diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..2ee7383 --- /dev/null +++ b/README.txt @@ -0,0 +1,58 @@ +GETTING SET UP FOR THE FIRST TIME +--------------------------------- + +1. Bootstrap your environment. This only needs to be done once: + + ./setup/_bootstrap.sh + + +2. Create a virtual environment (it doesn't need to be named EffervescentCollective, + but name it something you'll remember): + + mkvirtualenv EffervescentCollective + + +3. Install the "pip" Python package manager in the new virtual environment: + + easy_install pip + + +4. Upgrade to the latest version of the packages: + + ./bin/upgrade.sh + +5. Link the source directory into the project folder for easier access + + ln -s ~/.virtualenvs/EffervescentCollective/src/ externals + + +WHAT YOU SHOULD DO PERIODICALLY +------------------------------- + +1. Switch to the correct virtual environment: + + workon EffervescentCollective + + +2. Upgrade to the latest version of the packages: + + ./bin/upgrade.sh + + + +WHAT YOU SHOULD DO EVERY DAY +---------------------------- + +1. Upgrade to the latest code: + + git pull + + +2. Switch to the correct virtual environment: + + workon EffervescentCollective + + +3. Start your local development server: + + python manage.py runserver 0.0.0.0:8000 \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ + diff --git a/__init__.pyc b/__init__.pyc new file mode 100644 index 0000000..3cf5559 Binary files /dev/null and b/__init__.pyc differ diff --git a/apps/api/__init__.py b/apps/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/api/__init__.pyc b/apps/api/__init__.pyc new file mode 100644 index 0000000..3734685 Binary files /dev/null and b/apps/api/__init__.pyc differ diff --git a/apps/api/handlers.py b/apps/api/handlers.py new file mode 100644 index 0000000..5c92e16 --- /dev/null +++ b/apps/api/handlers.py @@ -0,0 +1,31 @@ +from piston.handler import BaseHandler +from tagging.models import Tag, TaggedItem +from django.db.models import get_model +from django.core.urlresolvers import reverse +from pprint import pprint + +class TagHandler(BaseHandler): + allowed_methods = ('GET',) + model = Tag + + def read(self, request): + if 'referer' in request.GET: + bits = filter(None, request.GET['referer'].replace('/admin/','').split('/')) + model = get_model(*bits[:2]) + + if len(bits) == 2: + r = [] + for x in Tag.objects.cloud_for_model(model): + r.append({'size':x.font_size,'name':x.name}) + return r + elif len(bits) == 3: + if bits[2] == 'add': + return [] + obj = model.objects.get(pk=bits[2]) + tags = Tag.objects.get_for_object(obj) + if 'tags' in request.GET: + obj.tags = request.GET['tags'] + else: + return tags + + diff --git a/apps/api/handlers.pyc b/apps/api/handlers.pyc new file mode 100644 index 0000000..34d1b07 Binary files /dev/null and b/apps/api/handlers.pyc differ diff --git a/apps/api/urls.py b/apps/api/urls.py new file mode 100644 index 0000000..ee08852 --- /dev/null +++ b/apps/api/urls.py @@ -0,0 +1,9 @@ +from django.conf.urls.defaults import * +from piston.resource import Resource +from handlers import TagHandler + +tag_handler = Resource(TagHandler) + +urlpatterns = patterns('', + url(r'^tags/?$', tag_handler), +) \ No newline at end of file diff --git a/apps/api/urls.pyc b/apps/api/urls.pyc new file mode 100644 index 0000000..b804d4f Binary files /dev/null and b/apps/api/urls.pyc differ diff --git a/apps/django_ext/__init__.py b/apps/django_ext/__init__.py new file mode 100644 index 0000000..69472ea --- /dev/null +++ b/apps/django_ext/__init__.py @@ -0,0 +1,3 @@ +from django.template import add_to_builtins + +add_to_builtins('django_ext.templatetags.smart_if') \ No newline at end of file diff --git a/apps/django_ext/__init__.pyc b/apps/django_ext/__init__.pyc new file mode 100644 index 0000000..55b63fe Binary files /dev/null and b/apps/django_ext/__init__.pyc differ diff --git a/apps/django_ext/admin.py b/apps/django_ext/admin.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/django_ext/admin.pyc b/apps/django_ext/admin.pyc new file mode 100644 index 0000000..18f2427 Binary files /dev/null and b/apps/django_ext/admin.pyc differ diff --git a/apps/django_ext/cache.py b/apps/django_ext/cache.py new file mode 100644 index 0000000..37de085 --- /dev/null +++ b/apps/django_ext/cache.py @@ -0,0 +1,25 @@ +from django.core.cache import cache +from django.utils.encoding import smart_str +import inspect + +# Check if the cache backend supports min_compress_len. If so, add it. +if cache._cache: + if 'min_compress_len' in inspect.getargspec(cache._cache.add)[0] and \ + 'min_compress_len' in inspect.getargspec(cache._cache.set)[0]: + class CacheClass(cache.__class__): + def add(self, key, value, timeout=None, min_compress_len=150000): + if isinstance(value, unicode): + value = value.encode('utf-8') + # Allow infinite timeouts + if timeout is None: + timeout = self.default_timeout + return self._cache.add(smart_str(key), value, timeout, min_compress_len) + + def set(self, key, value, timeout=None, min_compress_len=150000): + if isinstance(value, unicode): + value = value.encode('utf-8') + if timeout is None: + timeout = self.default_timeout + self._cache.set(smart_str(key), value, timeout, min_compress_len) + + cache.__class__ = CacheClass \ No newline at end of file diff --git a/apps/django_ext/fields.py b/apps/django_ext/fields.py new file mode 100644 index 0000000..f8acab5 --- /dev/null +++ b/apps/django_ext/fields.py @@ -0,0 +1,133 @@ +import functools +from django.db.models.fields.related import ManyToManyField, ReverseManyRelatedObjectsDescriptor, ManyRelatedObjectsDescriptor +from django.db.models.query import QuerySet +from django.db.models import signals +from django_ext.cache import cache +from types import MethodType + +CACHE_DURATION = 60 * 30 + +def invalidate_cache(obj, field): + cache.set(obj._get_cache_key(field=field), None, 5) + +def fix_where(where, modified=False): + def wrap_add(f): + @functools.wraps(f) + def add(self, *args, **kwargs): + """ + Wraps django.db.models.sql.where.add to indicate that a new + 'where' condition has been added. + """ + self.modified = True + return f(*args, **kwargs) + return add + where.modified = modified + where.add = MethodType(wrap_add(where.add), where, where.__class__) + return where + + +def get_pk_list_query_set(superclass): + class PKListQuerySet(superclass): + """ + QuerySet that, when unfiltered, fetches objects individually from + the datastore by pk. + + The `pk_list` attribute is a list of primary keys for objects that + should be fetched. + + """ + def __init__(self, pk_list=[], from_cache=False, *args, **kwargs): + super(PKListQuerySet, self).__init__(*args, **kwargs) + self.pk_list = pk_list + self.from_cache = from_cache + self.query.where = fix_where(self.query.where) + + def iterator(self): + if not self.query.where.modified: + for pk in self.pk_list: + yield self.model._default_manager.get(pk=pk) + else: + superiter = super(PKListQuerySet, self).iterator() + while True: + yield superiter.next() + + def _clone(self, *args, **kwargs): + c = super(PKListQuerySet, self)._clone(*args, **kwargs) + c.query.where = fix_where(c.query.where, modified=self.query.where.modified) + c.pk_list = self.pk_list + c.from_cache = self.from_cache + return c + return PKListQuerySet + + +def get_caching_related_manager(superclass, instance, field_name, related_name): + class CachingRelatedManager(superclass): + def all(self): + key = instance._get_cache_key(field=field_name) + qs = super(CachingRelatedManager, self).get_query_set() + PKListQuerySet = get_pk_list_query_set(qs.__class__) + qs = qs._clone(klass=PKListQuerySet) + pk_list = cache.get(key) + if pk_list is None: + pk_list = qs.values_list('pk', flat=True) + cache.add(key, pk_list, CACHE_DURATION) + else: + qs.from_cache = True + qs.pk_list = pk_list + return qs + + def add(self, *objs): + super(CachingRelatedManager, self).add(*objs) + for obj in objs: + invalidate_cache(obj, related_name) + invalidate_cache(instance, field_name) + + def remove(self, *objs): + super(CachingRelatedManager, self).remove(*objs) + for obj in objs: + invalidate_cache(obj, related_name) + invalidate_cache(instance, field_name) + + def clear(self): + objs = list(self.all()) + super(CachingRelatedManager, self).clear() + for obj in objs: + invalidate_cache(obj, related_name) + invalidate_cache(instance, field_name) + return CachingRelatedManager + + +class CachingReverseManyRelatedObjectsDescriptor(ReverseManyRelatedObjectsDescriptor): + def __get__(self, instance, cls=None): + manager = super(CachingReverseManyRelatedObjectsDescriptor, self).__get__(instance, cls) + + CachingRelatedManager = get_caching_related_manager(manager.__class__, + instance, + self.field.name, + self.field.rel.related_name) + + manager.__class__ = CachingRelatedManager + return manager + + +class CachingManyRelatedObjectsDescriptor(ManyRelatedObjectsDescriptor): + def __get__(self, instance, cls=None): + manager = super(CachingManyRelatedObjectsDescriptor, self).__get__(instance, cls) + + CachingRelatedManager = get_caching_related_manager(manager.__class__, + instance, + self.related.get_accessor_name(), + self.related.field.name) + + manager.__class__ = CachingRelatedManager + return manager + + +class CachingManyToManyField(ManyToManyField): + def contribute_to_class(self, cls, name): + super(CachingManyToManyField, self).contribute_to_class(cls, name) + setattr(cls, self.name, CachingReverseManyRelatedObjectsDescriptor(self)) + + def contribute_to_related_class(self, cls, related): + super(CachingManyToManyField, self).contribute_to_related_class(cls, related) + setattr(cls, related.get_accessor_name(), CachingManyRelatedObjectsDescriptor(related)) \ No newline at end of file diff --git a/apps/django_ext/management/__init__.py b/apps/django_ext/management/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/django_ext/management/__init__.py @@ -0,0 +1 @@ + diff --git a/apps/django_ext/management/__init__.pyc b/apps/django_ext/management/__init__.pyc new file mode 100644 index 0000000..f178ebc Binary files /dev/null and b/apps/django_ext/management/__init__.pyc differ diff --git a/apps/django_ext/management/commands/__init__.py b/apps/django_ext/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/django_ext/management/commands/delete_contenttypes.py b/apps/django_ext/management/commands/delete_contenttypes.py new file mode 100644 index 0000000..4676938 --- /dev/null +++ b/apps/django_ext/management/commands/delete_contenttypes.py @@ -0,0 +1,20 @@ +from django.core.management.base import NoArgsCommand +from django.db import transaction + +class Command(NoArgsCommand): + help = "Delete contenttypes crapola" + + def handle_noargs(self, **options): + from django.db import connection + print "Deleting content types and permissions" + transaction.commit_unless_managed() + transaction.enter_transaction_management() + transaction.managed(True) + cursor = connection.cursor() + cursor.execute("DELETE FROM django_content_type", []) + print cursor.fetchall() + cursor.execute("DELETE FROM auth_permission", []) + print cursor.fetchall() + transaction.commit() + transaction.leave_transaction_management() + print "Contenttypes deleted" \ No newline at end of file diff --git a/apps/django_ext/management/commands/flush_all_memcached.py b/apps/django_ext/management/commands/flush_all_memcached.py new file mode 100644 index 0000000..4fd3568 --- /dev/null +++ b/apps/django_ext/management/commands/flush_all_memcached.py @@ -0,0 +1,17 @@ +from django.core.management.base import NoArgsCommand +from django.db import transaction +from django.conf import settings + +class Command(NoArgsCommand): + help = "Flushes memcached" + + def handle_noargs(self, **options): + try: + import memcache + except ImportError: + return + if 'memcached' in settings.CACHE_BACKEND: + servers = settings.CACHE_BACKEND.replace('memcached://', + '').replace('/','').split(';') + mc = memcache.Client(servers, debug=0) + mc.flush_all() \ No newline at end of file diff --git a/apps/django_ext/managers.py b/apps/django_ext/managers.py new file mode 100644 index 0000000..5a8ffdb --- /dev/null +++ b/apps/django_ext/managers.py @@ -0,0 +1,87 @@ +from django.db import models +from django.db.models import signals +from django_ext.cache import cache +from django.db.models.query import QuerySet + +CACHE_DURATION = 60 * 30 + +def _cache_key(model, pk, field=None): + if field: + return "%s:%s.%s:%s" % (field, model._meta.app_label, model._meta.module_name, pk) + else: + return "%s.%s:%s" % (model._meta.app_label, model._meta.module_name, pk) + +def _get_cache_key(self, field=None): + return self._cache_key(self.pk, field) + + +class CachingManager(models.Manager): + def __init__(self, use_for_related_fields=True, *args, **kwargs): + self.use_for_related_fields = use_for_related_fields + super(CachingManager, self).__init__(*args, **kwargs) + + def get_query_set(self): + return CachingQuerySet(self.model) + + def contribute_to_class(self, model, name): + signals.post_save.connect(self._post_save, sender=model) + signals.post_delete.connect(self._post_delete, sender=model) + setattr(model, '_cache_key', classmethod(_cache_key)) + setattr(model, '_get_cache_key', _get_cache_key) + setattr(model, 'cache_key', property(_get_cache_key)) + return super(CachingManager, self).contribute_to_class(model, name) + + def _invalidate_cache(self, instance): + """ + Explicitly set a None value instead of just deleting so we don't have any race + conditions where: + Thread 1 -> Cache miss, get object from DB + Thread 2 -> Object saved, deleted from cache + Thread 1 -> Store (stale) object fetched from DB in cache + Five second should be more than enough time to prevent this from happening for + a web app. + """ + cache.set(instance.cache_key, None, 5) + + def _post_save(self, instance, **kwargs): + self._invalidate_cache(instance) + + def _post_delete(self, instance, **kwargs): + self._invalidate_cache(instance) + + +class CachingQuerySet(QuerySet): + def iterator(self): + superiter = super(CachingQuerySet, self).iterator() + while True: + obj = superiter.next() + # Use cache.add instead of cache.set to prevent race conditions (see CachingManager) + cache.add(obj.cache_key, obj, CACHE_DURATION) + yield obj + + def get(self, *args, **kwargs): + """ + Checks the cache to see if there's a cached entry for this pk. If not, fetches + using super then stores the result in cache. + + Most of the logic here was gathered from a careful reading of + ``django.db.models.sql.query.add_filter`` + """ + if self.query.where: + # If there is any other ``where`` filter on this QuerySet just call + # super. There will be a where clause if this QuerySet has already + # been filtered/cloned. + return super(CachingQuerySet, self).get(*args, **kwargs) + + # Punt on anything more complicated than get by pk/id only... + if len(kwargs) == 1: + k = kwargs.keys()[0] + if k in ('pk', 'pk__exact', '%s' % self.model._meta.pk.attname, + '%s__exact' % self.model._meta.pk.attname): + obj = cache.get(self.model._cache_key(pk=kwargs.values()[0])) + if obj is not None: + obj.from_cache = True + return obj + + # Calls self.iterator to fetch objects, storing object in cache. + return super(CachingQuerySet, self).get(*args, **kwargs) \ No newline at end of file diff --git a/apps/django_ext/middleware.py b/apps/django_ext/middleware.py new file mode 100644 index 0000000..7fa06e8 --- /dev/null +++ b/apps/django_ext/middleware.py @@ -0,0 +1,48 @@ +from django.db import connection +from django.conf import settings +import os + +def terminal_width(): + """ + Function to compute the terminal width. + WARNING: This is not my code, but I've been using it forever and + I don't remember where it came from. + """ + width = 0 + try: + import struct, fcntl, termios + s = struct.pack('HHHH', 0, 0, 0, 0) + x = fcntl.ioctl(1, termios.TIOCGWINSZ, s) + width = struct.unpack('HHHH', x)[1] + except: + pass + if width <= 0: + try: + width = int(os.environ['COLUMNS']) + except: + pass + if width <= 0: + width = 80 + return width + +class SqlPrintingMiddleware(object): + """ + Middleware which prints out a list of all SQL queries done + for each view that is processed. This is only useful for debugging. + """ + def process_response(self, request, response): + indentation = 2 + if len(connection.queries) > 0 and settings.DEBUG: + width = terminal_width() + total_time = 0.0 + for query in connection.queries: + nice_sql = query['sql'].replace('"', '').replace(',',', ') + sql = "\033[1;31m[%s]\033[0m %s" % (query['time'], nice_sql) + total_time = total_time + float(query['time']) + while len(sql) > width-indentation: + print "%s%s" % (" "*indentation, sql[:width-indentation]) + sql = sql[width-indentation:] + print "%s%s\n" % (" "*indentation, sql) + replace_tuple = (" "*indentation, str(total_time)) + print "%s\033[1;32m[TOTAL TIME: %s seconds]\033[0m" % replace_tuple + return response \ No newline at end of file diff --git a/apps/django_ext/models.py b/apps/django_ext/models.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/django_ext/models.py @@ -0,0 +1 @@ + diff --git a/apps/django_ext/models.pyc b/apps/django_ext/models.pyc new file mode 100644 index 0000000..8343d04 Binary files /dev/null and b/apps/django_ext/models.pyc differ diff --git a/apps/django_ext/templatetags/__init__.py b/apps/django_ext/templatetags/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/django_ext/templatetags/__init__.py @@ -0,0 +1 @@ + diff --git a/apps/django_ext/templatetags/__init__.pyc b/apps/django_ext/templatetags/__init__.pyc new file mode 100644 index 0000000..e286a51 Binary files /dev/null and b/apps/django_ext/templatetags/__init__.pyc differ diff --git a/apps/django_ext/templatetags/fb.py b/apps/django_ext/templatetags/fb.py new file mode 100644 index 0000000..1f4286d --- /dev/null +++ b/apps/django_ext/templatetags/fb.py @@ -0,0 +1,98 @@ +from django import template +from django.conf import settings + +from django.utils.encoding import smart_str + +register = template.Library() + +class URLNode(template.Node): + def __init__(self, view_name, args, kwargs, asvar): + self.view_name = view_name + self.args = args + self.kwargs = kwargs + self.asvar = asvar + + def render(self, context): + from django.core.urlresolvers import reverse, NoReverseMatch + args = [arg.resolve(context) for arg in self.args] + kwargs = dict([(smart_str(k,'ascii'), v.resolve(context)) + for k, v in self.kwargs.items()]) + + # Try to look up the URL twice: once given the view name, and again + # relative to what we guess is the "main" app. If they both fail, + # re-raise the NoReverseMatch unless we're using the + # {% url ... as var %} construct in which cause return nothing. + url = '' + try: + url = reverse(self.view_name, args=args, kwargs=kwargs) + except NoReverseMatch: + project_name = settings.SETTINGS_MODULE.split('.')[0] + try: + url = reverse(project_name + '.' + self.view_name, + args=args, kwargs=kwargs) + except NoReverseMatch: + if self.asvar is None: + raise + + if self.asvar: + context[self.asvar] = settings.URL_PREFIX + url + return '' + else: + return settings.URL_PREFIX + url + +def fburl(parser, token): + """ + Returns an absolute URL matching given view with its parameters. + + This is a way to define links that aren't tied to a particular URL + configuration:: + + {% url path.to.some_view arg1,arg2,name1=value1 %} + + The first argument is a path to a view. It can be an absolute python path + or just ``app_name.view_name`` without the project name if the view is + located inside the project. Other arguments are comma-separated values + that will be filled in place of positional and keyword arguments in the + URL. All arguments for the URL should be present. + + For example if you have a view ``app_name.client`` taking client's id and + the corresponding line in a URLconf looks like this:: + + ('^client/(\d+)/$', 'app_name.client') + + and this app's URLconf is included into the project's URLconf under some + path:: + + ('^clients/', include('project_name.app_name.urls')) + + then in a template you can create a link for a certain client like this:: + + {% url app_name.client client.id %} + + The URL will look like ``/clients/client/123/``. + """ + bits = token.contents.split(' ') + if len(bits) < 2: + raise template.TemplateSyntaxError("'%s' takes at least one argument" + " (path to a view)" % bits[0]) + viewname = bits[1] + args = [] + kwargs = {} + asvar = None + + if len(bits) > 2: + bits = iter(bits[2:]) + for bit in bits: + if bit == 'as': + asvar = bits.next() + break + else: + for arg in bit.split(","): + if '=' in arg: + k, v = arg.split('=', 1) + k = k.strip() + kwargs[k] = parser.compile_filter(v) + elif arg: + args.append(parser.compile_filter(arg)) + return URLNode(viewname, args, kwargs, asvar) +fburl = register.tag(fburl) \ No newline at end of file diff --git a/apps/django_ext/templatetags/fb.pyc b/apps/django_ext/templatetags/fb.pyc new file mode 100644 index 0000000..d6aac38 Binary files /dev/null and b/apps/django_ext/templatetags/fb.pyc differ diff --git a/apps/django_ext/templatetags/listutil.py b/apps/django_ext/templatetags/listutil.py new file mode 100644 index 0000000..9f295bb --- /dev/null +++ b/apps/django_ext/templatetags/listutil.py @@ -0,0 +1,104 @@ +""" +Template tags for working with lists. + +You'll use these in templates thusly:: + + {% load listutil %} + {% for sublist in mylist|parition:"3" %} + {% for item in mylist %} + do something with {{ item }} + {% endfor %} + {% endfor %} +""" + +from math import ceil + +from django import template + +register = template.Library() + +@register.filter +def partition(thelist, n): + """ + Break a list into ``n`` pieces. The last list may be larger than the rest if + the list doesn't break cleanly. That is:: + + >>> l = range(10) + + >>> partition(l, 2) + [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] + + >>> partition(l, 3) + [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]] + + >>> partition(l, 4) + [[0, 1], [2, 3], [4, 5], [6, 7, 8, 9]] + + >>> partition(l, 5) + [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]] + + """ + try: + n = int(n) + thelist = list(thelist) + except (ValueError, TypeError): + return [thelist] + p = len(thelist) / n + return [thelist[p*i:p*(i+1)] for i in range(n - 1)] + [thelist[p*(i+1):]] +register.filter(partition) + + +@register.filter +def partition_horizontal(thelist, n): + """ + Break a list into ``n`` peices, but "horizontally." That is, + ``partition_horizontal(range(10), 3)`` gives:: + + [[1, 2, 3], + [4, 5, 6], + [7, 8, 9], + [10]] + + Clear as mud? + """ + try: + n = int(n) + thelist = list(thelist) + except (ValueError, TypeError): + return [thelist] + newlists = [list() for i in range(int(ceil(len(thelist) / float(n))))] + for i, val in enumerate(thelist): + newlists[i/n].append(val) + return newlists +register.filter(partition_horizontal) + + +@register.filter +def partition_horizontal_twice(thelist, numbers): + """ + numbers is split on a comma to n and n2. + Break a list into peices each peice alternating between n and n2 items long + ``partition_horizontal_twice(range(14), "3,4")`` gives:: + + [[0, 1, 2], + [3, 4, 5, 6], + [7, 8, 9], + [10, 11, 12, 13]] + + Clear as mud? + """ + n, n2 = numbers.split(',') + try: + n = int(n) + n2 = int(n2) + thelist = list(thelist) + except (ValueError, TypeError): + return [thelist] + newlists = [] + while thelist: + newlists.append(thelist[:n]) + thelist = thelist[n:] + newlists.append(thelist[:n2]) + thelist = thelist[n2:] + return newlists +register.filter(partition_horizontal_twice) \ No newline at end of file diff --git a/apps/django_ext/templatetags/listutil.pyc b/apps/django_ext/templatetags/listutil.pyc new file mode 100644 index 0000000..8e891e6 Binary files /dev/null and b/apps/django_ext/templatetags/listutil.pyc differ diff --git a/apps/django_ext/templatetags/smart_if.py b/apps/django_ext/templatetags/smart_if.py new file mode 100644 index 0000000..0a38089 --- /dev/null +++ b/apps/django_ext/templatetags/smart_if.py @@ -0,0 +1,333 @@ +''' +A smarter {% if %} tag for django templates. + +While retaining current Django functionality, it also handles equality, +greater than and less than operators. Some common case examples:: + + {% if articles|length >= 5 %}...{% endif %} + {% if "ifnotequal tag" != "beautiful" %}...{% endif %} +''' +import unittest +from django import template + + +register = template.Library() + + +#=============================================================================== +# Calculation objects +#=============================================================================== + +class BaseCalc(object): + def __init__(self, var1, var2=None, negate=False): + self.var1 = var1 + self.var2 = var2 + self.negate = negate + + def resolve(self, context): + try: + var1, var2 = self.resolve_vars(context) + outcome = self.calculate(var1, var2) + except: + outcome = False + if self.negate: + return not outcome + return outcome + + def resolve_vars(self, context): + var2 = self.var2 and self.var2.resolve(context) + return self.var1.resolve(context), var2 + + def calculate(self, var1, var2): + raise NotImplementedError() + + +class Or(BaseCalc): + def calculate(self, var1, var2): + return var1 or var2 + + +class And(BaseCalc): + def calculate(self, var1, var2): + return var1 and var2 + + +class Equals(BaseCalc): + def calculate(self, var1, var2): + return var1 == var2 + + +class Greater(BaseCalc): + def calculate(self, var1, var2): + return var1 > var2 + + +class GreaterOrEqual(BaseCalc): + def calculate(self, var1, var2): + return var1 >= var2 + + +class In(BaseCalc): + def calculate(self, var1, var2): + return var1 in var2 + + +#=============================================================================== +# Tests +#=============================================================================== + +class TestVar(object): + """ + A basic self-resolvable object similar to a Django template variable. Used + to assist with tests. + """ + def __init__(self, value): + self.value = value + + def resolve(self, context): + return self.value + + +class SmartIfTests(unittest.TestCase): + def setUp(self): + self.true = TestVar(True) + self.false = TestVar(False) + self.high = TestVar(9000) + self.low = TestVar(1) + + def assertCalc(self, calc, context=None): + """ + Test a calculation is True, also checking the inverse "negate" case. + """ + context = context or {} + self.assert_(calc.resolve(context)) + calc.negate = not calc.negate + self.assertFalse(calc.resolve(context)) + + def assertCalcFalse(self, calc, context=None): + """ + Test a calculation is False, also checking the inverse "negate" case. + """ + context = context or {} + self.assertFalse(calc.resolve(context)) + calc.negate = not calc.negate + self.assert_(calc.resolve(context)) + + def test_or(self): + self.assertCalc(Or(self.true)) + self.assertCalcFalse(Or(self.false)) + self.assertCalc(Or(self.true, self.true)) + self.assertCalc(Or(self.true, self.false)) + self.assertCalc(Or(self.false, self.true)) + self.assertCalcFalse(Or(self.false, self.false)) + + def test_and(self): + self.assertCalc(And(self.true, self.true)) + self.assertCalcFalse(And(self.true, self.false)) + self.assertCalcFalse(And(self.false, self.true)) + self.assertCalcFalse(And(self.false, self.false)) + + def test_equals(self): + self.assertCalc(Equals(self.low, self.low)) + self.assertCalcFalse(Equals(self.low, self.high)) + + def test_greater(self): + self.assertCalc(Greater(self.high, self.low)) + self.assertCalcFalse(Greater(self.low, self.low)) + self.assertCalcFalse(Greater(self.low, self.high)) + + def test_greater_or_equal(self): + self.assertCalc(GreaterOrEqual(self.high, self.low)) + self.assertCalc(GreaterOrEqual(self.low, self.low)) + self.assertCalcFalse(GreaterOrEqual(self.low, self.high)) + + def test_in(self): + list_ = TestVar([1,2,3]) + invalid_list = TestVar(None) + self.assertCalc(In(self.low, list_)) + self.assertCalcFalse(In(self.low, invalid_list)) + + def test_parse_bits(self): + var = IfParser([True]).parse() + self.assert_(var.resolve({})) + var = IfParser([False]).parse() + self.assertFalse(var.resolve({})) + + var = IfParser([False, 'or', True]).parse() + self.assert_(var.resolve({})) + + var = IfParser([False, 'and', True]).parse() + self.assertFalse(var.resolve({})) + + var = IfParser(['not', False, 'and', 'not', False]).parse() + self.assert_(var.resolve({})) + + var = IfParser([1, '=', 1]).parse() + self.assert_(var.resolve({})) + + var = IfParser([1, '!=', 1]).parse() + self.assertFalse(var.resolve({})) + + var = IfParser([3, '>', 2]).parse() + self.assert_(var.resolve({})) + + var = IfParser([1, '<', 2]).parse() + self.assert_(var.resolve({})) + + var = IfParser([2, 'not', 'in', [2, 3]]).parse() + self.assertFalse(var.resolve({})) + + +OPERATORS = { + '=': (Equals, True), + '==': (Equals, True), + '!=': (Equals, False), + '>': (Greater, True), + '>=': (GreaterOrEqual, True), + '<=': (Greater, False), + '<': (GreaterOrEqual, False), + 'or': (Or, True), + 'and': (And, True), + 'in': (In, True), +} + + +class IfParser(object): + error_class = ValueError + + def __init__(self, tokens): + self.tokens = tokens + + def _get_tokens(self): + return self._tokens + + def _set_tokens(self, tokens): + self._tokens = tokens + self.len = len(tokens) + self.pos = 0 + + tokens = property(_get_tokens, _set_tokens) + + def parse(self): + if self.at_end(): + raise self.error_class('No variables provided.') + var1 = self.get_var() + while not self.at_end(): + token = self.get_token() + if token == 'not': + if self.at_end(): + raise self.error_class('No variable provided after "not".') + token = self.get_token() + negate = True + else: + negate = False + if token not in OPERATORS: + raise self.error_class('%s is not a valid operator.' % token) + if self.at_end(): + raise self.error_class('No variable provided after "%s"' % token) + op, true = OPERATORS[token] + if not true: + negate = not negate + var2 = self.get_var() + var1 = op(var1, var2, negate=negate) + return var1 + + def get_token(self): + token = self.tokens[self.pos] + self.pos += 1 + return token + + def at_end(self): + return self.pos >= self.len + + def create_var(self, value): + return TestVar(value) + + def get_var(self): + token = self.get_token() + if token == 'not': + if self.at_end(): + raise self.error_class('No variable provided after "not".') + token = self.get_token() + return Or(self.create_var(token), negate=True) + return self.create_var(token) + + +#=============================================================================== +# Actual templatetag code. +#=============================================================================== + +class TemplateIfParser(IfParser): + error_class = template.TemplateSyntaxError + + def __init__(self, parser, *args, **kwargs): + self.template_parser = parser + return super(TemplateIfParser, self).__init__(*args, **kwargs) + + def create_var(self, value): + return self.template_parser.compile_filter(value) + + +class SmartIfNode(template.Node): + def __init__(self, var, nodelist_true, nodelist_false=None): + self.nodelist_true, self.nodelist_false = nodelist_true, nodelist_false + self.var = var + + def render(self, context): + if self.var.resolve(context): + return self.nodelist_true.render(context) + if self.nodelist_false: + return self.nodelist_false.render(context) + return '' + + def __repr__(self): + return "" + + def __iter__(self): + for node in self.nodelist_true: + yield node + if self.nodelist_false: + for node in self.nodelist_false: + yield node + + def get_nodes_by_type(self, nodetype): + nodes = [] + if isinstance(self, nodetype): + nodes.append(self) + nodes.extend(self.nodelist_true.get_nodes_by_type(nodetype)) + if self.nodelist_false: + nodes.extend(self.nodelist_false.get_nodes_by_type(nodetype)) + return nodes + + +@register.tag('if') +def smart_if(parser, token): + ''' + A smarter {% if %} tag for django templates. + + While retaining current Django functionality, it also handles equality, + greater than and less than operators. Some common case examples:: + + {% if articles|length >= 5 %}...{% endif %} + {% if "ifnotequal tag" != "beautiful" %}...{% endif %} + + Arguments and operators _must_ have a space between them, so + ``{% if 1>2 %}`` is not a valid smart if tag. + + All supported operators are: ``or``, ``and``, ``in``, ``=`` (or ``==``), + ``!=``, ``>``, ``>=``, ``<`` and ``<=``. + ''' + bits = token.split_contents()[1:] + var = TemplateIfParser(parser, bits).parse() + nodelist_true = parser.parse(('else', 'endif')) + token = parser.next_token() + if token.contents == 'else': + nodelist_false = parser.parse(('endif',)) + parser.delete_first_token() + else: + nodelist_false = None + return SmartIfNode(var, nodelist_true, nodelist_false) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/apps/django_ext/templatetags/smart_if.pyc b/apps/django_ext/templatetags/smart_if.pyc new file mode 100644 index 0000000..00238cf Binary files /dev/null and b/apps/django_ext/templatetags/smart_if.pyc differ diff --git a/apps/django_ext/views.py b/apps/django_ext/views.py new file mode 100644 index 0000000..42b979c --- /dev/null +++ b/apps/django_ext/views.py @@ -0,0 +1,14 @@ +from django.shortcuts import render_to_response +from django.template import RequestContext + +clean = lambda i: '/'+'/'.join(i['location'].split('/')[3:]) + +def sitemap(request, sitemaps): + maps = {} + for section, site in sitemaps.items(): + if callable(site): + maps[section] = map(clean, site().get_urls()) + else: + maps[section] = map(clean, site.get_urls()) + return render_to_response('sitemap.html',{'maps':maps}, + context_instance=RequestContext(request)) \ No newline at end of file diff --git a/apps/django_ext/views.pyc b/apps/django_ext/views.pyc new file mode 100644 index 0000000..d9b940b Binary files /dev/null and b/apps/django_ext/views.pyc differ diff --git a/bin/ext-status.sh b/bin/ext-status.sh new file mode 100755 index 0000000..31466db --- /dev/null +++ b/bin/ext-status.sh @@ -0,0 +1,28 @@ +#!/bin/bash +if [ "$VIRTUAL_ENV" = "" ]; then + echo "You must be in a virtualenv environment. Type workon for a list." + exit +fi + +FILES=$VIRTUAL_ENV/src/* + +for f in $FILES +do + if [ -d $f ] + then + cd $f + if [ -e .git ] + then + git status + elif [ -e .bzr ] + then + bzr status + elif [ -e .hg ] + then + hg status + elif [ -e .svn ] + then + svn status + fi + fi +done \ No newline at end of file diff --git a/bin/install.sh b/bin/install.sh new file mode 100755 index 0000000..b2409ec --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +if [ "$VIRTUAL_ENV" = "" ]; then + echo "You must be in a virtualenv environment. Type workon for a list." + exit +fi + +PWD=`pwd` +POSTACTIVATE=$VIRTUAL_ENV/bin/postactivate + +if [ -e externals ]; then + echo 'Externals link exists.' +else + echo 'Creating link: externals.' + ln -s $VIRTUAL_ENV/src externals +fi + +if [ -e $POSTACTIVATE ]; then + echo 'Postactivate script exists.' +else + echo 'Creating postactivate script.' + cat > $POSTACTIVATE < + ServerAdmin webmaster@washingtontimes.com + ServerName EffervescentCollective + ServerAlias media-EffervescentCollective + DocumentRoot /var/code/EffervescentCollective/media + + WSGIDaemonProcess EffervescentCollective user=webdev group=webdev processes=3 threads=1 maximum-requests=1000 python-path=/home/webdev/.virtualenvs/EffervescentCollective/lib/python2.5/site-packages + WSGIProcessGroup EffervescentCollective + WSGIScriptAlias / /var/code/EffervescentCollective/conf/EffervescentCollective.wsgi + + Alias /media /var/code/EffervescentCollective/media + + SetHandler None + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/xml + AddOutputFilterByType DEFLATE application/xhtml+xml + AddOutputFilterByType DEFLATE text/css + AddOutputFilterByType DEFLATE application/xml + AddOutputFilterByType DEFLATE image/svg+xml + AddOutputFilterByType DEFLATE application/rss+xml + AddOutputFilterByType DEFLATE application/atom_xml + AddOutputFilterByType DEFLATE application/x-javascript + AddOutputFilterByType DEFLATE application/x-httpd-php + AddOutputFilterByType DEFLATE application/x-httpd-fastphp + AddOutputFilterByType DEFLATE application/x-httpd-eruby + AddOutputFilterByType DEFLATE text/html + FileETag INode MTime Size + + + Alias /admin-media /home/webdev/.virtualenvs/EffervescentCollective/lib/python2.5/site-packages/django/contrib/admin/media + + SetHandler None + + + \ No newline at end of file diff --git a/conf/nginx-EffervescentCollective b/conf/nginx-EffervescentCollective new file mode 100644 index 0000000..386fc63 --- /dev/null +++ b/conf/nginx-EffervescentCollective @@ -0,0 +1,23 @@ +#upstream webcluster { +# server 127.0.0.1:8080; +#} +server { + listen 80; + server_name media-$$$$DEV_APP_HOST$$$$; + access_log /var/log/nginx/media-$$$$DEV_APP_HOST$$$$.access.log; + location / { + autoindex on; + index index.html; + root /var/code/EffervescentCollective/media; + expires max; + } +} +server { + listen 80; + server_name $$$$DEV_APP_HOST$$$$; + access_log /var/log/nginx/$$$$DEV_APP_HOST$$$$.access.log; + location / { + proxy_pass http://webcluster; + include /var/code/EffervescentCollective/conf/proxy.conf; + } +} \ No newline at end of file diff --git a/conf/proxy.conf b/conf/proxy.conf new file mode 100644 index 0000000..21dbbd3 --- /dev/null +++ b/conf/proxy.conf @@ -0,0 +1,13 @@ +proxy_redirect off; +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +client_max_body_size 10m; +client_body_buffer_size 128k; +proxy_connect_timeout 90; +proxy_send_timeout 90; +proxy_read_timeout 90; +proxy_buffer_size 4k; +proxy_buffers 4 32k; +proxy_busy_buffers_size 64k; +proxy_temp_file_write_size 64k; \ No newline at end of file diff --git a/dev.db b/dev.db new file mode 100644 index 0000000..ec518e1 Binary files /dev/null and b/dev.db differ diff --git a/local_settings.py b/local_settings.py new file mode 100644 index 0000000..364fd2a --- /dev/null +++ b/local_settings.py @@ -0,0 +1,18 @@ +import os + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +DATABASE_ENGINE = 'sqlite3' +DATABASE_NAME = 'dev.db' +DATABASE_USER = '' +DATABASE_PASSWORD = '' +DATABASE_HOST = '' +DATABASE_PORT = '' + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(os.path.dirname(__file__),'media') +ADMIN_MEDIA_PREFIX = '/admin-media/' + + +CACHE_BACKEND = "dummy:///" diff --git a/local_settings.pyc b/local_settings.pyc new file mode 100644 index 0000000..d6621c2 Binary files /dev/null and b/local_settings.pyc differ diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..7b654ee --- /dev/null +++ b/manage.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +import os, sys + +PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0, os.path.join(PROJECT_ROOT,"apps")) +sys.path.insert(0, os.path.join(PROJECT_ROOT,"lib")) +sys.path.insert(0, PROJECT_ROOT) + +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/media/.DS_Store b/media/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/media/.DS_Store differ diff --git a/media/Nautica05b/Thumbs.db b/media/Nautica05b/Thumbs.db new file mode 100644 index 0000000..903587e Binary files /dev/null and b/media/Nautica05b/Thumbs.db differ diff --git a/media/Nautica05b/contact.html b/media/Nautica05b/contact.html new file mode 100644 index 0000000..8a4139a --- /dev/null +++ b/media/Nautica05b/contact.html @@ -0,0 +1,263 @@ + + + + + + + + Nautica 05 Dark Contact Layout + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + +
+ + + +
+ + + +
+ +

Details

+ +

+ Please make sure your info is correct, otherwise we can't get back to you. +

+ + + +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. +

+ + + +
+ + + + +
+ +

Contact Us

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ + +

+ +

  + +

+ + + +

Example Form Elements

+ + + +

+ + +

+ +

+ + +

+ +

+ + +

+ +

+ + +

+ + + + +

+ + One + Two + Three + Four +

+ + +

+ + One + Two + Three + Four +

+ + +
+ +

Different Style Checkbox Group

+

+ A Choice
+ Another Choice
+ Maybe this is a better choice
+ Other +

+ +
+ + + +
+ + + + +
+ + + +
+ + +
+ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/media/Nautica05b/css/html.css b/media/Nautica05b/css/html.css new file mode 100644 index 0000000..01b2fb8 --- /dev/null +++ b/media/Nautica05b/css/html.css @@ -0,0 +1,203 @@ +/************************************************************** + Visit studio7designs.com for more layouts and downloads for this template! + **************************************************************/ + +/********************************************************* + HTML Elements + *********************************************************/ + +html, +body { + height: 100%; +} + +body { + margin: 0; + padding: 0; + text-align: center; + background: url(../images/bg/light_body.gif) repeat-y top center; + font: 400 0.7em verdana, arial, sans-serif; + line-height: 170%; + + color: #555; +} + + +/* Headers */ +h1, h2, h3, h4, h5, h6 { + margin: 0 0 10px 0; + padding: 0; +} + + +h1 { + padding-bottom: 0.2em; + + font: 400 1.6em arial, sans-serif; + color: #536C71; + border-bottom: 12px solid #ddd; +} + +h2 { + font-size: 1.2em; + color: #586B7A; +} + +h3 { + text-transform: uppercase; + font-size: 0.9em; + color: #5D6F73; +} + +h4 { + font-size: 0.85em; +} + +h5 { + font-size: 0.8em; +} + + +/* Needed to horizontally pad in a coloured container */ +.horzPad h1, +.horzPad h2, +.horzPad h3, +.horzPad h4, +.horzPad h5, +.horzPad p { + padding-left: 5px; + padding-right: 5px; +} + + +/* Links */ +a { + text-decoration: none; + color: #3B5D77; +} + +a:hover { + color: #668FA3; +} + +a img { + border: 0; +} + +a img.border { + border: 1px solid #000; +} + +a:hover img.border { + /* Fixes IE bug - IE doesn't correctly apply the style on a:hover so need to mask it */ + border: 1px solid #668FA3 !important; + border: 1px solid #FC3307; +} + + + +/* Images */ +img.floatRight { + margin: 5px 0 10px 10px; +} + +img.floatLeft { + margin: 5px 10px 10px 0; +} + + + +/* Lists */ +ul li { + list-style-image: url(../images/bg/submenu1.gif); +} + +ol li { + font-weight: bold; + color: #668FA3; +} + +ol li span { + font-weight: normal; + color: #444; +} + + + +/* Blockquote */ +blockquote { + margin: 0; + padding: 0 20px; + background: #eee; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + + + +/************************************************************** + Form Elements + **************************************************************/ + +form { + padding: 0; + margin: 0; +} + +/* If you're finding the input elements get pushed down, increase the width */ +label { + float: left; + width: 25%; + vertical-align: top; +} + +input, +textarea, +select { + padding: 1px; + font: 400 1em verdana, sans-serif; + color: #999; + background: #EEE; + border: 1px solid #CCC; +} + +input:focus, +input:hover, +textarea:focus, +textarea:hover, +select:focus, +select:hover { + color: #000; + background: #E7F1F3; + border: 1px solid #888; +} + +input.noBorder, +input:focus.noBorder, +input:hover.noBorder { + padding: 0; + border: 0; +} + +input.button { + padding: 2px 5px; + + font: 400 0.9em verdana, serif; + cursor: pointer; + + color: #fff; + background: #ccc; + border-width: 1px; + border-style: solid; + border-color: #888 #888 #8880 #888; +} + +input.radio { + background: none; + border: 0px; +} + + + + + diff --git a/media/Nautica05b/css/layout.css b/media/Nautica05b/css/layout.css new file mode 100644 index 0000000..ef8cf3b --- /dev/null +++ b/media/Nautica05b/css/layout.css @@ -0,0 +1,551 @@ +/************************************************************** + Visit studio7designs.com for more layouts and downloads for this template! + **************************************************************/ + +/************************************************************** + All page content except for footer + **************************************************************/ + +#content { + position: relative; + height: auto !important; + height: 100%; + min-height: 100%; +} + + + +/************************************************************** + Topbar with newsletter form and theme change buttons + **************************************************************/ + +#topbar { + float: left; + width: 100%; + padding: 0.6em 0; + + font-size: 0.9em; + text-transform: uppercase; + + color: #CFD9DB; + background: #FFF url(../images/bg/topbar.gif) repeat-x bottom left; +} + + + +/************************************************************** + Top menu and logo + **************************************************************/ + +#header { + clear: both; + position: relative; + height: 5em; + margin: 0 auto; + background: #48525B url(../images/bg/header.gif) repeat-x bottom left; + border-bottom: 2px solid #48525B; + background-color: #48525B; +} + + +#header img { + position: absolute; + top: 5%; + left: 10px; +} + +#header ul { + margin: 3.5em 1em 0 0 !important; + margin: 3.5em 0.5em 0 0; + padding: 0; + float: right; +} + +#header ul li { + display: inline; + list-style: none; +} + +#header ul li a { + float: left; + padding: 0 1em; + + font: 400 1.1em arial, sans-serif; + letter-spacing: 0.1em; + line-height: 0.8em !important; + line-height: 1em; + + color: #cccccc; + border-right: 1px solid #4D5760; +} + +#header ul li a.last { + padding-right: 0; + border-right: 0; +} + +#header ul li a:hover { + color: #F26A92; +} + + + +/************************************************************** + Header Image/Flash Movie + **************************************************************/ + +#headerImg { + margin: 0 auto; + height: 250px; + background: url(../images/bg/header_image2.jpg) no-repeat top left; +} + + + + + +/************************************************************** + Top Block Menu + **************************************************************/ + +#menu { + margin: 0 auto; +} + +#menu ul { + width: 100%; + float: left; + margin: 0; + padding: 0; + + text-align: left; + background: #000 url(../images/bg/menu.gif) repeat-x top left; +} + +#menu ul li { + display: inline; + margin: 0; + padding: 0; + list-style: none; +} + +#menu ul li a { + float: left; + width: 25%; + height: 4.5em; + + font: 400 1.2em arial, sans-serif; + letter-spacing: 0.1em; + + color: #fff; + + border-top: 7px solid #000; + border-bottom: 15px solid #FFF; +} + +#menu ul li a span { + display: block; + padding: 2px 7px; +} + + +#menu ul li a span.desc { + font-size: 0.8em; + color: #8C8D94; +} + + +#menu ul li a:hover, +#menu ul li a.here { + background: #000; + border-top: 7px solid #F06890; +} + +#menu ul li a:hover span.desc, +#menu ul li a.here span.desc { + color: #FFF; +} + + +/* Top menu icons */ +#menu ul li a span.speaker { + padding-left: 22px; + background: url(../images/icons/speaker.gif) no-repeat 5px 50%; +} + +#menu ul li a:hover span.speaker { + background: url(../images/icons/speaker_on.gif) no-repeat 5px 50%; +} + +#menu ul li a span.bubble { + padding-left: 24px; + background: url(../images/icons/bubble.gif) no-repeat 4px 4px; +} + +#menu ul li a:hover span.bubble { + background: url(../images/icons/bubble_on.gif) no-repeat 4px 4px; +} + +#menu ul li a span.heart { + padding-left: 20px; + background: url(../images/icons/heart.gif) no-repeat 3px 50%; +} + +#menu ul li a:hover span.heart { + background: url(../images/icons/heart_on.gif) no-repeat 3px 50%; +} + + +#menu ul li a span.dollar { + padding-left: 20px; + background: url(../images/icons/dollar.gif) no-repeat 4px 50%; +} + +#menu ul li a:hover span.dollar { + background: url(../images/icons/dollar_on.gif) no-repeat 4px 50%; +} + + + + +/************************************************************** + Page Content + **************************************************************/ + +#page { + clear: both; + float: left; + width: 100%; + margin-bottom: 6em; + text-align: left; +} + +#columns { + margin: 0 auto; +} + + +/* Column widths */ +.width { + width: 776px; +} + +.widthPad { + width: 746px; +} + +.width25 { + width: 24%; +} + +.width50 { + width: 48%; +} + +.width73 { + width: 73%; +} + +.width75 { + width: 75%; +} + +.width100 { + width: 100%; +} + + +/************************************************************** + Footer + **************************************************************/ + + +#footer { + clear: both; + float: left; + width: 100%; + height: 5em; + margin-top: -5em; +} + +#footer #bg { + position: relative; + height: 5em; + margin: 0 auto; + background: #49525B url(../images/bg/header.gif) repeat-x bottom left; +} + +#footer #bg ul { + float: right; + margin: 3em 1em 0 0 !important; + margin: 3em 0.5em 0 0; + padding: 0; +} + +#footer #bg ul li { + display: inline; + list-style: none; +} + +#footer #bg ul li a { + float: left; + padding: 0 1em; + + font: 400 1em arial, sans-serif; + letter-spacing: 0.1em; + line-height: 0.8em !important; + line-height: 1em; + + color: #ccc; + border-right: 1px solid #4D5760; +} + +#footer #bg ul li a.last { + padding-right: 0; + border-right: 0; +} + +#footer #bg ul li a:hover { + color: #F26A92; +} + +#footer #bg img { + position: absolute; + top: 6%; + left: 10px; +} + + + +/************************************************************** + Icons specific to the colour theme + **************************************************************/ + +a.lightTheme img, +a.darkTheme img, +a.submitButton img { + width: 20px; + height: 20px; + vertical-align: middle; +} + +a.lightTheme img { + background: url(../images/icons/light_light_theme.gif) no-repeat center center; +} + +a.darkTheme img { + background: url(../images/icons/light_dark_theme.gif) no-repeat center center; +} + +a.submitButton img { + background: url(../images/icons/light_submit.gif) no-repeat center center; +} + + +/************************************************************** + Posts + **************************************************************/ + +.post { + float: left; + width: 100% !important; + width: 99%; + position: relative; + + margin-bottom: 1.5em; + + border-bottom: 1px solid #CCCCCC; +} + +.post .date { + position: absolute; + top: 0; + left: 5px; + + width: 2.3em; + text-align: right; +} + +.post .date .month { + text-transform: uppercase; + font: 700 1.0em arial, sans-serif; + color: #888; +} + +.post .date .day { + display: block; + margin-top: -5px; + font: 700 2.1em arial, sans-serif; + color: #888; +} + +.post .title { + display: block; + padding: 0 0 5px 0; + + font-size: 1.2em; + font-weight: bold; + color: #586B7A; +} + +.post p { + margin: 0 0 0 3.5em; + padding: 0 0 1em 1.2em; + border-left: 1px solid #CCCCCC; +} + + + +/************************************************************** + Thumbnail Lists + **************************************************************/ + +ul.thumbs, +ul.thumbs li { + margin: 0; + padding: 0; +} + +ul.thumbs li { + margin: 0 0 15px 0 !important; + margin: 0; + padding: 0px; + list-style: none; +} + +a.thumb img { + + border: 5px solid #ccc; +} + +a:hover.thumb img { + background: #8EB4C6; + border: 5px solid #000; +} + +a:hover.thumb { + background: none; +} + +a.thumb span { + display: block; + margin-top: -5px !important; + margin-top: -2px; +} + + + +/************************************************************** + Submenu Styles + **************************************************************/ + +ul.submenu1, +ul.submenu2 { + margin: 0 0 20px 0; + padding: 0; +} + +ul.submenu1 li, +ul.submenu2 li{ + margin: 0; + padding: 0; + list-style: none; + list-style-image: url(foo.gif); /* because IE is balls */ +} + +ul.submenu1 li a, +ul.submenu2 li a { + display: block; + height: auto !important; + + /* Start hide from IE Mac \*/ + height: 1%; + /* End hide from IE Mac */ + + padding: 1px 5px 1px 20px; +} + +ul.submenu1 li a { + background: url(../images/bg/submenu1.gif) no-repeat 5px 50%; +} + +ul.submenu1 a:hover { + color: #888; + background: #B3C6C4 url(../images/bg/submenu1.gif) no-repeat 5px 50%; +} + +ul.submenu2 li a { + color: #426F85; + background: url(../images/bg/submenu2.gif) no-repeat 3px 50%; +} + +ul.submenu2 a:hover { + color: #888; + background: #B3C6C4 url(../images/bg/submenu2.gif) no-repeat 3px 50%; +} + + + + + + +/************************************************************** + Generic Display + **************************************************************/ + + +.block { + display: block; +} + +.clear { + clear: both; +} + +.marginRight { + margin-right: 15px; +} + +.paddingLeft { + padding-left: 5px; +} + +.paddingRight { + padding-right: 5px; +} + +.floatLeft { + float: left; +} + +.floatRight { + float: right; +} + +.alignLeft { + text-align: left; +} + +.alignRight { + text-align: right; +} + +.alignTop { + vertical-align: top; +} + +.alignMiddle { + vertical-align: middle; +} + +.alignBottom { + vertical-align: bottom; +} + +.lightBlueBg { + background-color: #E9EAEB; +} + +.dark { + color: #353E47; +} diff --git a/media/Nautica05b/images/Thumbs.db b/media/Nautica05b/images/Thumbs.db new file mode 100644 index 0000000..4c492d0 Binary files /dev/null and b/media/Nautica05b/images/Thumbs.db differ diff --git a/media/Nautica05b/images/bg/Thumbs.db b/media/Nautica05b/images/bg/Thumbs.db new file mode 100644 index 0000000..53fa63f Binary files /dev/null and b/media/Nautica05b/images/bg/Thumbs.db differ diff --git a/media/Nautica05b/images/bg/blank.gif b/media/Nautica05b/images/bg/blank.gif new file mode 100644 index 0000000..f1ebcfe Binary files /dev/null and b/media/Nautica05b/images/bg/blank.gif differ diff --git a/media/Nautica05b/images/bg/header.gif b/media/Nautica05b/images/bg/header.gif new file mode 100644 index 0000000..e4d3769 Binary files /dev/null and b/media/Nautica05b/images/bg/header.gif differ diff --git a/media/Nautica05b/images/bg/header_image.jpg b/media/Nautica05b/images/bg/header_image.jpg new file mode 100644 index 0000000..8dc7fb2 Binary files /dev/null and b/media/Nautica05b/images/bg/header_image.jpg differ diff --git a/media/Nautica05b/images/bg/header_image2.jpg b/media/Nautica05b/images/bg/header_image2.jpg new file mode 100644 index 0000000..e12b873 Binary files /dev/null and b/media/Nautica05b/images/bg/header_image2.jpg differ diff --git a/media/Nautica05b/images/bg/light_body.gif b/media/Nautica05b/images/bg/light_body.gif new file mode 100644 index 0000000..3198f2b Binary files /dev/null and b/media/Nautica05b/images/bg/light_body.gif differ diff --git a/media/Nautica05b/images/bg/menu.gif b/media/Nautica05b/images/bg/menu.gif new file mode 100644 index 0000000..e4d3769 Binary files /dev/null and b/media/Nautica05b/images/bg/menu.gif differ diff --git a/media/Nautica05b/images/bg/submenu1.gif b/media/Nautica05b/images/bg/submenu1.gif new file mode 100644 index 0000000..f9aeefb Binary files /dev/null and b/media/Nautica05b/images/bg/submenu1.gif differ diff --git a/media/Nautica05b/images/bg/submenu2.gif b/media/Nautica05b/images/bg/submenu2.gif new file mode 100644 index 0000000..949ffef Binary files /dev/null and b/media/Nautica05b/images/bg/submenu2.gif differ diff --git a/media/Nautica05b/images/firefox.jpg b/media/Nautica05b/images/firefox.jpg new file mode 100644 index 0000000..b65393f Binary files /dev/null and b/media/Nautica05b/images/firefox.jpg differ diff --git a/media/Nautica05b/images/icon_samples.gif b/media/Nautica05b/images/icon_samples.gif new file mode 100644 index 0000000..6661e51 Binary files /dev/null and b/media/Nautica05b/images/icon_samples.gif differ diff --git a/media/Nautica05b/images/logo.gif b/media/Nautica05b/images/logo.gif new file mode 100644 index 0000000..e16794e Binary files /dev/null and b/media/Nautica05b/images/logo.gif differ diff --git a/media/Nautica05b/images/logo.jpg b/media/Nautica05b/images/logo.jpg new file mode 100644 index 0000000..3cd4e9f Binary files /dev/null and b/media/Nautica05b/images/logo.jpg differ diff --git a/media/Nautica05b/images/thumbs/01.jpg b/media/Nautica05b/images/thumbs/01.jpg new file mode 100644 index 0000000..185a06c Binary files /dev/null and b/media/Nautica05b/images/thumbs/01.jpg differ diff --git a/media/Nautica05b/images/thumbs/Thumbs.db b/media/Nautica05b/images/thumbs/Thumbs.db new file mode 100644 index 0000000..8be0d72 Binary files /dev/null and b/media/Nautica05b/images/thumbs/Thumbs.db differ diff --git a/media/Nautica05b/index.html b/media/Nautica05b/index.html new file mode 100644 index 0000000..6c828df --- /dev/null +++ b/media/Nautica05b/index.html @@ -0,0 +1,322 @@ + + + + + + + + Nautica 05 Dark + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + +
+ + + +
+ + + + + + + + + +
+

Nautica 05 Dark

+ + + +
+ +
+ May + 15
+ +

STUDIO7DESIGNS releases Nautica05 Public!. It has a very wide range of layouts and sample ID's and CLASSES for you to put together to create a very functional site in just hours! Make sure you click the above menu to see the 5 layouts that are included!

+

+ Samples: samples More... +

+ +
+ + + + +
+ +
+ May + 14 +
+ +

+ Easy to Modify + This template is easy to modify, we have made the PSD of the header image available for download so you can put your own text into the blank sign and side ribbon. If you would like to get more free graphics and Open Source Stock Photography you can visit studio7designs.com/opensource. +

+ +
+ + + + + +
+ +
+ May + 13 +
+ +

+ Chose your theme! + firefox + Visit STUDIO7DESIGNS to download the full template with a javascript theme switcher and more header graphics and icons. +

+

+ Read More +

+ +
+ + + + + +
+ +
+ May + 12 +
+ +

+ Open Source Tutorials + STUDIO7DESIGNS is working hard on providing easy to follow video tutorials on how to download and modify these templates. All you need is dreamweaver ( or other text editors ) and an hour and we can help you get this template up and running on your own server... Sign up for our newsletter for new tutorial releases! + +

+

+ Samples: samples More... +

+ +
+ + + + +
+ +
+ May + 11 +
+ +

+ Theme Pack releases + firefox + We have just released a few more header images that are hand drawn vector art for you. You can download the full version of this template at STUDIO7DESIGNS +

+ +
+ + +
+ + + + + + + +
+ + + +
+ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/media/Nautica05b/onecol.html b/media/Nautica05b/onecol.html new file mode 100644 index 0000000..1701a97 --- /dev/null +++ b/media/Nautica05b/onecol.html @@ -0,0 +1,245 @@ + + + + + + + + Nautica 05 Dark One column layout + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + +
+ + + +
+ + + +
+ +

Nautica 05 Dark One column example

+ + + +
+ +
+ Apr + 8 +
+ +

+ Sample Icon Pack Released! + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. + +

+

+ Samples: samples More... +

+ +
+ + + + +
+ +
+ Mar + 28 +
+ +

+ New Illustration + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +

Heading One

+ +

+ firefox + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Two

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Three

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Four

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
Heading Five
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ + +

Bulleted Lists

+ +
    +
  • Item One
  • +
  • Item Two
  • +
  • Item the Third
  • +
+ +

+ firefox + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
    +
  1. Item One
  2. +
  3. Item Two
  4. +
  5. Item the Third
  6. +
+ + +

Blockquote

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
+

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. +

+
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +
+ + +
+ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/media/Nautica05b/readme.txt b/media/Nautica05b/readme.txt new file mode 100644 index 0000000..be64e90 --- /dev/null +++ b/media/Nautica05b/readme.txt @@ -0,0 +1,10 @@ +This Template is opensource use it as you like. + +I only ask if you can, to link back to www.opensourcetemplates.org to help get the word out. + +Thats it :) + +Cheers +Aran + +aran@studio7designs.com \ No newline at end of file diff --git a/media/Nautica05b/twocol_a.html b/media/Nautica05b/twocol_a.html new file mode 100644 index 0000000..20f6393 --- /dev/null +++ b/media/Nautica05b/twocol_a.html @@ -0,0 +1,278 @@ + + + + + + + + Nautica 05 Dark Two column layout + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + +
+ + + +
+ + + + + + + + +
+ +

Nautica 05 Dark Two column example

+ + + +
+ +
+ Apr + 8 +
+ +

+ Sample Icon Pack Released! + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. + +

+

+ Samples: samples More... +

+ +
+ + + + +
+ +
+ Mar + 28 +
+ +

+ New Illustration + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +

Heading One

+ +

+ firefox + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Two

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Three

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Four

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
Heading Five
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ + +

Bulleted Lists

+ +
    +
  • Item One
  • +
  • Item Two
  • +
  • Item the Third
  • +
+ +

+ firefox + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
    +
  1. Item One
  2. +
  3. Item Two
  4. +
  5. Item the Third
  6. +
+ + +

Blockquote

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
+

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. +

+
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +
+ + +
+ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/media/Nautica05b/twocol_b.html b/media/Nautica05b/twocol_b.html new file mode 100644 index 0000000..ee807d3 --- /dev/null +++ b/media/Nautica05b/twocol_b.html @@ -0,0 +1,304 @@ + + + + + + + + Nautica 05 Dark Two Column with right sidebar layout + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + +
+ + + +
+ + + +
+ +

Nautica05 Dark Two Columb B

+ + + +
+ +
+ Apr + 8 +
+ +

+ Sample Icon Pack Released! + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. + +

+

+ Samples: samples More... +

+ +
+ + + + +
+ +
+ Mar + 28 +
+ +

+ New Illustration + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + +

Heading One

+ +

+ firefox + Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Two

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Three

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

Heading Four

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
Heading Five
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ + +

Bulleted Lists

+ +
    +
  • Item One
  • +
  • Item Two
  • +
  • Item the Third
  • +
+ +

+ firefox + In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
    +
  1. Item One
  2. +
  3. Item Two
  4. +
  5. Item the Third
  6. +
+ + +

Blockquote

+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. Sed est eros, faucibus vitae, vulputate sollicitudin, rutrum ultricies, neque. Nunc varius. Aenean vel magna. Pellentesque ultricies euismod massa. Vestibulum et quam. Maecenas diam metus, imperdiet sed, pharetra sed, rhoncus id, turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Cras felis. Vivamus nec quam. +

+ +
+

+ In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Sed posuere turpis ac sapien. +

+
+ +

+ Nulla commodo. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. Nulla commodo. In pharetra justo eget turpis. Nulla commodo. In pharetra justo eget turpis. In nunc justo, mollis sed, gravida at, aliquam sit amet, urna. +

+ +
+ + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/media/admin/css/base.css b/media/admin/css/base.css new file mode 100644 index 0000000..7299c95 --- /dev/null +++ b/media/admin/css/base.css @@ -0,0 +1,746 @@ +/* + DJANGO Admin styles +*/ + +body { + margin: 0; + padding: 0; + font-size: 12px; + font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; + color: #333; + background: #fff; +} + +/* LINKS */ + +a:link, a:visited { + color: #5b80b2; + text-decoration: none; +} + +a:hover { + color: #036; +} + +a img { + border: none; +} + +a.section:link, a.section:visited { + color: white; + text-decoration: none; +} + +/* GLOBAL DEFAULTS */ + +p, ol, ul, dl { + margin: .2em 0 .8em 0; +} + +p { + padding: 0; + line-height: 140%; +} + +h1,h2,h3,h4,h5 { + font-weight: bold; +} + +h1 { + font-size: 18px; + color: #666; + padding: 0 6px 0 0; + margin: 0 0 .2em 0; +} + +h2 { + font-size: 16px; + margin: 1em 0 .5em 0; +} + +h2.subhead { + font-weight: normal; + margin-top: 0; +} + +h3 { + font-size: 14px; + margin: .8em 0 .3em 0; + color: #666; + font-weight: bold; +} + +h4 { + font-size: 12px; + margin: 1em 0 .8em 0; + padding-bottom: 3px; +} + +h5 { + font-size: 10px; + margin: 1.5em 0 .5em 0; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; +} + +ul li { + list-style-type: square; + padding: 1px 0; +} + +ul.plainlist { + margin-left: 0 !important; +} + +ul.plainlist li { + list-style-type: none; +} + +li ul { + margin-bottom: 0; +} + +li, dt, dd { + font-size: 11px; + line-height: 14px; +} + +dt { + font-weight: bold; + margin-top: 4px; +} + +dd { + margin-left: 0; +} + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +blockquote { + font-size: 11px; + color: #777; + margin-left: 2px; + padding-left: 10px; + border-left: 5px solid #ddd; +} + +code, pre { + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; + background: inherit; + color: #666; + font-size: 11px; +} + +pre.literal-block { + margin: 10px; + background: #eee; + padding: 6px 8px; +} + +code strong { + color: #930; +} + +hr { + clear: both; + color: #eee; + background-color: #eee; + height: 1px; + border: none; + margin: 0; + padding: 0; + font-size: 1px; + line-height: 1px; +} + +/* TEXT STYLES & MODIFIERS */ + +.small { + font-size: 11px; +} + +.tiny { + font-size: 10px; +} + +p.tiny { + margin-top: -2px; +} + +.mini { + font-size: 9px; +} + +p.mini { + margin-top: -3px; +} + +.help, p.help { + font-size: 10px !important; + color: #999; +} + +p img, h1 img, h2 img, h3 img, h4 img, td img { + vertical-align: middle; +} + +.quiet, a.quiet:link, a.quiet:visited { + color: #999 !important; + font-weight: normal !important; +} + +.quiet strong { + font-weight: bold !important; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.clear { + clear: both; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.example { + margin: 10px 0; + padding: 5px 10px; + background: #efefef; +} + +.nowrap { + white-space: nowrap; +} + +/* TABLES */ + +table { + border-collapse: collapse; + border-color: #ccc; +} + +td, th { + font-size: 11px; + line-height: 13px; + border-bottom: 1px solid #eee; + vertical-align: top; + padding: 5px; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; +} + +th { + text-align: left; + font-size: 12px; + font-weight: bold; +} + +thead th, +tfoot td { + color: #666; + padding: 2px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + border-left: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +tfoot td { + border-bottom: none; + border-top: 1px solid #ddd; +} + +thead th:first-child, +tfoot td:first-child { + border-left: none !important; +} + +thead th.optional { + font-weight: normal !important; +} + +fieldset table { + border-right: 1px solid #eee; +} + +tr.row-label td { + font-size: 9px; + padding-top: 2px; + padding-bottom: 0; + border-bottom: none; + color: #666; + margin-top: -1px; +} + +tr.alt { + background: #f6f6f6; +} + +.row1 { + background: #EDF3FE; +} + +.row2 { + background: white; +} + +/* SORTABLE TABLES */ + +thead th a:link, thead th a:visited { + color: #666; + display: block; +} + +table thead th.sorted { + background-position: bottom left !important; +} + +table thead th.sorted a { + padding-right: 13px; +} + +table thead th.ascending a { + background: url(../img/admin/arrow-down.gif) right .4em no-repeat; +} + +table thead th.descending a { + background: url(../img/admin/arrow-up.gif) right .4em no-repeat; +} + +/* ORDERABLE TABLES */ + +table.orderable tbody tr td:hover { + cursor: move; +} + +table.orderable tbody tr td:first-child { + padding-left: 14px; + background-image: url(../img/admin/nav-bg-grabber.gif); + background-repeat: repeat-y; +} + +table.orderable-initalized .order-cell, body>tr>td.order-cell { + display: none; +} + +/* FORM DEFAULTS */ + +input, textarea, select { + margin: 2px 0; + padding: 2px 3px; + vertical-align: middle; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + font-size: 11px; +} + +textarea { + vertical-align: top !important; +} + +input[type=text], input[type=password], textarea, select, .vTextField { + border: 1px solid #ccc; +} + +/* FORM BUTTONS */ + +.button, input[type=submit], input[type=button], .submit-row input { + background: white url(../img/admin/nav-bg.gif) bottom repeat-x; + padding: 3px; + color: black; + border: 1px solid #bbb; + border-color: #ddd #aaa #aaa #ddd; +} + +.button:active, input[type=submit]:active, input[type=button]:active { + background-image: url(../img/admin/nav-bg-reverse.gif); + background-position: top; +} + +.button.default, input[type=submit].default, .submit-row input.default { + border: 2px solid #5b80b2; + background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x; + font-weight: bold; + color: white; + float: right; +} + +.button.default:active, input[type=submit].default:active { + background-image: url(../img/admin/default-bg-reverse.gif); + background-position: top; +} + +/* MODULES */ + +.module { + border: 1px solid #ccc; + margin-bottom: 5px; + background: white; +} + +.module p, .module ul, .module h3, .module h4, .module dl, .module pre { + padding-left: 10px; + padding-right: 10px; +} + +.module blockquote { + margin-left: 12px; +} + +.module ul, .module ol { + margin-left: 1.5em; +} + +.module h3 { + margin-top: .6em; +} + +.module h2, .module caption, .inline-group h2 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x; + color: white; +} + +.module table { + border-collapse: collapse; +} + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0 0 5px 0; + margin: 0; +} + +ul.messagelist li { + font-size: 12px; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border-bottom: 1px solid #ddd; + color: #666; + background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat; +} + +.errornote { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: red; + background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; +} + +ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +.errorlist li { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: white; + background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat; +} + +td ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +td ul.errorlist li { + margin: 0 !important; +} + +.errors { + background: #ffc; +} + +.errors input, .errors select { + border: 1px solid red; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: red; + background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} + +/* BREADCRUMBS */ + +div.breadcrumbs { + background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; + padding: 2px 8px 3px 8px; + font-size: 11px; + color: #999; + border-top: 1px solid white; + border-bottom: 1px solid #ccc; + text-align: left; +} + +/* ACTION ICONS */ + +.addlink { + padding-left: 12px; + background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat; +} + +.changelink { + padding-left: 12px; + background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat; +} + +.deletelink { + padding-left: 12px; + background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat; +} + +a.deletelink:link, a.deletelink:visited { + color: #CC3434; +} + +a.deletelink:hover { + color: #993333; +} + +/* OBJECT TOOLS */ + +.object-tools { + font-size: 10px; + font-weight: bold; + font-family: Arial,Helvetica,sans-serif; + padding-left: 0; + float: right; + position: relative; + margin-top: -2.4em; + margin-bottom: -2em; +} + +.form-row .object-tools { + margin-top: 5px; + margin-bottom: 5px; + float: none; + height: 2em; + padding-left: 3.5em; +} + +.object-tools li { + display: block; + float: left; + background: url(../img/admin/tool-left.gif) 0 0 no-repeat; + padding: 0 0 0 8px; + margin-left: 2px; + height: 16px; +} + +.object-tools li:hover { + background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat; +} + +.object-tools a:link, .object-tools a:visited { + display: block; + float: left; + color: white; + padding: .1em 14px .1em 8px; + height: 14px; + background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat; +} + +.object-tools a:hover, .object-tools li:hover a { + background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat; +} + +.object-tools a.viewsitelink, .object-tools a.golink { + background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.viewsitelink:hover, .object-tools a.golink:hover { + background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat; +} + +.object-tools a.addlink { + background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.addlink:hover { + background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat; +} + +/* OBJECT HISTORY */ + +table#change-history { + width: 100%; +} + +table#change-history tbody th { + width: 16em; +} + +/* PAGE STRUCTURE */ + +#container { + position: relative; + width: 100%; + min-width: 760px; + padding: 0; +} + +#content { + margin: 10px 15px; +} + +#header { + width: 100%; +} + +#content-main { + float: left; + width: 100%; +} + +#content-related { + float: right; + width: 18em; + position: relative; + margin-right: -19em; +} + +#footer { + clear: both; + padding: 10px; +} + +/* COLUMN TYPES */ + +.colMS { + margin-right: 20em !important; +} + +.colSM { + margin-left: 20em !important; +} + +.colSM #content-related { + float: left; + margin-right: 0; + margin-left: -19em; +} + +.colSM #content-main { + float: right; +} + +.popup .colM { + width: 95%; +} + +.subcol { + float: left; + width: 46%; + margin-right: 15px; +} + +.dashboard #content { + width: 500px; +} + +/* HEADER */ + +#header { + background: #417690; + color: #ffc; + overflow: hidden; +} + +#header a:link, #header a:visited { + color: white; +} + +#header a:hover { + text-decoration: underline; +} + +#branding h1 { + padding: 0 10px; + font-size: 18px; + margin: 8px 0; + font-weight: normal; + color: #f4f379; +} + +#branding h2 { + padding: 0 10px; + font-size: 14px; + margin: -8px 0 8px 0; + font-weight: normal; + color: #ffc; +} + +#user-tools { + position: absolute; + top: 0; + right: 0; + padding: 1.2em 10px; + font-size: 11px; + text-align: right; +} + +/* SIDEBAR */ + +#content-related h3 { + font-size: 12px; + color: #666; + margin-bottom: 3px; +} + +#content-related h4 { + font-size: 11px; +} + +#content-related .module h2 { + background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x; + color: #666; +} + diff --git a/media/admin/css/changelists.css b/media/admin/css/changelists.css new file mode 100644 index 0000000..649cff7 --- /dev/null +++ b/media/admin/css/changelists.css @@ -0,0 +1,255 @@ +/* CHANGELISTS */ + +#changelist { + position: relative; + width: 100%; +} + +#changelist table { + width: 100%; +} + +.change-list .filtered table { + border-right: 1px solid #ddd; +} + +.change-list .filtered { + min-height: 400px; +} + +.change-list .filtered { + background: white url(../img/admin/changelist-bg.gif) top right repeat-y !important; +} + +.change-list .filtered table, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 160px !important; + width: auto !important; +} + +.change-list .filtered table tbody th { + padding-right: 1em; +} + +#changelist .toplinks { + border-bottom: 1px solid #ccc !important; +} + +#changelist .paginator { + color: #666; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + background: white url(../img/admin/nav-bg.gif) 0 180% repeat-x; + overflow: hidden; +} + +.change-list .filtered .paginator { + border-right: 1px solid #ddd; +} + +/* CHANGELIST TABLES */ + +#changelist table thead th { + white-space: nowrap; + vertical-align: middle; +} + +#changelist table thead th:first-child { + width: 1.5em; + text-align: center; +} + +#changelist table tbody td { + border-left: 1px solid #ddd; +} + +#changelist table tbody td:first-child { + border-left: 0; + border-right: 1px solid #ddd; + text-align: center; +} + +#changelist table tfoot { + color: #666; +} + +/* TOOLBAR */ + +#changelist #toolbar { + padding: 3px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + color: #666; +} + +#changelist #toolbar form input { + font-size: 11px; + padding: 1px 2px; +} + +#changelist #toolbar form #searchbar { + padding: 2px; +} + +#changelist #changelist-search img { + vertical-align: middle; +} + +/* FILTER COLUMN */ + +#changelist-filter { + position: absolute; + top: 0; + right: 0; + z-index: 1000; + width: 160px; + border-left: 1px solid #ddd; + background: #efefef; + margin: 0; +} + +#changelist-filter h2 { + font-size: 11px; + padding: 2px 5px; + border-bottom: 1px solid #ddd; +} + +#changelist-filter h3 { + font-size: 12px; + margin-bottom: 0; +} + +#changelist-filter ul { + padding-left: 0; + margin-left: 10px; +} + +#changelist-filter li { + list-style-type: none; + margin-left: 0; + padding-left: 0; +} + +#changelist-filter a { + color: #999; +} + +#changelist-filter a:hover { + color: #036; +} + +#changelist-filter li.selected { + border-left: 5px solid #ccc; + padding-left: 5px; + margin-left: -10px; +} + +#changelist-filter li.selected a { + color: #5b80b2 !important; +} + +/* DATE DRILLDOWN */ + +.change-list ul.toplinks { + display: block; + background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; + border-top: 1px solid white; + float: left; + padding: 0 !important; + margin: 0 !important; + width: 100%; +} + +.change-list ul.toplinks li { + float: left; + width: 9em; + padding: 3px 6px; + font-weight: bold; + list-style-type: none; +} + +.change-list ul.toplinks .date-back a { + color: #999; +} + +.change-list ul.toplinks .date-back a:hover { + color: #036; +} + +/* PAGINATOR */ + +.paginator { + font-size: 11px; + padding-top: 10px; + padding-bottom: 10px; + line-height: 22px; + margin: 0; + border-top: 1px solid #ddd; +} + +.paginator a:link, .paginator a:visited { + padding: 2px 6px; + border: solid 1px #ccc; + background: white; + text-decoration: none; +} + +.paginator a.showall { + padding: 0 !important; + border: none !important; +} + +.paginator a.showall:hover { + color: #036 !important; + background: transparent !important; +} + +.paginator .end { + border-width: 2px !important; + margin-right: 6px; +} + +.paginator .this-page { + padding: 2px 6px; + font-weight: bold; + font-size: 13px; + vertical-align: top; +} + +.paginator a:hover { + color: white; + background: #5b80b2; + border-color: #036; +} + +/* ACTIONS */ + +.filtered .actions { + margin-right: 160px !important; + border-right: 1px solid #ddd; +} + +#changelist .actions { + color: #666; + padding: 3px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; +} + +#changelist .actions:last-child { + border-bottom: none; +} + +#changelist .actions select { + border: 1px solid #aaa; + margin: 0 0.5em; + padding: 1px 2px; +} + +#changelist .actions label { + font-size: 11px; + margin: 0 0.5em; +} + +#changelist #action-toggle { + display: none; +} diff --git a/media/admin/css/dashboard.css b/media/admin/css/dashboard.css new file mode 100644 index 0000000..88e3b1d --- /dev/null +++ b/media/admin/css/dashboard.css @@ -0,0 +1,24 @@ +/* DASHBOARD */ + +.dashboard .module table th { + width: 100%; +} + +.dashboard .module table td { + white-space: nowrap; +} + +.dashboard .module table td a { + display: block; + padding-right: .6em; +} + +/* RECENT ACTIONS MODULE */ + +.module ul.actionlist { + margin-left: 0; +} + +ul.actionlist li { + list-style-type: none; +} diff --git a/media/admin/css/forms.css b/media/admin/css/forms.css new file mode 100644 index 0000000..fbe4b75 --- /dev/null +++ b/media/admin/css/forms.css @@ -0,0 +1,327 @@ +@import url('widgets.css'); + +/* FORM ROWS */ + +.form-row { + overflow: hidden; + padding: 8px 12px; + font-size: 11px; + border-bottom: 1px solid #eee; +} + +.form-row img, .form-row input { + vertical-align: middle; +} + +form .form-row p { + padding-left: 0; + font-size: 11px; +} + +/* FORM LABELS */ + +form h4 { + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +label { + font-weight: normal !important; + color: #666; + font-size: 12px; +} + +.required label, label.required { + font-weight: bold !important; + color: #333 !important; +} + +/* RADIO BUTTONS */ + +form ul.radiolist li { + list-style-type: none; +} + +form ul.radiolist label { + float: none; + display: inline; +} + +form ul.inline { + margin-left: 0; + padding: 0; +} + +form ul.inline li { + float: left; + padding-right: 7px; +} + +/* ALIGNED FIELDSETS */ + +.aligned label { + display: block; + padding: 3px 10px 0 0; + float: left; + width: 8em; +} + +.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { + width: 350px; +} + +form .aligned p, form .aligned ul { + margin-left: 7em; + padding-left: 30px; +} + +form .aligned table p { + margin-left: 0; + padding-left: 0; +} + +form .aligned p.help { + padding-left: 38px; +} + +.aligned .vCheckboxLabel { + float: none !important; + display: inline; + padding-left: 4px; +} + +.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { + width: 610px; +} + +.checkbox-row p.help { + margin-left: 0; + padding-left: 0 !important; +} + +fieldset .field-box { + float: left; + margin-right: 20px; +} + +/* WIDE FIELDSETS */ + +.wide label { + width: 15em !important; +} + +form .wide p { + margin-left: 15em; +} + +form .wide p.help { + padding-left: 38px; +} + +.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField { + width: 450px; +} + +/* COLLAPSED FIELDSETS */ + +fieldset.collapsed * { + display: none; +} + +fieldset.collapsed h2, fieldset.collapsed { + display: block !important; +} + +fieldset.collapsed h2 { + background-image: url(../img/admin/nav-bg.gif); + background-position: bottom left; + color: #999; +} + +fieldset.collapsed .collapse-toggle { + padding: 3px 5px !important; + background: transparent; + display: inline !important; +} + +/* MONOSPACE TEXTAREAS */ + +fieldset.monospace textarea { + font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; +} + +/* SUBMIT ROW */ + +.submit-row { + padding: 5px 7px; + text-align: right; + background: white url(../img/admin/nav-bg.gif) 0 100% repeat-x; + border: 1px solid #ccc; + margin: 5px 0; + overflow: hidden; +} + +.submit-row input { + margin: 0 0 0 5px; +} + +.submit-row p { + margin: 0.3em; +} + +.submit-row p.deletelink-box { + float: left; +} + +.submit-row .deletelink { + background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; + padding-left: 14px; +} + +/* CUSTOM FORM FIELDS */ + +.vSelectMultipleField { + vertical-align: top !important; +} + +.vCheckboxField { + border: none; +} + +.vDateField, .vTimeField { + margin-right: 2px; +} + +.vURLField { + width: 30em; +} + +.vLargeTextField, .vXMLLargeTextField { + width: 48em; +} + +.flatpages-flatpage #id_content { + height: 40.2em; +} + +.module table .vPositiveSmallIntegerField { + width: 2.2em; +} + +.vTextField { + width: 20em; +} + +.vIntegerField { + width: 5em; +} + +.vForeignKeyRawIdAdminField { + width: 5em; +} + +/* INLINES */ + +.inline-group { + padding: 0; + border: 1px solid #ccc; + margin: 10px 0; +} + +.inline-group .aligned label { + width: 8em; +} + +.inline-related { + position: relative; +} + +.inline-related h3 { + margin: 0; + color: #666; + padding: 3px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + border-bottom: 1px solid #ddd; +} + +.inline-related h3 span.delete { + padding-left: 20px; + position: absolute; + top: 2px; + right: 10px; +} + +.inline-related h3 span.delete label { + margin-left: 2px; + font-size: 11px; +} + +.inline-related fieldset { + margin: 0; + background: #fff; + border: none; +} + +.inline-related fieldset.module h3 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #bcd; + color: #fff; +} + +.inline-related.tabular fieldset.module table { + width: 100%; +} + +.last-related fieldset { + border: none; +} + +.inline-group .tabular tr.has_original td { + padding-top: 2em; +} + +.inline-group .tabular tr td.original { + padding: 2px 0 0 0; + width: 0; + _position: relative; +} + +.inline-group .tabular th.original { + width: 0px; + padding: 0; +} + +.inline-group .tabular td.original p { + position: absolute; + left: 0; + height: 1.1em; + padding: 2px 7px; + overflow: hidden; + font-size: 9px; + font-weight: bold; + color: #666; + _width: 700px; +} + +.inline-group ul.tools { + padding: 0; + margin: 0; + list-style: none; +} + +.inline-group ul.tools li { + display: inline; + padding: 0 5px; +} + +.inline-group ul.tools a.add { + background: url(../img/admin/icon_addlink.gif) 0 50% no-repeat; + padding-left: 14px; +} + diff --git a/media/admin/css/ie.css b/media/admin/css/ie.css new file mode 100644 index 0000000..30a08e4 --- /dev/null +++ b/media/admin/css/ie.css @@ -0,0 +1,51 @@ +/* IE 6 & 7 */ + +/* Proper fixed width for dashboard in IE6 */ + +.dashboard #content { + *width: 768px; +} + +.dashboard #content-main { + *width: 535px; +} + +/* IE 6 ONLY */ + +/* Keep header from flowing off the page */ + +#container { + _position: static; +} + +/* Put the right sidebars back on the page */ + +.colMS #content-related { + _margin-right: 0; + _margin-left: 10px; + _position: static; +} + +/* Put the left sidebars back on the page */ + +.colSM #content-related { + _margin-right: 10px; + _margin-left: -115px; + _position: static; +} + +.form-row { + _height: 1%; +} + +/* Fix right margin for changelist filters in IE6 */ + +#changelist-filter ul { + _margin-right: -10px; +} + +/* IE ignores min-height, but treats height as if it were min-height */ + +.change-list .filtered { + _height: 400px; +} \ No newline at end of file diff --git a/media/admin/css/login.css b/media/admin/css/login.css new file mode 100644 index 0000000..8d90d12 --- /dev/null +++ b/media/admin/css/login.css @@ -0,0 +1,54 @@ +/* LOGIN FORM */ + +body.login { + background: #eee; +} + +.login #container { + background: white; + border: 1px solid #ccc; + width: 28em; + min-width: 300px; + margin-left: auto; + margin-right: auto; + margin-top: 100px; +} + +.login #content-main { + width: 100%; +} + +.login form { + margin-top: 1em; +} + +.login .form-row { + padding: 4px 0; + float: left; + width: 100%; +} + +.login .form-row label { + float: left; + width: 9em; + padding-right: 0.5em; + line-height: 2em; + text-align: right; + font-size: 1em; + color: #333; +} + +.login .form-row #id_username, .login .form-row #id_password { + width: 14em; +} + +.login span.help { + font-size: 10px; + display: block; +} + +.login .submit-row { + clear: both; + padding: 1em 0 0 9.4em; +} + diff --git a/media/admin/css/rtl.css b/media/admin/css/rtl.css new file mode 100644 index 0000000..f8aebb3 --- /dev/null +++ b/media/admin/css/rtl.css @@ -0,0 +1,195 @@ +body { + direction: rtl; +} + +/* LOGIN */ + +.login .form-row { + float: right; +} + +.login .form-row label { + float: right; + padding-left: 0.5em; + padding-right: 0; + text-align: left; +} + +.login .submit-row { + clear: both; + padding: 1em 9.4em 0 0; +} + +/* GLOBAL */ + +th { + text-align: right; +} + +.module h2, .module caption { + text-align: right; +} + +.addlink, .changelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.2em; +} + +.deletelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.25em; +} + +.object-tools { + float: left; +} + +/* LAYOUT */ + +#user-tools { + right: auto; + left: 0; + text-align: left; +} + +div.breadcrumbs { + text-align: right; +} + +#content-main { + float: right; +} + +#content-related { + float: left; + margin-left: -19em; + margin-right: auto; +} + +.colMS { + margin-left: 20em !important; + margin-right: 10px !important; +} + +/* dashboard styles */ + +.dashboard .module table td a { + padding-left: .6em; + padding-right: 12px; +} + +/* changelists styles */ + +.change-list .filtered { + background: white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important; +} + +.change-list .filtered table { + border-left: 1px solid #ddd; + border-right: 0px none; +} + +#changelist-filter { + right: auto; + left: 0; + border-left: 0px none; + border-right: 1px solid #ddd; +} + +.change-list .filtered table, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 0px !important; + margin-left: 160px !important; +} + +#changelist-filter li.selected { + border-left: 0px none; + padding-left: 0px; + margin-left: 0; + border-right: 5px solid #ccc; + padding-right: 5px; + margin-right: -10px; +} + +/* FORMS */ + +.aligned label { + padding: 0 0 3px 1em; + float: right; +} + +.submit-row { + text-align: left +} + +.submit-row p.deletelink-box { + float: right; +} + +.submit-row .deletelink { + background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; + padding-right: 14px; +} + +.vDateField, .vTimeField { + margin-left: 2px; +} + +form ul.inline li { + float: right; + padding-right: 0; + padding-left: 7px; +} + +input[type=submit].default, .submit-row input.default { + float: left; +} + +fieldset .field-box { + float: right; + margin-left: 20px; +} + +.errorlist li { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +.errornote { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +/* WIDGETS */ + +.calendarnav-previous { + top: 0; + left: auto; + right: 0; +} + +.calendarnav-next { + top: 0; + right: auto; + left: 0; +} + +.calendar caption, .calendarbox h2 { + text-align: center; +} + +.selector { + float: right; +} + +.selector .selector-filter { + text-align: right; +} + +/* MISC */ + +.inline-related h2 { + text-align: right +} + diff --git a/media/admin/css/widgets.css b/media/admin/css/widgets.css new file mode 100644 index 0000000..9f9e63e --- /dev/null +++ b/media/admin/css/widgets.css @@ -0,0 +1,506 @@ +/* SELECTOR (FILTER INTERFACE) */ + +.selector { + width: 580px; + float: left; +} + +.selector select { + width: 270px; + height: 17.2em; +} + +.selector-available, .selector-chosen { + float: left; + width: 270px; + text-align: center; + margin-bottom: 5px; +} + +.selector-available h2, .selector-chosen h2 { + border: 1px solid #ccc; +} + +.selector .selector-available h2 { + background: white url(../img/admin/nav-bg.gif) bottom left repeat-x; + color: #666; +} + +.selector .selector-filter { + background: white; + border: 1px solid #ccc; + border-width: 0 1px; + padding: 3px; + color: #999; + font-size: 10px; + margin: 0; + text-align: left; +} + +.selector .selector-chosen .selector-filter { + padding: 4px 5px; +} + +.selector .selector-available input { + width: 230px; +} + +.selector ul.selector-chooser { + float: left; + width: 22px; + height: 50px; + background: url(../img/admin/chooser-bg.gif) top center no-repeat; + margin: 8em 3px 0 3px; + padding: 0; +} + +.selector-chooser li { + margin: 0; + padding: 3px; + list-style-type: none; +} + +.selector select { + margin-bottom: 5px; + margin-top: 0; +} + +.selector-add, .selector-remove { + width: 16px; + height: 16px; + display: block; + text-indent: -3000px; +} + +.selector-add { + background: url(../img/admin/selector-add.gif) top center no-repeat; + margin-bottom: 2px; +} + +.selector-remove { + background: url(../img/admin/selector-remove.gif) top center no-repeat; +} + +a.selector-chooseall, a.selector-clearall { + display: block; + width: 6em; + text-align: left; + margin-left: auto; + margin-right: auto; + font-weight: bold; + color: #666; + padding: 3px 0 3px 18px; +} + +a.selector-chooseall:hover, a.selector-clearall:hover { + color: #036; +} + +a.selector-chooseall { + width: 7em; + background: url(../img/admin/selector-addall.gif) left center no-repeat; +} + +a.selector-clearall { + background: url(../img/admin/selector-removeall.gif) left center no-repeat; +} + + +/* STACKED SELECTORS */ + +.stacked { + float: left; + width: 500px; +} + +.stacked select { + width: 480px; + height: 10.1em; +} + +.stacked .selector-available, .stacked .selector-chosen { + width: 480px; +} + +.stacked .selector-available { + margin-bottom: 0; +} + +.stacked .selector-available input { + width: 442px; +} + +.stacked ul.selector-chooser { + height: 22px; + width: 50px; + margin: 0 0 3px 40%; + background: url(../img/admin/chooser_stacked-bg.gif) top center no-repeat; +} + +.stacked .selector-chooser li { + float: left; + padding: 3px 3px 3px 5px; +} + +.stacked .selector-chooseall, .stacked .selector-clearall { + display: none; +} + +.stacked .selector-add { + background-image: url(../img/admin/selector_stacked-add.gif); +} + +.stacked .selector-remove { + background-image: url(../img/admin/selector_stacked-remove.gif); +} + + +/* DATE AND TIME */ + +p.datetime { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.datetime span { + font-size: 11px; + color: #ccc; + font-weight: normal; + white-space: nowrap; +} + +table p.datetime { + font-size: 10px; + margin-left: 0; + padding-left: 0; +} + +/* FILE UPLOADS */ + +p.file-upload { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.file-upload a { + font-weight: normal; +} + +.file-upload .deletelink { + margin-left: 5px; +} + +/* CALENDARS & CLOCKS */ + +.calendarbox, .clockbox { + margin: 5px auto; + font-size: 11px; + width: 16em; + text-align: center; + background: white; + position: relative; +} + +.clockbox { + width: auto; +} + +.calendar { + margin: 0; + padding: 0; +} + +.calendar table { + margin: 0; + padding: 0; + border-collapse: collapse; + background: white; + width: 99%; +} + +.calendar caption, .calendarbox h2 { + margin: 0; + font-size: 11px; + text-align: center; + border-top: none; +} + +.calendar th { + font-size: 10px; + color: #666; + padding: 2px 3px; + text-align: center; + background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; + border-bottom: 1px solid #ddd; +} + +.calendar td { + font-size: 11px; + text-align: center; + padding: 0; + border-top: 1px solid #eee; + border-bottom: none; +} + +.calendar td.selected a { + background: #C9DBED; +} + +.calendar td.nonday { + background: #efefef; +} + +.calendar td.today a { + background: #ffc; +} + +.calendar td a, .timelist a { + display: block; + font-weight: bold; + padding: 4px; + text-decoration: none; + color: #444; +} + +.calendar td a:hover, .timelist a:hover { + background: #5b80b2; + color: white; +} + +.calendar td a:active, .timelist a:active { + background: #036; + color: white; +} + +.calendarnav { + font-size: 10px; + text-align: center; + color: #ccc; + margin: 0; + padding: 1px 3px; +} + +.calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { + color: #999; +} + +.calendar-shortcuts { + background: white; + font-size: 10px; + line-height: 11px; + border-top: 1px solid #eee; + padding: 3px 0 4px; + color: #ccc; +} + +.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + display: block; + position: absolute; + font-weight: bold; + font-size: 12px; + background: #C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x; + padding: 1px 4px 2px 4px; + color: white; +} + +.calendarnav-previous:hover, .calendarnav-next:hover { + background: #036; +} + +.calendarnav-previous { + top: 0; + left: 0; +} + +.calendarnav-next { + top: 0; + right: 0; +} + +.calendar-cancel { + margin: 0 !important; + padding: 0; + font-size: 10px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; + border-top: 1px solid #ddd; +} + +.calendar-cancel a { + padding: 2px; + color: #999; +} + +ul.timelist, .timelist li { + list-style-type: none; + margin: 0; + padding: 0; +} + +.timelist a { + padding: 2px; +} + +/* INLINE ORDERER */ + +ul.orderer { + position: relative; + padding: 0 !important; + margin: 0 !important; + list-style-type: none; +} + +ul.orderer li { + list-style-type: none; + display: block; + padding: 0; + margin: 0; + border: 1px solid #bbb; + border-width: 0 1px 1px 0; + white-space: nowrap; + overflow: hidden; + background: #e2e2e2 url(../img/admin/nav-bg-grabber.gif) repeat-y; +} + +ul.orderer li:hover { + cursor: move; + background-color: #ddd; +} + +ul.orderer li a.selector { + margin-left: 12px; + overflow: hidden; + width: 83%; + font-size: 10px !important; + padding: 0.6em 0; +} + +ul.orderer li a:link, ul.orderer li a:visited { + color: #333; +} + +ul.orderer li .inline-deletelink { + position: absolute; + right: 4px; + margin-top: 0.6em; +} + +ul.orderer li.selected { + background-color: #f8f8f8; + border-right-color: #f8f8f8; +} + +ul.orderer li.deleted { + background: #bbb url(../img/admin/deleted-overlay.gif); +} + +ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { + color: #888; +} + +ul.orderer li.deleted .inline-deletelink { + background-image: url(../img/admin/inline-restore.png); +} + +ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { + cursor: default; +} + +/* EDIT INLINE */ + +.inline-deletelink { + display: block; + text-indent: -9999px; + background: transparent url(../img/admin/inline-delete.png) no-repeat; + width: 15px; + height: 15px; + margin: 0.4em 0; + border: 0px none; +} + +.inline-deletelink:hover { + background-position: -15px 0; + cursor: pointer; +} + +.editinline button.addlink { + border: 0px none; + color: #5b80b2; + font-size: 100%; + cursor: pointer; +} + +.editinline button.addlink:hover { + color: #036; + cursor: pointer; +} + +.editinline table .help { + text-align: right; + float: right; + padding-left: 2em; +} + +.editinline tfoot .addlink { + white-space: nowrap; +} + +.editinline table thead th:last-child { + border-left: none; +} + +.editinline tr.deleted { + background: #ddd url(../img/admin/deleted-overlay.gif); +} + +.editinline tr.deleted .inline-deletelink { + background-image: url(../img/admin/inline-restore.png); +} + +.editinline tr.deleted td:hover { + cursor: default; +} + +.editinline tr.deleted td:first-child { + background-image: none !important; +} + +/* EDIT INLINE - STACKED */ + +.editinline-stacked { + min-width: 758px; +} + +.editinline-stacked .inline-object { + margin-left: 210px; + background: white; +} + +.editinline-stacked .inline-source { + float: left; + width: 200px; + background: #f8f8f8; +} + +.editinline-stacked .inline-splitter { + float: left; + width: 9px; + background: #f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat; + border-right: 1px solid #ccc; +} + +.editinline-stacked .controls { + clear: both; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + padding: 3px 4px; + font-size: 11px; + border-top: 1px solid #ddd; +} + diff --git a/media/admin/img/admin/arrow-down.gif b/media/admin/img/admin/arrow-down.gif new file mode 100644 index 0000000..a967b9f Binary files /dev/null and b/media/admin/img/admin/arrow-down.gif differ diff --git a/media/admin/img/admin/arrow-up.gif b/media/admin/img/admin/arrow-up.gif new file mode 100644 index 0000000..3fe4851 Binary files /dev/null and b/media/admin/img/admin/arrow-up.gif differ diff --git a/media/admin/img/admin/changelist-bg.gif b/media/admin/img/admin/changelist-bg.gif new file mode 100644 index 0000000..7f46994 Binary files /dev/null and b/media/admin/img/admin/changelist-bg.gif differ diff --git a/media/admin/img/admin/changelist-bg_rtl.gif b/media/admin/img/admin/changelist-bg_rtl.gif new file mode 100644 index 0000000..2379712 Binary files /dev/null and b/media/admin/img/admin/changelist-bg_rtl.gif differ diff --git a/media/admin/img/admin/chooser-bg.gif b/media/admin/img/admin/chooser-bg.gif new file mode 100644 index 0000000..30e83c2 Binary files /dev/null and b/media/admin/img/admin/chooser-bg.gif differ diff --git a/media/admin/img/admin/chooser_stacked-bg.gif b/media/admin/img/admin/chooser_stacked-bg.gif new file mode 100644 index 0000000..5d104b6 Binary files /dev/null and b/media/admin/img/admin/chooser_stacked-bg.gif differ diff --git a/media/admin/img/admin/default-bg-reverse.gif b/media/admin/img/admin/default-bg-reverse.gif new file mode 100644 index 0000000..0873281 Binary files /dev/null and b/media/admin/img/admin/default-bg-reverse.gif differ diff --git a/media/admin/img/admin/default-bg.gif b/media/admin/img/admin/default-bg.gif new file mode 100644 index 0000000..003aeca Binary files /dev/null and b/media/admin/img/admin/default-bg.gif differ diff --git a/media/admin/img/admin/deleted-overlay.gif b/media/admin/img/admin/deleted-overlay.gif new file mode 100644 index 0000000..dc3828f Binary files /dev/null and b/media/admin/img/admin/deleted-overlay.gif differ diff --git a/media/admin/img/admin/icon-no.gif b/media/admin/img/admin/icon-no.gif new file mode 100644 index 0000000..1b4ee58 Binary files /dev/null and b/media/admin/img/admin/icon-no.gif differ diff --git a/media/admin/img/admin/icon-unknown.gif b/media/admin/img/admin/icon-unknown.gif new file mode 100644 index 0000000..cfd2b02 Binary files /dev/null and b/media/admin/img/admin/icon-unknown.gif differ diff --git a/media/admin/img/admin/icon-yes.gif b/media/admin/img/admin/icon-yes.gif new file mode 100644 index 0000000..7399282 Binary files /dev/null and b/media/admin/img/admin/icon-yes.gif differ diff --git a/media/admin/img/admin/icon_addlink.gif b/media/admin/img/admin/icon_addlink.gif new file mode 100644 index 0000000..ee70e1a Binary files /dev/null and b/media/admin/img/admin/icon_addlink.gif differ diff --git a/media/admin/img/admin/icon_alert.gif b/media/admin/img/admin/icon_alert.gif new file mode 100644 index 0000000..a1dde26 Binary files /dev/null and b/media/admin/img/admin/icon_alert.gif differ diff --git a/media/admin/img/admin/icon_calendar.gif b/media/admin/img/admin/icon_calendar.gif new file mode 100644 index 0000000..7587b30 Binary files /dev/null and b/media/admin/img/admin/icon_calendar.gif differ diff --git a/media/admin/img/admin/icon_changelink.gif b/media/admin/img/admin/icon_changelink.gif new file mode 100644 index 0000000..e1b9afd Binary files /dev/null and b/media/admin/img/admin/icon_changelink.gif differ diff --git a/media/admin/img/admin/icon_clock.gif b/media/admin/img/admin/icon_clock.gif new file mode 100644 index 0000000..ff2d57e Binary files /dev/null and b/media/admin/img/admin/icon_clock.gif differ diff --git a/media/admin/img/admin/icon_deletelink.gif b/media/admin/img/admin/icon_deletelink.gif new file mode 100644 index 0000000..72523e3 Binary files /dev/null and b/media/admin/img/admin/icon_deletelink.gif differ diff --git a/media/admin/img/admin/icon_error.gif b/media/admin/img/admin/icon_error.gif new file mode 100644 index 0000000..3730a00 Binary files /dev/null and b/media/admin/img/admin/icon_error.gif differ diff --git a/media/admin/img/admin/icon_searchbox.png b/media/admin/img/admin/icon_searchbox.png new file mode 100644 index 0000000..8ab579e Binary files /dev/null and b/media/admin/img/admin/icon_searchbox.png differ diff --git a/media/admin/img/admin/icon_success.gif b/media/admin/img/admin/icon_success.gif new file mode 100644 index 0000000..5cf90a1 Binary files /dev/null and b/media/admin/img/admin/icon_success.gif differ diff --git a/media/admin/img/admin/inline-delete-8bit.png b/media/admin/img/admin/inline-delete-8bit.png new file mode 100644 index 0000000..95caf59 Binary files /dev/null and b/media/admin/img/admin/inline-delete-8bit.png differ diff --git a/media/admin/img/admin/inline-delete.png b/media/admin/img/admin/inline-delete.png new file mode 100644 index 0000000..d59bcd2 Binary files /dev/null and b/media/admin/img/admin/inline-delete.png differ diff --git a/media/admin/img/admin/inline-restore-8bit.png b/media/admin/img/admin/inline-restore-8bit.png new file mode 100644 index 0000000..e087c8e Binary files /dev/null and b/media/admin/img/admin/inline-restore-8bit.png differ diff --git a/media/admin/img/admin/inline-restore.png b/media/admin/img/admin/inline-restore.png new file mode 100644 index 0000000..efdd92a Binary files /dev/null and b/media/admin/img/admin/inline-restore.png differ diff --git a/media/admin/img/admin/inline-splitter-bg.gif b/media/admin/img/admin/inline-splitter-bg.gif new file mode 100644 index 0000000..32ac5b3 Binary files /dev/null and b/media/admin/img/admin/inline-splitter-bg.gif differ diff --git a/media/admin/img/admin/nav-bg-grabber.gif b/media/admin/img/admin/nav-bg-grabber.gif new file mode 100644 index 0000000..0a784fa Binary files /dev/null and b/media/admin/img/admin/nav-bg-grabber.gif differ diff --git a/media/admin/img/admin/nav-bg-reverse.gif b/media/admin/img/admin/nav-bg-reverse.gif new file mode 100644 index 0000000..f11029f Binary files /dev/null and b/media/admin/img/admin/nav-bg-reverse.gif differ diff --git a/media/admin/img/admin/nav-bg.gif b/media/admin/img/admin/nav-bg.gif new file mode 100644 index 0000000..f8402b8 Binary files /dev/null and b/media/admin/img/admin/nav-bg.gif differ diff --git a/media/admin/img/admin/selector-add.gif b/media/admin/img/admin/selector-add.gif new file mode 100644 index 0000000..50132d1 Binary files /dev/null and b/media/admin/img/admin/selector-add.gif differ diff --git a/media/admin/img/admin/selector-addall.gif b/media/admin/img/admin/selector-addall.gif new file mode 100644 index 0000000..d6e7c63 Binary files /dev/null and b/media/admin/img/admin/selector-addall.gif differ diff --git a/media/admin/img/admin/selector-remove.gif b/media/admin/img/admin/selector-remove.gif new file mode 100644 index 0000000..2b9b0a2 Binary files /dev/null and b/media/admin/img/admin/selector-remove.gif differ diff --git a/media/admin/img/admin/selector-removeall.gif b/media/admin/img/admin/selector-removeall.gif new file mode 100644 index 0000000..5a44219 Binary files /dev/null and b/media/admin/img/admin/selector-removeall.gif differ diff --git a/media/admin/img/admin/selector-search.gif b/media/admin/img/admin/selector-search.gif new file mode 100644 index 0000000..6d5f4c7 Binary files /dev/null and b/media/admin/img/admin/selector-search.gif differ diff --git a/media/admin/img/admin/selector_stacked-add.gif b/media/admin/img/admin/selector_stacked-add.gif new file mode 100644 index 0000000..7426169 Binary files /dev/null and b/media/admin/img/admin/selector_stacked-add.gif differ diff --git a/media/admin/img/admin/selector_stacked-remove.gif b/media/admin/img/admin/selector_stacked-remove.gif new file mode 100644 index 0000000..60412ce Binary files /dev/null and b/media/admin/img/admin/selector_stacked-remove.gif differ diff --git a/media/admin/img/admin/tool-left.gif b/media/admin/img/admin/tool-left.gif new file mode 100644 index 0000000..011490f Binary files /dev/null and b/media/admin/img/admin/tool-left.gif differ diff --git a/media/admin/img/admin/tool-left_over.gif b/media/admin/img/admin/tool-left_over.gif new file mode 100644 index 0000000..937e07b Binary files /dev/null and b/media/admin/img/admin/tool-left_over.gif differ diff --git a/media/admin/img/admin/tool-right.gif b/media/admin/img/admin/tool-right.gif new file mode 100644 index 0000000..cdc140c Binary files /dev/null and b/media/admin/img/admin/tool-right.gif differ diff --git a/media/admin/img/admin/tool-right_over.gif b/media/admin/img/admin/tool-right_over.gif new file mode 100644 index 0000000..4db977e Binary files /dev/null and b/media/admin/img/admin/tool-right_over.gif differ diff --git a/media/admin/img/admin/tooltag-add.gif b/media/admin/img/admin/tooltag-add.gif new file mode 100644 index 0000000..8b53d49 Binary files /dev/null and b/media/admin/img/admin/tooltag-add.gif differ diff --git a/media/admin/img/admin/tooltag-add_over.gif b/media/admin/img/admin/tooltag-add_over.gif new file mode 100644 index 0000000..bfc52f1 Binary files /dev/null and b/media/admin/img/admin/tooltag-add_over.gif differ diff --git a/media/admin/img/admin/tooltag-arrowright.gif b/media/admin/img/admin/tooltag-arrowright.gif new file mode 100644 index 0000000..cdaaae7 Binary files /dev/null and b/media/admin/img/admin/tooltag-arrowright.gif differ diff --git a/media/admin/img/admin/tooltag-arrowright_over.gif b/media/admin/img/admin/tooltag-arrowright_over.gif new file mode 100644 index 0000000..7163189 Binary files /dev/null and b/media/admin/img/admin/tooltag-arrowright_over.gif differ diff --git a/media/admin/img/gis/move_vertex_off.png b/media/admin/img/gis/move_vertex_off.png new file mode 100644 index 0000000..296b2e2 Binary files /dev/null and b/media/admin/img/gis/move_vertex_off.png differ diff --git a/media/admin/img/gis/move_vertex_on.png b/media/admin/img/gis/move_vertex_on.png new file mode 100644 index 0000000..21f4758 Binary files /dev/null and b/media/admin/img/gis/move_vertex_on.png differ diff --git a/media/admin/js/SelectBox.js b/media/admin/js/SelectBox.js new file mode 100644 index 0000000..f28c861 --- /dev/null +++ b/media/admin/js/SelectBox.js @@ -0,0 +1,111 @@ +var SelectBox = { + cache: new Object(), + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = new Array(); + var cache = SelectBox.cache[id]; + for (var i = 0; (node = box.options[i]); i++) { + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + box.options.length = 0; // clear all options + for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { + var node = SelectBox.cache[id][i]; + if (node.displayed) { + box.options[box.options.length] = new Option(node.text, node.value, false, false); + } + } + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + node.displayed = 1; + for (var j = 0; (token = tokens[j]); j++) { + if (node.text.toLowerCase().indexOf(token) == -1) { + node.displayed = 0; + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + delete_index = i; + break; + } + } + var j = SelectBox.cache[id].length - 1; + for (var i = delete_index; i < j; i++) { + SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; + } + SelectBox.cache[id].length--; + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (option.selected && SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort( function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) return 1; + if (a < b) return -1; + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + for (var i = 0; i < box.options.length; i++) { + box.options[i].selected = 'selected'; + } + } +} diff --git a/media/admin/js/SelectFilter2.js b/media/admin/js/SelectFilter2.js new file mode 100644 index 0000000..db946a6 --- /dev/null +++ b/media/admin/js/SelectFilter2.js @@ -0,0 +1,113 @@ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Different than SelectFilter because this is coupled to the admin framework. + +Requires core.js, SelectBox.js and addevent.js. +*/ + +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +var SelectFilter = { + init: function(field_id, field_name, is_stacked, admin_media_prefix) { + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + // Remove

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

+ var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
+ var selector_available = quickElement('div', selector_div, ''); + selector_available.className = 'selector-available'; + quickElement('h2', selector_available, interpolate(gettext('Available %s'), [field_name])); + var filter_p = quickElement('p', selector_available, ''); + filter_p.className = 'selector-filter'; + quickElement('img', filter_p, '', 'src', admin_media_prefix + 'img/admin/selector-search.gif'); + filter_p.appendChild(document.createTextNode(' ')); + var filter_input = quickElement('input', filter_p, '', 'type', 'text'); + filter_input.id = field_id + '_input'; + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); })()'); + choose_all.className = 'selector-chooseall'; + + //
    + var selector_chooser = quickElement('ul', selector_div, ''); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Add'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to");})()'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from");})()'); + remove_link.className = 'selector-remove'; + + //
    + var selector_chosen = quickElement('div', selector_div, ''); + selector_chosen.className = 'selector-chosen'; + quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name])); + var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click ')); + selector_filter.className = 'selector-filter'; + quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/admin/selector_stacked-add.gif':'img/admin/selector-add.gif'), 'alt', 'Add'); + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); }); + addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + }, + filter_key_up: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + return false; + } + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { + from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { + from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } +} diff --git a/media/admin/js/actions.js b/media/admin/js/actions.js new file mode 100644 index 0000000..b5e556a --- /dev/null +++ b/media/admin/js/actions.js @@ -0,0 +1,19 @@ +var Actions = { + init: function() { + selectAll = document.getElementById('action-toggle'); + if (selectAll) { + selectAll.style.display = 'inline'; + addEvent(selectAll, 'click', function() { + Actions.checker(selectAll.checked); + }); + } + }, + checker: function(checked) { + actionCheckboxes = document.getElementsBySelector('tr input.action-select'); + for(var i = 0; i < actionCheckboxes.length; i++) { + actionCheckboxes[i].checked = checked; + } + } +} + +addEvent(window, 'load', Actions.init); diff --git a/media/admin/js/admin/CollapsedFieldsets.js b/media/admin/js/admin/CollapsedFieldsets.js new file mode 100644 index 0000000..d66bec0 --- /dev/null +++ b/media/admin/js/admin/CollapsedFieldsets.js @@ -0,0 +1,85 @@ +// Finds all fieldsets with class="collapse", collapses them, and gives each +// one a "Show" link that uncollapses it. The "Show" link becomes a "Hide" +// link when the fieldset is visible. + +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +var CollapsedFieldsets = { + collapse_re: /\bcollapse\b/, // Class of fieldsets that should be dealt with. + collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden. + collapsed_class: 'collapsed', + init: function() { + var fieldsets = document.getElementsByTagName('fieldset'); + var collapsed_seen = false; + for (var i = 0, fs; fs = fieldsets[i]; i++) { + // Collapse this fieldset if it has the correct class, and if it + // doesn't have any errors. (Collapsing shouldn't apply in the case + // of error messages.) + if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) { + collapsed_seen = true; + // Give it an additional class, used by CSS to hide it. + fs.className += ' ' + CollapsedFieldsets.collapsed_class; + // (Show) + var collapse_link = document.createElement('a'); + collapse_link.className = 'collapse-toggle'; + collapse_link.id = 'fieldsetcollapser' + i; + collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;'); + collapse_link.href = '#'; + collapse_link.innerHTML = gettext('Show'); + var h2 = fs.getElementsByTagName('h2')[0]; + h2.appendChild(document.createTextNode(' (')); + h2.appendChild(collapse_link); + h2.appendChild(document.createTextNode(')')); + } + } + if (collapsed_seen) { + // Expand all collapsed fieldsets when form is submitted. + addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); }); + } + }, + fieldset_has_errors: function(fs) { + // Returns true if any fields in the fieldset have validation errors. + var divs = fs.getElementsByTagName('div'); + for (var i=0; i +// + +var DateTimeShortcuts = { + calendars: [], + calendarInputs: [], + clockInputs: [], + calendarDivName1: 'calendarbox', // name of calendar
    that gets toggled + calendarDivName2: 'calendarin', // name of
    that contains calendar + calendarLinkName: 'calendarlink',// name of the link that is used to toggle + clockDivName: 'clockbox', // name of clock
    that gets toggled + clockLinkName: 'clocklink', // name of the link that is used to toggle + admin_media_prefix: '', + init: function() { + // Deduce admin_media_prefix by looking at the + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/media/js/tiny_mce/plugins/advimage/css/advimage.css b/media/js/tiny_mce/plugins/advimage/css/advimage.css new file mode 100644 index 0000000..0a6251a --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/media/js/tiny_mce/plugins/advimage/editor_plugin.js b/media/js/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100644 index 0000000..4c7a9c3 --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advimage/editor_plugin_src.js b/media/js/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100644 index 0000000..f526842 --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -0,0 +1,47 @@ +/** + * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advimage/image.htm b/media/js/tiny_mce/plugins/advimage/image.htm new file mode 100644 index 0000000..5d26150 --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/image.htm @@ -0,0 +1,237 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + +
    + + +
    +
    +
    + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    + +
    + {#advimage_dlg.preview} + +
    +
    + +
    +
    + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + {#advimage_dlg.example_img} + Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam + nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam + erat volutpat. +
    +
    + x + px +
      + + + + +
    +
    +
    +
    + +
    +
    + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + + + + +
     
    +
    + +
    + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
     
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/media/js/tiny_mce/plugins/advimage/img/sample.gif b/media/js/tiny_mce/plugins/advimage/img/sample.gif new file mode 100644 index 0000000..53bf689 Binary files /dev/null and b/media/js/tiny_mce/plugins/advimage/img/sample.gif differ diff --git a/media/js/tiny_mce/plugins/advimage/js/image.js b/media/js/tiny_mce/plugins/advimage/js/image.js new file mode 100644 index 0000000..3477226 --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/js/image.js @@ -0,0 +1,443 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', 'tinyMCEImageList'); + this.fillFileList('over_list', 'tinyMCEImageList'); + this.fillFileList('out_list', 'tinyMCEImageList'); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value, + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = '0'; + else + img.style.border = v + 'px solid black'; + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/media/js/tiny_mce/plugins/advimage/langs/en_dlg.js b/media/js/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100644 index 0000000..f493d19 --- /dev/null +++ b/media/js/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -0,0 +1,43 @@ +tinyMCE.addI18n('en.advimage_dlg',{ +tab_general:"General", +tab_appearance:"Appearance", +tab_advanced:"Advanced", +general:"General", +title:"Title", +preview:"Preview", +constrain_proportions:"Constrain proportions", +langdir:"Language direction", +langcode:"Language code", +long_desc:"Long description link", +style:"Style", +classes:"Classes", +ltr:"Left to right", +rtl:"Right to left", +id:"Id", +map:"Image map", +swap_image:"Swap image", +alt_image:"Alternative image", +mouseover:"for mouse over", +mouseout:"for mouse out", +misc:"Miscellaneous", +example_img:"Appearance preview image", +missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", +dialog_title:"Insert/edit image", +src:"Image URL", +alt:"Image description", +list:"Image list", +border:"Border", +dimensions:"Dimensions", +vspace:"Vertical space", +hspace:"Horizontal space", +align:"Alignment", +align_baseline:"Baseline", +align_top:"Top", +align_middle:"Middle", +align_bottom:"Bottom", +align_texttop:"Text top", +align_textbottom:"Text bottom", +align_left:"Left", +align_right:"Right", +image_list:"Image list" +}); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advlink/css/advlink.css b/media/js/tiny_mce/plugins/advlink/css/advlink.css new file mode 100644 index 0000000..1436431 --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/media/js/tiny_mce/plugins/advlink/editor_plugin.js b/media/js/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100644 index 0000000..983fe5a --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advlink/editor_plugin_src.js b/media/js/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100644 index 0000000..fc5325a --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -0,0 +1,58 @@ +/** + * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advlink/js/advlink.js b/media/js/tiny_mce/plugins/advlink/js/advlink.js new file mode 100644 index 0000000..bb7922a --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/js/advlink.js @@ -0,0 +1,528 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); + document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', inst.dom.getAttrib(elm, 'target')); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i'; + html += ''; + + for (i=0; i' + name + ''; + } + + html += ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/media/js/tiny_mce/plugins/advlink/langs/en_dlg.js b/media/js/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100644 index 0000000..c71ffbd --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -0,0 +1,52 @@ +tinyMCE.addI18n('en.advlink_dlg',{ +title:"Insert/edit link", +url:"Link URL", +target:"Target", +titlefield:"Title", +is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", +is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", +list:"Link list", +general_tab:"General", +popup_tab:"Popup", +events_tab:"Events", +advanced_tab:"Advanced", +general_props:"General properties", +popup_props:"Popup properties", +event_props:"Events", +advanced_props:"Advanced properties", +popup_opts:"Options", +anchor_names:"Anchors", +target_same:"Open in this window / frame", +target_parent:"Open in parent window / frame", +target_top:"Open in top frame (replaces all frames)", +target_blank:"Open in new window", +popup:"Javascript popup", +popup_url:"Popup URL", +popup_name:"Window name", +popup_return:"Insert 'return false'", +popup_scrollbars:"Show scrollbars", +popup_statusbar:"Show status bar", +popup_toolbar:"Show toolbars", +popup_menubar:"Show menu bar", +popup_location:"Show location bar", +popup_resizable:"Make window resizable", +popup_dependent:"Dependent (Mozilla/Firefox only)", +popup_size:"Size", +popup_position:"Position (X/Y)", +id:"Id", +style:"Style", +classes:"Classes", +target_name:"Target name", +langdir:"Language direction", +target_langcode:"Target language", +langcode:"Language code", +encoding:"Target character encoding", +mime:"Target MIME type", +rel:"Relationship page to target", +rev:"Relationship target to page", +tabindex:"Tabindex", +accesskey:"Accesskey", +ltr:"Left to right", +rtl:"Right to left", +link_list:"Link list" +}); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/advlink/link.htm b/media/js/tiny_mce/plugins/advlink/link.htm new file mode 100644 index 0000000..cc8b0b8 --- /dev/null +++ b/media/js/tiny_mce/plugins/advlink/link.htm @@ -0,0 +1,338 @@ + + + + {#advlink_dlg.title} + + + + + + + + +
    + + +
    +
    +
    + {#advlink_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + +
    +
    +
    + + + +
    +
    + {#advlink_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + {#advlink_dlg.event_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/media/js/tiny_mce/plugins/autoresize/editor_plugin.js b/media/js/tiny_mce/plugins/autoresize/editor_plugin.js new file mode 100644 index 0000000..220b84a --- /dev/null +++ b/media/js/tiny_mce/plugins/autoresize/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/autoresize/editor_plugin_src.js b/media/js/tiny_mce/plugins/autoresize/editor_plugin_src.js new file mode 100644 index 0000000..8b2f374 --- /dev/null +++ b/media/js/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -0,0 +1,114 @@ +/** + * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + /** + * Auto Resize + * + * This plugin automatically resizes the content area to fit its content height. + * It will retain a minimum height, which is the height of the content area when + * it's initialized. + */ + tinymce.create('tinymce.plugins.AutoResizePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var t = this; + + if (ed.getParam('fullscreen_is_enabled')) + return; + + /** + * This method gets executed each time the editor needs to resize. + */ + function resize() { + var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; + + // Get height differently depending on the browser used + myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight; + + // Don't make it smaller than the minimum height + if (myHeight > t.autoresize_min_height) + resizeHeight = myHeight; + + // Resize content element + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + + // if we're throbbing, we'll re-throb to match the new size + if (t.throbbing) { + ed.setProgressState(false); + ed.setProgressState(true); + } + }; + + t.editor = ed; + + // Define minimum height + t.autoresize_min_height = ed.getElement().offsetHeight; + + // Things to do when the editor is ready + ed.onInit.add(function(ed, l) { + // Show throbber until content area is resized properly + ed.setProgressState(true); + t.throbbing = true; + + // Hide scrollbars + ed.getBody().style.overflowY = "hidden"; + }); + + // Add appropriate listeners for resizing content area + ed.onChange.add(resize); + ed.onSetContent.add(resize); + ed.onPaste.add(resize); + ed.onKeyUp.add(resize); + ed.onPostRender.add(resize); + + ed.onLoadContent.add(function(ed, l) { + resize(); + + // Because the content area resizes when its content CSS loads, + // and we can't easily add a listener to its onload event, + // we'll just trigger a resize after a short loading period + setTimeout(function() { + resize(); + + // Disable throbber + ed.setProgressState(false); + t.throbbing = false; + }, 1250); + }); + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceAutoResize', resize); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto Resize', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/autosave/editor_plugin.js b/media/js/tiny_mce/plugins/autosave/editor_plugin.js new file mode 100644 index 0000000..091a063 --- /dev/null +++ b/media/js/tiny_mce/plugins/autosave/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutoSavePlugin",{init:function(a,b){var c=this;c.editor=a;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:tinymce.majorVersion+"."+tinymce.minorVersion}},"static":{_beforeUnloadHandler:function(){var a;tinymce.each(tinyMCE.editors,function(b){if(b.getParam("fullscreen_is_enabled")){return}if(b.isDirty()){a=b.getLang("autosave.unload_msg");return false}});return a}}});tinymce.PluginManager.add("autosave",tinymce.plugins.AutoSavePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/autosave/editor_plugin_src.js b/media/js/tiny_mce/plugins/autosave/editor_plugin_src.js new file mode 100644 index 0000000..3c4325a --- /dev/null +++ b/media/js/tiny_mce/plugins/autosave/editor_plugin_src.js @@ -0,0 +1,51 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.AutoSavePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; + }, + + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + 'static' : { + _beforeUnloadHandler : function() { + var msg; + + tinymce.each(tinyMCE.editors, function(ed) { + if (ed.getParam("fullscreen_is_enabled")) + return; + + if (ed.isDirty()) { + msg = ed.getLang("autosave.unload_msg"); + return false; + } + }); + + return msg; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/bbcode/editor_plugin.js b/media/js/tiny_mce/plugins/bbcode/editor_plugin.js new file mode 100644 index 0000000..930fdff --- /dev/null +++ b/media/js/tiny_mce/plugins/bbcode/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
    /gi,"\n");b(//gi,"\n");b(/
    /gi,"\n");b(/

    /gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
    ");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/bbcode/editor_plugin_src.js b/media/js/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 0000000..1d7493e --- /dev/null +++ b/media/js/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -0,0 +1,117 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
    /gi,"\n"); + rep(//gi,"\n"); + rep(/
    /gi,"\n"); + rep(/

    /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ /gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
    "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/contextmenu/editor_plugin.js b/media/js/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 0000000..24ee2eb --- /dev/null +++ b/media/js/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/media/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 0000000..a2c1866 --- /dev/null +++ b/media/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,95 @@ +/** + * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.ContextMenu', { + init : function(ed) { + var t = this; + + t.editor = ed; + t.onContextMenu = new tinymce.util.Dispatcher(this); + + ed.onContextMenu.add(function(ed, e) { + if (!e.ctrlKey) { + t._getMenu(ed).showMenu(e.clientX, e.clientY); + Event.add(ed.getDoc(), 'click', hide); + Event.cancel(e); + } + }); + + function hide() { + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + }, + + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1 + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/directionality/editor_plugin.js b/media/js/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100644 index 0000000..bce8e73 --- /dev/null +++ b/media/js/tiny_mce/plugins/directionality/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/directionality/editor_plugin_src.js b/media/js/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100644 index 0000000..81818e3 --- /dev/null +++ b/media/js/tiny_mce/plugins/directionality/editor_plugin_src.js @@ -0,0 +1,79 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + ed.addCommand('mceDirectionLTR', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "ltr") + ed.dom.setAttrib(e, "dir", "ltr"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addCommand('mceDirectionRTL', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "rtl") + ed.dom.setAttrib(e, "dir", "rtl"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/emotions/editor_plugin.js b/media/js/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100644 index 0000000..4783bc3 --- /dev/null +++ b/media/js/tiny_mce/plugins/emotions/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.EmotionsPlugin",{init:function(a,b){a.addCommand("mceEmotion",function(){a.windowManager.open({file:b+"/emotions.htm",width:250+parseInt(a.getLang("emotions.delta_width",0)),height:160+parseInt(a.getLang("emotions.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("emotions",tinymce.plugins.EmotionsPlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/emotions/editor_plugin_src.js b/media/js/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 0000000..df0d370 --- /dev/null +++ b/media/js/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,40 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/emotions/emotions.htm b/media/js/tiny_mce/plugins/emotions/emotions.htm new file mode 100644 index 0000000..55a1d72 --- /dev/null +++ b/media/js/tiny_mce/plugins/emotions/emotions.htm @@ -0,0 +1,40 @@ + + + + {#emotions_dlg.title} + + + + +

    +
    {#emotions_dlg.title}:

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {#emotions_dlg.cool}{#emotions_dlg.cry}{#emotions_dlg.embarassed}{#emotions_dlg.foot_in_mouth}
    {#emotions_dlg.frown}{#emotions_dlg.innocent}{#emotions_dlg.kiss}{#emotions_dlg.laughing}
    {#emotions_dlg.money_mouth}{#emotions_dlg.sealed}{#emotions_dlg.smile}{#emotions_dlg.surprised}
    {#emotions_dlg.tongue-out}{#emotions_dlg.undecided}{#emotions_dlg.wink}{#emotions_dlg.yell}
    +
    + + diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-cool.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 0000000..ba90cc3 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-cool.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-cry.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 0000000..74d897a Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-cry.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 0000000..963a96b Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 0000000..16f68cc Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-frown.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 0000000..716f55e Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-frown.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 0000000..334d49e Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 0000000..4efd549 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 0000000..1606c11 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 0000000..ca2451e Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 0000000..b33d3cc Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-smile.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 0000000..e6a9e60 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-smile.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 0000000..cb99cdd Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 0000000..2075dc1 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 0000000..bef7e25 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-wink.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 0000000..9faf1af Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-wink.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/img/smiley-yell.gif b/media/js/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 0000000..648e6e8 Binary files /dev/null and b/media/js/tiny_mce/plugins/emotions/img/smiley-yell.gif differ diff --git a/media/js/tiny_mce/plugins/emotions/js/emotions.js b/media/js/tiny_mce/plugins/emotions/js/emotions.js new file mode 100644 index 0000000..c549367 --- /dev/null +++ b/media/js/tiny_mce/plugins/emotions/js/emotions.js @@ -0,0 +1,22 @@ +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/media/js/tiny_mce/plugins/emotions/langs/en_dlg.js b/media/js/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100644 index 0000000..3b57ad9 --- /dev/null +++ b/media/js/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n('en.emotions_dlg',{ +title:"Insert emotion", +desc:"Emotions", +cool:"Cool", +cry:"Cry", +embarassed:"Embarassed", +foot_in_mouth:"Foot in mouth", +frown:"Frown", +innocent:"Innocent", +kiss:"Kiss", +laughing:"Laughing", +money_mouth:"Money mouth", +sealed:"Sealed", +smile:"Smile", +surprised:"Surprised", +tongue_out:"Tongue out", +undecided:"Undecided", +wink:"Wink", +yell:"Yell" +}); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/example/dialog.htm b/media/js/tiny_mce/plugins/example/dialog.htm new file mode 100644 index 0000000..b4c6284 --- /dev/null +++ b/media/js/tiny_mce/plugins/example/dialog.htm @@ -0,0 +1,27 @@ + + + + {#example_dlg.title} + + + + + +
    +

    Here is a example dialog.

    +

    Selected text:

    +

    Custom arg:

    + +
    +
    + +
    + +
    + +
    +
    +
    + + + diff --git a/media/js/tiny_mce/plugins/example/editor_plugin.js b/media/js/tiny_mce/plugins/example/editor_plugin.js new file mode 100644 index 0000000..ec1f81e --- /dev/null +++ b/media/js/tiny_mce/plugins/example/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/example/editor_plugin_src.js b/media/js/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100644 index 0000000..5050550 --- /dev/null +++ b/media/js/tiny_mce/plugins/example/editor_plugin_src.js @@ -0,0 +1,81 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/example/img/example.gif b/media/js/tiny_mce/plugins/example/img/example.gif new file mode 100644 index 0000000..1ab5da4 Binary files /dev/null and b/media/js/tiny_mce/plugins/example/img/example.gif differ diff --git a/media/js/tiny_mce/plugins/example/js/dialog.js b/media/js/tiny_mce/plugins/example/js/dialog.js new file mode 100644 index 0000000..fa83411 --- /dev/null +++ b/media/js/tiny_mce/plugins/example/js/dialog.js @@ -0,0 +1,19 @@ +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/media/js/tiny_mce/plugins/example/langs/en.js b/media/js/tiny_mce/plugins/example/langs/en.js new file mode 100644 index 0000000..e0784f8 --- /dev/null +++ b/media/js/tiny_mce/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/media/js/tiny_mce/plugins/example/langs/en_dlg.js b/media/js/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100644 index 0000000..ebcf948 --- /dev/null +++ b/media/js/tiny_mce/plugins/example/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/media/js/tiny_mce/plugins/fullpage/css/fullpage.css b/media/js/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100644 index 0000000..7a3334f --- /dev/null +++ b/media/js/tiny_mce/plugins/fullpage/css/fullpage.css @@ -0,0 +1,182 @@ +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.addbutton, .removebutton, .moveupbutton, .movedownbutton { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: default; + display: block; + width: 20px; + height: 20px; +} + +#doctypes { + width: 200px; +} + +.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.addbutton { + background-image: url('../images/add.gif'); + float: left; + margin-right: 3px; +} + +.removebutton { + background-image: url('../images/remove.gif'); + float: left; +} + +.moveupbutton { + background-image: url('../images/move_up.gif'); + float: left; + margin-right: 3px; +} + +.movedownbutton { + background-image: url('../images/move_down.gif'); + float: left; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + +.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/fullpage/editor_plugin.js b/media/js/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100644 index 0000000..8e11bfc --- /dev/null +++ b/media/js/tiny_mce/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n\n"+d.getParam("fullpage_default_title","Untitled document")+"\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n\n";h.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/fullpage/editor_plugin_src.js b/media/js/tiny_mce/plugins/fullpage/editor_plugin_src.js new file mode 100644 index 0000000..c7d5aca --- /dev/null +++ b/media/js/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -0,0 +1,146 @@ +/** + * $Id: editor_plugin_src.js 1029 2009-02-24 22:32:21Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + head_html : t.head + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onSetContent.add(t._setBodyAttribs, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _setBodyAttribs : function(ed, o) { + var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); + + if (attr && attr[1]) { + bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); + + if (bdattr) { + for(i = 0, len = bdattr.length; i < len; i++) { + kv = bdattr[i].split('='); + k = kv[0].replace(/\s/,''); + v = kv[1]; + + if (v) { + v = v.replace(/^\s+/,'').replace(/\s+$/,''); + t = v.match(/^["'](.*)["']$/); + + if (t) + v = t[1]; + } else + v = k; + + ed.dom.setAttrib(ed.getBody(), 'style', v); + } + } + } + }, + + _createSerializer : function() { + return new tinymce.dom.Serializer({ + dom : this.editor.dom, + apply_source_formatting : true + }); + }, + + _setContent : function(ed, o) { + var t = this, sp, ep, c = o.content, v, st = ''; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + c = c.replace(/<(\/?)BODY/gi, '<$1body'); + sp = c.indexOf('', sp); + t.head = c.substring(0, sp + 1); + + ep = c.indexOf('\n'; + + t.head += ed.getParam('fullpage_default_doctype', ''); + t.head += '\n\n\n' + ed.getParam('fullpage_default_title', 'Untitled document') + '\n'; + + if (v = ed.getParam('fullpage_default_encoding')) + t.head += '\n'; + + if (v = ed.getParam('fullpage_default_font_family')) + st += 'font-family: ' + v + ';'; + + if (v = ed.getParam('fullpage_default_font_size')) + st += 'font-size: ' + v + ';'; + + if (v = ed.getParam('fullpage_default_text_color')) + st += 'color: ' + v + ';'; + + t.head += '\n\n'; + t.foot = '\n\n'; + } + }, + + _getContent : function(ed, o) { + var t = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/fullpage/fullpage.htm b/media/js/tiny_mce/plugins/fullpage/fullpage.htm new file mode 100644 index 0000000..3ea4081 --- /dev/null +++ b/media/js/tiny_mce/plugins/fullpage/fullpage.htm @@ -0,0 +1,576 @@ + + + + {#fullpage_dlg.title} + + + + + + + +
    + + +
    +
    +
    + {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
     
     
     
      + +
    +
    + +
    + {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
    + +
      + +
     
    + +
     
    +
    +
    + +
    +
    + {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    +
    + +
    + {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    + +
    + {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
    +
    + +
    + {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
      
    +
    + +
    + {#fullpage_dlg.appearance_style} + + + + + + + + + + +
    + + + + +
     
    +
    +
    + +
    + + +
    + {#fullpage_dlg.head_elements} + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + {#fullpage_dlg.meta_element} + + + + + + + + + + + + + + +
    + + +
    + +
    + {#fullpage_dlg.title_element} + + + + + + +
    + + +
    + +
    + {#fullpage_dlg.script_element} + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    + +
    + +
    +
    + + +
    + +
    + {#fullpage_dlg.style_element} + + + +
    + +
    +
    + + + + + + + + + +
    +
    + +
    + +
    +
    + + +
    + +
    + {#fullpage_dlg.base_element} + + + + + + + + + + +
    + + +
    + + + +
    + {#fullpage_dlg.comment_element} + + + + +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/media/js/tiny_mce/plugins/fullpage/js/fullpage.js b/media/js/tiny_mce/plugins/fullpage/js/fullpage.js new file mode 100644 index 0000000..dd3a29c --- /dev/null +++ b/media/js/tiny_mce/plugins/fullpage/js/fullpage.js @@ -0,0 +1,461 @@ +tinyMCEPopup.requireLangPack(); + +var doc; + +var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + +var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + +var defaultMediaTypes = + 'all=all,' + + 'screen=screen,' + + 'print=print,' + + 'tty=tty,' + + 'tv=tv,' + + 'projection=projection,' + + 'handheld=handheld,' + + 'braille=braille,' + + 'aural=aural'; + +var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; +var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + +function init() { + var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; + + // Setup doctype select box + doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i=0; i 1) + addSelectValue(f, 'doctypes', p[0], p[1]); + } + + // Setup fonts select box + fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i=0; i 1) + addSelectValue(f, 'fontface', p[0], p[1]); + } + + // Setup fontsize select box + fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i=0; i 1) { + addSelectValue(f, 'element_style_media', p[0], p[1]); + addSelectValue(f, 'element_link_media', p[0], p[1]); + } + } + + // Setup encodings select box + encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i=0; i 1) { + addSelectValue(f, 'docencoding', p[0], p[1]); + addSelectValue(f, 'element_script_charset', p[0], p[1]); + addSelectValue(f, 'element_link_charset', p[0], p[1]); + } + } + + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); + document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Add iframe + dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); + doc = dom.get('documentIframe').contentWindow.document; + h = tinyMCEPopup.getWindowArg('head_html'); + + // Preprocess the HTML disable scripts and urls + h = h.replace(/ + + + +
    + +
    + + + + + diff --git a/media/js/tiny_mce/plugins/iespell/editor_plugin.js b/media/js/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100644 index 0000000..e9cba10 --- /dev/null +++ b/media/js/tiny_mce/plugins/iespell/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/iespell/editor_plugin_src.js b/media/js/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 0000000..a68f69a --- /dev/null +++ b/media/js/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,51 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.IESpell', { + init : function(ed, url) { + var t = this, sp; + + if (!tinymce.isIE) + return; + + t.editor = ed; + + // Register commands + ed.addCommand('mceIESpell', function() { + try { + sp = new ActiveXObject("ieSpell.ieSpellExtension"); + sp.CheckDocumentNode(ed.getDoc().documentElement); + } catch (e) { + if (e.number == -2146827859) { + ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { + if (s) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + }); + } else + ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); + } + }); + + // Register buttons + ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); + }, + + getInfo : function() { + return { + longname : 'IESpell (IE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/inlinepopups/editor_plugin.js b/media/js/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100644 index 0000000..07ea477 --- /dev/null +++ b/media/js/tiny_mce/plugins/inlinepopups/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","
    "))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/media/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100644 index 0000000..fffca5a --- /dev/null +++ b/media/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -0,0 +1,632 @@ +/** + * $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
    ')); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + + if (fw) + t.focus(fw.id); + } + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100644 index 0000000..94abd08 Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100644 index 0000000..e671094 Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100644 index 0000000..6baf64a Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100644 index 0000000..497307a Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100644 index 0000000..c894b2e Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100644 index 0000000..c2a2ad4 Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100644 index 0000000..43a735f Binary files /dev/null and b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ diff --git a/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100644 index 0000000..5e6fd7d --- /dev/null +++ b/media/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -0,0 +1,90 @@ +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/inlinepopups/template.htm b/media/js/tiny_mce/plugins/inlinepopups/template.htm new file mode 100644 index 0000000..f9ec642 --- /dev/null +++ b/media/js/tiny_mce/plugins/inlinepopups/template.htm @@ -0,0 +1,387 @@ + + + +Template for dialogs + + + + +
    +
    +
    +
    +
    +
    +
    + Blured +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Focused +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Statusbar +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Statusbar, Resizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Resizable, Maximizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Blurred, Maximizable, Statusbar, Resizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Maximized, Maximizable, Minimizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Blured +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Alert +
    + +
    +
    + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
    +
    +
    + +
    +
    +
    +
    +
    + + + Ok + +
    +
    + +
    +
    +
    +
    +
    +
    + Confirm +
    + +
    +
    + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
    +
    +
    + +
    +
    +
    +
    +
    + + + Ok + Cancel + +
    +
    +
    + + + diff --git a/media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js b/media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js new file mode 100644 index 0000000..938ce6b --- /dev/null +++ b/media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;fg[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/layer/editor_plugin_src.js b/media/js/tiny_mce/plugins/layer/editor_plugin_src.js new file mode 100644 index 0000000..a72f6c3 --- /dev/null +++ b/media/js/tiny_mce/plugins/layer/editor_plugin_src.js @@ -0,0 +1,209 @@ +/** + * $Id: editor_plugin_src.js 652 2008-02-29 13:09:46Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Layer', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceInsertLayer', t._insertLayer, t); + + ed.addCommand('mceMoveForward', function() { + t._move(1); + }); + + ed.addCommand('mceMoveBackward', function() { + t._move(-1); + }); + + ed.addCommand('mceMakeAbsolute', function() { + t._toggleAbsolute(); + }); + + // Register buttons + ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); + ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); + ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); + ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); + + ed.onInit.add(function() { + if (tinymce.isIE) + ed.getDoc().execCommand('2D-Position', false, true); + }); + + ed.onNodeChange.add(t._nodeChange, t); + ed.onVisualAid.add(t._visualAid, t); + }, + + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var le, p; + + le = this._getParentLayer(n); + p = ed.dom.getParent(n, 'DIV,P,IMG'); + + if (!p) { + cm.setDisabled('absolute', 1); + cm.setDisabled('moveforward', 1); + cm.setDisabled('movebackward', 1); + } else { + cm.setDisabled('absolute', 0); + cm.setDisabled('moveforward', !le); + cm.setDisabled('movebackward', !le); + cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); + } + }, + + // Private methods + + _visualAid : function(ed, e, s) { + var dom = ed.dom; + + tinymce.each(dom.select('div,p', e), function(e) { + if (/^(absolute|relative|static)$/i.test(e.style.position)) { + if (s) + dom.addClass(e, 'mceItemVisualAid'); + else + dom.removeClass(e, 'mceItemVisualAid'); + } + }); + }, + + _move : function(d) { + var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; + + nl = []; + tinymce.walk(ed.getBody(), function(n) { + if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) + nl.push(n); + }, 'childNodes'); + + // Find z-indexes + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + ed.execCommand('mceRepaint'); + }, + + _getParentLayer : function(n) { + return this.editor.dom.getParent(n, function(n) { + return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); + }); + }, + + _insertLayer : function() { + var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); + + ed.dom.add(ed.getBody(), 'div', { + style : { + position : 'absolute', + left : p.x, + top : (p.y > 20 ? p.y : 20), + width : 100, + height : 100 + }, + 'class' : 'mceItemVisualAid' + }, ed.selection.getContent() || ed.getLang('layer.content')); + }, + + _toggleAbsolute : function() { + var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); + + if (!le) + le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + ed.dom.setStyles(le, { + position : '', + left : '', + top : '', + width : '', + height : '' + }); + + ed.dom.removeClass(le, 'mceItemVisualAid'); + } else { + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + le.style.position = "absolute"; + ed.addVisual(ed.getBody()); + } + + ed.execCommand('mceRepaint'); + ed.nodeChanged(); + } + } + }); + + // Register plugin + tinymce.PluginManager.add('layer', tinymce.plugins.Layer); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/media/css/content.css b/media/js/tiny_mce/plugins/media/css/content.css new file mode 100644 index 0000000..1bf6a75 --- /dev/null +++ b/media/js/tiny_mce/plugins/media/css/content.css @@ -0,0 +1,6 @@ +.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} +.mceItemShockWave {background-image: url(../img/shockwave.gif);} +.mceItemFlash {background-image:url(../img/flash.gif);} +.mceItemQuickTime {background-image:url(../img/quicktime.gif);} +.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} +.mceItemRealMedia {background-image:url(../img/realmedia.gif);} diff --git a/media/js/tiny_mce/plugins/media/css/media.css b/media/js/tiny_mce/plugins/media/css/media.css new file mode 100644 index 0000000..2d08794 --- /dev/null +++ b/media/js/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,16 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } +.panel_wrapper div.current { height: 390px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } diff --git a/media/js/tiny_mce/plugins/media/editor_plugin.js b/media/js/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 0000000..2889be5 --- /dev/null +++ b/media/js/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j=''; + } + + return im; + }); + } + }); + }, + + getInfo : function() { + return { + longname : 'Media', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + _objectsToSpans : function(ed, o) { + var t = this, h = o.content; + + h = h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { + var o = t._parse(c); + + return '' + }); + + h = h.replace(/]*)>/gi, ''); + h = h.replace(/]*)\/?>/gi, ''); + h = h.replace(/]*)>/gi, ''); + h = h.replace(/<\/(object)([^>]*)>/gi, ''); + h = h.replace(/<\/embed>/gi, ''); + h = h.replace(/]*)>/gi, function(a, b) {return ''}); + h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam">'); + + o.content = h; + }, + + _buildObj : function(o, n) { + var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; + + stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; + + p.width = o.width = dom.getAttrib(n, 'width') || 100; + p.height = o.height = dom.getAttrib(n, 'height') || 100; + + if (p.src) + p.src = ed.convertURL(p.src, 'src', n); + + if (stc) { + ob = dom.create('span', { + id : p.id, + mce_name : 'object', + type : 'application/x-shockwave-flash', + data : p.src, + style : dom.getAttrib(n, 'style'), + width : o.width, + height : o.height + }); + } else { + ob = dom.create('span', { + id : p.id, + mce_name : 'object', + classid : "clsid:" + o.classid, + style : dom.getAttrib(n, 'style'), + codebase : o.codebase, + width : o.width, + height : o.height + }); + } + + each (p, function(v, k) { + if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { + // Use url instead of src in IE for Windows media + if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) + k = 'url'; + + if (v) + dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); + } + }); + + if (!stc) + dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); + + return ob; + }, + + _spansToImgs : function(p) { + var t = this, dom = t.editor.dom, im, ci; + + each(dom.select('span', p), function(n) { + // Convert object into image + if (dom.getAttrib(n, 'class') == 'mceItemObject') { + ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); + + switch (ci) { + case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': + dom.replace(t._createImg('mceItemFlash', n), n); + break; + + case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': + dom.replace(t._createImg('mceItemShockWave', n), n); + break; + + case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': + case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': + case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': + dom.replace(t._createImg('mceItemWindowsMedia', n), n); + break; + + case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': + dom.replace(t._createImg('mceItemQuickTime', n), n); + break; + + case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': + dom.replace(t._createImg('mceItemRealMedia', n), n); + break; + + default: + dom.replace(t._createImg('mceItemFlash', n), n); + } + + return; + } + + // Convert embed into image + if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { + switch (dom.getAttrib(n, 'type')) { + case 'application/x-shockwave-flash': + dom.replace(t._createImg('mceItemFlash', n), n); + break; + + case 'application/x-director': + dom.replace(t._createImg('mceItemShockWave', n), n); + break; + + case 'application/x-mplayer2': + dom.replace(t._createImg('mceItemWindowsMedia', n), n); + break; + + case 'video/quicktime': + dom.replace(t._createImg('mceItemQuickTime', n), n); + break; + + case 'audio/x-pn-realaudio-plugin': + dom.replace(t._createImg('mceItemRealMedia', n), n); + break; + + default: + dom.replace(t._createImg('mceItemFlash', n), n); + } + } + }); + }, + + _createImg : function(cl, n) { + var im, dom = this.editor.dom, pa = {}, ti = '', args; + + args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; + + // Create image + im = dom.create('img', { + src : this.url + '/img/trans.gif', + width : dom.getAttrib(n, 'width') || 100, + height : dom.getAttrib(n, 'height') || 100, + style : dom.getAttrib(n, 'style'), + 'class' : cl + }); + + // Setup base parameters + each(args, function(na) { + var v = dom.getAttrib(n, na); + + if (v) + pa[na] = v; + }); + + // Add optional parameters + each(dom.select('span', n), function(n) { + if (dom.hasClass(n, 'mceItemParam')) + pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); + }); + + // Use src not movie + if (pa.movie) { + pa.src = pa.movie; + delete pa.movie; + } + + // No src try data + if (!pa.src) { + pa.src = pa.data; + delete pa.data; + } + + // Merge with embed args + n = dom.select('.mceItemEmbed', n)[0]; + if (n) { + each(args, function(na) { + var v = dom.getAttrib(n, na); + + if (v && !pa[na]) + pa[na] = v; + }); + } + + delete pa.width; + delete pa.height; + + im.title = this._serialize(pa); + + return im; + }, + + _parse : function(s) { + return tinymce.util.JSON.parse('{' + s + '}'); + }, + + _serialize : function(o) { + return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/media/img/flash.gif b/media/js/tiny_mce/plugins/media/img/flash.gif new file mode 100644 index 0000000..cb192e6 Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/flash.gif differ diff --git a/media/js/tiny_mce/plugins/media/img/flv_player.swf b/media/js/tiny_mce/plugins/media/img/flv_player.swf new file mode 100644 index 0000000..042c2ab Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/flv_player.swf differ diff --git a/media/js/tiny_mce/plugins/media/img/quicktime.gif b/media/js/tiny_mce/plugins/media/img/quicktime.gif new file mode 100644 index 0000000..3b04991 Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/quicktime.gif differ diff --git a/media/js/tiny_mce/plugins/media/img/realmedia.gif b/media/js/tiny_mce/plugins/media/img/realmedia.gif new file mode 100644 index 0000000..fdfe0b9 Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/realmedia.gif differ diff --git a/media/js/tiny_mce/plugins/media/img/shockwave.gif b/media/js/tiny_mce/plugins/media/img/shockwave.gif new file mode 100644 index 0000000..5f235df Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/shockwave.gif differ diff --git a/media/js/tiny_mce/plugins/media/img/trans.gif b/media/js/tiny_mce/plugins/media/img/trans.gif new file mode 100644 index 0000000..3884865 Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/trans.gif differ diff --git a/media/js/tiny_mce/plugins/media/img/windowsmedia.gif b/media/js/tiny_mce/plugins/media/img/windowsmedia.gif new file mode 100644 index 0000000..ab50f2d Binary files /dev/null and b/media/js/tiny_mce/plugins/media/img/windowsmedia.gif differ diff --git a/media/js/tiny_mce/plugins/media/js/embed.js b/media/js/tiny_mce/plugins/media/js/embed.js new file mode 100644 index 0000000..f8dc810 --- /dev/null +++ b/media/js/tiny_mce/plugins/media/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + +function init() { + var pl = "", f, val; + var type = "flash", fe, i; + + ed = tinyMCEPopup.editor; + + tinyMCEPopup.resizeToInnerSize(); + f = document.forms[0] + + fe = ed.selection.getNode(); + if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { + pl = fe.title; + + switch (ed.dom.getAttrib(fe, 'class')) { + case 'mceItemFlash': + type = 'flash'; + break; + + case 'mceItemFlashVideo': + type = 'flv'; + break; + + case 'mceItemShockWave': + type = 'shockwave'; + break; + + case 'mceItemWindowsMedia': + type = 'wmp'; + break; + + case 'mceItemQuickTime': + type = 'qt'; + break; + + case 'mceItemRealMedia': + type = 'rmp'; + break; + } + + document.forms[0].insert.value = ed.getLang('update', 'Insert', true); + } + + document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var html = getMediaListHTML('medialist','src','media','media'); + if (html == "") + document.getElementById("linklistrow").style.display = 'none'; + else + document.getElementById("linklistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('filebrowser')) + document.getElementById('src').style.width = '230px'; + + // Setup form + if (pl != "") { + pl = tinyMCEPopup.editor.plugins.media._parse(pl); + + switch (type) { + case "flash": + setBool(pl, 'flash', 'play'); + setBool(pl, 'flash', 'loop'); + setBool(pl, 'flash', 'menu'); + setBool(pl, 'flash', 'swliveconnect'); + setStr(pl, 'flash', 'quality'); + setStr(pl, 'flash', 'scale'); + setStr(pl, 'flash', 'salign'); + setStr(pl, 'flash', 'wmode'); + setStr(pl, 'flash', 'base'); + setStr(pl, 'flash', 'flashvars'); + break; + + case "qt": + setBool(pl, 'qt', 'loop'); + setBool(pl, 'qt', 'autoplay'); + setBool(pl, 'qt', 'cache'); + setBool(pl, 'qt', 'controller'); + setBool(pl, 'qt', 'correction'); + setBool(pl, 'qt', 'enablejavascript'); + setBool(pl, 'qt', 'kioskmode'); + setBool(pl, 'qt', 'autohref'); + setBool(pl, 'qt', 'playeveryframe'); + setBool(pl, 'qt', 'tarsetcache'); + setStr(pl, 'qt', 'scale'); + setStr(pl, 'qt', 'starttime'); + setStr(pl, 'qt', 'endtime'); + setStr(pl, 'qt', 'tarset'); + setStr(pl, 'qt', 'qtsrcchokespeed'); + setStr(pl, 'qt', 'volume'); + setStr(pl, 'qt', 'qtsrc'); + break; + + case "shockwave": + setBool(pl, 'shockwave', 'sound'); + setBool(pl, 'shockwave', 'progress'); + setBool(pl, 'shockwave', 'autostart'); + setBool(pl, 'shockwave', 'swliveconnect'); + setStr(pl, 'shockwave', 'swvolume'); + setStr(pl, 'shockwave', 'swstretchstyle'); + setStr(pl, 'shockwave', 'swstretchhalign'); + setStr(pl, 'shockwave', 'swstretchvalign'); + break; + + case "wmp": + setBool(pl, 'wmp', 'autostart'); + setBool(pl, 'wmp', 'enabled'); + setBool(pl, 'wmp', 'enablecontextmenu'); + setBool(pl, 'wmp', 'fullscreen'); + setBool(pl, 'wmp', 'invokeurls'); + setBool(pl, 'wmp', 'mute'); + setBool(pl, 'wmp', 'stretchtofit'); + setBool(pl, 'wmp', 'windowlessvideo'); + setStr(pl, 'wmp', 'balance'); + setStr(pl, 'wmp', 'baseurl'); + setStr(pl, 'wmp', 'captioningid'); + setStr(pl, 'wmp', 'currentmarker'); + setStr(pl, 'wmp', 'currentposition'); + setStr(pl, 'wmp', 'defaultframe'); + setStr(pl, 'wmp', 'playcount'); + setStr(pl, 'wmp', 'rate'); + setStr(pl, 'wmp', 'uimode'); + setStr(pl, 'wmp', 'volume'); + break; + + case "rmp": + setBool(pl, 'rmp', 'autostart'); + setBool(pl, 'rmp', 'loop'); + setBool(pl, 'rmp', 'autogotourl'); + setBool(pl, 'rmp', 'center'); + setBool(pl, 'rmp', 'imagestatus'); + setBool(pl, 'rmp', 'maintainaspect'); + setBool(pl, 'rmp', 'nojava'); + setBool(pl, 'rmp', 'prefetch'); + setBool(pl, 'rmp', 'shuffle'); + setStr(pl, 'rmp', 'console'); + setStr(pl, 'rmp', 'controls'); + setStr(pl, 'rmp', 'numloop'); + setStr(pl, 'rmp', 'scriptcallbacks'); + break; + } + + setStr(pl, null, 'src'); + setStr(pl, null, 'id'); + setStr(pl, null, 'name'); + setStr(pl, null, 'vspace'); + setStr(pl, null, 'hspace'); + setStr(pl, null, 'bgcolor'); + setStr(pl, null, 'align'); + setStr(pl, null, 'width'); + setStr(pl, null, 'height'); + + if ((val = ed.dom.getAttrib(fe, "width")) != "") + pl.width = f.width.value = val; + + if ((val = ed.dom.getAttrib(fe, "height")) != "") + pl.height = f.height.value = val; + + oldWidth = pl.width ? parseInt(pl.width) : 0; + oldHeight = pl.height ? parseInt(pl.height) : 0; + } else + oldWidth = oldHeight = 0; + + selectByValue(f, 'media_type', type); + changedType(type); + updateColor('bgcolor_pick', 'bgcolor'); + + TinyMCE_EditableSelects.init(); + generatePreview(); +} + +function insertMedia() { + var fe, f = document.forms[0], h; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(f)) { + tinyMCEPopup.alert(ed.getLang('invalid_data')); + return false; + } + + f.width.value = f.width.value == "" ? 100 : f.width.value; + f.height.value = f.height.value == "" ? 100 : f.height.value; + + fe = ed.selection.getNode(); + if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + fe.className = "mceItemFlash"; + break; + + case "flv": + fe.className = "mceItemFlashVideo"; + break; + + case "shockwave": + fe.className = "mceItemShockWave"; + break; + + case "qt": + fe.className = "mceItemQuickTime"; + break; + + case "wmp": + fe.className = "mceItemWindowsMedia"; + break; + + case "rmp": + fe.className = "mceItemRealMedia"; + break; + } + + if (fe.width != f.width.value || fe.height != f.height.value) + ed.execCommand('mceRepaint'); + + fe.title = serializeParameters(); + fe.width = f.width.value; + fe.height = f.height.value; + fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); + fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); + fe.align = f.align.options[f.align.selectedIndex].value; + } else { + h = ' 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; +} + +function getType(v) { + var fo, i, c, el, x, f = document.forms[0]; + + fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); + + // YouTube + if (v.match(/watch\?v=(.+)(.*)/)) { + f.width.value = '425'; + f.height.value = '350'; + f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; + return 'flash'; + } + + // Google video + if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { + f.width.value = '425'; + f.height.value = '326'; + f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; + return 'flash'; + } + + for (i=0; i 0 ? s.substring(0, s.length - 1) : s; + + return s; +} + +function setBool(pl, p, n) { + if (typeof(pl[n]) == "undefined") + return; + + document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; +} + +function setStr(pl, p, n) { + var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; + + if (typeof(pl[n]) == "undefined") + return; + + if (e.type == "text") + e.value = pl[n]; + else + selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); +} + +function getBool(p, n, d, tv, fv) { + var v = document.forms[0].elements[p + "_" + n].checked; + + tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; + fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; + + return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); +} + +function getStr(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + if (n == 'src') + v = tinyMCEPopup.editor.convertURL(v, 'src', null); + + return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); +} + +function getInt(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); +} + +function jsEncode(s) { + s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); + s = s.replace(new RegExp('"', 'g'), '\\"'); + s = s.replace(new RegExp("'", 'g'), "\\'"); + + return s; +} + +function generatePreview(c) { + var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + + p.innerHTML = ''; + + nw = parseInt(f.width.value); + nh = parseInt(f.height.value); + + if (f.width.value != "" && f.height.value != "") { + if (f.constrain.checked) { + if (c == 'width' && oldWidth != 0) { + wp = nw / oldWidth; + nh = Math.round(wp * nh); + f.height.value = nh; + } else if (c == 'height' && oldHeight != 0) { + hp = nh / oldHeight; + nw = Math.round(hp * nw); + f.width.value = nw; + } + } + } + + if (f.width.value != "") + oldWidth = nw; + + if (f.height.value != "") + oldHeight = nh; + + // After constrain + pl = serializeParameters(); + + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + type = 'application/x-shockwave-flash'; + break; + + case "shockwave": + cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + type = 'application/x-director'; + break; + + case "qt": + cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + type = 'video/quicktime'; + break; + + case "wmp": + cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'application/x-mplayer2'; + break; + + case "rmp": + cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'audio/x-pn-realaudio-plugin'; + break; + } + + if (pl == '') { + p.innerHTML = ''; + return; + } + + pl = tinyMCEPopup.editor.plugins.media._parse(pl); + + if (!pl.src) { + p.innerHTML = ''; + return; + } + + pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); + pl.width = !pl.width ? 100 : pl.width; + pl.height = !pl.height ? 100 : pl.height; + pl.id = !pl.id ? 'obj' : pl.id; + pl.name = !pl.name ? 'eobj' : pl.name; + pl.align = !pl.align ? '' : pl.align; + + // Avoid annoying warning about insecure items + if (!tinymce.isIE || document.location.protocol != 'https:') { + h += ''; + + for (n in pl) { + h += ''; + + // Add extra url parameter if it's an absolute URL + if (n == 'src' && pl[n].indexOf('://') != -1) + h += ''; + } + } + + h += ' + + + {#media_dlg.title} + + + + + + + + + +
    + + +
    +
    +
    + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
    + + + + + + +
    x   
    +
    +
    + +
    + {#media_dlg.preview} + +
    +
    + +
    +
    + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
     
    +
    +
    + +
    + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + + + + + + + +
    +
    + +
    + {#media_dlg.flv_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +  
    + + + + + +
     
    +
    +
    + +
    + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +   +
    +
    + +
    + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/media/js/tiny_mce/plugins/nonbreaking/editor_plugin.js b/media/js/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100644 index 0000000..f2dbbff --- /dev/null +++ b/media/js/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'·':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/media/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100644 index 0000000..b723756 --- /dev/null +++ b/media/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Nonbreaking', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceNonBreaking', function() { + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '·' : ' '); + }); + + // Register buttons + ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); + + if (ed.getParam('nonbreaking_force_tab')) { + ed.onKeyDown.add(function(ed, e) { + if (tinymce.isIE && e.keyCode == 9) { + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + tinymce.dom.Event.cancel(e); + } + }); + } + }, + + getInfo : function() { + return { + longname : 'Nonbreaking space', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/noneditable/editor_plugin.js b/media/js/tiny_mce/plugins/noneditable/editor_plugin.js new file mode 100644 index 0000000..9945cd8 --- /dev/null +++ b/media/js/tiny_mce/plugins/noneditable/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/noneditable/editor_plugin_src.js b/media/js/tiny_mce/plugins/noneditable/editor_plugin_src.js new file mode 100644 index 0000000..77db577 --- /dev/null +++ b/media/js/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -0,0 +1,87 @@ +/** + * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var Event = tinymce.dom.Event; + + tinymce.create('tinymce.plugins.NonEditablePlugin', { + init : function(ed, url) { + var t = this, editClass, nonEditClass; + + t.editor = ed; + editClass = ed.getParam("noneditable_editable_class", "mceEditable"); + nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); + + ed.onNodeChange.addToTop(function(ed, cm, n) { + var sc, ec; + + // Block if start or end is inside a non editable element + sc = ed.dom.getParent(ed.selection.getStart(), function(n) { + return ed.dom.hasClass(n, nonEditClass); + }); + + ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { + return ed.dom.hasClass(n, nonEditClass); + }); + + // Block or unblock + if (sc || ec) { + t._setDisabled(1); + return false; + } else + t._setDisabled(0); + }); + }, + + getInfo : function() { + return { + longname : 'Non editable elements', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _block : function(ed, e) { + var k = e.keyCode; + + // Don't block arrow keys, pg up/down, and F1-F12 + if ((k > 32 && k < 41) || (k > 111 && k < 124)) + return; + + return Event.cancel(e); + }, + + _setDisabled : function(s) { + var t = this, ed = t.editor; + + tinymce.each(ed.controlManager.controls, function(c) { + c.setDisabled(s); + }); + + if (s !== t.disabled) { + if (s) { + ed.onKeyDown.addToTop(t._block); + ed.onKeyPress.addToTop(t._block); + ed.onKeyUp.addToTop(t._block); + ed.onPaste.addToTop(t._block); + } else { + ed.onKeyDown.remove(t._block); + ed.onKeyPress.remove(t._block); + ed.onKeyUp.remove(t._block); + ed.onPaste.remove(t._block); + } + + t.disabled = s; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/pagebreak/css/content.css b/media/js/tiny_mce/plugins/pagebreak/css/content.css new file mode 100644 index 0000000..c949d58 --- /dev/null +++ b/media/js/tiny_mce/plugins/pagebreak/css/content.css @@ -0,0 +1 @@ +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} diff --git a/media/js/tiny_mce/plugins/pagebreak/editor_plugin.js b/media/js/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100644 index 0000000..a212f69 --- /dev/null +++ b/media/js/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/media/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100644 index 0000000..16f5748 --- /dev/null +++ b/media/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -0,0 +1,74 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.settings.content_css !== false) + ed.dom.loadCSS(url + "/css/content.css"); + + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +})(); \ No newline at end of file diff --git a/media/js/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/media/js/tiny_mce/plugins/pagebreak/img/pagebreak.gif new file mode 100644 index 0000000..acdf408 Binary files /dev/null and b/media/js/tiny_mce/plugins/pagebreak/img/pagebreak.gif differ diff --git a/media/js/tiny_mce/plugins/pagebreak/img/trans.gif b/media/js/tiny_mce/plugins/pagebreak/img/trans.gif new file mode 100644 index 0000000..3884865 Binary files /dev/null and b/media/js/tiny_mce/plugins/pagebreak/img/trans.gif differ diff --git a/media/js/tiny_mce/plugins/paste/editor_plugin.js b/media/js/tiny_mce/plugins/paste/editor_plugin.js new file mode 100644 index 0000000..7b2bbd9 --- /dev/null +++ b/media/js/tiny_mce/plugins/paste/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"\uFEFF");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);if(p.innerHTML==="\uFEFF"){c.execCommand("mcePasteWord");l.preventDefault();return}g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var q="",n=o.select("div[id=_mcePaste]");a(n,function(r){q+=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[//gi,"$&__MCE_ITEM__"],[/(]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([//gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert(' ',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(kb.y+b.h){h.getDoc().body.scrollTop=k