Commits

Rostyslav Bryzgunov committed 5cc24a0

Move subfolders up

  • Participants
  • Parent commits dce2ba4

Comments (0)

Files changed (104)

File media/README.txt

+This folder is for user-generated content. 
+We strongly suggest to "svn:ignore *" it (if you're using SVN).

File media/media/README.txt

-This folder is for user-generated content. 
-We strongly suggest to "svn:ignore *" it (if you're using SVN).

File source/__init__.py

Empty file added.

File source/apps/README.txt

+Project-specific Django applications container.
+Use "ext" subfolder to include third-party applications.

File source/apps/__init__.py

Empty file added.

File source/apps/ext/README.txt

+Django external applications SOURCE CODE.
+If you want to make changes - make a copy into "apps" (parent dir).
+
+This folder should contain UNCHANGED third-party apps code. Probably subfolders here may be:
+* filebrowser/
+* admin_tools/
+* debug_toolbar/
+* ... (other thitd-party apps)
+
+You may use svn:externals (if you use SVN) to prevent copy-paste. Here is an example of our svn:externals:
+
+south            %SERVER%/django-south/tags/0.7.1/south
+debug_toolbar    %SERVER%/django-debug-toolbar/tags/version-0.8.3/debug_toolbar
+filebrowser      %SERVER%/django-filebrowser/branches/no-grapelli-3.0
+tinymce          %SERVER%/django-tinymce/branches/googlecode-trunk-r102-patched/tinymce
+localeurl        %SERVER%/django-localeurl/tags/version-1.4/localeurl
+admin_tools      %SERVER%/django-admin-tools/tags/0.3.0/admin_tools
+rosetta          %SERVER%/i18n/django-rosetta/tags/0.5.6/rosetta
+modeltranslation %SERVER%/i18n/django-modeltranslation/trunk/modeltranslation
+
+Note, that %SERVER% is our secret SVN hosting and we won't tell it :)

File source/apps/ext/__init__.py

Empty file added.

File source/apps/web/__init__.py

Empty file added.

File source/apps/web/context_processors.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app context processors
+'''

File source/apps/web/decorators.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app decorators
+'''

File source/apps/web/middleware.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app middleware
+'''

File source/apps/web/models.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app models
+'''

File source/apps/web/templates/web/base.html

+{% load i18n %}
+<!DOCTYPE html>
+
+<html>
+<head>
+	<title>{% block title %}Django project{% endblock %}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+	<!-- CSS -->
+	<link href="/static/web/css/greetings.css" rel="stylesheet" type="text/css" />
+
+	{% block css %}
+	{% endblock %}
+
+    <!-- JavaScript -->
+    <script type="text/javascript" src="/static/ext/jquery/jquery-1.5.2.min.js"></script>
+    <script type="text/javascript" src="/static/web/js/greetings.js"></script>
+
+	{% block js %}
+	{% endblock %}
+</head>
+
+<body>
+	{% block content %}
+		<h1>Greetings! You have successfully initiated your django-project!</h1>
+		<p>Go to the <a href="/admin/">Admin</a> side</p>
+	{% endblock %}
+</body>
+</html>

File source/apps/web/templatetags/__init__.py

Empty file added.

File source/apps/web/urls.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app urls
+'''
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('web.views',
+    (r'^$', 'greetings'),
+)

File source/apps/web/views.py

+# -*- encoding:utf-8 -*-
+'''
+Common web-app views
+'''
+from django.views.generic.base import TemplateView
+
+class Greetings(TemplateView):
+    template_name = "web/base.html"
+greetings = Greetings.as_view()

File source/conf/__init__.py

Empty file added.

File source/db/README.txt

+DB folder. 
+Our SQLite files are stored here. 
+But you may also place here some SQL scripts, alters, dumps, etc.
+
+We suggest you to ignore all your *.sqlite files stored here (if you'll use SQLite too):
+  svn:ignore
+  *.sqlite

File source/db/local.sqlite

Binary file added.

File source/lib/README.txt

+Container for project-specific libs (not django-apps)

File source/lib/__init__.py

Empty file added.

File source/manage.py

+#!/usr/bin/env python
+from django.core.management import execute_manager
+
+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)

File source/scripts/compile_messages.bat

+cd ../apps/web
+echo off
+echo --------------------------------------------------
+echo Compile i18n messages
+echo --------------------------------------------------
+python ../../manage.py compilemessages

File source/scripts/dump_db.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Dump whole project data in json format
+echo --------------------------------------------------
+python manage.py dumpdata --format=json --indent=4 > db/all.json

File source/scripts/load_db.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Load saved dump into db
+echo --------------------------------------------------
+python manage.py reset
+python manage.py reset --noinput auth contenttypes sites sessions web
+python manage.py loaddata db/all.json

File source/scripts/make_messages.bat

+cd ../apps/web
+echo off
+echo --------------------------------------------------
+echo Make i18n messages
+echo --------------------------------------------------
+python ../../manage.py makemessages -l en
+

File source/scripts/migrate.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Migrate database
+echo --------------------------------------------------
+python manage.py schemamigration web --auto
+python manage.py migrate web

File source/scripts/py_shell.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Python Shell
+echo --------------------------------------------------
+python manage.py shell

File source/scripts/run_devserver.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Start development server
+echo --------------------------------------------------
+python manage.py runserver 80

File source/scripts/south_auto.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Create migrations
+echo --------------------------------------------------
+python manage.py schemamigration web --auto

File source/scripts/south_init.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Init South control for not south-controlled app
+echo --------------------------------------------------
+python manage.py schemamigration web --initial
+python manage.py syncdb --migrate

File source/scripts/south_migrate.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Migrate database (run all migrations)
+echo --------------------------------------------------
+python manage.py migrate 

File source/scripts/sync_db.bat

+cd ..
+echo off
+echo --------------------------------------------------
+echo Sync DB
+echo --------------------------------------------------
+python manage.py syncdb --migrate
+

File source/settings/README.txt

+Look into __init__.py - include order:
+1) main settings
+2) apps settings
+3) (local|deployment) settings

File source/settings/__init__.py

+import platform
+
+DEPLOYMENT_SERVERS = ('your_domain.com',)
+DEPLOYMENT = platform.node() in DEPLOYMENT_SERVERS
+
+if DEPLOYMENT:
+    from deployment import *
+else:
+    from local import *

File source/settings/apps_settings/README.txt

+Create new app's settings file and don't forget to include it inside __init__.py

File source/settings/apps_settings/__init__.py

+# External apps
+# Our apps
+from web import *

File source/settings/apps_settings/web.py

+from .. import main_settings as settings
+
+app_name = 'web'
+if app_name not in settings.INSTALLED_APPS:
+    settings.INSTALLED_APPS += (app_name,)

File source/settings/deployment.py

+"""
+Standalone Deployment settings to be used with --settings parameter
+"""
+
+# Load all apps settings
+from apps_settings import *
+from main_settings import *
+from deployment_settings import *

File source/settings/deployment_settings.py

+import main_settings as settings
+import os
+
+TEMPLATE_DEBUG = DEBUG = False
+
+#EMAIL_HOST = "pleso.net"
+#EMAIL_PORT = "25"
+#EMAIL_HOST_USER = "bot@inmind.org"
+#EMAIL_HOST_PASSWORD = ""
+#EMAIL_SUBJECT_PREFIX = "website (local) - "
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'
+        'NAME': os.path.join(settings.PROJECT_ROOT, 'source/db/live.sqlite'), # Or path to database file if using sqlite3
+    }
+}
+
+del settings, os

File source/settings/local.py

+"""
+Standalone Local settings to be used with --settings parameter
+"""
+
+# Load all apps settings
+from apps_settings import *
+from main_settings import *
+from local_settings import *

File source/settings/local_settings.py

+import main_settings as settings
+import os
+
+DEBUG = TEMPLATE_DEBUG = True
+
+#EMAIL_HOST = "pleso.net"
+#EMAIL_PORT = "25"
+#EMAIL_HOST_USER = "bot@inmind.org"
+#EMAIL_HOST_PASSWORD = ""
+#EMAIL_SUBJECT_PREFIX = "website (local) - "
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'
+        'NAME': os.path.join(settings.PROJECT_ROOT, 'source/db/local.sqlite'), # Or path to database file if using sqlite3
+    }
+}
+
+del settings, os

File source/settings/main_settings.py

+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+
+# Django settings for project.
+import os
+import sys
+
+# Debug settings
+DEBUG = False
+TEMPLATE_DEBUG = DEBUG
+
+# Force removal of fastcgi script name from URL
+FORCE_SCRIPT_NAME=""
+
+# We are in "project/trunk/code/" folder. We need to get PROJECT_ROOT
+PROJECT_ROOT = os.path.abspath('..')
+
+sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/')))
+sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps')))
+sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps/ext')))
+sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib')))
+sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib/ext')))
+
+ADMINS = [
+     ('Alerts', 'alert@example.com'),
+]
+MANAGERS = [
+     ('Info', 'info@example.com'),
+]
+if not DEBUG:
+    pass
+
+EMAIL_HOST = ''
+EMAIL_PORT = ''
+EMAIL_HOST_USER = ''
+EMAIL_HOST_PASSWORD = ''
+EMAIL_USE_TLS = True
+EMAIL_SUBJECT_PREFIX = ' '
+
+
+# DB settings will be overrided
+#DATABASES = {
+#    'default': {}
+#}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'Europe/Kiev'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en'
+
+#LANGUAGES = (
+#             ('ru', u'Русский'),
+#             ('en', u'English'),
+#             ('uk', u'Український'),
+#             )
+#
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+USE_L10N = True
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = os.path.join(PROJECT_ROOT, "media")
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = '/media/'
+
+STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
+
+STATIC_URL = '/static/'
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/adminmedia/'
+ADMIN_MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'adminmedia') 
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'c^7$)t^ka7oe+z6nfw)#$10auo=_$5oqv%6@nhhzm%k5s$1mxr'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.load_template_source',
+    'django.template.loaders.app_directories.load_template_source',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+)
+
+ROOT_URLCONF = 'urls'
+
+TEMPLATE_DIRS = (
+    # We don't use global template dirs
+)
+
+# Default list of context processors
+TEMPLATE_CONTEXT_PROCESSORS = (
+    'django.core.context_processors.auth',
+    'django.core.context_processors.debug',
+    'django.core.context_processors.i18n',
+    'django.core.context_processors.media',
+    'django.contrib.messages.context_processors.messages',
+    'django.core.context_processors.request',
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    #'django.contrib.sites',
+    'django.contrib.admin',
+)
+
+INTERNAL_IPS = ('127.0.0.1', 'localhost', 'django.local')

File source/source/__init__.py

Empty file removed.

File source/source/apps/README.txt

-Project-specific Django applications container.
-Use "ext" subfolder to include third-party applications.

File source/source/apps/__init__.py

Empty file removed.

File source/source/apps/ext/README.txt

-Django external applications SOURCE CODE.
-If you want to make changes - make a copy into "apps" (parent dir).
-
-This folder should contain UNCHANGED third-party apps code. Probably subfolders here may be:
-* filebrowser/
-* admin_tools/
-* debug_toolbar/
-* ... (other thitd-party apps)
-
-You may use svn:externals (if you use SVN) to prevent copy-paste. Here is an example of our svn:externals:
-
-south            %SERVER%/django-south/tags/0.7.1/south
-debug_toolbar    %SERVER%/django-debug-toolbar/tags/version-0.8.3/debug_toolbar
-filebrowser      %SERVER%/django-filebrowser/branches/no-grapelli-3.0
-tinymce          %SERVER%/django-tinymce/branches/googlecode-trunk-r102-patched/tinymce
-localeurl        %SERVER%/django-localeurl/tags/version-1.4/localeurl
-admin_tools      %SERVER%/django-admin-tools/tags/0.3.0/admin_tools
-rosetta          %SERVER%/i18n/django-rosetta/tags/0.5.6/rosetta
-modeltranslation %SERVER%/i18n/django-modeltranslation/trunk/modeltranslation
-
-Note, that %SERVER% is our secret SVN hosting and we won't tell it :)

File source/source/apps/ext/__init__.py

Empty file removed.

File source/source/apps/web/__init__.py

Empty file removed.

File source/source/apps/web/context_processors.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app context processors
-'''

File source/source/apps/web/decorators.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app decorators
-'''

File source/source/apps/web/middleware.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app middleware
-'''

File source/source/apps/web/models.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app models
-'''

File source/source/apps/web/templates/web/base.html

-{% load i18n %}
-<!DOCTYPE html>
-
-<html>
-<head>
-	<title>{% block title %}Django project{% endblock %}</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-
-	<!-- CSS -->
-	<link href="/static/web/css/greetings.css" rel="stylesheet" type="text/css" />
-
-	{% block css %}
-	{% endblock %}
-
-    <!-- JavaScript -->
-    <script type="text/javascript" src="/static/ext/jquery/jquery-1.5.2.min.js"></script>
-    <script type="text/javascript" src="/static/web/js/greetings.js"></script>
-
-	{% block js %}
-	{% endblock %}
-</head>
-
-<body>
-	{% block content %}
-		<h1>Greetings! You have successfully initiated your django-project!</h1>
-		<p>Go to the <a href="/admin/">Admin</a> side</p>
-	{% endblock %}
-</body>
-</html>

File source/source/apps/web/templatetags/__init__.py

Empty file removed.

File source/source/apps/web/urls.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app urls
-'''
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('web.views',
-    (r'^$', 'greetings'),
-)

File source/source/apps/web/views.py

-# -*- encoding:utf-8 -*-
-'''
-Common web-app views
-'''
-from django.views.generic.base import TemplateView
-
-class Greetings(TemplateView):
-    template_name = "web/base.html"
-greetings = Greetings.as_view()

File source/source/conf/__init__.py

Empty file removed.

File source/source/db/README.txt

-DB folder. 
-Our SQLite files are stored here. 
-But you may also place here some SQL scripts, alters, dumps, etc.
-
-We suggest you to ignore all your *.sqlite files stored here (if you'll use SQLite too):
-  svn:ignore
-  *.sqlite

File source/source/db/local.sqlite

Binary file removed.

File source/source/lib/README.txt

-Container for project-specific libs (not django-apps)

File source/source/lib/__init__.py

Empty file removed.

File source/source/manage.py

-#!/usr/bin/env python
-from django.core.management import execute_manager
-
-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)

File source/source/scripts/compile_messages.bat

-cd ../apps/web
-echo off
-echo --------------------------------------------------
-echo Compile i18n messages
-echo --------------------------------------------------
-python ../../manage.py compilemessages

File source/source/scripts/dump_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Dump whole project data in json format
-echo --------------------------------------------------
-python manage.py dumpdata --format=json --indent=4 > db/all.json

File source/source/scripts/load_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Load saved dump into db
-echo --------------------------------------------------
-python manage.py reset
-python manage.py reset --noinput auth contenttypes sites sessions web
-python manage.py loaddata db/all.json

File source/source/scripts/make_messages.bat

-cd ../apps/web
-echo off
-echo --------------------------------------------------
-echo Make i18n messages
-echo --------------------------------------------------
-python ../../manage.py makemessages -l en
-

File source/source/scripts/migrate.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Migrate database
-echo --------------------------------------------------
-python manage.py schemamigration web --auto
-python manage.py migrate web

File source/source/scripts/py_shell.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Python Shell
-echo --------------------------------------------------
-python manage.py shell

File source/source/scripts/run_devserver.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Start development server
-echo --------------------------------------------------
-python manage.py runserver 80

File source/source/scripts/south_auto.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Create migrations
-echo --------------------------------------------------
-python manage.py schemamigration web --auto

File source/source/scripts/south_init.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Init South control for not south-controlled app
-echo --------------------------------------------------
-python manage.py schemamigration web --initial
-python manage.py syncdb --migrate

File source/source/scripts/south_migrate.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Migrate database (run all migrations)
-echo --------------------------------------------------
-python manage.py migrate 

File source/source/scripts/sync_db.bat

-cd ..
-echo off
-echo --------------------------------------------------
-echo Sync DB
-echo --------------------------------------------------
-python manage.py syncdb --migrate
-

File source/source/settings/README.txt

-Look into __init__.py - include order:
-1) main settings
-2) apps settings
-3) (local|deployment) settings

File source/source/settings/__init__.py

-import platform
-
-DEPLOYMENT_SERVERS = ('your_domain.com',)
-DEPLOYMENT = platform.node() in DEPLOYMENT_SERVERS
-
-if DEPLOYMENT:
-    from deployment import *
-else:
-    from local import *

File source/source/settings/apps_settings/README.txt

-Create new app's settings file and don't forget to include it inside __init__.py

File source/source/settings/apps_settings/__init__.py

-# External apps
-# Our apps
-from web import *

File source/source/settings/apps_settings/web.py

-from .. import main_settings as settings
-
-app_name = 'web'
-if app_name not in settings.INSTALLED_APPS:
-    settings.INSTALLED_APPS += (app_name,)

File source/source/settings/deployment.py

-"""
-Standalone Deployment settings to be used with --settings parameter
-"""
-
-# Load all apps settings
-from apps_settings import *
-from main_settings import *
-from deployment_settings import *

File source/source/settings/deployment_settings.py

-import main_settings as settings
-import os
-
-TEMPLATE_DEBUG = DEBUG = False
-
-#EMAIL_HOST = "pleso.net"
-#EMAIL_PORT = "25"
-#EMAIL_HOST_USER = "bot@inmind.org"
-#EMAIL_HOST_PASSWORD = ""
-#EMAIL_SUBJECT_PREFIX = "website (local) - "
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'
-        'NAME': os.path.join(settings.PROJECT_ROOT, 'source/db/live.sqlite'), # Or path to database file if using sqlite3
-    }
-}
-
-del settings, os

File source/source/settings/local.py

-"""
-Standalone Local settings to be used with --settings parameter
-"""
-
-# Load all apps settings
-from apps_settings import *
-from main_settings import *
-from local_settings import *

File source/source/settings/local_settings.py

-import main_settings as settings
-import os
-
-DEBUG = TEMPLATE_DEBUG = True
-
-#EMAIL_HOST = "pleso.net"
-#EMAIL_PORT = "25"
-#EMAIL_HOST_USER = "bot@inmind.org"
-#EMAIL_HOST_PASSWORD = ""
-#EMAIL_SUBJECT_PREFIX = "website (local) - "
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'
-        'NAME': os.path.join(settings.PROJECT_ROOT, 'source/db/local.sqlite'), # Or path to database file if using sqlite3
-    }
-}
-
-del settings, os

File source/source/settings/main_settings.py

-#!/usr/bin/python
-# -*- coding: UTF-8 -*-
-
-# Django settings for project.
-import os
-import sys
-
-# Debug settings
-DEBUG = False
-TEMPLATE_DEBUG = DEBUG
-
-# Force removal of fastcgi script name from URL
-FORCE_SCRIPT_NAME=""
-
-# We are in "project/trunk/code/" folder. We need to get PROJECT_ROOT
-PROJECT_ROOT = os.path.abspath('..')
-
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/apps/ext')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib')))
-sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, 'source/lib/ext')))
-
-ADMINS = [
-     ('Alerts', 'alert@example.com'),
-]
-MANAGERS = [
-     ('Info', 'info@example.com'),
-]
-if not DEBUG:
-    pass
-
-EMAIL_HOST = ''
-EMAIL_PORT = ''
-EMAIL_HOST_USER = ''
-EMAIL_HOST_PASSWORD = ''
-EMAIL_USE_TLS = True
-EMAIL_SUBJECT_PREFIX = ' '
-
-
-# DB settings will be overrided
-#DATABASES = {
-#    'default': {}
-#}
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'Europe/Kiev'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en'
-
-#LANGUAGES = (
-#             ('ru', u'Русский'),
-#             ('en', u'English'),
-#             ('uk', u'Український'),
-#             )
-#
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-USE_L10N = True
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = os.path.join(PROJECT_ROOT, "media")
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
-
-STATIC_URL = '/static/'
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/adminmedia/'
-ADMIN_MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'adminmedia') 
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'c^7$)t^ka7oe+z6nfw)#$10auo=_$5oqv%6@nhhzm%k5s$1mxr'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-)
-
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-)
-
-ROOT_URLCONF = 'urls'
-
-TEMPLATE_DIRS = (
-    # We don't use global template dirs
-)
-
-# Default list of context processors
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'django.core.context_processors.media',
-    'django.contrib.messages.context_processors.messages',
-    'django.core.context_processors.request',
-)
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    #'django.contrib.sites',
-    'django.contrib.admin',
-)
-
-INTERNAL_IPS = ('127.0.0.1', 'localhost', 'django.local')

File source/source/urls.py

-from django.conf.urls.defaults import *
-from django.conf import settings
-
-from django.contrib import admin
-admin.autodiscover()
-
-MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT', '/media/')
-MEDIA_URL = getattr(settings, 'MEDIA_URL', '/media/')
-STATIC_ROOT = getattr(settings, 'STATIC_ROOT', '/static/')
-STATIC_URL = getattr(settings, 'STATIC_URL', '/static/')
-
-urlpatterns = patterns('',
-    (r'^admin/', include(admin.site.urls)),
-    (r'^kak/', include('web.urls')),
-    (r'', include('web.urls')),
-)
-     
-# Adding debug-mappings
-if settings.DEBUG:
-    # Debug media and static
-    urlpatterns += patterns('',
-                            (r'^%s(?P<path>.*)$' % MEDIA_URL[1:], 'django.views.static.serve', {'document_root': MEDIA_ROOT}),
-                            (r'^%s(?P<path>.*)$' % STATIC_URL[1:], 'django.views.static.serve', {'document_root': STATIC_ROOT}),
-                            )
-
-# Unregister
-#from django.contrib.auth.models import User, Group
-#admin.site.unregister(User)
-#admin.site.unregister(Group)

File source/urls.py

+from django.conf.urls.defaults import *
+from django.conf import settings
+
+from django.contrib import admin
+admin.autodiscover()
+
+MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT', '/media/')
+MEDIA_URL = getattr(settings, 'MEDIA_URL', '/media/')
+STATIC_ROOT = getattr(settings, 'STATIC_ROOT', '/static/')
+STATIC_URL = getattr(settings, 'STATIC_URL', '/static/')
+
+urlpatterns = patterns('',
+    (r'^admin/', include(admin.site.urls)),
+    (r'^kak/', include('web.urls')),
+    (r'', include('web.urls')),
+)
+     
+# Adding debug-mappings
+if settings.DEBUG:
+    # Debug media and static
+    urlpatterns += patterns('',
+                            (r'^%s(?P<path>.*)$' % MEDIA_URL[1:], 'django.views.static.serve', {'document_root': MEDIA_ROOT}),
+                            (r'^%s(?P<path>.*)$' % STATIC_URL[1:], 'django.views.static.serve', {'document_root': STATIC_ROOT}),
+                            )
+
+# Unregister
+#from django.contrib.auth.models import User, Group
+#admin.site.unregister(User)
+#admin.site.unregister(Group)

File static/README.txt

+Project-specific media files.

File static/ext/README.txt

+Django external (third-party) apps media.
+If you want to make changes here - please, make a copy into parent dir.
+
+This folder should contain UNCHANGED third-party apps media. Probably subfolders here may be:
+* admin_tools/
+* debug_toolbar/
+* ... (other third-party apps)
+
+You may use svn:externals (if you use SVN) to prevent copy-paste here.

File static/ext/jquery/jquery-1.5.2.js

+/*!
+ * jQuery JavaScript Library v1.5.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Mar 31 15:28:23 2011 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+		// The jQuery object is actually just the init constructor 'enhanced'
+		return new jQuery.fn.init( selector, context, rootjQuery );
+	},
+
+	// Map over jQuery in case of overwrite
+	_jQuery = window.jQuery,
+
+	// Map over the $ in case of overwrite
+	_$ = window.$,
+
+	// A central reference to the root jQuery(document)
+	rootjQuery,
+
+	// A simple way to check for HTML strings or ID strings
+	// (both of which we optimize for)
+	quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
+
+	// Check if a string has a non-whitespace character in it
+	rnotwhite = /\S/,
+
+	// Used for trimming whitespace
+	trimLeft = /^\s+/,
+	trimRight = /\s+$/,
+
+	// Check for digits
+	rdigit = /\d/,
+
+	// Match a standalone tag
+	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+	// JSON RegExp
+	rvalidchars = /^[\],:{}\s]*$/,
+	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+	// Useragent RegExp
+	rwebkit = /(webkit)[ \/]([\w.]+)/,
+	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+	rmsie = /(msie) ([\w.]+)/,
+	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+	// Keep a UserAgent string for use with jQuery.browser
+	userAgent = navigator.userAgent,
+
+	// For matching the engine and version of the browser
+	browserMatch,
+
+	// The deferred used on DOM ready
+	readyList,
+
+	// The ready event handler
+	DOMContentLoaded,
+
+	// Save a reference to some core methods
+	toString = Object.prototype.toString,
+	hasOwn = Object.prototype.hasOwnProperty,
+	push = Array.prototype.push,
+	slice = Array.prototype.slice,
+	trim = String.prototype.trim,
+	indexOf = Array.prototype.indexOf,
+
+	// [[Class]] -> type pairs
+	class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+	constructor: jQuery,
+	init: function( selector, context, rootjQuery ) {
+		var match, elem, ret, doc;
+
+		// Handle $(""), $(null), or $(undefined)
+		if ( !selector ) {
+			return this;
+		}
+
+		// Handle $(DOMElement)
+		if ( selector.nodeType ) {
+			this.context = this[0] = selector;
+			this.length = 1;
+			return this;
+		}
+
+		// The body element only exists once, optimize finding it
+		if ( selector === "body" && !context && document.body ) {
+			this.context = document;
+			this[0] = document.body;
+			this.selector = "body";
+			this.length = 1;
+			return this;
+		}
+
+		// Handle HTML strings
+		if ( typeof selector === "string" ) {
+			// Are we dealing with HTML string or an ID?
+			match = quickExpr.exec( selector );
+
+			// Verify a match, and that no context was specified for #id
+			if ( match && (match[1] || !context) ) {
+
+				// HANDLE: $(html) -> $(array)
+				if ( match[1] ) {
+					context = context instanceof jQuery ? context[0] : context;
+					doc = (context ? context.ownerDocument || context : document);
+
+					// If a single string is passed in and it's a single tag
+					// just do a createElement and skip the rest
+					ret = rsingleTag.exec( selector );
+
+					if ( ret ) {
+						if ( jQuery.isPlainObject( context ) ) {
+							selector = [ document.createElement( ret[1] ) ];
+							jQuery.fn.attr.call( selector, context, true );
+
+						} else {
+							selector = [ doc.createElement( ret[1] ) ];
+						}
+
+					} else {
+						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+					}
+
+					return jQuery.merge( this, selector );
+
+				// HANDLE: $("#id")
+				} else {
+					elem = document.getElementById( match[2] );
+
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document #6963
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( elem.id !== match[2] ) {
+							return rootjQuery.find( selector );
+						}
+
+						// Otherwise, we inject the element directly into the jQuery object
+						this.length = 1;
+						this[0] = elem;
+					}
+
+					this.context = document;
+					this.selector = selector;
+					return this;
+				}
+
+			// HANDLE: $(expr, $(...))
+			} else if ( !context || context.jquery ) {
+				return (context || rootjQuery).find( selector );
+
+			// HANDLE: $(expr, context)
+			// (which is just equivalent to: $(context).find(expr)
+			} else {
+				return this.constructor( context ).find( selector );
+			}
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction( selector ) ) {
+			return rootjQuery.ready( selector );
+		}
+
+		if (selector.selector !== undefined) {
+			this.selector = selector.selector;
+			this.context = selector.context;
+		}
+
+		return jQuery.makeArray( selector, this );
+	},
+
+	// Start with an empty selector
+	selector: "",
+
+	// The current version of jQuery being used
+	jquery: "1.5.2",
+
+	// The default length of a jQuery object is 0
+	length: 0,
+
+	// The number of elements contained in the matched element set
+	size: function() {
+		return this.length;
+	},
+
+	toArray: function() {
+		return slice.call( this, 0 );
+	},
+
+	// Get the Nth element in the matched element set OR
+	// Get the whole matched element set as a clean array
+	get: function( num ) {
+		return num == null ?
+
+			// Return a 'clean' array
+			this.toArray() :
+
+			// Return just the object
+			( num < 0 ? this[ this.length + num ] : this[ num ] );
+	},
+
+	// Take an array of elements and push it onto the stack
+	// (returning the new matched element set)
+	pushStack: function( elems, name, selector ) {
+		// Build a new jQuery matched element set
+		var ret = this.constructor();
+
+		if ( jQuery.isArray( elems ) ) {
+			push.apply( ret, elems );
+
+		} else {
+			jQuery.merge( ret, elems );
+		}
+
+		// Add the old object onto the stack (as a reference)
+		ret.prevObject = this;
+
+		ret.context = this.context;
+
+		if ( name === "find" ) {
+			ret.selector = this.selector + (this.selector ? " " : "") + selector;
+		} else if ( name ) {
+			ret.selector = this.selector + "." + name + "(" + selector + ")";
+		}
+
+		// Return the newly-formed element set
+		return ret;
+	},
+
+	// Execute a callback for every element in the matched set.
+	// (You can seed the arguments with an array of args, but this is
+	// only used internally.)
+	each: function( callback, args ) {
+		return jQuery.each( this, callback, args );
+	},
+
+	ready: function( fn ) {
+		// Attach the listeners
+		jQuery.bindReady();
+
+		// Add the callback
+		readyList.done( fn );
+
+		return this;
+	},
+
+	eq: function( i ) {
+		return i === -1 ?
+			this.slice( i ) :
+			this.slice( i, +i + 1 );
+	},
+
+	first: function() {
+		return this.eq( 0 );
+	},
+
+	last: function() {
+		return this.eq( -1 );
+	},
+
+	slice: function() {
+		return this.pushStack( slice.apply( this, arguments ),
+			"slice", slice.call(arguments).join(",") );
+	},
+
+	map: function( callback ) {
+		return this.pushStack( jQuery.map(this, function( elem, i ) {
+			return callback.call( elem, i, elem );
+		}));
+	},
+
+	end: function() {
+		return this.prevObject || this.constructor(null);
+	},
+
+	// For internal use only.
+	// Behaves like an Array's method, not like a jQuery method.
+	push: push,
+	sort: [].sort,
+	splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+	var options, name, src, copy, copyIsArray, clone,
+		target = arguments[0] || {},
+		i = 1,
+		length = arguments.length,
+		deep = false;
+
+	// Handle a deep copy situation
+	if ( typeof target === "boolean" ) {
+		deep = target;
+		target = arguments[1] || {};
+		// skip the boolean and the target
+		i = 2;
+	}
+
+	// Handle case when target is a string or something (possible in deep copy)
+	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+		target = {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( length === i ) {
+		target = this;
+		--i;
+	}
+
+	for ( ; i < length; i++ ) {
+		// Only deal with non-null/undefined values
+		if ( (options = arguments[ i ]) != null ) {
+			// Extend the base object
+			for ( name in options ) {
+				src = target[ name ];
+				copy = options[ name ];
+
+				// Prevent never-ending loop
+				if ( target === copy ) {
+					continue;
+				}
+
+				// Recurse if we're merging plain objects or arrays
+				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+					if ( copyIsArray ) {
+						copyIsArray = false;
+						clone = src && jQuery.isArray(src) ? src : [];
+
+					} else {
+						clone = src && jQuery.isPlainObject(src) ? src : {};
+					}
+
+					// Never move original objects, clone them
+					target[ name ] = jQuery.extend( deep, clone, copy );
+
+				// Don't bring in undefined values
+				} else if ( copy !== undefined ) {
+					target[ name ] = copy;
+				}
+			}
+		}
+	}
+
+	// Return the modified object
+	return target;
+};
+
+jQuery.extend({
+	noConflict: function( deep ) {
+		window.$ = _$;
+
+		if ( deep ) {
+			window.jQuery = _jQuery;
+		}
+
+		return jQuery;
+	},
+
+	// Is the DOM ready to be used? Set to true once it occurs.
+	isReady: false,
+
+	// A counter to track how many items to wait for before
+	// the ready event fires. See #6781
+	readyWait: 1,
+
+	// Handle when the DOM is ready
+	ready: function( wait ) {
+		// A third-party is pushing the ready event forwards
+		if ( wait === true ) {
+			jQuery.readyWait--;
+		}
+
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
+			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+			if ( !document.body ) {
+				return setTimeout( jQuery.ready, 1 );
+			}
+
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+
+			// If a normal DOM Ready event fired, decrement, and wait if need be
+			if ( wait !== true && --jQuery.readyWait > 0 ) {
+				return;
+			}
+
+			// If there are functions bound, to execute
+			readyList.resolveWith( document, [ jQuery ] );
+
+			// Trigger any bound ready events
+			if ( jQuery.fn.trigger ) {
+				jQuery( document ).trigger( "ready" ).unbind( "ready" );
+			}
+		}
+	},
+
+	bindReady: function() {
+		if ( readyList ) {
+			return;
+		}
+
+		readyList = jQuery._Deferred();
+
+		// Catch cases where $(document).ready() is called after the
+		// browser event has already occurred.
+		if ( document.readyState === "complete" ) {
+			// Handle it asynchronously to allow scripts the opportunity to delay ready
+			return setTimeout( jQuery.ready, 1 );
+		}
+
+		// Mozilla, Opera and webkit nightlies currently support this event
+		if ( document.addEventListener ) {
+			// Use the handy event callback
+			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+			// A fallback to window.onload, that will always work
+			window.addEventListener( "load", jQuery.ready, false );
+
+		// If IE event model is used
+		} else if ( document.attachEvent ) {
+			// ensure firing before onload,
+			// maybe late but safe also for iframes
+			document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+			// A fallback to window.onload, that will always work
+			window.attachEvent( "onload", jQuery.ready );
+
+			// If IE and not a frame
+			// continually check to see if the document is ready
+			var toplevel = false;
+
+			try {
+				toplevel = window.frameElement == null;
+			} catch(e) {}
+
+			if ( document.documentElement.doScroll && toplevel ) {
+				doScrollCheck();
+			}
+		}
+	},
+
+	// See test/unit/core.js for details concerning isFunction.
+	// Since version 1.3, DOM methods and functions like alert
+	// aren't supported. They return false on IE (#2968).
+	isFunction: function( obj ) {
+		return jQuery.type(obj) === "function";
+	},
+
+	isArray: Array.isArray || function( obj ) {
+		return jQuery.type(obj) === "array";
+	},
+
+	// A crude way of determining if an object is a window
+	isWindow: function( obj ) {
+		return obj && typeof obj === "object" && "setInterval" in obj;
+	},
+
+	isNaN: function( obj ) {
+		return obj == null || !rdigit.test( obj ) || isNaN( obj );
+	},
+
+	type: function( obj ) {
+		return obj == null ?
+			String( obj ) :
+			class2type[ toString.call(obj) ] || "object";
+	},
+
+	isPlainObject: function( obj ) {
+		// Must be an Object.
+		// Because of IE, we also have to check the presence of the constructor property.
+		// Make sure that DOM nodes and window objects don't pass through, as well
+		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+			return false;
+		}
+
+		// Not own constructor property must be Object
+		if ( obj.constructor &&
+			!hasOwn.call(obj, "constructor") &&
+			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+			return false;
+		}
+
+		// Own properties are enumerated firstly, so to speed up,
+		// if last one is own, then all properties are own.
+
+		var key;
+		for ( key in obj ) {}
+
+		return key === undefined || hasOwn.call( obj, key );
+	},
+
+	isEmptyObject: function( obj ) {
+		for ( var name in obj ) {
+			return false;
+		}
+		return true;
+	},
+
+	error: function( msg ) {
+		throw msg;
+	},
+
+	parseJSON: function( data ) {
+		if ( typeof data !== "string" || !data ) {
+			return null;
+		}
+
+		// Make sure leading/trailing whitespace is removed (IE can't handle it)
+		data = jQuery.trim( data );
+
+		// Make sure the incoming data is actual JSON
+		// Logic borrowed from http://json.org/json2.js
+		if ( rvalidchars.test(data.replace(rvalidescape, "@")
+			.replace(rvalidtokens, "]")
+			.replace(rvalidbraces, "")) ) {
+
+			// Try to use the native JSON parser first
+			return window.JSON && window.JSON.parse ?
+				window.JSON.parse( data ) :
+				(new Function("return " + data))();
+
+		} else {
+			jQuery.error( "Invalid JSON: " + data );
+		}
+	},
+
+	// Cross-browser xml parsing
+	// (xml & tmp used internally)
+	parseXML: function( data , xml , tmp ) {
+
+		if ( window.DOMParser ) { // Standard
+			tmp = new DOMParser();
+			xml = tmp.parseFromString( data , "text/xml" );
+		} else { // IE
+			xml = new ActiveXObject( "Microsoft.XMLDOM" );
+			xml.async = "false";
+			xml.loadXML( data );
+		}
+
+		tmp = xml.documentElement;
+
+		if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
+			jQuery.error( "Invalid XML: " + data );
+		}
+
+		return xml;
+	},
+
+	noop: function() {},
+
+	// Evalulates a script in a global context
+	globalEval: function( data ) {
+		if ( data && rnotwhite.test(data) ) {
+			// Inspired by code by Andrea Giammarchi
+			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+			var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
+				script = document.createElement( "script" );
+
+			if ( jQuery.support.scriptEval() ) {
+				script.appendChild( document.createTextNode( data ) );
+			} else {
+				script.text = data;
+			}
+
+			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
+			// This arises when a base node is used (#2709).
+			head.insertBefore( script, head.firstChild );
+			head.removeChild( script );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+	},
+
+	// args is for internal usage only
+	each: function( object, callback, args ) {
+		var name, i = 0,
+			length = object.length,
+			isObj = length === undefined || jQuery.isFunction(object);
+
+		if ( args ) {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.apply( object[ name ], args ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( ; i < length; ) {
+					if ( callback.apply( object[ i++ ], args ) === false ) {
+						break;
+					}
+				}
+			}
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( var value = object[0];
+					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+			}
+		}
+
+		return object;
+	},
+
+	// Use native String.trim function wherever possible
+	trim: trim ?
+		function( text ) {
+			return text == null ?
+				"" :
+				trim.call( text );
+		} :
+
+		// Otherwise use our own trimming functionality
+		function( text ) {
+			return text == null ?
+				"" :
+				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+		},
+
+	// results is for internal usage only
+	makeArray: function( array, results ) {
+		var ret = results || [];
+
+		if ( array != null ) {
+			// The window, strings (and functions) also have 'length'
+			// The extra typeof function check is to prevent crashes
+			// in Safari 2 (See: #3039)
+			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+			var type = jQuery.type(array);
+
+			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+				push.call( ret, array );
+			} else {
+				jQuery.merge( ret, array );
+			}
+		}
+
+		return ret;
+	},
+
+	inArray: function( elem, array ) {
+		if ( array.indexOf ) {
+			return array.indexOf( elem );
+		}
+
+		for ( var i = 0, length = array.length; i < length; i++ ) {
+			if ( array[ i ] === elem ) {
+				return i;
+			}
+		}
+
+		return -1;
+	},
+
+	merge: function( first, second ) {
+		var i = first.length,
+			j = 0;
+
+		if ( typeof second.length === "number" ) {
+			for ( var l = second.length; j < l; j++ ) {
+				first[ i++ ] = second[ j ];
+			}
+
+		} else {
+			while ( second[j] !== undefined ) {
+				first[ i++ ] = second[ j++ ];
+			}
+		}
+
+		first.length = i;
+
+		return first;
+	},
+
+	grep: function( elems, callback, inv ) {
+		var ret = [], retVal;
+		inv = !!inv;
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, length = elems.length; i < length; i++ ) {
+			retVal = !!callback( elems[ i ], i );
+			if ( inv !== retVal ) {
+				ret.push( elems[ i ] );
+			}
+		}
+
+		return ret;
+	},
+
+	// arg is for internal usage only
+	map: function( elems, callback, arg ) {
+		var ret = [], value;
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, length = elems.length; i < length; i++ ) {
+			value = callback( elems[ i ], i, arg );
+
+			if ( value != null ) {
+				ret[ ret.length ] = value;
+			}
+		}
+
+		// Flatten any nested arrays
+		return ret.concat.apply( [], ret );
+	},
+
+	// A global GUID counter for objects
+	guid: 1,
+
+	proxy: function( fn, proxy, thisObject ) {
+		if ( arguments.length === 2 ) {
+			if ( typeof proxy === "string" ) {
+				thisObject = fn;
+				fn = thisObject[ proxy ];
+				proxy = undefined;
+
+			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
+				thisObject = proxy;
+				proxy = undefined;
+			}
+		}
+
+		if ( !proxy && fn ) {
+			proxy = function() {
+				return fn.apply( thisObject || this, arguments );
<