Move verdantadmin app to django-wagtail package
0
wagtail/wagtailadmin/__init__.py
Normal file
639
wagtail/wagtailadmin/edit_handlers.py
Normal file
|
|
@ -0,0 +1,639 @@
|
|||
from django.template.loader import render_to_string
|
||||
from django.template.defaultfilters import addslashes
|
||||
from django.utils.safestring import mark_safe
|
||||
from django import forms
|
||||
from django.db import models
|
||||
from django.forms.models import fields_for_model
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured, ValidationError
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
import copy
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailcore.util import camelcase_to_underscore
|
||||
from wagtail.wagtailcore.fields import RichTextArea
|
||||
from cluster.forms import ClusterForm, ClusterFormMetaclass
|
||||
from taggit.forms import TagWidget
|
||||
|
||||
import re
|
||||
import datetime
|
||||
|
||||
|
||||
class FriendlyDateInput(forms.DateInput):
|
||||
"""
|
||||
A custom DateInput widget that formats dates as "05 Oct 2013"
|
||||
and adds class="friendly_date" to be picked up by jquery datepicker.
|
||||
"""
|
||||
def __init__(self, attrs=None):
|
||||
default_attrs = {'class': 'friendly_date'}
|
||||
if attrs:
|
||||
default_attrs.update(attrs)
|
||||
|
||||
super(FriendlyDateInput, self).__init__(attrs=default_attrs, format='%d %b %Y')
|
||||
|
||||
|
||||
class FriendlyTimeInput(forms.TimeInput):
|
||||
"""
|
||||
A custom TimeInput widget that formats dates as "5.30pm"
|
||||
and adds class="friendly_time" to be picked up by jquery timepicker.
|
||||
"""
|
||||
def __init__(self, attrs=None):
|
||||
default_attrs = {'class': 'friendly_time'}
|
||||
if attrs:
|
||||
default_attrs.update(attrs)
|
||||
|
||||
super(FriendlyTimeInput, self).__init__(attrs=default_attrs, format='%I.%M%p')
|
||||
|
||||
|
||||
class FriendlyTimeField(forms.CharField):
|
||||
def to_python(self, time_string):
|
||||
# Check if the string is blank
|
||||
if not time_string:
|
||||
return None
|
||||
|
||||
# Look for time in the string
|
||||
expr = re.compile("^(?P<hour>\d+)(?:(?:.|:)(?P<minute>\d+))?(?P<am_pm>am|pm)")
|
||||
match = expr.match(time_string.lower())
|
||||
if match:
|
||||
# Pull out values from string
|
||||
hour_string, minute_string, am_pm = match.groups()
|
||||
|
||||
# Convert hours and minutes to integers
|
||||
hour = int(hour_string)
|
||||
if minute_string:
|
||||
minute = int(minute_string)
|
||||
else:
|
||||
minute = 0
|
||||
|
||||
# Create python time
|
||||
if am_pm == "pm" and hour < 12:
|
||||
hour += 12
|
||||
|
||||
if am_pm == "am" and hour >= 12:
|
||||
hour -= 12
|
||||
|
||||
return datetime.time(hour=hour, minute=minute)
|
||||
else:
|
||||
raise ValidationError("Please type a valid time")
|
||||
|
||||
|
||||
FORM_FIELD_OVERRIDES = {
|
||||
models.DateField: {'widget': FriendlyDateInput},
|
||||
models.TimeField: {'widget': FriendlyTimeInput, 'form_class': FriendlyTimeField},
|
||||
}
|
||||
|
||||
WIDGET_JS = {
|
||||
FriendlyDateInput: (lambda id: "initDateChooser(fixPrefix('%s'));" % id),
|
||||
FriendlyTimeInput: (lambda id: "initTimeChooser(fixPrefix('%s'));" % id),
|
||||
RichTextArea: (lambda id: "makeRichTextEditable(fixPrefix('%s'));" % id),
|
||||
TagWidget: (
|
||||
lambda id: "initTagField(fixPrefix('%s'), '%s');" % (
|
||||
id, addslashes(reverse('wagtailadmin_tag_autocomplete'))
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
# Callback to allow us to override the default form fields provided for each model field.
|
||||
def formfield_for_dbfield(db_field, **kwargs):
|
||||
# snarfed from django/contrib/admin/options.py
|
||||
|
||||
# If we've got overrides for the formfield defined, use 'em. **kwargs
|
||||
# passed to formfield_for_dbfield override the defaults.
|
||||
for klass in db_field.__class__.mro():
|
||||
if klass in FORM_FIELD_OVERRIDES:
|
||||
kwargs = dict(copy.deepcopy(FORM_FIELD_OVERRIDES[klass]), **kwargs)
|
||||
return db_field.formfield(**kwargs)
|
||||
|
||||
# For any other type of field, just call its formfield() method.
|
||||
return db_field.formfield(**kwargs)
|
||||
|
||||
|
||||
class VerdantAdminModelFormMetaclass(ClusterFormMetaclass):
|
||||
# Override the behaviour of the regular ModelForm metaclass -
|
||||
# which handles the translation of model fields to form fields -
|
||||
# to use our own formfield_for_dbfield function to do that translation.
|
||||
# This is done by sneaking a formfield_callback property into the class
|
||||
# being defined (unless the class already provides a formfield_callback
|
||||
# of its own).
|
||||
|
||||
# while we're at it, we'll also set extra_form_count to 0, as we're creating
|
||||
# extra forms in JS
|
||||
extra_form_count = 0
|
||||
|
||||
def __new__(cls, name, bases, attrs):
|
||||
if 'formfield_callback' not in attrs or attrs['formfield_callback'] is None:
|
||||
attrs['formfield_callback'] = formfield_for_dbfield
|
||||
|
||||
new_class = super(VerdantAdminModelFormMetaclass, cls).__new__(cls, name, bases, attrs)
|
||||
return new_class
|
||||
|
||||
VerdantAdminModelForm = VerdantAdminModelFormMetaclass('VerdantAdminModelForm', (ClusterForm,), {})
|
||||
|
||||
# Now, any model forms built off VerdantAdminModelForm instead of ModelForm should pick up
|
||||
# the nice form fields defined in FORM_FIELD_OVERRIDES.
|
||||
|
||||
|
||||
def get_form_for_model(model, fields=None, exclude=None, formsets=None, exclude_formsets=None,
|
||||
widgets=None):
|
||||
|
||||
# django's modelform_factory with a bit of custom behaviour
|
||||
# (dealing with Treebeard's tree-related fields that really should have
|
||||
# been editable=False)
|
||||
attrs = {'model': model}
|
||||
|
||||
if fields is not None:
|
||||
attrs['fields'] = fields
|
||||
|
||||
if exclude is not None:
|
||||
attrs['exclude'] = exclude
|
||||
if issubclass(model, Page):
|
||||
attrs['exclude'] = attrs.get('exclude', []) + ['content_type', 'path', 'depth', 'numchild']
|
||||
|
||||
if widgets is not None:
|
||||
attrs['widgets'] = widgets
|
||||
|
||||
if formsets is not None:
|
||||
attrs['formsets'] = formsets
|
||||
|
||||
if exclude_formsets is not None:
|
||||
attrs['exclude_formsets'] = exclude_formsets
|
||||
|
||||
# Give this new form class a reasonable name.
|
||||
class_name = model.__name__ + str('Form')
|
||||
form_class_attrs = {
|
||||
'Meta': type('Meta', (object,), attrs)
|
||||
}
|
||||
|
||||
return VerdantAdminModelFormMetaclass(class_name, (VerdantAdminModelForm,), form_class_attrs)
|
||||
|
||||
|
||||
def extract_panel_definitions_from_model_class(model, exclude=None):
|
||||
if hasattr(model, 'panels'):
|
||||
return model.panels
|
||||
|
||||
panels = []
|
||||
|
||||
_exclude = []
|
||||
if exclude:
|
||||
_exclude.extend(exclude)
|
||||
if issubclass(model, Page):
|
||||
_exclude = ['content_type', 'path', 'depth', 'numchild']
|
||||
|
||||
fields = fields_for_model(model, exclude=_exclude, formfield_callback=formfield_for_dbfield)
|
||||
|
||||
for field_name, field in fields.items():
|
||||
try:
|
||||
panel_class = field.widget.get_panel()
|
||||
except AttributeError:
|
||||
panel_class = FieldPanel
|
||||
|
||||
panel = panel_class(field_name)
|
||||
panels.append(panel)
|
||||
|
||||
return panels
|
||||
|
||||
|
||||
class EditHandler(object):
|
||||
"""
|
||||
Abstract class providing sensible default behaviours for objects implementing
|
||||
the EditHandler API
|
||||
"""
|
||||
|
||||
# return list of widget overrides that this EditHandler wants to be in place
|
||||
# on the form it receives
|
||||
@classmethod
|
||||
def widget_overrides(cls):
|
||||
return {}
|
||||
|
||||
# return list of formset names that this EditHandler requires to be present
|
||||
# as children of the ClusterForm
|
||||
@classmethod
|
||||
def required_formsets(cls):
|
||||
return []
|
||||
|
||||
# the top-level edit handler is responsible for providing a form class that can produce forms
|
||||
# acceptable to the edit handler
|
||||
_form_class = None
|
||||
@classmethod
|
||||
def get_form_class(cls, model):
|
||||
if cls._form_class is None:
|
||||
cls._form_class = get_form_for_model(model,
|
||||
formsets=cls.required_formsets(), widgets=cls.widget_overrides())
|
||||
return cls._form_class
|
||||
|
||||
def __init__(self, instance=None, form=None):
|
||||
if not instance:
|
||||
raise ValueError("EditHandler did not receive an instance object")
|
||||
self.instance = instance
|
||||
|
||||
if not form:
|
||||
raise ValueError("EditHandler did not receive a form object")
|
||||
self.form = form
|
||||
|
||||
|
||||
# Heading / help text to display to the user
|
||||
heading = ""
|
||||
help_text = ""
|
||||
|
||||
def object_classnames(self):
|
||||
"""
|
||||
Additional classnames to add to the <li class="object"> when rendering this
|
||||
within an ObjectList
|
||||
"""
|
||||
return ""
|
||||
|
||||
def field_classnames(self):
|
||||
"""
|
||||
Additional classnames to add to the <li> when rendering this within a
|
||||
<ul class="fields">
|
||||
"""
|
||||
return ""
|
||||
|
||||
|
||||
def field_type(self):
|
||||
"""
|
||||
The kind of field it is e.g boolean_field. Useful for better semantic markup of field display based on type
|
||||
"""
|
||||
return ""
|
||||
|
||||
def render_as_object(self):
|
||||
"""
|
||||
Render this object as it should appear within an ObjectList. Should not
|
||||
include the <h2> heading or help text - ObjectList will supply those
|
||||
"""
|
||||
# by default, assume that the subclass provides a catch-all render() method
|
||||
return self.render()
|
||||
|
||||
def render_as_field(self):
|
||||
"""
|
||||
Render this object as it should appear within a <ul class="fields"> list item
|
||||
"""
|
||||
# by default, assume that the subclass provides a catch-all render() method
|
||||
return self.render()
|
||||
|
||||
def render_js(self):
|
||||
"""
|
||||
Render a snippet of Javascript code to be executed when this object's rendered
|
||||
HTML is inserted into the DOM. (This won't necessarily happen on page load...)
|
||||
"""
|
||||
return ""
|
||||
|
||||
def rendered_fields(self):
|
||||
"""
|
||||
return a list of the fields of the passed form which are rendered by this
|
||||
EditHandler.
|
||||
"""
|
||||
return []
|
||||
|
||||
def render_missing_fields(self):
|
||||
"""
|
||||
Helper function: render all of the fields of the form that are not accounted for
|
||||
in rendered_fields
|
||||
"""
|
||||
rendered_fields = self.rendered_fields()
|
||||
missing_fields_html = [
|
||||
unicode(self.form[field_name])
|
||||
for field_name in self.form.fields
|
||||
if field_name not in rendered_fields
|
||||
]
|
||||
|
||||
return mark_safe(u''.join(missing_fields_html))
|
||||
|
||||
def render_form_content(self):
|
||||
"""
|
||||
Render this as an 'object', along with any unaccounted-for fields to make this
|
||||
a valid submittable form
|
||||
"""
|
||||
return mark_safe(self.render_as_object() + self.render_missing_fields())
|
||||
|
||||
|
||||
class BaseCompositeEditHandler(EditHandler):
|
||||
"""
|
||||
Abstract class for EditHandlers that manage a set of sub-EditHandlers.
|
||||
Concrete subclasses must attach a 'children' property
|
||||
"""
|
||||
_widget_overrides = None
|
||||
@classmethod
|
||||
def widget_overrides(cls):
|
||||
if cls._widget_overrides is None:
|
||||
# build a collated version of all its children's widget lists
|
||||
widgets = {}
|
||||
for handler_class in cls.children:
|
||||
widgets.update(handler_class.widget_overrides())
|
||||
cls._widget_overrides = widgets
|
||||
|
||||
return cls._widget_overrides
|
||||
|
||||
_required_formsets = None
|
||||
@classmethod
|
||||
def required_formsets(cls):
|
||||
if cls._required_formsets is None:
|
||||
formsets = []
|
||||
for handler_class in cls.children:
|
||||
formsets.extend(handler_class.required_formsets())
|
||||
cls._required_formsets = formsets
|
||||
|
||||
return cls._required_formsets
|
||||
|
||||
def __init__(self, instance=None, form=None):
|
||||
super(BaseCompositeEditHandler, self).__init__(instance=instance, form=form)
|
||||
|
||||
self.children = [
|
||||
handler_class(instance=self.instance, form=self.form)
|
||||
for handler_class in self.__class__.children
|
||||
]
|
||||
|
||||
def render(self):
|
||||
return mark_safe(render_to_string(self.template, {
|
||||
'self': self
|
||||
}))
|
||||
|
||||
def render_js(self):
|
||||
return mark_safe(u'\n'.join([handler.render_js() for handler in self.children]))
|
||||
|
||||
def rendered_fields(self):
|
||||
result = []
|
||||
for handler in self.children:
|
||||
result += handler.rendered_fields()
|
||||
|
||||
return result
|
||||
|
||||
class BaseTabbedInterface(BaseCompositeEditHandler):
|
||||
template = "wagtailadmin/edit_handlers/tabbed_interface.html"
|
||||
|
||||
def TabbedInterface(children):
|
||||
return type('_TabbedInterface', (BaseTabbedInterface,), {'children': children})
|
||||
|
||||
|
||||
class BaseObjectList(BaseCompositeEditHandler):
|
||||
template = "wagtailadmin/edit_handlers/object_list.html"
|
||||
|
||||
def ObjectList(children, heading=""):
|
||||
return type('_ObjectList', (BaseObjectList,), {
|
||||
'children': children,
|
||||
'heading': heading,
|
||||
})
|
||||
|
||||
|
||||
class BaseMultiFieldPanel(BaseCompositeEditHandler):
|
||||
template = "wagtailadmin/edit_handlers/multi_field_panel.html"
|
||||
|
||||
def MultiFieldPanel(children, heading=""):
|
||||
return type('_MultiFieldPanel', (BaseMultiFieldPanel,), {
|
||||
'children': children,
|
||||
'heading': heading,
|
||||
})
|
||||
|
||||
|
||||
class BaseFieldPanel(EditHandler):
|
||||
def __init__(self, instance=None, form=None):
|
||||
super(BaseFieldPanel, self).__init__(instance=instance, form=form)
|
||||
self.bound_field = self.form[self.field_name]
|
||||
|
||||
self.heading = self.bound_field.label
|
||||
self.help_text = self.bound_field.help_text
|
||||
|
||||
def object_classnames(self):
|
||||
try:
|
||||
return "single-field " + self.classname
|
||||
except (AttributeError, TypeError):
|
||||
return "single-field"
|
||||
|
||||
def field_type(self):
|
||||
return camelcase_to_underscore(self.bound_field.field.__class__.__name__)
|
||||
|
||||
def field_classnames(self):
|
||||
classname = self.field_type()
|
||||
if self.bound_field.field.required:
|
||||
classname += " required"
|
||||
if self.bound_field.errors:
|
||||
classname += " error"
|
||||
|
||||
return classname
|
||||
|
||||
object_template = "wagtailadmin/edit_handlers/field_panel_object.html"
|
||||
def render_as_object(self):
|
||||
return mark_safe(render_to_string(self.object_template, {
|
||||
'self': self,
|
||||
'field_content': self.render_as_field(show_help_text=False),
|
||||
}))
|
||||
|
||||
def render_js(self):
|
||||
try:
|
||||
# see if there's an entry for this widget type in WIDGET_JS
|
||||
js_func = WIDGET_JS[self.bound_field.field.widget.__class__]
|
||||
except KeyError:
|
||||
return ''
|
||||
|
||||
return mark_safe(js_func(self.bound_field.id_for_label))
|
||||
|
||||
|
||||
field_template = "wagtailadmin/edit_handlers/field_panel_field.html"
|
||||
def render_as_field(self, show_help_text=True):
|
||||
return mark_safe(render_to_string(self.field_template, {
|
||||
'field': self.bound_field,
|
||||
'field_type': self.field_type(),
|
||||
'show_help_text': show_help_text,
|
||||
}))
|
||||
|
||||
def rendered_fields(self):
|
||||
return [self.field_name]
|
||||
|
||||
def FieldPanel(field_name, classname=None):
|
||||
return type('_FieldPanel', (BaseFieldPanel,), {
|
||||
'field_name': field_name,
|
||||
'classname': classname,
|
||||
})
|
||||
|
||||
|
||||
class BaseRichTextFieldPanel(BaseFieldPanel):
|
||||
def render_js(self):
|
||||
return mark_safe("makeRichTextEditable(fixPrefix('%s'));" % self.bound_field.id_for_label)
|
||||
|
||||
def RichTextFieldPanel(field_name):
|
||||
return type('_RichTextFieldPanel', (BaseRichTextFieldPanel,), {
|
||||
'field_name': field_name,
|
||||
})
|
||||
|
||||
|
||||
class BaseChooserPanel(BaseFieldPanel):
|
||||
"""
|
||||
Abstract superclass for panels that provide a modal interface for choosing (or creating)
|
||||
a database object such as an image, resulting in an ID that is used to populate
|
||||
a hidden foreign key input.
|
||||
|
||||
Subclasses provide:
|
||||
* field_template
|
||||
* object_type_name - something like 'image' which will be used as the var name
|
||||
for the object instance in the field_template
|
||||
* js_function_name - a JS function responsible for the modal workflow; this receives
|
||||
the ID of the hidden field as a parameter, and should ultimately populate that field
|
||||
with the appropriate object ID. If the function requires any other parameters, the
|
||||
subclass will need to override render_js instead.
|
||||
"""
|
||||
@classmethod
|
||||
def widget_overrides(cls):
|
||||
return {cls.field_name: forms.HiddenInput}
|
||||
|
||||
def get_chosen_item(self):
|
||||
try:
|
||||
return getattr(self.instance, self.field_name)
|
||||
except ObjectDoesNotExist:
|
||||
# if the ForeignKey is null=False, Django decides to raise
|
||||
# a DoesNotExist exception here, rather than returning None
|
||||
# like every other unpopulated field type. Yay consistency!
|
||||
return None
|
||||
|
||||
def render_as_field(self, show_help_text=True):
|
||||
instance_obj = self.get_chosen_item()
|
||||
return mark_safe(render_to_string(self.field_template, {
|
||||
'field': self.bound_field,
|
||||
self.object_type_name: instance_obj,
|
||||
'is_chosen': bool(instance_obj),
|
||||
'show_help_text': show_help_text,
|
||||
}))
|
||||
|
||||
def render_js(self):
|
||||
return mark_safe("%s(fixPrefix('%s'));" % (self.js_function_name, self.bound_field.id_for_label))
|
||||
|
||||
class BasePageChooserPanel(BaseChooserPanel):
|
||||
field_template = "wagtailadmin/edit_handlers/page_chooser_panel.html"
|
||||
object_type_name = "page"
|
||||
|
||||
_target_content_type = None
|
||||
@classmethod
|
||||
def target_content_type(cls):
|
||||
if cls._target_content_type is None:
|
||||
if cls.page_type:
|
||||
if isinstance(cls.page_type, basestring):
|
||||
# translate the passed model name into an actual model class
|
||||
from django.db.models import get_model
|
||||
try:
|
||||
app_label, model_name = cls.page_type.split('.')
|
||||
except ValueError:
|
||||
raise ImproperlyConfigured("The page_type passed to PageChooserPanel must be of the form 'app_label.model_name'")
|
||||
|
||||
page_type = get_model(app_label, model_name)
|
||||
if page_type is None:
|
||||
raise ImproperlyConfigured("PageChooserPanel refers to model '%s' that has not been installed" % cls.page_type)
|
||||
else:
|
||||
page_type = cls.page_type
|
||||
|
||||
cls._target_content_type = ContentType.objects.get_for_model(page_type)
|
||||
else:
|
||||
# TODO: infer the content type by introspection on the foreign key
|
||||
cls._target_content_type = ContentType.objects.get_by_natural_key('wagtailcore', 'page')
|
||||
|
||||
return cls._target_content_type
|
||||
|
||||
def render_js(self):
|
||||
page = getattr(self.instance, self.field_name)
|
||||
parent = page.get_parent() if page else None
|
||||
content_type = self.__class__.target_content_type()
|
||||
|
||||
return mark_safe("createPageChooser(fixPrefix('%s'), '%s.%s', %s);" % (
|
||||
self.bound_field.id_for_label,
|
||||
content_type.app_label,
|
||||
content_type.model,
|
||||
(parent.id if parent else 'null'),
|
||||
))
|
||||
|
||||
def PageChooserPanel(field_name, page_type=None):
|
||||
return type('_PageChooserPanel', (BasePageChooserPanel,), {
|
||||
'field_name': field_name,
|
||||
'page_type': page_type,
|
||||
})
|
||||
|
||||
|
||||
class BaseInlinePanel(EditHandler):
|
||||
@classmethod
|
||||
def get_panel_definitions(cls):
|
||||
# Look for a panels definition in the InlinePanel declaration
|
||||
if cls.panels is not None:
|
||||
return cls.panels
|
||||
# Failing that, get it from the model
|
||||
else:
|
||||
return extract_panel_definitions_from_model_class(cls.related.model, exclude=[cls.related.field.name])
|
||||
|
||||
_child_edit_handler_class = None
|
||||
@classmethod
|
||||
def get_child_edit_handler_class(cls):
|
||||
if cls._child_edit_handler_class is None:
|
||||
panels = cls.get_panel_definitions()
|
||||
cls._child_edit_handler_class = MultiFieldPanel(panels, heading=cls.heading)
|
||||
|
||||
return cls._child_edit_handler_class
|
||||
|
||||
@classmethod
|
||||
def required_formsets(cls):
|
||||
return [cls.relation_name]
|
||||
|
||||
@classmethod
|
||||
def widget_overrides(cls):
|
||||
overrides = cls.get_child_edit_handler_class().widget_overrides()
|
||||
if overrides:
|
||||
return {cls.relation_name: overrides}
|
||||
else:
|
||||
return {}
|
||||
|
||||
|
||||
def __init__(self, instance=None, form=None):
|
||||
super(BaseInlinePanel, self).__init__(instance=instance, form=form)
|
||||
|
||||
self.formset = form.formsets[self.__class__.relation_name]
|
||||
|
||||
child_edit_handler_class = self.__class__.get_child_edit_handler_class()
|
||||
self.children = []
|
||||
for subform in self.formset.forms:
|
||||
# override the DELETE field to have a hidden input
|
||||
subform.fields['DELETE'].widget = forms.HiddenInput()
|
||||
|
||||
# ditto for the ORDER field, if present
|
||||
if self.formset.can_order:
|
||||
subform.fields['ORDER'].widget = forms.HiddenInput()
|
||||
|
||||
self.children.append(
|
||||
child_edit_handler_class(instance=subform.instance, form=subform)
|
||||
)
|
||||
|
||||
empty_form = self.formset.empty_form
|
||||
empty_form.fields['DELETE'].widget = forms.HiddenInput()
|
||||
if self.formset.can_order:
|
||||
empty_form.fields['ORDER'].widget = forms.HiddenInput()
|
||||
|
||||
self.empty_child = child_edit_handler_class(instance=empty_form.instance, form=empty_form)
|
||||
|
||||
template = "wagtailadmin/edit_handlers/inline_panel.html"
|
||||
def render(self):
|
||||
return mark_safe(render_to_string(self.template, {
|
||||
'self': self,
|
||||
'can_order': self.formset.can_order,
|
||||
}))
|
||||
|
||||
js_template = "wagtailadmin/edit_handlers/inline_panel.js"
|
||||
def render_js(self):
|
||||
return mark_safe(render_to_string(self.js_template, {
|
||||
'self': self,
|
||||
'can_order': self.formset.can_order,
|
||||
}))
|
||||
|
||||
def InlinePanel(base_model, relation_name, panels=None, label='', help_text=''):
|
||||
rel = getattr(base_model, relation_name).related
|
||||
return type('_InlinePanel', (BaseInlinePanel,), {
|
||||
'relation_name': relation_name,
|
||||
'related': rel,
|
||||
'panels': panels,
|
||||
'heading': label,
|
||||
'help_text': help_text, # TODO: can we pick this out of the foreign key definition as an alternative? (with a bit of help from the inlineformset object, as we do for label/heading)
|
||||
})
|
||||
|
||||
|
||||
# Now that we've defined EditHandlers, we can set up wagtailcore.Page to have some.
|
||||
Page.content_panels = [
|
||||
FieldPanel('title'),
|
||||
FieldPanel('slug'),
|
||||
]
|
||||
Page.promote_panels = [
|
||||
]
|
||||
30
wagtail/wagtailadmin/forms.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
|
||||
class SearchForm(forms.Form):
|
||||
q = forms.CharField(label="Search term")
|
||||
|
||||
|
||||
class ExternalLinkChooserForm(forms.Form):
|
||||
url = forms.URLField(required=True)
|
||||
|
||||
class ExternalLinkChooserWithLinkTextForm(forms.Form):
|
||||
url = forms.URLField(required=True)
|
||||
link_text = forms.CharField(required=True)
|
||||
|
||||
class EmailLinkChooserForm(forms.Form):
|
||||
email_address = forms.EmailField(required=True)
|
||||
|
||||
class EmailLinkChooserWithLinkTextForm(forms.Form):
|
||||
email_address = forms.EmailField(required=True)
|
||||
link_text = forms.CharField(required=False)
|
||||
|
||||
|
||||
class LoginForm(AuthenticationForm):
|
||||
username = forms.CharField(
|
||||
max_length=254,
|
||||
widget=forms.TextInput(attrs={'placeholder': "Enter your username"}),
|
||||
)
|
||||
password = forms.CharField(
|
||||
widget=forms.PasswordInput(attrs={'placeholder': "Enter password"}),
|
||||
)
|
||||
31
wagtail/wagtailadmin/hooks.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from django.conf import settings
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
_hooks = {}
|
||||
|
||||
# TODO: support 'register' as a decorator:
|
||||
# @hooks.register('construct_main_menu')
|
||||
# def construct_main_menu(menu_items):
|
||||
# ...
|
||||
|
||||
def register(hook_name, fn):
|
||||
if hook_name not in _hooks:
|
||||
_hooks[hook_name] = []
|
||||
_hooks[hook_name].append(fn)
|
||||
|
||||
_searched_for_hooks = False
|
||||
def search_for_hooks():
|
||||
global _searched_for_hooks
|
||||
if not _searched_for_hooks:
|
||||
for app_module in settings.INSTALLED_APPS:
|
||||
try:
|
||||
import_module('%s.verdant_hooks' % app_module)
|
||||
except ImportError:
|
||||
continue
|
||||
|
||||
_searched_for_hooks = True
|
||||
|
||||
|
||||
def get_hooks(hook_name):
|
||||
search_for_hooks()
|
||||
return _hooks.get(hook_name, [])
|
||||
14
wagtail/wagtailadmin/menu.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from django.utils.text import slugify
|
||||
from django.utils.html import format_html
|
||||
|
||||
class MenuItem(object):
|
||||
def __init__(self, label, url, name=None, classnames='', order=1000):
|
||||
self.label = label
|
||||
self.url = url
|
||||
self.classnames = classnames
|
||||
self.name = (name or slugify(unicode(label)))
|
||||
self.order = order
|
||||
|
||||
def render_html(self):
|
||||
return format_html(u"""<li class="menu-{0}"><a href="{1}" class="{2}">{3}</a></li>""",
|
||||
self.name, self.url, self.classnames, self.label)
|
||||
25
wagtail/wagtailadmin/modal_workflow.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from django.http import HttpResponse
|
||||
from django.template import RequestContext
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
import json
|
||||
|
||||
def render_modal_workflow(request, html_template, js_template, template_vars={}):
|
||||
""""
|
||||
Render a response consisting of an HTML chunk and a JS onload chunk
|
||||
in the format required by the modal-workflow framework.
|
||||
"""
|
||||
response_keyvars = []
|
||||
context = RequestContext(request)
|
||||
|
||||
if html_template:
|
||||
html = render_to_string(html_template, template_vars, context)
|
||||
response_keyvars.append("'html': %s" % json.dumps(html))
|
||||
|
||||
if js_template:
|
||||
js = render_to_string(js_template, template_vars, context)
|
||||
response_keyvars.append("'onload': %s" % js)
|
||||
|
||||
response_text = "{%s}" % ','.join(response_keyvars)
|
||||
|
||||
return HttpResponse(response_text, mimetype="text/javascript")
|
||||
3
wagtail/wagtailadmin/models.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
.dropdown{
|
||||
position:relative;
|
||||
.clearfix();
|
||||
|
||||
.dropdown-toggle{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
ul{
|
||||
.unlist();
|
||||
background-color:@color-teal;
|
||||
position:absolute;
|
||||
overflow:hidden;
|
||||
top:100%;
|
||||
left:-2000px;
|
||||
z-index:500;
|
||||
opacity:0;
|
||||
|
||||
li{
|
||||
float:none;
|
||||
border-top:1px solid rgba(255,255,255,0.2);
|
||||
}
|
||||
li:first-child{
|
||||
border-top:0;
|
||||
}
|
||||
|
||||
a{
|
||||
box-sizing:border-box;
|
||||
white-space: nowrap;
|
||||
position:relative;
|
||||
text-decoration:none;
|
||||
text-transform:uppercase;
|
||||
display:block;
|
||||
color:white;
|
||||
padding:1em;
|
||||
font-weight:normal;
|
||||
|
||||
&:hover{
|
||||
background-color:@color-teal-darker;
|
||||
}
|
||||
&.icon{
|
||||
padding-right:5em;
|
||||
|
||||
&:before,
|
||||
&:after{
|
||||
right:1em;
|
||||
}
|
||||
}
|
||||
&.shortcut{
|
||||
padding-right:7em;
|
||||
}
|
||||
}
|
||||
|
||||
a, input[type=submit], input[type=reset], input[type=button], .button, button{
|
||||
font-size:0.95em;
|
||||
-webkit-font-smoothing: auto;
|
||||
}
|
||||
|
||||
label{
|
||||
padding:1.3em;
|
||||
}
|
||||
|
||||
.kbd{
|
||||
position:absolute;
|
||||
right:1em;
|
||||
font-weight:600;
|
||||
font-size:0.8em;
|
||||
color:rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.open ul{
|
||||
.box-shadow(0px 3px 3px 0 rgba(0,0,0,0.2));
|
||||
opacity:1;
|
||||
left:0;
|
||||
display:block;
|
||||
}
|
||||
|
||||
&.match-width ul{
|
||||
width:100%;
|
||||
min-width:110px;
|
||||
|
||||
li{
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.dropup ul{
|
||||
.box-shadow(0px -3px 3px 0 rgba(0,0,0,0.2));
|
||||
top:auto;
|
||||
bottom:100%;
|
||||
}
|
||||
|
||||
input[type=button], input[type=submit], button{
|
||||
padding:1em 0;
|
||||
.border-radius(0);
|
||||
display:block;
|
||||
width:100%;
|
||||
text-align:left;
|
||||
padding-left:1em;
|
||||
}
|
||||
|
||||
.button{
|
||||
float:left;
|
||||
|
||||
&:hover{
|
||||
background-color:@color-teal-darker;
|
||||
}
|
||||
}
|
||||
|
||||
& > .button + .dropdown-toggle{
|
||||
border-left:1px solid rgba(255,255,255,0.2);
|
||||
position:absolute;
|
||||
right:0;
|
||||
height:100%;
|
||||
padding:0 0.5em;
|
||||
text-align:center;
|
||||
|
||||
&:before{
|
||||
width:1em;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
background-color:@color-teal-darker;
|
||||
}
|
||||
}
|
||||
&.open > .button + .dropdown-toggle{
|
||||
background-color:@color-teal-darker;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown.white{
|
||||
ul{
|
||||
background-color:white;
|
||||
|
||||
li{
|
||||
border-top:1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
a{
|
||||
color:@color-grey-2;
|
||||
|
||||
&:hover{
|
||||
background-color:@color-grey-3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h2 .dropdown{
|
||||
display:inline-block;
|
||||
font-size:0.7em;
|
||||
margin-right:0.5em;
|
||||
vertical-align:middle;
|
||||
|
||||
.dropdown-toggle{
|
||||
padding:0.5em 0;
|
||||
border-right:1px solid @color-grey-3;
|
||||
|
||||
/* icon */
|
||||
&:before{
|
||||
opacity:0.5;
|
||||
padding:0.2em;
|
||||
height:1.1em;
|
||||
text-align:left;
|
||||
}
|
||||
&:hover{
|
||||
background-color:@color-teal;
|
||||
border-color:transparent;
|
||||
}
|
||||
}
|
||||
&.open{
|
||||
.dropdown-toggle{
|
||||
background-color:@color-teal;
|
||||
}
|
||||
|
||||
ul{
|
||||
left:auto;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-toggle:hover{
|
||||
background-color:@color-grey-3;
|
||||
&:before{
|
||||
color:white;
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
&.open .dropdown-toggle:before{
|
||||
background-color:@color-teal;
|
||||
color:white;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
footer .actions .dropdown-toggle{
|
||||
text-transform:uppercase;
|
||||
background-color:@color-teal;
|
||||
line-height:3em;
|
||||
color:white;
|
||||
padding-left:1em;
|
||||
padding-right:1em;
|
||||
|
||||
&:before,
|
||||
&:after{
|
||||
right:1em !important;
|
||||
}
|
||||
}
|
||||
|
||||
footer .actions .dropdown ul li{
|
||||
border-bottom:1px solid rgba(255,255,255,0.2);
|
||||
border-top:0;
|
||||
}
|
||||
|
||||
|
||||
/* Transitions */
|
||||
.dropdown ul{
|
||||
.transition(opacity 0.2s linear);
|
||||
}
|
||||
|
|
@ -0,0 +1,924 @@
|
|||
/*
|
||||
min z-index: 500;
|
||||
max z-index: unknown;
|
||||
*/
|
||||
|
||||
|
||||
@explorer-z-index:500;
|
||||
|
||||
.explorer {
|
||||
pointer-events:none;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
top:0;
|
||||
left:0;
|
||||
display:none;
|
||||
-webkit-perspective: 1000px;
|
||||
-moz-perspective: 1000px;
|
||||
perspective: 1000px;
|
||||
-webkit-perspective-origin: 50% 200%;
|
||||
-moz-perspective-origin: 50% 200%;
|
||||
perspective-origin: 50% 200%;
|
||||
ul {
|
||||
background: @color-grey-1;
|
||||
padding: 0;
|
||||
margin:0;
|
||||
list-style: none;
|
||||
-webkit-transform-style: preserve-3d;
|
||||
-moz-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
border-top:1px solid @color-grey-1-1;
|
||||
|
||||
&:first-child{
|
||||
border-top:0;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration:none;
|
||||
padding:0.9em;
|
||||
color:white;
|
||||
display: block;
|
||||
position: relative;
|
||||
outline: none;
|
||||
white-space: nowrap;
|
||||
text-overflow:ellipsis;
|
||||
overflow:hidden;
|
||||
|
||||
&:before{
|
||||
opacity:0.5;
|
||||
left:1em;
|
||||
|
||||
}
|
||||
|
||||
&:hover{
|
||||
background:@color-teal;
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
.has-children a{
|
||||
padding-right:5em;
|
||||
}
|
||||
|
||||
|
||||
.children{
|
||||
position:absolute;
|
||||
z-index:@explorer-z-index + 1;
|
||||
right:0;
|
||||
top:0;
|
||||
width:4em;
|
||||
text-align:center;
|
||||
height:100%;
|
||||
color:white;
|
||||
background-color:@color-grey-1;
|
||||
cursor:pointer;
|
||||
border-left:1px solid rgba(255,255,255,0.2);
|
||||
|
||||
&:before{
|
||||
padding:0.55em 0;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
background:@color-teal
|
||||
}
|
||||
}
|
||||
.dl-subviewopen > .children,
|
||||
.dl-subview > .children{
|
||||
display:none;
|
||||
}
|
||||
|
||||
/*.no-touch .explorer li a:hover {
|
||||
background: rgba(255,248,213,0.1);
|
||||
}*/
|
||||
|
||||
li.dl-back a {
|
||||
/* .icon.arrow-left;*/
|
||||
|
||||
}
|
||||
|
||||
li.dl-back:after {
|
||||
|
||||
}
|
||||
|
||||
li > a:after {
|
||||
|
||||
}
|
||||
|
||||
.dl-menu {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
|
||||
&.dl-menuopen {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide the inner submenus */
|
||||
li .dl-submenu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
When a submenu is openend, we will hide all li siblings.
|
||||
For that we give a class to the parent menu called "dl-subview".
|
||||
We also hide the submenu link.
|
||||
The opened submenu will get the class "dl-subviewopen".
|
||||
All this is done for any sub-level being entered.
|
||||
*/
|
||||
.dl-menu.dl-subview li,
|
||||
.dl-menu.dl-subview li.dl-subviewopen > a,
|
||||
.dl-menu.dl-subview li.dl-subview > a {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dl-menu.dl-subview li.dl-subview,
|
||||
.dl-menu.dl-subview li.dl-subview .dl-submenu,
|
||||
.dl-menu.dl-subview li.dl-subviewopen,
|
||||
.dl-menu.dl-subview li.dl-subviewopen > .dl-submenu,
|
||||
.dl-menu.dl-subview li.dl-subviewopen > .dl-submenu > li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Dynamically added submenu outside of the menu context */
|
||||
> .dl-submenu {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 0px;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Animation classes for moving out and in */
|
||||
|
||||
.dl-menu.dl-animate-out-1 {
|
||||
-webkit-animation: MenuAnimOut1 0.4s;
|
||||
-moz-animation: MenuAnimOut1 0.4s;
|
||||
animation: MenuAnimOut1 0.4s;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-out-2 {
|
||||
-webkit-animation: MenuAnimOut2 0.3s ease-in-out;
|
||||
-moz-animation: MenuAnimOut2 0.3s ease-in-out;
|
||||
animation: MenuAnimOut2 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-out-3 {
|
||||
-webkit-animation: MenuAnimOut3 0.4s ease;
|
||||
-moz-animation: MenuAnimOut3 0.4s ease;
|
||||
animation: MenuAnimOut3 0.4s ease;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-out-4 {
|
||||
-webkit-animation: MenuAnimOut4 0.4s ease;
|
||||
-moz-animation: MenuAnimOut4 0.4s ease;
|
||||
animation: MenuAnimOut4 0.4s ease;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-out-5 {
|
||||
-webkit-animation: MenuAnimOut5 0.4s ease;
|
||||
-moz-animation: MenuAnimOut5 0.4s ease;
|
||||
animation: MenuAnimOut5 0.4s ease;
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimOut1 {
|
||||
50% {
|
||||
-webkit-transform: translateZ(-250px) rotateY(30deg);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translateZ(-372.5px) rotateY(15deg);
|
||||
opacity: .5;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimOut2 {
|
||||
100% {
|
||||
-webkit-transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimOut3 {
|
||||
100% {
|
||||
-webkit-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimOut4 {
|
||||
100% {
|
||||
-webkit-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimOut5 {
|
||||
100% {
|
||||
-webkit-transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimOut1 {
|
||||
50% {
|
||||
-moz-transform: translateZ(-250px) rotateY(30deg);
|
||||
}
|
||||
75% {
|
||||
-moz-transform: translateZ(-372.5px) rotateY(15deg);
|
||||
opacity: .5;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimOut2 {
|
||||
100% {
|
||||
-moz-transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimOut3 {
|
||||
100% {
|
||||
-moz-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimOut4 {
|
||||
100% {
|
||||
-moz-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimOut5 {
|
||||
100% {
|
||||
-moz-transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimOut1 {
|
||||
50% {
|
||||
transform: translateZ(-250px) rotateY(30deg);
|
||||
}
|
||||
75% {
|
||||
transform: translateZ(-372.5px) rotateY(15deg);
|
||||
opacity: .5;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimOut2 {
|
||||
100% {
|
||||
transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimOut3 {
|
||||
100% {
|
||||
transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimOut4 {
|
||||
100% {
|
||||
transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimOut5 {
|
||||
100% {
|
||||
transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-in-1 {
|
||||
-webkit-animation: MenuAnimIn1 0.3s;
|
||||
-moz-animation: MenuAnimIn1 0.3s;
|
||||
animation: MenuAnimIn1 0.3s;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-in-2 {
|
||||
-webkit-animation: MenuAnimIn2 0.3s ease-in-out;
|
||||
-moz-animation: MenuAnimIn2 0.3s ease-in-out;
|
||||
animation: MenuAnimIn2 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-in-3 {
|
||||
-webkit-animation: MenuAnimIn3 0.4s ease;
|
||||
-moz-animation: MenuAnimIn3 0.4s ease;
|
||||
animation: MenuAnimIn3 0.4s ease;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-in-4 {
|
||||
-webkit-animation: MenuAnimIn4 0.4s ease;
|
||||
-moz-animation: MenuAnimIn4 0.4s ease;
|
||||
animation: MenuAnimIn4 0.4s ease;
|
||||
}
|
||||
|
||||
.dl-menu.dl-animate-in-5 {
|
||||
-webkit-animation: MenuAnimIn5 0.4s ease;
|
||||
-moz-animation: MenuAnimIn5 0.4s ease;
|
||||
animation: MenuAnimIn5 0.4s ease;
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimIn1 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
-webkit-transform: translateZ(-250px) rotateY(30deg);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0px) rotateY(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimIn2 {
|
||||
0% {
|
||||
-webkit-transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimIn3 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimIn4 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes MenuAnimIn5 {
|
||||
0% {
|
||||
-webkit-transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimIn1 {
|
||||
0% {
|
||||
-moz-transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
-moz-transform: translateZ(-250px) rotateY(30deg);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0px) rotateY(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimIn2 {
|
||||
0% {
|
||||
-moz-transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimIn3 {
|
||||
0% {
|
||||
-moz-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimIn4 {
|
||||
0% {
|
||||
-moz-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes MenuAnimIn5 {
|
||||
0% {
|
||||
-moz-transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimIn1 {
|
||||
0% {
|
||||
transform: translateZ(-500px) rotateY(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
transform: translateZ(-250px) rotateY(30deg);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0px) rotateY(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimIn2 {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimIn3 {
|
||||
0% {
|
||||
transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimIn4 {
|
||||
0% {
|
||||
transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes MenuAnimIn5 {
|
||||
0% {
|
||||
transform: translateY(40%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-in-1 {
|
||||
-webkit-animation: SubMenuAnimIn1 0.4s ease;
|
||||
-moz-animation: SubMenuAnimIn1 0.4s ease;
|
||||
animation: SubMenuAnimIn1 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-in-2 {
|
||||
-webkit-animation: SubMenuAnimIn2 0.3s ease-in-out;
|
||||
-moz-animation: SubMenuAnimIn2 0.3s ease-in-out;
|
||||
animation: SubMenuAnimIn2 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-in-3 {
|
||||
-webkit-animation: SubMenuAnimIn3 0.4s ease;
|
||||
-moz-animation: SubMenuAnimIn3 0.4s ease;
|
||||
animation: SubMenuAnimIn3 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-in-4 {
|
||||
-webkit-animation: SubMenuAnimIn4 0.4s ease;
|
||||
-moz-animation: SubMenuAnimIn4 0.4s ease;
|
||||
animation: SubMenuAnimIn4 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-in-5 {
|
||||
-webkit-animation: SubMenuAnimIn5 0.4s ease;
|
||||
-moz-animation: SubMenuAnimIn5 0.4s ease;
|
||||
animation: SubMenuAnimIn5 0.4s ease;
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimIn1 {
|
||||
0% {
|
||||
-webkit-transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimIn2 {
|
||||
0% {
|
||||
-webkit-transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimIn3 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimIn4 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimIn5 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimIn1 {
|
||||
0% {
|
||||
-moz-transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimIn2 {
|
||||
0% {
|
||||
-moz-transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimIn3 {
|
||||
0% {
|
||||
-moz-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimIn4 {
|
||||
0% {
|
||||
-moz-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimIn5 {
|
||||
0% {
|
||||
-moz-transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimIn1 {
|
||||
0% {
|
||||
transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimIn2 {
|
||||
0% {
|
||||
transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimIn3 {
|
||||
0% {
|
||||
transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimIn4 {
|
||||
0% {
|
||||
transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimIn5 {
|
||||
0% {
|
||||
transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-out-1 {
|
||||
-webkit-animation: SubMenuAnimOut1 0.4s ease;
|
||||
-moz-animation: SubMenuAnimOut1 0.4s ease;
|
||||
animation: SubMenuAnimOut1 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-out-2 {
|
||||
-webkit-animation: SubMenuAnimOut2 0.3s ease-in-out;
|
||||
-moz-animation: SubMenuAnimOut2 0.3s ease-in-out;
|
||||
animation: SubMenuAnimOut2 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-out-3 {
|
||||
-webkit-animation: SubMenuAnimOut3 0.4s ease;
|
||||
-moz-animation: SubMenuAnimOut3 0.4s ease;
|
||||
animation: SubMenuAnimOut3 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-out-4 {
|
||||
-webkit-animation: SubMenuAnimOut4 0.4s ease;
|
||||
-moz-animation: SubMenuAnimOut4 0.4s ease;
|
||||
animation: SubMenuAnimOut4 0.4s ease;
|
||||
}
|
||||
|
||||
.explorer > .dl-submenu.dl-animate-out-5 {
|
||||
-webkit-animation: SubMenuAnimOut5 0.4s ease;
|
||||
-moz-animation: SubMenuAnimOut5 0.4s ease;
|
||||
animation: SubMenuAnimOut5 0.4s ease;
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimOut1 {
|
||||
0% {
|
||||
-webkit-transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimOut2 {
|
||||
0% {
|
||||
-webkit-transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimOut3 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimOut4 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes SubMenuAnimOut5 {
|
||||
0% {
|
||||
-webkit-transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimOut1 {
|
||||
0% {
|
||||
-moz-transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimOut2 {
|
||||
0% {
|
||||
-moz-transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimOut3 {
|
||||
0% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimOut4 {
|
||||
0% {
|
||||
-moz-transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes SubMenuAnimOut5 {
|
||||
0% {
|
||||
-moz-transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-moz-transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimOut1 {
|
||||
0% {
|
||||
transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimOut2 {
|
||||
0% {
|
||||
transform: translateX(0%);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimOut3 {
|
||||
0% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(-300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimOut4 {
|
||||
0% {
|
||||
transform: translateZ(0px);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(300px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SubMenuAnimOut5 {
|
||||
0% {
|
||||
transform: translateZ(0);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translateZ(-200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Transitions */
|
||||
.children{
|
||||
.transition(all 0.2s linear);
|
||||
}
|
||||
.dl-menu.dl-menu-toggle {
|
||||
.transition(all 0.3s ease);
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
.avatar{
|
||||
.border-radius(100%);
|
||||
position:relative;
|
||||
display:inline-block;
|
||||
width:50px;
|
||||
height:50px;
|
||||
|
||||
&:before{
|
||||
.border-radius(100%);
|
||||
color:@color-grey-3;
|
||||
border: 2px solid @color-grey-3;
|
||||
text-align:center;
|
||||
display:block;
|
||||
width:42px;
|
||||
height:42px;
|
||||
margin:2px 0 0 2px;
|
||||
line-height:42px;
|
||||
position:absolute;
|
||||
z-index:1;
|
||||
left:0;
|
||||
}
|
||||
a{
|
||||
position:absolute;
|
||||
z-index:2;
|
||||
left:0;
|
||||
display:block;
|
||||
width:100%;
|
||||
height:50px;
|
||||
}
|
||||
img{
|
||||
.border-radius(100%);
|
||||
}
|
||||
&:hover{
|
||||
&:before{
|
||||
color:@color-teal;
|
||||
border-color:@color-teal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.media-placeholder {
|
||||
width: 600px;
|
||||
height: 400px;
|
||||
background-color: #CCC;
|
||||
padding: 5px;
|
||||
h3, p {
|
||||
margin: 0;
|
||||
}
|
||||
img {
|
||||
max-width: 350px;
|
||||
max-height: 350px;
|
||||
margin: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Displays "timesince" formatted date with full date on hover */
|
||||
.human-readable-date{
|
||||
overflow:hidden;
|
||||
display:block;
|
||||
position:relative;
|
||||
|
||||
&:before{
|
||||
position:absolute;
|
||||
display:none;
|
||||
content:attr(title);
|
||||
}
|
||||
|
||||
&:hover{
|
||||
visibility:hidden;
|
||||
|
||||
&:before{
|
||||
visibility:visible;
|
||||
display:block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* makes a link look like regular text */
|
||||
.nolink{
|
||||
color:@color-text-base;
|
||||
}
|
||||
|
||||
/* Status tags */
|
||||
.status-tag{
|
||||
text-align:center;
|
||||
display:inline-block;
|
||||
.border-radius(2px);
|
||||
text-transform:uppercase;
|
||||
padding:0em 0.5em;
|
||||
border:1px solid @color-grey-3;
|
||||
color:@color-grey-3;
|
||||
-webkit-font-smoothing: auto;
|
||||
font-size:0.80em;
|
||||
margin:0 0.5em;
|
||||
|
||||
&.primary{
|
||||
color:@color-grey-2;
|
||||
border:1px solid @color-grey-2;
|
||||
}
|
||||
}
|
||||
|
||||
/* tags */
|
||||
.tag{
|
||||
background-color:@color-teal;
|
||||
padding-right:0.5em;
|
||||
padding:0.2em 0.5em;
|
||||
color:white;
|
||||
line-height:2em;
|
||||
white-space: nowrap;
|
||||
.border-radius(2px);
|
||||
|
||||
|
||||
&:before{
|
||||
font-family:verdant;
|
||||
display:inline-block;
|
||||
color:white;
|
||||
content:"u";
|
||||
padding-right:0.5em;
|
||||
}
|
||||
a&:hover{
|
||||
background-color:@color-teal-darker;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.taglist &{
|
||||
margin-right:0.8em;
|
||||
}
|
||||
}
|
||||
.taglist {
|
||||
font-size:0.9em;
|
||||
line-height:2.4em;
|
||||
h3{
|
||||
display:inline;
|
||||
margin-right:1em;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,626 @@
|
|||
form {
|
||||
ul, li{
|
||||
list-style-type:none;
|
||||
}
|
||||
ul{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
li{
|
||||
.row();
|
||||
}
|
||||
}
|
||||
|
||||
fieldset{
|
||||
border:0;
|
||||
padding:2em 0;
|
||||
margin:0;
|
||||
/* position:relative; See if we can get away without this */
|
||||
}
|
||||
|
||||
|
||||
|
||||
legend{
|
||||
.visuallyhidden();
|
||||
}
|
||||
|
||||
.fields li{
|
||||
padding-top:0.5em;
|
||||
padding-bottom:0.5em;
|
||||
}
|
||||
|
||||
.field{
|
||||
padding:0 0 0.5em 0;
|
||||
}
|
||||
|
||||
label{
|
||||
font-weight:normal;
|
||||
display:block;
|
||||
padding:0 0 0.5em 0;
|
||||
line-height:1em;
|
||||
|
||||
.checkbox &,
|
||||
.radio &{
|
||||
display:inline;
|
||||
}
|
||||
}
|
||||
|
||||
input, textarea, select, .richtext, .tagit{
|
||||
.border-radius(6px);
|
||||
.border-box();
|
||||
font-family:Open Sans,Arial,sans-serif;
|
||||
width:100%;
|
||||
border:1px dashed @color-input-border;
|
||||
padding:1.2em;
|
||||
background-color:white;
|
||||
-webkit-appearance: none;
|
||||
color:@color-text-input;
|
||||
font-size:1.1em;
|
||||
outline:none;
|
||||
|
||||
&:hover{
|
||||
background-color:@color-fieldset-hover;
|
||||
}
|
||||
&:focus{
|
||||
border-color: darken(@color-input-focus, 40%);
|
||||
outline:none;
|
||||
background-color:@color-input-focus;
|
||||
}
|
||||
}
|
||||
|
||||
.full .richtext{
|
||||
border:0;
|
||||
}
|
||||
|
||||
input[type=radio],input[type=checkbox]{
|
||||
.border-radius(0);
|
||||
cursor:pointer;
|
||||
float:left;
|
||||
border:0;
|
||||
}
|
||||
|
||||
input[type=radio]{
|
||||
-webkit-appearance: radio;
|
||||
width:auto;
|
||||
position:relative;
|
||||
margin-right:15px;
|
||||
}
|
||||
|
||||
input[type=radio]:before{
|
||||
.border-radius(100%);
|
||||
font-family: verdant;
|
||||
font-style: normal;
|
||||
text-align:center;
|
||||
position:absolute;
|
||||
top:-5px;
|
||||
left:-2px;
|
||||
cursor:pointer;
|
||||
display:block;
|
||||
content:"K";
|
||||
width: 1em;
|
||||
line-height: 1.1em;
|
||||
padding: 4px;
|
||||
background-color: white;
|
||||
color:@color-grey-4;
|
||||
border: 1px solid @color-grey-4;
|
||||
}
|
||||
input[type=radio]:checked:before{
|
||||
content:"K";
|
||||
color:@color-teal;
|
||||
}
|
||||
|
||||
input[type=checkbox]{
|
||||
-webkit-appearance: checkbox;
|
||||
width:auto;
|
||||
position:relative;
|
||||
margin-right:15px;
|
||||
}
|
||||
|
||||
input[type=checkbox]:before{
|
||||
font-family: verdant;
|
||||
font-style: normal;
|
||||
text-align:center;
|
||||
position:absolute;
|
||||
top:-5px;
|
||||
cursor:pointer;
|
||||
display:block;
|
||||
content:"x";
|
||||
line-height:20px;
|
||||
width:20px;
|
||||
height:20px;
|
||||
background-color:white;
|
||||
border:1px solid @color-grey-4;
|
||||
color:#EEE;
|
||||
}
|
||||
input[type=checkbox]:checked:before{
|
||||
color:@color-teal;
|
||||
}
|
||||
|
||||
input[type=submit], input[type=reset], input[type=button], .button, button{
|
||||
.border-radius(2px);
|
||||
width:auto;
|
||||
padding:0.6em 1.2em;
|
||||
border:none;
|
||||
background-color: @color-button;
|
||||
color:white;
|
||||
text-decoration:none;
|
||||
text-transform:uppercase;
|
||||
font-size:1em;
|
||||
white-space: nowrap;
|
||||
position:relative;
|
||||
-webkit-font-smoothing: auto;
|
||||
vertical-align: middle;
|
||||
line-height:1em;
|
||||
display:inline-block;
|
||||
|
||||
&.icon:before{
|
||||
font-size:1.5em;
|
||||
}
|
||||
&.icon.text-replace:before{
|
||||
font-size:auto;
|
||||
}
|
||||
|
||||
&.button-small{
|
||||
font-size:0.85em;
|
||||
padding:1em 1.8em;
|
||||
}
|
||||
|
||||
&.button-secondary{
|
||||
border:1px solid @color-button;
|
||||
color:@color-button;
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
background-color: @color-button-hover;
|
||||
color:white;
|
||||
border-color:transparent;
|
||||
}
|
||||
|
||||
&.yes{
|
||||
background-color: @color-button-yes;
|
||||
|
||||
&.button-secondary{
|
||||
border:1px solid @color-button-yes;
|
||||
color:@color-button-yes;
|
||||
background-color:transparent;
|
||||
}
|
||||
&:hover{
|
||||
color:white;
|
||||
border-color:transparent;
|
||||
background-color: @color-button-yes-hover;
|
||||
}
|
||||
}
|
||||
&.no, &.serious{
|
||||
background-color: @color-button-no;
|
||||
|
||||
&.button-secondary{
|
||||
border:1px solid @color-button-no;
|
||||
color:@color-button-no;
|
||||
background-color:transparent;
|
||||
}
|
||||
&:hover{
|
||||
color:white;
|
||||
border-color:transparent;
|
||||
background-color: @color-button-no-hover;
|
||||
}
|
||||
}
|
||||
|
||||
/* special consideration for buttons with icons in them, to make them smaller */
|
||||
&.icon{
|
||||
padding:1em 2.4em;
|
||||
padding:0.6em 1.2em;
|
||||
}
|
||||
|
||||
+ input[type=submit],
|
||||
+ input[type=reset],
|
||||
+ input[type=button],
|
||||
+ .button,
|
||||
+ button{
|
||||
margin-left:1em;
|
||||
}
|
||||
}
|
||||
|
||||
/* multiple-item forms where groups of fields can be added */
|
||||
.multiple {
|
||||
|
||||
|
||||
> li{
|
||||
position:relative;
|
||||
border-bottom: 1px solid @color-input-border;
|
||||
|
||||
&:first-child fieldset{
|
||||
padding-top:0;
|
||||
}
|
||||
}
|
||||
|
||||
/* styles applied to an element as it is being reordered */
|
||||
&.moving{
|
||||
position:relative;
|
||||
}
|
||||
li.moving{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* Object controls */
|
||||
.controls{
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:2em;
|
||||
text-transform:uppercase;
|
||||
color:@color-grey-2;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
overflow:hidden;
|
||||
line-height:0em;
|
||||
|
||||
li{
|
||||
background-color: @color-grey-4;
|
||||
display:inline-block;
|
||||
cursor:pointer;
|
||||
}
|
||||
.icon{
|
||||
padding:0.3em;
|
||||
}
|
||||
.icon:before{
|
||||
vertical-align:middle;
|
||||
line-height:2em;
|
||||
}
|
||||
.icon:hover{
|
||||
background-color:@color-teal;
|
||||
|
||||
&:before{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
.disabled{
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
> li:first-child .controls{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
||||
/* wrapper around add button for mutliple objects */
|
||||
p.add{
|
||||
font-weight:700;
|
||||
cursor:pointer;
|
||||
margin-top:0;
|
||||
margin-bottom:0;
|
||||
padding-top:2.5em;
|
||||
padding-bottom:2em;
|
||||
}
|
||||
|
||||
/* Other text */
|
||||
.help, .error-message{
|
||||
font-size:0.85em;
|
||||
font-weight:normal;
|
||||
margin:0 0 0.5em 0;
|
||||
}
|
||||
.help{
|
||||
color:@color-grey-2;
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
/* permanently show checkbox/radio help as they have no focus state */
|
||||
.boolean_field .help, .radio .help{
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
|
||||
fieldset:hover > .help,
|
||||
.field.focused + .help,
|
||||
.field:focus + .help,
|
||||
.field:hover + .help,
|
||||
li.focused > .help{
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.required label:after{
|
||||
content:"*";
|
||||
color:@color-red;
|
||||
font-weight:bold;
|
||||
display:inline-block;
|
||||
margin-left:0.5em;
|
||||
line-height:1em;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.error-message{
|
||||
margin:0;
|
||||
color:@color-red;
|
||||
clear:both;
|
||||
}
|
||||
.error input[type=text], .error input[type=email], .error input[type=tel], .error textarea, .error select, .error .tagit{
|
||||
border-color:@color-red;
|
||||
background-color:@color-input-error-bg;
|
||||
}
|
||||
|
||||
/* field sizing */
|
||||
.field{
|
||||
&.col1,
|
||||
&.col2,
|
||||
&.col3,
|
||||
&.col4,
|
||||
&.col5,
|
||||
&.col6,
|
||||
&.col7,
|
||||
&.col8,
|
||||
&.col9,
|
||||
&.col10,
|
||||
&.col11,
|
||||
&.col12{clear:both;}
|
||||
}
|
||||
|
||||
li.inline .field{
|
||||
&.col1,
|
||||
&.col2,
|
||||
&.col3,
|
||||
&.col4,
|
||||
&.col5,
|
||||
&.col6,
|
||||
&.col7,
|
||||
&.col8,
|
||||
&.col9,
|
||||
&.col10,
|
||||
&.col11,
|
||||
&.col12{clear:none;}
|
||||
}
|
||||
|
||||
/* solve gutter issues of inline fields */
|
||||
ul.inline li:first-child, li.inline:first-child{
|
||||
margin-left:-@grid-gutter-width / 2;
|
||||
}
|
||||
|
||||
|
||||
/* TODO this chooser style has been made more generic based on two identical methods for choosing pages and images that were previously included in their own less files in each app directory (and since deleted). It would be best if an admin "theme" provided all the design for a UI in a single place, but should that be a series of overrides to the css provided from an app? If so, perhaps those two previous less files should be re-instated and then overriden here? hmm. */
|
||||
|
||||
.chooser {
|
||||
/* We show the 'chosen' state...*/
|
||||
.clearfix();
|
||||
|
||||
input[type=text]{
|
||||
float:left;
|
||||
width:50%;
|
||||
margin-right:1em;
|
||||
}
|
||||
.chosen {
|
||||
display: block;
|
||||
}
|
||||
.unchosen, .chosen{
|
||||
position:relative;
|
||||
padding-left:@thumbnail-width+15;
|
||||
|
||||
&:before{
|
||||
font-family:verdant;
|
||||
content:"";
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
margin-top:auto;
|
||||
margin-bottom:auto;
|
||||
display:inline-block;
|
||||
opacity:0.1;
|
||||
font-size:7.5em;
|
||||
line-height:1em;
|
||||
}
|
||||
&:hover:before{
|
||||
opacity:0.2;
|
||||
}
|
||||
}
|
||||
.unchosen {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ...unless the .page-chooser has the 'blank' class set */
|
||||
&.blank {
|
||||
.chosen { display: none; }
|
||||
.unchosen { display: block; }
|
||||
}
|
||||
|
||||
input[type=button]{
|
||||
font-size:0.85em;
|
||||
padding:0.9em 1.4em;
|
||||
}
|
||||
}
|
||||
|
||||
/* standard way of doing a chooser where the chosen object's title is overlayed */
|
||||
.page-chooser,
|
||||
.snippet-chooser,
|
||||
.document-chooser {
|
||||
.unchosen, .chosen{
|
||||
height:100px;
|
||||
|
||||
&:before{
|
||||
content:"c";
|
||||
left:0.2em;
|
||||
}
|
||||
}
|
||||
.chosen{
|
||||
&:before{
|
||||
content:"b";
|
||||
}
|
||||
.title{
|
||||
z-index:0;
|
||||
float: left;
|
||||
margin-left: -146px;
|
||||
width: 126px;
|
||||
max-height: 40px;
|
||||
overflow: hidden;
|
||||
font-size: 0.7em;
|
||||
padding: 30px 10px 0px 10px;
|
||||
display: block;
|
||||
top: 0px;
|
||||
position: absolute;
|
||||
line-height: 1.4em;
|
||||
text-align: center;
|
||||
color: black;
|
||||
white-space:nowrap;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
&:hover .title{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.snippet-chooser {
|
||||
.unchosen:before,
|
||||
.chosen:before{
|
||||
content:"D";
|
||||
}
|
||||
}
|
||||
|
||||
.document-chooser {
|
||||
.unchosen, .chosen{
|
||||
height:100px;
|
||||
|
||||
&:before{
|
||||
content:"h";
|
||||
left:0.2em;
|
||||
}
|
||||
}
|
||||
.chosen:before{
|
||||
content:"r";
|
||||
}
|
||||
}
|
||||
|
||||
.image-chooser {
|
||||
.unchosen, .chosen{
|
||||
.clearfix;
|
||||
min-height:95px;
|
||||
|
||||
&:before{
|
||||
content:"o";
|
||||
font-size:120px;
|
||||
line-height:97px;
|
||||
}
|
||||
}
|
||||
.chosen{
|
||||
&:before{
|
||||
content:"";
|
||||
}
|
||||
.preview-image{
|
||||
float:left;
|
||||
margin-left:-(@thumbnail-width)-15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
|
||||
.tagit{
|
||||
padding:0.6saem 1.2em;
|
||||
|
||||
.tagit-choice{
|
||||
border:0;
|
||||
}
|
||||
|
||||
ul& input[type="text"]{
|
||||
padding: 0.2em 0.5em !important; /* having to use important, FML*/
|
||||
}
|
||||
ul& li.tagit-choice-editable{
|
||||
padding:0 23px 0 0 !important; /* having to use important, FML*/
|
||||
}
|
||||
}
|
||||
|
||||
.tagit-close{
|
||||
.ui-icon-close{
|
||||
margin-left:1em;
|
||||
text-indent:0;
|
||||
background:none;
|
||||
}
|
||||
|
||||
.ui-icon-close:before{
|
||||
font-family:verdant;
|
||||
display:block;
|
||||
color:@color-grey-3;
|
||||
content:"g";
|
||||
}
|
||||
.ui-icon-close:hover:before{
|
||||
color:@color-red
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* search bars (search integrated into header area) */
|
||||
.search-bar{
|
||||
margin-top:-2em;
|
||||
padding-top:1em;
|
||||
padding-bottom:1em;
|
||||
margin-bottom:2em;
|
||||
|
||||
&.full-width{
|
||||
.nice-padding();
|
||||
background-color:@color-header-bg;
|
||||
border-bottom:1px solid @color-grey-4;
|
||||
}
|
||||
|
||||
.fields{
|
||||
position:relative;
|
||||
|
||||
.field label{
|
||||
display:none;
|
||||
}
|
||||
.field input{
|
||||
padding-left:3em;
|
||||
}
|
||||
.field:before{
|
||||
position:absolute;
|
||||
left:0.5em;
|
||||
top:1em;
|
||||
font-family:verdant;
|
||||
content:"f";
|
||||
font-size:25px;
|
||||
color:@color-grey-3;
|
||||
}
|
||||
}
|
||||
.submit{
|
||||
display:none;
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:0;
|
||||
input{
|
||||
padding:1.55em 2em;
|
||||
}
|
||||
}
|
||||
.taglist{
|
||||
font-size:0.9em;
|
||||
line-height:2.4em;
|
||||
h3{
|
||||
display:inline;
|
||||
}
|
||||
a{
|
||||
white-space: nowrap
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Transitions */
|
||||
fieldset, input, textarea, select{
|
||||
.transition(background-color 0.2s ease);
|
||||
}
|
||||
input[type=submit], input[type=reset], input[type=button], .button, button{
|
||||
.transition(~"background-color 0.2s ease, color 0.2s ease");
|
||||
}
|
||||
.help{
|
||||
/* TODO: This transitionmakes the browser go nuts and the left menu jerk around. Find way to solve */
|
||||
.transition(opacity 0.2s ease);
|
||||
}
|
||||
.chooser {
|
||||
.unchosen:before, .chosen:before{
|
||||
.transition(opacity 0.3s ease);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
input[type=submit], input[type=reset], input[type=button], .button, button{
|
||||
font-size:0.95em;
|
||||
padding:1.3em 2.2em;
|
||||
|
||||
&.icon{
|
||||
padding:1em 2.4em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
@font-face {
|
||||
font-family: "verdant";
|
||||
src:url("@{css-root}fonts/verdant.eot");
|
||||
src:url("@{css-root}fonts/verdant.eot?#iefix") format("embedded-opentype"),
|
||||
url("@{css-root}fonts/verdant.ttf") format("truetype"),
|
||||
url("@{css-root}fonts/verdant.svg#verdant") format("svg"),
|
||||
url("@{css-root}fonts/verdant.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.icon.teal{
|
||||
color:@color-teal;
|
||||
}
|
||||
.icon.white{
|
||||
color:white
|
||||
}
|
||||
|
||||
.icon:before,
|
||||
.icon:after,
|
||||
.hallotoolbar [class^="icon-"],
|
||||
.hallotoolbar [class*=" icon-"]:before,
|
||||
.hallotoolbar [class^="icon-"]:before{
|
||||
font-family: "verdant";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none !important;
|
||||
speak: none;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
width: 1.3em;
|
||||
line-height: 1em;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
vertical-align: -20%;
|
||||
font-size:20px;
|
||||
text-align:left;
|
||||
}
|
||||
.icon:after,
|
||||
.hallotoolbar [class^="icon-"]:after,
|
||||
.hallotoolbar [class^="icon-"]:after{
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.hallotoolbar [class^="icon-"],
|
||||
.hallotoolbar [class*=" icon-"]:before,
|
||||
.hallotoolbar [class*=" icon-"]:before,
|
||||
.hallotoolbar [class^="icon-"]:before{
|
||||
font-size:1.1em;
|
||||
vertical-align:-10%;
|
||||
font-size:1.05em;
|
||||
}
|
||||
|
||||
|
||||
.icon-cogs:before, {
|
||||
content: "a";
|
||||
}
|
||||
.icon-doc-empty-inverse:before {
|
||||
content: "b";
|
||||
}
|
||||
.icon-doc-empty:before{
|
||||
content: "c";
|
||||
}
|
||||
.icon-edit:before {
|
||||
content: "d";
|
||||
}
|
||||
.icon-arrow-up:before,
|
||||
.icon-arrow-up-after:after {
|
||||
content: "e";
|
||||
}
|
||||
.icon-arrow-down:before,
|
||||
.icon-arrow-down-after:after {
|
||||
content: "q";
|
||||
}
|
||||
.icon-search:before {
|
||||
content: "f";
|
||||
}
|
||||
.icon-cross:before {
|
||||
content: "g";
|
||||
}
|
||||
.icon-folder-open-1:before {
|
||||
content: "i";
|
||||
}
|
||||
.icon-folder-inverse:before {
|
||||
content: "j";
|
||||
}
|
||||
.icon-mail:before {
|
||||
content: "k";
|
||||
}
|
||||
.icon-arrows-up-down:before {
|
||||
content: "l";
|
||||
}
|
||||
.icon-locked:before {
|
||||
content: "m";
|
||||
}
|
||||
.icon-arrow-right:before,
|
||||
.icon-arrow-right-after:after {
|
||||
content: "n";
|
||||
}
|
||||
.icon-doc-full:before,
|
||||
.icon-file-text-alt:before {
|
||||
content: "h";
|
||||
}
|
||||
.icon-image:before,
|
||||
.icon-picture:before {
|
||||
content: "o";
|
||||
}
|
||||
.icon-unlocked:before {
|
||||
content: "p";
|
||||
}
|
||||
|
||||
.icon-doc-full-inverse:before {
|
||||
content: "r";
|
||||
}
|
||||
.icon-folder:before {
|
||||
content: "s";
|
||||
}
|
||||
.icon-plus:before {
|
||||
content: "t";
|
||||
}
|
||||
.icon-tag:before {
|
||||
content: "u";
|
||||
}
|
||||
.icon-folder-open-inverse:before {
|
||||
content: "v";
|
||||
}
|
||||
.icon-cog:before {
|
||||
content: "w";
|
||||
}
|
||||
.icon-tick:before {
|
||||
content: "x";
|
||||
}
|
||||
.icon-user:before {
|
||||
content: "y";
|
||||
}
|
||||
.icon-arrow-left:before {
|
||||
content: "z";
|
||||
}
|
||||
.icon-tick-inverse:before {
|
||||
content: "A";
|
||||
}
|
||||
.icon-plus-inverse:before {
|
||||
content: "B";
|
||||
}
|
||||
.icon-snippet:before {
|
||||
content: "D";
|
||||
}
|
||||
.icon-verdant:before {
|
||||
content: "V";
|
||||
}
|
||||
.icon-bold:before{
|
||||
content:"C";
|
||||
}
|
||||
.icon-italic:before{
|
||||
content:"E";
|
||||
}
|
||||
.icon-undo:before{
|
||||
content:"H";
|
||||
}
|
||||
.icon-repeat:before{
|
||||
content:"I";
|
||||
}
|
||||
.icon-list-ol:before{
|
||||
content:"G";
|
||||
}
|
||||
.icon-list-ul:before{
|
||||
content:"F";
|
||||
}
|
||||
.icon-link:before{
|
||||
content:"J";
|
||||
}
|
||||
.icon-radio-full:before{
|
||||
content:"K";
|
||||
}
|
||||
.icon-radio-empty:before{
|
||||
content:"L";
|
||||
}
|
||||
.icon-arrow-up-big:before{
|
||||
content:"M";
|
||||
}
|
||||
.icon-arrow-down-big:before{
|
||||
content:"N";
|
||||
}
|
||||
.icon-group:before{
|
||||
content:"O";
|
||||
}
|
||||
.icon-media:before{
|
||||
content:"P";
|
||||
}
|
||||
.icon-horizontalrule{
|
||||
&:before{
|
||||
font-family: Open Sans,Arial,sans-serif !important; // FML
|
||||
content:"—";
|
||||
}
|
||||
}
|
||||
.icon-password:before{
|
||||
content:"Q";
|
||||
}
|
||||
.icon-download:before{
|
||||
content:"S";
|
||||
}
|
||||
.icon-home:before{
|
||||
content:"W";
|
||||
}
|
||||
.icon-order:before{
|
||||
content:"T";
|
||||
}
|
||||
.icon-grip:before{
|
||||
content:"U";
|
||||
}
|
||||
|
||||
.icon.text-replace{
|
||||
font-size:0em;
|
||||
line-height:0;
|
||||
overflow:hidden;
|
||||
|
||||
&:before{
|
||||
font-size:1rem;
|
||||
display:inline-block;
|
||||
width:100%;
|
||||
line-height:1.2em;
|
||||
text-align:center;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,446 @@
|
|||
/* General listings, like for pages, images or snippets */
|
||||
ul.listing{
|
||||
.unlist();
|
||||
}
|
||||
|
||||
.listing{
|
||||
margin-bottom:2em;
|
||||
ul&{
|
||||
border-top:1px dashed @color-input-border;
|
||||
margin-bottom:2em;
|
||||
}
|
||||
ul{
|
||||
.unlist();
|
||||
}
|
||||
> li{
|
||||
padding:1em 0;
|
||||
border-bottom:1px dashed @color-input-border;
|
||||
}
|
||||
|
||||
h3{
|
||||
margin:0;
|
||||
font-size:0.95em;
|
||||
}
|
||||
|
||||
table&{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
td, th{
|
||||
padding:1.5em 1em;
|
||||
}
|
||||
|
||||
&.small td, th{
|
||||
padding:0.6em 1em;
|
||||
}
|
||||
|
||||
thead{
|
||||
color: @color-grey-2;
|
||||
border-bottom:1px solid @color-grey-4;
|
||||
|
||||
th{
|
||||
font-size:0.85em;
|
||||
text-align:left;
|
||||
font-weight:normal;
|
||||
white-space: nowrap;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
th.children{
|
||||
border:0;
|
||||
}
|
||||
|
||||
th a{
|
||||
text-decoration:none;
|
||||
color:inherit;
|
||||
position:relative;
|
||||
|
||||
&.icon:after{
|
||||
opacity:0.5;
|
||||
right:0;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown{
|
||||
padding:0;
|
||||
}
|
||||
.dropdown-toggle{
|
||||
display:block;
|
||||
padding:1.5em;
|
||||
}
|
||||
.dropdown:hover,
|
||||
.dropdown.open{
|
||||
.box-shadow(0px 0px 3px 0 rgba(0,0,0,0.2));
|
||||
background-color:white;
|
||||
margin-left:-@grid-gutter-width * 2;
|
||||
}
|
||||
}
|
||||
|
||||
&.full-width td:first-child,
|
||||
&.full-width th:first-child{
|
||||
.push-padding(@grid-content-indent);
|
||||
}
|
||||
|
||||
&.full-width{
|
||||
margin-bottom:-3em; /* this negates the padding added to the bottom of .content */
|
||||
}
|
||||
&.full-width th{
|
||||
background-color:@color-thead-bg;
|
||||
}
|
||||
|
||||
.table-headers{
|
||||
border-bottom:1px solid @color-grey-4
|
||||
}
|
||||
|
||||
tbody{
|
||||
border-bottom:1px dashed @color-input-border;
|
||||
}
|
||||
tbody tr{
|
||||
border-top:1px dashed @color-input-border;
|
||||
&:first-child{
|
||||
border-top:1px dashed @color-input-border;
|
||||
}
|
||||
|
||||
}
|
||||
&.full-width tbody{
|
||||
border:0;
|
||||
}
|
||||
&.full-width tbody tr:hover{
|
||||
background-color:#FDFDFD;
|
||||
}
|
||||
&.chooser tr.can-choose:hover{
|
||||
background-color:@color-teal;
|
||||
color:white;
|
||||
|
||||
a,a:hover{
|
||||
color:white;
|
||||
}
|
||||
.status-tag{
|
||||
border-color:white;
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
&.small tbody tr{
|
||||
font-size:1em;
|
||||
}
|
||||
|
||||
|
||||
.divider{
|
||||
text-transform:uppercase;
|
||||
font-size:0.8em;
|
||||
background-color:@color-grey-3;
|
||||
td{
|
||||
|
||||
padding-top:0.5em;
|
||||
padding-bottom:0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
&.full-width .divider td{
|
||||
.push-padding(@grid-content-indent);
|
||||
}
|
||||
|
||||
.index {
|
||||
background-color:@color-header-bg;
|
||||
.title h2{
|
||||
font-size:1.2em;
|
||||
}
|
||||
a{
|
||||
color:auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* specific columns */
|
||||
.bulk{
|
||||
padding-right:0;
|
||||
|
||||
label{
|
||||
font-size:1em;
|
||||
display:block;
|
||||
width:100%;
|
||||
position:relative;
|
||||
}
|
||||
label span{
|
||||
.visuallyhidden();
|
||||
}
|
||||
input{
|
||||
margin-top:3px;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.title{
|
||||
h2{
|
||||
text-transform:none;
|
||||
margin:0;
|
||||
font-size:1.1em;
|
||||
font-weight:700;
|
||||
color:@color-grey-2;
|
||||
line-height:1.5em;
|
||||
|
||||
a{
|
||||
color:inherit;
|
||||
text-decoration:none;
|
||||
display: block;
|
||||
|
||||
&:hover{
|
||||
color:@color-link;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions{
|
||||
margin-top:0.5em;
|
||||
text-transform:uppercase;
|
||||
font-size:0.85em;
|
||||
|
||||
a{
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
li{
|
||||
display:inline-block;
|
||||
padding:0 0.5em;
|
||||
border-left:1px solid @color-grey-3;
|
||||
line-height:1em;
|
||||
|
||||
&:first-child{
|
||||
border:0;
|
||||
padding-left:0;
|
||||
}
|
||||
&.no-border{
|
||||
border:0;
|
||||
}
|
||||
}
|
||||
|
||||
.button-small{
|
||||
font-size:1em;
|
||||
padding:0.6em 1.2em;
|
||||
margin-right:1em;
|
||||
|
||||
&:before{
|
||||
font-size:1.7em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.moderate-actions form{
|
||||
float:left;
|
||||
margin:0 1em 1em 0;
|
||||
}
|
||||
|
||||
.children,
|
||||
.no-children{
|
||||
padding:0 !important;
|
||||
border-left:1px dashed @color-input-border;
|
||||
&:hover{
|
||||
background-color:@color-header-bg;
|
||||
}
|
||||
}
|
||||
.children a,
|
||||
.no-children a{
|
||||
color:@color-grey-3;
|
||||
display:block;
|
||||
padding:2em 0;
|
||||
}
|
||||
|
||||
.children a{
|
||||
display:block;
|
||||
&:before{
|
||||
font-size:3rem;
|
||||
}
|
||||
}
|
||||
.no-children a{
|
||||
display:block;
|
||||
&:before{
|
||||
font-size:1.5rem;
|
||||
}
|
||||
}
|
||||
&.small .children a:before{
|
||||
font-size:30px;
|
||||
}
|
||||
|
||||
.ord{
|
||||
padding-left:10px !important;
|
||||
}
|
||||
th.ord a:before{
|
||||
width:1em;
|
||||
font-size:15px;
|
||||
}
|
||||
th.ord a:hover:before{
|
||||
color:@color-teal;
|
||||
}
|
||||
.handle{
|
||||
cursor:move;
|
||||
width:20px;
|
||||
|
||||
&:before{
|
||||
font-size:20px;
|
||||
color:@color-grey-3;
|
||||
width:1em;
|
||||
}
|
||||
&:hover:before{
|
||||
color:@color-text-base;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-sortable-helper{
|
||||
border:1px dashed @color-input-border;
|
||||
border-width:1px 0;
|
||||
|
||||
|
||||
td{
|
||||
display:none;
|
||||
|
||||
}
|
||||
.ord,.title{
|
||||
display:table-cell;
|
||||
}
|
||||
.ord{
|
||||
|
||||
}
|
||||
}
|
||||
.dropzone{
|
||||
height:80px;
|
||||
background-color:@color-grey-1;
|
||||
|
||||
&:hover{
|
||||
background-color:@color-grey-1;
|
||||
}
|
||||
td{
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
td.children:hover{
|
||||
background-color:@color-teal;
|
||||
|
||||
a:before{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
table .no-results-message{
|
||||
.push-padding(@grid-content-indent);
|
||||
}
|
||||
|
||||
.inactive h2{
|
||||
opacity:0.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pagination{
|
||||
text-align:center;
|
||||
p{
|
||||
margin:0;
|
||||
}
|
||||
ul{
|
||||
.unlist();
|
||||
}
|
||||
ul{
|
||||
margin-top:-1.7em;
|
||||
}
|
||||
li{
|
||||
line-height:1em;
|
||||
}
|
||||
.prev{
|
||||
float:left;
|
||||
}
|
||||
.next{
|
||||
float:right;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
.listing{
|
||||
&.horiz > li{
|
||||
float:left;
|
||||
}
|
||||
&.images {
|
||||
.clearfix();
|
||||
border: 1px solid @color-grey-4;
|
||||
border-width:0 0 0 1px !important;
|
||||
|
||||
> li{
|
||||
padding:@grid-gutter-width/2;
|
||||
width:200px;
|
||||
height:220px;
|
||||
text-align:center;
|
||||
margin-top:-1px;
|
||||
border:1px solid @color-grey-4;
|
||||
border-width:1px 1px 1px 0px;
|
||||
|
||||
.image{
|
||||
text-align:center;
|
||||
height:180px;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
margin-right: -0.25em;
|
||||
}
|
||||
|
||||
img{
|
||||
border:3px solid transparent;
|
||||
display:inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover{
|
||||
background-color:#FDFDFD;
|
||||
|
||||
img{
|
||||
border-color:@color-teal;
|
||||
}
|
||||
}
|
||||
}
|
||||
a{
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
}
|
||||
.actions{
|
||||
visibility: hidden;
|
||||
}
|
||||
.index .actions{
|
||||
visibility:visible;
|
||||
}
|
||||
td:hover .actions{
|
||||
visibility:visible;
|
||||
}
|
||||
.no-children {
|
||||
border-color:transparent;
|
||||
}
|
||||
.no-children a{
|
||||
color:@color-teal;
|
||||
opacity:0;
|
||||
}
|
||||
.no-children:hover{
|
||||
border-color:@color-input-border;
|
||||
a{opacity:1;}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Transitions */
|
||||
.listing {
|
||||
thead .dropdown ul{
|
||||
.transition(none);
|
||||
}
|
||||
.children, .no-children{
|
||||
.transition(background-color 0.2s ease);
|
||||
}
|
||||
.children a,
|
||||
.no-children a{
|
||||
.transition(all 0.2s ease);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
.messages{
|
||||
position:relative;
|
||||
|
||||
z-index:5;
|
||||
|
||||
background-color:@color-grey-5;
|
||||
|
||||
ul{
|
||||
.unlist();
|
||||
margin-left:-15px;
|
||||
padding-left:10px;
|
||||
position:relative;
|
||||
top:-100px;
|
||||
|
||||
&:before{
|
||||
content: "";
|
||||
height: 0;
|
||||
width: 0;
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: -15px;
|
||||
left: 0;
|
||||
border-top: 15px solid #000;
|
||||
border-left: 15px solid transparent;
|
||||
}
|
||||
}
|
||||
li{
|
||||
.nice-padding;
|
||||
padding-top:1.3em;
|
||||
padding-bottom:1.3em;
|
||||
color:white;
|
||||
}
|
||||
.error{
|
||||
background-color:@color-red;
|
||||
}
|
||||
.warning{
|
||||
background-color:@color-orange;
|
||||
}
|
||||
.success{
|
||||
background-color:@color-teal-dark;
|
||||
}
|
||||
}
|
||||
.ready .messages ul{
|
||||
.transition-immediate(~"top 0.5s ease, max-height 1.2s ease");
|
||||
top:0px;
|
||||
}
|
||||
.messages.new ul{
|
||||
.transition-immediate(none);
|
||||
top:-100px;
|
||||
}
|
||||
.messages.appear ul{
|
||||
.transition-immediate(~"top 0.5s ease, max-height 1.2s ease");
|
||||
top:0;
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
@zindex-modal-background: 500;
|
||||
|
||||
// Kill the scroll on the body
|
||||
.modal-open {
|
||||
overflow: hidden;
|
||||
|
||||
.content-wrapper{
|
||||
-webkit-transform:none;
|
||||
transform:none;
|
||||
}
|
||||
}
|
||||
|
||||
// Container that the modal scrolls within
|
||||
.modal {
|
||||
.border-box();
|
||||
display: none;
|
||||
overflow: auto;
|
||||
overflow-y: scroll;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: @zindex-modal-background;
|
||||
}
|
||||
|
||||
// Shell div to position the modal with bottom padding
|
||||
.modal-dialog {
|
||||
.border-box();
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: auto;
|
||||
padding: 0px;
|
||||
z-index: (@zindex-modal-background + 10);
|
||||
height:90%;
|
||||
width:85%;
|
||||
|
||||
&:before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
margin-right: -0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
// Actual modal
|
||||
.modal-content {
|
||||
.border-box();
|
||||
.border-radius(3px);
|
||||
width:99.70%;
|
||||
position: relative;
|
||||
background-color: white;
|
||||
outline: none;
|
||||
margin-top:2em;
|
||||
padding-bottom:3em;
|
||||
display:inline-block;
|
||||
vertical-align: middle;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
// Modal background
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: (@zindex-modal-background - 10);
|
||||
background-color: black;
|
||||
// Fade for backdrop
|
||||
&.fade { opacity:0; }
|
||||
&.in { opacity:0.7; }
|
||||
}
|
||||
|
||||
.modal .close{
|
||||
padding:0;
|
||||
position:absolute;
|
||||
width:50px;
|
||||
height:50px;
|
||||
top:10px;
|
||||
right:10px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
// Where all modal content resides
|
||||
.modal-body {
|
||||
position: relative;
|
||||
padding-bottom:2em;
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile) {
|
||||
.modal-dialog {
|
||||
padding:0px 0 2em @menu-width;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
.tab-nav{
|
||||
.clearfix();
|
||||
border:1px solid @color-grey-4;
|
||||
border-width:0 0 1px 1px;
|
||||
padding:0;
|
||||
|
||||
li{
|
||||
border:1px solid @color-grey-4;
|
||||
border-width:1px 1px 0px 1px;
|
||||
text-align:center;
|
||||
}
|
||||
a{
|
||||
outline:none;
|
||||
line-height:3em;
|
||||
text-transform:uppercase;
|
||||
font-weight:700;
|
||||
font-size:1.2em;
|
||||
text-decoration:none;
|
||||
background-color:@color-grey-5;
|
||||
display:block;
|
||||
padding:0 1em;
|
||||
color:@color-grey-2;
|
||||
border-top:0.3em solid @color-grey-3;
|
||||
border-bottom:1px solid transparent;
|
||||
|
||||
&:hover{
|
||||
color:inherit;
|
||||
border-top-color:@color-grey-3;
|
||||
}
|
||||
|
||||
&.active{
|
||||
background-color:white;
|
||||
.box-shadow(none);
|
||||
color:@color-grey-1;
|
||||
border-top:0.3em solid @color-grey-1;
|
||||
border-bottom:2px solid white;
|
||||
margin-bottom:-1px;
|
||||
z-index:1;
|
||||
position:relative;
|
||||
}
|
||||
}
|
||||
|
||||
/* For cases where tab-nav should merge with header */
|
||||
&.merged{
|
||||
background-color:@color-header-bg;
|
||||
margin-top:0;
|
||||
}
|
||||
}
|
||||
.tab-content{
|
||||
section{
|
||||
display:none;
|
||||
padding-top:1em;
|
||||
|
||||
&.active{
|
||||
display:block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
.tab-nav li{
|
||||
.column(2);
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.modal-content .tab-nav li{
|
||||
.column(2);
|
||||
padding:0;
|
||||
min-width:110px;
|
||||
}
|
||||
.modal-content .tab-nav li{
|
||||
min-width:0;
|
||||
}
|
||||
}
|
||||
727
wagtail/wagtailadmin/static/wagtailadmin/css/core.less
Normal file
|
|
@ -0,0 +1,727 @@
|
|||
/*
|
||||
min z-index: 1;
|
||||
max z-index: 5;
|
||||
*/
|
||||
|
||||
@import "variables.less";
|
||||
@import "mixins.less";
|
||||
@import "grid.less";
|
||||
|
||||
@import "components/explorer.less";
|
||||
@import "components/icons.less";
|
||||
@import "components/tabs.less";
|
||||
@import "components/dropdowns.less";
|
||||
@import "components/modals.less";
|
||||
@import "components/forms.less";
|
||||
@import "components/listing.less";
|
||||
@import "components/messages.less";
|
||||
@import "components/formatters.less";
|
||||
|
||||
html{
|
||||
background-color:@color-header-bg;
|
||||
}
|
||||
|
||||
body{
|
||||
-webkit-font-smoothing: antialiased; /* Do not remove! */
|
||||
font-family:Open Sans,Arial,sans-serif;
|
||||
font-size:80%;
|
||||
line-height:1.5em;
|
||||
color:@color-text-base;
|
||||
overflow-x: hidden;
|
||||
position: relative;
|
||||
|
||||
&.reordering{
|
||||
overflow:visible;
|
||||
}
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6{
|
||||
font-weight:normal;
|
||||
-webkit-font-smoothing: auto;
|
||||
}
|
||||
|
||||
h1{
|
||||
line-height:1.3em;
|
||||
font-size:1.5em;
|
||||
text-transform:uppercase;
|
||||
color:@color-grey-2;
|
||||
font-weight:700;
|
||||
|
||||
span{
|
||||
text-transform:none;
|
||||
font-weight:300;
|
||||
}
|
||||
|
||||
.homepage &{
|
||||
text-transform:none;
|
||||
}
|
||||
}
|
||||
h2{
|
||||
text-transform:uppercase;
|
||||
font-size:1.3em;
|
||||
font-family:Open Sans;
|
||||
font-weight:600;
|
||||
color:@color-grey-2;
|
||||
|
||||
.page-explorer &{
|
||||
text-transform:none;
|
||||
}
|
||||
}
|
||||
a{
|
||||
color:@color-link;
|
||||
text-decoration:none;
|
||||
|
||||
&:hover{
|
||||
color:@color-link-hover;
|
||||
}
|
||||
}
|
||||
|
||||
code{
|
||||
.box-shadow(inset 0px 0px 4px 0px rgba(0, 0, 0, 0.2));
|
||||
background-color:@color-fieldset-hover;
|
||||
padding:2px 5px;
|
||||
}
|
||||
|
||||
kbd{
|
||||
.border-radius(3px);
|
||||
font-family:Open Sans, Arial, sans-serif;
|
||||
border:1px solid @color-grey-2;
|
||||
border-color:rgba(0,0,0,0.2);
|
||||
padding:0.3em 0.5em;
|
||||
}
|
||||
|
||||
img{
|
||||
max-width:100%;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
.browsermessage{
|
||||
background-color:@color-red;
|
||||
color:white;
|
||||
padding:1em 2em;
|
||||
margin:0;
|
||||
position:relative;
|
||||
left:0;
|
||||
top:0;
|
||||
right:0;
|
||||
|
||||
a{
|
||||
color:white;
|
||||
text-decoration:underline;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
.clearfix();
|
||||
}
|
||||
|
||||
.nav-wrapper{
|
||||
.box-shadow(inset -2px 0px 10px 0px rgba(0, 0, 0, 0.5));
|
||||
position:relative;
|
||||
background: @color-grey-1;
|
||||
margin-left: -100%;
|
||||
width: 80%;
|
||||
float: left;
|
||||
height:100%;
|
||||
min-height:800px;
|
||||
}
|
||||
.logo{
|
||||
display:block;
|
||||
margin:2em auto;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
color:white;
|
||||
opacity:0.4;
|
||||
|
||||
em{
|
||||
font-family: verdant;
|
||||
font-style: normal;
|
||||
font-size:7.7em;
|
||||
line-height:1em;
|
||||
}
|
||||
span{
|
||||
display:none;
|
||||
}
|
||||
&:hover{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
|
||||
#nav-toggle{
|
||||
.push(0.65);
|
||||
.box-shadow(0px 0px 10px 5px rgba(255, 255, 255, 0.5));
|
||||
cursor:pointer;
|
||||
position:fixed;
|
||||
background: @color-grey-1;
|
||||
width:40px;
|
||||
opacity:0.8;
|
||||
|
||||
&:before{
|
||||
font-size:30px;
|
||||
color:white;
|
||||
line-height:40px;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-main{
|
||||
position:absolute;
|
||||
top: 150px;
|
||||
bottom: 0px;
|
||||
overflow: auto;
|
||||
width:100%;
|
||||
|
||||
ul, li{
|
||||
margin:0;
|
||||
padding:0;
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
ul{
|
||||
border-top:1px solid @color-grey-1-1;
|
||||
}
|
||||
|
||||
li{
|
||||
border-bottom:1px solid @color-grey-1-1;
|
||||
position:relative;
|
||||
|
||||
&.selected{
|
||||
background-color:@color-grey-1;
|
||||
}
|
||||
|
||||
.menu-snippets &.menu-snippets,
|
||||
.menu-users &.menu-users,
|
||||
.menu-snippets &.menu-snippets,
|
||||
.menu-documents &.menu-documents,
|
||||
.menu-images &.menu-images,
|
||||
.menu-search &.menu-search,
|
||||
.menu-explorer &.menu-explorer{
|
||||
background:#222;
|
||||
|
||||
&:after{
|
||||
content: " ";
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0.9em;
|
||||
border: 0.7em solid #fff;
|
||||
border-color: transparent #fff transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
-webkit-font-smoothing: auto;
|
||||
text-decoration:none;
|
||||
text-transform:uppercase;
|
||||
display: block;
|
||||
color: #AAA;
|
||||
padding: 0.9em 1.2em;
|
||||
position:relative;
|
||||
font-size:0.9em;
|
||||
font-weight:400;
|
||||
white-space:nowrap;
|
||||
|
||||
&:before{
|
||||
margin-right:0.3em;
|
||||
}
|
||||
&:hover{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
.more > a{
|
||||
&:before{
|
||||
margin-right:0.4em;
|
||||
}
|
||||
font-size:0.8em;
|
||||
padding:0.2em 1.2em;
|
||||
background-color:@color-grey-1-1;
|
||||
}
|
||||
.more{
|
||||
border:0;
|
||||
}
|
||||
|
||||
.avatar{
|
||||
display:none;
|
||||
}
|
||||
|
||||
/* search form */
|
||||
#menu-search{
|
||||
position:relative;
|
||||
.fields{
|
||||
.transition(background-color 0.2s ease);
|
||||
background-color:@color-grey-1;
|
||||
border:0;
|
||||
li{
|
||||
border:0;
|
||||
}
|
||||
}
|
||||
.field{
|
||||
padding:0;
|
||||
color: #AAA;
|
||||
|
||||
&:before{
|
||||
position:absolute;
|
||||
left:0.75em;
|
||||
top:0.45em;
|
||||
}
|
||||
}
|
||||
.submit{
|
||||
.visuallyhidden();
|
||||
}
|
||||
label{
|
||||
-webkit-font-smoothing: auto;
|
||||
line-height:inherit;
|
||||
text-transform:uppercase;
|
||||
padding: 0.9em 1.2em 0.9em 3.5em;
|
||||
}
|
||||
input{
|
||||
float:left;
|
||||
margin-top:-1000px;
|
||||
text-transform:uppercase;
|
||||
font-size:1em;
|
||||
padding: 0.9em 1.2em 0.9em 3.5em;
|
||||
border:0;
|
||||
border-radius:0;
|
||||
background-color:transparent;
|
||||
line-height:inherit;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
.field, input{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
&.focussed{
|
||||
label{
|
||||
display:none;
|
||||
}
|
||||
.fields{
|
||||
background-color:@color-grey-4;
|
||||
}
|
||||
.field{
|
||||
color: @color-grey-1;
|
||||
}
|
||||
input{
|
||||
margin-top:0px;
|
||||
color:@color-grey-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.js .nav-main .more ul{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.explorer{
|
||||
position:absolute;
|
||||
margin-top:150px; /* same as .nav-main */
|
||||
}
|
||||
|
||||
.content-wrapper{
|
||||
width:100%;
|
||||
float: right;
|
||||
position: relative;
|
||||
background-color:white;
|
||||
border-bottom:1px solid @color-grey-4;
|
||||
transform: translate3d(0,0,0);
|
||||
-webkit-transform: translate3d(0,0,0);
|
||||
}
|
||||
.content{
|
||||
.row();
|
||||
border-top:40px solid @color-grey-5; /* this top border provides space for the floating logo to toggle the menu */
|
||||
padding-bottom:3em;
|
||||
}
|
||||
|
||||
body.nav-open .nav-wrapper{
|
||||
margin-left:0;
|
||||
}
|
||||
|
||||
body.nav-open .content-wrapper{
|
||||
transform: translate3d(80%,0,0);
|
||||
-webkit-transform: translate3d(80%,0,0);
|
||||
|
||||
position:fixed;
|
||||
}
|
||||
|
||||
body.nav-open #nav-toggle{
|
||||
left:80%;
|
||||
&:before{
|
||||
content:"z";
|
||||
}
|
||||
}
|
||||
|
||||
body.explorer-open .explorer{
|
||||
display:block;
|
||||
border-top:1px solid rgba(200,200,200,0.1);
|
||||
|
||||
&:before{
|
||||
position:absolute;
|
||||
top:-3em;
|
||||
content:"Close explorer";
|
||||
padding:0.9em;
|
||||
}
|
||||
}
|
||||
|
||||
body.explorer-open .nav-main{
|
||||
display:none;
|
||||
}
|
||||
|
||||
header{
|
||||
.nice-padding();
|
||||
padding-top:2em;
|
||||
padding-bottom:1em;
|
||||
background-color: @color-grey-5;
|
||||
border-bottom:1px solid @color-grey-4;
|
||||
margin-bottom:2em;
|
||||
|
||||
h1, h2{
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.left{
|
||||
float:left;
|
||||
}
|
||||
.right{
|
||||
float:right;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
/* For case where content below header should merge with it */
|
||||
&.merged{
|
||||
margin-bottom:0;
|
||||
}
|
||||
&.tab-merged, &.no-border{
|
||||
border:0;
|
||||
}
|
||||
&.merged.no-border{
|
||||
padding-bottom:0;
|
||||
}
|
||||
}
|
||||
|
||||
.page-explorer header{
|
||||
margin-bottom:0;
|
||||
padding-bottom:1em;
|
||||
}
|
||||
|
||||
|
||||
footer{
|
||||
.row();
|
||||
background: @color-grey-1;
|
||||
background: rgba(0,0,0,0.7);
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
height:3.4em;
|
||||
padding:0.3em;
|
||||
width:90%;
|
||||
margin:0 5%;
|
||||
color:white;
|
||||
|
||||
ul{
|
||||
.unlist();
|
||||
}
|
||||
li{
|
||||
float:left;
|
||||
}
|
||||
|
||||
.actions{
|
||||
width:250px;
|
||||
margin-right:@grid-gutter-width/2;
|
||||
|
||||
.button{
|
||||
padding-top:1em;
|
||||
padding-bottom:1em;
|
||||
}
|
||||
}
|
||||
|
||||
.meta{
|
||||
float:right;
|
||||
text-align:right;
|
||||
padding-right:@grid-gutter-width/2;
|
||||
line-height:3.5em;
|
||||
font-size:0.85em;
|
||||
|
||||
span{
|
||||
margin-right:@grid-gutter-width;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
background: @color-grey-1;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: @color-grey-2;
|
||||
-webkit-border-radius: 1ex;
|
||||
}
|
||||
::-webkit-scrollbar-corner {
|
||||
background: @color-grey-1;
|
||||
}
|
||||
|
||||
|
||||
/* Z-indexes */
|
||||
#nav-toggle{
|
||||
z-index:5;
|
||||
}
|
||||
.nav-wrapper{
|
||||
z-index:2;
|
||||
}
|
||||
.content-wrapper{
|
||||
z-index:3;
|
||||
}
|
||||
footer, .logo{
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.breadcrumb{
|
||||
.unlist();
|
||||
.clearfix();
|
||||
|
||||
font-size:0.85em;
|
||||
margin-top:1em !important;
|
||||
|
||||
li {
|
||||
display: block;
|
||||
float: left;
|
||||
background: @color-grey-3;
|
||||
padding: 0.5em 1em 0.5em 2em;
|
||||
position: relative;
|
||||
margin: 0 4px 4px 0;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
line-height:1em;
|
||||
white-space: nowrap;
|
||||
max-width:30em;
|
||||
line-height:1.5em;
|
||||
|
||||
a{
|
||||
color:@color-grey-2;
|
||||
display:block;
|
||||
max-width:25em;
|
||||
white-space: nowrap;
|
||||
text-overflow:ellipsis;
|
||||
overflow:hidden;
|
||||
line-height:1.6em;
|
||||
}
|
||||
|
||||
&:after, &:before{
|
||||
content: "";
|
||||
border-top: 1.3em solid transparent;
|
||||
border-bottom: 1.3em solid transparent;
|
||||
}
|
||||
&:after {
|
||||
border-left: 1em solid @color-grey-3;
|
||||
position: absolute; right: -0.9em; top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
&:before {
|
||||
border-left: 1em solid @color-header-bg;
|
||||
position: absolute; left: 0; top: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: @color-teal;
|
||||
|
||||
a{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
&:hover:after {
|
||||
border-left-color: @color-teal;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
padding:0.5em;
|
||||
.border-radius(3px 0px 0px 3px);
|
||||
|
||||
&:before{
|
||||
display:none;
|
||||
width:1em;
|
||||
}
|
||||
a {
|
||||
width:2em;
|
||||
font-size:1em;
|
||||
&:before{
|
||||
line-height:1em;
|
||||
font-size:1.7em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
.col1{
|
||||
.column(1);
|
||||
}
|
||||
.col2{
|
||||
.column(2);
|
||||
}
|
||||
.col3{
|
||||
.column(3);
|
||||
}
|
||||
.col4{
|
||||
.column(4);
|
||||
}
|
||||
.col5{
|
||||
.column(5);
|
||||
}
|
||||
.col6{
|
||||
.column(6);
|
||||
}
|
||||
.col7{
|
||||
.column(7);
|
||||
}
|
||||
.col8{
|
||||
.column(8);
|
||||
}
|
||||
.col9{
|
||||
.column(9);
|
||||
}
|
||||
.col10{
|
||||
.column(10);
|
||||
}
|
||||
.col11{
|
||||
.column(11);
|
||||
}
|
||||
.col12{
|
||||
.column(12);
|
||||
}
|
||||
|
||||
body{
|
||||
margin-left:@menu-width;
|
||||
}
|
||||
|
||||
.browsermessage{
|
||||
margin:0 0 0 -150px;
|
||||
}
|
||||
.content-wrapper{
|
||||
z-index:0;
|
||||
-webkit-transform:none;
|
||||
transform:none;
|
||||
}
|
||||
|
||||
.nav-wrapper{
|
||||
/* heigt and position necessary to force it to 100% height of screen (with some JS help) */
|
||||
position:absolute;
|
||||
left:0;
|
||||
height:100%;
|
||||
width:@menu-width;
|
||||
margin-left: -@menu-width;
|
||||
}
|
||||
|
||||
.content{
|
||||
border-top:0;
|
||||
background-color:none;
|
||||
padding-top:0;
|
||||
}
|
||||
|
||||
.inner{ /* inner only serves a purpose to position content */
|
||||
height:100%;
|
||||
position:fixed;
|
||||
width:@menu-width;
|
||||
}
|
||||
|
||||
#nav-toggle{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.nav-main{
|
||||
margin-bottom: 116px; /* WARNING: magic number - the height of the .footer */
|
||||
|
||||
li{
|
||||
z-index:1;
|
||||
}
|
||||
.footer{
|
||||
padding-top:1em;
|
||||
background-color:@color-grey-1;
|
||||
position:fixed;
|
||||
width:@menu-width - 7;
|
||||
bottom:0;
|
||||
text-align:center;
|
||||
z-index:2;
|
||||
}
|
||||
.avatar{
|
||||
display:block;
|
||||
margin:auto;
|
||||
text-align:center;
|
||||
margin-bottom:1em;
|
||||
|
||||
a{
|
||||
padding:0 0 1em 0;
|
||||
border-bottom:1px solid rgba(200,200,200,0.1);
|
||||
}
|
||||
&:before{
|
||||
color:@color-grey-2;
|
||||
border: 2px solid @color-grey-2;
|
||||
}
|
||||
&:hover{
|
||||
.box-shadow(0px 0px 6px 0px rgba(0,0,0,1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.explorer {
|
||||
width: 400px;
|
||||
position: absolute;
|
||||
z-index:@explorer-z-index;
|
||||
top:0;
|
||||
left:99%;
|
||||
}
|
||||
.dl-menu {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* UN-set the transformations used on mobile */
|
||||
body.nav-open .content-wrapper{
|
||||
position:relative;
|
||||
transform: none;
|
||||
-webkit-transform: none;
|
||||
}
|
||||
body.nav-open .nav-wrapper{
|
||||
margin-left: -@menu-width;
|
||||
}
|
||||
body.nav-open .nav-wrapper,
|
||||
body.nav-open .nav-main{
|
||||
width:@menu-width;
|
||||
}
|
||||
|
||||
body.explorer-open .explorer:before{
|
||||
display:none;
|
||||
}
|
||||
body.explorer-open .nav-main{
|
||||
display:block;
|
||||
}
|
||||
|
||||
header{
|
||||
padding-top:2em;
|
||||
padding-bottom:2em;
|
||||
.nice-padding();
|
||||
}
|
||||
footer{
|
||||
width:80%;
|
||||
margin-left:40px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Transitions */
|
||||
.content-wrapper,
|
||||
.nav-main,
|
||||
#nav-toggle,
|
||||
footer,
|
||||
.logo{
|
||||
.transition(all 0.2s ease); /* TODO: ensure that nav-wrapper can't be seen to be gradually expanding to fill height of screen, by removing unnecessary transitions */
|
||||
}
|
||||
.nav-wrapper{
|
||||
.transition-transform(0.2s ease);
|
||||
}
|
||||
.nav-main a, a{
|
||||
.transition(~"color 0.2s ease, background-color 0.2s ease");
|
||||
}
|
||||
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/fonts/verdant.eot
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>This SVG font generated by Fontastic.me</metadata>
|
||||
<defs>
|
||||
<font id="verdant" horiz-adv-x="512">
|
||||
<font-face font-family="verdant" font-weight="500" font-stretch="normal" units-per-em="512" panose-1="2 0 6 9 0 0 0 0 0 0" ascent="480" descent="-32" x-height="348" cap-height="443" bbox="0 -34.2014 512 480" underline-thickness="50" underline-position="-100" unicode-range="U+0041-007A"/>
|
||||
<missing-glyph/>
|
||||
<glyph glyph-name="a" unicode="a" d="M171 156c37 0 68 31 68 68s-31 68 -68 68s-69 -31 -69 -68s32 -68 69 -68zM410 53c19 0 34 15 34 34c0 18 -16 35 -34 35s-35 -17 -35 -35c0 -19 16 -34 35 -34zM410 326c19 0 34 16 34 35c0 18 -16 34 -34 34s-35 -16 -35 -34c0 -19 16 -35 35 -35zM341 248v-49 c0 -3 -3 -8 -6 -8l-41 -6c-2 -6 -5 -14 -9 -21c6 -9 14 -18 24 -30c1 -2 2 -4 2 -6s-1 -4 -2 -5c-4 -5 -35 -40 -43 -40c-2 0 -3 1 -5 2l-31 24c-7 -3 -13 -6 -20 -8c-2 -19 -5 -33 -7 -41c-1 -4 -4 -7 -8 -7h-49c-4 0 -8 3 -8 7l-6 41c-6 2 -13 4 -20 8l-32 -24 c-1 -1 -3 -2 -5 -2s-4 2 -6 3c-26 24 -38 37 -38 42c0 2 1 3 2 5c4 5 19 26 23 31c-4 8 -7 15 -9 22l-41 6c-4 0 -6 4 -6 8v49c0 3 3 8 6 8l41 6c2 6 5 14 9 21c-6 9 -14 18 -24 30c-1 2 -2 4 -2 6s1 4 2 5c4 5 35 40 43 40c2 0 4 -1 6 -2l30 -24c6 3 13 6 21 8 c2 19 4 33 6 41c1 4 4 7 8 7h49c4 0 8 -3 8 -7l7 -41c6 -2 13 -4 20 -8l31 24c1 1 3 2 5 2s4 -2 6 -3c26 -24 38 -37 38 -42c0 -2 0 -3 -1 -5c-4 -5 -20 -25 -24 -31c4 -9 7 -16 9 -22l41 -6c3 -1 6 -4 6 -8zM375 186c4 0 25 -29 27 -31c4 0 6 1 8 1s4 -1 8 -1 c9 13 17 23 24 30l2 1c1 0 12 -7 33 -19c1 -1 1 -1 1 -2c0 -4 -5 -17 -14 -37c3 -4 6 -9 8 -14c26 -3 40 -5 40 -8v-37c0 -3 -14 -5 -40 -8c-2 -5 -5 -10 -8 -14c9 -20 14 -33 14 -37c0 -1 0 -1 -1 -2c-22 -13 -33 -19 -33 -19c-4 0 -24 29 -26 31c-4 0 -6 -1 -8 -1 s-4 1 -8 1c-2 -2 -23 -31 -27 -31c0 0 -11 6 -33 19c-1 1 -1 1 -1 2c0 4 5 17 14 37c-3 4 -6 9 -8 14c-26 3 -40 5 -40 8v37c0 3 14 5 40 8c2 5 5 10 8 14c-9 20 -14 33 -14 37c0 3 5 3 11 7c6 3 10 6 15 9s8 5 8 5zM375 459c4 0 25 -29 27 -31c4 0 6 1 8 1s4 -1 8 -1 c9 13 17 23 24 30l2 1c1 0 12 -7 33 -19c1 -1 1 -1 1 -2c0 -4 -5 -17 -14 -37c3 -4 6 -9 8 -14c26 -3 40 -5 40 -8v-37c0 -3 -14 -5 -40 -8c-2 -5 -5 -10 -8 -14c9 -20 14 -33 14 -37c0 -1 0 -1 -1 -2c-22 -13 -33 -19 -33 -19c-4 0 -24 29 -26 31c-4 0 -6 -1 -8 -1 s-4 1 -8 1c-2 -2 -23 -31 -27 -31c0 0 -11 6 -33 19c-1 1 -1 1 -1 2c0 4 5 17 14 37c-3 4 -6 9 -8 14c-26 3 -40 5 -40 8v37c0 3 14 5 40 8c2 5 5 10 8 14c-9 20 -14 33 -14 37c0 3 5 3 11 7c6 3 10 6 15 9s8 5 8 5z"/>
|
||||
<glyph glyph-name="b" unicode="b" d="M256 288c0 -15 12 -27 27 -27h156v-229c0 -15 -13 -27 -28 -27h-310c-15 0 -28 12 -28 27v384c0 15 13 27 28 27h155v-155zM438 297h-145v146c16 -3 27 -9 37 -19l89 -89c10 -10 16 -22 19 -38z"/>
|
||||
<glyph glyph-name="c" unicode="c" d="M283 261c-15 0 -27 12 -27 27v119h-146v-366h292v220h-119zM293 297h107c-2 6 -4 10 -6 12l-90 89c-2 2 -5 5 -11 7v-108zM73 416c0 15 13 27 28 27h182c17 0 38 -10 47 -19l89 -89c9 -9 20 -30 20 -47v-256c0 -15 -13 -27 -28 -27h-310c-15 0 -28 12 -28 27v384z"/>
|
||||
<glyph glyph-name="d" unicode="d" d="M140 41l26 26l-67 67l-26 -26v-30h37v-37h30zM290 306c0 4 -3 7 -7 7c-2 0 -3 -1 -4 -2l-155 -155c-1 -1 -2 -3 -2 -5c0 -4 2 -6 6 -6c2 0 4 1 5 2l155 154c1 1 2 3 2 5zM274 361l119 -119l-238 -237h-118v118zM469 334c0 -10 -3 -19 -10 -26l-48 -47l-118 118l47 48 c7 7 16 10 26 10s19 -3 26 -10l67 -67c7 -7 10 -16 10 -26z"/>
|
||||
<glyph glyph-name="e" unicode="e" d="M399 142c0 -2 -1 -5 -3 -7l-15 -14c-2 -2 -4 -3 -6 -3s-5 1 -7 3l-112 112l-112 -112c-2 -2 -5 -3 -7 -3s-4 1 -6 3l-15 14c-2 2 -3 5 -3 7s1 4 3 6l133 133c2 2 5 3 7 3s5 -1 7 -3l133 -133c2 -2 3 -4 3 -6z"/>
|
||||
<glyph glyph-name="f" unicode="f" d="M347 242c0 35 -12 66 -37 91s-56 37 -91 37s-65 -12 -90 -37s-38 -56 -38 -91s13 -65 38 -90s55 -38 90 -38s66 13 91 38s37 55 37 90zM494 5c0 -20 -17 -37 -37 -37c-10 0 -19 4 -26 11l-98 98c-34 -24 -72 -36 -114 -36c-60 0 -110 27 -142 59s-59 82 -59 142 s27 111 59 143s82 58 142 58s111 -26 143 -58s59 -83 59 -143c0 -42 -12 -80 -36 -114l98 -98c7 -7 11 -15 11 -25z"/>
|
||||
<glyph glyph-name="g" unicode="g" d="M426 102c0 -8 -3 -14 -8 -19l-39 -39c-5 -5 -12 -8 -20 -8s-14 3 -19 8l-84 84l-84 -84c-5 -5 -11 -8 -19 -8s-15 3 -20 8l-39 39c-5 5 -8 11 -8 19s3 15 8 20l84 84l-84 84c-5 5 -8 11 -8 19s3 15 8 20l39 38c5 5 12 8 20 8s14 -3 19 -8l84 -84l84 84c5 5 11 8 19 8 s15 -3 20 -8l39 -38c5 -5 8 -12 8 -20s-3 -14 -8 -19l-84 -84l84 -84c5 -5 8 -12 8 -20z"/>
|
||||
<glyph glyph-name="i" unicode="i" d="M475 215c0 6 -5 9 -14 9h-290c-16 0 -34 -11 -42 -20l-79 -97c-3 -4 -4 -7 -4 -10c0 -6 5 -10 14 -10h290c16 0 35 11 42 20l78 97c3 4 5 8 5 11zM60 395c-14 0 -26 -12 -26 -26v-227l68 84c13 16 42 32 69 32h204v43c0 14 -11 25 -25 25h-154c-14 0 -25 12 -25 26v17 c0 14 -12 26 -26 26h-85zM461 258c27 0 48 -16 48 -43c0 -11 -4 -22 -12 -32l-79 -97c-13 -16 -41 -33 -68 -33h-290c-32 0 -60 28 -60 60v256c0 32 28 60 60 60h85c32 0 60 -28 60 -60v-8h145c32 0 60 -28 60 -60v-43h51z"/>
|
||||
<glyph glyph-name="j" unicode="j" d="M430 370c35 0 64 -29 64 -64v-201c0 -35 -29 -64 -64 -64h-348c-35 0 -64 29 -64 64v274c0 35 29 64 64 64h92c35 0 64 -29 64 -64v-9h192z"/>
|
||||
<glyph glyph-name="k" unicode="k" d="M46 5c-25 0 -46 20 -46 45v227c8 -9 18 -18 29 -25c69 -47 116 -79 142 -98c22 -16 28 -23 53 -33c11 -5 22 -7 32 -7v0c20 0 47 13 59 21c7 4 15 11 26 19c32 23 80 56 142 98c11 7 21 16 29 25v-227c0 -25 -21 -45 -46 -45h-420zM466 407c25 0 46 -21 46 -46 c0 -35 -26 -62 -49 -78c-83 -58 -115 -79 -146 -102c-12 -9 -17 -12 -30 -20c-9 -5 -19 -10 -31 -10v0c-18 0 -35 11 -46 19c-5 4 -22 17 -27 20c-19 13 -116 81 -134 93s-49 44 -49 72c0 29 17 52 46 52h420z"/>
|
||||
<glyph glyph-name="l" unicode="l" d="M183 370c-10 0 -18 9 -18 19c0 5 1 8 5 12l73 74c4 4 8 5 13 5s9 -1 13 -5l73 -74c4 -4 5 -7 5 -12c0 -10 -8 -19 -18 -19h-36v-292h36c10 0 18 -9 18 -19c0 -5 -1 -8 -5 -12l-73 -74c-4 -4 -8 -5 -13 -5s-9 1 -13 5l-73 74c-4 4 -5 7 -5 12c0 10 8 19 18 19h36v292h-36z "/>
|
||||
<glyph glyph-name="m" unicode="m" d="M256 389c-40 0 -73 -34 -73 -74v-54h146v54c0 40 -33 74 -73 74zM393 261c15 0 28 -13 28 -28v-164c0 -15 -13 -28 -28 -28h-274c-15 0 -28 13 -28 28v164c0 15 13 28 28 28h9v54c0 35 13 66 38 91s55 37 90 37s65 -12 90 -37s38 -56 38 -91v-54h9z"/>
|
||||
<glyph glyph-name="n" unicode="n" d="M335 206c0 -2 -1 -5 -3 -7l-133 -133c-2 -2 -5 -3 -7 -3s-5 1 -7 3l-14 14c-2 2 -3 5 -3 7s1 4 3 6l112 113l-112 112c-2 2 -3 5 -3 7s1 4 3 6l14 14c2 2 5 3 7 3s5 -1 7 -3l133 -133c2 -2 3 -4 3 -6z"/>
|
||||
<glyph glyph-name="h" unicode="h" d="M357 151c5 0 9 -4 9 -9v-19c0 -5 -4 -9 -9 -9h-202c-5 0 -9 4 -9 9v19c0 5 4 9 9 9h202zM357 224c5 0 9 -4 9 -9v-18c0 -5 -4 -10 -9 -10h-202c-5 0 -9 5 -9 10v18c0 5 4 9 9 9h202zM283 261c-15 0 -27 12 -27 27v119h-146v-366h292v220h-119zM293 297h107 c-2 6 -4 10 -6 12l-90 89c-2 2 -5 5 -11 7v-108zM73 416c0 15 13 27 28 27h182c17 0 38 -10 47 -19l89 -89c9 -9 20 -30 20 -47v-256c0 -15 -13 -27 -28 -27h-310c-15 0 -28 12 -28 27v384z"/>
|
||||
<glyph glyph-name="o" unicode="o" d="M119 361c28 0 52 -24 52 -52s-24 -51 -52 -51s-51 23 -51 51s23 52 51 52zM444 207v-120h-376v52l86 85l42 -43l137 137zM478 386c0 5 -4 9 -9 9h-426c-5 0 -9 -4 -9 -9v-324c0 -5 4 -9 9 -9h426c5 0 9 4 9 9v324zM469 429c23 0 43 -20 43 -43v-324 c0 -23 -20 -43 -43 -43h-426c-23 0 -43 20 -43 43v324c0 23 20 43 43 43h426z"/>
|
||||
<glyph glyph-name="p" unicode="p" d="M18 233c0 15 13 28 28 28h192v54c0 35 12 66 37 91s56 37 91 37s65 -12 90 -37s38 -56 38 -91v-73c0 -10 -9 -18 -19 -18h-18c-10 0 -18 8 -18 18v73c0 40 -33 74 -73 74s-73 -34 -73 -74v-54h27c15 0 27 -13 27 -28v-164c0 -15 -12 -28 -27 -28h-274 c-15 0 -28 13 -28 28v164z"/>
|
||||
<glyph glyph-name="q" unicode="q" d="M399 270c0 -2 -1 -5 -3 -7l-133 -133c-2 -2 -5 -3 -7 -3s-5 1 -7 3l-133 133c-2 2 -3 5 -3 7s1 4 3 6l15 15c2 2 4 2 6 2s5 0 7 -2l112 -113l112 113c2 2 5 2 7 2s4 0 6 -2l15 -15c2 -2 3 -4 3 -6z"/>
|
||||
<glyph glyph-name="r" unicode="r" d="M357 78c5 0 9 4 9 9v18c0 5 -4 9 -9 9h-202c-5 0 -9 -4 -9 -9v-18c0 -5 4 -9 9 -9h202zM357 151c5 0 9 4 9 9v18c0 5 -4 9 -9 9h-202c-5 0 -9 -4 -9 -9v-18c0 -5 4 -9 9 -9h202zM256 288c0 -15 12 -27 27 -27h156v-229c0 -15 -13 -27 -28 -27h-310c-15 0 -28 12 -28 27 v384c0 15 13 27 28 27h155v-155zM438 297h-145v146c16 -3 27 -9 37 -19l89 -89c10 -10 16 -22 19 -38z"/>
|
||||
<glyph glyph-name="s" unicode="s" d="M430 78c15 0 27 12 27 27v201c0 15 -12 28 -27 28h-201c-15 0 -28 12 -28 27v18c0 15 -12 28 -27 28h-92c-15 0 -27 -13 -27 -28v-274c0 -15 12 -27 27 -27h348zM430 370c35 0 64 -29 64 -64v-201c0 -35 -29 -64 -64 -64h-348c-35 0 -64 29 -64 64v274c0 35 29 64 64 64 h92c35 0 64 -29 64 -64v-9h192z"/>
|
||||
<glyph glyph-name="t" unicode="t" d="M430 297c15 0 27 -12 27 -27v-55c0 -15 -12 -28 -27 -28h-119v-118c0 -15 -13 -28 -28 -28h-54c-15 0 -28 13 -28 28v118h-119c-15 0 -27 13 -27 28v55c0 15 12 27 27 27h119v119c0 15 13 27 28 27h54c15 0 28 -12 28 -27v-119h119z"/>
|
||||
<glyph glyph-name="u" unicode="u" d="M128 315c20 0 37 17 37 37s-17 37 -37 37s-37 -17 -37 -37s17 -37 37 -37zM37 407c0 20 16 36 36 36h119c23 0 51 -14 63 -26l204 -204c7 -7 10 -16 10 -26s-3 -18 -10 -25l-140 -141c-7 -7 -16 -10 -26 -10s-19 3 -26 10l-204 205c-12 12 -26 39 -26 62v119z"/>
|
||||
<glyph glyph-name="v" unicode="v" d="M478 224c11 0 23 -4 23 -15c0 -6 -2 -12 -8 -18l-90 -105c-13 -15 -43 -33 -70 -33h-290c-11 0 -24 4 -24 15c0 6 3 12 9 18l89 105c13 15 44 33 71 33h290zM350 361c32 0 60 -28 60 -60v-43h-222c-38 0 -79 -22 -97 -44c-30 -36 -61 -72 -91 -108v7v256 c0 32 28 60 60 60h85c32 0 60 -28 60 -60v-8h145z"/>
|
||||
<glyph glyph-name="w" unicode="w" d="M256 151c40 0 73 33 73 73s-33 73 -73 73s-73 -33 -73 -73s33 -73 73 -73zM475 255v-63c0 -5 -4 -10 -8 -11l-52 -8c-4 -10 -8 -19 -12 -26c7 -10 17 -22 31 -39c2 -2 3 -5 3 -7s-1 -5 -3 -7c-5 -7 -44 -51 -55 -51c-2 0 -4 1 -7 3l-40 31c-8 -4 -17 -8 -26 -11 c-3 -26 -6 -43 -8 -53c-1 -5 -4 -8 -10 -8h-64c-5 0 -10 3 -10 8l-8 53c-9 3 -18 6 -26 10l-40 -30c-2 -2 -4 -3 -7 -3s-5 1 -7 3c-24 22 -40 38 -47 48c-1 2 -2 5 -2 7s0 4 2 6c5 7 25 33 30 40c-5 10 -9 19 -12 28l-52 8c-5 1 -8 5 -8 10v63c0 5 3 10 7 11l53 8 c3 9 7 17 12 26c-8 11 -18 24 -31 39c-2 2 -3 5 -3 7s1 5 3 7c5 6 45 51 55 51c2 0 5 -1 7 -3l40 -31c8 4 17 8 26 11c3 26 6 43 8 53c1 5 4 8 10 8h64c5 0 10 -3 10 -8l8 -53c9 -3 18 -6 26 -10l40 30c2 2 4 3 7 3c2 0 5 -1 7 -3c25 -23 40 -39 47 -49c1 -2 2 -3 2 -6 c0 -2 0 -4 -2 -6c-5 -7 -25 -33 -30 -40c5 -10 9 -19 12 -28l52 -8c5 -1 8 -5 8 -10z"/>
|
||||
<glyph glyph-name="x" unicode="x" d="M477 318c0 -8 -3 -14 -8 -19c-82 -82 -163 -164 -245 -246c-5 -5 -12 -8 -20 -8s-14 3 -19 8l-142 142c-5 5 -8 12 -8 20s3 14 8 19l38 39c5 5 12 8 20 8s14 -3 19 -8l84 -84l188 188c5 5 11 8 19 8s15 -3 20 -8l38 -39c5 -5 8 -12 8 -20z"/>
|
||||
<glyph glyph-name="z" unicode="z" d="M344 325c0 -2 -1 -5 -3 -7l-112 -112l112 -113c2 -2 3 -4 3 -6s-1 -5 -3 -7l-14 -14c-2 -2 -5 -3 -7 -3s-5 1 -7 3l-133 133c-2 2 -3 5 -3 7s1 4 3 6l133 133c2 2 5 3 7 3s5 -1 7 -3l14 -14c2 -2 3 -4 3 -6z"/>
|
||||
<glyph glyph-name="A" unicode="A" d="M232 109l176 175c4 4 5 8 5 13s-1 9 -5 13l-29 29c-4 4 -8 6 -13 6s-9 -2 -13 -6l-134 -133l-60 60c-4 4 -8 5 -13 5s-9 -1 -13 -5l-29 -29c-4 -4 -5 -8 -5 -13s1 -9 5 -13l103 -102c4 -4 7 -6 12 -6s9 2 13 6zM393 443c45 0 82 -37 82 -82v-274c0 -45 -37 -82 -82 -82 h-274c-45 0 -82 37 -82 82v274c0 45 37 82 82 82h274z"/>
|
||||
<glyph glyph-name="B" unicode="B" d="M366 187c10 0 18 9 18 19v36c0 10 -8 19 -18 19h-73v73c0 10 -9 18 -19 18h-36c-10 0 -19 -8 -19 -18v-73h-73c-10 0 -18 -9 -18 -19v-36c0 -10 8 -19 18 -19h73v-73c0 -10 9 -18 19 -18h36c10 0 19 8 19 18v73h73zM475 224c0 -88 -50 -155 -109 -190 c-34 -20 -70 -29 -110 -29c-88 0 -155 50 -190 109c-20 34 -29 70 -29 110c0 88 50 155 109 190c34 20 70 29 110 29c88 0 155 -50 190 -109c20 -34 29 -70 29 -110z"/>
|
||||
<glyph glyph-name="D" unicode="D" d="M173 22c-79 24 -309 124 -49 458c140 -95 194 -179 204 -248c-67 -24 -113 -71 -107 -156c-37 87 -66 208 -78 283c-6 -88 7 -244 30 -337zM262 1c-19 54 -59 229 241 219c9 -274 -136 -265 -202 -246c27 53 62 100 106 141c-55 -30 -103 -68 -145 -114z"/>
|
||||
<glyph glyph-name="C" unicode="C" d="M253 36c68 0 108 29 108 96c0 22 -4 38 -12 51c-23 37 -49 46 -111 46c-14 0 -24 -1 -29 -3v-41v-50l1 -77c0 -3 1 -7 3 -13c14 -6 28 -9 40 -9zM241 257c64 0 100 19 100 82c0 21 -8 40 -24 54s-40 21 -73 21c-10 0 -22 -2 -37 -4c0 -8 1 -16 1 -22c1 -23 1 -49 1 -79 v-28v-22c8 -1 19 -2 32 -2zM259 443h18h21c17 0 35 -3 55 -8c43 -13 81 -42 81 -97c0 -32 -17 -52 -37 -67c-5 -4 -18 -11 -42 -22c34 -8 59 -21 76 -41c18 -20 26 -43 26 -68c0 -54 -31 -92 -68 -110c-26 -13 -69 -22 -115 -20l-56 1c-16 0 -44 -1 -85 -3 c-6 -1 -32 -1 -78 -3v26c20 4 41 7 55 13c3 5 5 9 6 14c2 13 3 32 3 56l-1 142c-1 49 -2 87 -3 115c0 32 1 37 -26 39c-6 0 -16 2 -32 4l-2 23l75 2l108 4h13h8z"/>
|
||||
<glyph glyph-name="E" unicode="E" d="M312 5h-19c-2 0 -4 -1 -8 0s-17 3 -41 5l-57 1c-6 0 -63 -5 -77 -6l5 24c1 0 8 2 22 6s25 7 33 11c6 7 9 17 11 29c7 39 16 77 24 116l4 19c4 23 8 45 15 65c1 2 1 3 1 3l8 45l5 18c3 18 6 35 9 53v11c-8 4 -22 7 -42 8c-5 0 -8 1 -10 1l5 29l91 -4h20c13 0 56 2 81 4h10 c-1 -9 -3 -18 -5 -25c-18 -6 -45 -12 -60 -18c-4 -10 -9 -33 -11 -48c-8 -38 -15 -68 -19 -88l-17 -89l-11 -45l-12 -67l-4 -13c0 -1 0 -3 1 -7c19 -4 35 -6 53 -9c0 -8 -4 -23 -5 -29z"/>
|
||||
<glyph glyph-name="F" unicode="F" d="M55 133c30 0 55 -25 55 -55s-25 -55 -55 -55s-55 25 -55 55s25 55 55 55zM55 279c30 0 55 -25 55 -55s-25 -55 -55 -55s-55 25 -55 55s25 55 55 55zM503 114c5 0 9 -4 9 -9v-55c0 -5 -4 -9 -9 -9h-348c-5 0 -9 4 -9 9v55c0 5 4 9 9 9h348zM55 425c30 0 55 -25 55 -55 s-25 -55 -55 -55s-55 25 -55 55s25 55 55 55zM503 261c5 0 9 -5 9 -10v-54c0 -5 -4 -10 -9 -10h-348c-5 0 -9 5 -9 10v54c0 5 4 10 9 10h348zM503 407c5 0 9 -4 9 -9v-55c0 -5 -4 -9 -9 -9h-348c-5 0 -9 4 -9 9v55c0 5 4 9 9 9h348z"/>
|
||||
<glyph glyph-name="G" unicode="G" d="M77 56c18 -4 32 -18 32 -39c0 -31 -24 -49 -54 -49c-20 0 -37 6 -50 19l17 25c9 -9 19 -13 30 -13s21 5 21 16c0 12 -10 18 -30 16l-8 16c9 11 22 29 32 39v1c-5 0 -23 -1 -28 -1v-15h-30v43h95v-25zM57 297c27 0 49 -17 49 -44c0 -20 -17 -36 -31 -44 c-8 -4 -15 -10 -22 -15s-10 -10 -10 -15h36v17h30v-45h-103c-1 7 -2 12 -2 15c0 42 37 52 58 72c4 4 7 9 7 13c0 10 -7 15 -16 15s-16 -6 -23 -17l-24 17c8 17 27 31 51 31zM503 114c5 0 9 -4 9 -9v-55c0 -5 -4 -9 -9 -9h-348c-5 0 -9 4 -9 9v55c0 5 4 9 9 9h348zM45 362v69 v4h-1c-2 -3 -6 -9 -14 -16l-20 22l39 36h30v-115h31v-28h-96v28h31zM503 261c5 0 9 -5 9 -10v-54c0 -5 -4 -10 -9 -10h-348c-5 0 -9 5 -9 10v54c0 5 4 10 9 10h348zM503 407c5 0 9 -4 9 -9v-55c0 -5 -4 -9 -9 -9h-348c-5 0 -9 4 -9 9v55c0 5 4 9 9 9h348z"/>
|
||||
<glyph glyph-name="H" unicode="H" d="M105 383c35 33 87 60 151 60c66 0 120 -29 155 -64s64 -89 64 -155s-29 -120 -64 -155s-89 -64 -155 -64c-74 0 -133 35 -169 79c-3 4 -2 9 1 12l39 39c2 2 4 3 7 3s6 -1 7 -3c24 -31 63 -57 115 -57c44 0 80 20 103 43s43 59 43 103s-20 80 -43 103s-59 43 -103 43 c-42 0 -76 -17 -99 -39l39 -39c12 -12 2 -31 -13 -31h-128c-10 0 -18 8 -18 18v128c0 15 19 25 31 13z"/>
|
||||
<glyph glyph-name="I" unicode="I" d="M256 443c64 0 116 -27 151 -60l37 37c6 6 12 7 20 4c7 -3 11 -9 11 -17v-128c0 -10 -8 -18 -18 -18h-128c-15 0 -25 19 -13 31l40 39c-28 26 -62 39 -100 39c-44 0 -80 -20 -103 -43s-43 -59 -43 -103s20 -80 43 -103s59 -43 103 -43c52 0 91 26 115 57c1 2 4 3 7 3 s5 -1 7 -3l39 -39c3 -3 4 -8 1 -12c-36 -44 -95 -79 -169 -79c-66 0 -120 29 -155 64s-64 89 -64 155s29 120 64 155s89 64 155 64z"/>
|
||||
<glyph glyph-name="J" unicode="J" d="M320 151c-16 0 -24 12 -32 20c-6 -6 -9 -12 -9 -20s3 -15 8 -20l58 -59c5 -5 12 -8 20 -8s14 3 19 8l42 41c5 5 8 13 8 20c0 8 -3 14 -8 19l-59 59c-5 5 -12 8 -20 8s-14 -3 -20 -9c8 -8 20 -16 20 -32c0 -15 -12 -27 -27 -27zM192 334c16 0 24 -13 32 -21c6 6 9 13 9 21 s-3 14 -8 19l-58 60c-5 5 -12 8 -20 8c-7 0 -13 -3 -19 -8l-42 -42c-5 -5 -8 -12 -8 -19c0 -8 3 -14 8 -19l59 -60c5 -5 12 -8 20 -8s14 3 20 9c-8 8 -20 16 -20 32c0 15 12 28 27 28zM489 133c0 -23 -8 -42 -24 -58l-42 -42c-16 -16 -35 -24 -58 -24s-42 8 -58 24l-59 60 c-16 16 -24 35 -24 58s8 43 25 59l-25 25c-16 -17 -36 -25 -59 -25s-43 8 -59 24l-59 60c-16 16 -24 35 -24 58s8 42 24 58l42 42c16 16 35 23 58 23s42 -8 58 -24l59 -59c16 -16 24 -35 24 -58s-8 -44 -25 -60l25 -25c16 17 36 25 59 25s43 -8 59 -24l59 -59 c16 -16 24 -35 24 -58z"/>
|
||||
<glyph glyph-name="K" unicode="K" d="M475 224c0 -88 -50 -155 -109 -190c-34 -20 -70 -29 -110 -29c-88 0 -155 50 -190 109c-20 34 -29 70 -29 110c0 88 50 155 109 190c34 20 70 29 110 29c88 0 155 -50 190 -109c20 -34 29 -70 29 -110z"/>
|
||||
<glyph glyph-name="L" unicode="L" d="M256 379c-63 0 -111 -35 -135 -77c-14 -24 -20 -50 -20 -78c0 -63 35 -111 77 -135c24 -14 50 -20 78 -20c63 0 111 35 135 77c14 24 20 50 20 78c0 63 -35 111 -77 135c-24 14 -50 20 -78 20zM475 224c0 -88 -50 -155 -109 -190c-34 -20 -70 -29 -110 -29 c-88 0 -155 50 -190 109c-20 34 -29 70 -29 110c0 88 50 155 109 190c34 20 70 29 110 29c88 0 155 -50 190 -109c20 -34 29 -70 29 -110z"/>
|
||||
<glyph glyph-name="M" unicode="M" d="M479 133c0 -10 -4 -19 -11 -26l-21 -22c-7 -7 -16 -10 -26 -10s-19 3 -26 10l-139 139l-139 -139c-7 -7 -16 -10 -26 -10s-18 3 -25 10l-22 22c-7 7 -11 16 -11 26s4 19 11 26l186 186c7 7 16 10 26 10s19 -3 26 -10l186 -186c7 -7 11 -16 11 -26z"/>
|
||||
<glyph glyph-name="N" unicode="N" d="M479 279c0 -10 -4 -19 -11 -26l-186 -186c-7 -7 -16 -11 -26 -11s-19 4 -26 11l-186 186c-7 7 -11 16 -11 26s4 19 11 26l21 21c7 7 16 11 26 11s19 -4 26 -11l139 -139l139 139c7 7 16 11 26 11s19 -4 26 -11l21 -21c7 -7 11 -16 11 -26z"/>
|
||||
<glyph glyph-name="O" unicode="O" d="M52 190c-28 0 -52 14 -52 42c0 63 11 94 33 94c1 0 5 -1 12 -5c13 -7 37 -17 57 -17c12 0 24 2 36 6c-1 -7 -1 -13 -1 -18c0 -25 7 -47 21 -68c-29 -1 -53 -12 -71 -34h-35zM139 -15c-43 0 -71 26 -71 69c0 67 15 129 63 148c9 4 19 5 30 5c2 0 5 -2 11 -6 c21 -14 47 -31 84 -31c23 0 51 9 65 18c7 5 13 9 19 13s9 6 11 6c58 0 79 -47 88 -96c3 -19 5 -36 5 -57c0 -43 -28 -69 -71 -69h-234zM102 463c37 0 69 -31 69 -68s-32 -69 -69 -69s-68 32 -68 69s31 68 68 68zM256 395c56 0 102 -47 102 -103s-46 -102 -102 -102 s-102 46 -102 102s46 103 102 103zM512 232c0 -28 -24 -42 -52 -42h-35c-18 22 -42 33 -71 34c14 21 21 43 21 68c0 5 0 11 -1 18c12 -4 24 -6 36 -6c20 0 44 10 57 17c7 4 11 5 12 5c22 0 33 -31 33 -94zM410 463c37 0 68 -31 68 -68s-31 -69 -68 -69s-69 32 -69 69 s32 68 69 68z"/>
|
||||
<glyph glyph-name="P" unicode="P" d="M201 114c-11 0 -18 9 -18 19v182c0 12 13 24 27 16l156 -91c6 -3 9 -9 9 -16s-3 -13 -9 -16l-156 -91c-3 -2 -6 -3 -9 -3zM411 224c0 63 -35 111 -77 135c-24 14 -50 20 -78 20c-63 0 -111 -35 -135 -77c-14 -24 -20 -50 -20 -78c0 -63 35 -111 77 -135 c24 -14 50 -20 78 -20c63 0 111 35 135 77c14 24 20 50 20 78zM475 224c0 -88 -50 -155 -109 -190c-34 -20 -70 -29 -110 -29c-88 0 -155 50 -190 109c-20 34 -29 70 -29 110c0 88 50 155 109 190c34 20 70 29 110 29c88 0 155 -50 190 -109c20 -34 29 -70 29 -110z"/>
|
||||
<glyph glyph-name="V" unicode="V" d="M272 156c7 27 30 235 161 227c0 0 -173 -114 -159 -358c-1 10 -7 -4 -11 11c-10 41 17 265 -183 394c-12 8 139 -30 190 -243c1 -2 1 -12 1 -16c-1 -16 1 -15 1 -15z"/>
|
||||
<glyph glyph-name="Q" unicode="Q" d="M183 279c30 0 55 25 55 55s-25 55 -55 55s-55 -25 -55 -55c0 -8 1 -16 5 -24c-8 4 -15 5 -23 5c-30 0 -55 -24 -55 -54s25 -55 55 -55s55 25 55 55c0 8 -2 15 -6 23c8 -4 16 -5 24 -5zM351 197c0 6 27 32 33 32c2 0 5 0 7 -2c25 -25 59 -56 82 -83c5 -6 8 -9 8 -11 c0 -6 -27 -33 -33 -33c-5 0 -15 10 -19 14s-15 16 -18 19l-27 -28l63 -63c5 -5 8 -11 8 -19c0 -16 -18 -34 -34 -34c-8 0 -15 3 -20 8l-192 191c-34 -25 -68 -37 -104 -37c-62 0 -105 43 -105 105c0 71 50 130 98 160c29 18 59 27 89 27c62 0 106 -43 106 -105 c0 -36 -13 -70 -38 -104l102 -101l27 27c-8 8 -21 19 -28 28c-3 4 -5 7 -5 9z"/>
|
||||
<glyph glyph-name="y" unicode="y" d="M392 110c70 -25 105 -45 105 -62v-54h-482v54c0 17 35 37 105 62c32 12 53 24 65 36s18 28 18 48c0 8 -4 16 -12 25s-13 22 -16 38c-1 7 -6 11 -12 13c-8 2 -10 19 -11 31c0 8 3 17 7 19l2 2c-3 17 -5 32 -6 45c-1 18 6 38 21 58s42 29 80 29s65 -9 81 -29s22 -40 20 -58 l-6 -45c6 -3 9 -9 9 -21c-1 -12 -3 -29 -11 -31c-6 -2 -11 -6 -12 -13c-3 -16 -8 -29 -16 -38s-12 -17 -12 -25c0 -20 6 -36 18 -48s34 -24 65 -36z"/>
|
||||
<glyph glyph-name="R" unicode="R" d="M440 357c15 0 28 -13 28 -28v-248c0 -15 -13 -28 -28 -28h-368c-15 0 -28 13 -28 28v248c0 15 13 28 28 28h30l25 32c3 4 8 6 13 6h75c6 0 11 -5 14 -10c3 -4 13 -16 23 -28h188z"/>
|
||||
<glyph glyph-name="S" unicode="S" d="M347 224c5 0 10 -4 10 -9c0 -2 -1 -5 -3 -7l-91 -91c-2 -2 -5 -3 -7 -3s-5 1 -7 3l-91 91c-6 6 -1 16 7 16h54v101c0 5 5 9 10 9h54c5 0 10 -4 10 -9v-101h54zM256 379c-63 0 -111 -35 -135 -77c-14 -24 -20 -50 -20 -78c0 -63 35 -111 77 -135c24 -14 50 -20 78 -20 c63 0 111 35 135 77c14 24 20 50 20 78c0 63 -35 111 -77 135c-24 14 -50 20 -78 20zM475 224c0 -88 -50 -155 -109 -190c-34 -20 -70 -29 -110 -29c-88 0 -155 50 -190 109c-20 34 -29 70 -29 110c0 88 50 155 109 190c34 20 70 29 110 29c88 0 155 -50 190 -109 c20 -34 29 -70 29 -110z"/>
|
||||
<glyph glyph-name="T" unicode="T" d="M387 78c17 0 34 10 34 27c0 23 -19 48 -42 48c-20 0 -32 -16 -32 -37c0 -23 16 -38 40 -38zM238 78c5 0 9 -4 9 -9c0 -2 -1 -5 -3 -7l-91 -91c-2 -2 -5 -3 -7 -3s-4 1 -6 3l-92 91c-6 6 -1 16 7 16h55v393c0 5 4 9 9 9h55c5 0 9 -4 9 -9v-393h55zM379 187 c51 0 82 -45 82 -99c0 -41 -14 -73 -35 -94c-14 -15 -36 -26 -64 -26c-17 0 -31 4 -43 9l11 32c8 -4 20 -7 30 -7c34 0 52 29 58 59h-1c-8 -9 -25 -15 -42 -15c-39 0 -68 31 -68 70c0 40 31 71 72 71zM366 417c0 2 1 8 1 10v4h-1c-3 -5 -4 -7 -9 -12l-18 -16l-24 24l55 53 h35v-187h48v-32h-134v32h47v124z"/>
|
||||
<glyph glyph-name="U" unicode="U" d="M147 480h81v-82h-81v82zM284 480h82v-82h-82v82zM147 336h81v-82h-81v82zM284 336h82v-82h-82v82zM147 193h81v-82h-81v82zM284 193h82v-82h-82v82zM147 49h81v-82h-81v82zM284 49h82v-82h-82v82z"/>
|
||||
<<<<<<< HEAD
|
||||
<glyph glyph-name="W" unicode="W" d="M91 197l1 1l164 136l164 -136s1 0 1 -1v-138c0 -10 -9 -18 -19 -18h-109v110h-74v-110h-109c-10 0 -19 8 -19 18v138zM411 407c5 0 10 -4 10 -9v-117l62 -52c4 -3 4 -9 1 -13l-17 -21c-2 -2 -4 -3 -6 -3h-1c-2 0 -4 1 -6 2l-198 165l-198 -165c-5 -3 -10 -3 -13 1l-17 21 c-3 4 -3 10 1 13l205 171c6 5 14 8 22 8s16 -3 22 -8l69 -58v56c0 5 5 9 10 9h54z"/>
|
||||
=======
|
||||
>>>>>>> feature/ordering-integrated
|
||||
</font>
|
||||
</defs></svg>
|
||||
|
After Width: | Height: | Size: 21 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/fonts/verdant.ttf
Normal file
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/fonts/verdant.woff
Normal file
88
wagtail/wagtailadmin/static/wagtailadmin/css/grid.less
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/* Utility variable — you should never need to modify this */
|
||||
@gridsystem_width: @grid-columns * 1px;
|
||||
@padding: @grid-gutter-width*0.5;
|
||||
@correction: 0.5 / @grid-max-width * 100 * 1%; // NOTE: Check this in IE
|
||||
|
||||
/* Ensure grid columns are set to border-boxes. This is essential */
|
||||
.border-box(){
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content-box(){
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/* Our row container */
|
||||
.row(@padding:0){
|
||||
.clearfix();
|
||||
.border-box();
|
||||
|
||||
display:block;
|
||||
/*max-width: @grid-max-width; NO MAX WIDTH*/
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding-right: @padding;
|
||||
padding-left: @padding;
|
||||
}
|
||||
|
||||
.row-flush(){
|
||||
margin-left:-@padding;
|
||||
margin-right:-@padding;
|
||||
}
|
||||
|
||||
/* Our column container */
|
||||
.column(@x, @padding:@padding, @grid-columns:@grid-columns){
|
||||
.border-box();
|
||||
|
||||
display: inline;
|
||||
float: left;
|
||||
width: 100%*(@x / @grid-columns);
|
||||
padding-right: @padding;
|
||||
padding-left: @padding;
|
||||
}
|
||||
|
||||
.table-column(@x, @padding:@padding, @grid-columns:@grid-columns){
|
||||
.border-box();
|
||||
|
||||
width: 100%*(@x / @grid-columns);
|
||||
/*padding-right: @padding;
|
||||
padding-left: @padding;*/
|
||||
}
|
||||
|
||||
/* Push adds left padding */
|
||||
.push(@offset:1, @grid-columns:@grid-columns) {
|
||||
margin-left: 100%*(@offset / @grid-columns);
|
||||
}
|
||||
.push-padding(@offset:1, @grid-columns:@grid-columns) {
|
||||
padding-left:100%*(@offset / @grid-columns);
|
||||
}
|
||||
|
||||
/* Pull adds right padding */
|
||||
.pull(@offset:1, @grid-columns:@grid-columns) {
|
||||
margin-right: 100%*(@offset / @grid-columns);
|
||||
}
|
||||
.pull-padding(@offset:1, @grid-columns:@grid-columns){
|
||||
padding-right: 100%*(@offset / @grid-columns);
|
||||
}
|
||||
|
||||
.row{
|
||||
.row();
|
||||
}
|
||||
.row-flush{
|
||||
.row-flush();
|
||||
}
|
||||
|
||||
/* must come after row/row-flush */
|
||||
.nice-padding{
|
||||
.push-padding(@grid-content-indent);
|
||||
.pull-padding(@grid-content-indent);
|
||||
}
|
||||
.nice-margin{
|
||||
.push(@grid-content-indent);
|
||||
.pull(@grid-content-indent);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
@import "../variables.less";
|
||||
@import "../mixins.less";
|
||||
@import "../grid.less";
|
||||
|
||||
h1{
|
||||
font-weight:300;
|
||||
font-size:2.2em;
|
||||
}
|
||||
header{
|
||||
.col1{
|
||||
width:50px;
|
||||
margin-right:1em;
|
||||
padding:0;
|
||||
}
|
||||
h2{
|
||||
text-transform:none;
|
||||
}
|
||||
}
|
||||
|
||||
.panel{
|
||||
margin-bottom:4em;
|
||||
}
|
||||
|
||||
.summary{
|
||||
.row();
|
||||
background-color:@color-header-bg;
|
||||
|
||||
h2{
|
||||
.visuallyhidden();
|
||||
}
|
||||
ul{
|
||||
.unlist();
|
||||
width:100%;
|
||||
}
|
||||
li{
|
||||
.column(4);
|
||||
padding-top:3em;
|
||||
padding-bottom:3em;
|
||||
|
||||
&:first-child{
|
||||
.push-padding(@grid-content-indent);
|
||||
}
|
||||
}
|
||||
|
||||
li:before{
|
||||
opacity:0.2;
|
||||
font-size:6em;
|
||||
float:left;
|
||||
}
|
||||
|
||||
span{
|
||||
font-family:Bitter, Georgia, serif;
|
||||
display:block;
|
||||
font-size:4em;
|
||||
line-height:1em;
|
||||
font-weight:300;
|
||||
}
|
||||
}
|
||||
175
wagtail/wagtailadmin/static/wagtailadmin/css/layouts/login.less
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
@import "../variables.less";
|
||||
@import "../mixins.less";
|
||||
@import "../grid.less";
|
||||
|
||||
html{
|
||||
background-color:@color-grey-1;
|
||||
height:100%;
|
||||
}
|
||||
body{
|
||||
margin-left: 0px;
|
||||
height:100%;
|
||||
}
|
||||
h1{
|
||||
.nice-padding();
|
||||
font-weight:300;
|
||||
font-size:2em;
|
||||
line-height:1em;
|
||||
color:white;
|
||||
text-transform: none;
|
||||
white-space: nowrap;
|
||||
|
||||
span{
|
||||
color:white;
|
||||
font-weight:normal;
|
||||
font-family:verdant;
|
||||
font-size:1.8em;
|
||||
line-height:1em;
|
||||
display:inline-block;
|
||||
margin:0 -0.3em;
|
||||
vertical-align: -15%;
|
||||
}
|
||||
}
|
||||
form{
|
||||
width:100%;
|
||||
ul{
|
||||
.unlist();
|
||||
}
|
||||
.fields li{
|
||||
.nice-padding();
|
||||
padding-top:1em;
|
||||
padding-bottom:1em;
|
||||
}
|
||||
.fields .checkbox{
|
||||
padding-top:2em;
|
||||
padding-bottom:2em;
|
||||
}
|
||||
}
|
||||
label{
|
||||
color:white;
|
||||
}
|
||||
input[type=submit]{
|
||||
font-size:1.5em;
|
||||
padding:1.1em 2.4em;
|
||||
}
|
||||
input[type=checkbox]:before{
|
||||
background-color:#333;
|
||||
color:#555;
|
||||
border:1px solid #555;
|
||||
}
|
||||
.fields li.full{
|
||||
position:relative;
|
||||
padding:0;
|
||||
|
||||
label{
|
||||
display:none;
|
||||
}
|
||||
input{
|
||||
border-top: 1px dashed @color-input-border;
|
||||
}
|
||||
}
|
||||
.fields li:first-child input{
|
||||
border-top:0;
|
||||
}
|
||||
|
||||
.field{
|
||||
padding:0;
|
||||
}
|
||||
.field.icon:before{
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
.full label{
|
||||
.border-radius(2px);
|
||||
text-transform:uppercase;
|
||||
padding:2px 5px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
margin-top:-1px;
|
||||
font-size:0.7em;
|
||||
z-index:1;
|
||||
margin:0.2em 0;
|
||||
line-height:1.5em;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
/* Special full-width, one-off fields i.e a single text or textarea input */
|
||||
.full input{
|
||||
.nice-padding;
|
||||
.border-radius(0px);
|
||||
font-weight:300;
|
||||
border:0;
|
||||
padding-top:1.5em;
|
||||
padding-bottom:1.5em;
|
||||
font-size:1.6em;
|
||||
line-height:1.6em;
|
||||
}
|
||||
.help{
|
||||
opacity:1;
|
||||
position:absolute;
|
||||
font-size:1.3em;
|
||||
top:50%;
|
||||
margin-top:-0.5em;
|
||||
right:5%;
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
body{
|
||||
font-size:85%;
|
||||
}
|
||||
|
||||
/* centres login form vertically */
|
||||
.wrapper{
|
||||
height:100%;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
margin-left:-4px;
|
||||
}
|
||||
}
|
||||
form{
|
||||
width:100%;
|
||||
display:inline-block;
|
||||
vertical-align: middle;
|
||||
|
||||
.fields li{
|
||||
padding-left:10%;
|
||||
}
|
||||
}
|
||||
|
||||
h1{
|
||||
padding-left:10%;
|
||||
font-weight:300;
|
||||
font-size:4em;
|
||||
line-height:1em;
|
||||
}
|
||||
.full input{
|
||||
padding-left:10%;
|
||||
}
|
||||
.field.icon:before{
|
||||
display:inline-block;
|
||||
position: absolute;
|
||||
color:@color-grey-4;
|
||||
border: 2px solid @color-grey-4;
|
||||
border-radius: 100%;
|
||||
width: 1em;
|
||||
padding: 0.3em;
|
||||
left: 12%;
|
||||
margin-left: 80px;
|
||||
margin-left: -25px;
|
||||
top: 50%;
|
||||
margin-top: -25px;
|
||||
}
|
||||
.full input{
|
||||
padding-left:15%;
|
||||
}
|
||||
|
||||
.messages li{
|
||||
padding-left:11%;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
@import "../variables.less";
|
||||
@import "../mixins.less";
|
||||
@import "../grid.less";
|
||||
|
||||
.page-editor .tab-nav li{
|
||||
.column(6);
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.objects{
|
||||
.object{
|
||||
.push-padding(@grid-content-indent);
|
||||
padding-right:@grid-gutter-width/2;
|
||||
position:relative;
|
||||
border:1px solid @color-grey-4;
|
||||
border-width:1px 0 0 0;
|
||||
|
||||
&:first-child{
|
||||
border:0;
|
||||
}
|
||||
|
||||
&.focused{
|
||||
border-color: darken(@color-input-focus, 40%);
|
||||
}
|
||||
|
||||
fieldset{
|
||||
.column(10);
|
||||
padding-left:0;
|
||||
}
|
||||
|
||||
.object-help{
|
||||
.column(2);
|
||||
display:block;
|
||||
position:absolute;
|
||||
z-index:1;
|
||||
right:0;
|
||||
top:0;
|
||||
padding-right:@grid-gutter-width/2;
|
||||
float:right;
|
||||
margin-top:4em;
|
||||
text-align:right;
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
&:hover .object-help{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
|
||||
.preview{
|
||||
padding-top:1em;
|
||||
padding-bottom:0.5em;
|
||||
}
|
||||
|
||||
.single-field{
|
||||
h2, .object-help{
|
||||
display:none; /* The field label is used instead */
|
||||
}
|
||||
}
|
||||
|
||||
/* Special full-width, one-off fields i.e a single text or textarea input */
|
||||
.full{
|
||||
padding:0;
|
||||
|
||||
h2{
|
||||
display:none; /* The field label is used instead */
|
||||
}
|
||||
|
||||
.object-help{
|
||||
display:block;
|
||||
}
|
||||
|
||||
fieldset{
|
||||
display:block;
|
||||
float:none;
|
||||
width:auto;
|
||||
padding:0;
|
||||
|
||||
.help{
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
li{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.field{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
input, textarea, .richtext{
|
||||
.nice-padding;
|
||||
.pull-padding(2);
|
||||
font-family:Bitter, Georgia, serif;
|
||||
.border-radius(0px);
|
||||
border:0;
|
||||
padding-top:3em;
|
||||
padding-bottom:2em;
|
||||
font-size:1.2em;
|
||||
line-height:1.6em;
|
||||
}
|
||||
|
||||
|
||||
.error-message{
|
||||
.push(@grid-content-indent);
|
||||
.pull(@grid-content-indent);
|
||||
padding-bottom:2em;
|
||||
}
|
||||
|
||||
.error,
|
||||
.error input,
|
||||
.error textarea{
|
||||
background-color:@color-input-error-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.object > h2, .single-field label{
|
||||
-webkit-font-smoothing: auto;
|
||||
.border-radius(2px);
|
||||
background-color:@color-grey-4;
|
||||
text-transform:uppercase;
|
||||
padding:2px 5px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
font-size:0.85em;
|
||||
z-index:1;
|
||||
margin:0 0 0.2em 0;
|
||||
line-height:1.5em;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
.title input,
|
||||
.title textarea{
|
||||
font-size:2em;
|
||||
padding-top:2em;
|
||||
}
|
||||
|
||||
.multiple > li{
|
||||
border-bottom: 1px dashed @color-input-border;
|
||||
}
|
||||
|
||||
.multiple .controls{
|
||||
top:auto;
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
.page-editor .tab-nav li{
|
||||
.column(2);
|
||||
padding:0;
|
||||
min-width:110px;
|
||||
}
|
||||
}
|
||||
91
wagtail/wagtailadmin/static/wagtailadmin/css/mixins.less
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
.clearfix() {
|
||||
&:before,
|
||||
&:after {
|
||||
content: " "; /* 1 */
|
||||
display: table; /* 2 */
|
||||
}
|
||||
&:after {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
.unlist(){
|
||||
&, ul, li{
|
||||
list-style-type:none;
|
||||
font-style: normal;
|
||||
}
|
||||
&, ul{
|
||||
margin-top:0;
|
||||
margin-bottom:0;
|
||||
padding-left:0;
|
||||
}
|
||||
}
|
||||
|
||||
.transition(@transition){
|
||||
body.ready &{
|
||||
-webkit-transition: @transition;
|
||||
-moz-transition: @transition;
|
||||
-o-transition: @transition;
|
||||
transition: @transition;
|
||||
}
|
||||
}
|
||||
.transition-immediate(@transition){
|
||||
-webkit-transition: @transition;
|
||||
-moz-transition: @transition;
|
||||
-o-transition: @transition;
|
||||
transition: @transition;
|
||||
}
|
||||
|
||||
.transition-transform(@transition) {
|
||||
-webkit-transition: -webkit-transform @transition;
|
||||
-moz-transition: -moz-transform @transition;
|
||||
-o-transition: -o-transform @transition;
|
||||
transition: transform @transition;
|
||||
}
|
||||
|
||||
.notransition() {
|
||||
-webkit-transition: none !important;
|
||||
-moz-transition: none !important;
|
||||
-o-transition: none !important;
|
||||
-ms-transition: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
.border-radius(@radius){
|
||||
-webkit-border-radius: @radius;
|
||||
border-radius: @radius;
|
||||
}
|
||||
|
||||
.box-shadow(@shadow){
|
||||
-webkit-box-shadow: @shadow; //inset 2px 2px 3px 2px rgba(0, 0, 0, 1)
|
||||
box-shadow: @shadow; //inset 2px 2px 3px 2px rgba(0, 0, 0, 1)
|
||||
}
|
||||
|
||||
.visuallyhidden() {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
|
||||
&:active, &:focus {
|
||||
clip: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
position: static;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.visuallyvisible(){
|
||||
clip:none;
|
||||
height:auto;
|
||||
width:auto;
|
||||
margin:auto;
|
||||
overflow:visible;
|
||||
position:initial;
|
||||
}
|
||||
533
wagtail/wagtailadmin/static/wagtailadmin/css/normalize.css
vendored
Executable file
|
|
@ -0,0 +1,533 @@
|
|||
/*! normalize.css v1.1.1 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
|
||||
* Known issue: no IE 6 support.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Prevent system color scheme's background color being used in Firefox, IE,
|
||||
* and Opera.
|
||||
* 2. Prevent system color scheme's text color being used in Firefox, IE, and
|
||||
* Opera.
|
||||
* 3. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
|
||||
* `em` units.
|
||||
* 4. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
background: #fff; /* 1 */
|
||||
color: #000; /* 2 */
|
||||
font-size: 100%; /* 3 */
|
||||
-webkit-text-size-adjust: 100%; /* 4 */
|
||||
-ms-text-size-adjust: 100%; /* 4 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `font-family` inconsistency between `textarea` and other form
|
||||
* elements.
|
||||
*/
|
||||
|
||||
html,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address margins handled incorrectly in IE 6/7.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address font sizes and margins set differently in IE 6/7.
|
||||
* Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
|
||||
* and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
margin: 0.83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.17em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 0.83em;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 0.67em;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 7/8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
* Known issue: no IE 6/7 normalization.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 6/7/8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address margins set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
p,
|
||||
pre {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
_font-family: 'courier new', monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address CSS quotes not supported in IE 6/7.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `quotes` property not supported in Safari 4.
|
||||
*/
|
||||
|
||||
q:before,
|
||||
q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Lists
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margins set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
dl,
|
||||
menu,
|
||||
ol,
|
||||
ul {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0 0 0 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address paddings set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
menu,
|
||||
ol,
|
||||
ul {
|
||||
padding: 0 0 0 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct list images handled incorrectly in IE 7.
|
||||
*/
|
||||
|
||||
nav ul,
|
||||
nav ol {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
|
||||
* 2. Improve image quality when scaled in IE 7.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0; /* 1 */
|
||||
-ms-interpolation-mode: bicubic; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct margin displayed oddly in IE 6/7.
|
||||
*/
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct color not being inherited in IE 6/7/8/9.
|
||||
* 2. Correct text not wrapping in Firefox 3.
|
||||
* 3. Correct alignment displayed oddly in IE 6/7.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0;
|
||||
white-space: normal; /* 2 */
|
||||
*margin-left: -7px; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct font size not being inherited in all browsers.
|
||||
* 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
|
||||
* and Chrome.
|
||||
* 3. Improve appearance and consistency in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-size: 100%; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
vertical-align: baseline; /* 3 */
|
||||
*vertical-align: middle; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 3+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
|
||||
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
* 4. Remove inner spacing in IE 7 without affecting normal text inputs.
|
||||
* Known issue: inner spacing remains in IE 6.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
*overflow: visible; /* 4 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address box sizing set to content-box in IE 8/9.
|
||||
* 2. Remove excess padding in IE 8/9.
|
||||
* 3. Remove excess padding in IE 7.
|
||||
* Known issue: excess padding remains in IE 6.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
*height: 13px; /* 3 */
|
||||
*width: 13px; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 3+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove default vertical scrollbar in IE 6/7/8/9.
|
||||
* 2. Improve readability and alignment in all browsers.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
@import "../variables.less";
|
||||
|
||||
.hallotoolbar{
|
||||
position:absolute;
|
||||
left:5.83%;
|
||||
}
|
||||
.hallotoolbar.affixed{
|
||||
position:fixed;
|
||||
left:5.83%;
|
||||
margin-left:140px;
|
||||
}
|
||||
|
||||
.richtext {
|
||||
min-height:50px;
|
||||
overflow: hidden;
|
||||
|
||||
/* Resetting various html tags that have been messed with by Verdant's main css */
|
||||
h1{
|
||||
text-transform:none;
|
||||
}
|
||||
h2 {
|
||||
text-transform:none;
|
||||
display:block !important;
|
||||
}
|
||||
h1 span {
|
||||
font-weight: normal;
|
||||
color: inherit;
|
||||
}
|
||||
*:before,
|
||||
*:after{
|
||||
display:none;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
margin: 1em 0;
|
||||
padding: 0 0 0 40px;
|
||||
}
|
||||
li{
|
||||
display:list-item !important;
|
||||
}
|
||||
ul li{
|
||||
list-style-type:disc !important;
|
||||
}
|
||||
ol li{
|
||||
list-style-type:decimal !important;
|
||||
}
|
||||
|
||||
/* Delete controls on embedded blocks with contenteditable="false" */
|
||||
.rich-text-deletable {
|
||||
position: relative;
|
||||
a.delete-control {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
|
||||
&:before{
|
||||
background-color:rgba(255,255,255,0.8);
|
||||
}
|
||||
&:hover:before{
|
||||
background-color:white;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.inEditMode {
|
||||
.rich-text-deletable a.delete-control {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* === CSS BELOW THIS POINT IS CUSTOM TO RCA === */
|
||||
/* TODO: find extensible way for developers to style rich text to suit their implementation, without making changes to anything within wagtailadmin */
|
||||
|
||||
h1,h2,h3,h4,h5,h6{
|
||||
font-family:inherit;
|
||||
}
|
||||
h1{} /* shouldn't be used */
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
line-height: 1.2em;
|
||||
padding-top:0.5em;
|
||||
border-top:1px solid #CCC;
|
||||
clear:both
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.7em;
|
||||
line-height: 1.194em;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.267em;
|
||||
}
|
||||
h5 {
|
||||
/* used for large body text, not really heading */
|
||||
font-size: 1.200em;
|
||||
line-height: 1.278em;
|
||||
}
|
||||
|
||||
hr {
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
/*
|
||||
These styles correspond to the image formats defined in verdantimages/formats.py,
|
||||
so that images displayed in the rich text field receive more or less the same
|
||||
styling that they would receive on the site front-end.
|
||||
TODO: when we implement a mechanism to configure the image format list on a
|
||||
per-installation / per-site basis, we'll need a way to insert the corresponding
|
||||
CSS here.
|
||||
*/
|
||||
|
||||
.bodytext-image {
|
||||
margin-top: 3px; /* close as possible to match line-height space above p */
|
||||
img {
|
||||
width:100%;
|
||||
}
|
||||
figcaption {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
margin-top: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
&.small {
|
||||
max-width: 45%;
|
||||
}
|
||||
&.left {
|
||||
float: left;
|
||||
margin-right: 16px;
|
||||
}
|
||||
&.right {
|
||||
float: right;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
51
wagtail/wagtailadmin/static/wagtailadmin/css/variables.less
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
@static-root: "/static/wagtailadmin/images/";
|
||||
@css-root: "/static/wagtailadmin/css/";
|
||||
|
||||
@grid-columns: 12;
|
||||
@grid-gutter-width: 3%;
|
||||
@grid-max-width: 1200px;
|
||||
@grid-content-indent:0.7;
|
||||
|
||||
@breakpoint-mobile:50em; /* 800px */
|
||||
@breakpoint-desktop-small:56.25em; /* 900px */
|
||||
@breakpoint-desktop-large:75em; /* 1200px */
|
||||
@breakpoint-desktop-larger:100em; /* 1600px */
|
||||
|
||||
// generic colours
|
||||
@color-teal: #43b1b0;
|
||||
@color-teal-darker: darken(@color-teal, 10%);
|
||||
@color-teal-dark: #246060;
|
||||
@color-red: #f7474e;
|
||||
@color-orange:#e9b04d;
|
||||
@color-green: #00FF00;
|
||||
|
||||
/* greys, darker to lighter */
|
||||
@color-grey-1: #333333;
|
||||
@color-grey-1-1: #404040;
|
||||
@color-grey-2: #666666;
|
||||
@color-grey-3: #d9d9d9;
|
||||
@color-grey-4: #e6e6e6;
|
||||
@color-grey-5: #fafafa;
|
||||
|
||||
@color-thead-bg: @color-grey-5;
|
||||
@color-header-bg: @color-grey-5;
|
||||
@color-fieldset-hover: @color-grey-5;
|
||||
@color-input-border: @color-grey-3;
|
||||
@color-input-focus: #f4fcfc;
|
||||
@color-input-error-bg: #feedee;
|
||||
@color-button: @color-teal;
|
||||
@color-button-hover: @color-teal-darker;
|
||||
@color-button-yes: @color-green;
|
||||
@color-button-yes-hover: darken(@color-button-yes, 8%);
|
||||
@color-button-no: @color-red;
|
||||
@color-button-no-hover: darken(@color-button-no, 20%);
|
||||
@color-link: @color-teal;
|
||||
@color-link-hover: darken(@color-button, 8%);
|
||||
|
||||
@color-text-base: @color-grey-2;
|
||||
@color-text-input: @color-grey-1;
|
||||
|
||||
|
||||
@thumbnail-width:130px;
|
||||
|
||||
@menu-width: 150px;
|
||||
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/animated-overlay.gif
vendored
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 212 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_100_246060_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 206 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_100_49c0c1_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 206 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_100_e8f8f9_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 206 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_100_f7474e_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 206 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_100_ffffff_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 208 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png
vendored
Executable file
|
After Width: | Height: | Size: 208 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png
vendored
Executable file
|
After Width: | Height: | Size: 335 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png
vendored
Executable file
|
After Width: | Height: | Size: 207 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png
vendored
Executable file
|
After Width: | Height: | Size: 262 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png
vendored
Executable file
|
After Width: | Height: | Size: 262 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png
vendored
Executable file
|
After Width: | Height: | Size: 332 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png
vendored
Executable file
|
After Width: | Height: | Size: 280 B |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_222222_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_454545_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_49c0c1_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_888888_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/images/ui-icons_ffffff_256x240.png
vendored
Executable file
|
After Width: | Height: | Size: 6.2 KiB |
1177
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/jquery-ui-1.10.3.verdant.css
vendored
Executable file
1177
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery-ui/jquery-ui-smoothness.css
vendored
Executable file
66
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery.tagit.css
vendored
Executable file
|
|
@ -0,0 +1,66 @@
|
|||
ul.tagit {
|
||||
overflow: auto;
|
||||
margin-left: inherit; /* usually we don't want the regular ul margins. */
|
||||
margin-right: inherit;
|
||||
}
|
||||
ul.tagit li {
|
||||
display: block;
|
||||
float: left;
|
||||
margin: 2px 5px 2px 0;
|
||||
}
|
||||
ul.tagit li.tagit-choice {
|
||||
position: relative;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ul.tagit li.tagit-choice-read-only {
|
||||
padding: .2em .5em .2em .5em;
|
||||
}
|
||||
|
||||
ul.tagit li.tagit-choice-editable {
|
||||
padding: .2em 18px .2em .5em;
|
||||
}
|
||||
|
||||
ul.tagit li.tagit-new {
|
||||
padding: .25em 4px .25em 0;
|
||||
}
|
||||
|
||||
ul.tagit li.tagit-choice a.tagit-label {
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
ul.tagit li.tagit-choice .tagit-close {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: .1em;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
/* used for some custom themes that don't need image icons */
|
||||
ul.tagit li.tagit-choice .tagit-close .text-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul.tagit li.tagit-choice input {
|
||||
display: block;
|
||||
float: left;
|
||||
margin: 2px 5px 2px 0;
|
||||
}
|
||||
ul.tagit input[type="text"] {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: inherit;
|
||||
background-color: inherit;
|
||||
outline: none;
|
||||
}
|
||||
67
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/jquery.timepicker.css
vendored
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
.ui-timepicker-wrapper {
|
||||
overflow-y: auto;
|
||||
height: 150px;
|
||||
width: 6.5em;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
-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);
|
||||
outline: none;
|
||||
z-index: 10001;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ui-timepicker-wrapper.ui-timepicker-with-duration {
|
||||
width: 11em;
|
||||
}
|
||||
|
||||
.ui-timepicker-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.ui-timepicker-duration {
|
||||
margin-left: 5px; color: #888;
|
||||
}
|
||||
|
||||
.ui-timepicker-list:hover .ui-timepicker-duration {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.ui-timepicker-list li {
|
||||
padding: 3px 0 3px 5px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
color: #000;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ui-timepicker-list:hover .ui-timepicker-selected {
|
||||
background: #fff; color: #000;
|
||||
}
|
||||
|
||||
li.ui-timepicker-selected,
|
||||
.ui-timepicker-list li:hover,
|
||||
.ui-timepicker-list .ui-timepicker-selected:hover {
|
||||
background: #1980EC; color: #fff;
|
||||
}
|
||||
|
||||
li.ui-timepicker-selected .ui-timepicker-duration,
|
||||
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.ui-timepicker-list li.ui-timepicker-disabled,
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
color: #888;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
56
wagtail/wagtailadmin/static/wagtailadmin/css/vendor/tagit.ui-zendesk.css
vendored
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/* Optional scoped theme for tag-it which mimics the zendesk widget. */
|
||||
|
||||
|
||||
ul.tagit {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: #C6C6C6;
|
||||
background: inherit;
|
||||
}
|
||||
ul.tagit li.tagit-choice {
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border: 1px solid #CAD8F3;
|
||||
|
||||
background: none;
|
||||
background-color: #DEE7F8;
|
||||
|
||||
font-weight: normal;
|
||||
}
|
||||
ul.tagit li.tagit-choice .tagit-label:not(a) {
|
||||
color: #555;
|
||||
}
|
||||
ul.tagit li.tagit-choice a.tagit-close {
|
||||
text-decoration: none;
|
||||
}
|
||||
ul.tagit li.tagit-choice .tagit-close {
|
||||
right: .4em;
|
||||
}
|
||||
ul.tagit li.tagit-choice .ui-icon {
|
||||
display: none;
|
||||
}
|
||||
ul.tagit li.tagit-choice .tagit-close .text-icon {
|
||||
display: inline;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
color: #777;
|
||||
}
|
||||
ul.tagit li.tagit-choice:hover, ul.tagit li.tagit-choice.remove {
|
||||
background-color: #bbcef1;
|
||||
border-color: #6d95e0;
|
||||
}
|
||||
ul.tagit li.tagit-choice a.tagLabel:hover,
|
||||
ul.tagit li.tagit-choice a.tagit-close .text-icon:hover {
|
||||
color: #222;
|
||||
}
|
||||
ul.tagit input[type="text"] {
|
||||
color: #333333;
|
||||
background: none;
|
||||
}
|
||||
.ui-widget {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
BIN
wagtail/wagtailadmin/static/wagtailadmin/images/spinner.gif
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
105
wagtail/wagtailadmin/static/wagtailadmin/js/core.js
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/* generic function for adding a message to message area through JS alone */
|
||||
function addMessage(status,text){
|
||||
$('.messages').addClass('new').empty().append('<ul><li class="' + status + '">' + text + '</li></ul>');
|
||||
var addMsgTimeout = setTimeout(function(){
|
||||
$('.messages').addClass('appear');
|
||||
clearTimeout(addMsgTimeout);
|
||||
}, 100)
|
||||
}
|
||||
|
||||
$(function(){
|
||||
// Add class to the body from which transitions may be hung so they don't appear to transition as the page loads
|
||||
$('body').addClass('ready');
|
||||
|
||||
// Enable toggle to open/close nav
|
||||
$('#nav-toggle').click(function(){
|
||||
$('body').toggleClass('nav-open');
|
||||
});
|
||||
|
||||
// Enable swishy section navigation menu
|
||||
$('.explorer').addClass('dl-menuwrapper').dlmenu({
|
||||
animationClasses : {
|
||||
classin : 'dl-animate-in-2',
|
||||
classout : 'dl-animate-out-2'
|
||||
}
|
||||
});
|
||||
|
||||
// Resize nav to fit height of window. This is an unimportant bell/whistle to make it look nice
|
||||
var fitNav = function(){
|
||||
$('.nav-wrapper').css('min-height',$(window).height());
|
||||
$('.nav-main').each(function(){
|
||||
var thisHeight = $(this).height();
|
||||
var footerHeight = $('.footer', $(this)).height();
|
||||
|
||||
// $(this).css({'height':thisHeight - footerHeight, 'overflow-y':'scroll'});
|
||||
// $('> ul', $(this)).height(thisHeight)
|
||||
});
|
||||
}
|
||||
fitNav();
|
||||
$(window).resize(function(){
|
||||
fitNav();
|
||||
})
|
||||
|
||||
// Apply auto-height sizing to text areas
|
||||
// NB .richtext (hallo.js-enabled) divs do not need this as they expand to fit their content by default
|
||||
// $('.page-editor textarea').autosize();
|
||||
|
||||
// Enable nice focus effects on all fields. This enables help text on hover.
|
||||
$(document).on('focus mouseover', 'input,textarea,select', function(){
|
||||
$(this).closest('.field').addClass('focused')
|
||||
$(this).closest('fieldset').addClass('focused')
|
||||
$(this).closest('li').addClass('focused')
|
||||
})
|
||||
$(document).on('blur mouseout', 'input,textarea,select', function(){
|
||||
$(this).closest('.field').removeClass('focused')
|
||||
$(this).closest('fieldset').removeClass('focused')
|
||||
$(this).closest('li').removeClass('focused')
|
||||
});
|
||||
|
||||
/* tabs */
|
||||
$(document).on('click', '.tab-nav a', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show');
|
||||
});
|
||||
$(document).on('click', '.tab-toggle', function(e){
|
||||
e.preventDefault()
|
||||
$('.tab-nav a[href="'+ $(this).attr('href') +'"]').click();
|
||||
})
|
||||
|
||||
|
||||
$('.dropdown-toggle').bind('click', function(){
|
||||
$(this).closest('.dropdown').toggleClass('open');
|
||||
|
||||
// Stop event propagating so the "close all dropdowns on body clicks" code (below) doesn't immediately close the dropdown
|
||||
return false;
|
||||
});
|
||||
|
||||
/* close all dropdowns on body clicks */
|
||||
$(document).on('click', function(e){
|
||||
var relTarg = e.relatedTarget || e.toElement;
|
||||
if(!$(relTarg).hasClass('dropdown-toggle')){
|
||||
$('.dropdown').removeClass('open');
|
||||
}
|
||||
})
|
||||
|
||||
/* Bulk-selection */
|
||||
$(document).on('click', 'thead .bulk', function(){
|
||||
$(this).closest('table').find('tbody .bulk input').each(function(){
|
||||
$(this).prop('checked', !$(this).prop('checked'));
|
||||
})
|
||||
});
|
||||
|
||||
$(".nav-main .more > a").bind('click keydown', function(){
|
||||
$(this).parent().find('ul').toggle('fast');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#menu-search input').bind('focus', function(){
|
||||
$('#menu-search').addClass('focussed');
|
||||
}).bind('blur', function(){
|
||||
$('#menu-search').removeClass('focussed');
|
||||
})
|
||||
$('#menu-search').bind('focus click', function(){
|
||||
$(this).addClass('focussed');
|
||||
})
|
||||
})
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
function buildExpandingFormset(prefix, opts) {
|
||||
if (!opts) {
|
||||
opts = {};
|
||||
}
|
||||
|
||||
var addButton = $('#' + prefix + '-ADD');
|
||||
var formContainer = $('#' + prefix + '-FORMS');
|
||||
var totalFormsInput = $('#' + prefix + '-TOTAL_FORMS');
|
||||
var formCount = parseInt(totalFormsInput.val(), 10);
|
||||
|
||||
var emptyFormTemplate = document.getElementById(prefix + '-EMPTY_FORM_TEMPLATE');
|
||||
if (emptyFormTemplate.innerText) {
|
||||
emptyFormTemplate = emptyFormTemplate.innerText;
|
||||
} else if (emptyFormTemplate.textContent) {
|
||||
emptyFormTemplate = emptyFormTemplate.textContent;
|
||||
}
|
||||
|
||||
addButton.click(function() {
|
||||
var newFormHtml = emptyFormTemplate.replace(/__prefix__/g, formCount);
|
||||
formContainer.append(newFormHtml);
|
||||
if (opts.onAdd) {
|
||||
opts.onAdd(formCount);
|
||||
}
|
||||
|
||||
formCount++;
|
||||
totalFormsInput.val(formCount);
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# Hallo - a rich text editing jQuery UI widget
|
||||
# (c) 2011 Henri Bergius, IKS Consortium
|
||||
# Hallo may be freely distributed under the MIT license
|
||||
((jQuery) ->
|
||||
jQuery.widget "IKS.hallohr",
|
||||
options:
|
||||
editable: null
|
||||
toolbar: null
|
||||
uuid: ''
|
||||
buttonCssClass: null
|
||||
|
||||
populateToolbar: (toolbar) ->
|
||||
buttonset = jQuery "<span class=\"#{@widgetName}\"></span>"
|
||||
|
||||
buttonElement = jQuery '<span></span>'
|
||||
buttonElement.hallobutton
|
||||
uuid: @options.uuid
|
||||
editable: @options.editable
|
||||
label: "Horizontal rule"
|
||||
command: "insertHorizontalRule"
|
||||
icon: "icon-horizontalrule"
|
||||
cssClass: @options.buttonCssClass
|
||||
buttonset.append buttonElement
|
||||
|
||||
buttonset.hallobuttonset()
|
||||
toolbar.append buttonset
|
||||
|
||||
)(jQuery)
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
(function(jQuery) {
|
||||
return jQuery.widget('IKS.halloToolbarFixed', {
|
||||
toolbar: null,
|
||||
options: {
|
||||
parentElement: 'body',
|
||||
editable: null,
|
||||
toolbar: null,
|
||||
affix: true,
|
||||
affixTopOffset: 2
|
||||
},
|
||||
_create: function() {
|
||||
var el, widthToAdd,
|
||||
_this = this;
|
||||
this.toolbar = this.options.toolbar;
|
||||
this.toolbar.show();
|
||||
jQuery(this.options.parentElement).append(this.toolbar);
|
||||
this._bindEvents();
|
||||
jQuery(window).resize(function(event) {
|
||||
return _this.setPosition();
|
||||
});
|
||||
jQuery(window).scroll(function(event) {
|
||||
return _this.setPosition();
|
||||
});
|
||||
if (this.options.parentElement === 'body') {
|
||||
el = jQuery(this.element);
|
||||
widthToAdd = parseFloat(el.css('padding-left'));
|
||||
widthToAdd += parseFloat(el.css('padding-right'));
|
||||
widthToAdd += parseFloat(el.css('border-left-width'));
|
||||
widthToAdd += parseFloat(el.css('border-right-width'));
|
||||
widthToAdd += (parseFloat(el.css('outline-width'))) * 2;
|
||||
widthToAdd += (parseFloat(el.css('outline-offset'))) * 2;
|
||||
return jQuery(this.toolbar).css("width", el.width() + widthToAdd);
|
||||
}
|
||||
},
|
||||
_getPosition: function(event, selection) {
|
||||
var offset, position, width;
|
||||
if (!event) {
|
||||
return;
|
||||
}
|
||||
width = parseFloat(this.element.css('outline-width'));
|
||||
offset = width + parseFloat(this.element.css('outline-offset'));
|
||||
return position = {
|
||||
top: this.element.offset().top - this.toolbar.outerHeight() - offset,
|
||||
left: this.element.offset().left - offset
|
||||
};
|
||||
},
|
||||
_getCaretPosition: function(range) {
|
||||
var newRange, position, tmpSpan;
|
||||
tmpSpan = jQuery("<span/>");
|
||||
newRange = rangy.createRange();
|
||||
newRange.setStart(range.endContainer, range.endOffset);
|
||||
newRange.insertNode(tmpSpan.get(0));
|
||||
position = {
|
||||
top: tmpSpan.offset().top,
|
||||
left: tmpSpan.offset().left
|
||||
};
|
||||
tmpSpan.remove();
|
||||
return position;
|
||||
},
|
||||
setPosition: function() {
|
||||
var elementBottom, elementTop, height, offset, scrollTop, topOffset;
|
||||
if (this.options.parentElement !== 'body') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.toolbar.css('top', this.element.offset().top - this.toolbar.outerHeight());
|
||||
|
||||
if (this.options.affix) {
|
||||
this.toolbar.removeClass('affixed');
|
||||
scrollTop = jQuery(window).scrollTop();
|
||||
offset = this.element.offset();
|
||||
height = this.element.height();
|
||||
topOffset = this.options.affixTopOffset;
|
||||
elementTop = offset.top - (this.toolbar.height() + this.options.affixTopOffset);
|
||||
elementBottom = (height - topOffset) + (offset.top - this.toolbar.height());
|
||||
if (scrollTop > elementTop && scrollTop < elementBottom) {
|
||||
this.toolbar.addClass('affixed');
|
||||
this.toolbar.css('top', this.options.affixTopOffset);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
return this.toolbar;
|
||||
},
|
||||
_updatePosition: function(position) {},
|
||||
_bindEvents: function() {
|
||||
var _this = this;
|
||||
this.element.on('halloactivated', function(event, data) {
|
||||
_this.setPosition();
|
||||
return _this.toolbar.show();
|
||||
});
|
||||
return this.element.on('hallodeactivated', function(event, data) {
|
||||
return _this.toolbar.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
# plugin for hallo.js to allow inserting links using Verdant's page chooser
|
||||
|
||||
(($) ->
|
||||
$.widget "IKS.halloverdantlink",
|
||||
options:
|
||||
uuid: ''
|
||||
editable: null
|
||||
|
||||
populateToolbar: (toolbar) ->
|
||||
widget = this
|
||||
|
||||
getEnclosingLink = () ->
|
||||
# if cursor is currently within a link element, return it, otherwise return null
|
||||
node = widget.options.editable.getSelection().commonAncestorContainer
|
||||
return $(node).parents('a').get(0)
|
||||
|
||||
# Create an element for holding the button
|
||||
button = $('<span></span>')
|
||||
button.hallobutton
|
||||
uuid: @options.uuid
|
||||
editable: @options.editable
|
||||
label: 'Links'
|
||||
icon: 'icon-link'
|
||||
command: null
|
||||
queryState: (event) ->
|
||||
button.hallobutton('checked', !!getEnclosingLink())
|
||||
|
||||
# Append the button to toolbar
|
||||
toolbar.append button
|
||||
|
||||
button.on "click", (event) ->
|
||||
enclosingLink = getEnclosingLink()
|
||||
if enclosingLink
|
||||
# remove existing link
|
||||
$(enclosingLink).replaceWith(enclosingLink.innerHTML)
|
||||
button.hallobutton('checked', false)
|
||||
widget.options.editable.element.trigger('change')
|
||||
else
|
||||
# commence workflow to add a link
|
||||
lastSelection = widget.options.editable.getSelection()
|
||||
|
||||
if lastSelection.collapsed
|
||||
# TODO: don't hard-code this, as it may be changed in urls.py
|
||||
url = '/admin/choose-page/?allow_external_link=true&allow_email_link=true&prompt_for_link_text=true'
|
||||
else
|
||||
url = '/admin/choose-page/?allow_external_link=true&allow_email_link=true'
|
||||
|
||||
ModalWorkflow
|
||||
url: url
|
||||
responses:
|
||||
pageChosen: (pageData) ->
|
||||
a = document.createElement('a')
|
||||
a.setAttribute('href', pageData.url)
|
||||
if pageData.id
|
||||
a.setAttribute('data-id', pageData.id)
|
||||
a.setAttribute('data-linktype', 'page')
|
||||
|
||||
if (not lastSelection.collapsed) and lastSelection.canSurroundContents()
|
||||
# use the selected content as the link text
|
||||
lastSelection.surroundContents(a)
|
||||
else
|
||||
# no text is selected, so use the page title as link text
|
||||
a.appendChild(document.createTextNode pageData.title)
|
||||
lastSelection.insertNode(a)
|
||||
|
||||
widget.options.editable.element.trigger('change')
|
||||
|
||||
)(jQuery)
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
/* A framework for modal popups that are loaded via AJAX, allowing navigation to other
|
||||
subpages to happen within the lightbox, and returning a response to the calling page,
|
||||
possibly after several navigation steps
|
||||
*/
|
||||
|
||||
function ModalWorkflow(opts) {
|
||||
/* options passed in 'opts':
|
||||
'url' (required): initial
|
||||
'responses' (optional): dict of callbacks to be called when the modal content
|
||||
calls modal.respond(callbackName, params)
|
||||
*/
|
||||
|
||||
var self = {};
|
||||
var responseCallbacks = opts.responses || {};
|
||||
|
||||
/* remove any previous modals before continuing (closing doesn't remove them from the dom) */
|
||||
$('body > .modal').remove();
|
||||
|
||||
var container = $('<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">\n <div class="modal-dialog">\n <div class="modal-content">\n <button type="button" class="close icon text-replace icon-cross" data-dismiss="modal" aria-hidden="true">×</button>\n <div class="modal-body"></div>\n </div><!-- /.modal-content -->\n </div><!-- /.modal-dialog -->\n</div>');
|
||||
$('body').append(container);
|
||||
container.modal();
|
||||
|
||||
self.body = container.find('.modal-body');
|
||||
|
||||
self.loadUrl = function(url, urlParams) {
|
||||
$.get(url, urlParams, self.loadResponseText, 'text');
|
||||
};
|
||||
|
||||
self.postForm = function(url, formData) {
|
||||
$.post(url, formData, self.loadResponseText, 'text');
|
||||
};
|
||||
|
||||
self.ajaxifyForm = function(formSelector) {
|
||||
$(formSelector).each(function() {
|
||||
var action = this.action;
|
||||
if (this.method.toLowerCase() == 'get') {
|
||||
$(this).submit(function() {
|
||||
self.loadUrl(action, $(this).serialize());
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$(this).submit(function() {
|
||||
self.postForm(action, $(this).serialize());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
self.loadResponseText = function(responseText) {
|
||||
var response = eval('(' + responseText + ')');
|
||||
self.loadBody(response);
|
||||
};
|
||||
|
||||
self.loadBody = function(body) {
|
||||
if (body.html) {
|
||||
self.body.html(body.html);
|
||||
}
|
||||
if (body.onload) {
|
||||
body.onload(self);
|
||||
}
|
||||
};
|
||||
|
||||
self.respond = function(responseType) {
|
||||
if (responseType in responseCallbacks) {
|
||||
args = Array.prototype.slice.call(arguments, 1);
|
||||
responseCallbacks[responseType].apply(self, args);
|
||||
}
|
||||
};
|
||||
|
||||
self.close = function() {
|
||||
container.modal('hide');
|
||||
};
|
||||
|
||||
self.loadUrl(opts.url, opts.urlParams);
|
||||
|
||||
return self;
|
||||
}
|
||||
31
wagtail/wagtailadmin/static/wagtailadmin/js/page-chooser.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
function createPageChooser(id, pageType, openAtParentId) {
|
||||
var chooserElement = $('#' + id + '-chooser');
|
||||
var pageTitle = chooserElement.find('.title');
|
||||
var input = $('#' + id);
|
||||
|
||||
$('.action-choose', chooserElement).click(function() {
|
||||
var initialUrl = '/admin/choose-page/';
|
||||
/* TODO: don't hard-code this URL, as it may be changed in urls.py */
|
||||
if (openAtParentId) {
|
||||
initialUrl += openAtParentId + '/';
|
||||
}
|
||||
ModalWorkflow({
|
||||
'url': initialUrl,
|
||||
'urlParams': {'page_type': pageType},
|
||||
'responses': {
|
||||
'pageChosen': function(pageData) {
|
||||
input.val(pageData.id);
|
||||
openAtParentId = pageData.parentId;
|
||||
pageTitle.text(pageData.title);
|
||||
chooserElement.removeClass('blank');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.action-clear', chooserElement).click(function() {
|
||||
input.val('');
|
||||
openAtParentId = null;
|
||||
chooserElement.addClass('blank');
|
||||
});
|
||||
}
|
||||
251
wagtail/wagtailadmin/static/wagtailadmin/js/page-editor.js
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
function makeRichTextEditable(id) {
|
||||
var input = $('#' + id);
|
||||
var richText = $('<div class="richtext"></div>').html(input.val());
|
||||
richText.insertBefore(input);
|
||||
input.hide();
|
||||
|
||||
var removeStylingPending = false;
|
||||
function removeStyling() {
|
||||
/* Strip the 'style' attribute from spans that have no other attributes.
|
||||
(we don't remove the span entirely as that messes with the cursor position,
|
||||
and spans will be removed anyway by our whitelisting)
|
||||
*/
|
||||
$('span[style]', richText).filter(function() {
|
||||
return this.attributes.length === 1;
|
||||
}).removeAttr('style');
|
||||
removeStylingPending = false;
|
||||
}
|
||||
|
||||
richText.hallo({
|
||||
toolbar: 'halloToolbarFixed',
|
||||
toolbarcssClass: 'testy',
|
||||
plugins: {
|
||||
'halloformat': {},
|
||||
'halloheadings': {formatBlocks: ["p", "h2", "h3", "h4", "h5"]},
|
||||
'hallolists': {},
|
||||
'hallohr': {},
|
||||
'halloreundo': {},
|
||||
'halloverdantimage': {},
|
||||
'halloverdantembeds': {},
|
||||
'halloverdantlink': {},
|
||||
'halloverdantdoclink': {},
|
||||
}
|
||||
}).bind('hallomodified', function(event, data) {
|
||||
input.val(data.content);
|
||||
if (!removeStylingPending) {
|
||||
setTimeout(removeStyling, 100);
|
||||
removeStylingPending = true;
|
||||
}
|
||||
}).bind('paste', function(event, data) {
|
||||
setTimeout(removeStyling, 1);
|
||||
});
|
||||
}
|
||||
|
||||
function insertRichTextDeleteControl(elem) {
|
||||
var a = $('<a class="icon icon-cross text-replace delete-control">Delete</a>');
|
||||
$(elem).addClass('rich-text-deletable').prepend(a);
|
||||
a.click(function() {
|
||||
$(elem).fadeOut(function() {
|
||||
$(elem).remove();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function initDateChoosers(context) {
|
||||
$('input.friendly_date', context).datepicker({
|
||||
dateFormat: 'd M yy', constrainInput: false, /* showOn: 'button', */ firstDay: 1
|
||||
});
|
||||
}
|
||||
function initDateChooser(id) {
|
||||
$('#' + id).datepicker({
|
||||
dateFormat: 'd M yy', constrainInput: false, /* showOn: 'button', */ firstDay: 1
|
||||
});
|
||||
}
|
||||
|
||||
function initTimeChoosers(context) {
|
||||
$('input.friendly_time', context).timepicker({
|
||||
timeFormat: 'g.ia'
|
||||
});
|
||||
}
|
||||
function initTimeChooser(id) {
|
||||
$('#' + id).timepicker({
|
||||
timeFormat: 'g.ia'
|
||||
});
|
||||
}
|
||||
|
||||
function initTagField(id, autocompleteUrl) {
|
||||
$('#' + id).tagit({
|
||||
autocomplete: {source: autocompleteUrl}
|
||||
});
|
||||
}
|
||||
|
||||
function InlinePanel(opts) {
|
||||
var self = {};
|
||||
|
||||
self.initChildControls = function (prefix) {
|
||||
var childId = 'inline_child_' + prefix;
|
||||
var deleteInputId = 'id_' + prefix + '-DELETE';
|
||||
$('#' + deleteInputId + '-button').click(function() {
|
||||
/* set 'deleted' form field to true */
|
||||
$('#' + deleteInputId).val('1');
|
||||
$('#' + childId).fadeOut(function() {
|
||||
self.updateMoveButtonDisabledStates();
|
||||
});
|
||||
});
|
||||
if (opts.canOrder) {
|
||||
$('#' + prefix + '-move-up').click(function() {
|
||||
var currentChild = $('#' + childId);
|
||||
var currentChildOrderElem = currentChild.find('input[name$="-ORDER"]');
|
||||
var currentChildOrder = currentChildOrderElem.val();
|
||||
|
||||
/* find the previous visible 'inline_child' li before this one */
|
||||
var prevChild = currentChild.prev(':visible');
|
||||
if (!prevChild.length) return;
|
||||
var prevChildOrderElem = prevChild.find('input[name$="-ORDER"]');
|
||||
var prevChildOrder = prevChildOrderElem.val();
|
||||
|
||||
// async swap animation must run before the insertBefore line below, but doesn't need to finish first
|
||||
self.animateSwap(currentChild, prevChild);
|
||||
|
||||
currentChild.insertBefore(prevChild);
|
||||
currentChildOrderElem.val(prevChildOrder);
|
||||
prevChildOrderElem.val(currentChildOrder);
|
||||
|
||||
self.updateMoveButtonDisabledStates();
|
||||
});
|
||||
|
||||
$('#' + prefix + '-move-down').click(function() {
|
||||
var currentChild = $('#' + childId);
|
||||
var currentChildOrderElem = currentChild.find('input[name$="-ORDER"]');
|
||||
var currentChildOrder = currentChildOrderElem.val();
|
||||
|
||||
/* find the next visible 'inline_child' li after this one */
|
||||
var nextChild = currentChild.next(':visible');
|
||||
if (!nextChild.length) return;
|
||||
var nextChildOrderElem = nextChild.find('input[name$="-ORDER"]');
|
||||
var nextChildOrder = nextChildOrderElem.val();
|
||||
|
||||
// async swap animation must run before the insertAfter line below, but doesn't need to finish first
|
||||
self.animateSwap(currentChild, nextChild);
|
||||
|
||||
currentChild.insertAfter(nextChild);
|
||||
currentChildOrderElem.val(nextChildOrder);
|
||||
nextChildOrderElem.val(currentChildOrder);
|
||||
|
||||
self.updateMoveButtonDisabledStates();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
self.formsUl = $('#' + opts.formsetPrefix + '-FORMS');
|
||||
|
||||
self.updateMoveButtonDisabledStates = function() {
|
||||
if (opts.canOrder) {
|
||||
forms = self.formsUl.children('li:visible');
|
||||
forms.each(function(i) {
|
||||
$('ul.controls .inline-child-move-up', this).toggleClass('disabled', i == 0).toggleClass('enabled', i != 0);
|
||||
$('ul.controls .inline-child-move-down', this).toggleClass('disabled', i == forms.length - 1).toggleClass('enabled', i != forms.length - 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
self.animateSwap = function(item1, item2){
|
||||
var parent = self.formsUl;
|
||||
var children = parent.children('li:visible');
|
||||
|
||||
// Apply moving class to container (ul.multiple) so it can assist absolute positioning of it's children
|
||||
// Also set it's relatively calculated height to be an absolute one, to prevent the container collapsing while its children go absolute
|
||||
parent.addClass('moving').css('height', parent.height());
|
||||
|
||||
children.each(function(){
|
||||
// console.log($(this));
|
||||
$(this).css('top', $(this).position().top);
|
||||
}).addClass('moving');
|
||||
|
||||
// animate swapping around
|
||||
item1.animate({
|
||||
top:item2.position().top
|
||||
}, 200, function(){
|
||||
parent.removeClass('moving').removeAttr('style');
|
||||
children.removeClass('moving').removeAttr('style');
|
||||
});
|
||||
item2.animate({
|
||||
top:item1.position().top
|
||||
}, 200, function(){
|
||||
parent.removeClass('moving').removeAttr('style');
|
||||
children.removeClass('moving').removeAttr('style');
|
||||
})
|
||||
}
|
||||
|
||||
buildExpandingFormset(opts.formsetPrefix, {
|
||||
onAdd: function(formCount) {
|
||||
function fixPrefix(str) {
|
||||
return str.replace(/__prefix__/g, formCount);
|
||||
}
|
||||
self.initChildControls(fixPrefix(opts.emptyChildFormPrefix));
|
||||
if (opts.canOrder) {
|
||||
$(fixPrefix('#id_' + opts.emptyChildFormPrefix + '-ORDER')).val(formCount);
|
||||
}
|
||||
self.updateMoveButtonDisabledStates();
|
||||
opts.onAdd(fixPrefix);
|
||||
}
|
||||
});
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
function cleanForSlug(val){
|
||||
return val.replace(/\s/g,"-").replace(/[^A-Za-z0-9\-]/g,"").toLowerCase();
|
||||
}
|
||||
|
||||
function initSlugAutoPopulate(){
|
||||
$('#id_title').on('focus', function(){
|
||||
$('#id_slug').data('previous-val', $('#id_slug').val());
|
||||
$(this).data('previous-val', $(this).val());
|
||||
});
|
||||
$('#id_title').on('keyup keydown keypress blur', function(){
|
||||
if($('body').hasClass('create') || (!$('#id_slug').data('previous-val').length || cleanForSlug($('#id_title').data('previous-val')) === $('#id_slug').data('previous-val'))){
|
||||
// only update slug if the page is being created from scratch, if slug is completely blank, or if title and slug prior to typing were identical
|
||||
$('#id_slug').val(cleanForSlug($('#id_title').val()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initSlugCleaning(){
|
||||
$('#id_slug').on('keyup blur', function(){
|
||||
$(this).val(cleanForSlug($(this).val()));
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
initDateChoosers();
|
||||
initTimeChoosers();
|
||||
initSlugAutoPopulate();
|
||||
initSlugCleaning();
|
||||
|
||||
|
||||
$('.richtext [contenteditable="false"]').each(function() {
|
||||
insertRichTextDeleteControl(this);
|
||||
});
|
||||
|
||||
/* Set up behaviour of preview button */
|
||||
$('#action-preview').click(function() {
|
||||
var previewWindow = window.open($(this).data('placeholder'), $(this).data('windowname'));
|
||||
$.post(
|
||||
$(this).data('action'),
|
||||
$('#page-edit-form').serialize(),
|
||||
function(data, textStatus, request) {
|
||||
if (request.getResponseHeader('X-Verdant-Preview') == 'ok') {
|
||||
previewWindow.document.open();
|
||||
previewWindow.document.write(data);
|
||||
previewWindow.document.close();
|
||||
} else {
|
||||
previewWindow.close();
|
||||
document.open();
|
||||
document.write(data);
|
||||
document.close();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
246
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/bootstrap-modal.js
vendored
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.0.0
|
||||
* http://twbs.github.com/bootstrap/javascript.html#modals
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// MODAL CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$element = $(element)
|
||||
this.$backdrop =
|
||||
this.isShown = null
|
||||
|
||||
if (this.options.remote) this.$element.load(this.options.remote)
|
||||
}
|
||||
|
||||
Modal.DEFAULTS = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
Modal.prototype.toggle = function (_relatedTarget) {
|
||||
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
||||
}
|
||||
|
||||
Modal.prototype.show = function (_relatedTarget) {
|
||||
var that = this
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.escape()
|
||||
|
||||
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) // don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
transition ?
|
||||
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||
.one($.support.transition.end, function () {
|
||||
that.$element.focus().trigger(e)
|
||||
})
|
||||
.emulateTransitionEnd(300) :
|
||||
that.$element.focus().trigger(e)
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.hide = function (e) {
|
||||
if (e) e.preventDefault()
|
||||
|
||||
e = $.Event('hide.bs.modal')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
this.escape()
|
||||
|
||||
$(document).off('focusin.bs.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
.off('click.dismiss.modal')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.$element
|
||||
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
||||
.emulateTransitionEnd(300) :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
Modal.prototype.enforceFocus = function () {
|
||||
$(document)
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||
this.$element.focus()
|
||||
}
|
||||
}, this))
|
||||
}
|
||||
|
||||
Modal.prototype.escape = function () {
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||
e.which == 27 && this.hide()
|
||||
}, this))
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.bs.modal')
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.hideModal = function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
that.$element.trigger('hidden.bs.modal')
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.removeBackdrop = function () {
|
||||
this.$backdrop && this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
Modal.prototype.backdrop = function (callback) {
|
||||
var that = this
|
||||
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
||||
if (e.target !== e.currentTarget) return
|
||||
this.options.backdrop == 'static'
|
||||
? this.$element[0].focus.call(this.$element[0])
|
||||
: this.hide.call(this)
|
||||
}, this))
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop
|
||||
.one($.support.transition.end, callback)
|
||||
.emulateTransitionEnd(150) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop
|
||||
.one($.support.transition.end, callback)
|
||||
.emulateTransitionEnd(150) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MODAL PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option, _relatedTarget) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option](_relatedTarget)
|
||||
else if (options.show) data.show(_relatedTarget)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
// MODAL NO CONFLICT
|
||||
// =================
|
||||
|
||||
$.fn.modal.noConflict = function () {
|
||||
$.fn.modal = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// MODAL DATA-API
|
||||
// ==============
|
||||
|
||||
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option, this)
|
||||
.one('hide', function () {
|
||||
$this.is(':visible') && $this.focus()
|
||||
})
|
||||
})
|
||||
|
||||
$(document)
|
||||
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
||||
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
||||
|
||||
}(window.jQuery);
|
||||
138
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/bootstrap-tab.js
vendored
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/* ========================================================================
|
||||
* Bootstrap: tab.js v3.0.0
|
||||
* http://twbs.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// TAB CLASS DEFINITION
|
||||
// ====================
|
||||
|
||||
var Tab = function (element) {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.prototype.show = function () {
|
||||
var $this = this.element
|
||||
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ($this.parent('li').hasClass('active')) return
|
||||
|
||||
var previous = $ul.find('.active:last a')[0]
|
||||
var e = $.Event('show.bs.tab', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
var $target = $(selector)
|
||||
|
||||
this.activate($this, $this.parent('li'), $ul)
|
||||
this.activate($this, $target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown.bs.tab'
|
||||
, relatedTarget: previous
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Tab.prototype.activate = function (trigger, element, container, callback) {
|
||||
var $active = container.find('> .active')
|
||||
var transition = callback
|
||||
&& $.support.transition
|
||||
&& $active.hasClass('fade')
|
||||
|
||||
function next() {
|
||||
element.parent().find('.active').removeClass('active');
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
|
||||
trigger.addClass('active');
|
||||
element.addClass('active');
|
||||
|
||||
if (transition) {
|
||||
element[0].offsetWidth // reflow for transition
|
||||
element.addClass('in')
|
||||
} else {
|
||||
element.removeClass('fade')
|
||||
}
|
||||
|
||||
if (element.parent('.dropdown-menu')) {
|
||||
element.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
}
|
||||
|
||||
transition ?
|
||||
$active
|
||||
.one($.support.transition.end, next)
|
||||
.emulateTransitionEnd(150) :
|
||||
next()
|
||||
|
||||
$active.removeClass('in')
|
||||
}
|
||||
|
||||
|
||||
// TAB PLUGIN DEFINITION
|
||||
// =====================
|
||||
|
||||
var old = $.fn.tab
|
||||
|
||||
$.fn.tab = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.tab')
|
||||
|
||||
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tab.Constructor = Tab
|
||||
|
||||
|
||||
// TAB NO CONFLICT
|
||||
// ===============
|
||||
|
||||
$.fn.tab.noConflict = function () {
|
||||
$.fn.tab = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// TAB DATA-API
|
||||
// ============
|
||||
|
||||
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
2949
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/hallo.js
vendored
Normal file
6
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/jquery-1.10.3.js
vendored
Normal file
14971
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/jquery-ui-1.10.3.js
vendored
Executable file
242
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/jquery.autosize.js
vendored
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
/*!
|
||||
Autosize v1.17.2 - 2013-07-30
|
||||
Automatically adjust textarea height based on user input.
|
||||
(c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
|
||||
license: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else {
|
||||
// Browser globals: jQuery or jQuery-like library, such as Zepto
|
||||
factory(window.jQuery || window.$);
|
||||
}
|
||||
}(function ($) {
|
||||
var
|
||||
defaults = {
|
||||
className: 'autosizejs',
|
||||
append: '',
|
||||
callback: false,
|
||||
resizeDelay: 10
|
||||
},
|
||||
|
||||
// border:0 is unnecessary, but avoids a bug in FireFox on OSX
|
||||
copy = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',
|
||||
|
||||
// line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
|
||||
typographyStyles = [
|
||||
'fontFamily',
|
||||
'fontSize',
|
||||
'fontWeight',
|
||||
'fontStyle',
|
||||
'letterSpacing',
|
||||
'textTransform',
|
||||
'wordSpacing',
|
||||
'textIndent'
|
||||
],
|
||||
|
||||
// to keep track which textarea is being mirrored when adjust() is called.
|
||||
mirrored,
|
||||
|
||||
// the mirror element, which is used to calculate what size the mirrored element should be.
|
||||
mirror = $(copy).data('autosize', true)[0];
|
||||
|
||||
// test that line-height can be accurately copied.
|
||||
mirror.style.lineHeight = '99px';
|
||||
if ($(mirror).css('lineHeight') === '99px') {
|
||||
typographyStyles.push('lineHeight');
|
||||
}
|
||||
mirror.style.lineHeight = '';
|
||||
|
||||
$.fn.autosize = function (options) {
|
||||
options = $.extend({}, defaults, options || {});
|
||||
|
||||
if (mirror.parentNode !== document.body) {
|
||||
$(document.body).append(mirror);
|
||||
}
|
||||
|
||||
return this.each(function () {
|
||||
var
|
||||
ta = this,
|
||||
$ta = $(ta),
|
||||
maxHeight,
|
||||
minHeight,
|
||||
boxOffset = 0,
|
||||
callback = $.isFunction(options.callback),
|
||||
originalStyles = {
|
||||
height: ta.style.height,
|
||||
overflow: ta.style.overflow,
|
||||
overflowY: ta.style.overflowY,
|
||||
wordWrap: ta.style.wordWrap,
|
||||
resize: ta.style.resize
|
||||
},
|
||||
timeout,
|
||||
width = $ta.width();
|
||||
|
||||
if ($ta.data('autosize')) {
|
||||
// exit if autosize has already been applied, or if the textarea is the mirror element.
|
||||
return;
|
||||
}
|
||||
$ta.data('autosize', true);
|
||||
|
||||
if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){
|
||||
boxOffset = $ta.outerHeight() - $ta.height();
|
||||
}
|
||||
|
||||
// IE8 and lower return 'auto', which parses to NaN, if no min-height is set.
|
||||
minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height());
|
||||
|
||||
$ta.css({
|
||||
overflow: 'hidden',
|
||||
overflowY: 'hidden',
|
||||
wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
|
||||
resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
|
||||
});
|
||||
|
||||
function initMirror() {
|
||||
var styles = {}, ignore;
|
||||
|
||||
mirrored = ta;
|
||||
mirror.className = options.className;
|
||||
maxHeight = parseInt($ta.css('maxHeight'), 10);
|
||||
|
||||
// mirror is a duplicate textarea located off-screen that
|
||||
// is automatically updated to contain the same text as the
|
||||
// original textarea. mirror always has a height of 0.
|
||||
// This gives a cross-browser supported way getting the actual
|
||||
// height of the text, through the scrollTop property.
|
||||
$.each(typographyStyles, function(i,val){
|
||||
styles[val] = $ta.css(val);
|
||||
});
|
||||
$(mirror).css(styles);
|
||||
|
||||
// The textarea overflow is probably now hidden, but Chrome doesn't reflow the text to account for the
|
||||
// new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text.
|
||||
if ('oninput' in ta) {
|
||||
var width = ta.style.width;
|
||||
ta.style.width = '0px';
|
||||
ignore = ta.offsetWidth; // This value isn't used, but getting it triggers the necessary reflow
|
||||
ta.style.width = width;
|
||||
}
|
||||
}
|
||||
|
||||
// Using mainly bare JS in this function because it is going
|
||||
// to fire very often while typing, and needs to very efficient.
|
||||
function adjust() {
|
||||
var height, original, width, style;
|
||||
|
||||
if (mirrored !== ta) {
|
||||
initMirror();
|
||||
}
|
||||
|
||||
mirror.value = ta.value + options.append;
|
||||
mirror.style.overflowY = ta.style.overflowY;
|
||||
original = parseInt(ta.style.height,10);
|
||||
|
||||
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported in IE8 and lower.
|
||||
// The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
|
||||
if ('getComputedStyle' in window) {
|
||||
style = window.getComputedStyle(ta);
|
||||
width = ta.getBoundingClientRect().width;
|
||||
|
||||
$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
|
||||
width -= parseInt(style[val],10);
|
||||
});
|
||||
|
||||
mirror.style.width = width + 'px';
|
||||
}
|
||||
else {
|
||||
mirror.style.width = Math.max($ta.width(), 0) + 'px';
|
||||
}
|
||||
|
||||
// Needed for IE8 and lower to reliably return the correct scrollTop
|
||||
mirror.scrollTop = 0;
|
||||
|
||||
mirror.scrollTop = 9e4;
|
||||
|
||||
// Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding.
|
||||
height = mirror.scrollTop;
|
||||
|
||||
if (maxHeight && height > maxHeight) {
|
||||
ta.style.overflowY = 'scroll';
|
||||
height = maxHeight;
|
||||
} else {
|
||||
ta.style.overflowY = 'hidden';
|
||||
if (height < minHeight) {
|
||||
height = minHeight;
|
||||
}
|
||||
}
|
||||
|
||||
height += boxOffset;
|
||||
|
||||
if (original !== height) {
|
||||
ta.style.height = height + 'px';
|
||||
if (callback) {
|
||||
options.callback.call(ta,ta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resize () {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(function(){
|
||||
if ($ta.width() !== width) {
|
||||
adjust();
|
||||
}
|
||||
}, parseInt(options.resizeDelay,10));
|
||||
}
|
||||
|
||||
if ('onpropertychange' in ta) {
|
||||
if ('oninput' in ta) {
|
||||
// Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
|
||||
// so binding to onkeyup to catch most of those occasions. There is no way that I
|
||||
// know of to detect something like 'cut' in IE9.
|
||||
$ta.on('input.autosize keyup.autosize', adjust);
|
||||
} else {
|
||||
// IE7 / IE8
|
||||
$ta.on('propertychange.autosize', function(){
|
||||
if(event.propertyName === 'value'){
|
||||
adjust();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Modern Browsers
|
||||
$ta.on('input.autosize', adjust);
|
||||
}
|
||||
|
||||
// Set options.resizeDelay to false if using fixed-width textarea elements.
|
||||
// Uses a timeout and width check to reduce the amount of times adjust needs to be called after window resize.
|
||||
|
||||
if (options.resizeDelay !== false) {
|
||||
$(window).on('resize.autosize', resize);
|
||||
}
|
||||
|
||||
// Event for manual triggering if needed.
|
||||
// Should only be needed when the value of the textarea is changed through JavaScript rather than user input.
|
||||
$ta.on('autosize.resize', adjust);
|
||||
|
||||
// Event for manual triggering that also forces the styles to update as well.
|
||||
// Should only be needed if one of typography styles of the textarea change, and the textarea is already the target of the adjust method.
|
||||
$ta.on('autosize.resizeIncludeStyle', function() {
|
||||
mirrored = null;
|
||||
adjust();
|
||||
});
|
||||
|
||||
$ta.on('autosize.destroy', function(){
|
||||
mirrored = null;
|
||||
clearTimeout(timeout);
|
||||
$(window).off('resize', resize);
|
||||
$ta
|
||||
.off('autosize')
|
||||
.off('.autosize')
|
||||
.css(originalStyles)
|
||||
.removeData('autosize');
|
||||
});
|
||||
|
||||
// Call adjust in case the textarea already contains text.
|
||||
adjust();
|
||||
});
|
||||
};
|
||||
}));
|
||||
255
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/jquery.dlmenu.js
vendored
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
/**
|
||||
* jquery.dlmenu.js v1.0.1
|
||||
* http://www.codrops.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Copyright 2013, Codrops
|
||||
* http://www.codrops.com
|
||||
*/
|
||||
;( function( $, window, undefined ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// global
|
||||
var Modernizr = window.Modernizr, $body = $( 'body' );
|
||||
|
||||
$.DLMenu = function( options, element ) {
|
||||
this.$el = $( element );
|
||||
this._init( options );
|
||||
};
|
||||
|
||||
// the options
|
||||
$.DLMenu.defaults = {
|
||||
// classes for the animation effects
|
||||
animationClasses : { classin : 'dl-animate-in-1', classout : 'dl-animate-out-1' },
|
||||
// callback: click a link that has a sub menu
|
||||
// el is the link element (li); name is the level name
|
||||
onLevelClick : function( el, name ) { return false; },
|
||||
// callback: click a link that does not have a sub menu
|
||||
// el is the link element (li); ev is the event obj
|
||||
onLinkClick : function( el, ev ) { return false; }
|
||||
};
|
||||
|
||||
$.DLMenu.prototype = {
|
||||
_init : function( options ) {
|
||||
|
||||
// options
|
||||
this.options = $.extend( true, {}, $.DLMenu.defaults, options );
|
||||
// cache some elements and initialize some variables
|
||||
this._config();
|
||||
|
||||
var animEndEventNames = {
|
||||
'WebkitAnimation' : 'webkitAnimationEnd',
|
||||
'OAnimation' : 'oAnimationEnd',
|
||||
'msAnimation' : 'MSAnimationEnd',
|
||||
'animation' : 'animationend'
|
||||
},
|
||||
transEndEventNames = {
|
||||
'WebkitTransition' : 'webkitTransitionEnd',
|
||||
'MozTransition' : 'transitionend',
|
||||
'OTransition' : 'oTransitionEnd',
|
||||
'msTransition' : 'MSTransitionEnd',
|
||||
'transition' : 'transitionend'
|
||||
};
|
||||
// animation end event name
|
||||
this.animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ] + '.dlmenu';
|
||||
// transition end event name
|
||||
this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.dlmenu',
|
||||
// support for css animations and css transitions
|
||||
this.supportAnimations = Modernizr.cssanimations,
|
||||
this.supportTransitions = Modernizr.csstransitions;
|
||||
|
||||
this._initEvents();
|
||||
|
||||
},
|
||||
_config : function() {
|
||||
this.open = false;
|
||||
this.$trigger = $( '.dl-trigger' );
|
||||
this.$menu = this.$el.children( 'ul.dl-menu' );
|
||||
this.$menuitems = this.$menu.find( 'li:not(.dl-back) .children' );
|
||||
this.$el.find( 'ul.dl-submenu' ).prepend( '<li class="dl-back"><a href="#" class="icon icon-arrow-left">back</a></li>' );
|
||||
this.$back = this.$menu.find( 'li.dl-back' );
|
||||
},
|
||||
_initEvents : function() {
|
||||
|
||||
var self = this;
|
||||
|
||||
this.$trigger.on( 'click.dlmenu', function() {
|
||||
|
||||
if( self.open ) {
|
||||
self._closeMenu();
|
||||
}
|
||||
else {
|
||||
self._openMenu();
|
||||
}
|
||||
return false;
|
||||
|
||||
} );
|
||||
|
||||
this.$menuitems.on( 'click.dlmenu', function( event ) {
|
||||
|
||||
event.stopPropagation();
|
||||
|
||||
var $item = $(this).parent(),
|
||||
$submenu = $item.children( 'ul.dl-submenu' );
|
||||
|
||||
if( $submenu.length > 0 ) {
|
||||
|
||||
var $flyin = $submenu.clone().css( 'opacity', 0 ).insertAfter( self.$menu ),
|
||||
onAnimationEndFn = function() {
|
||||
self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'dl-subview' );
|
||||
$item.addClass( 'dl-subviewopen' ).parents( '.dl-subviewopen:first' ).removeClass( 'dl-subviewopen' ).addClass( 'dl-subview' );
|
||||
$flyin.remove();
|
||||
};
|
||||
|
||||
setTimeout( function() {
|
||||
$flyin.addClass( self.options.animationClasses.classin );
|
||||
self.$menu.addClass( self.options.animationClasses.classout );
|
||||
if( self.supportAnimations ) {
|
||||
self.$menu.on( self.animEndEventName, onAnimationEndFn );
|
||||
}
|
||||
else {
|
||||
onAnimationEndFn.call();
|
||||
}
|
||||
|
||||
self.options.onLevelClick( $item, $item.children( 'a:first' ).text() );
|
||||
} );
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
else {
|
||||
self.options.onLinkClick( $item, event );
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
this.$back.on( 'click.dlmenu', function( event ) {
|
||||
|
||||
var $this = $( this ),
|
||||
$submenu = $this.parents( 'ul.dl-submenu:first' ),
|
||||
$item = $submenu.parent(),
|
||||
|
||||
$flyin = $submenu.clone().insertAfter( self.$menu );
|
||||
|
||||
var onAnimationEndFn = function() {
|
||||
self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classin );
|
||||
$flyin.remove();
|
||||
};
|
||||
|
||||
setTimeout( function() {
|
||||
$flyin.addClass( self.options.animationClasses.classout );
|
||||
self.$menu.addClass( self.options.animationClasses.classin );
|
||||
if( self.supportAnimations ) {
|
||||
self.$menu.on( self.animEndEventName, onAnimationEndFn );
|
||||
}
|
||||
else {
|
||||
onAnimationEndFn.call();
|
||||
}
|
||||
|
||||
$item.removeClass( 'dl-subviewopen' );
|
||||
|
||||
var $subview = $this.parents( '.dl-subview:first' );
|
||||
if( $subview.is( 'li' ) ) {
|
||||
$subview.addClass( 'dl-subviewopen' );
|
||||
}
|
||||
$subview.removeClass( 'dl-subview' );
|
||||
} );
|
||||
|
||||
return false;
|
||||
|
||||
} );
|
||||
|
||||
},
|
||||
closeMenu : function() {
|
||||
if( this.open ) {
|
||||
this._closeMenu();
|
||||
}
|
||||
},
|
||||
_closeMenu : function() {
|
||||
var self = this,
|
||||
onTransitionEndFn = function() {
|
||||
self.$menu.off( self.transEndEventName );
|
||||
self._resetMenu();
|
||||
$body.removeClass('explorer-open');
|
||||
};
|
||||
|
||||
this.$menu.removeClass( 'dl-menuopen' );
|
||||
this.$menu.addClass( 'dl-menu-toggle' );
|
||||
this.$trigger.removeClass( 'dl-active' );
|
||||
|
||||
if( this.supportTransitions ) {
|
||||
this.$menu.on( this.transEndEventName, onTransitionEndFn );
|
||||
}
|
||||
else {
|
||||
onTransitionEndFn.call();
|
||||
}
|
||||
|
||||
this.open = false;
|
||||
},
|
||||
openMenu : function() {
|
||||
if( !this.open ) {
|
||||
this._openMenu();
|
||||
}
|
||||
},
|
||||
_openMenu : function() {
|
||||
var self = this;
|
||||
// clicking somewhere else makes the menu close
|
||||
$body.off( 'click' ).on( 'click.dlmenu', function() {
|
||||
self._closeMenu() ;
|
||||
} );
|
||||
this.$menu.addClass( 'dl-menuopen dl-menu-toggle' ).on( this.transEndEventName, function() {
|
||||
$( this ).removeClass( 'dl-menu-toggle' );
|
||||
} );
|
||||
this.$trigger.addClass( 'dl-active' );
|
||||
$body.addClass('explorer-open');
|
||||
$('.explorer').css('top', $(document).scrollTop());
|
||||
this.open = true;
|
||||
},
|
||||
// resets the menu to its original state (first level of options)
|
||||
_resetMenu : function() {
|
||||
this.$menu.removeClass( 'dl-subview' );
|
||||
this.$menuitems.parent().removeClass( 'dl-subview dl-subviewopen' );
|
||||
}
|
||||
};
|
||||
|
||||
var logError = function( message ) {
|
||||
if ( window.console ) {
|
||||
window.console.error( message );
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.dlmenu = function( options ) {
|
||||
if ( typeof options === 'string' ) {
|
||||
var args = Array.prototype.slice.call( arguments, 1 );
|
||||
this.each(function() {
|
||||
var instance = $.data( this, 'dlmenu' );
|
||||
if ( !instance ) {
|
||||
logError( "cannot call methods on dlmenu prior to initialization; " +
|
||||
"attempted to call method '" + options + "'" );
|
||||
return;
|
||||
}
|
||||
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
||||
logError( "no such method '" + options + "' for dlmenu instance" );
|
||||
return;
|
||||
}
|
||||
instance[ options ].apply( instance, args );
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, 'dlmenu' );
|
||||
if ( instance ) {
|
||||
instance._init();
|
||||
}
|
||||
else {
|
||||
instance = $.data( this, 'dlmenu', new $.DLMenu( options, this ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
} )( jQuery, window );
|
||||
1
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/jquery.timepicker.min.js
vendored
Normal file
4
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js
vendored
Normal file
94
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/rangy-core.js
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
Rangy, a cross-browser JavaScript range and selection library
|
||||
http://code.google.com/p/rangy/
|
||||
|
||||
Copyright 2012, Tim Down
|
||||
Licensed under the MIT license.
|
||||
Version: 1.2.3
|
||||
Build date: 26 February 2012
|
||||
*/
|
||||
window.rangy=function(){function l(p,u){var w=typeof p[u];return w=="function"||!!(w=="object"&&p[u])||w=="unknown"}function K(p,u){return!!(typeof p[u]=="object"&&p[u])}function H(p,u){return typeof p[u]!="undefined"}function I(p){return function(u,w){for(var B=w.length;B--;)if(!p(u,w[B]))return false;return true}}function z(p){return p&&A(p,x)&&v(p,t)}function C(p){window.alert("Rangy not supported in your browser. Reason: "+p);c.initialized=true;c.supported=false}function N(){if(!c.initialized){var p,
|
||||
u=false,w=false;if(l(document,"createRange")){p=document.createRange();if(A(p,n)&&v(p,i))u=true;p.detach()}if((p=K(document,"body")?document.body:document.getElementsByTagName("body")[0])&&l(p,"createTextRange")){p=p.createTextRange();if(z(p))w=true}!u&&!w&&C("Neither Range nor TextRange are implemented");c.initialized=true;c.features={implementsDomRange:u,implementsTextRange:w};u=k.concat(f);w=0;for(p=u.length;w<p;++w)try{u[w](c)}catch(B){K(window,"console")&&l(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",
|
||||
B)}}}function O(p){this.name=p;this.supported=this.initialized=false}var i=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],n=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],
|
||||
t=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],x=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],A=I(l),q=I(K),v=I(H),c={version:"1.2.3",initialized:false,supported:true,util:{isHostMethod:l,isHostObject:K,isHostProperty:H,areHostMethods:A,areHostObjects:q,areHostProperties:v,isTextRange:z},features:{},modules:{},config:{alertOnWarn:false,preferTextRange:false}};
|
||||
c.fail=C;c.warn=function(p){p="Rangy warning: "+p;if(c.config.alertOnWarn)window.alert(p);else typeof window.console!="undefined"&&typeof window.console.log!="undefined"&&window.console.log(p)};if({}.hasOwnProperty)c.util.extend=function(p,u){for(var w in u)if(u.hasOwnProperty(w))p[w]=u[w]};else C("hasOwnProperty not supported");var f=[],k=[];c.init=N;c.addInitListener=function(p){c.initialized?p(c):f.push(p)};var r=[];c.addCreateMissingNativeApiListener=function(p){r.push(p)};c.createMissingNativeApi=
|
||||
function(p){p=p||window;N();for(var u=0,w=r.length;u<w;++u)r[u](p)};O.prototype.fail=function(p){this.initialized=true;this.supported=false;throw Error("Module '"+this.name+"' failed to load: "+p);};O.prototype.warn=function(p){c.warn("Module "+this.name+": "+p)};O.prototype.createError=function(p){return Error("Error in Rangy "+this.name+" module: "+p)};c.createModule=function(p,u){var w=new O(p);c.modules[p]=w;k.push(function(B){u(B,w);w.initialized=true;w.supported=true})};c.requireModules=function(p){for(var u=
|
||||
0,w=p.length,B,V;u<w;++u){V=p[u];B=c.modules[V];if(!B||!(B instanceof O))throw Error("Module '"+V+"' not found");if(!B.supported)throw Error("Module '"+V+"' not supported");}};var L=false;q=function(){if(!L){L=true;c.initialized||N()}};if(typeof window=="undefined")C("No window found");else if(typeof document=="undefined")C("No document found");else{l(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",q,false);if(l(window,"addEventListener"))window.addEventListener("load",
|
||||
q,false);else l(window,"attachEvent")?window.attachEvent("onload",q):C("Window does not have required addEventListener or attachEvent method");return c}}();
|
||||
rangy.createModule("DomUtil",function(l,K){function H(c){for(var f=0;c=c.previousSibling;)f++;return f}function I(c,f){var k=[],r;for(r=c;r;r=r.parentNode)k.push(r);for(r=f;r;r=r.parentNode)if(v(k,r))return r;return null}function z(c,f,k){for(k=k?c:c.parentNode;k;){c=k.parentNode;if(c===f)return k;k=c}return null}function C(c){c=c.nodeType;return c==3||c==4||c==8}function N(c,f){var k=f.nextSibling,r=f.parentNode;k?r.insertBefore(c,k):r.appendChild(c);return c}function O(c){if(c.nodeType==9)return c;
|
||||
else if(typeof c.ownerDocument!="undefined")return c.ownerDocument;else if(typeof c.document!="undefined")return c.document;else if(c.parentNode)return O(c.parentNode);else throw Error("getDocument: no document found for node");}function i(c){if(!c)return"[No node]";return C(c)?'"'+c.data+'"':c.nodeType==1?"<"+c.nodeName+(c.id?' id="'+c.id+'"':"")+">["+c.childNodes.length+"]":c.nodeName}function n(c){this._next=this.root=c}function t(c,f){this.node=c;this.offset=f}function x(c){this.code=this[c];
|
||||
this.codeName=c;this.message="DOMException: "+this.codeName}var A=l.util;A.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||K.fail("document missing a Node creation method");A.isHostMethod(document,"getElementsByTagName")||K.fail("document missing getElementsByTagName method");var q=document.createElement("div");A.areHostMethods(q,["insertBefore","appendChild","cloneNode"])||K.fail("Incomplete Element implementation");A.isHostProperty(q,"innerHTML")||K.fail("Element is missing innerHTML property");
|
||||
q=document.createTextNode("test");A.areHostMethods(q,["splitText","deleteData","insertData","appendData","cloneNode"])||K.fail("Incomplete Text Node implementation");var v=function(c,f){for(var k=c.length;k--;)if(c[k]===f)return true;return false};n.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var c=this._current=this._next,f;if(this._current)if(f=c.firstChild)this._next=f;else{for(f=null;c!==this.root&&!(f=c.nextSibling);)c=c.parentNode;this._next=f}return this._current},
|
||||
detach:function(){this._current=this._next=this.root=null}};t.prototype={equals:function(c){return this.node===c.node&this.offset==c.offset},inspect:function(){return"[DomPosition("+i(this.node)+":"+this.offset+")]"}};x.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};x.prototype.toString=function(){return this.message};l.dom={arrayContains:v,isHtmlNamespace:function(c){var f;return typeof c.namespaceURI==
|
||||
"undefined"||(f=c.namespaceURI)===null||f=="http://www.w3.org/1999/xhtml"},parentElement:function(c){c=c.parentNode;return c.nodeType==1?c:null},getNodeIndex:H,getNodeLength:function(c){var f;return C(c)?c.length:(f=c.childNodes)?f.length:0},getCommonAncestor:I,isAncestorOf:function(c,f,k){for(f=k?f:f.parentNode;f;)if(f===c)return true;else f=f.parentNode;return false},getClosestAncestorIn:z,isCharacterDataNode:C,insertAfter:N,splitDataNode:function(c,f){var k=c.cloneNode(false);k.deleteData(0,f);
|
||||
c.deleteData(f,c.length-f);N(k,c);return k},getDocument:O,getWindow:function(c){c=O(c);if(typeof c.defaultView!="undefined")return c.defaultView;else if(typeof c.parentWindow!="undefined")return c.parentWindow;else throw Error("Cannot get a window object for node");},getIframeWindow:function(c){if(typeof c.contentWindow!="undefined")return c.contentWindow;else if(typeof c.contentDocument!="undefined")return c.contentDocument.defaultView;else throw Error("getIframeWindow: No Window object found for iframe element");
|
||||
},getIframeDocument:function(c){if(typeof c.contentDocument!="undefined")return c.contentDocument;else if(typeof c.contentWindow!="undefined")return c.contentWindow.document;else throw Error("getIframeWindow: No Document object found for iframe element");},getBody:function(c){return A.isHostObject(c,"body")?c.body:c.getElementsByTagName("body")[0]},getRootContainer:function(c){for(var f;f=c.parentNode;)c=f;return c},comparePoints:function(c,f,k,r){var L;if(c==k)return f===r?0:f<r?-1:1;else if(L=z(k,
|
||||
c,true))return f<=H(L)?-1:1;else if(L=z(c,k,true))return H(L)<r?-1:1;else{f=I(c,k);c=c===f?f:z(c,f,true);k=k===f?f:z(k,f,true);if(c===k)throw Error("comparePoints got to case 4 and childA and childB are the same!");else{for(f=f.firstChild;f;){if(f===c)return-1;else if(f===k)return 1;f=f.nextSibling}throw Error("Should not be here!");}}},inspectNode:i,fragmentFromNodeChildren:function(c){for(var f=O(c).createDocumentFragment(),k;k=c.firstChild;)f.appendChild(k);return f},createIterator:function(c){return new n(c)},
|
||||
DomPosition:t};l.DOMException=x});
|
||||
rangy.createModule("DomRange",function(l){function K(a,e){return a.nodeType!=3&&(g.isAncestorOf(a,e.startContainer,true)||g.isAncestorOf(a,e.endContainer,true))}function H(a){return g.getDocument(a.startContainer)}function I(a,e,j){if(e=a._listeners[e])for(var o=0,E=e.length;o<E;++o)e[o].call(a,{target:a,args:j})}function z(a){return new Z(a.parentNode,g.getNodeIndex(a))}function C(a){return new Z(a.parentNode,g.getNodeIndex(a)+1)}function N(a,e,j){var o=a.nodeType==11?a.firstChild:a;if(g.isCharacterDataNode(e))j==
|
||||
e.length?g.insertAfter(a,e):e.parentNode.insertBefore(a,j==0?e:g.splitDataNode(e,j));else j>=e.childNodes.length?e.appendChild(a):e.insertBefore(a,e.childNodes[j]);return o}function O(a){for(var e,j,o=H(a.range).createDocumentFragment();j=a.next();){e=a.isPartiallySelectedSubtree();j=j.cloneNode(!e);if(e){e=a.getSubtreeIterator();j.appendChild(O(e));e.detach(true)}if(j.nodeType==10)throw new S("HIERARCHY_REQUEST_ERR");o.appendChild(j)}return o}function i(a,e,j){var o,E;for(j=j||{stop:false};o=a.next();)if(a.isPartiallySelectedSubtree())if(e(o)===
|
||||
false){j.stop=true;return}else{o=a.getSubtreeIterator();i(o,e,j);o.detach(true);if(j.stop)return}else for(o=g.createIterator(o);E=o.next();)if(e(E)===false){j.stop=true;return}}function n(a){for(var e;a.next();)if(a.isPartiallySelectedSubtree()){e=a.getSubtreeIterator();n(e);e.detach(true)}else a.remove()}function t(a){for(var e,j=H(a.range).createDocumentFragment(),o;e=a.next();){if(a.isPartiallySelectedSubtree()){e=e.cloneNode(false);o=a.getSubtreeIterator();e.appendChild(t(o));o.detach(true)}else a.remove();
|
||||
if(e.nodeType==10)throw new S("HIERARCHY_REQUEST_ERR");j.appendChild(e)}return j}function x(a,e,j){var o=!!(e&&e.length),E,T=!!j;if(o)E=RegExp("^("+e.join("|")+")$");var m=[];i(new q(a,false),function(s){if((!o||E.test(s.nodeType))&&(!T||j(s)))m.push(s)});return m}function A(a){return"["+(typeof a.getName=="undefined"?"Range":a.getName())+"("+g.inspectNode(a.startContainer)+":"+a.startOffset+", "+g.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function q(a,e){this.range=a;this.clonePartiallySelectedTextNodes=
|
||||
e;if(!a.collapsed){this.sc=a.startContainer;this.so=a.startOffset;this.ec=a.endContainer;this.eo=a.endOffset;var j=a.commonAncestorContainer;if(this.sc===this.ec&&g.isCharacterDataNode(this.sc)){this.isSingleCharacterDataNode=true;this._first=this._last=this._next=this.sc}else{this._first=this._next=this.sc===j&&!g.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:g.getClosestAncestorIn(this.sc,j,true);this._last=this.ec===j&&!g.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:g.getClosestAncestorIn(this.ec,
|
||||
j,true)}}}function v(a){this.code=this[a];this.codeName=a;this.message="RangeException: "+this.codeName}function c(a,e,j){this.nodes=x(a,e,j);this._next=this.nodes[0];this._position=0}function f(a){return function(e,j){for(var o,E=j?e:e.parentNode;E;){o=E.nodeType;if(g.arrayContains(a,o))return E;E=E.parentNode}return null}}function k(a,e){if(G(a,e))throw new v("INVALID_NODE_TYPE_ERR");}function r(a){if(!a.startContainer)throw new S("INVALID_STATE_ERR");}function L(a,e){if(!g.arrayContains(e,a.nodeType))throw new v("INVALID_NODE_TYPE_ERR");
|
||||
}function p(a,e){if(e<0||e>(g.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new S("INDEX_SIZE_ERR");}function u(a,e){if(h(a,true)!==h(e,true))throw new S("WRONG_DOCUMENT_ERR");}function w(a){if(D(a,true))throw new S("NO_MODIFICATION_ALLOWED_ERR");}function B(a,e){if(!a)throw new S(e);}function V(a){return!!a.startContainer&&!!a.endContainer&&!(!g.arrayContains(ba,a.startContainer.nodeType)&&!h(a.startContainer,true))&&!(!g.arrayContains(ba,a.endContainer.nodeType)&&!h(a.endContainer,
|
||||
true))&&a.startOffset<=(g.isCharacterDataNode(a.startContainer)?a.startContainer.length:a.startContainer.childNodes.length)&&a.endOffset<=(g.isCharacterDataNode(a.endContainer)?a.endContainer.length:a.endContainer.childNodes.length)}function J(a){r(a);if(!V(a))throw Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")");}function ca(){}function Y(a){a.START_TO_START=ia;a.START_TO_END=la;a.END_TO_END=ra;a.END_TO_START=ma;a.NODE_BEFORE=na;a.NODE_AFTER=oa;a.NODE_BEFORE_AND_AFTER=
|
||||
pa;a.NODE_INSIDE=ja}function W(a){Y(a);Y(a.prototype)}function da(a,e){return function(){J(this);var j=this.startContainer,o=this.startOffset,E=this.commonAncestorContainer,T=new q(this,true);if(j!==E){j=g.getClosestAncestorIn(j,E,true);o=C(j);j=o.node;o=o.offset}i(T,w);T.reset();E=a(T);T.detach();e(this,j,o,j,o);return E}}function fa(a,e,j){function o(m,s){return function(y){r(this);L(y,$);L(d(y),ba);y=(m?z:C)(y);(s?E:T)(this,y.node,y.offset)}}function E(m,s,y){var F=m.endContainer,Q=m.endOffset;
|
||||
if(s!==m.startContainer||y!==m.startOffset){if(d(s)!=d(F)||g.comparePoints(s,y,F,Q)==1){F=s;Q=y}e(m,s,y,F,Q)}}function T(m,s,y){var F=m.startContainer,Q=m.startOffset;if(s!==m.endContainer||y!==m.endOffset){if(d(s)!=d(F)||g.comparePoints(s,y,F,Q)==-1){F=s;Q=y}e(m,F,Q,s,y)}}a.prototype=new ca;l.util.extend(a.prototype,{setStart:function(m,s){r(this);k(m,true);p(m,s);E(this,m,s)},setEnd:function(m,s){r(this);k(m,true);p(m,s);T(this,m,s)},setStartBefore:o(true,true),setStartAfter:o(false,true),setEndBefore:o(true,
|
||||
false),setEndAfter:o(false,false),collapse:function(m){J(this);m?e(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):e(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(m){r(this);k(m,true);e(this,m,0,m,g.getNodeLength(m))},selectNode:function(m){r(this);k(m,false);L(m,$);var s=z(m);m=C(m);e(this,s.node,s.offset,m.node,m.offset)},extractContents:da(t,e),deleteContents:da(n,e),canSurroundContents:function(){J(this);w(this.startContainer);
|
||||
w(this.endContainer);var m=new q(this,true),s=m._first&&K(m._first,this)||m._last&&K(m._last,this);m.detach();return!s},detach:function(){j(this)},splitBoundaries:function(){J(this);var m=this.startContainer,s=this.startOffset,y=this.endContainer,F=this.endOffset,Q=m===y;g.isCharacterDataNode(y)&&F>0&&F<y.length&&g.splitDataNode(y,F);if(g.isCharacterDataNode(m)&&s>0&&s<m.length){m=g.splitDataNode(m,s);if(Q){F-=s;y=m}else y==m.parentNode&&F>=g.getNodeIndex(m)&&F++;s=0}e(this,m,s,y,F)},normalizeBoundaries:function(){J(this);
|
||||
var m=this.startContainer,s=this.startOffset,y=this.endContainer,F=this.endOffset,Q=function(U){var R=U.nextSibling;if(R&&R.nodeType==U.nodeType){y=U;F=U.length;U.appendData(R.data);R.parentNode.removeChild(R)}},qa=function(U){var R=U.previousSibling;if(R&&R.nodeType==U.nodeType){m=U;var sa=U.length;s=R.length;U.insertData(0,R.data);R.parentNode.removeChild(R);if(m==y){F+=s;y=m}else if(y==U.parentNode){R=g.getNodeIndex(U);if(F==R){y=U;F=sa}else F>R&&F--}}},ga=true;if(g.isCharacterDataNode(y))y.length==
|
||||
F&&Q(y);else{if(F>0)(ga=y.childNodes[F-1])&&g.isCharacterDataNode(ga)&&Q(ga);ga=!this.collapsed}if(ga)if(g.isCharacterDataNode(m))s==0&&qa(m);else{if(s<m.childNodes.length)(Q=m.childNodes[s])&&g.isCharacterDataNode(Q)&&qa(Q)}else{m=y;s=F}e(this,m,s,y,F)},collapseToPoint:function(m,s){r(this);k(m,true);p(m,s);if(m!==this.startContainer||s!==this.startOffset||m!==this.endContainer||s!==this.endOffset)e(this,m,s,m,s)}});W(a)}function ea(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===
|
||||
a.endOffset;a.commonAncestorContainer=a.collapsed?a.startContainer:g.getCommonAncestor(a.startContainer,a.endContainer)}function ha(a,e,j,o,E){var T=a.startContainer!==e||a.startOffset!==j,m=a.endContainer!==o||a.endOffset!==E;a.startContainer=e;a.startOffset=j;a.endContainer=o;a.endOffset=E;ea(a);I(a,"boundarychange",{startMoved:T,endMoved:m})}function M(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};ea(this)}l.requireModules(["DomUtil"]);
|
||||
var g=l.dom,Z=g.DomPosition,S=l.DOMException;q.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:false,reset:function(){this._current=null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next;if(a){this._next=a!==this._last?a.nextSibling:null;if(g.isCharacterDataNode(a)&&this.clonePartiallySelectedTextNodes){if(a===this.ec)(a=a.cloneNode(true)).deleteData(this.eo,a.length-this.eo);if(this._current===this.sc)(a=
|
||||
a.cloneNode(true)).deleteData(0,this.so)}}return a},remove:function(){var a=this._current,e,j;if(g.isCharacterDataNode(a)&&(a===this.sc||a===this.ec)){e=a===this.sc?this.so:0;j=a===this.ec?this.eo:a.length;e!=j&&a.deleteData(e,j-e)}else a.parentNode&&a.parentNode.removeChild(a)},isPartiallySelectedSubtree:function(){return K(this._current,this.range)},getSubtreeIterator:function(){var a;if(this.isSingleCharacterDataNode){a=this.range.cloneRange();a.collapse()}else{a=new M(H(this.range));var e=this._current,
|
||||
j=e,o=0,E=e,T=g.getNodeLength(e);if(g.isAncestorOf(e,this.sc,true)){j=this.sc;o=this.so}if(g.isAncestorOf(e,this.ec,true)){E=this.ec;T=this.eo}ha(a,j,o,E,T)}return new q(a,this.clonePartiallySelectedTextNodes)},detach:function(a){a&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};v.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};v.prototype.toString=function(){return this.message};c.prototype={_current:null,hasNext:function(){return!!this._next},
|
||||
next:function(){this._current=this._next;this._next=this.nodes[++this._position];return this._current},detach:function(){this._current=this._next=this.nodes=null}};var $=[1,3,4,5,7,8,10],ba=[2,9,11],aa=[1,3,4,5,7,8,10,11],b=[1,3,4,5,7,8],d=g.getRootContainer,h=f([9,11]),D=f([5,6,10,12]),G=f([6,10,12]),P=document.createElement("style"),X=false;try{P.innerHTML="<b>x</b>";X=P.firstChild.nodeType==3}catch(ta){}l.features.htmlParsingConforms=X;var ka=["startContainer","startOffset","endContainer","endOffset",
|
||||
"collapsed","commonAncestorContainer"],ia=0,la=1,ra=2,ma=3,na=0,oa=1,pa=2,ja=3;ca.prototype={attachListener:function(a,e){this._listeners[a].push(e)},compareBoundaryPoints:function(a,e){J(this);u(this.startContainer,e.startContainer);var j=a==ma||a==ia?"start":"end",o=a==la||a==ia?"start":"end";return g.comparePoints(this[j+"Container"],this[j+"Offset"],e[o+"Container"],e[o+"Offset"])},insertNode:function(a){J(this);L(a,aa);w(this.startContainer);if(g.isAncestorOf(a,this.startContainer,true))throw new S("HIERARCHY_REQUEST_ERR");
|
||||
this.setStartBefore(N(a,this.startContainer,this.startOffset))},cloneContents:function(){J(this);var a,e;if(this.collapsed)return H(this).createDocumentFragment();else{if(this.startContainer===this.endContainer&&g.isCharacterDataNode(this.startContainer)){a=this.startContainer.cloneNode(true);a.data=a.data.slice(this.startOffset,this.endOffset);e=H(this).createDocumentFragment();e.appendChild(a);return e}else{e=new q(this,true);a=O(e);e.detach()}return a}},canSurroundContents:function(){J(this);w(this.startContainer);
|
||||
w(this.endContainer);var a=new q(this,true),e=a._first&&K(a._first,this)||a._last&&K(a._last,this);a.detach();return!e},surroundContents:function(a){L(a,b);if(!this.canSurroundContents())throw new v("BAD_BOUNDARYPOINTS_ERR");var e=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);N(a,this.startContainer,this.startOffset);a.appendChild(e);this.selectNode(a)},cloneRange:function(){J(this);for(var a=new M(H(this)),e=ka.length,j;e--;){j=ka[e];a[j]=this[j]}return a},
|
||||
toString:function(){J(this);var a=this.startContainer;if(a===this.endContainer&&g.isCharacterDataNode(a))return a.nodeType==3||a.nodeType==4?a.data.slice(this.startOffset,this.endOffset):"";else{var e=[];a=new q(this,true);i(a,function(j){if(j.nodeType==3||j.nodeType==4)e.push(j.data)});a.detach();return e.join("")}},compareNode:function(a){J(this);var e=a.parentNode,j=g.getNodeIndex(a);if(!e)throw new S("NOT_FOUND_ERR");a=this.comparePoint(e,j);e=this.comparePoint(e,j+1);return a<0?e>0?pa:na:e>0?
|
||||
oa:ja},comparePoint:function(a,e){J(this);B(a,"HIERARCHY_REQUEST_ERR");u(a,this.startContainer);if(g.comparePoints(a,e,this.startContainer,this.startOffset)<0)return-1;else if(g.comparePoints(a,e,this.endContainer,this.endOffset)>0)return 1;return 0},createContextualFragment:X?function(a){var e=this.startContainer,j=g.getDocument(e);if(!e)throw new S("INVALID_STATE_ERR");var o=null;if(e.nodeType==1)o=e;else if(g.isCharacterDataNode(e))o=g.parentElement(e);o=o===null||o.nodeName=="HTML"&&g.isHtmlNamespace(g.getDocument(o).documentElement)&&
|
||||
g.isHtmlNamespace(o)?j.createElement("body"):o.cloneNode(false);o.innerHTML=a;return g.fragmentFromNodeChildren(o)}:function(a){r(this);var e=H(this).createElement("body");e.innerHTML=a;return g.fragmentFromNodeChildren(e)},toHtml:function(){J(this);var a=H(this).createElement("div");a.appendChild(this.cloneContents());return a.innerHTML},intersectsNode:function(a,e){J(this);B(a,"NOT_FOUND_ERR");if(g.getDocument(a)!==H(this))return false;var j=a.parentNode,o=g.getNodeIndex(a);B(j,"NOT_FOUND_ERR");
|
||||
var E=g.comparePoints(j,o,this.endContainer,this.endOffset);j=g.comparePoints(j,o+1,this.startContainer,this.startOffset);return e?E<=0&&j>=0:E<0&&j>0},isPointInRange:function(a,e){J(this);B(a,"HIERARCHY_REQUEST_ERR");u(a,this.startContainer);return g.comparePoints(a,e,this.startContainer,this.startOffset)>=0&&g.comparePoints(a,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(a,e){J(this);if(H(a)!=H(this))throw new S("WRONG_DOCUMENT_ERR");var j=g.comparePoints(this.startContainer,
|
||||
this.startOffset,a.endContainer,a.endOffset),o=g.comparePoints(this.endContainer,this.endOffset,a.startContainer,a.startOffset);return e?j<=0&&o>=0:j<0&&o>0},intersection:function(a){if(this.intersectsRange(a)){var e=g.comparePoints(this.startContainer,this.startOffset,a.startContainer,a.startOffset),j=g.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),o=this.cloneRange();e==-1&&o.setStart(a.startContainer,a.startOffset);j==1&&o.setEnd(a.endContainer,a.endOffset);return o}return null},
|
||||
union:function(a){if(this.intersectsRange(a,true)){var e=this.cloneRange();g.comparePoints(a.startContainer,a.startOffset,this.startContainer,this.startOffset)==-1&&e.setStart(a.startContainer,a.startOffset);g.comparePoints(a.endContainer,a.endOffset,this.endContainer,this.endOffset)==1&&e.setEnd(a.endContainer,a.endOffset);return e}else throw new v("Ranges do not intersect");},containsNode:function(a,e){return e?this.intersectsNode(a,false):this.compareNode(a)==ja},containsNodeContents:function(a){return this.comparePoint(a,
|
||||
0)>=0&&this.comparePoint(a,g.getNodeLength(a))<=0},containsRange:function(a){return this.intersection(a).equals(a)},containsNodeText:function(a){var e=this.cloneRange();e.selectNode(a);var j=e.getNodes([3]);if(j.length>0){e.setStart(j[0],0);a=j.pop();e.setEnd(a,a.length);a=this.containsRange(e);e.detach();return a}else return this.containsNodeContents(a)},createNodeIterator:function(a,e){J(this);return new c(this,a,e)},getNodes:function(a,e){J(this);return x(this,a,e)},getDocument:function(){return H(this)},
|
||||
collapseBefore:function(a){r(this);this.setEndBefore(a);this.collapse(false)},collapseAfter:function(a){r(this);this.setStartAfter(a);this.collapse(true)},getName:function(){return"DomRange"},equals:function(a){return M.rangesEqual(this,a)},isValid:function(){return V(this)},inspect:function(){return A(this)}};fa(M,ha,function(a){r(a);a.startContainer=a.startOffset=a.endContainer=a.endOffset=null;a.collapsed=a.commonAncestorContainer=null;I(a,"detach",null);a._listeners=null});l.rangePrototype=ca.prototype;
|
||||
M.rangeProperties=ka;M.RangeIterator=q;M.copyComparisonConstants=W;M.createPrototypeRange=fa;M.inspect=A;M.getRangeDocument=H;M.rangesEqual=function(a,e){return a.startContainer===e.startContainer&&a.startOffset===e.startOffset&&a.endContainer===e.endContainer&&a.endOffset===e.endOffset};l.DomRange=M;l.RangeException=v});
|
||||
rangy.createModule("WrappedRange",function(l){function K(i,n,t,x){var A=i.duplicate();A.collapse(t);var q=A.parentElement();z.isAncestorOf(n,q,true)||(q=n);if(!q.canHaveHTML)return new C(q.parentNode,z.getNodeIndex(q));n=z.getDocument(q).createElement("span");var v,c=t?"StartToStart":"StartToEnd";do{q.insertBefore(n,n.previousSibling);A.moveToElementText(n)}while((v=A.compareEndPoints(c,i))>0&&n.previousSibling);c=n.nextSibling;if(v==-1&&c&&z.isCharacterDataNode(c)){A.setEndPoint(t?"EndToStart":"EndToEnd",
|
||||
i);if(/[\r\n]/.test(c.data)){q=A.duplicate();t=q.text.replace(/\r\n/g,"\r").length;for(t=q.moveStart("character",t);q.compareEndPoints("StartToEnd",q)==-1;){t++;q.moveStart("character",1)}}else t=A.text.length;q=new C(c,t)}else{c=(x||!t)&&n.previousSibling;q=(t=(x||t)&&n.nextSibling)&&z.isCharacterDataNode(t)?new C(t,0):c&&z.isCharacterDataNode(c)?new C(c,c.length):new C(q,z.getNodeIndex(n))}n.parentNode.removeChild(n);return q}function H(i,n){var t,x,A=i.offset,q=z.getDocument(i.node),v=q.body.createTextRange(),
|
||||
c=z.isCharacterDataNode(i.node);if(c){t=i.node;x=t.parentNode}else{t=i.node.childNodes;t=A<t.length?t[A]:null;x=i.node}q=q.createElement("span");q.innerHTML="&#feff;";t?x.insertBefore(q,t):x.appendChild(q);v.moveToElementText(q);v.collapse(!n);x.removeChild(q);if(c)v[n?"moveStart":"moveEnd"]("character",A);return v}l.requireModules(["DomUtil","DomRange"]);var I,z=l.dom,C=z.DomPosition,N=l.DomRange;if(l.features.implementsDomRange&&(!l.features.implementsTextRange||!l.config.preferTextRange)){(function(){function i(f){for(var k=
|
||||
t.length,r;k--;){r=t[k];f[r]=f.nativeRange[r]}}var n,t=N.rangeProperties,x,A;I=function(f){if(!f)throw Error("Range must be specified");this.nativeRange=f;i(this)};N.createPrototypeRange(I,function(f,k,r,L,p){var u=f.endContainer!==L||f.endOffset!=p;if(f.startContainer!==k||f.startOffset!=r||u){f.setEnd(L,p);f.setStart(k,r)}},function(f){f.nativeRange.detach();f.detached=true;for(var k=t.length,r;k--;){r=t[k];f[r]=null}});n=I.prototype;n.selectNode=function(f){this.nativeRange.selectNode(f);i(this)};
|
||||
n.deleteContents=function(){this.nativeRange.deleteContents();i(this)};n.extractContents=function(){var f=this.nativeRange.extractContents();i(this);return f};n.cloneContents=function(){return this.nativeRange.cloneContents()};n.surroundContents=function(f){this.nativeRange.surroundContents(f);i(this)};n.collapse=function(f){this.nativeRange.collapse(f);i(this)};n.cloneRange=function(){return new I(this.nativeRange.cloneRange())};n.refresh=function(){i(this)};n.toString=function(){return this.nativeRange.toString()};
|
||||
var q=document.createTextNode("test");z.getBody(document).appendChild(q);var v=document.createRange();v.setStart(q,0);v.setEnd(q,0);try{v.setStart(q,1);x=true;n.setStart=function(f,k){this.nativeRange.setStart(f,k);i(this)};n.setEnd=function(f,k){this.nativeRange.setEnd(f,k);i(this)};A=function(f){return function(k){this.nativeRange[f](k);i(this)}}}catch(c){x=false;n.setStart=function(f,k){try{this.nativeRange.setStart(f,k)}catch(r){this.nativeRange.setEnd(f,k);this.nativeRange.setStart(f,k)}i(this)};
|
||||
n.setEnd=function(f,k){try{this.nativeRange.setEnd(f,k)}catch(r){this.nativeRange.setStart(f,k);this.nativeRange.setEnd(f,k)}i(this)};A=function(f,k){return function(r){try{this.nativeRange[f](r)}catch(L){this.nativeRange[k](r);this.nativeRange[f](r)}i(this)}}}n.setStartBefore=A("setStartBefore","setEndBefore");n.setStartAfter=A("setStartAfter","setEndAfter");n.setEndBefore=A("setEndBefore","setStartBefore");n.setEndAfter=A("setEndAfter","setStartAfter");v.selectNodeContents(q);n.selectNodeContents=
|
||||
v.startContainer==q&&v.endContainer==q&&v.startOffset==0&&v.endOffset==q.length?function(f){this.nativeRange.selectNodeContents(f);i(this)}:function(f){this.setStart(f,0);this.setEnd(f,N.getEndOffset(f))};v.selectNodeContents(q);v.setEnd(q,3);x=document.createRange();x.selectNodeContents(q);x.setEnd(q,4);x.setStart(q,2);n.compareBoundaryPoints=v.compareBoundaryPoints(v.START_TO_END,x)==-1&v.compareBoundaryPoints(v.END_TO_START,x)==1?function(f,k){k=k.nativeRange||k;if(f==k.START_TO_END)f=k.END_TO_START;
|
||||
else if(f==k.END_TO_START)f=k.START_TO_END;return this.nativeRange.compareBoundaryPoints(f,k)}:function(f,k){return this.nativeRange.compareBoundaryPoints(f,k.nativeRange||k)};if(l.util.isHostMethod(v,"createContextualFragment"))n.createContextualFragment=function(f){return this.nativeRange.createContextualFragment(f)};z.getBody(document).removeChild(q);v.detach();x.detach()})();l.createNativeRange=function(i){i=i||document;return i.createRange()}}else if(l.features.implementsTextRange){I=function(i){this.textRange=
|
||||
i;this.refresh()};I.prototype=new N(document);I.prototype.refresh=function(){var i,n,t=this.textRange;i=t.parentElement();var x=t.duplicate();x.collapse(true);n=x.parentElement();x=t.duplicate();x.collapse(false);t=x.parentElement();n=n==t?n:z.getCommonAncestor(n,t);n=n==i?n:z.getCommonAncestor(i,n);if(this.textRange.compareEndPoints("StartToEnd",this.textRange)==0)n=i=K(this.textRange,n,true,true);else{i=K(this.textRange,n,true,false);n=K(this.textRange,n,false,false)}this.setStart(i.node,i.offset);
|
||||
this.setEnd(n.node,n.offset)};N.copyComparisonConstants(I);var O=function(){return this}();if(typeof O.Range=="undefined")O.Range=I;l.createNativeRange=function(i){i=i||document;return i.body.createTextRange()}}if(l.features.implementsTextRange)I.rangeToTextRange=function(i){if(i.collapsed)return H(new C(i.startContainer,i.startOffset),true);else{var n=H(new C(i.startContainer,i.startOffset),true),t=H(new C(i.endContainer,i.endOffset),false);i=z.getDocument(i.startContainer).body.createTextRange();
|
||||
i.setEndPoint("StartToStart",n);i.setEndPoint("EndToEnd",t);return i}};I.prototype.getName=function(){return"WrappedRange"};l.WrappedRange=I;l.createRange=function(i){i=i||document;return new I(l.createNativeRange(i))};l.createRangyRange=function(i){i=i||document;return new N(i)};l.createIframeRange=function(i){return l.createRange(z.getIframeDocument(i))};l.createIframeRangyRange=function(i){return l.createRangyRange(z.getIframeDocument(i))};l.addCreateMissingNativeApiListener(function(i){i=i.document;
|
||||
if(typeof i.createRange=="undefined")i.createRange=function(){return l.createRange(this)};i=i=null})});
|
||||
rangy.createModule("WrappedSelection",function(l,K){function H(b){return(b||window).getSelection()}function I(b){return(b||window).document.selection}function z(b,d,h){var D=h?"end":"start";h=h?"start":"end";b.anchorNode=d[D+"Container"];b.anchorOffset=d[D+"Offset"];b.focusNode=d[h+"Container"];b.focusOffset=d[h+"Offset"]}function C(b){b.anchorNode=b.focusNode=null;b.anchorOffset=b.focusOffset=0;b.rangeCount=0;b.isCollapsed=true;b._ranges.length=0}function N(b){var d;if(b instanceof k){d=b._selectionNativeRange;
|
||||
if(!d){d=l.createNativeRange(c.getDocument(b.startContainer));d.setEnd(b.endContainer,b.endOffset);d.setStart(b.startContainer,b.startOffset);b._selectionNativeRange=d;b.attachListener("detach",function(){this._selectionNativeRange=null})}}else if(b instanceof r)d=b.nativeRange;else if(l.features.implementsDomRange&&b instanceof c.getWindow(b.startContainer).Range)d=b;return d}function O(b){var d=b.getNodes(),h;a:if(!d.length||d[0].nodeType!=1)h=false;else{h=1;for(var D=d.length;h<D;++h)if(!c.isAncestorOf(d[0],
|
||||
d[h])){h=false;break a}h=true}if(!h)throw Error("getSingleElementFromRange: range "+b.inspect()+" did not consist of a single element");return d[0]}function i(b,d){var h=new r(d);b._ranges=[h];z(b,h,false);b.rangeCount=1;b.isCollapsed=h.collapsed}function n(b){b._ranges.length=0;if(b.docSelection.type=="None")C(b);else{var d=b.docSelection.createRange();if(d&&typeof d.text!="undefined")i(b,d);else{b.rangeCount=d.length;for(var h,D=c.getDocument(d.item(0)),G=0;G<b.rangeCount;++G){h=l.createRange(D);
|
||||
h.selectNode(d.item(G));b._ranges.push(h)}b.isCollapsed=b.rangeCount==1&&b._ranges[0].collapsed;z(b,b._ranges[b.rangeCount-1],false)}}}function t(b,d){var h=b.docSelection.createRange(),D=O(d),G=c.getDocument(h.item(0));G=c.getBody(G).createControlRange();for(var P=0,X=h.length;P<X;++P)G.add(h.item(P));try{G.add(D)}catch(ta){throw Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}G.select();n(b)}function x(b,d,h){this.nativeSelection=
|
||||
b;this.docSelection=d;this._ranges=[];this.win=h;this.refresh()}function A(b,d){var h=c.getDocument(d[0].startContainer);h=c.getBody(h).createControlRange();for(var D=0,G;D<rangeCount;++D){G=O(d[D]);try{h.add(G)}catch(P){throw Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}h.select();n(b)}function q(b,d){if(b.anchorNode&&c.getDocument(b.anchorNode)!==c.getDocument(d))throw new L("WRONG_DOCUMENT_ERR");}function v(b){var d=
|
||||
[],h=new p(b.anchorNode,b.anchorOffset),D=new p(b.focusNode,b.focusOffset),G=typeof b.getName=="function"?b.getName():"Selection";if(typeof b.rangeCount!="undefined")for(var P=0,X=b.rangeCount;P<X;++P)d[P]=k.inspect(b.getRangeAt(P));return"["+G+"(Ranges: "+d.join(", ")+")(anchor: "+h.inspect()+", focus: "+D.inspect()+"]"}l.requireModules(["DomUtil","DomRange","WrappedRange"]);l.config.checkSelectionRanges=true;var c=l.dom,f=l.util,k=l.DomRange,r=l.WrappedRange,L=l.DOMException,p=c.DomPosition,u,w,
|
||||
B=l.util.isHostMethod(window,"getSelection"),V=l.util.isHostObject(document,"selection"),J=V&&(!B||l.config.preferTextRange);if(J){u=I;l.isSelectionValid=function(b){b=(b||window).document;var d=b.selection;return d.type!="None"||c.getDocument(d.createRange().parentElement())==b}}else if(B){u=H;l.isSelectionValid=function(){return true}}else K.fail("Neither document.selection or window.getSelection() detected.");l.getNativeSelection=u;B=u();var ca=l.createNativeRange(document),Y=c.getBody(document),
|
||||
W=f.areHostObjects(B,f.areHostProperties(B,["anchorOffset","focusOffset"]));l.features.selectionHasAnchorAndFocus=W;var da=f.isHostMethod(B,"extend");l.features.selectionHasExtend=da;var fa=typeof B.rangeCount=="number";l.features.selectionHasRangeCount=fa;var ea=false,ha=true;f.areHostMethods(B,["addRange","getRangeAt","removeAllRanges"])&&typeof B.rangeCount=="number"&&l.features.implementsDomRange&&function(){var b=document.createElement("iframe");b.frameBorder=0;b.style.position="absolute";b.style.left=
|
||||
"-10000px";Y.appendChild(b);var d=c.getIframeDocument(b);d.open();d.write("<html><head></head><body>12</body></html>");d.close();var h=c.getIframeWindow(b).getSelection(),D=d.documentElement.lastChild.firstChild;d=d.createRange();d.setStart(D,1);d.collapse(true);h.addRange(d);ha=h.rangeCount==1;h.removeAllRanges();var G=d.cloneRange();d.setStart(D,0);G.setEnd(D,2);h.addRange(d);h.addRange(G);ea=h.rangeCount==2;d.detach();G.detach();Y.removeChild(b)}();l.features.selectionSupportsMultipleRanges=ea;
|
||||
l.features.collapsedNonEditableSelectionsSupported=ha;var M=false,g;if(Y&&f.isHostMethod(Y,"createControlRange")){g=Y.createControlRange();if(f.areHostProperties(g,["item","add"]))M=true}l.features.implementsControlRange=M;w=W?function(b){return b.anchorNode===b.focusNode&&b.anchorOffset===b.focusOffset}:function(b){return b.rangeCount?b.getRangeAt(b.rangeCount-1).collapsed:false};var Z;if(f.isHostMethod(B,"getRangeAt"))Z=function(b,d){try{return b.getRangeAt(d)}catch(h){return null}};else if(W)Z=
|
||||
function(b){var d=c.getDocument(b.anchorNode);d=l.createRange(d);d.setStart(b.anchorNode,b.anchorOffset);d.setEnd(b.focusNode,b.focusOffset);if(d.collapsed!==this.isCollapsed){d.setStart(b.focusNode,b.focusOffset);d.setEnd(b.anchorNode,b.anchorOffset)}return d};l.getSelection=function(b){b=b||window;var d=b._rangySelection,h=u(b),D=V?I(b):null;if(d){d.nativeSelection=h;d.docSelection=D;d.refresh(b)}else{d=new x(h,D,b);b._rangySelection=d}return d};l.getIframeSelection=function(b){return l.getSelection(c.getIframeWindow(b))};
|
||||
g=x.prototype;if(!J&&W&&f.areHostMethods(B,["removeAllRanges","addRange"])){g.removeAllRanges=function(){this.nativeSelection.removeAllRanges();C(this)};var S=function(b,d){var h=k.getRangeDocument(d);h=l.createRange(h);h.collapseToPoint(d.endContainer,d.endOffset);b.nativeSelection.addRange(N(h));b.nativeSelection.extend(d.startContainer,d.startOffset);b.refresh()};g.addRange=fa?function(b,d){if(M&&V&&this.docSelection.type=="Control")t(this,b);else if(d&&da)S(this,b);else{var h;if(ea)h=this.rangeCount;
|
||||
else{this.removeAllRanges();h=0}this.nativeSelection.addRange(N(b));this.rangeCount=this.nativeSelection.rangeCount;if(this.rangeCount==h+1){if(l.config.checkSelectionRanges)if((h=Z(this.nativeSelection,this.rangeCount-1))&&!k.rangesEqual(h,b))b=new r(h);this._ranges[this.rangeCount-1]=b;z(this,b,aa(this.nativeSelection));this.isCollapsed=w(this)}else this.refresh()}}:function(b,d){if(d&&da)S(this,b);else{this.nativeSelection.addRange(N(b));this.refresh()}};g.setRanges=function(b){if(M&&b.length>
|
||||
1)A(this,b);else{this.removeAllRanges();for(var d=0,h=b.length;d<h;++d)this.addRange(b[d])}}}else if(f.isHostMethod(B,"empty")&&f.isHostMethod(ca,"select")&&M&&J){g.removeAllRanges=function(){try{this.docSelection.empty();if(this.docSelection.type!="None"){var b;if(this.anchorNode)b=c.getDocument(this.anchorNode);else if(this.docSelection.type=="Control"){var d=this.docSelection.createRange();if(d.length)b=c.getDocument(d.item(0)).body.createTextRange()}if(b){b.body.createTextRange().select();this.docSelection.empty()}}}catch(h){}C(this)};
|
||||
g.addRange=function(b){if(this.docSelection.type=="Control")t(this,b);else{r.rangeToTextRange(b).select();this._ranges[0]=b;this.rangeCount=1;this.isCollapsed=this._ranges[0].collapsed;z(this,b,false)}};g.setRanges=function(b){this.removeAllRanges();var d=b.length;if(d>1)A(this,b);else d&&this.addRange(b[0])}}else{K.fail("No means of selecting a Range or TextRange was found");return false}g.getRangeAt=function(b){if(b<0||b>=this.rangeCount)throw new L("INDEX_SIZE_ERR");else return this._ranges[b]};
|
||||
var $;if(J)$=function(b){var d;if(l.isSelectionValid(b.win))d=b.docSelection.createRange();else{d=c.getBody(b.win.document).createTextRange();d.collapse(true)}if(b.docSelection.type=="Control")n(b);else d&&typeof d.text!="undefined"?i(b,d):C(b)};else if(f.isHostMethod(B,"getRangeAt")&&typeof B.rangeCount=="number")$=function(b){if(M&&V&&b.docSelection.type=="Control")n(b);else{b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount;if(b.rangeCount){for(var d=0,h=b.rangeCount;d<h;++d)b._ranges[d]=
|
||||
new l.WrappedRange(b.nativeSelection.getRangeAt(d));z(b,b._ranges[b.rangeCount-1],aa(b.nativeSelection));b.isCollapsed=w(b)}else C(b)}};else if(W&&typeof B.isCollapsed=="boolean"&&typeof ca.collapsed=="boolean"&&l.features.implementsDomRange)$=function(b){var d;d=b.nativeSelection;if(d.anchorNode){d=Z(d,0);b._ranges=[d];b.rangeCount=1;d=b.nativeSelection;b.anchorNode=d.anchorNode;b.anchorOffset=d.anchorOffset;b.focusNode=d.focusNode;b.focusOffset=d.focusOffset;b.isCollapsed=w(b)}else C(b)};else{K.fail("No means of obtaining a Range or TextRange from the user's selection was found");
|
||||
return false}g.refresh=function(b){var d=b?this._ranges.slice(0):null;$(this);if(b){b=d.length;if(b!=this._ranges.length)return false;for(;b--;)if(!k.rangesEqual(d[b],this._ranges[b]))return false;return true}};var ba=function(b,d){var h=b.getAllRanges(),D=false;b.removeAllRanges();for(var G=0,P=h.length;G<P;++G)if(D||d!==h[G])b.addRange(h[G]);else D=true;b.rangeCount||C(b)};g.removeRange=M?function(b){if(this.docSelection.type=="Control"){var d=this.docSelection.createRange();b=O(b);var h=c.getDocument(d.item(0));
|
||||
h=c.getBody(h).createControlRange();for(var D,G=false,P=0,X=d.length;P<X;++P){D=d.item(P);if(D!==b||G)h.add(d.item(P));else G=true}h.select();n(this)}else ba(this,b)}:function(b){ba(this,b)};var aa;if(!J&&W&&l.features.implementsDomRange){aa=function(b){var d=false;if(b.anchorNode)d=c.comparePoints(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset)==1;return d};g.isBackwards=function(){return aa(this)}}else aa=g.isBackwards=function(){return false};g.toString=function(){for(var b=[],d=0,h=this.rangeCount;d<
|
||||
h;++d)b[d]=""+this._ranges[d];return b.join("")};g.collapse=function(b,d){q(this,b);var h=l.createRange(c.getDocument(b));h.collapseToPoint(b,d);this.removeAllRanges();this.addRange(h);this.isCollapsed=true};g.collapseToStart=function(){if(this.rangeCount){var b=this._ranges[0];this.collapse(b.startContainer,b.startOffset)}else throw new L("INVALID_STATE_ERR");};g.collapseToEnd=function(){if(this.rangeCount){var b=this._ranges[this.rangeCount-1];this.collapse(b.endContainer,b.endOffset)}else throw new L("INVALID_STATE_ERR");
|
||||
};g.selectAllChildren=function(b){q(this,b);var d=l.createRange(c.getDocument(b));d.selectNodeContents(b);this.removeAllRanges();this.addRange(d)};g.deleteFromDocument=function(){if(M&&V&&this.docSelection.type=="Control"){for(var b=this.docSelection.createRange(),d;b.length;){d=b.item(0);b.remove(d);d.parentNode.removeChild(d)}this.refresh()}else if(this.rangeCount){b=this.getAllRanges();this.removeAllRanges();d=0;for(var h=b.length;d<h;++d)b[d].deleteContents();this.addRange(b[h-1])}};g.getAllRanges=
|
||||
function(){return this._ranges.slice(0)};g.setSingleRange=function(b){this.setRanges([b])};g.containsNode=function(b,d){for(var h=0,D=this._ranges.length;h<D;++h)if(this._ranges[h].containsNode(b,d))return true;return false};g.toHtml=function(){var b="";if(this.rangeCount){b=k.getRangeDocument(this._ranges[0]).createElement("div");for(var d=0,h=this._ranges.length;d<h;++d)b.appendChild(this._ranges[d].cloneContents());b=b.innerHTML}return b};g.getName=function(){return"WrappedSelection"};g.inspect=
|
||||
function(){return v(this)};g.detach=function(){this.win=this.anchorNode=this.focusNode=this.win._rangySelection=null};x.inspect=v;l.Selection=x;l.selectionPrototype=g;l.addCreateMissingNativeApiListener(function(b){if(typeof b.getSelection=="undefined")b.getSelection=function(){return l.getSelection(this)};b=null})});
|
||||
541
wagtail/wagtailadmin/static/wagtailadmin/js/vendor/tag-it.js
vendored
Executable file
|
|
@ -0,0 +1,541 @@
|
|||
/*
|
||||
* jQuery UI Tag-it!
|
||||
*
|
||||
* @version v2.0 (06/2011)
|
||||
*
|
||||
* Copyright 2011, Levy Carneiro Jr.
|
||||
* Released under the MIT license.
|
||||
* http://aehlke.github.com/tag-it/LICENSE
|
||||
*
|
||||
* Homepage:
|
||||
* http://aehlke.github.com/tag-it/
|
||||
*
|
||||
* Authors:
|
||||
* Levy Carneiro Jr.
|
||||
* Martin Rehfeld
|
||||
* Tobias Schmidt
|
||||
* Skylar Challand
|
||||
* Alex Ehlke
|
||||
*
|
||||
* Maintainer:
|
||||
* Alex Ehlke - Twitter: @aehlke
|
||||
*
|
||||
* Dependencies:
|
||||
* jQuery v1.4+
|
||||
* jQuery UI v1.8+
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
$.widget('ui.tagit', {
|
||||
options: {
|
||||
allowDuplicates : false,
|
||||
caseSensitive : true,
|
||||
fieldName : 'tags',
|
||||
placeholderText : null, // Sets `placeholder` attr on input field.
|
||||
readOnly : false, // Disables editing.
|
||||
removeConfirmation: false, // Require confirmation to remove tags.
|
||||
tagLimit : null, // Max number of tags allowed (null for unlimited).
|
||||
|
||||
// Used for autocomplete, unless you override `autocomplete.source`.
|
||||
availableTags : [],
|
||||
|
||||
// Use to override or add any options to the autocomplete widget.
|
||||
//
|
||||
// By default, autocomplete.source will map to availableTags,
|
||||
// unless overridden.
|
||||
autocomplete: {},
|
||||
|
||||
// Shows autocomplete before the user even types anything.
|
||||
showAutocompleteOnFocus: false,
|
||||
|
||||
// When enabled, quotes are unneccesary for inputting multi-word tags.
|
||||
allowSpaces: false,
|
||||
|
||||
// The below options are for using a single field instead of several
|
||||
// for our form values.
|
||||
//
|
||||
// When enabled, will use a single hidden field for the form,
|
||||
// rather than one per tag. It will delimit tags in the field
|
||||
// with singleFieldDelimiter.
|
||||
//
|
||||
// The easiest way to use singleField is to just instantiate tag-it
|
||||
// on an INPUT element, in which case singleField is automatically
|
||||
// set to true, and singleFieldNode is set to that element. This
|
||||
// way, you don't need to fiddle with these options.
|
||||
singleField: false,
|
||||
|
||||
// This is just used when preloading data from the field, and for
|
||||
// populating the field with delimited tags as the user adds them.
|
||||
singleFieldDelimiter: ',',
|
||||
|
||||
// Set this to an input DOM node to use an existing form field.
|
||||
// Any text in it will be erased on init. But it will be
|
||||
// populated with the text of tags as they are created,
|
||||
// delimited by singleFieldDelimiter.
|
||||
//
|
||||
// If this is not set, we create an input node for it,
|
||||
// with the name given in settings.fieldName.
|
||||
singleFieldNode: null,
|
||||
|
||||
// Whether to animate tag removals or not.
|
||||
animate: true,
|
||||
|
||||
// Optionally set a tabindex attribute on the input that gets
|
||||
// created for tag-it.
|
||||
tabIndex: null,
|
||||
|
||||
// Event callbacks.
|
||||
beforeTagAdded : null,
|
||||
afterTagAdded : null,
|
||||
|
||||
beforeTagRemoved : null,
|
||||
afterTagRemoved : null,
|
||||
|
||||
onTagClicked : null,
|
||||
onTagLimitExceeded : null,
|
||||
|
||||
|
||||
// DEPRECATED:
|
||||
//
|
||||
// /!\ These event callbacks are deprecated and WILL BE REMOVED at some
|
||||
// point in the future. They're here for backwards-compatibility.
|
||||
// Use the above before/after event callbacks instead.
|
||||
onTagAdded : null,
|
||||
onTagRemoved: null,
|
||||
// `autocomplete.source` is the replacement for tagSource.
|
||||
tagSource: null
|
||||
// Do not use the above deprecated options.
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
// for handling static scoping inside callbacks
|
||||
var that = this;
|
||||
|
||||
// There are 2 kinds of DOM nodes this widget can be instantiated on:
|
||||
// 1. UL, OL, or some element containing either of these.
|
||||
// 2. INPUT, in which case 'singleField' is overridden to true,
|
||||
// a UL is created and the INPUT is hidden.
|
||||
if (this.element.is('input')) {
|
||||
this.tagList = $('<ul></ul>').insertAfter(this.element);
|
||||
this.options.singleField = true;
|
||||
this.options.singleFieldNode = this.element;
|
||||
this.element.css('display', 'none');
|
||||
} else {
|
||||
this.tagList = this.element.find('ul, ol').andSelf().last();
|
||||
}
|
||||
|
||||
this.tagInput = $('<input type="text" />').addClass('ui-widget-content');
|
||||
|
||||
if (this.options.readOnly) this.tagInput.attr('disabled', 'disabled');
|
||||
|
||||
if (this.options.tabIndex) {
|
||||
this.tagInput.attr('tabindex', this.options.tabIndex);
|
||||
}
|
||||
|
||||
if (this.options.placeholderText) {
|
||||
this.tagInput.attr('placeholder', this.options.placeholderText);
|
||||
}
|
||||
|
||||
if (!this.options.autocomplete.source) {
|
||||
this.options.autocomplete.source = function(search, showChoices) {
|
||||
var filter = search.term.toLowerCase();
|
||||
var choices = $.grep(this.options.availableTags, function(element) {
|
||||
// Only match autocomplete options that begin with the search term.
|
||||
// (Case insensitive.)
|
||||
return (element.toLowerCase().indexOf(filter) === 0);
|
||||
});
|
||||
if (!this.options.allowDuplicates) {
|
||||
choices = this._subtractArray(choices, this.assignedTags());
|
||||
}
|
||||
showChoices(choices);
|
||||
};
|
||||
}
|
||||
|
||||
if (this.options.showAutocompleteOnFocus) {
|
||||
this.tagInput.focus(function(event, ui) {
|
||||
that._showAutocomplete();
|
||||
});
|
||||
|
||||
if (typeof this.options.autocomplete.minLength === 'undefined') {
|
||||
this.options.autocomplete.minLength = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Bind autocomplete.source callback functions to this context.
|
||||
if ($.isFunction(this.options.autocomplete.source)) {
|
||||
this.options.autocomplete.source = $.proxy(this.options.autocomplete.source, this);
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
if ($.isFunction(this.options.tagSource)) {
|
||||
this.options.tagSource = $.proxy(this.options.tagSource, this);
|
||||
}
|
||||
|
||||
this.tagList
|
||||
.addClass('tagit')
|
||||
.addClass('ui-widget ui-widget-content ui-corner-all')
|
||||
// Create the input field.
|
||||
.append($('<li class="tagit-new"></li>').append(this.tagInput))
|
||||
.click(function(e) {
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('tagit-label')) {
|
||||
var tag = target.closest('.tagit-choice');
|
||||
if (!tag.hasClass('removed')) {
|
||||
that._trigger('onTagClicked', e, {tag: tag, tagLabel: that.tagLabel(tag)});
|
||||
}
|
||||
} else {
|
||||
// Sets the focus() to the input field, if the user
|
||||
// clicks anywhere inside the UL. This is needed
|
||||
// because the input field needs to be of a small size.
|
||||
that.tagInput.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Single field support.
|
||||
var addedExistingFromSingleFieldNode = false;
|
||||
if (this.options.singleField) {
|
||||
if (this.options.singleFieldNode) {
|
||||
// Add existing tags from the input field.
|
||||
var node = $(this.options.singleFieldNode);
|
||||
var tags = node.val().split(this.options.singleFieldDelimiter);
|
||||
node.val('');
|
||||
$.each(tags, function(index, tag) {
|
||||
that.createTag(tag, null, true);
|
||||
addedExistingFromSingleFieldNode = true;
|
||||
});
|
||||
} else {
|
||||
// Create our single field input after our list.
|
||||
this.options.singleFieldNode = $('<input type="hidden" style="display:none;" value="" name="' + this.options.fieldName + '" />');
|
||||
this.tagList.after(this.options.singleFieldNode);
|
||||
}
|
||||
}
|
||||
|
||||
// Add existing tags from the list, if any.
|
||||
if (!addedExistingFromSingleFieldNode) {
|
||||
this.tagList.children('li').each(function() {
|
||||
if (!$(this).hasClass('tagit-new')) {
|
||||
that.createTag($(this).text(), $(this).attr('class'), true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Events.
|
||||
this.tagInput
|
||||
.keydown(function(event) {
|
||||
// Backspace is not detected within a keypress, so it must use keydown.
|
||||
if (event.which == $.ui.keyCode.BACKSPACE && that.tagInput.val() === '') {
|
||||
var tag = that._lastTag();
|
||||
if (!that.options.removeConfirmation || tag.hasClass('remove')) {
|
||||
// When backspace is pressed, the last tag is deleted.
|
||||
that.removeTag(tag);
|
||||
} else if (that.options.removeConfirmation) {
|
||||
tag.addClass('remove ui-state-highlight');
|
||||
}
|
||||
} else if (that.options.removeConfirmation) {
|
||||
that._lastTag().removeClass('remove ui-state-highlight');
|
||||
}
|
||||
|
||||
// Comma/Space/Enter are all valid delimiters for new tags,
|
||||
// except when there is an open quote or if setting allowSpaces = true.
|
||||
// Tab will also create a tag, unless the tag input is empty,
|
||||
// in which case it isn't caught.
|
||||
if (
|
||||
event.which === $.ui.keyCode.COMMA ||
|
||||
event.which === $.ui.keyCode.ENTER ||
|
||||
(
|
||||
event.which == $.ui.keyCode.TAB &&
|
||||
that.tagInput.val() !== ''
|
||||
) ||
|
||||
(
|
||||
event.which == $.ui.keyCode.SPACE &&
|
||||
that.options.allowSpaces !== true &&
|
||||
(
|
||||
$.trim(that.tagInput.val()).replace( /^s*/, '' ).charAt(0) != '"' ||
|
||||
(
|
||||
$.trim(that.tagInput.val()).charAt(0) == '"' &&
|
||||
$.trim(that.tagInput.val()).charAt($.trim(that.tagInput.val()).length - 1) == '"' &&
|
||||
$.trim(that.tagInput.val()).length - 1 !== 0
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
// Enter submits the form if there's no text in the input.
|
||||
if (!(event.which === $.ui.keyCode.ENTER && that.tagInput.val() === '')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
// Autocomplete will create its own tag from a selection and close automatically.
|
||||
if (!that.tagInput.data('autocomplete-open')) {
|
||||
that.createTag(that._cleanedInput());
|
||||
}
|
||||
}
|
||||
}).blur(function(e){
|
||||
// Create a tag when the element loses focus.
|
||||
// If autocomplete is enabled and suggestion was clicked, don't add it.
|
||||
if (!that.tagInput.data('autocomplete-open')) {
|
||||
that.createTag(that._cleanedInput());
|
||||
}
|
||||
});
|
||||
|
||||
// Autocomplete.
|
||||
if (this.options.availableTags || this.options.tagSource || this.options.autocomplete.source) {
|
||||
var autocompleteOptions = {
|
||||
select: function(event, ui) {
|
||||
that.createTag(ui.item.value);
|
||||
// Preventing the tag input to be updated with the chosen value.
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$.extend(autocompleteOptions, this.options.autocomplete);
|
||||
|
||||
// tagSource is deprecated, but takes precedence here since autocomplete.source is set by default,
|
||||
// while tagSource is left null by default.
|
||||
autocompleteOptions.source = this.options.tagSource || autocompleteOptions.source;
|
||||
|
||||
this.tagInput.autocomplete(autocompleteOptions).bind('autocompleteopen', function(event, ui) {
|
||||
that.tagInput.data('autocomplete-open', true);
|
||||
}).bind('autocompleteclose', function(event, ui) {
|
||||
that.tagInput.data('autocomplete-open', false)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_cleanedInput: function() {
|
||||
// Returns the contents of the tag input, cleaned and ready to be passed to createTag
|
||||
return $.trim(this.tagInput.val().replace(/^"(.*)"$/, '$1'));
|
||||
},
|
||||
|
||||
_lastTag: function() {
|
||||
return this.tagList.find('.tagit-choice:last:not(.removed)');
|
||||
},
|
||||
|
||||
_tags: function() {
|
||||
return this.tagList.find('.tagit-choice:not(.removed)');
|
||||
},
|
||||
|
||||
assignedTags: function() {
|
||||
// Returns an array of tag string values
|
||||
var that = this;
|
||||
var tags = [];
|
||||
if (this.options.singleField) {
|
||||
tags = $(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter);
|
||||
if (tags[0] === '') {
|
||||
tags = [];
|
||||
}
|
||||
} else {
|
||||
this._tags().each(function() {
|
||||
tags.push(that.tagLabel(this));
|
||||
});
|
||||
}
|
||||
return tags;
|
||||
},
|
||||
|
||||
_updateSingleTagsField: function(tags) {
|
||||
// Takes a list of tag string values, updates this.options.singleFieldNode.val to the tags delimited by this.options.singleFieldDelimiter
|
||||
$(this.options.singleFieldNode).val(tags.join(this.options.singleFieldDelimiter)).trigger('change');
|
||||
},
|
||||
|
||||
_subtractArray: function(a1, a2) {
|
||||
var result = [];
|
||||
for (var i = 0; i < a1.length; i++) {
|
||||
if ($.inArray(a1[i], a2) == -1) {
|
||||
result.push(a1[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
tagLabel: function(tag) {
|
||||
// Returns the tag's string label.
|
||||
if (this.options.singleField) {
|
||||
return $(tag).find('.tagit-label:first').text();
|
||||
} else {
|
||||
return $(tag).find('input:first').val();
|
||||
}
|
||||
},
|
||||
|
||||
_showAutocomplete: function() {
|
||||
this.tagInput.autocomplete('search', '');
|
||||
},
|
||||
|
||||
_findTagByLabel: function(name) {
|
||||
var that = this;
|
||||
var tag = null;
|
||||
this._tags().each(function(i) {
|
||||
if (that._formatStr(name) == that._formatStr(that.tagLabel(this))) {
|
||||
tag = $(this);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return tag;
|
||||
},
|
||||
|
||||
_isNew: function(name) {
|
||||
return !this._findTagByLabel(name);
|
||||
},
|
||||
|
||||
_formatStr: function(str) {
|
||||
if (this.options.caseSensitive) {
|
||||
return str;
|
||||
}
|
||||
return $.trim(str.toLowerCase());
|
||||
},
|
||||
|
||||
_effectExists: function(name) {
|
||||
return Boolean($.effects && ($.effects[name] || ($.effects.effect && $.effects.effect[name])));
|
||||
},
|
||||
|
||||
createTag: function(value, additionalClass, duringInitialization) {
|
||||
var that = this;
|
||||
|
||||
value = $.trim(value);
|
||||
|
||||
if(this.options.preprocessTag) {
|
||||
value = this.options.preprocessTag(value);
|
||||
}
|
||||
|
||||
if (value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.options.allowDuplicates && !this._isNew(value)) {
|
||||
var existingTag = this._findTagByLabel(value);
|
||||
if (this._trigger('onTagExists', null, {
|
||||
existingTag: existingTag,
|
||||
duringInitialization: duringInitialization
|
||||
}) !== false) {
|
||||
if (this._effectExists('highlight')) {
|
||||
existingTag.effect('highlight');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.options.tagLimit && this._tags().length >= this.options.tagLimit) {
|
||||
this._trigger('onTagLimitExceeded', null, {duringInitialization: duringInitialization});
|
||||
return false;
|
||||
}
|
||||
|
||||
var label = $(this.options.onTagClicked ? '<a class="tagit-label tag"></a>' : '<span class="tagit-label tag"></span>').text(value);
|
||||
|
||||
// Create tag.
|
||||
var tag = $('<li></li>')
|
||||
.addClass('tagit-choice ui-widget-content ui-state-default ui-corner-all')
|
||||
.addClass(additionalClass)
|
||||
.append(label);
|
||||
|
||||
if (this.options.readOnly){
|
||||
tag.addClass('tagit-choice-read-only');
|
||||
} else {
|
||||
tag.addClass('tagit-choice-editable');
|
||||
// Button for removing the tag.
|
||||
var removeTagIcon = $('<span></span>')
|
||||
.addClass('ui-icon ui-icon-close');
|
||||
var removeTag = $('<a><span class="text-icon">\xd7</span></a>') // \xd7 is an X
|
||||
.addClass('tagit-close')
|
||||
.append(removeTagIcon)
|
||||
.click(function(e) {
|
||||
// Removes a tag when the little 'x' is clicked.
|
||||
that.removeTag(tag);
|
||||
});
|
||||
tag.append(removeTag);
|
||||
}
|
||||
|
||||
// Unless options.singleField is set, each tag has a hidden input field inline.
|
||||
if (!this.options.singleField) {
|
||||
var escapedValue = label.html();
|
||||
tag.append('<input type="hidden" style="display:none;" value="' + escapedValue + '" name="' + this.options.fieldName + '" />');
|
||||
}
|
||||
|
||||
if (this._trigger('beforeTagAdded', null, {
|
||||
tag: tag,
|
||||
tagLabel: this.tagLabel(tag),
|
||||
duringInitialization: duringInitialization
|
||||
}) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.singleField) {
|
||||
var tags = this.assignedTags();
|
||||
tags.push(value);
|
||||
this._updateSingleTagsField(tags);
|
||||
}
|
||||
|
||||
// DEPRECATED.
|
||||
this._trigger('onTagAdded', null, tag);
|
||||
|
||||
this.tagInput.val('');
|
||||
|
||||
// Insert tag.
|
||||
this.tagInput.parent().before(tag);
|
||||
|
||||
this._trigger('afterTagAdded', null, {
|
||||
tag: tag,
|
||||
tagLabel: this.tagLabel(tag),
|
||||
duringInitialization: duringInitialization
|
||||
});
|
||||
|
||||
if (this.options.showAutocompleteOnFocus && !duringInitialization) {
|
||||
setTimeout(function () { that._showAutocomplete(); }, 0);
|
||||
}
|
||||
},
|
||||
|
||||
removeTag: function(tag, animate) {
|
||||
animate = typeof animate === 'undefined' ? this.options.animate : animate;
|
||||
|
||||
tag = $(tag);
|
||||
|
||||
// DEPRECATED.
|
||||
this._trigger('onTagRemoved', null, tag);
|
||||
|
||||
if (this._trigger('beforeTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)}) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.singleField) {
|
||||
var tags = this.assignedTags();
|
||||
var removedTagLabel = this.tagLabel(tag);
|
||||
tags = $.grep(tags, function(el){
|
||||
return el != removedTagLabel;
|
||||
});
|
||||
this._updateSingleTagsField(tags);
|
||||
}
|
||||
|
||||
if (animate) {
|
||||
tag.addClass('removed'); // Excludes this tag from _tags.
|
||||
var hide_args = this._effectExists('blind') ? ['blind', {direction: 'horizontal'}, 'fast'] : ['fast'];
|
||||
|
||||
var thisTag = this;
|
||||
hide_args.push(function() {
|
||||
tag.remove();
|
||||
thisTag._trigger('afterTagRemoved', null, {tag: tag, tagLabel: thisTag.tagLabel(tag)});
|
||||
});
|
||||
|
||||
tag.fadeOut('fast').hide.apply(tag, hide_args).dequeue();
|
||||
} else {
|
||||
tag.remove();
|
||||
this._trigger('afterTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
removeTagByLabel: function(tagLabel, animate) {
|
||||
var toRemove = this._findTagByLabel(tagLabel);
|
||||
if (!toRemove) {
|
||||
throw "No such tag exists with the name '" + tagLabel + "'";
|
||||
}
|
||||
this.removeTag(toRemove, animate);
|
||||
},
|
||||
|
||||
removeAll: function() {
|
||||
// Removes all tags.
|
||||
var that = this;
|
||||
this._tags().each(function(index, tag) {
|
||||
that.removeTag(tag, false);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
65
wagtail/wagtailadmin/taggable.py
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
from taggit.models import Tag
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db.models import Count, Q
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
from verdantsearch import Indexed, Search
|
||||
|
||||
|
||||
class TagSearchable(Indexed):
|
||||
"""
|
||||
Mixin to provide a 'search' method, searching on the 'title' field and tags,
|
||||
for models that provide those things.
|
||||
"""
|
||||
|
||||
indexed_fields = {
|
||||
'title': {
|
||||
'type': 'string',
|
||||
'analyzer': 'edgengram_analyzer',
|
||||
'boost': 10,
|
||||
},
|
||||
'get_tags': {
|
||||
'type': 'string',
|
||||
'analyzer': 'edgengram_analyzer',
|
||||
'boost': 10,
|
||||
},
|
||||
}
|
||||
|
||||
@property
|
||||
def get_tags(self):
|
||||
return ' '.join([tag.name for tag in self.tags.all()])
|
||||
|
||||
@classmethod
|
||||
def search(cls, q, results_per_page=None, page=1, prefetch_tags=False, filters={}):
|
||||
# Run search query
|
||||
if prefetch_tags:
|
||||
results = Search().search(q, cls, prefetch_related=['tagged_items__tag'], filters=filters)
|
||||
else:
|
||||
results = Search().search(q, cls, filters=filters)
|
||||
|
||||
# If results_per_page is set, return a paginator
|
||||
if results_per_page is not None:
|
||||
paginator = Paginator(results, results_per_page)
|
||||
try:
|
||||
return paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
return paginator.page(1)
|
||||
except EmptyPage:
|
||||
return paginator.page(paginator.num_pages)
|
||||
else:
|
||||
return results
|
||||
|
||||
def prefetched_tags(self):
|
||||
# a hack to do the equivalent of self.tags.all() but take advantage of the
|
||||
# prefetch_related('tagged_items__tag') in the above search method, so that we can
|
||||
# output the list of tags on each result without doing a further query
|
||||
return [tagged_item.tag for tagged_item in self.tagged_items.all()]
|
||||
|
||||
|
||||
@classmethod
|
||||
def popular_tags(cls):
|
||||
content_type = ContentType.objects.get_for_model(cls)
|
||||
return Tag.objects.filter(
|
||||
taggit_taggeditem_items__content_type=content_type
|
||||
).annotate(
|
||||
item_count=Count('taggit_taggeditem_items')
|
||||
).order_by('-item_count')[:10]
|
||||
68
wagtail/wagtailadmin/tasks.py
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
from django.template.loader import render_to_string
|
||||
from django.core.mail import send_mail
|
||||
from django.conf import settings
|
||||
from celery.decorators import task
|
||||
from wagtail.wagtailcore.models import PageRevision
|
||||
|
||||
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db.models import Q
|
||||
|
||||
def users_with_permission(permission, include_superusers=True):
|
||||
# Get user model
|
||||
User = get_user_model()
|
||||
|
||||
# Get users with this permission
|
||||
permission_app, permission_codename = permission.split('.')
|
||||
perm = Permission.objects.get(content_type__app_label=permission_app, codename=permission_codename)
|
||||
q = Q(groups__permissions=perm) | Q(user_permissions=perm)
|
||||
|
||||
# Include superusers
|
||||
if include_superusers:
|
||||
q |= Q(is_superuser=True)
|
||||
|
||||
return User.objects.filter(q).distinct()
|
||||
|
||||
|
||||
@task()
|
||||
def send_notification(page_revision_id, notification, excluded_user_id):
|
||||
# Get revision
|
||||
revision = PageRevision.objects.get(id=page_revision_id)
|
||||
|
||||
# Get list of recipients
|
||||
if notification == 'submitted':
|
||||
# Get list of publishers
|
||||
recipients = users_with_permission('wagtailcore.publish_page')
|
||||
elif notification == 'approved' or notification == 'rejected':
|
||||
# Get submitter
|
||||
recipients = [revision.user]
|
||||
else:
|
||||
return
|
||||
|
||||
# Get list of email addresses
|
||||
email_addresses = [
|
||||
recipient.email for recipient in recipients
|
||||
if recipient.email and recipient.id != excluded_user_id
|
||||
]
|
||||
|
||||
# Return if there are no email addresses
|
||||
if not email_addresses:
|
||||
return
|
||||
|
||||
# Get email subject and content
|
||||
template = 'wagtailadmin/notifications/' + notification + '.html'
|
||||
rendered_template = render_to_string(template, dict(revision=revision, settings=settings)).split('\n')
|
||||
email_subject = rendered_template[0]
|
||||
email_content = '\n'.join(rendered_template[1:])
|
||||
|
||||
# Get from email
|
||||
if hasattr(settings, 'VERDANTADMIN_NOTIFICATION_FROM_EMAIL'):
|
||||
from_email = settings.VERDANTADMIN_NOTIFICATION_FROM_EMAIL
|
||||
elif hasattr(settings, 'DEFAULT_FROM_EMAIL'):
|
||||
from_email = settings.DEFAULT_FROM_EMAIL
|
||||
else:
|
||||
from_email = 'webmaster@localhost'
|
||||
|
||||
# Send email
|
||||
send_mail(email_subject, email_content, from_email, email_addresses)
|
||||
35
wagtail/wagtailadmin/templates/wagtailadmin/base.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{% extends "wagtailadmin/skeleton.html" %}
|
||||
{% load wagtailadmin_nav %}
|
||||
|
||||
{% block furniture %}
|
||||
<div id="nav-toggle" data-afteropen="Collapse" class="icon icon-verdant text-replace">Menu</div>
|
||||
<div class="nav-wrapper">
|
||||
<div class="inner">
|
||||
<a href="{% url 'wagtailadmin_home' %}" class="logo"><em>V</em><span>erdant</span></a>
|
||||
{% main_nav %}
|
||||
</div>
|
||||
|
||||
<nav class="explorer">
|
||||
<ul class="dl-menu">
|
||||
{% explorer_nav %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="content">
|
||||
{# Always show messages div so it can be appended to by JS #}
|
||||
<div class="messages">
|
||||
{% if messages %}
|
||||
<ul>
|
||||
{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|safe }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
{% if allow_external_link or allow_email_link or current == 'external' or current == 'email' %}
|
||||
<p class="link-types">
|
||||
{% if current == 'internal' %}
|
||||
<b>Internal link</b>
|
||||
{% else %}
|
||||
<a href="{% url 'wagtailadmin_choose_page' %}?{{ querystring }}">Internal link</a>
|
||||
{% endif %}
|
||||
|
||||
{% if current == 'external' %}
|
||||
| <b>External link</b>
|
||||
{% elif allow_external_link %}
|
||||
| <a href="{% url 'wagtailadmin_choose_page_external_link' %}?{{ querystring }}">External link</a>
|
||||
{% endif %}
|
||||
|
||||
{% if current == 'email' %}
|
||||
| <b>Email link</b>
|
||||
{% elif allow_email_link %}
|
||||
| <a href="{% url 'wagtailadmin_choose_page_email_link' %}?{{ querystring }}">Email link</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
modal.ajaxifyForm($('form.search-bar', modal.body));
|
||||
|
||||
var searchUrl = $('form.search-bar', modal.body).attr('action');
|
||||
function search() {
|
||||
$.ajax({
|
||||
url: searchUrl,
|
||||
data: {q: $('#id_q', modal.body).val(), 'results_only': true},
|
||||
success: function(data, status) {
|
||||
$('.page-results', modal.body).html(data);
|
||||
ajaxifySearchResults();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$('#id_q', modal.body).on('input', function() {
|
||||
clearTimeout($.data(this, 'timer'));
|
||||
var wait = setTimeout(search, 200);
|
||||
$(this).data('timer', wait);
|
||||
});
|
||||
|
||||
function ajaxifySearchResults() {
|
||||
$('.page-results a.choose-page', modal.body).click(function() {
|
||||
var pageData = $(this).data();
|
||||
modal.respond('pageChosen', $(this).data());
|
||||
modal.close();
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$('#id_q', modal.body).focus();
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<form class="search-bar full-width" action="{% url 'wagtailadmin_choose_page' %}?{{ querystring }}" method="get">
|
||||
<ul class="fields">
|
||||
{% for field in search_form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
{% endfor %}
|
||||
<li class="submit"><input type="submit" value="Search" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{% if not is_searching %}
|
||||
<h2>Explorer</h2>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{% url 'wagtailadmin_explore_root' %}?{{ querystring }}" class="icon icon-home text-replace navigate-pages">Home</a></li>
|
||||
{% for page in parent_page.get_ancestors %}
|
||||
<li><a href="{% url 'wagtailadmin_choose_page_child' page.id %}?{{ querystring }}" class="navigate-pages" >{{ page.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% else %}
|
||||
<h2>{{ pages.count }} search match{{ pages.count|pluralize:"es" }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{% if is_searching %}
|
||||
{% include "wagtailadmin/pages/list.html" with choosing=1 show_parent=1 pages=pages parent_page=parent_page %}
|
||||
{% else %}
|
||||
{% include "wagtailadmin/pages/list.html" with choosing=1 allow_navigation=1 orderable=0 pages=pages parent_page=parent_page %}
|
||||
{% endif %}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<header>
|
||||
<h1>Choose a page</h1>
|
||||
</header>
|
||||
{% include 'wagtailadmin/chooser/_search_form.html' %}
|
||||
|
||||
<div class="nice-padding">
|
||||
{% include 'wagtailadmin/chooser/_link_types.html' with current='internal' %}
|
||||
|
||||
<div class="page-results">
|
||||
{# content in here will be replaced by live search results #}
|
||||
|
||||
{% include 'wagtailadmin/chooser/_search_results.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function(modal) {
|
||||
$('a.navigate-pages, .link-types a', modal.body).click(function() {
|
||||
modal.loadUrl(this.href);
|
||||
return false;
|
||||
});
|
||||
|
||||
{% include 'wagtailadmin/chooser/_search_behaviour.js' %}
|
||||
|
||||
$('a.choose-page', modal.body).click(function() {
|
||||
var pageData = $(this).data();
|
||||
pageData.parentId = {{ parent_page.id }};
|
||||
modal.respond('pageChosen', $(this).data());
|
||||
modal.close();
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<header>
|
||||
<h1>Add an email link</h1>
|
||||
</header>
|
||||
|
||||
<div class="nice-padding">
|
||||
{% include 'wagtailadmin/chooser/_link_types.html' with current='email' %}
|
||||
|
||||
<form action="{% url 'wagtailadmin_choose_page_email_link' %}?{{ querystring }}" method="post">
|
||||
{% csrf_token %}
|
||||
<ul class="fields">
|
||||
{% for field in form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" %}
|
||||
{% endfor %}
|
||||
<li><input type="submit" value="Insert link" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
function(modal) {
|
||||
$('p.link-types a', modal.body).click(function() {
|
||||
modal.loadUrl(this.href);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('form', modal.body).submit(function() {
|
||||
modal.postForm(this.action, $(this).serialize());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<header>
|
||||
<h1>Add an external link</h1>
|
||||
</header>
|
||||
|
||||
<div class="nice-padding">
|
||||
{% include 'wagtailadmin/chooser/_link_types.html' with current='external' %}
|
||||
|
||||
<form action="{% url 'wagtailadmin_choose_page_external_link' %}?{{ querystring }}" method="post">
|
||||
{% csrf_token %}
|
||||
<ul class="fields">
|
||||
{% for field in form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" %}
|
||||
{% endfor %}
|
||||
<li><input type="submit" value="Insert link" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
function(modal) {
|
||||
$('p.link-types a', modal.body).click(function() {
|
||||
modal.loadUrl(this.href);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('form', modal.body).submit(function() {
|
||||
modal.postForm(this.action, $(this).serialize());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
function(modal) {
|
||||
modal.respond('pageChosen', {
|
||||
'url': '{{ url|escapejs }}',
|
||||
'title': '{{ link_text|escapejs }}'
|
||||
});
|
||||
modal.close();
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<header>
|
||||
<h1>Choose a page</h1>
|
||||
</header>
|
||||
|
||||
<div class="nice-padding">
|
||||
{% include 'wagtailadmin/chooser/_link_types.html' with current='internal' %}
|
||||
|
||||
{% include 'wagtailadmin/chooser/_search_form.html' %}
|
||||
|
||||
<div class="page-results">{# content in here will be replaced by live search results #}
|
||||
{% include 'wagtailadmin/chooser/_search_results.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function(modal) {
|
||||
$('.link-types a', modal.body).click(function() {
|
||||
modal.loadUrl(this.href);
|
||||
return false;
|
||||
});
|
||||
|
||||
{% include 'wagtailadmin/chooser/_search_behaviour.js' %}
|
||||
ajaxifySearchResults();
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{% extends "wagtailadmin/edit_handlers/field_panel_field.html" %}
|
||||
|
||||
{% comment %}
|
||||
Either the chosen or unchosen div will be shown, depending on the presence
|
||||
of the 'blank' class on the container.
|
||||
|
||||
Any element with the 'action-choose' class will open the page chooser modal
|
||||
when clicked.
|
||||
{% endcomment %}
|
||||
|
||||
{% block form_field %}
|
||||
|
||||
<div id="{{ field.id_for_label }}-chooser" class="chooser {% block chooser_class %}page-chooser{% endblock %} {% if not is_chosen %}blank{% endif %}">
|
||||
|
||||
<div class="chosen">
|
||||
{% block chosen_state_view %}{% endblock %}
|
||||
|
||||
{% if not field.field.required %}
|
||||
<input type="button" class="button-secondary action-clear" value="{% block clear_button_label %}Clear choice{% endblock %}">
|
||||
{% endif %}
|
||||
<input type="button" class="button-secondary action-choose" value="{% block choose_another_button_label %}Choose another item{% endblock %}">
|
||||
</div>
|
||||
|
||||
<div class="unchosen">
|
||||
<input type="button" class="action-choose" value="{% block choose_button_label %}Choose an item{% endblock %}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ field }}
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<div class="field">
|
||||
{% if field_type != "boolean_field" %}{{ field.label_tag }}{% endif %}
|
||||
{% block form_field %}
|
||||
{{ field }}
|
||||
{% endblock %}
|
||||
{% if field_type = "boolean_field" %}{{ field.label_tag }}{% endif %}
|
||||
</div>
|
||||
|
||||
{% if field.errors %}
|
||||
<p class="error-message">
|
||||
{% for error in field.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if field.help_text %}
|
||||
<p class="help">{{ field.help_text }}</p>
|
||||
{% endif %}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<fieldset>
|
||||
<legend>{{ self.heading }}</legend>
|
||||
<ul class="fields">
|
||||
<li class="{{ self.field_classnames }}">{{ field_content }}</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{{ self.formset.management_form }}
|
||||
<ul class="multiple" id="id_{{ self.formset.prefix }}-FORMS">
|
||||
{% for child in self.children %}
|
||||
{% include "wagtailadmin/edit_handlers/inline_panel_child.html" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<script type="text/django-form-template" id="id_{{ self.formset.prefix }}-EMPTY_FORM_TEMPLATE">
|
||||
{% include "wagtailadmin/edit_handlers/inline_panel_child.html" with child=self.empty_child %}
|
||||
</script>
|
||||
|
||||
<p class="add">
|
||||
<a class="icon icon-plus-inverse" id="id_{{ self.formset.prefix }}-ADD" value="Add">Add {{ self.heading|lower }}</a>
|
||||
</p>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
(function() {
|
||||
var panel = InlinePanel({
|
||||
formsetPrefix: fixPrefix("id_{{ self.formset.prefix }}"),
|
||||
emptyChildFormPrefix: fixPrefix("{{ self.empty_child.form.prefix }}"),
|
||||
canOrder: {% if can_order %}true{% else %}false{% endif %},
|
||||
|
||||
onAdd: function(fixPrefix) {
|
||||
{{ self.empty_child.render_js }}
|
||||
}
|
||||
});
|
||||
|
||||
{% for child in self.children %}
|
||||
{{ child.render_js }}
|
||||
panel.initChildControls(fixPrefix("{{ child.form.prefix }}"));
|
||||
{% endfor %}
|
||||
panel.updateMoveButtonDisabledStates();
|
||||
})();
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<li id="inline_child_{{ child.form.prefix }}">
|
||||
<ul class="controls">
|
||||
{% if can_order %}
|
||||
<li class="icon text-replace teal icon-arrow-up-big inline-child-move-up" id="{{ child.form.prefix }}-move-up">Move up</li>
|
||||
<li class="icon text-replace teal icon-arrow-down-big inline-child-move-down" id="{{ child.form.prefix }}-move-down">Move down</li>
|
||||
{% endif %}
|
||||
<li class="icon text-replace teal icon-cross" id="{{ child.form.DELETE.id_for_label }}-button">Delete</li>
|
||||
</ul>
|
||||
{{ child.render_form_content }}
|
||||
</li>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<fieldset>
|
||||
<legend>{{ self.heading }}</legend>
|
||||
<ul class="fields">
|
||||
{% for child in self.children %}
|
||||
<li {% if child.field_classnames %}class="{{ child.field_classnames }}"{% endif %}>
|
||||
{{ child.render_as_field }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<ul class="objects">
|
||||
{% for child in self.children %}
|
||||
<li class="object {{ child.object_classnames }}">
|
||||
{% if child.heading %}
|
||||
<h2>{{ child.heading }}</h2>
|
||||
{% endif %}
|
||||
{% if child.help_text %}
|
||||
<div class="object-help help">{{ child.help_text }}</div>
|
||||
{% endif %}
|
||||
{{ child.render_as_object }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{% extends "wagtailadmin/edit_handlers/chooser_panel.html" %}
|
||||
|
||||
{% comment %}
|
||||
TODO: make it possible to specify button labels that are better tuned to the
|
||||
particular use case: e.g. "Choose an author", "Choose a location"
|
||||
{% endcomment %}
|
||||
|
||||
{% block chosen_state_view %}
|
||||
<span class="title">{{ page.title }}</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block choose_another_button_label %}Choose another page{% endblock %}
|
||||
{% block choose_button_label %}Choose a page{% endblock %}
|
||||