├── pwl ├── __init__.py ├── utils │ ├── __init__.py │ ├── daemonize.py │ ├── importlib.py │ └── daemon.py └── fastcgi.py ├── rsted ├── __init__.py ├── pdf.py └── html.py ├── localsphinx ├── __init__.py └── convert.py ├── var └── themes │ ├── README │ ├── template.txt │ ├── nature │ └── nature.css │ └── basic.css ├── Procfile ├── flaskext ├── __init__.py ├── helpers.py └── redis.py ├── static ├── markit │ ├── sets │ │ ├── rest │ │ │ ├── images │ │ │ │ ├── h1.png │ │ │ │ ├── h2.png │ │ │ │ ├── h3.png │ │ │ │ ├── h4.png │ │ │ │ ├── h5.png │ │ │ │ ├── h6.png │ │ │ │ ├── bold.png │ │ │ │ ├── code.png │ │ │ │ ├── link.png │ │ │ │ ├── italic.png │ │ │ │ ├── picture.png │ │ │ │ ├── preview.png │ │ │ │ ├── quotes.png │ │ │ │ ├── list-bullet.png │ │ │ │ ├── list-numeric.png │ │ │ │ ├── text_indent.png │ │ │ │ ├── text_monospace.png │ │ │ │ └── text_indent_remove.png │ │ │ ├── readme.txt │ │ │ ├── style.css │ │ │ └── set.js │ │ └── default │ │ │ ├── images │ │ │ ├── bold.png │ │ │ ├── link.png │ │ │ ├── clean.png │ │ │ ├── image.png │ │ │ ├── italic.png │ │ │ ├── picture.png │ │ │ ├── preview.png │ │ │ └── stroke.png │ │ │ ├── style.css │ │ │ └── set.js │ ├── skins │ │ ├── simple │ │ │ ├── images │ │ │ │ ├── menu.png │ │ │ │ ├── handle.png │ │ │ │ └── submenu.png │ │ │ └── style.css │ │ └── markitup │ │ │ ├── images │ │ │ ├── menu.png │ │ │ ├── handle.png │ │ │ ├── submenu.png │ │ │ ├── bg-editor.png │ │ │ ├── bg-container.png │ │ │ ├── bg-editor-html.png │ │ │ ├── bg-editor-json.png │ │ │ ├── bg-editor-wiki.png │ │ │ ├── bg-editor-xml.png │ │ │ ├── bg-editor-bbcode.png │ │ │ ├── bg-editor-textile.png │ │ │ ├── bg-editor-dotclear.png │ │ │ └── bg-editor-markdown.png │ │ │ └── style.css │ ├── templates │ │ ├── preview.css │ │ └── preview.html │ ├── jquery.markitup.pack.js │ └── jquery.markitup.js ├── style │ ├── overcast │ │ ├── images │ │ │ ├── ui-icons_3383bb_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_70b2e1_256x240.png │ │ │ ├── ui-icons_999999_256x240.png │ │ │ ├── ui-icons_fbc856_256x240.png │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_0_eeeeee_40x100.png │ │ │ ├── ui-bg_flat_55_c0402a_40x100.png │ │ │ ├── ui-bg_flat_55_eeeeee_40x100.png │ │ │ ├── ui-bg_glass_35_dddddd_1x400.png │ │ │ ├── ui-bg_glass_60_eeeeee_1x400.png │ │ │ ├── ui-bg_glass_100_f8f8f8_1x400.png │ │ │ ├── ui-bg_inset-hard_75_999999_1x100.png │ │ │ └── ui-bg_inset-soft_50_c9c9c9_1x100.png │ │ └── jquery-ui-1.8.16.custom.css │ ├── site.css │ ├── menu.css │ └── base.css ├── sphinx │ ├── pygments.css │ ├── flasky.css │ └── basic.css └── scripts │ ├── editor.js │ └── jquery.layout.min-1.2.0.js ├── .gitignore ├── settings.py ├── templates ├── about.html ├── base.html └── index.html ├── requirements.txt ├── README.rst ├── rsted.fcgi ├── LICENSE ├── sbin └── rsted ├── application.py └── conf.py /pwl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rsted/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /localsphinx/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwl/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /var/themes/README: -------------------------------------------------------------------------------- 1 | Themes from the sphinx mostly 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn -k gevent -w 6 application:app 2 | -------------------------------------------------------------------------------- /flaskext/__init__.py: -------------------------------------------------------------------------------- 1 | __import__('pkg_resources').declare_namespace(__name__) -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h1.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h2.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h3.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h4.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h5.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/h6.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/bold.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/code.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/link.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | /src/settings_base.py 3 | /src/settings_local.py 4 | .project 5 | .pydevproject 6 | .settings 7 | .tmp* 8 | /var/run 9 | -------------------------------------------------------------------------------- /static/markit/sets/default/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/bold.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/link.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/italic.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/picture.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/preview.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/quotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/quotes.png -------------------------------------------------------------------------------- /static/markit/skins/simple/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/simple/images/menu.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/clean.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/image.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/italic.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/picture.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/preview.png -------------------------------------------------------------------------------- /static/markit/sets/default/images/stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/default/images/stroke.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/menu.png -------------------------------------------------------------------------------- /static/markit/skins/simple/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/simple/images/handle.png -------------------------------------------------------------------------------- /static/markit/skins/simple/images/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/simple/images/submenu.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/list-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/list-bullet.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/list-numeric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/list-numeric.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/text_indent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/text_indent.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/handle.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/submenu.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/text_monospace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/text_monospace.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-container.png -------------------------------------------------------------------------------- /static/markit/sets/rest/images/text_indent_remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/sets/rest/images/text_indent_remove.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-html.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-json.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-wiki.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-xml.png -------------------------------------------------------------------------------- /static/markit/templates/preview.css: -------------------------------------------------------------------------------- 1 | /* preview style examples */ 2 | body { 3 | background-color:#EFEFEF; 4 | font:70% Verdana, Arial, Helvetica, sans-serif; 5 | } -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-bbcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-bbcode.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-textile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-textile.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-icons_3383bb_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-icons_3383bb_256x240.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-icons_70b2e1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-icons_70b2e1_256x240.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-icons_999999_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-icons_999999_256x240.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-icons_fbc856_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-icons_fbc856_256x240.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-dotclear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-dotclear.png -------------------------------------------------------------------------------- /static/markit/skins/markitup/images/bg-editor-markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/markit/skins/markitup/images/bg-editor-markdown.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_flat_0_eeeeee_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_flat_0_eeeeee_40x100.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_flat_55_c0402a_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_flat_55_c0402a_40x100.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_flat_55_eeeeee_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_flat_55_eeeeee_40x100.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_glass_35_dddddd_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_glass_35_dddddd_1x400.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_glass_60_eeeeee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_glass_60_eeeeee_1x400.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_inset-hard_75_999999_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_inset-hard_75_999999_1x100.png -------------------------------------------------------------------------------- /static/style/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/readthedocs/livesphinx/HEAD/static/style/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png -------------------------------------------------------------------------------- /var/themes/template.txt: -------------------------------------------------------------------------------- 1 | %(head_prefix)s 2 | %(head)s 3 | %(stylesheet)s 4 | %(body_prefix)s 5 |
6 | %(body_pre_docinfo)s 7 | %(docinfo)s 8 | 9 | %(body)s 10 |
11 | 12 | %(body_suffix)s 13 | -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | 2 | # configuration 3 | DEBUG = True 4 | 5 | RUN_PATH = 'var/run' 6 | PID_FILE = 'fastcgi.pid' 7 | SOCKET_FILE = 'rsted.sock' 8 | FCGI_UMASK = '000' # you can override this in settings_local.py if you wish 9 | 10 | try: 11 | from settings_local import * 12 | except ImportError: 13 | pass 14 | -------------------------------------------------------------------------------- /static/markit/sets/rest/readme.txt: -------------------------------------------------------------------------------- 1 | Markup language: 2 | reStructuredText 3 | 4 | Description: 5 | Fork from Markdown for reStructuredText 6 | 7 | Install: 8 | - Download the zip file 9 | - Unzip it in your markItUp! sets folder 10 | - Modify your JS link to point at this set.js 11 | - Modify your CSS link to point at this style.css -------------------------------------------------------------------------------- /templates/about.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 5 |

6 | Site uses standard Sphinx. 7 | This is a forked version of: http://github.com/anru/rsted 8 |

9 | 10 |

11 | If you like this project, please consider donating on Gittip 12 |

13 | 14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /static/markit/templates/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | markItUp! preview template 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.10.1 2 | Jinja2==2.7.1 3 | MarkupSafe==0.18 4 | Pygments==1.6 5 | SQLAlchemy==0.8.2 6 | Sphinx==1.2b2 7 | Werkzeug==0.9.4 8 | docutils==0.11 9 | ## FIXME: could not find svn URL in dependency_links for this package: 10 | flup==1.0.3.dev-20110405 11 | gevent==0.13.8 12 | greenlet==0.4.1 13 | gunicorn==18.0 14 | heroku==0.1.4 15 | itsdangerous==0.23 16 | pdfrw==0.1 17 | python-dateutil==1.5 18 | redis==2.8.0 19 | reportlab==2.7 20 | requests==2.0.0 21 | rst2pdf==0.93.dev 22 | wsgiref==0.1.2 23 | -------------------------------------------------------------------------------- /rsted/pdf.py: -------------------------------------------------------------------------------- 1 | from rst2pdf.createpdf import RstToPdf 2 | import codecs 3 | utf8codec = codecs.lookup('utf-8') 4 | 5 | from flask import current_app 6 | 7 | try: 8 | from cStringIO import StringIO 9 | except ImportError: 10 | from StringIO import StringIO 11 | 12 | def rst2pdf(content, theme=None): 13 | topdf = RstToPdf(basedir=current_app.config.root_path, breaklevel=0) 14 | 15 | buf = StringIO() 16 | if not content: 17 | content = '\0' 18 | content_utf8 = utf8codec.encode(content)[0] 19 | topdf.createPdf(text=content_utf8, output=buf, compressed=False) 20 | 21 | return buf.getvalue() 22 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Simple online editor for reStructuredText on Flask. 2 | 3 | Try it where: http://rst.ninjs.org/ 4 | 5 | Getting setup 6 | ------------- 7 | 8 | Requirements for rsted: 9 | 10 | * Flask 11 | * Redis 12 | * rst2html (from Docutils) 13 | 14 | These requirements are expressed in the pip-requirements.txt file and may be 15 | installed by running the following (from within a virtual environment):: 16 | 17 | pip install -r requirements.txt 18 | 19 | 20 | How to run 21 | ---------- 22 | 23 | From within your environment, just run:: 24 | 25 | ./application.py 26 | 27 | This will start a server on port 5000. Just visit http://localhost:5000/ in 28 | your browser. 29 | -------------------------------------------------------------------------------- /flaskext/helpers.py: -------------------------------------------------------------------------------- 1 | from functools import wraps 2 | from types import GeneratorType 3 | 4 | from flask import render_template 5 | 6 | 7 | def render_html(template): 8 | def decorator(func): 9 | @wraps(func) 10 | def wrapped(*args, **kwargs): 11 | result = func(*args, **kwargs) 12 | 13 | if isinstance(result, GeneratorType): 14 | variables = {} 15 | for i in result: 16 | name, value = i 17 | variables[name] = value 18 | else: 19 | variables = result 20 | 21 | return render_template(template, **variables) 22 | return wrapped 23 | return decorator -------------------------------------------------------------------------------- /static/style/site.css: -------------------------------------------------------------------------------- 1 | 2 | .b_page_cont, .b_page_left { 3 | position: relative; 4 | } 5 | 6 | .b_page_left { 7 | display: block; 8 | width: 48.5%; 9 | } 10 | 11 | .b_page_center { 12 | position: absolute; 13 | top: 0; 14 | width: 100%; 15 | } 16 | 17 | .b_page_right { 18 | margin-left: 50%; 19 | position: absolute; 20 | left: 0; 21 | right: 0; 22 | top: 0; 23 | bottom: 0; 24 | } 25 | 26 | .themes { 27 | display: inline-block; 28 | } 29 | 30 | #editor { 31 | min-height: 75px; 32 | } 33 | 34 | #browse { 35 | border: 1px solid #CCC; 36 | position: relative; 37 | margin-top: 1px; 38 | height: 330px; 39 | 40 | width: 100%; 41 | background-color: white; 42 | } 43 | 44 | #editor { 45 | width: 100%; 46 | resize: vertical; 47 | } 48 | -------------------------------------------------------------------------------- /static/markit/sets/default/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | .markItUp .markItUpButton1 a { 6 | background-image:url(images/bold.png); 7 | } 8 | .markItUp .markItUpButton2 a { 9 | background-image:url(images/italic.png); 10 | } 11 | .markItUp .markItUpButton3 a { 12 | background-image:url(images/stroke.png); 13 | } 14 | 15 | .markItUp .markItUpButton4 a { 16 | background-image:url(images/picture.png); 17 | } 18 | .markItUp .markItUpButton5 a { 19 | background-image:url(images/link.png); 20 | } 21 | 22 | .markItUp .markItUpButton6 a { 23 | background-image:url(images/clean.png); 24 | } 25 | .markItUp .preview a { 26 | background-image:url(images/preview.png); 27 | } -------------------------------------------------------------------------------- /rsted.fcgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | import os 4 | from os.path import join as J 5 | from pwl.fastcgi import runfastcgi 6 | from application import app 7 | 8 | full_run_path = J(app.config.root_path, app.config.get('RUN_PATH', 'var/run')) 9 | 10 | if not os.path.isdir(full_run_path): 11 | os.mkdir(full_run_path) 12 | 13 | # default options 14 | fcgi_opts = { 15 | 'daemonize': 'yes', 16 | 'pidfile': os.path.join(full_run_path, app.config.get('PID_FILE', 'fastcgi.pid')), 17 | 'method': 'prefork', 18 | 'socket': os.path.join(full_run_path, app.config.get('SOCKET_FILE', 'rsted.sock')), 19 | 'workdir': app.config.root_path, 20 | 'maxrequests': 100, 21 | 'umask': app.config.get('FCGI_UMASK', '002') 22 | } 23 | 24 | run_as = app.config.get('RUN_AS') 25 | if run_as: 26 | fcgi_opts['run_as'] = run_as 27 | 28 | args=[] 29 | runfastcgi(app, args, **fcgi_opts) 30 | -------------------------------------------------------------------------------- /localsphinx/convert.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import os 3 | import shutil 4 | import tempfile 5 | 6 | from sphinx.websupport import WebSupport 7 | 8 | @contextlib.contextmanager 9 | def mkdtemp(suffix='', prefix='tmp', parent_dir=None): 10 | path = tempfile.mkdtemp(suffix, prefix, parent_dir) 11 | try: 12 | yield unicode(path) 13 | finally: 14 | shutil.rmtree(path, ignore_errors=True) 15 | 16 | def magic_convert_function(text): 17 | with mkdtemp() as outdir: 18 | with mkdtemp() as indir: 19 | shutil.copy('conf.py', indir) 20 | with open(os.path.join(indir, 'index.rst'), 'w') as infile: 21 | infile.write(text) 22 | 23 | support = WebSupport(srcdir=indir, 24 | builddir=outdir) 25 | print "Building Sphinx at %s & %s" % (indir, outdir) 26 | print "Current dir: %s" % os.listdir(indir) 27 | support.build() 28 | contents = support.get_document('index') 29 | return contents['body'] 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Andrey Rublev 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /rsted/html.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import sys 4 | from os.path import join as J 5 | #import codecs 6 | 7 | from docutils.core import publish_string 8 | 9 | #utf8codec = codecs.lookup('utf-8') 10 | 11 | # see http://docutils.sourceforge.net/docs/user/config.html 12 | default_rst_opts = { 13 | 'no_generator': True, 14 | 'no_source_link': True, 15 | 'tab_width': 4, 16 | 'file_insertion_enabled': False, 17 | 'raw_enabled': False, 18 | 'stylesheet_path': None, 19 | 'traceback': True, 20 | 'halt_level': 5, 21 | } 22 | 23 | def rst2html(rst, theme=None, opts=None): 24 | rst_opts = default_rst_opts.copy() 25 | if opts: 26 | rst_opts.update(opts) 27 | rst_opts['template'] = 'var/themes/template.txt' 28 | 29 | stylesheets = ['basic.css'] 30 | if theme: 31 | stylesheets.append('%s/%s.css' % (theme, theme)) 32 | rst_opts['stylesheet'] = ','.join([J('var/themes/', p) for p in stylesheets ]) 33 | 34 | out = publish_string(rst, writer_name='html', settings_overrides=rst_opts) 35 | 36 | return out 37 | 38 | -------------------------------------------------------------------------------- /flaskext/redis.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | import redis 3 | from flask import g 4 | 5 | class RedisManager(object): 6 | 7 | def __init__(self, app=None): 8 | 9 | if app is not None: 10 | self.init_app(app) 11 | else: 12 | self.app = None 13 | self.instance = None 14 | 15 | def init_app(self, app): 16 | """ 17 | Used to initialize redis with app object 18 | """ 19 | 20 | app.config.setdefault('REDIS_HOST', 'localhost') 21 | app.config.setdefault('REDIS_PORT', 6379) 22 | app.config.setdefault('REDIS_DB', 0) 23 | app.config.setdefault('REDIS_PASSWORD', None) 24 | 25 | self.app = app 26 | self._connect() 27 | 28 | 29 | def _connect(self): 30 | self.instance = redis.Redis(host=self.app.config['REDIS_HOST'], 31 | port=self.app.config['REDIS_PORT'], 32 | db=self.app.config['REDIS_DB'], 33 | password=self.app.config['REDIS_PASSWORD']) 34 | 35 | def get_instance(self): 36 | return self.instance 37 | -------------------------------------------------------------------------------- /pwl/utils/daemonize.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import sys 4 | import signal 5 | 6 | def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): 7 | '''Robustly turn into a UNIX daemon, running in our_home_dir.''' 8 | 9 | # On some systems, the fork() system call resets some of the 10 | # signal handler, so save them here. 11 | # Esp. linux uses SIGUSR1 in the pthread library. 12 | usr1 = signal.signal(signal.SIGUSR1, signal.SIG_IGN) 13 | 14 | # First fork 15 | try: 16 | if os.fork() > 0: 17 | sys.exit(0) # kill off parent 18 | except OSError, e: 19 | sys.stderr.write('fork #1 failed: (%d) %s\n' % (e.errno, e.strerror)) 20 | sys.exit(1) 21 | os.setsid() 22 | os.chdir(our_home_dir) 23 | os.umask(umask) 24 | 25 | # Second fork 26 | try: 27 | if os.fork() > 0: 28 | os._exit(0) 29 | except OSError, e: 30 | sys.stderr.write('fork #2 failed: (%d) %s\n' % (e.errno, e.strerror)) 31 | os._exit(1) 32 | 33 | signal.signal(signal.SIGUSR1, usr1) 34 | si = open('/dev/null', 'r') 35 | so = open(out_log, 'a+', 0) 36 | se = open(err_log, 'a+', 0) 37 | os.dup2(si.fileno(), sys.stdin.fileno()) 38 | os.dup2(so.fileno(), sys.stdout.fileno()) 39 | os.dup2(se.fileno(), sys.stderr.fileno()) 40 | # Set custom file descriptors so that they get proper buffering. 41 | sys.stdout, sys.stderr = so, se 42 | -------------------------------------------------------------------------------- /static/markit/sets/default/set.js: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // markItUp! 3 | // ---------------------------------------------------------------------------- 4 | // Copyright (C) 2008 Jay Salvat 5 | // http://markitup.jaysalvat.com/ 6 | // ---------------------------------------------------------------------------- 7 | // Html tags 8 | // http://en.wikipedia.org/wiki/html 9 | // ---------------------------------------------------------------------------- 10 | // Basic set. Feel free to add more tags 11 | // ---------------------------------------------------------------------------- 12 | mySettings = { 13 | onShiftEnter: {keepDefault:false, replaceWith:'
\n'}, 14 | onCtrlEnter: {keepDefault:false, openWith:'\n

', closeWith:'

'}, 15 | onTab: {keepDefault:false, replaceWith:' '}, 16 | markupSet: [ 17 | {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, 18 | {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, 19 | {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, 20 | {separator:'---------------' }, 21 | {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, 22 | {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, 23 | {separator:'---------------' }, 24 | {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, 25 | {name:'Preview', className:'preview', call:'preview'} 26 | ] 27 | } -------------------------------------------------------------------------------- /static/markit/sets/rest/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | 6 | .markItUp .markItUpButton1 a { 7 | background-image:url(images/h1.png); 8 | } 9 | .markItUp .markItUpButton2 a { 10 | background-image:url(images/h2.png); 11 | } 12 | .markItUp .markItUpButton3 a { 13 | background-image:url(images/h3.png); 14 | } 15 | .markItUp .markItUpButton4 a { 16 | background-image:url(images/h4.png); 17 | } 18 | .markItUp .markItUpButton5 a { 19 | background-image:url(images/h5.png); 20 | } 21 | .markItUp .markItUpButton6 a { 22 | background-image:url(images/h6.png); 23 | } 24 | 25 | .markItUp .buttonBold a { 26 | background-image:url(images/bold.png); 27 | } 28 | .markItUp .buttonItalic a { 29 | background-image:url(images/italic.png); 30 | } 31 | .markItUp .buttonMonospace a { 32 | background-image:url(images/text_monospace.png); 33 | } 34 | 35 | .markItUp .buttonIndent a { 36 | background-image:url(images/text_indent.png); 37 | } 38 | 39 | .markItUp .buttonRemoveIndent a { 40 | background-image:url(images/text_indent_remove.png); 41 | } 42 | 43 | .markItUp .buttonBulletedList a { 44 | background-image:url(images/list-bullet.png); 45 | } 46 | .markItUp .buttonNumericList a { 47 | background-image:url(images/list-numeric.png); 48 | } 49 | 50 | .markItUp .buttonPicture a { 51 | background-image:url(images/picture.png); 52 | } 53 | .markItUp .buttonLink a { 54 | background-image:url(images/link.png); 55 | } 56 | 57 | .markItUp .markItUpButton13 a { 58 | background-image:url(images/quotes.png); 59 | } 60 | .markItUp .markItUpButton14 a { 61 | background-image:url(images/code.png); 62 | } 63 | 64 | .markItUp .preview a { 65 | background-image:url(images/preview.png); 66 | } -------------------------------------------------------------------------------- /sbin/rsted: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, sys 4 | from os.path import join as J 5 | import time 6 | 7 | root_path = J(os.path.dirname(os.path.realpath(__file__)), '../') 8 | root_path = os.path.normpath(root_path) 9 | sys.path.insert(0, root_path) 10 | 11 | from pwl.utils.daemon import BaseDaemon 12 | from application import app 13 | 14 | run_path = J(app.config.root_path, app.config.get('RUN_PATH', 'var/run')) 15 | 16 | try: 17 | action = sys.argv[1] 18 | except IndexError: 19 | action = 'status' 20 | 21 | class RstedDaemon(BaseDaemon): 22 | NO_DAEMONIZE = True 23 | NO_WRITE_PID = True 24 | 25 | def run(self): 26 | os.system('python ' + J(app.config.root_path, 'rsted.fcgi')) 27 | 28 | def print_status(self): 29 | pidexists = os.path.exists(self.pidfile) 30 | print "Pidfile (%s) exists:" % self.pidfile, ('Yes' if pidexists else 'No') 31 | if pidexists: 32 | pid = self.readpid() 33 | count = int(os.popen("ps --pid %d --no-heading| wc -l" % pid).read().strip()) 34 | running = count > 0 35 | print "Running: %s" % ('Yes' if running else 'No') 36 | 37 | def is_running(self): 38 | pidexists = os.path.exists(self.pidfile) 39 | if pidexists: 40 | pid = self.readpid() 41 | count = int(os.popen("ps --pid %d --no-heading| wc -l" % pid).read().strip()) 42 | return count > 0 43 | return False 44 | 45 | def ensure_started(self): 46 | if not self.is_running(): 47 | self.delpid() 48 | self.start() 49 | 50 | pidfile = J(run_path, 'fastcgi.pid') 51 | daemon = RstedDaemon(pidfile) 52 | 53 | if action == 'start': 54 | daemon.start() 55 | elif action == 'stop': 56 | daemon.stop() 57 | elif action == 'restart': 58 | daemon.restart() 59 | elif action == 'status': 60 | daemon.print_status() 61 | elif action == 'check': 62 | if not daemon.is_running(): 63 | sys.exit(1) 64 | elif action == 'ensure_started': 65 | daemon.ensure_started() 66 | 67 | 68 | -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block head %} 5 | 6 | {% block title %}Online Sphinx editor{% endblock %} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {% endblock %} 20 | 21 | 22 | {% block body_head %} 23 | {% endblock %} 24 | 36 | 41 | 42 |
43 | {%- block content %} 44 | {% endblock -%} 45 |
46 | 47 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /static/style/menu.css: -------------------------------------------------------------------------------- 1 | #menu { 2 | margin: 0; 3 | line-height: 100%; 4 | } 5 | 6 | 7 | #menu li { 8 | float: left; 9 | margin: 0 0px; 10 | padding: 0 0 0px; 11 | position: relative; 12 | list-style: none; 13 | } 14 | 15 | 16 | /* main level link */ 17 | #menu li a { 18 | color: #e7e5e5; 19 | background: transparent; 20 | text-decoration: none; 21 | display: block; 22 | padding: 8px 10px; 23 | margin: 0; 24 | /*text-shadow: 0 1px 1px rgba(0,0,0, 1);*/ 25 | border: 1px solid transparent; 26 | } 27 | 28 | #menu li.active a { 29 | color: #213A49; 30 | background-color: #E1EAEF; 31 | } 32 | 33 | 34 | 35 | /* dropdown */ 36 | #menu li:hover > ul { 37 | display: block; 38 | } 39 | 40 | /* level 2 list */ 41 | #menu ul { 42 | display: none; 43 | z-index: 50; 44 | margin: 0; 45 | padding: 0; 46 | width: 185px; 47 | position: absolute; 48 | top: 32px; 49 | left: 0; 50 | background: #213A49; 51 | /*border: solid 1px #848484;*/ 52 | 53 | -webkit-box-shadow: 0 1px 3px #213A49; 54 | -moz-box-shadow: 0 1px 3px #213A49; 55 | box-shadow: 0 1px 3px #213A49; 56 | } 57 | #menu ul li { 58 | float: none; 59 | margin: 0; 60 | padding: 0; 61 | } 62 | 63 | #menu ul li a { 64 | display: block; 65 | width: 160px; 66 | background: transparent; 67 | padding: 3px 7px; 68 | color: #fff !important; 69 | border: 1px solid transparent; 70 | } 71 | 72 | /* sub levels link hover */ 73 | #menu li a:hover { 74 | text-decoration: underline; 75 | } 76 | 77 | #menu li.active a:hover { 78 | text-decoration: none; 79 | } 80 | 81 | 82 | 83 | #menu li a.jslink:hover { 84 | 85 | } 86 | 87 | #menu li ul li { 88 | border-bottom: 1px solid #6f6658; 89 | padding: 3px 4px; 90 | width: 174px; 91 | } 92 | #menu li ul li:last-child { 93 | border-bottom: none; 94 | } 95 | 96 | /* clearfix */ 97 | #menu:after { 98 | content: "."; 99 | display: block; 100 | clear: both; 101 | visibility: hidden; 102 | line-height: 0; 103 | height: 0; 104 | } 105 | -------------------------------------------------------------------------------- /pwl/utils/importlib.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | #Taken from Python 2.7 with permission from/by the original author. 4 | import sys 5 | import os 6 | 7 | 8 | def _resolve_name(name, package, level): 9 | """Return the absolute name of the module to be imported.""" 10 | 11 | if not hasattr(package, 'rindex'): 12 | raise ValueError("'package' not set to a string") 13 | dot = len(package) 14 | for x in xrange(level, 1, -1): 15 | try: 16 | dot = package.rindex('.', 0, dot) 17 | except ValueError: 18 | raise ValueError('attempted relative import beyond top-level package') 19 | return '%s.%s' % (package[:dot], name) 20 | 21 | 22 | def import_module(name, package=None): 23 | """Import a module. 24 | 25 | The 'package' argument is required when performing a relative import. It 26 | specifies the package to use as the anchor point from which to resolve the 27 | relative import to an absolute import. 28 | 29 | """ 30 | 31 | if name.startswith('.'): 32 | if not package: 33 | raise TypeError("relative imports require the 'package' argument") 34 | level = 0 35 | for character in name: 36 | if character != '.': 37 | break 38 | level += 1 39 | name = _resolve_name(name[level:], package, level) 40 | __import__(name) 41 | return sys.modules[name] 42 | 43 | def import_package_modules(package): 44 | pkg = import_module(package) 45 | path = pkg.__path__[0] 46 | 47 | names = [name[:-3] for name in os.listdir(path) if name.endswith('.py') and not name.startswith('_')] 48 | modules = [] 49 | 50 | for name in names: 51 | module = import_module('.'.join([package, name])) 52 | modules.append(module) 53 | return modules 54 | 55 | 56 | def import_attribute(name): 57 | """ 58 | Import attribute using string reference. 59 | Example: 60 | import_attribute('a.b.c.foo') 61 | Throws ImportError or AttributeError if module or attribute do not exist. 62 | """ 63 | i = name.rfind('.') 64 | 65 | module, attr = name[:i], name[i+1:] 66 | mod = __import__(module, globals(), locals(), [attr]) 67 | 68 | return getattr(mod, attr) 69 | 70 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block head %} 4 | {{ super() }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 27 | 28 | {% endblock %} 29 | 30 | 31 | {% block editor_nav %} 32 | 47 | {% endblock %} 48 | 49 | {% block content %} 50 |
51 |
52 | 53 |
54 |
55 |
56 |
Output 57 |
58 |
59 |
60 |
61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 |
70 | 71 | 72 |
73 | 74 | {% endblock %} 75 | -------------------------------------------------------------------------------- /static/markit/skins/simple/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! Universal MarkUp Engine, JQuery plugin 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | .markItUp * { 6 | margin:0px; padding:0px; 7 | outline:none; 8 | } 9 | .markItUp a:link, 10 | .markItUp a:visited { 11 | color:#000; 12 | text-decoration:none; 13 | } 14 | .markItUp { 15 | /*width:700px;*/ 16 | margin:5px 0 5px 0; 17 | } 18 | .markItUpContainer { 19 | font:11px Verdana, Arial, Helvetica, sans-serif; 20 | } 21 | .markItUpEditor { 22 | font:12px monospace; 23 | padding:5px; 24 | /*width:690px;*/ 25 | height:320px; 26 | clear:both; display:block; 27 | line-height:18px; 28 | overflow:auto; 29 | } 30 | .markItUpPreviewFrame { 31 | overflow:auto; 32 | background-color:#FFF; 33 | width:99.9%; 34 | height:300px; 35 | margin:5px 0; 36 | } 37 | .markItUpFooter { 38 | width:100%; 39 | } 40 | .markItUpResizeHandle { 41 | overflow:hidden; 42 | width:22px; height:5px; 43 | margin-left:auto; 44 | margin-right:auto; 45 | background-image:url(images/handle.png); 46 | cursor:n-resize; 47 | } 48 | /***************************************************************************************/ 49 | /* first row of buttons */ 50 | .markItUpHeader ul li { 51 | list-style:none; 52 | float:left; 53 | position:relative; 54 | } 55 | .markItUpHeader ul li:hover > ul{ 56 | display:block; 57 | } 58 | .markItUpHeader ul .markItUpDropMenu { 59 | background:transparent url(images/menu.png) no-repeat 115% 50%; 60 | margin-right:5px; 61 | } 62 | .markItUpHeader ul .markItUpDropMenu li { 63 | margin-right:0px; 64 | } 65 | /* next rows of buttons */ 66 | .markItUpHeader ul ul { 67 | display:none; 68 | position:absolute; 69 | top:18px; left:0px; 70 | background:#FFF; 71 | border:1px solid #000; 72 | } 73 | .markItUpHeader ul ul li { 74 | float:none; 75 | border-bottom:1px solid #000; 76 | } 77 | .markItUpHeader ul ul .markItUpDropMenu { 78 | background:#FFF url(images/submenu.png) no-repeat 100% 50%; 79 | } 80 | .markItUpHeader ul .markItUpSeparator { 81 | margin:0 10px; 82 | width:1px; 83 | height:16px; 84 | overflow:hidden; 85 | background-color:#CCC; 86 | } 87 | .markItUpHeader ul ul .markItUpSeparator { 88 | width:auto; height:1px; 89 | margin:0px; 90 | } 91 | /* next rows of buttons */ 92 | .markItUpHeader ul ul ul { 93 | position:absolute; 94 | top:-1px; left:150px; 95 | } 96 | .markItUpHeader ul ul ul li { 97 | float:none; 98 | } 99 | .markItUpHeader ul a { 100 | display:block; 101 | width:16px; height:16px; 102 | text-indent:-10000px; 103 | background-repeat:no-repeat; 104 | padding:3px; 105 | margin:0px; 106 | } 107 | .markItUpHeader ul ul a { 108 | display:block; 109 | padding-left:0px; 110 | text-indent:0; 111 | width:120px; 112 | padding:5px 5px 5px 25px; 113 | background-position:2px 50%; 114 | } 115 | .markItUpHeader ul ul a:hover { 116 | color:#FFF; 117 | background-color:#000; 118 | } 119 | -------------------------------------------------------------------------------- /application.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # all the imports 3 | 4 | import os, sys 5 | reload(sys) 6 | sys.setdefaultencoding('utf-8') 7 | 8 | from flask import Flask, request, render_template, make_response, url_for 9 | 10 | from rsted.html import rst2html as _rst2html 11 | from rsted.pdf import rst2pdf as _rst2pdf 12 | from localsphinx.convert import magic_convert_function 13 | 14 | from flaskext.redis import RedisManager 15 | from flaskext.helpers import render_html 16 | 17 | 18 | # create our little application :) 19 | app = Flask(__name__) 20 | app.config.from_pyfile(os.environ.get('RSTED_CONF', 'settings.py')) 21 | redis = RedisManager(app).get_instance() 22 | 23 | REDIS_EXPIRE = app.config.setdefault('REDIS_EXPIRE', 60*60*24*30*6) # Default 6 months 24 | REDIS_PREFIX = app.config.setdefault('REDIS_PREFIX', 'rst_') 25 | 26 | 27 | def view_is_active(view_name): 28 | if request.path == url_for(view_name): 29 | return 'active' 30 | return '' 31 | 32 | @app.context_processor 33 | def ctx_pro(): 34 | return { 35 | 'MEDIA_URL': '/static/', 36 | 'is_active': view_is_active 37 | } 38 | 39 | @app.route("/") 40 | @render_html('index.html') 41 | def index(): 42 | yield 'js_params', {'theme': request.args.get('theme', '')} 43 | 44 | saved_doc_id = request.args.get('n') 45 | if saved_doc_id: 46 | rst = redis.get('%s%s' % (REDIS_PREFIX, saved_doc_id)) 47 | if rst: 48 | yield 'rst', rst 49 | yield 'document', saved_doc_id 50 | 51 | @app.route('/about/') 52 | def about(): 53 | return render_template('about.html') 54 | 55 | @app.route('/srv/rst2html/', methods=['POST', 'GET']) 56 | def rst2html(): 57 | rst = request.form.get('rst', '') 58 | theme = request.form.get('theme') 59 | if theme == 'basic': 60 | theme = None 61 | html = magic_convert_function(rst) 62 | return html 63 | 64 | @app.route('/srv/rst2pdf/', methods=['POST']) 65 | def rst2pdf(): 66 | rst = request.form.get('rst', '') 67 | theme = request.form.get('theme') 68 | if theme == 'basic': 69 | theme = None 70 | 71 | pdf = _rst2pdf(rst, theme=theme) 72 | responce = make_response(pdf) 73 | responce.headers['Content-Type'] = 'application/pdf' 74 | responce.headers['Content-Disposition'] = 'attachment; filename="rst.pdf"' 75 | responce.headers['Content-Transfer-Encoding'] = 'binary' 76 | return responce 77 | 78 | @app.route('/srv/save_rst/', methods=['POST']) 79 | def save_rst(): 80 | rst = request.form.get('rst') 81 | if not rst: 82 | return '' 83 | 84 | from hashlib import md5 85 | 86 | md5sum = md5(rst).hexdigest() 87 | redis_key = '%s%s' % (REDIS_PREFIX, md5sum) 88 | 89 | if redis.setnx(redis_key, rst) and REDIS_EXPIRE: 90 | redis.expire(redis_key, REDIS_EXPIRE) 91 | response = make_response(md5sum) 92 | response.headers['Content-Type'] = 'text/plain' 93 | return response 94 | 95 | @app.route('/srv/del_rst/', methods=['GET']) 96 | def del_rst(): 97 | saved_id = request.args.get('n') 98 | if saved_id: 99 | redis_key = '%s%s' % (REDIS_PREFIX, saved_id) 100 | redis.delete(redis_key) 101 | 102 | response = make_response() 103 | response.headers['Content-Type'] = 'text/plain' 104 | return response 105 | 106 | 107 | if __name__ == '__main__': 108 | app.run(host='0.0.0.0') 109 | -------------------------------------------------------------------------------- /static/style/base.css: -------------------------------------------------------------------------------- 1 | 2 | html, body, #container { 3 | padding: 0; 4 | margin: 0; 5 | height: 100%; 6 | background-color: #e1eaef; 7 | } 8 | 9 | #header { 10 | background-color: #213A49; 11 | text-align: center; 12 | } 13 | 14 | #header, #footer { 15 | color: #E1EAEF; 16 | } 17 | 18 | 19 | #header h1 { 20 | margin: 0; 21 | padding-top: 11px; 22 | font-size: 25px; 23 | } 24 | 25 | menu#navigation 26 | { 27 | margin: 0; 28 | padding: 0; 29 | width: 100%; 30 | } 31 | 32 | #navigation ul { 33 | margin: 0; 34 | padding: 0; 35 | } 36 | 37 | 38 | #content { 39 | clear: left; 40 | padding: 2px 11px; 41 | /*background-color: #88B3F9;*/ 42 | } 43 | 44 | #content h2 { 45 | color: #000; 46 | font-size: 160%; 47 | margin: 0 0 .5em; 48 | } 49 | 50 | #footer { 51 | background: #2e3341; 52 | text-align: right; 53 | padding: 11px; 54 | color: #E1EAEF; 55 | position: fixed; 56 | left: 0; 57 | right: 0; 58 | bottom: 0; 59 | font-size: 0.85em; 60 | box-shadow: 0 -1px 1px #2E3341; 61 | -moz-box-shadow: 0 -1px 1px #2E3341; 62 | -webkit-box-shadow: 0 -1px 1px #2E3341; 63 | -ms-box-shadow: 0 -1px 1px #2E3341; 64 | } 65 | 66 | #footer a { 67 | color: #E1EAEF; 68 | } 69 | 70 | #footer a:visited { 71 | color: #e1e5ef; 72 | } 73 | 74 | li.ext_link { 75 | } 76 | 77 | 78 | .jslink { 79 | text-decoration: none; 80 | } 81 | 82 | .ext_link { 83 | text-decoration: underline; 84 | 85 | } 86 | 87 | 88 | .showLinkDialog { 89 | height: 40px; 90 | width: 400px; 91 | border: 1px solid white; 92 | background-color: #bcF; 93 | -moz-border-radius: 3px; 94 | } 95 | 96 | .showLinkDialog .hider { 97 | width: 100%; 98 | height: 13px; 99 | background: -moz-linear-gradient(-90deg, #BBCCFF, #103b67); 100 | cursor: pointer; 101 | } 102 | 103 | .left { 104 | float: left; 105 | } 106 | 107 | .right { 108 | float: right; 109 | } 110 | 111 | .ui-widget { 112 | font-size: 0.9em !important; 113 | } 114 | 115 | a#github-ribbon { 116 | position: fixed; 117 | top: -5px; 118 | right: 5px; 119 | width: 150px; 120 | line-height: 1; 121 | padding: 8px 5px 5px; 122 | color: white; 123 | 124 | /* From colorzilla gradient generator */ 125 | background: #444444; /* Old browsers */ 126 | background: -moz-linear-gradient(top, #444444 0%, #666666 50%, #444444 100%); /* FF3.6+ */ 127 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444444), color-stop(50%,#666666), color-stop(100%,#444444)); /* Chrome,Safari4+ */ 128 | background: -webkit-linear-gradient(top, #444444 0%,#666666 50%,#444444 100%); /* Chrome10+,Safari5.1+ */ 129 | background: -o-linear-gradient(top, #444444 0%,#666666 50%,#444444 100%); /* Opera11.10+ */ 130 | background: -ms-linear-gradient(top, #444444 0%,#666666 50%,#444444 100%); /* IE10+ */ 131 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#444444',GradientType=0 ); /* IE6-9 */ 132 | background: linear-gradient(top, #444444 0%,#666666 50%,#444444 100%); /* W3C */ 133 | 134 | text-shadow: #333 1px 1px 1px; 135 | text-align: center; 136 | text-decoration: none; 137 | font-weight: bold; 138 | -webkit-border-radius: 5px; 139 | -moz-border-radius: 5px; 140 | border-radius: 5px; 141 | -webkit-box-shadow: 0px 0px 10px #213A49; /* 94*3 */ 142 | -moz-box-shadow: 0px 0px 10px #213A49; 143 | box-shadow: 0px 0px 10px #213A49; 144 | z-index: 1; 145 | } 146 | 147 | 148 | -------------------------------------------------------------------------------- /pwl/utils/daemon.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import with_statement 3 | import os 4 | import sys 5 | import errno 6 | import time 7 | import atexit 8 | import signal 9 | from pwl.utils.daemonize import become_daemon 10 | 11 | 12 | class BaseDaemon(object): 13 | """ 14 | A generic daemon class. 15 | Usage: subclass the Daemon class and override the run() method 16 | for run\start daemon execute start() ( not run method ) 17 | 18 | Availability: Unix 19 | opts: our_home_dir, out_log, err_log, umask 20 | """ 21 | NO_DAEMONIZE = False 22 | NO_WRITE_PID = False 23 | 24 | def __init__(self, pidfile, **opts): 25 | self.opts = opts 26 | self.pidfile = pidfile 27 | 28 | def daemonize(self): 29 | if self.NO_DAEMONIZE: 30 | return 31 | 32 | become_daemon(**self.opts) 33 | 34 | atexit.register(self.delpid) 35 | signal.signal(signal.SIGTERM, self.handle_sigterm) 36 | 37 | # write pidfile 38 | if not self.NO_WRITE_PID: 39 | pid = str(os.getpid()) 40 | open(self.pidfile, 'w').write('%s\n' % pid) 41 | 42 | 43 | def handle_sigterm(self, *args): 44 | self.atkilled(signal.SIGTERM) 45 | #self.delpid() - handle by atexit 46 | 47 | def atkilled(self, signo): 48 | pass 49 | 50 | def delpid(self): 51 | if os.path.exists(self.pidfile): 52 | try: 53 | os.unlink(self.pidfile) 54 | except: 55 | pass 56 | 57 | def readpid(self): 58 | try: 59 | with open(self.pidfile, 'r') as pf: 60 | return int(pf.read().strip()) 61 | except IOError: 62 | pass 63 | 64 | def start(self, *args, **kwargs): 65 | """ 66 | Start the daemon 67 | """ 68 | 69 | # Check for a pidfile to see if the daemon already runs 70 | pid = self.readpid() 71 | 72 | if pid: 73 | message = 'pidfile %s already exist. Daemon already running?\n' % self.pidfile 74 | sys.stderr.write(message) 75 | sys.exit(1) 76 | 77 | self.daemonize() 78 | self.run(*args, **kwargs) 79 | 80 | def stop(self): 81 | """ 82 | Stop the daemon 83 | """ 84 | 85 | # Get the pid from the pidfile 86 | pid = self.readpid() 87 | 88 | if not pid: 89 | message = 'pidfile %s does not exist. Daemon not running?\n' % self.pidfile 90 | sys.stderr.write(message) 91 | return # not an error in a restart 92 | 93 | # Try killing the daemon process 94 | try: 95 | while 1: 96 | os.kill(pid, signal.SIGTERM) # @UndefinedVariable 97 | time.sleep(0.1) 98 | except OSError, err: 99 | error_code = getattr(err, 'code', err.errno) 100 | if error_code == errno.ESRCH: # No such process 101 | self.delpid() 102 | else: 103 | print >> sys.stderr, str(err) 104 | sys.exit(1) 105 | 106 | def restart(self, *args, **kwargs): 107 | """ 108 | Restart the daemon 109 | """ 110 | 111 | self.stop() 112 | self.start(*args, **kwargs) 113 | 114 | def run(self): 115 | """ 116 | You should override this method when you subclass Daemon. It will be called after the process has been 117 | daemonized by start() or restart(). 118 | """ 119 | 120 | raise NotImplementedError 121 | 122 | -------------------------------------------------------------------------------- /static/sphinx/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #333333 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 44 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 45 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 46 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 47 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 48 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 49 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 50 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 51 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 52 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 53 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 54 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 55 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 56 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 57 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 58 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 59 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 60 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 61 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 62 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /static/markit/skins/markitup/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! Universal MarkUp Engine, JQuery plugin 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | .markItUp * { 6 | margin:0px; padding:0px; 7 | outline:none; 8 | } 9 | .markItUp a:link, 10 | .markItUp a:visited { 11 | color:#000; 12 | text-decoration:none; 13 | } 14 | .markItUp { 15 | width:700px; 16 | margin:5px 0 5px 0; 17 | border:5px solid #F5F5F5; 18 | } 19 | .markItUpContainer { 20 | border:1px solid #3C769D; 21 | background:#FFF url(images/bg-container.png) repeat-x top left; 22 | padding:5px 5px 2px 5px; 23 | font:11px Verdana, Arial, Helvetica, sans-serif; 24 | } 25 | .markItUpEditor { 26 | font:12px monospace; 27 | padding:5px 5px 5px 35px; 28 | border:3px solid #3C769D; 29 | width:643px; 30 | height:320px; 31 | background-image:url(images/bg-editor.png); 32 | background-repeat:no-repeat; 33 | clear:both; display:block; 34 | line-height:18px; 35 | overflow:auto; 36 | } 37 | .markItUpPreviewFrame { 38 | overflow:auto; 39 | background-color:#FFFFFF; 40 | border:1px solid #3C769D; 41 | width:99.9%; 42 | height:300px; 43 | margin:5px 0; 44 | } 45 | .markItUpFooter { 46 | width:100%; 47 | cursor:n-resize; 48 | } 49 | .markItUpResizeHandle { 50 | overflow:hidden; 51 | width:22px; height:5px; 52 | margin-left:auto; 53 | margin-right:auto; 54 | background-image:url(images/handle.png); 55 | cursor:n-resize; 56 | } 57 | /***************************************************************************************/ 58 | /* first row of buttons */ 59 | .markItUpHeader ul li { 60 | list-style:none; 61 | float:left; 62 | position:relative; 63 | } 64 | .markItUpHeader ul li ul{ 65 | display:none; 66 | } 67 | .markItUpHeader ul li:hover > ul{ 68 | display:block; 69 | } 70 | .markItUpHeader ul .markItUpDropMenu { 71 | background:transparent url(images/menu.png) no-repeat 115% 50%; 72 | margin-right:5px; 73 | } 74 | .markItUpHeader ul .markItUpDropMenu li { 75 | margin-right:0px; 76 | } 77 | .markItUpHeader ul .markItUpSeparator { 78 | margin:0 10px; 79 | width:1px; 80 | height:16px; 81 | overflow:hidden; 82 | background-color:#CCC; 83 | } 84 | .markItUpHeader ul ul .markItUpSeparator { 85 | width:auto; height:1px; 86 | margin:0px; 87 | } 88 | /* next rows of buttons */ 89 | .markItUpHeader ul ul { 90 | display:none; 91 | position:absolute; 92 | top:18px; left:0px; 93 | background:#F5F5F5; 94 | border:1px solid #3C769D; 95 | height:inherit; 96 | } 97 | .markItUpHeader ul ul li { 98 | float:none; 99 | border-bottom:1px solid #3C769D; 100 | } 101 | .markItUpHeader ul ul .markItUpDropMenu { 102 | background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%; 103 | } 104 | /* next rows of buttons */ 105 | .markItUpHeader ul ul ul { 106 | position:absolute; 107 | top:-1px; left:150px; 108 | } 109 | .markItUpHeader ul ul ul li { 110 | float:none; 111 | } 112 | .markItUpHeader ul a { 113 | display:block; 114 | width:16px; height:16px; 115 | text-indent:-10000px; 116 | background-repeat:no-repeat; 117 | padding:3px; 118 | margin:0px; 119 | } 120 | .markItUpHeader ul ul a { 121 | display:block; 122 | padding-left:0px; 123 | text-indent:0; 124 | width:120px; 125 | padding:5px 5px 5px 25px; 126 | background-position:2px 50%; 127 | } 128 | .markItUpHeader ul ul a:hover { 129 | color:#FFF; 130 | background-color:#3C769D; 131 | } 132 | /***************************************************************************************/ 133 | .html .markItUpEditor { 134 | background-image:url(images/bg-editor-html.png); 135 | } 136 | .markdown .markItUpEditor { 137 | background-image:url(images/bg-editor-markdown.png); 138 | } 139 | .textile .markItUpEditor { 140 | background-image:url(images/bg-editor-textile.png); 141 | } 142 | .bbcode .markItUpEditor { 143 | background-image:url(images/bg-editor-bbcode.png); 144 | } 145 | .wiki .markItUpEditor, 146 | .dotclear .markItUpEditor { 147 | background-image:url(images/bg-editor-wiki.png); 148 | } -------------------------------------------------------------------------------- /var/themes/nature/nature.css: -------------------------------------------------------------------------------- 1 | /* 2 | * nature.css_t 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- nature theme. 6 | * 7 | * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- page layout ----------------------------------------------------------- */ 13 | 14 | body { 15 | font-family: Arial, sans-serif; 16 | font-size: 100%; 17 | /*background-color: #111;*/ 18 | color: #555; 19 | margin: 0; 20 | padding: 0; 21 | } 22 | 23 | div.documentwrapper { 24 | float: left; 25 | width: 100%; 26 | } 27 | 28 | div.bodywrapper { 29 | margin: 0 0 0 230px; 30 | } 31 | 32 | hr { 33 | border: 1px solid #B1B4B6; 34 | } 35 | 36 | div.document { 37 | background-color: #eee; 38 | } 39 | 40 | div.body { 41 | background-color: #ffffff; 42 | color: #3E4349; 43 | padding: 0 30px 30px 30px; 44 | font-size: 0.9em; 45 | } 46 | 47 | div.footer { 48 | color: #555; 49 | width: 100%; 50 | padding: 13px 0; 51 | text-align: center; 52 | font-size: 75%; 53 | } 54 | 55 | div.footer a { 56 | color: #444; 57 | text-decoration: underline; 58 | } 59 | 60 | div.related { 61 | background-color: #6BA81E; 62 | line-height: 32px; 63 | color: #fff; 64 | text-shadow: 0px 1px 0 #444; 65 | font-size: 0.9em; 66 | } 67 | 68 | div.related a { 69 | color: #E2F3CC; 70 | } 71 | 72 | div.sphinxsidebar { 73 | font-size: 0.75em; 74 | line-height: 1.5em; 75 | } 76 | 77 | div.sphinxsidebarwrapper{ 78 | padding: 20px 0; 79 | } 80 | 81 | div.sphinxsidebar h3, 82 | div.sphinxsidebar h4 { 83 | font-family: Arial, sans-serif; 84 | color: #222; 85 | font-size: 1.2em; 86 | font-weight: normal; 87 | margin: 0; 88 | padding: 5px 10px; 89 | background-color: #ddd; 90 | text-shadow: 1px 1px 0 white 91 | } 92 | 93 | div.sphinxsidebar h4{ 94 | font-size: 1.1em; 95 | } 96 | 97 | div.sphinxsidebar h3 a { 98 | color: #444; 99 | } 100 | 101 | 102 | div.sphinxsidebar p { 103 | color: #888; 104 | padding: 5px 20px; 105 | } 106 | 107 | div.sphinxsidebar p.topless { 108 | } 109 | 110 | div.sphinxsidebar ul { 111 | margin: 10px 20px; 112 | padding: 0; 113 | color: #000; 114 | } 115 | 116 | div.sphinxsidebar a { 117 | color: #444; 118 | } 119 | 120 | div.sphinxsidebar input { 121 | border: 1px solid #ccc; 122 | font-family: sans-serif; 123 | font-size: 1em; 124 | } 125 | 126 | div.sphinxsidebar input[type=text]{ 127 | margin-left: 20px; 128 | } 129 | 130 | /* -- body styles ----------------------------------------------------------- */ 131 | 132 | a { 133 | color: #005B81; 134 | text-decoration: none; 135 | } 136 | 137 | a:hover { 138 | color: #E32E00; 139 | text-decoration: underline; 140 | } 141 | 142 | div.body h1, 143 | div.body h2, 144 | div.body h3, 145 | div.body h4, 146 | div.body h5, 147 | div.body h6 { 148 | font-family: Arial, sans-serif; 149 | background-color: #BED4EB; 150 | font-weight: normal; 151 | color: #212224; 152 | margin: 30px 0px 10px 0px; 153 | padding: 5px 0 5px 10px; 154 | text-shadow: 0px 1px 0 white 155 | } 156 | 157 | div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } 158 | div.body h2 { font-size: 150%; background-color: #C8D5E3; } 159 | div.body h3 { font-size: 120%; background-color: #D8DEE3; } 160 | div.body h4 { font-size: 110%; background-color: #D8DEE3; } 161 | div.body h5 { font-size: 100%; background-color: #D8DEE3; } 162 | div.body h6 { font-size: 100%; background-color: #D8DEE3; } 163 | 164 | a.headerlink { 165 | color: #c60f0f; 166 | font-size: 0.8em; 167 | padding: 0 4px 0 4px; 168 | text-decoration: none; 169 | } 170 | 171 | a.headerlink:hover { 172 | background-color: #c60f0f; 173 | color: white; 174 | } 175 | 176 | div.body p, div.body dd, div.body li { 177 | line-height: 1.5em; 178 | } 179 | 180 | div.admonition p.admonition-title + p { 181 | display: inline; 182 | } 183 | 184 | div.highlight{ 185 | background-color: white; 186 | } 187 | 188 | div.note { 189 | background-color: #eee; 190 | border: 1px solid #ccc; 191 | } 192 | 193 | div.seealso { 194 | background-color: #ffc; 195 | border: 1px solid #ff6; 196 | } 197 | 198 | div.topic { 199 | background-color: #eee; 200 | } 201 | 202 | div.warning { 203 | background-color: #ffe4e4; 204 | border: 1px solid #f66; 205 | } 206 | 207 | p.admonition-title { 208 | display: inline; 209 | } 210 | 211 | p.admonition-title:after { 212 | content: ":"; 213 | } 214 | 215 | pre { 216 | padding: 10px; 217 | background-color: White; 218 | color: #222; 219 | line-height: 1.2em; 220 | border: 1px solid #C6C9CB; 221 | font-size: 1.1em; 222 | margin: 1.5em 0 1.5em 0; 223 | -webkit-box-shadow: 1px 1px 1px #d8d8d8; 224 | -moz-box-shadow: 1px 1px 1px #d8d8d8; 225 | } 226 | 227 | tt { 228 | background-color: #ecf0f3; 229 | color: #222; 230 | /* padding: 1px 2px; */ 231 | font-size: 1.1em; 232 | font-family: monospace; 233 | } 234 | 235 | .viewcode-back { 236 | font-family: Arial, sans-serif; 237 | } 238 | 239 | div.viewcode-block:target { 240 | background-color: #f4debf; 241 | border-top: 1px solid #ac9; 242 | border-bottom: 1px solid #ac9; 243 | } 244 | 245 | p { 246 | margin: 0; 247 | } 248 | 249 | ul li dd { 250 | margin-top: 0; 251 | } 252 | 253 | ul li dl { 254 | margin-bottom: 0; 255 | } 256 | 257 | li dl dd { 258 | margin-bottom: 0; 259 | } 260 | 261 | dd ul { 262 | padding-left: 0; 263 | } 264 | 265 | li dd ul { 266 | margin-bottom: 0; 267 | } 268 | -------------------------------------------------------------------------------- /static/markit/sets/rest/set.js: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------- 2 | // markItUp! 3 | // ------------------------------------------------------------------- 4 | // Copyright (C) 2008 Jay Salvat 5 | // http://markitup.jaysalvat.com/ 6 | // ------------------------------------------------------------------- 7 | // MarkDown tags example 8 | // http://en.wikipedia.org/wiki/Markdown 9 | // http://daringfireball.net/projects/markdown/ 10 | // ------------------------------------------------------------------- 11 | // Feel free to add more tags 12 | // ------------------------------------------------------------------- 13 | 14 | // mIu nameSpace to avoid conflict. 15 | 16 | 17 | 18 | miu = new function() { 19 | 20 | var tabWidth = 4; 21 | var self = this; 22 | 23 | var makeChars = function(ch, repeat) { 24 | var i = repeat; 25 | var r = ''; 26 | while (i--) { 27 | r += ch; 28 | } 29 | return r; 30 | } 31 | 32 | var wcwidth = function (ucs) { 33 | if (ucs < 0x1100) 34 | return 1; 35 | 36 | if ((ucs >= 0x1100 && ucs <= 0x115f) || /* Hangul Jamo */ 37 | (ucs >= 0x2e80 && ucs <= 0xa4cf && (ucs & ~0x0011) != 0x300a && 38 | ucs != 0x303f) || /* CJK ... Yi */ 39 | (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ 40 | (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ 41 | (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ 42 | (ucs >= 0xff00 && ucs <= 0xff5f) || /* Fullwidth Forms */ 43 | (ucs >= 0xffe0 && ucs <= 0xffe6)) { 44 | return 2; 45 | } 46 | return 1; 47 | } 48 | 49 | var strByteLen = this.strByteLen = function(str) { 50 | var count = 0; 51 | for(var i=0; i < str.length; i++) { 52 | count += wcwidth(str.charCodeAt(i)); 53 | } 54 | return count; 55 | } 56 | 57 | this.markText = function(markItUp, ch, breakBefore) { 58 | if (typeof breakBefore == 'undefined') { 59 | breakBefore = true; 60 | } 61 | var heading = ''; 62 | var n = strByteLen($.trim(markItUp.selection||markItUp.placeHolder)); 63 | for(var i = 0; i < n; i++) { 64 | heading += ch; 65 | } 66 | if (breakBefore) { 67 | return '\n'+heading; 68 | } else { 69 | return heading + '\n'; 70 | } 71 | }, 72 | 73 | this.makeMarkDown = function(ch) { 74 | return function(markItUp) { 75 | return self.markText(markItUp, ch); 76 | }; 77 | }, 78 | 79 | this.makeMarkUp = function(ch){ 80 | return function(markItUp){ 81 | return self.markText(markItUp, ch, false); 82 | }; 83 | }, 84 | 85 | this.makeIndent = function(h) { 86 | if (!h.selection) { 87 | return makeChars(' ', tabWidth); 88 | } else { 89 | var lines = h.selection.split('\n'); 90 | var len = lines.length; 91 | for (var i = 0; i < len; i++) { 92 | lines[i] = makeChars(' ', tabWidth) + lines[i]; 93 | } 94 | return lines.join('\n'); 95 | } 96 | }, 97 | 98 | this.removeIndent = function(h) { 99 | if (h.selection) { 100 | var lines = h.selection.split('\n'); 101 | var len = lines.length; 102 | for (var i = 0; i < len; i++) { 103 | var line = lines[i]; 104 | var offs = 0; 105 | for (var j = 0; j < tabWidth; j++) { 106 | if (line.charAt(j) == ' ' || line.charAt(j) == '\t') { 107 | offs += 1; 108 | } else { 109 | break; 110 | } 111 | } 112 | lines[i] = line.substr(offs); 113 | } 114 | return lines.join('\n'); 115 | } 116 | } 117 | } 118 | 119 | function restLink(markItUp) { 120 | var link = markItUp.selection; 121 | if (!link) { 122 | link = '[![Title]!]' 123 | } 124 | return '`' + link + ' <[![Url:!:http://]!]>`_\n' 125 | } 126 | 127 | mySettings = { 128 | previewParserPath: '', 129 | onShiftEnter: {keepDefault:false, openWith:'\n\n'}, 130 | markupSet: [ 131 | {name:'# with overline, for parts', text:'##', key:'1', placeHolder:'Part title..', openWith: miu.makeMarkUp('='), closeWith: miu.makeMarkDown('=')}, 132 | {name:'* with overline, for chapters', text:'**', key:'2', placeHolder:'Chapter title..', openWith: miu.makeMarkUp('*'), closeWith: miu.makeMarkDown('*')}, 133 | {name:'=, for sections', text:'=', key:'3', placeHolder:'Section title..', closeWith: miu.makeMarkDown('=') }, 134 | {name:'-, for subsections', text:'-', key:'4', placeHolder:'Subsection title..', closeWith: miu.makeMarkDown('-') }, 135 | {name:'^, for subsubsections', text:'^', key:'5', placeHolder:'Subsubsection title..', closeWith: miu.makeMarkDown('^') }, 136 | {name:'", for paragraphs', text:'"', key:'6', placeHolder:'Paragrapth title..', closeWith: miu.makeMarkDown('"') }, 137 | {name:'*, for paragraphs', text:'*', key:'7', placeHolder:'Paragrapth title..', closeWith: miu.makeMarkDown('*') }, 138 | {separator:'---------------' }, 139 | {name:'Bold', key:'B', openWith:'**', closeWith:'**', className: 'buttonBold'}, 140 | {name:'Italic', key:'I', openWith:'*', closeWith:'*', className: 'buttonItalic'}, 141 | {name:'Monospace', key:'M', openWith:'``', closeWith:'``', className: 'buttonMonospace'}, 142 | {separator:'---------------' }, 143 | {name: 'Indent', key: 'T', replaceWith: miu.makeIndent, className: 'buttonIndent'}, 144 | {name: 'Remove indent', key: 'R', replaceWith: miu.removeIndent, className: 'buttonRemoveIndent'}, 145 | {separator:'---------------' }, 146 | {name:'Bulleted List', openWith:'- ', className: 'buttonBulletedList' }, 147 | {name:'Numeric List', openWith:function(markItUp) { 148 | return markItUp.line+'. '; 149 | }, className: 'buttonNumericList'}, 150 | {separator:'---------------' }, 151 | {name:'Picture', key:'P', replaceWith:'.. image:: [![Url]!]\n', className: 'buttonPicture'}, 152 | {name:'Link', key:'L', replaceWith: restLink, placeHolder:'Your text to link here...', className: 'buttonLink' }, 153 | //{separator:'---------------'}, 154 | //{name:'Quotes', openWith:'> '}, 155 | //{name:'Code Block / Code', openWith:'(!(\t|!|`)!)', closeWith:'(!(`)!)'}, 156 | //{separator:'---------------'}, 157 | //{name:'Preview', call:'preview', className:"preview"} 158 | ] 159 | } -------------------------------------------------------------------------------- /static/scripts/editor.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | function getSelectedTheme() { 4 | var theme = null; 5 | $('.themes input').each(function() { 6 | if (this.checked) { 7 | theme = this.value; 8 | return false; 9 | } 10 | }) 11 | return theme; 12 | } 13 | 14 | function getQueryArgs(locSearch) { 15 | locSearch = locSearch || window.location.search; 16 | var args = {}; 17 | 18 | locSearch.replace(/(\w+)=(.+?)(&|$)/g, function(substr, key, value) { 19 | args[key] = window.decodeURIComponent(value); 20 | }); 21 | return args; 22 | } 23 | 24 | function getCurrentDocument() { 25 | return getQueryArgs()['n']; 26 | } 27 | 28 | 29 | function setPreviewHtml(html) { 30 | var iframe = $('#browse')[0]; 31 | var doc = iframe.document; 32 | 33 | if (iframe.contentDocument) { 34 | doc = iframe.contentDocument; // For NS6 35 | } else if (iframe.contentWindow) { 36 | doc = iframe.contentWindow.document; // For IE5.5 and IE6 37 | } 38 | doc.open(); 39 | flaskHref = $("#flasky").attr('href') 40 | pygmentsHref = $("#pygments").attr('href') 41 | doc.writeln(''); 42 | doc.writeln(''); 43 | doc.writeln(html); 44 | doc.close(); 45 | var body = doc.body; 46 | 47 | var titleText = null; 48 | var headElem = $('h1', body)[0] || $('h2', body)[0] || $('h3', body)[0] || $('h4', body)[0] || $('h5', body)[0] || $('p', body)[0]; 49 | if (headElem) { 50 | titleText = headElem.innerText || headElem.textContent; 51 | } 52 | if (titleText) { 53 | $('head title').html(titleText.substr(0, 55) + ' - ' + window.baseTitle); 54 | } else { 55 | $('head title').html(window.baseTitle); 56 | } 57 | } 58 | 59 | function getScrollHeight($prevFrame) { 60 | // Different browsers attach the scrollHeight of a document to different 61 | // elements, so handle that here. 62 | if ($prevFrame[0].scrollHeight !== undefined) { 63 | return $prevFrame[0].scrollHeight; 64 | } else if ($prevFrame.find('html')[0].scrollHeight !== undefined && 65 | $prevFrame.find('html')[0].scrollHeight !== 0) { 66 | return $prevFrame.find('html')[0].scrollHeight; 67 | } else { 68 | return $prevFrame.find('body')[0].scrollHeight; 69 | } 70 | } 71 | 72 | /** 73 | * syncScrollPosition 74 | * 75 | * Synchronize the scroll positions between the editor and preview panes. 76 | * Specifically, this function will match the percentages that each pane is 77 | * scrolled (i.e., if one is scrolled 25% of its total scroll height, the 78 | * other will be too). 79 | */ 80 | function syncScrollPosition() { 81 | var $ed = $('textarea#editor'); 82 | var $prev = $('#browse'); 83 | 84 | var editorScrollRange = ($ed[0].scrollHeight - $ed.innerHeight()); 85 | var previewScrollRange = (getScrollHeight($prev.contents()) - $prev.innerHeight()); 86 | 87 | // Find how far along the editor is (0 means it is scrolled to the top, 1 88 | // means it is at the bottom). 89 | var scrollFactor = $ed.scrollTop() / editorScrollRange; 90 | 91 | // Set the scroll position of the preview pane to match. jQuery will 92 | // gracefully handle out-of-bounds values. 93 | $prev.contents().scrollTop(scrollFactor * previewScrollRange); 94 | } 95 | 96 | var activeXhr = null; 97 | var lastContent = null; 98 | 99 | function genPreview() { 100 | var self = $('textarea#editor'); 101 | var rstContent = self.val(); 102 | if (activeXhr || lastContent == rstContent) { 103 | //activeXhr.abort(); 104 | return; 105 | } 106 | lastContent = rstContent; 107 | activeXhr = $.ajax({ 108 | 'url': '/srv/rst2html/', 109 | 'data': {'rst': rstContent}, 110 | 'type': 'POST', 111 | 'error': function(xhr) { 112 | setPreviewHtml(xhr.responseText); 113 | }, 114 | 'success': function(response) { 115 | setPreviewHtml(response); 116 | syncScrollPosition(); 117 | activeXhr = null; 118 | } 119 | }); 120 | } 121 | 122 | var timerId = null; 123 | 124 | function getCurrentLink(res) { 125 | if (!res) { 126 | return 'http://' + window.location.host + '/?theme=' + getSelectedTheme(); 127 | } 128 | return 'http://' + window.location.host + '/?n=' + res + '&theme=' + getSelectedTheme(); 129 | } 130 | 131 | function adjustBrowse() { 132 | var h = $('body').height() - $('#browse').offset().top - $('#footer').outerHeight() - 7; 133 | $('#browse').height(h); 134 | h -= 12; 135 | $('#editor').height(h).css('max-height', h + 'px'); 136 | } 137 | 138 | 139 | $(function() { 140 | //$('').click(genPreview).appendTo($('body')); 141 | 142 | window.baseTitle = $('head title').text(); 143 | 144 | $('textarea#editor').bind('change', genPreview).markItUp(mySettings); 145 | timerId = window.setInterval(genPreview, 900); 146 | window.setTimeout(function() { 147 | $('#editor-td > div').css({'width': '100%', 'height': '96%'}); 148 | }, 200); 149 | 150 | $('textarea#editor').scroll(syncScrollPosition); 151 | 152 | $('.themes input').bind('change', function() { 153 | lastContent = null; 154 | genPreview(); 155 | }); 156 | 157 | $('#save_link').click(function(e) { 158 | 159 | $.ajax({ 160 | 'url': '/srv/save_rst/', 161 | 'type': 'POST', 162 | 'data': {'rst': $('textarea#editor').val()}, 163 | 'success': function(response) { 164 | window.location = getCurrentLink(response + ''); 165 | $('textarea#editor').focus(); 166 | } 167 | 168 | }); 169 | 170 | e.preventDefault(); 171 | return false; 172 | }); 173 | 174 | $('#del_link').click(function(e) { 175 | $.ajax({ 176 | 'url': '/srv/del_rst/', 177 | 'type': 'GET', 178 | 'data': {'n': getCurrentDocument()}, 179 | 'success': function(response) { 180 | window.location = getCurrentLink(); 181 | } 182 | }); 183 | 184 | e.preventDefault(); 185 | return false; 186 | }); 187 | 188 | $('#as_pdf').click(function(e) { 189 | var form = $('#save_as_pdf'); 190 | $('#as_pdf_rst').attr('value', $("#editor").val()); 191 | $('#as_pdf_theme').attr('value', getSelectedTheme()); 192 | form.submit(); 193 | 194 | e.preventDefault(); 195 | return false; 196 | }); 197 | 198 | adjustBrowse(); 199 | 200 | $(window).bind('resize', adjustBrowse); 201 | 202 | }); 203 | -------------------------------------------------------------------------------- /static/markit/jquery.markitup.pack.js: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // markItUp! Universal MarkUp Engine, JQuery plugin 3 | // v 1.1.7 4 | // Dual licensed under the MIT and GPL licenses. 5 | // ---------------------------------------------------------------------------- 6 | // Copyright (C) 2007-2010 Jay Salvat 7 | // http://markitup.jaysalvat.com/ 8 | // ---------------------------------------------------------------------------- 9 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.23.T=3(f,g){B k,v,A,F;v=A=F=l;k={D:\'\',12:\'\',U:\'\',1j:\'\',1y:7,24:\'25\',1k:\'~/2R/1z.1A\',1b:\'\',26:\'27\',1l:7,1B:\'\',1C:\'\',1D:{},1E:{},1F:{},1G:{},28:[{}]};$.V(k,f,g);2(!k.U){$(\'2S\').1c(3(a,b){1H=$(b).14(0).2T.2U(/(.*)2V\\.2W(\\.2X)?\\.2Y$/);2(1H!==29){k.U=1H[1]}})}4 G.1c(3(){B d,u,15,16,p,H,L,P,17,1m,w,2a,M,18;d=$(G);u=G;15=[];18=l;16=p=0;H=-1;k.1b=1d(k.1b);k.1k=1d(k.1k);3 1d(a,b){2(b){4 a.W(/("|\')~\\//g,"$1"+k.U)}4 a.W(/^~\\//,k.U)}3 2b(){D=\'\';12=\'\';2(k.D){D=\'D="\'+k.D+\'"\'}8 2(d.1I("D")){D=\'D="T\'+(d.1I("D").2c(0,1).2Z())+(d.1I("D").2c(1))+\'"\'}2(k.12){12=\'N="\'+k.12+\'"\'}d.1J(\'\');d.1J(\'\');d.1J(\'\');d.2d("2e");17=$(\'\').2f(d);$(1K(k.28)).1L(17);1m=$(\'\').1M(d);2(k.1l===7&&$.X.33!==7){1l=$(\'\').1M(d).1e("1N",3(e){B h=d.2g(),y=e.2h,1n,1o;1n=3(e){d.2i("2g",35.36(20,e.2h+h-y)+"37");4 l};1o=3(e){$("1A").1O("2j",1n).1O("2k",1o);4 l};$("1A").1e("2j",1n).1e("2k",1o)});1m.2l(1l)}d.2m(1P).38(1P);d.1e("1Q",3(e,a){2(a.1p!==l){14()}2(u===$.T.2n){Y(a)}});d.1f(3(){$.T.2n=G})}3 1K(b){B c=$(\'\'),i=0;$(\'C:2o > Z\',c).2i(\'39\',\'q\');$.1c(b,3(){B a=G,t=\'\',1q,C,j;1q=(a.19)?(a.1R||\'\')+\' [3a+\'+a.19+\']\':(a.1R||\'\');19=(a.19)?\'2p="\'+a.19+\'"\':\'\';2(a.2q){C=$(\'\'+(a.2q||\'\')+\'\').1L(c)}8{i++;2r(j=15.6-1;j>=0;j--){t+=15[j]+"-"}C=$(\'\'+(a.1R||\'\')+\'\').1e("3e",3(){4 l}).2t(3(){4 l}).1N(3(){2(a.2u){3f(a.2u)()}2v(3(){Y(a)},1);4 l}).2o(3(){$(\'> Z\',G).3g();$(E).3h(\'2t\',3(){$(\'Z Z\',17).2w()})},3(){$(\'> Z\',G).2w()}).1L(c);2(a.2x){15.3i(i);$(C).2d(\'3j\').2l(1K(a.2x))}}});15.3k();4 c}3 2y(c){2(c){c=c.3l();c=c.W(/\\(\\!\\(([\\s\\S]*?)\\)\\!\\)/g,3(x,a){B b=a.1S(\'|!|\');2(F===7){4(b[1]!==2z)?b[1]:b[0]}8{4(b[1]===2z)?"":b[0]}});c=c.W(/\\[\\!\\[([\\s\\S]*?)\\]\\!\\]/g,3(x,a){B b=a.1S(\':!:\');2(18===7){4 l}1T=3m(b[0],(b[1])?b[1]:\'\');2(1T===29){18=7}4 1T});4 c}4""}3 I(a){2($.3n(a)){a=a(P)}4 2y(a)}3 1g(a){J=I(L.J);1a=I(L.1a);Q=I(L.Q);O=I(L.O);2(Q!==""){q=J+Q+O}8 2(m===\'\'&&1a!==\'\'){q=J+1a+O}8{q=J+(a||m)+O}4{q:q,J:J,Q:Q,1a:1a,O:O}}3 Y(a){B b,j,n,i;P=L=a;14();$.V(P,{1r:"",U:k.U,u:u,m:(m||\'\'),p:p,v:v,A:A,F:F});I(k.1B);I(L.1B);2(v===7&&A===7){I(L.3o)}$.V(P,{1r:1});2(v===7&&A===7){R=m.1S(/\\r?\\n/);2r(j=0,n=R.6,i=0;i=9.5&&b==0){4 l}1i=u.2D();1i.3t(7);1i.2E(\'1Z\',a);1i.3u(\'1Z\',b);1i.3v()}8 2(u.2F){u.2F(a,a+b)}u.1t=16;u.1f()}3 14(){u.1f();16=u.1t;2(E.m){m=E.m.1Y().2C;2($.X.2B){B a=E.m.1Y(),1u=a.3w();1u.3x(u);p=-1;3y(1u.3z(a)){1u.2E(\'1Z\');p++}}8{p=u.2G}}8{p=u.2G;m=d.K().1h(p,u.3A)}4 m}3 1z(){2(!w||w.3B){2(k.1j){w=3C.2H(\'\',\'1z\',k.1j)}8{M=$(\'<2I N="3D">\');2(k.24==\'25\'){M.1M(1m)}8{M.2f(17)}w=M[M.6-1].3E||3F[M.6-1]}}8 2(F===7){2(M){M.3G()}8{w.2J()}w=M=l}2(!k.1y){1X()}}3 1X(){2K()}3 2K(){B b;2(k.1b!==\'\'){$.2L({2M:\'3H\',2N:k.1b,27:k.26+\'=\'+3I(d.K()),2O:3(a){21(1d(a,1))}})}8{2(!2a){$.2L({2N:k.1k,2O:3(a){21(1d(a,1).W(//g,d.K()))}})}}4 l}3 21(a){2(w.E){3K{22=w.E.2P.1t}3L(e){22=0}w.E.2H();w.E.3M(a);w.E.2J();w.E.2P.1t=22}2(k.1j){w.1f()}}3 1P(e){A=e.A;F=e.F;v=(!(e.F&&e.v))?e.v:l;2(e.2M===\'2m\'){2(v===7){C=$("a[2p="+3N.3O(e.1v)+"]",17).1w(\'C\');2(C.6!==0){v=l;2v(3(){C.3P(\'1N\')},1);4 l}}2(e.1v===13||e.1v===10){2(v===7){v=l;Y(k.1F);4 k.1F.1x}8 2(A===7){A=l;Y(k.1E);4 k.1E.1x}8{Y(k.1D);4 k.1D.1x}}2(e.1v===9){2(A==7||v==7||F==7){4 l}2(H!==-1){14();H=d.K().6-H;1W(H,0);H=-1;4 l}8{Y(k.1G);4 k.1G.1x}}}}2b()})};$.23.3Q=3(){4 G.1c(3(){B a=$(G).1O().3R(\'2e\');a.1w(\'z\').1w(\'z.T\').1w(\'z\').Q(a)})};$.T=3(a){B b={1p:l};$.V(b,a);2(b.1p){4 $(b.1p).1c(3(){$(G).1f();$(G).2Q(\'1Q\',[b])})}8{$(\'u\').2Q(\'1Q\',[b])}}})(3S);',62,241,'||if|function|return||length|true|else|||||||||||||false|selection||string|caretPosition|block||||textarea|ctrlKey|previewWindow|||div|shiftKey|var|li|id|document|altKey|this|caretOffset|prepare|openWith|val|clicked|iFrame|class|closeWith|hash|replaceWith|lines||markItUp|root|extend|replace|browser|markup|ul||start|nameSpace||get|levels|scrollPosition|header|abort|key|placeHolder|previewParserPath|each|localize|bind|focus|build|substring|range|previewInWindow|previewTemplatePath|resizeHandle|footer|mouseMove|mouseUp|target|title|line|fixIeBug|scrollTop|rangeCopy|keyCode|parent|keepDefault|previewAutoRefresh|preview|html|beforeInsert|afterInsert|onEnter|onShiftEnter|onCtrlEnter|onTab|miuScript|attr|wrap|dropMenus|appendTo|insertAfter|mousedown|unbind|keyPressed|insertion|name|split|value|opera|fixOperaBug|set|refreshPreview|createRange|character||writeInPreview|sp|fn|previewPosition|after|previewParserVar|data|markupSet|null|template|init|substr|addClass|markItUpEditor|insertBefore|height|clientY|css|mousemove|mouseup|append|keydown|focused|hover|accesskey|separator|for|markItUpButton|click|call|setTimeout|hide|dropMenu|magicMarkups|undefined|insert|msie|text|createTextRange|moveStart|setSelectionRange|selectionStart|open|iframe|close|renderPreview|ajax|type|url|success|documentElement|trigger|templates|script|src|match|jquery|markitup|pack|js|toUpperCase|markItUpContainer|markItUpHeader|markItUpFooter|safari|markItUpResizeHandle|Math|max|px|keyup|display|Ctrl|markItUpSeparator|className|href|contextmenu|eval|show|one|push|markItUpDropMenu|pop|toString|prompt|isFunction|beforeMultiInsert|trim|join|afterMultiInsert|version|collapse|moveEnd|select|duplicate|moveToElementText|while|inRange|selectionEnd|closed|window|markItUpPreviewFrame|contentWindow|frame|remove|POST|encodeURIComponent|content|try|catch|write|String|fromCharCode|triggerHandler|markItUpRemove|removeClass|jQuery'.split('|'),0,{})) -------------------------------------------------------------------------------- /pwl/fastcgi.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol. 5 | 6 | Uses the flup python package: http://www.saddi.com/software/flup/ 7 | 8 | This is a adaptation of the flup package to add FastCGI server support 9 | to run Django apps from pwl servers that support the FastCGI protocol. 10 | This module can be run standalone or from the django-admin / manage.py 11 | scripts using the "runfcgi" directive. 12 | 13 | Run with the extra option "help" for a list of additional options you can 14 | pass to this server. 15 | """ 16 | 17 | from pwl.utils import importlib 18 | import sys 19 | import os 20 | 21 | __version__ = '0.1' 22 | __all__ = ['runfastcgi'] 23 | 24 | FASTCGI_HELP = \ 25 | r""" 26 | Run this project as a fastcgi (or some other protocol supported 27 | by flup) application. To do this, the flup package from 28 | http://www.saddi.com/software/flup/ is required. 29 | 30 | runfcgi [options] [fcgi settings] 31 | 32 | Optional Fcgi settings: (setting=value) 33 | protocol=PROTOCOL fcgi, scgi, ajp, ... (default fcgi) 34 | host=HOSTNAME hostname to listen on.. 35 | port=PORTNUM port to listen on. 36 | socket=FILE UNIX socket to listen on. 37 | method=IMPL prefork or threaded (default prefork) 38 | maxrequests=NUMBER number of requests a child handles before it is 39 | killed and a new child is forked (0 = no limit). 40 | maxspare=NUMBER max number of spare processes / threads 41 | minspare=NUMBER min number of spare processes / threads. 42 | maxchildren=NUMBER hard limit number of processes / threads 43 | daemonize=BOOL whether to detach from terminal. 44 | pidfile=FILE write the spawned process-id to this file. 45 | workdir=DIRECTORY change to this directory when daemonizing. 46 | debug=BOOL set to true to enable flup tracebacks 47 | outlog=FILE write stdout to this file. 48 | errlog=FILE write stderr to this file. 49 | umask=UMASK umask to use when daemonizing (default 022). 50 | 51 | Examples: 52 | Run a "standard" fastcgi process on a file-descriptor 53 | (for webservers which spawn your processes for you) 54 | $ manage.py runfcgi method=threaded 55 | 56 | Run a scgi server on a TCP host/port 57 | $ manage.py runfcgi protocol=scgi method=prefork host=127.0.0.1 port=8025 58 | 59 | Run a fastcgi server on a UNIX domain socket (posix platforms only) 60 | $ manage.py runfcgi method=prefork socket=/tmp/fcgi.sock 61 | 62 | Run a fastCGI as a daemon and write the spawned PID in a file 63 | $ manage.py runfcgi socket=/tmp/fcgi.sock method=prefork \ 64 | daemonize=true pidfile=/var/run/django-fcgi.pid 65 | 66 | """ 67 | 68 | FASTCGI_OPTIONS = { 69 | 'protocol': 'fcgi', 70 | 'host': None, 71 | 'port': None, 72 | 'socket': None, 73 | 'method': 'fork', 74 | 'daemonize': None, 75 | 'workdir': '/', 76 | 'pidfile': None, 77 | 'maxspare': 5, 78 | 'minspare': 2, 79 | 'maxchildren': 50, 80 | 'maxrequests': 0, 81 | 'debug': False, 82 | 'outlog': None, 83 | 'errlog': None, 84 | 'umask': '002' 85 | } 86 | 87 | 88 | def fastcgi_help(message=None): 89 | print FASTCGI_HELP 90 | if message: 91 | print message 92 | return False 93 | 94 | 95 | def runfastcgi(app, argset=[], **kwargs): 96 | options = FASTCGI_OPTIONS.copy() 97 | options.update(kwargs) 98 | for x in argset: 99 | if '=' in x: 100 | k, v = x.split('=', 1) 101 | else: 102 | k, v = x, True 103 | options[k.lower()] = v 104 | 105 | if 'help' in options: 106 | return fastcgi_help() 107 | 108 | if 'run_as' in options: 109 | from pwd import getpwnam 110 | try: 111 | pw = getpwnam(options['run_as']) 112 | except KeyError: 113 | pw = None 114 | if pw: 115 | os.setresgid(pw.pw_gid, pw.pw_gid, pw.pw_gid) 116 | os.setresuid(pw.pw_uid, pw.pw_uid, pw.pw_uid) 117 | 118 | 119 | try: 120 | import flup 121 | except ImportError, e: 122 | print >> sys.stderr, 'ERROR: %s' % e 123 | print >> sys.stderr, ' Unable to load the flup package. In order to run rsted' 124 | print >> sys.stderr, ' as a FastCGI application, you will need to get flup from' 125 | print >> sys.stderr, " http://www.saddi.com/software/flup/ If you've already" 126 | print >> sys.stderr, ' installed flup, then make sure you have it in your PYTHONPATH.' 127 | return False 128 | 129 | flup_module = 'server.' + options['protocol'] 130 | 131 | if options['method'] in ('prefork', 'fork'): 132 | wsgi_opts = {'maxSpare': int(options['maxspare']), 'minSpare': int(options['minspare']), 133 | 'maxChildren': int(options['maxchildren']), 'maxRequests': int(options['maxrequests'])} 134 | flup_module += '_fork' 135 | elif options['method'] in ('thread', 'threaded'): 136 | wsgi_opts = {'maxSpare': int(options['maxspare']), 'minSpare': int(options['minspare']), 137 | 'maxThreads': int(options['maxchildren'])} 138 | else: 139 | return fastcgi_help('ERROR: Implementation must be one of prefork or thread.') 140 | 141 | wsgi_opts['debug'] = options['debug'] is not None 142 | 143 | try: 144 | module = importlib.import_module('.%s' % flup_module, 'flup') 145 | #WSGIServer = module.WSGIServer 146 | class WSGIServer(module.WSGIServer): 147 | 148 | def _spawnChild(self, sock): 149 | if not hasattr(self.application, '_unique_id'): 150 | self.application._unique_id = 0 151 | else: 152 | self.application._unique_id += 1 153 | 154 | return super(WSGIServer, self)._spawnChild(sock) 155 | 156 | except: 157 | print "Can't import flup." + flup_module 158 | return False 159 | 160 | if options['host'] and options['port'] and not options['socket']: 161 | wsgi_opts['bindAddress'] = options['host'], int(options['port']) 162 | elif options['socket'] and not options['host'] and not options['port']: 163 | wsgi_opts['bindAddress'] = options['socket'] 164 | elif not options['socket'] and not options['host'] and not options['port']: 165 | wsgi_opts['bindAddress'] = None 166 | else: 167 | return fastcgi_help('Invalid combination of host, port, socket.') 168 | 169 | if options['daemonize'] is None: 170 | # Default to daemonizing if we're running on a socket/named pipe. 171 | daemonize = wsgi_opts['bindAddress'] is not None 172 | else: 173 | if options['daemonize'].lower() in ('true', 'yes', 't'): 174 | daemonize = True 175 | elif options['daemonize'].lower() in ('false', 'no', 'f'): 176 | daemonize = False 177 | else: 178 | return fastcgi_help('ERROR: Invalid option for daemonize parameter.') 179 | 180 | daemon_kwargs = {} 181 | if options['outlog']: 182 | daemon_kwargs['out_log'] = options['outlog'] 183 | if options['errlog']: 184 | daemon_kwargs['err_log'] = options['errlog'] 185 | if options['umask']: 186 | daemon_kwargs['umask'] = int(options['umask']) 187 | 188 | if daemonize: 189 | from pwl.utils.daemonize import become_daemon 190 | become_daemon(our_home_dir=options['workdir'], **daemon_kwargs) 191 | 192 | if options['pidfile']: 193 | fp = open(options['pidfile'], 'w') 194 | fp.write('%d\n' % os.getpid()) 195 | fp.close() 196 | 197 | # TODO: add middlewares to application 198 | WSGIServer(app, **wsgi_opts).run() 199 | 200 | 201 | if __name__ == '__main__': 202 | runfastcgi(sys.argv[1:]) 203 | 204 | -------------------------------------------------------------------------------- /conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # test documentation build configuration file, created by 4 | # sphinx-quickstart on Tue Oct 1 17:11:44 2013. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [] 32 | 33 | # Add any paths that contain templates here, relative to this directory. 34 | templates_path = ['_templates'] 35 | 36 | # The suffix of source filenames. 37 | source_suffix = '.rst' 38 | 39 | # The encoding of source files. 40 | #source_encoding = 'utf-8-sig' 41 | 42 | # The master toctree document. 43 | master_doc = 'index' 44 | 45 | # General information about the project. 46 | project = u'test' 47 | copyright = u'2013, test' 48 | 49 | # The version info for the project you're documenting, acts as replacement for 50 | # |version| and |release|, also used in various other places throughout the 51 | # built documents. 52 | # 53 | # The short X.Y version. 54 | version = '1.0' 55 | # The full version, including alpha/beta/rc tags. 56 | release = '1.0' 57 | 58 | # The language for content autogenerated by Sphinx. Refer to documentation 59 | # for a list of supported languages. 60 | #language = None 61 | 62 | # There are two options for replacing |today|: either, you set today to some 63 | # non-false value, then it is used: 64 | #today = '' 65 | # Else, today_fmt is used as the format for a strftime call. 66 | #today_fmt = '%B %d, %Y' 67 | 68 | # List of patterns, relative to source directory, that match files and 69 | # directories to ignore when looking for source files. 70 | exclude_patterns = ['_build'] 71 | 72 | # The reST default role (used for this markup: `text`) to use for all 73 | # documents. 74 | #default_role = None 75 | 76 | # If true, '()' will be appended to :func: etc. cross-reference text. 77 | #add_function_parentheses = True 78 | 79 | # If true, the current module name will be prepended to all description 80 | # unit titles (such as .. function::). 81 | #add_module_names = True 82 | 83 | # If true, sectionauthor and moduleauthor directives will be shown in the 84 | # output. They are ignored by default. 85 | #show_authors = False 86 | 87 | # The name of the Pygments (syntax highlighting) style to use. 88 | pygments_style = 'sphinx' 89 | 90 | # A list of ignored prefixes for module index sorting. 91 | #modindex_common_prefix = [] 92 | 93 | # If true, keep warnings as "system message" paragraphs in the built documents. 94 | #keep_warnings = False 95 | 96 | 97 | # -- Options for HTML output ---------------------------------------------- 98 | 99 | # The theme to use for HTML and HTML Help pages. See the documentation for 100 | # a list of builtin themes. 101 | html_theme = 'default' 102 | 103 | # Theme options are theme-specific and customize the look and feel of a theme 104 | # further. For a list of options available for each theme, see the 105 | # documentation. 106 | #html_theme_options = {} 107 | 108 | # Add any paths that contain custom themes here, relative to this directory. 109 | #html_theme_path = [] 110 | 111 | # The name for this set of Sphinx documents. If None, it defaults to 112 | # " v documentation". 113 | #html_title = None 114 | 115 | # A shorter title for the navigation bar. Default is the same as html_title. 116 | #html_short_title = None 117 | 118 | # The name of an image file (relative to this directory) to place at the top 119 | # of the sidebar. 120 | #html_logo = None 121 | 122 | # The name of an image file (within the static path) to use as favicon of the 123 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 124 | # pixels large. 125 | #html_favicon = None 126 | 127 | # Add any paths that contain custom static files (such as style sheets) here, 128 | # relative to this directory. They are copied after the builtin static files, 129 | # so a file named "default.css" will overwrite the builtin "default.css". 130 | html_static_path = ['_static'] 131 | 132 | # Add any extra paths that contain custom files (such as robots.txt or 133 | # .htaccess) here, relative to this directory. These files are copied 134 | # directly to the root of the documentation. 135 | #html_extra_path = [] 136 | 137 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 138 | # using the given strftime format. 139 | #html_last_updated_fmt = '%b %d, %Y' 140 | 141 | # If true, SmartyPants will be used to convert quotes and dashes to 142 | # typographically correct entities. 143 | #html_use_smartypants = True 144 | 145 | # Custom sidebar templates, maps document names to template names. 146 | #html_sidebars = {} 147 | 148 | # Additional templates that should be rendered to pages, maps page names to 149 | # template names. 150 | #html_additional_pages = {} 151 | 152 | # If false, no module index is generated. 153 | #html_domain_indices = True 154 | 155 | # If false, no index is generated. 156 | #html_use_index = True 157 | 158 | # If true, the index is split into individual pages for each letter. 159 | #html_split_index = False 160 | 161 | # If true, links to the reST sources are added to the pages. 162 | #html_show_sourcelink = True 163 | 164 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 165 | #html_show_sphinx = True 166 | 167 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 168 | #html_show_copyright = True 169 | 170 | # If true, an OpenSearch description file will be output, and all pages will 171 | # contain a tag referring to it. The value of this option must be the 172 | # base URL from which the finished HTML is served. 173 | #html_use_opensearch = '' 174 | 175 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 176 | #html_file_suffix = None 177 | 178 | # Output file base name for HTML help builder. 179 | htmlhelp_basename = 'testdoc' 180 | 181 | 182 | # -- Options for LaTeX output --------------------------------------------- 183 | 184 | latex_elements = { 185 | # The paper size ('letterpaper' or 'a4paper'). 186 | #'papersize': 'letterpaper', 187 | 188 | # The font size ('10pt', '11pt' or '12pt'). 189 | #'pointsize': '10pt', 190 | 191 | # Additional stuff for the LaTeX preamble. 192 | #'preamble': '', 193 | } 194 | 195 | # Grouping the document tree into LaTeX files. List of tuples 196 | # (source start file, target name, title, 197 | # author, documentclass [howto/manual]). 198 | latex_documents = [ 199 | ('index', 'test.tex', u'test Documentation', 200 | u'test', 'manual'), 201 | ] 202 | 203 | # The name of an image file (relative to this directory) to place at the top of 204 | # the title page. 205 | #latex_logo = None 206 | 207 | # For "manual" documents, if this is true, then toplevel headings are parts, 208 | # not chapters. 209 | #latex_use_parts = False 210 | 211 | # If true, show page references after internal links. 212 | #latex_show_pagerefs = False 213 | 214 | # If true, show URL addresses after external links. 215 | #latex_show_urls = False 216 | 217 | # Documents to append as an appendix to all manuals. 218 | #latex_appendices = [] 219 | 220 | # If false, no module index is generated. 221 | #latex_domain_indices = True 222 | 223 | 224 | # -- Options for manual page output --------------------------------------- 225 | 226 | # One entry per manual page. List of tuples 227 | # (source start file, name, description, authors, manual section). 228 | man_pages = [ 229 | ('index', 'test', u'test Documentation', 230 | [u'test'], 1) 231 | ] 232 | 233 | # If true, show URL addresses after external links. 234 | #man_show_urls = False 235 | 236 | 237 | # -- Options for Texinfo output ------------------------------------------- 238 | 239 | # Grouping the document tree into Texinfo files. List of tuples 240 | # (source start file, target name, title, author, 241 | # dir menu entry, description, category) 242 | texinfo_documents = [ 243 | ('index', 'test', u'test Documentation', 244 | u'test', 'test', 'One line description of project.', 245 | 'Miscellaneous'), 246 | ] 247 | 248 | # Documents to append as an appendix to all manuals. 249 | #texinfo_appendices = [] 250 | 251 | # If false, no module index is generated. 252 | #texinfo_domain_indices = True 253 | 254 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 255 | #texinfo_show_urls = 'footnote' 256 | 257 | # If true, do not generate a @detailmenu in the "Top" node's menu. 258 | #texinfo_no_detailmenu = False 259 | -------------------------------------------------------------------------------- /static/sphinx/flasky.css: -------------------------------------------------------------------------------- 1 | /* 2 | * flasky.css_t 3 | * ~~~~~~~~~~~~ 4 | * 5 | * :copyright: Copyright 2010 by Armin Ronacher. Modifications by Kenneth Reitz. 6 | * :license: Flask Design License, see LICENSE for details. 7 | */ 8 | 9 | 10 | 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro'; 18 | font-size: 17px; 19 | background-color: white; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | width: 940px; 27 | margin: 30px auto 0 auto; 28 | } 29 | 30 | div.documentwrapper { 31 | float: left; 32 | width: 100%; 33 | } 34 | 35 | div.bodywrapper { 36 | margin: 0 0 0 220px; 37 | } 38 | 39 | div.sphinxsidebar { 40 | width: 220px; 41 | } 42 | 43 | hr { 44 | border: 1px solid #B1B4B6; 45 | } 46 | 47 | div.body { 48 | background-color: #ffffff; 49 | color: #3E4349; 50 | padding: 0 30px 0 30px; 51 | } 52 | 53 | img.floatingflask { 54 | padding: 0 0 10px 10px; 55 | float: right; 56 | } 57 | 58 | div.footer { 59 | width: 940px; 60 | margin: 20px auto 30px auto; 61 | font-size: 14px; 62 | color: #888; 63 | text-align: right; 64 | } 65 | 66 | div.footer a { 67 | color: #888; 68 | } 69 | 70 | div.related { 71 | display: none; 72 | } 73 | 74 | div.sphinxsidebar a { 75 | color: #444; 76 | text-decoration: none; 77 | border-bottom: 1px dotted #999; 78 | } 79 | 80 | div.sphinxsidebar a:hover { 81 | border-bottom: 1px solid #999; 82 | } 83 | 84 | div.sphinxsidebar { 85 | font-size: 14px; 86 | line-height: 1.5; 87 | } 88 | 89 | div.sphinxsidebarwrapper { 90 | padding: 18px 10px; 91 | } 92 | 93 | div.sphinxsidebarwrapper p.logo { 94 | padding: 0; 95 | margin: -10px 0 0 -20px; 96 | text-align: center; 97 | } 98 | 99 | div.sphinxsidebar h3, 100 | div.sphinxsidebar h4 { 101 | font-family: 'Garamond', 'Georgia', serif; 102 | color: #444; 103 | font-size: 24px; 104 | font-weight: normal; 105 | margin: 0 0 5px 0; 106 | padding: 0; 107 | } 108 | 109 | div.sphinxsidebar h4 { 110 | font-size: 20px; 111 | } 112 | 113 | div.sphinxsidebar h3 a { 114 | color: #444; 115 | } 116 | 117 | div.sphinxsidebar p.logo a, 118 | div.sphinxsidebar h3 a, 119 | div.sphinxsidebar p.logo a:hover, 120 | div.sphinxsidebar h3 a:hover { 121 | border: none; 122 | } 123 | 124 | div.sphinxsidebar p { 125 | color: #555; 126 | margin: 10px 0; 127 | } 128 | 129 | div.sphinxsidebar ul { 130 | margin: 10px 0; 131 | padding: 0; 132 | color: #000; 133 | } 134 | 135 | div.sphinxsidebar input { 136 | border: 1px solid #ccc; 137 | font-family: 'Georgia', serif; 138 | font-size: 1em; 139 | } 140 | 141 | /* -- body styles ----------------------------------------------------------- */ 142 | 143 | a { 144 | color: #004B6B; 145 | text-decoration: underline; 146 | } 147 | 148 | a:hover { 149 | color: #6D4100; 150 | text-decoration: underline; 151 | } 152 | 153 | div.body h1, 154 | div.body h2, 155 | div.body h3, 156 | div.body h4, 157 | div.body h5, 158 | div.body h6 { 159 | font-family: 'Garamond', 'Georgia', serif; 160 | font-weight: normal; 161 | margin: 30px 0px 10px 0px; 162 | padding: 0; 163 | } 164 | 165 | div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } 166 | div.body h2 { font-size: 210%; } 167 | div.body h3 { font-size: 150%; } 168 | div.body h4 { font-size: 130%; } 169 | div.body h5 { font-size: 100%; } 170 | div.body h6 { font-size: 100%; } 171 | 172 | a.headerlink { 173 | color: #ddd; 174 | padding: 0 4px; 175 | text-decoration: none; 176 | } 177 | 178 | a.headerlink:hover { 179 | color: #444; 180 | background: #eaeaea; 181 | } 182 | 183 | div.body p, div.body dd, div.body li { 184 | line-height: 1.4em; 185 | } 186 | 187 | div.admonition { 188 | background: #fafafa; 189 | margin: 20px -30px; 190 | padding: 10px 30px; 191 | border-top: 1px solid #ccc; 192 | border-bottom: 1px solid #ccc; 193 | } 194 | 195 | div.admonition tt.xref, div.admonition a tt { 196 | border-bottom: 1px solid #fafafa; 197 | } 198 | 199 | dd div.admonition { 200 | margin-left: -60px; 201 | padding-left: 60px; 202 | } 203 | 204 | div.admonition p.admonition-title { 205 | font-family: 'Garamond', 'Georgia', serif; 206 | font-weight: normal; 207 | font-size: 24px; 208 | margin: 0 0 10px 0; 209 | padding: 0; 210 | line-height: 1; 211 | } 212 | 213 | div.admonition p.last { 214 | margin-bottom: 0; 215 | } 216 | 217 | div.highlight { 218 | background-color: white; 219 | } 220 | 221 | dt:target, .highlight { 222 | background: #FAF3E8; 223 | } 224 | 225 | div.note { 226 | background-color: #eee; 227 | border: 1px solid #ccc; 228 | } 229 | 230 | div.seealso { 231 | background-color: #ffc; 232 | border: 1px solid #ff6; 233 | } 234 | 235 | div.topic { 236 | background-color: #eee; 237 | } 238 | 239 | p.admonition-title { 240 | display: inline; 241 | } 242 | 243 | p.admonition-title:after { 244 | content: ":"; 245 | } 246 | 247 | pre, tt { 248 | font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; 249 | font-size: 0.9em; 250 | } 251 | 252 | img.screenshot { 253 | } 254 | 255 | tt.descname, tt.descclassname { 256 | font-size: 0.95em; 257 | } 258 | 259 | tt.descname { 260 | padding-right: 0.08em; 261 | } 262 | 263 | img.screenshot { 264 | -moz-box-shadow: 2px 2px 4px #eee; 265 | -webkit-box-shadow: 2px 2px 4px #eee; 266 | box-shadow: 2px 2px 4px #eee; 267 | } 268 | 269 | table.docutils { 270 | border: 1px solid #888; 271 | -moz-box-shadow: 2px 2px 4px #eee; 272 | -webkit-box-shadow: 2px 2px 4px #eee; 273 | box-shadow: 2px 2px 4px #eee; 274 | } 275 | 276 | table.docutils td, table.docutils th { 277 | border: 1px solid #888; 278 | padding: 0.25em 0.7em; 279 | } 280 | 281 | table.field-list, table.footnote { 282 | border: none; 283 | -moz-box-shadow: none; 284 | -webkit-box-shadow: none; 285 | box-shadow: none; 286 | } 287 | 288 | table.footnote { 289 | margin: 15px 0; 290 | width: 100%; 291 | border: 1px solid #eee; 292 | background: #fdfdfd; 293 | font-size: 0.9em; 294 | } 295 | 296 | table.footnote + table.footnote { 297 | margin-top: -15px; 298 | border-top: none; 299 | } 300 | 301 | table.field-list th { 302 | padding: 0 0.8em 0 0; 303 | } 304 | 305 | table.field-list td { 306 | padding: 0; 307 | } 308 | 309 | table.footnote td.label { 310 | width: 0px; 311 | padding: 0.3em 0 0.3em 0.5em; 312 | } 313 | 314 | table.footnote td { 315 | padding: 0.3em 0.5em; 316 | } 317 | 318 | dl { 319 | margin: 0; 320 | padding: 0; 321 | } 322 | 323 | dl dd { 324 | margin-left: 30px; 325 | } 326 | 327 | blockquote { 328 | margin: 0 0 0 30px; 329 | padding: 0; 330 | } 331 | 332 | ul, ol { 333 | margin: 10px 0 10px 30px; 334 | padding: 0; 335 | } 336 | 337 | pre { 338 | background: #eee; 339 | padding: 7px 30px; 340 | margin: 15px -30px; 341 | line-height: 1.3em; 342 | } 343 | 344 | dl pre, blockquote pre, li pre { 345 | margin-left: -60px; 346 | padding-left: 60px; 347 | } 348 | 349 | dl dl pre { 350 | margin-left: -90px; 351 | padding-left: 90px; 352 | } 353 | 354 | tt { 355 | background-color: #ecf0f3; 356 | color: #222; 357 | /* padding: 1px 2px; */ 358 | } 359 | 360 | tt.xref, a tt { 361 | background-color: #FBFBFB; 362 | border-bottom: 1px solid white; 363 | } 364 | 365 | a.reference { 366 | text-decoration: none; 367 | border-bottom: 1px dotted #004B6B; 368 | } 369 | 370 | a.reference:hover { 371 | border-bottom: 1px solid #6D4100; 372 | } 373 | 374 | a.footnote-reference { 375 | text-decoration: none; 376 | font-size: 0.7em; 377 | vertical-align: top; 378 | border-bottom: 1px dotted #004B6B; 379 | } 380 | 381 | a.footnote-reference:hover { 382 | border-bottom: 1px solid #6D4100; 383 | } 384 | 385 | a:hover tt { 386 | background: #EEE; 387 | } 388 | 389 | 390 | @media screen and (max-width: 600px) { 391 | 392 | div.sphinxsidebar { 393 | display: none; 394 | } 395 | 396 | div.document { 397 | width: 100%; 398 | 399 | } 400 | 401 | div.documentwrapper { 402 | margin-left: 0; 403 | margin-top: 0; 404 | margin-right: 0; 405 | margin-bottom: 0; 406 | } 407 | 408 | div.bodywrapper { 409 | margin-top: 0; 410 | margin-right: 0; 411 | margin-bottom: 0; 412 | margin-left: 0; 413 | } 414 | 415 | ul { 416 | margin-left: 0; 417 | } 418 | 419 | .document { 420 | width: auto; 421 | } 422 | 423 | .footer { 424 | width: auto; 425 | } 426 | 427 | .bodywrapper { 428 | margin: 0; 429 | } 430 | 431 | .footer { 432 | width: auto; 433 | } 434 | 435 | .github { 436 | display: none; 437 | } 438 | 439 | } 440 | 441 | /* misc. */ 442 | 443 | .revsys-inline { 444 | display: none!important; 445 | } 446 | 447 | /* WTD specific */ 448 | 449 | table.docutils { 450 | border-collapse:collapse; 451 | border: 0 hidden; 452 | -moz-box-shadow: 0px 0px 0px #eee; 453 | -webkit-box-shadow: 0px 0px 0px #eee; 454 | box-shadow: 0px 0px 0px #eee; 455 | } 456 | 457 | table.docutils td { 458 | border: 0 hidden; 459 | } 460 | 461 | table.docutils tr { 462 | border: 0 hidden; 463 | } 464 | 465 | table.docutils th { 466 | border: 0 hidden; 467 | } 468 | 469 | #write-the-docs-schedule table { 470 | background-color: #fff; 471 | } 472 | -------------------------------------------------------------------------------- /var/themes/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | } 56 | 57 | div.sphinxsidebar ul { 58 | list-style: none; 59 | } 60 | 61 | div.sphinxsidebar ul ul, 62 | div.sphinxsidebar ul.want-points { 63 | margin-left: 20px; 64 | list-style: square; 65 | } 66 | 67 | div.sphinxsidebar ul ul { 68 | margin-top: 0; 69 | margin-bottom: 0; 70 | } 71 | 72 | div.sphinxsidebar form { 73 | margin-top: 10px; 74 | } 75 | 76 | div.sphinxsidebar input { 77 | border: 1px solid #98dbcc; 78 | font-family: sans-serif; 79 | font-size: 1em; 80 | } 81 | 82 | img { 83 | border: 0; 84 | } 85 | 86 | /* -- search page ----------------------------------------------------------- */ 87 | 88 | ul.search { 89 | margin: 10px 0 0 20px; 90 | padding: 0; 91 | } 92 | 93 | ul.search li { 94 | padding: 5px 0 5px 20px; 95 | background-image: url(file.png); 96 | background-repeat: no-repeat; 97 | background-position: 0 7px; 98 | } 99 | 100 | ul.search li a { 101 | font-weight: bold; 102 | } 103 | 104 | ul.search li div.context { 105 | color: #888; 106 | margin: 2px 0 0 30px; 107 | text-align: left; 108 | } 109 | 110 | ul.keywordmatches li.goodmatch a { 111 | font-weight: bold; 112 | } 113 | 114 | /* -- index page ------------------------------------------------------------ */ 115 | 116 | table.contentstable { 117 | width: 90%; 118 | } 119 | 120 | table.contentstable p.biglink { 121 | line-height: 150%; 122 | } 123 | 124 | a.biglink { 125 | font-size: 1.3em; 126 | } 127 | 128 | span.linkdescr { 129 | font-style: italic; 130 | padding-top: 5px; 131 | font-size: 90%; 132 | } 133 | 134 | /* -- general index --------------------------------------------------------- */ 135 | 136 | table.indextable { 137 | width: 100%; 138 | } 139 | 140 | table.indextable td { 141 | text-align: left; 142 | vertical-align: top; 143 | } 144 | 145 | table.indextable dl, table.indextable dd { 146 | margin-top: 0; 147 | margin-bottom: 0; 148 | } 149 | 150 | table.indextable tr.pcap { 151 | height: 10px; 152 | } 153 | 154 | table.indextable tr.cap { 155 | margin-top: 10px; 156 | background-color: #f2f2f2; 157 | } 158 | 159 | img.toggler { 160 | margin-right: 3px; 161 | margin-top: 3px; 162 | cursor: pointer; 163 | } 164 | 165 | div.modindex-jumpbox { 166 | border-top: 1px solid #ddd; 167 | border-bottom: 1px solid #ddd; 168 | margin: 1em 0 1em 0; 169 | padding: 0.4em; 170 | } 171 | 172 | div.genindex-jumpbox { 173 | border-top: 1px solid #ddd; 174 | border-bottom: 1px solid #ddd; 175 | margin: 1em 0 1em 0; 176 | padding: 0.4em; 177 | } 178 | 179 | /* -- general body styles --------------------------------------------------- */ 180 | 181 | a.headerlink { 182 | visibility: hidden; 183 | } 184 | 185 | h1:hover > a.headerlink, 186 | h2:hover > a.headerlink, 187 | h3:hover > a.headerlink, 188 | h4:hover > a.headerlink, 189 | h5:hover > a.headerlink, 190 | h6:hover > a.headerlink, 191 | dt:hover > a.headerlink { 192 | visibility: visible; 193 | } 194 | 195 | div.body p.caption { 196 | text-align: inherit; 197 | } 198 | 199 | div.body td { 200 | text-align: left; 201 | } 202 | 203 | .field-list ul { 204 | padding-left: 1em; 205 | } 206 | 207 | .first { 208 | margin-top: 0 !important; 209 | } 210 | 211 | p.rubric { 212 | margin-top: 30px; 213 | font-weight: bold; 214 | } 215 | 216 | .align-left { 217 | text-align: left; 218 | } 219 | 220 | .align-center { 221 | clear: both; 222 | text-align: center; 223 | } 224 | 225 | .align-right { 226 | text-align: right; 227 | } 228 | 229 | /* -- sidebars -------------------------------------------------------------- */ 230 | 231 | div.sidebar { 232 | margin: 0 0 0.5em 1em; 233 | border: 1px solid #ddb; 234 | padding: 7px 7px 0 7px; 235 | background-color: #ffe; 236 | width: 40%; 237 | float: right; 238 | } 239 | 240 | p.sidebar-title { 241 | font-weight: bold; 242 | } 243 | 244 | /* -- topics ---------------------------------------------------------------- */ 245 | 246 | div.topic { 247 | border: 1px solid #ccc; 248 | padding: 7px 7px 0 7px; 249 | margin: 10px 0 10px 0; 250 | } 251 | 252 | p.topic-title { 253 | font-size: 1.1em; 254 | font-weight: bold; 255 | margin-top: 10px; 256 | } 257 | 258 | /* -- admonitions ----------------------------------------------------------- */ 259 | 260 | div.admonition { 261 | margin-top: 10px; 262 | margin-bottom: 10px; 263 | padding: 7px; 264 | } 265 | 266 | div.admonition dt { 267 | font-weight: bold; 268 | } 269 | 270 | div.admonition dl { 271 | margin-bottom: 0; 272 | } 273 | 274 | p.admonition-title { 275 | margin: 0px 10px 5px 0px; 276 | font-weight: bold; 277 | } 278 | 279 | div.body p.centered { 280 | text-align: center; 281 | margin-top: 25px; 282 | } 283 | 284 | /* -- tables ---------------------------------------------------------------- */ 285 | 286 | table.docutils { 287 | border: 0; 288 | border-collapse: collapse; 289 | } 290 | 291 | table.docutils td, table.docutils th { 292 | padding: 1px 8px 1px 5px; 293 | border-top: 0; 294 | border-left: 0; 295 | border-right: 0; 296 | border-bottom: 1px solid #aaa; 297 | } 298 | 299 | table.field-list td, table.field-list th { 300 | border: 0 !important; 301 | } 302 | 303 | table.footnote td, table.footnote th { 304 | border: 0 !important; 305 | } 306 | 307 | th { 308 | text-align: left; 309 | padding-right: 5px; 310 | } 311 | 312 | table.citation { 313 | border-left: solid 1px gray; 314 | margin-left: 1px; 315 | } 316 | 317 | table.citation td { 318 | border-bottom: none; 319 | } 320 | 321 | /* -- other body styles ----------------------------------------------------- */ 322 | 323 | ol.arabic { 324 | list-style: decimal; 325 | } 326 | 327 | ol.loweralpha { 328 | list-style: lower-alpha; 329 | } 330 | 331 | ol.upperalpha { 332 | list-style: upper-alpha; 333 | } 334 | 335 | ol.lowerroman { 336 | list-style: lower-roman; 337 | } 338 | 339 | ol.upperroman { 340 | list-style: upper-roman; 341 | } 342 | 343 | dl { 344 | margin-bottom: 15px; 345 | } 346 | 347 | dd p { 348 | margin-top: 0px; 349 | } 350 | 351 | dd ul, dd table { 352 | margin-bottom: 10px; 353 | } 354 | 355 | dd { 356 | margin-top: 3px; 357 | margin-bottom: 10px; 358 | margin-left: 30px; 359 | } 360 | 361 | dt:target, .highlighted { 362 | background-color: #fbe54e; 363 | } 364 | 365 | dl.glossary dt { 366 | font-weight: bold; 367 | font-size: 1.1em; 368 | } 369 | 370 | .field-list ul { 371 | margin: 0; 372 | padding-left: 1em; 373 | } 374 | 375 | .field-list p { 376 | margin: 0; 377 | } 378 | 379 | .refcount { 380 | color: #060; 381 | } 382 | 383 | .optional { 384 | font-size: 1.3em; 385 | } 386 | 387 | .versionmodified { 388 | font-style: italic; 389 | } 390 | 391 | .system-message { 392 | background-color: #fda; 393 | padding: 5px; 394 | border: 3px solid red; 395 | } 396 | 397 | .footnote:target { 398 | background-color: #ffa 399 | } 400 | 401 | .line-block { 402 | display: block; 403 | margin-top: 1em; 404 | margin-bottom: 1em; 405 | } 406 | 407 | .line-block .line-block { 408 | margin-top: 0; 409 | margin-bottom: 0; 410 | margin-left: 1.5em; 411 | } 412 | 413 | .guilabel, .menuselection { 414 | font-family: sans-serif; 415 | } 416 | 417 | .accelerator { 418 | text-decoration: underline; 419 | } 420 | 421 | .classifier { 422 | font-style: oblique; 423 | } 424 | 425 | /* -- code displays --------------------------------------------------------- */ 426 | 427 | pre { 428 | overflow: auto; 429 | } 430 | 431 | td.linenos pre { 432 | padding: 5px 0px; 433 | border: 0; 434 | background-color: transparent; 435 | color: #aaa; 436 | } 437 | 438 | table.highlighttable { 439 | margin-left: 0.5em; 440 | } 441 | 442 | table.highlighttable td { 443 | padding: 0 0.5em 0 0.5em; 444 | } 445 | 446 | tt.descname { 447 | background-color: transparent; 448 | font-weight: bold; 449 | font-size: 1.2em; 450 | } 451 | 452 | tt.descclassname { 453 | background-color: transparent; 454 | } 455 | 456 | tt.xref, a tt { 457 | background-color: transparent; 458 | font-weight: bold; 459 | } 460 | 461 | h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { 462 | background-color: transparent; 463 | } 464 | 465 | .viewcode-link { 466 | float: right; 467 | } 468 | 469 | .viewcode-back { 470 | float: right; 471 | font-family: sans-serif; 472 | } 473 | 474 | div.viewcode-block:target { 475 | margin: -1px -10px; 476 | padding: 0 10px; 477 | } 478 | 479 | /* -- math display ---------------------------------------------------------- */ 480 | 481 | img.math { 482 | vertical-align: middle; 483 | } 484 | 485 | div.body div.math p { 486 | text-align: center; 487 | } 488 | 489 | span.eqno { 490 | float: right; 491 | } 492 | 493 | /* -- printout stylesheet --------------------------------------------------- */ 494 | 495 | @media print { 496 | div.document, 497 | div.documentwrapper, 498 | div.bodywrapper { 499 | margin: 0 !important; 500 | width: 100%; 501 | } 502 | 503 | div.sphinxsidebar, 504 | div.related, 505 | div.footer, 506 | #top-link { 507 | display: none; 508 | } 509 | } 510 | -------------------------------------------------------------------------------- /static/sphinx/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | } 56 | 57 | div.sphinxsidebar ul { 58 | list-style: none; 59 | } 60 | 61 | div.sphinxsidebar ul ul, 62 | div.sphinxsidebar ul.want-points { 63 | margin-left: 20px; 64 | list-style: square; 65 | } 66 | 67 | div.sphinxsidebar ul ul { 68 | margin-top: 0; 69 | margin-bottom: 0; 70 | } 71 | 72 | div.sphinxsidebar form { 73 | margin-top: 10px; 74 | } 75 | 76 | div.sphinxsidebar input { 77 | border: 1px solid #98dbcc; 78 | font-family: sans-serif; 79 | font-size: 1em; 80 | } 81 | 82 | div.sphinxsidebar #searchbox input[type="text"] { 83 | width: 170px; 84 | } 85 | 86 | div.sphinxsidebar #searchbox input[type="submit"] { 87 | width: 30px; 88 | } 89 | 90 | img { 91 | border: 0; 92 | } 93 | 94 | /* -- search page ----------------------------------------------------------- */ 95 | 96 | ul.search { 97 | margin: 10px 0 0 20px; 98 | padding: 0; 99 | } 100 | 101 | ul.search li { 102 | padding: 5px 0 5px 20px; 103 | background-image: url(file.png); 104 | background-repeat: no-repeat; 105 | background-position: 0 7px; 106 | } 107 | 108 | ul.search li a { 109 | font-weight: bold; 110 | } 111 | 112 | ul.search li div.context { 113 | color: #888; 114 | margin: 2px 0 0 30px; 115 | text-align: left; 116 | } 117 | 118 | ul.keywordmatches li.goodmatch a { 119 | font-weight: bold; 120 | } 121 | 122 | /* -- index page ------------------------------------------------------------ */ 123 | 124 | table.contentstable { 125 | width: 90%; 126 | } 127 | 128 | table.contentstable p.biglink { 129 | line-height: 150%; 130 | } 131 | 132 | a.biglink { 133 | font-size: 1.3em; 134 | } 135 | 136 | span.linkdescr { 137 | font-style: italic; 138 | padding-top: 5px; 139 | font-size: 90%; 140 | } 141 | 142 | /* -- general index --------------------------------------------------------- */ 143 | 144 | table.indextable { 145 | width: 100%; 146 | } 147 | 148 | table.indextable td { 149 | text-align: left; 150 | vertical-align: top; 151 | } 152 | 153 | table.indextable dl, table.indextable dd { 154 | margin-top: 0; 155 | margin-bottom: 0; 156 | } 157 | 158 | table.indextable tr.pcap { 159 | height: 10px; 160 | } 161 | 162 | table.indextable tr.cap { 163 | margin-top: 10px; 164 | background-color: #f2f2f2; 165 | } 166 | 167 | img.toggler { 168 | margin-right: 3px; 169 | margin-top: 3px; 170 | cursor: pointer; 171 | } 172 | 173 | div.modindex-jumpbox { 174 | border-top: 1px solid #ddd; 175 | border-bottom: 1px solid #ddd; 176 | margin: 1em 0 1em 0; 177 | padding: 0.4em; 178 | } 179 | 180 | div.genindex-jumpbox { 181 | border-top: 1px solid #ddd; 182 | border-bottom: 1px solid #ddd; 183 | margin: 1em 0 1em 0; 184 | padding: 0.4em; 185 | } 186 | 187 | /* -- general body styles --------------------------------------------------- */ 188 | 189 | a.headerlink { 190 | visibility: hidden; 191 | } 192 | 193 | h1:hover > a.headerlink, 194 | h2:hover > a.headerlink, 195 | h3:hover > a.headerlink, 196 | h4:hover > a.headerlink, 197 | h5:hover > a.headerlink, 198 | h6:hover > a.headerlink, 199 | dt:hover > a.headerlink { 200 | visibility: visible; 201 | } 202 | 203 | div.body p.caption { 204 | text-align: inherit; 205 | } 206 | 207 | div.body td { 208 | text-align: left; 209 | } 210 | 211 | .field-list ul { 212 | padding-left: 1em; 213 | } 214 | 215 | .first { 216 | margin-top: 0 !important; 217 | } 218 | 219 | p.rubric { 220 | margin-top: 30px; 221 | font-weight: bold; 222 | } 223 | 224 | img.align-left, .figure.align-left, object.align-left { 225 | clear: left; 226 | float: left; 227 | margin-right: 1em; 228 | } 229 | 230 | img.align-right, .figure.align-right, object.align-right { 231 | clear: right; 232 | float: right; 233 | margin-left: 1em; 234 | } 235 | 236 | img.align-center, .figure.align-center, object.align-center { 237 | display: block; 238 | margin-left: auto; 239 | margin-right: auto; 240 | } 241 | 242 | .align-left { 243 | text-align: left; 244 | } 245 | 246 | .align-center { 247 | text-align: center; 248 | } 249 | 250 | .align-right { 251 | text-align: right; 252 | } 253 | 254 | /* -- sidebars -------------------------------------------------------------- */ 255 | 256 | div.sidebar { 257 | margin: 0 0 0.5em 1em; 258 | border: 1px solid #ddb; 259 | padding: 7px 7px 0 7px; 260 | background-color: #ffe; 261 | width: 40%; 262 | float: right; 263 | } 264 | 265 | p.sidebar-title { 266 | font-weight: bold; 267 | } 268 | 269 | /* -- topics ---------------------------------------------------------------- */ 270 | 271 | div.topic { 272 | border: 1px solid #ccc; 273 | padding: 7px 7px 0 7px; 274 | margin: 10px 0 10px 0; 275 | } 276 | 277 | p.topic-title { 278 | font-size: 1.1em; 279 | font-weight: bold; 280 | margin-top: 10px; 281 | } 282 | 283 | /* -- admonitions ----------------------------------------------------------- */ 284 | 285 | div.admonition { 286 | margin-top: 10px; 287 | margin-bottom: 10px; 288 | padding: 7px; 289 | } 290 | 291 | div.admonition dt { 292 | font-weight: bold; 293 | } 294 | 295 | div.admonition dl { 296 | margin-bottom: 0; 297 | } 298 | 299 | p.admonition-title { 300 | margin: 0px 10px 5px 0px; 301 | font-weight: bold; 302 | } 303 | 304 | div.body p.centered { 305 | text-align: center; 306 | margin-top: 25px; 307 | } 308 | 309 | /* -- tables ---------------------------------------------------------------- */ 310 | 311 | table.docutils { 312 | border: 0; 313 | border-collapse: collapse; 314 | } 315 | 316 | table.docutils td, table.docutils th { 317 | padding: 1px 8px 1px 5px; 318 | border-top: 0; 319 | border-left: 0; 320 | border-right: 0; 321 | border-bottom: 1px solid #aaa; 322 | } 323 | 324 | table.field-list td, table.field-list th { 325 | border: 0 !important; 326 | } 327 | 328 | table.footnote td, table.footnote th { 329 | border: 0 !important; 330 | } 331 | 332 | th { 333 | text-align: left; 334 | padding-right: 5px; 335 | } 336 | 337 | table.citation { 338 | border-left: solid 1px gray; 339 | margin-left: 1px; 340 | } 341 | 342 | table.citation td { 343 | border-bottom: none; 344 | } 345 | 346 | /* -- other body styles ----------------------------------------------------- */ 347 | 348 | ol.arabic { 349 | list-style: decimal; 350 | } 351 | 352 | ol.loweralpha { 353 | list-style: lower-alpha; 354 | } 355 | 356 | ol.upperalpha { 357 | list-style: upper-alpha; 358 | } 359 | 360 | ol.lowerroman { 361 | list-style: lower-roman; 362 | } 363 | 364 | ol.upperroman { 365 | list-style: upper-roman; 366 | } 367 | 368 | dl { 369 | margin-bottom: 15px; 370 | } 371 | 372 | dd p { 373 | margin-top: 0px; 374 | } 375 | 376 | dd ul, dd table { 377 | margin-bottom: 10px; 378 | } 379 | 380 | dd { 381 | margin-top: 3px; 382 | margin-bottom: 10px; 383 | margin-left: 30px; 384 | } 385 | 386 | dt:target, .highlighted { 387 | background-color: #fbe54e; 388 | } 389 | 390 | dl.glossary dt { 391 | font-weight: bold; 392 | font-size: 1.1em; 393 | } 394 | 395 | .field-list ul { 396 | margin: 0; 397 | padding-left: 1em; 398 | } 399 | 400 | .field-list p { 401 | margin: 0; 402 | } 403 | 404 | .refcount { 405 | color: #060; 406 | } 407 | 408 | .optional { 409 | font-size: 1.3em; 410 | } 411 | 412 | .versionmodified { 413 | font-style: italic; 414 | } 415 | 416 | .system-message { 417 | background-color: #fda; 418 | padding: 5px; 419 | border: 3px solid red; 420 | } 421 | 422 | .footnote:target { 423 | background-color: #ffa; 424 | } 425 | 426 | .line-block { 427 | display: block; 428 | margin-top: 1em; 429 | margin-bottom: 1em; 430 | } 431 | 432 | .line-block .line-block { 433 | margin-top: 0; 434 | margin-bottom: 0; 435 | margin-left: 1.5em; 436 | } 437 | 438 | .guilabel, .menuselection { 439 | font-family: sans-serif; 440 | } 441 | 442 | .accelerator { 443 | text-decoration: underline; 444 | } 445 | 446 | .classifier { 447 | font-style: oblique; 448 | } 449 | 450 | abbr, acronym { 451 | border-bottom: dotted 1px; 452 | cursor: help; 453 | } 454 | 455 | /* -- code displays --------------------------------------------------------- */ 456 | 457 | pre { 458 | overflow: auto; 459 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 460 | } 461 | 462 | td.linenos pre { 463 | padding: 5px 0px; 464 | border: 0; 465 | background-color: transparent; 466 | color: #aaa; 467 | } 468 | 469 | table.highlighttable { 470 | margin-left: 0.5em; 471 | } 472 | 473 | table.highlighttable td { 474 | padding: 0 0.5em 0 0.5em; 475 | } 476 | 477 | tt.descname { 478 | background-color: transparent; 479 | font-weight: bold; 480 | font-size: 1.2em; 481 | } 482 | 483 | tt.descclassname { 484 | background-color: transparent; 485 | } 486 | 487 | tt.xref, a tt { 488 | background-color: transparent; 489 | font-weight: bold; 490 | } 491 | 492 | h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { 493 | background-color: transparent; 494 | } 495 | 496 | .viewcode-link { 497 | float: right; 498 | } 499 | 500 | .viewcode-back { 501 | float: right; 502 | font-family: sans-serif; 503 | } 504 | 505 | div.viewcode-block:target { 506 | margin: -1px -10px; 507 | padding: 0 10px; 508 | } 509 | 510 | /* -- math display ---------------------------------------------------------- */ 511 | 512 | img.math { 513 | vertical-align: middle; 514 | } 515 | 516 | div.body div.math p { 517 | text-align: center; 518 | } 519 | 520 | span.eqno { 521 | float: right; 522 | } 523 | 524 | /* -- printout stylesheet --------------------------------------------------- */ 525 | 526 | @media print { 527 | div.document, 528 | div.documentwrapper, 529 | div.bodywrapper { 530 | margin: 0 !important; 531 | width: 100%; 532 | } 533 | 534 | div.sphinxsidebar, 535 | div.related, 536 | div.footer, 537 | #top-link { 538 | display: none; 539 | } 540 | } -------------------------------------------------------------------------------- /static/markit/jquery.markitup.js: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // markItUp! Universal MarkUp Engine, JQuery plugin 3 | // v 1.1.7 4 | // Dual licensed under the MIT and GPL licenses. 5 | // ---------------------------------------------------------------------------- 6 | // Copyright (C) 2007-2010 Jay Salvat 7 | // http://markitup.jaysalvat.com/ 8 | // ---------------------------------------------------------------------------- 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // ---------------------------------------------------------------------------- 27 | (function($) { 28 | $.fn.markItUp = function(settings, extraSettings) { 29 | var options, ctrlKey, shiftKey, altKey; 30 | ctrlKey = shiftKey = altKey = false; 31 | 32 | options = { id: '', 33 | nameSpace: '', 34 | root: '', 35 | previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' 36 | previewAutoRefresh: true, 37 | previewPosition: 'after', 38 | previewTemplatePath: '~/templates/preview.html', 39 | previewParserPath: '', 40 | previewParserVar: 'data', 41 | resizeHandle: true, 42 | beforeInsert: '', 43 | afterInsert: '', 44 | onEnter: {}, 45 | onShiftEnter: {}, 46 | onCtrlEnter: {}, 47 | onTab: {}, 48 | markupSet: [ { /* set */ } ] 49 | }; 50 | $.extend(options, settings, extraSettings); 51 | 52 | // compute markItUp! path 53 | if (!options.root) { 54 | $('script').each(function(a, tag) { 55 | miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/); 56 | if (miuScript !== null) { 57 | options.root = miuScript[1]; 58 | } 59 | }); 60 | } 61 | 62 | return this.each(function() { 63 | var $$, textarea, levels, scrollPosition, caretPosition, caretOffset, 64 | clicked, hash, header, footer, previewWindow, template, iFrame, abort; 65 | $$ = $(this); 66 | textarea = this; 67 | levels = []; 68 | abort = false; 69 | scrollPosition = caretPosition = 0; 70 | caretOffset = -1; 71 | 72 | options.previewParserPath = localize(options.previewParserPath); 73 | options.previewTemplatePath = localize(options.previewTemplatePath); 74 | 75 | // apply the computed path to ~/ 76 | function localize(data, inText) { 77 | if (inText) { 78 | return data.replace(/("|')~\//g, "$1"+options.root); 79 | } 80 | return data.replace(/^~\//, options.root); 81 | } 82 | 83 | // init and build editor 84 | function init() { 85 | id = ''; nameSpace = ''; 86 | if (options.id) { 87 | id = 'id="'+options.id+'"'; 88 | } else if ($$.attr("id")) { 89 | id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"'; 90 | 91 | } 92 | if (options.nameSpace) { 93 | nameSpace = 'class="'+options.nameSpace+'"'; 94 | } 95 | $$.wrap('
'); 96 | $$.wrap('
'); 97 | $$.wrap('
'); 98 | $$.addClass("markItUpEditor"); 99 | 100 | // add the header before the textarea 101 | header = $('
').insertBefore($$); 102 | $(dropMenus(options.markupSet)).appendTo(header); 103 | 104 | // add the footer after the textarea 105 | footer = $('
').insertAfter($$); 106 | 107 | // add the resize handle after textarea 108 | if (options.resizeHandle === true && $.browser.safari !== true) { 109 | resizeHandle = $('
') 110 | .insertAfter($$) 111 | .bind("mousedown", function(e) { 112 | var h = $$.height(), y = e.clientY, mouseMove, mouseUp; 113 | mouseMove = function(e) { 114 | $$.css("height", Math.max(20, e.clientY+h-y)+"px"); 115 | return false; 116 | }; 117 | mouseUp = function(e) { 118 | $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); 119 | return false; 120 | }; 121 | $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp); 122 | }); 123 | footer.append(resizeHandle); 124 | } 125 | 126 | // listen key events 127 | $$.keydown(keyPressed).keyup(keyPressed); 128 | 129 | // bind an event to catch external calls 130 | $$.bind("insertion", function(e, settings) { 131 | if (settings.target !== false) { 132 | get(); 133 | } 134 | if (textarea === $.markItUp.focused) { 135 | markup(settings); 136 | } 137 | }); 138 | 139 | // remember the last focus 140 | $$.focus(function() { 141 | $.markItUp.focused = this; 142 | }); 143 | } 144 | 145 | // recursively build header with dropMenus from markupset 146 | function dropMenus(markupSet) { 147 | var ul = $('
    '), i = 0; 148 | $('li:hover > ul', ul).css('display', 'block'); 149 | $.each(markupSet, function() { 150 | var button = this, t = '', title, li, j; 151 | title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||''); 152 | key = (button.key) ? 'accesskey="'+button.key+'"' : ''; 153 | if (button.separator) { 154 | li = $('
  • '+(button.separator||'')+'
  • ').appendTo(ul); 155 | } else { 156 | i++; 157 | for (j = levels.length -1; j >= 0; j--) { 158 | t += levels[j]+"-"; 159 | } 160 | var aHref = $(''+(button.text||button.name||'')+''); 161 | if (button.text) { 162 | aHref.css('background-image', 'none'); 163 | if (button.text.length < 2) { 164 | aHref.css('text-indent', '0.4em'); 165 | } else { 166 | aHref.css('text-indent', '0'); 167 | } 168 | aHref.addClass('labeled'); 169 | } 170 | li = $('
  • ').append(aHref) 171 | .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click 172 | return false; 173 | }).click(function() { 174 | return false; 175 | }).mousedown(function() { 176 | if (button.call) { 177 | eval(button.call)(); 178 | } 179 | setTimeout(function() { markup(button) },1); 180 | return false; 181 | }).hover(function() { 182 | $('> ul', this).show(); 183 | $(document).one('click', function() { // close dropmenu if click outside 184 | $('ul ul', header).hide(); 185 | } 186 | ); 187 | }, function() { 188 | $('> ul', this).hide(); 189 | } 190 | ).appendTo(ul); 191 | if (button.dropMenu) { 192 | levels.push(i); 193 | $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu)); 194 | } 195 | } 196 | }); 197 | levels.pop(); 198 | return ul; 199 | } 200 | 201 | // markItUp! markups 202 | function magicMarkups(string) { 203 | if (string) { 204 | string = string.toString(); 205 | string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g, 206 | function(x, a) { 207 | var b = a.split('|!|'); 208 | if (altKey === true) { 209 | return (b[1] !== undefined) ? b[1] : b[0]; 210 | } else { 211 | return (b[1] === undefined) ? "" : b[0]; 212 | } 213 | } 214 | ); 215 | // [![prompt]!], [![prompt:!:value]!] 216 | string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g, 217 | function(x, a) { 218 | var b = a.split(':!:'); 219 | if (abort === true) { 220 | return false; 221 | } 222 | value = prompt(b[0], (b[1]) ? b[1] : ''); 223 | if (value === null) { 224 | abort = true; 225 | } 226 | return value; 227 | } 228 | ); 229 | return string; 230 | } 231 | return ""; 232 | } 233 | 234 | // prepare action 235 | function prepare(action) { 236 | if ($.isFunction(action)) { 237 | action = action(hash); 238 | } 239 | return magicMarkups(action); 240 | } 241 | 242 | // build block to insert 243 | function build(string) { 244 | openWith = prepare(clicked.openWith); 245 | placeHolder = prepare(clicked.placeHolder); 246 | replaceWith = prepare(clicked.replaceWith); 247 | closeWith = prepare(clicked.closeWith); 248 | if (replaceWith !== "") { 249 | block = openWith + replaceWith + closeWith; 250 | } else if (selection === '' && placeHolder !== '') { 251 | block = openWith + placeHolder + closeWith; 252 | } else { 253 | block = openWith + (string||selection) + closeWith; 254 | } 255 | return { block:block, 256 | openWith:openWith, 257 | replaceWith:replaceWith, 258 | placeHolder:placeHolder, 259 | closeWith:closeWith 260 | }; 261 | } 262 | 263 | // define markup to insert 264 | function markup(button) { 265 | var len, j, n, i; 266 | hash = clicked = button; 267 | get(); 268 | 269 | $.extend(hash, { line:"", 270 | root:options.root, 271 | options: options, 272 | textarea:textarea, 273 | selection:(selection||''), 274 | caretPosition:caretPosition, 275 | ctrlKey:ctrlKey, 276 | shiftKey:shiftKey, 277 | altKey:altKey 278 | } 279 | ); 280 | // callbacks before insertion 281 | prepare(options.beforeInsert); 282 | prepare(clicked.beforeInsert); 283 | if (ctrlKey === true && shiftKey === true) { 284 | prepare(clicked.beforeMultiInsert); 285 | } 286 | $.extend(hash, { line:1 }); 287 | 288 | if (ctrlKey === true && shiftKey === true) { 289 | lines = selection.split(/\r?\n/); 290 | for (j = 0, n = lines.length, i = 0; i < n; i++) { 291 | if ($.trim(lines[i]) !== '') { 292 | $.extend(hash, { line:++j, selection:lines[i] } ); 293 | lines[i] = build(lines[i]).block; 294 | } else { 295 | lines[i] = ""; 296 | } 297 | } 298 | string = { block:lines.join('\n')}; 299 | start = caretPosition; 300 | len = string.block.length + (($.browser.opera) ? n : 0); 301 | } else if (ctrlKey === true) { 302 | string = build(selection); 303 | start = caretPosition + string.openWith.length; 304 | len = string.block.length - string.openWith.length - string.closeWith.length; 305 | len -= fixIeBug(string.block); 306 | } else if (shiftKey === true) { 307 | string = build(selection); 308 | start = caretPosition; 309 | len = string.block.length; 310 | len -= fixIeBug(string.block); 311 | } else { 312 | string = build(selection); 313 | start = caretPosition + string.block.length ; 314 | len = 0; 315 | start -= fixIeBug(string.block); 316 | } 317 | if ((selection === '' && string.replaceWith === '')) { 318 | caretOffset += fixOperaBug(string.block); 319 | 320 | start = caretPosition + string.openWith.length; 321 | len = string.block.length - string.openWith.length - string.closeWith.length; 322 | 323 | caretOffset = $$.val().substring(caretPosition, $$.val().length).length; 324 | caretOffset -= fixOperaBug($$.val().substring(0, caretPosition)); 325 | } 326 | $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } ); 327 | 328 | if (string.block !== selection && abort === false) { 329 | insert(string.block); 330 | set(start, len); 331 | } else { 332 | caretOffset = -1; 333 | } 334 | get(); 335 | 336 | $.extend(hash, { line:'', selection:selection }); 337 | 338 | // callbacks after insertion 339 | if (ctrlKey === true && shiftKey === true) { 340 | prepare(clicked.afterMultiInsert); 341 | } 342 | prepare(clicked.afterInsert); 343 | prepare(options.afterInsert); 344 | 345 | // refresh preview if opened 346 | if (previewWindow && options.previewAutoRefresh) { 347 | refreshPreview(); 348 | } 349 | 350 | // reinit keyevent 351 | shiftKey = altKey = ctrlKey = abort = false; 352 | } 353 | 354 | // Substract linefeed in Opera 355 | function fixOperaBug(string) { 356 | if ($.browser.opera) { 357 | return string.length - string.replace(/\n*/g, '').length; 358 | } 359 | return 0; 360 | } 361 | // Substract linefeed in IE 362 | function fixIeBug(string) { 363 | if ($.browser.msie) { 364 | return string.length - string.replace(/\r*/g, '').length; 365 | } 366 | return 0; 367 | } 368 | 369 | // add markup 370 | function insert(block) { 371 | if (document.selection) { 372 | var newSelection = document.selection.createRange(); 373 | newSelection.text = block; 374 | } else { 375 | $$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length)); 376 | } 377 | } 378 | 379 | // set a selection 380 | function set(start, len) { 381 | if (textarea.createTextRange){ 382 | // quick fix to make it work on Opera 9.5 383 | if ($.browser.opera && $.browser.version >= 9.5 && len == 0) { 384 | return false; 385 | } 386 | range = textarea.createTextRange(); 387 | range.collapse(true); 388 | range.moveStart('character', start); 389 | range.moveEnd('character', len); 390 | range.select(); 391 | } else if (textarea.setSelectionRange ){ 392 | textarea.setSelectionRange(start, start + len); 393 | } 394 | textarea.scrollTop = scrollPosition; 395 | textarea.focus(); 396 | } 397 | 398 | // get the selection 399 | function get() { 400 | textarea.focus(); 401 | 402 | scrollPosition = textarea.scrollTop; 403 | if (document.selection) { 404 | selection = document.selection.createRange().text; 405 | if ($.browser.msie) { // ie 406 | var range = document.selection.createRange(), rangeCopy = range.duplicate(); 407 | rangeCopy.moveToElementText(textarea); 408 | caretPosition = -1; 409 | while(rangeCopy.inRange(range)) { // fix most of the ie bugs with linefeeds... 410 | rangeCopy.moveStart('character'); 411 | caretPosition ++; 412 | } 413 | } else { // opera 414 | caretPosition = textarea.selectionStart; 415 | } 416 | } else { // gecko & webkit 417 | caretPosition = textarea.selectionStart; 418 | selection = $$.val().substring(caretPosition, textarea.selectionEnd); 419 | } 420 | return selection; 421 | } 422 | 423 | // open preview window 424 | function preview() { 425 | if (!previewWindow || previewWindow.closed) { 426 | if (options.previewInWindow) { 427 | previewWindow = window.open('', 'preview', options.previewInWindow); 428 | } else { 429 | iFrame = $(''); 430 | if (options.previewPosition == 'after') { 431 | iFrame.insertAfter(footer); 432 | } else { 433 | iFrame.insertBefore(header); 434 | } 435 | previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1]; 436 | } 437 | } else if (altKey === true) { 438 | // Thx Stephen M. Redd for the IE8 fix 439 | if (iFrame) { 440 | iFrame.remove(); 441 | } else { 442 | previewWindow.close(); 443 | } 444 | previewWindow = iFrame = false; 445 | } 446 | if (!options.previewAutoRefresh) { 447 | refreshPreview(); 448 | } 449 | } 450 | 451 | // refresh Preview window 452 | function refreshPreview() { 453 | renderPreview(); 454 | } 455 | 456 | function renderPreview() { 457 | var phtml; 458 | if (options.previewParserPath !== '') { 459 | $.ajax( { 460 | type: 'POST', 461 | url: options.previewParserPath, 462 | data: options.previewParserVar+'='+encodeURIComponent($$.val()), 463 | success: function(data) { 464 | writeInPreview( localize(data, 1) ); 465 | } 466 | } ); 467 | } else { 468 | if (!template) { 469 | $.ajax( { 470 | url: options.previewTemplatePath, 471 | success: function(data) { 472 | writeInPreview( localize(data, 1).replace(//g, $$.val()) ); 473 | } 474 | } ); 475 | } 476 | } 477 | return false; 478 | } 479 | 480 | function writeInPreview(data) { 481 | if (previewWindow.document) { 482 | try { 483 | sp = previewWindow.document.documentElement.scrollTop 484 | } catch(e) { 485 | sp = 0; 486 | } 487 | previewWindow.document.open(); 488 | previewWindow.document.write(data); 489 | previewWindow.document.close(); 490 | previewWindow.document.documentElement.scrollTop = sp; 491 | } 492 | if (options.previewInWindow) { 493 | previewWindow.focus(); 494 | } 495 | } 496 | 497 | // set keys pressed 498 | function keyPressed(e) { 499 | shiftKey = e.shiftKey; 500 | altKey = e.altKey; 501 | ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false; 502 | 503 | if (e.type === 'keydown') { 504 | if (ctrlKey === true) { 505 | li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li'); 506 | if (li.length !== 0) { 507 | ctrlKey = false; 508 | setTimeout(function() { 509 | li.triggerHandler('mousedown'); 510 | },1); 511 | return false; 512 | } 513 | } 514 | if (e.keyCode === 13 || e.keyCode === 10) { // Enter key 515 | if (ctrlKey === true) { // Enter + Ctrl 516 | ctrlKey = false; 517 | markup(options.onCtrlEnter); 518 | return options.onCtrlEnter.keepDefault; 519 | } else if (shiftKey === true) { // Enter + Shift 520 | shiftKey = false; 521 | markup(options.onShiftEnter); 522 | return options.onShiftEnter.keepDefault; 523 | } else { // only Enter 524 | markup(options.onEnter); 525 | return options.onEnter.keepDefault; 526 | } 527 | } 528 | if (e.keyCode === 9) { // Tab key 529 | if (shiftKey == true || ctrlKey == true || altKey == true) { // Thx Dr Floob. 530 | return false; 531 | } 532 | if (caretOffset !== -1) { 533 | get(); 534 | caretOffset = $$.val().length - caretOffset; 535 | set(caretOffset, 0); 536 | caretOffset = -1; 537 | return false; 538 | } else { 539 | markup(options.onTab); 540 | return options.onTab.keepDefault; 541 | } 542 | } 543 | } 544 | } 545 | 546 | init(); 547 | }); 548 | }; 549 | 550 | $.fn.markItUpRemove = function() { 551 | return this.each(function() { 552 | var $$ = $(this).unbind().removeClass('markItUpEditor'); 553 | $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$); 554 | } 555 | ); 556 | }; 557 | 558 | $.markItUp = function(settings) { 559 | var options = { target:false }; 560 | $.extend(options, settings); 561 | if (options.target) { 562 | return $(options.target).each(function() { 563 | $(this).focus(); 564 | $(this).trigger('insertion', [options]); 565 | }); 566 | } else { 567 | $('textarea').trigger('insertion', [options]); 568 | } 569 | }; 570 | })(jQuery); 571 | -------------------------------------------------------------------------------- /static/style/overcast/jquery-ui-1.8.16.custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.16 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming/API 9 | */ 10 | 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { display: none; } 14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } 15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 17 | .ui-helper-clearfix { display: inline-block; } 18 | /* required comment for clearfix to work in Opera \*/ 19 | * html .ui-helper-clearfix { height:1%; } 20 | .ui-helper-clearfix { display:block; } 21 | /* end clearfix */ 22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 23 | 24 | 25 | /* Interaction Cues 26 | ----------------------------------*/ 27 | .ui-state-disabled { cursor: default !important; } 28 | 29 | 30 | /* Icons 31 | ----------------------------------*/ 32 | 33 | /* states and images */ 34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 35 | 36 | 37 | /* Misc visuals 38 | ----------------------------------*/ 39 | 40 | /* Overlays */ 41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 42 | 43 | 44 | /* 45 | * jQuery UI CSS Framework 1.8.16 46 | * 47 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 48 | * Dual licensed under the MIT or GPL Version 2 licenses. 49 | * http://jquery.org/license 50 | * 51 | * http://docs.jquery.com/UI/Theming/API 52 | * 53 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Helvetica,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=dddddd&bgTextureHeader=02_glass.png&bgImgOpacityHeader=35&borderColorHeader=bbbbbb&fcHeader=444444&iconColorHeader=999999&bgColorContent=c9c9c9&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=50&borderColorContent=aaaaaa&fcContent=333333&iconColorContent=999999&bgColorDefault=eeeeee&bgTextureDefault=02_glass.png&bgImgOpacityDefault=60&borderColorDefault=cccccc&fcDefault=3383bb&iconColorDefault=70b2e1&bgColorHover=f8f8f8&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=bbbbbb&fcHover=599fcf&iconColorHover=3383bb&bgColorActive=999999&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=75&borderColorActive=999999&fcActive=ffffff&iconColorActive=454545&bgColorHighlight=eeeeee&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=ffffff&fcHighlight=444444&iconColorHighlight=3383bb&bgColorError=c0402a&bgTextureError=01_flat.png&bgImgOpacityError=55&borderColorError=c0402a&fcError=ffffff&iconColorError=fbc856&bgColorOverlay=eeeeee&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0pxdow=0px 54 | */ 55 | 56 | 57 | /* Component containers 58 | ----------------------------------*/ 59 | .ui-widget { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1.1em; } 60 | .ui-widget .ui-widget { font-size: 1em; } 61 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1em; } 62 | .ui-widget-content { border: 1px solid #aaaaaa; background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x; color: #333333; } 63 | .ui-widget-content a { color: #333333; } 64 | .ui-widget-header { border: 1px solid #bbbbbb; background: #dddddd url(images/ui-bg_glass_35_dddddd_1x400.png) 50% 50% repeat-x; color: #444444; font-weight: bold; } 65 | .ui-widget-header a { color: #444444; } 66 | 67 | /* Interaction states 68 | ----------------------------------*/ 69 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #3383bb; } 70 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3383bb; text-decoration: none; } 71 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #bbbbbb; background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #599fcf; } 72 | .ui-state-hover a, .ui-state-hover a:hover { color: #599fcf; text-decoration: none; } 73 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #999999; background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; } 74 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } 75 | .ui-widget :active { outline: none; } 76 | 77 | /* Interaction Cues 78 | ----------------------------------*/ 79 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #ffffff; background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x; color: #444444; } 80 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; } 81 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #c0402a; background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x; color: #ffffff; } 82 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } 83 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } 84 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } 85 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 86 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 87 | 88 | /* Icons 89 | ----------------------------------*/ 90 | 91 | /* states and images */ 92 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_999999_256x240.png); } 93 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } 94 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } 95 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_70b2e1_256x240.png); } 96 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } 97 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } 98 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } 99 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbc856_256x240.png); } 100 | 101 | /* positioning */ 102 | .ui-icon-carat-1-n { background-position: 0 0; } 103 | .ui-icon-carat-1-ne { background-position: -16px 0; } 104 | .ui-icon-carat-1-e { background-position: -32px 0; } 105 | .ui-icon-carat-1-se { background-position: -48px 0; } 106 | .ui-icon-carat-1-s { background-position: -64px 0; } 107 | .ui-icon-carat-1-sw { background-position: -80px 0; } 108 | .ui-icon-carat-1-w { background-position: -96px 0; } 109 | .ui-icon-carat-1-nw { background-position: -112px 0; } 110 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 111 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 112 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 113 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 114 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 115 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 116 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 117 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 118 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 119 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 120 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 121 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 122 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 123 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 124 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 125 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 126 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 127 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 128 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 129 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 130 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 131 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 132 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 133 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 134 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 135 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 136 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 137 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 138 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 139 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 140 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 141 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 142 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 143 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 144 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 145 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 146 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 147 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 148 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 149 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 150 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 151 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 152 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 153 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 154 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 155 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 156 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 157 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 158 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 159 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 160 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 161 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 162 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 163 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 164 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 165 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 166 | .ui-icon-arrow-4 { background-position: 0 -80px; } 167 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 168 | .ui-icon-extlink { background-position: -32px -80px; } 169 | .ui-icon-newwin { background-position: -48px -80px; } 170 | .ui-icon-refresh { background-position: -64px -80px; } 171 | .ui-icon-shuffle { background-position: -80px -80px; } 172 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 173 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 174 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 175 | .ui-icon-folder-open { background-position: -16px -96px; } 176 | .ui-icon-document { background-position: -32px -96px; } 177 | .ui-icon-document-b { background-position: -48px -96px; } 178 | .ui-icon-note { background-position: -64px -96px; } 179 | .ui-icon-mail-closed { background-position: -80px -96px; } 180 | .ui-icon-mail-open { background-position: -96px -96px; } 181 | .ui-icon-suitcase { background-position: -112px -96px; } 182 | .ui-icon-comment { background-position: -128px -96px; } 183 | .ui-icon-person { background-position: -144px -96px; } 184 | .ui-icon-print { background-position: -160px -96px; } 185 | .ui-icon-trash { background-position: -176px -96px; } 186 | .ui-icon-locked { background-position: -192px -96px; } 187 | .ui-icon-unlocked { background-position: -208px -96px; } 188 | .ui-icon-bookmark { background-position: -224px -96px; } 189 | .ui-icon-tag { background-position: -240px -96px; } 190 | .ui-icon-home { background-position: 0 -112px; } 191 | .ui-icon-flag { background-position: -16px -112px; } 192 | .ui-icon-calendar { background-position: -32px -112px; } 193 | .ui-icon-cart { background-position: -48px -112px; } 194 | .ui-icon-pencil { background-position: -64px -112px; } 195 | .ui-icon-clock { background-position: -80px -112px; } 196 | .ui-icon-disk { background-position: -96px -112px; } 197 | .ui-icon-calculator { background-position: -112px -112px; } 198 | .ui-icon-zoomin { background-position: -128px -112px; } 199 | .ui-icon-zoomout { background-position: -144px -112px; } 200 | .ui-icon-search { background-position: -160px -112px; } 201 | .ui-icon-wrench { background-position: -176px -112px; } 202 | .ui-icon-gear { background-position: -192px -112px; } 203 | .ui-icon-heart { background-position: -208px -112px; } 204 | .ui-icon-star { background-position: -224px -112px; } 205 | .ui-icon-link { background-position: -240px -112px; } 206 | .ui-icon-cancel { background-position: 0 -128px; } 207 | .ui-icon-plus { background-position: -16px -128px; } 208 | .ui-icon-plusthick { background-position: -32px -128px; } 209 | .ui-icon-minus { background-position: -48px -128px; } 210 | .ui-icon-minusthick { background-position: -64px -128px; } 211 | .ui-icon-close { background-position: -80px -128px; } 212 | .ui-icon-closethick { background-position: -96px -128px; } 213 | .ui-icon-key { background-position: -112px -128px; } 214 | .ui-icon-lightbulb { background-position: -128px -128px; } 215 | .ui-icon-scissors { background-position: -144px -128px; } 216 | .ui-icon-clipboard { background-position: -160px -128px; } 217 | .ui-icon-copy { background-position: -176px -128px; } 218 | .ui-icon-contact { background-position: -192px -128px; } 219 | .ui-icon-image { background-position: -208px -128px; } 220 | .ui-icon-video { background-position: -224px -128px; } 221 | .ui-icon-script { background-position: -240px -128px; } 222 | .ui-icon-alert { background-position: 0 -144px; } 223 | .ui-icon-info { background-position: -16px -144px; } 224 | .ui-icon-notice { background-position: -32px -144px; } 225 | .ui-icon-help { background-position: -48px -144px; } 226 | .ui-icon-check { background-position: -64px -144px; } 227 | .ui-icon-bullet { background-position: -80px -144px; } 228 | .ui-icon-radio-off { background-position: -96px -144px; } 229 | .ui-icon-radio-on { background-position: -112px -144px; } 230 | .ui-icon-pin-w { background-position: -128px -144px; } 231 | .ui-icon-pin-s { background-position: -144px -144px; } 232 | .ui-icon-play { background-position: 0 -160px; } 233 | .ui-icon-pause { background-position: -16px -160px; } 234 | .ui-icon-seek-next { background-position: -32px -160px; } 235 | .ui-icon-seek-prev { background-position: -48px -160px; } 236 | .ui-icon-seek-end { background-position: -64px -160px; } 237 | .ui-icon-seek-start { background-position: -80px -160px; } 238 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 239 | .ui-icon-seek-first { background-position: -80px -160px; } 240 | .ui-icon-stop { background-position: -96px -160px; } 241 | .ui-icon-eject { background-position: -112px -160px; } 242 | .ui-icon-volume-off { background-position: -128px -160px; } 243 | .ui-icon-volume-on { background-position: -144px -160px; } 244 | .ui-icon-power { background-position: 0 -176px; } 245 | .ui-icon-signal-diag { background-position: -16px -176px; } 246 | .ui-icon-signal { background-position: -32px -176px; } 247 | .ui-icon-battery-0 { background-position: -48px -176px; } 248 | .ui-icon-battery-1 { background-position: -64px -176px; } 249 | .ui-icon-battery-2 { background-position: -80px -176px; } 250 | .ui-icon-battery-3 { background-position: -96px -176px; } 251 | .ui-icon-circle-plus { background-position: 0 -192px; } 252 | .ui-icon-circle-minus { background-position: -16px -192px; } 253 | .ui-icon-circle-close { background-position: -32px -192px; } 254 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 255 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 256 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 257 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 258 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 259 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 260 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 261 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 262 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 263 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 264 | .ui-icon-circle-check { background-position: -208px -192px; } 265 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 266 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 267 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 268 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 269 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 270 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 271 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 272 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 273 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 274 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 275 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 276 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 277 | 278 | 279 | /* Misc visuals 280 | ----------------------------------*/ 281 | 282 | /* Corner radius */ 283 | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; } 284 | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; } 285 | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } 286 | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } 287 | 288 | /* Overlays */ 289 | .ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } 290 | .ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0pxdow=0px; -khtml-border-radius: 0pxdow=0px; -webkit-border-radius: 0pxdow=0px; border-radius: 0pxdow=0px; }/* 291 | * jQuery UI Resizable 1.8.16 292 | * 293 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 294 | * Dual licensed under the MIT or GPL Version 2 licenses. 295 | * http://jquery.org/license 296 | * 297 | * http://docs.jquery.com/UI/Resizable#theming 298 | */ 299 | .ui-resizable { position: relative;} 300 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } 301 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 302 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 303 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 304 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 305 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 306 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 307 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 308 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 309 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* 310 | * jQuery UI Selectable 1.8.16 311 | * 312 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 313 | * Dual licensed under the MIT or GPL Version 2 licenses. 314 | * http://jquery.org/license 315 | * 316 | * http://docs.jquery.com/UI/Selectable#theming 317 | */ 318 | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } 319 | /* 320 | * jQuery UI Button 1.8.16 321 | * 322 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 323 | * Dual licensed under the MIT or GPL Version 2 licenses. 324 | * http://jquery.org/license 325 | * 326 | * http://docs.jquery.com/UI/Button#theming 327 | */ 328 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 329 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 330 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 331 | .ui-button-icons-only { width: 3.4em; } 332 | button.ui-button-icons-only { width: 3.7em; } 333 | 334 | /*button text element */ 335 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 336 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 337 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 338 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 339 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } 340 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 341 | /* no icon support for input elements, provide padding by default */ 342 | input.ui-button { padding: .4em 1em; } 343 | 344 | /*button icon element(s) */ 345 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 346 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 347 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 348 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 349 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 350 | 351 | /*button sets*/ 352 | .ui-buttonset { margin-right: 7px; } 353 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 354 | 355 | /* workarounds */ 356 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 357 | -------------------------------------------------------------------------------- /static/scripts/jquery.layout.min-1.2.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.layout 1.2.0 3 | * 4 | * Copyright (c) 2008 5 | * Fabrizio Balliano (http://www.fabrizioballiano.net) 6 | * Kevin Dalman (http://allpro.net) 7 | * 8 | * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) 9 | * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. 10 | * 11 | * $Date: 2008-12-27 02:17:22 +0100 (sab, 27 dic 2008) $ 12 | * $Rev: 203 $ 13 | * 14 | * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars 15 | */ 16 | (function($){$.fn.layout=function(opts){var 17 | prefix="ui-layout-",defaults={paneClass:prefix+"pane",resizerClass:prefix+"resizer",togglerClass:prefix+"toggler",togglerInnerClass:prefix+"",buttonClass:prefix+"button",contentSelector:"."+prefix+"content",contentIgnoreSelector:"."+prefix+"ignore"};var options={name:"",scrollToBookmarkOnLoad:true,defaults:{applyDefaultStyles:false,closable:true,resizable:true,slidable:true,contentSelector:defaults.contentSelector,contentIgnoreSelector:defaults.contentIgnoreSelector,paneClass:defaults.paneClass,resizerClass:defaults.resizerClass,togglerClass:defaults.togglerClass,buttonClass:defaults.buttonClass,resizerDragOpacity:1,maskIframesOnResize:true,minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:"Close",togglerTip_closed:"Open",resizerTip:"Resize",sliderTip:"Slide Open",sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},initClosed:false,initHidden:false},north:{paneSelector:"."+prefix+"north",size:"auto",resizerCursor:"n-resize"},south:{paneSelector:"."+prefix+"south",size:"auto",resizerCursor:"s-resize"},east:{paneSelector:"."+prefix+"east",size:200,resizerCursor:"e-resize"},west:{paneSelector:"."+prefix+"west",size:200,resizerCursor:"w-resize"},center:{paneSelector:"."+prefix+"center"}};var effects={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}};var config={allPanes:"north,south,east,west,center",borderPanes:"north,south,east,west",zIndex:{resizer_normal:1,pane_normal:2,mask:4,sliding:100,resizing:10000,animation:10000},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden",zIndex:1},cssDef:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDef:{background:"#AAA"}},content:{cssReq:{overflow:"auto"},cssDef:{}},defaults:{cssReq:{position:"absolute",margin:0,zIndex:2},cssDef:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{edge:"top",sizeType:"height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{edge:"bottom",sizeType:"height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{edge:"right",sizeType:"width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{edge:"left",sizeType:"width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}};var state={id:Math.floor(Math.random()*10000),container:{},north:{},south:{},east:{},west:{},center:{}};var 18 | altEdge={top:"bottom",bottom:"top",left:"right",right:"left"},altSide={north:"south",south:"north",east:"west",west:"east"};var isStr=function(o){if(typeof o=="string")return true;else if(typeof o=="object"){try{var match=o.constructor.toString().match(/string/i);return(match!==null);}catch(e){}}return false;};var str=function(o){if(typeof o=="string"||isStr(o))return $.trim(o);else return o;};var min=function(x,y){return Math.min(x,y);};var max=function(x,y){return Math.max(x,y);};var transformData=function(d){var json={defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};d=d||{};if(d.effects||d.defaults||d.north||d.south||d.west||d.east||d.center)json=$.extend(json,d);else 19 | $.each(d,function(key,val){a=key.split("__");json[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=val;});return json;};var setFlowCallback=function(action,pane,param){var 20 | cb=action+","+pane+","+(param?1:0),cP,cbPane;$.each(c.borderPanes.split(","),function(i,p){if(c[p].isMoving){bindCallback(p);return false;}});function bindCallback(p,test){cP=c[p];if(!cP.doCallback){cP.doCallback=true;cP.callback=cb;}else{cpPane=cP.callback.split(",")[1];if(cpPane!=p&&cpPane!=pane)bindCallback(cpPane,true);}}};var execFlowCallback=function(pane){var cP=c[pane];c.isLayoutBusy=false;delete cP.isMoving;if(!cP.doCallback||!cP.callback)return;cP.doCallback=false;var 21 | cb=cP.callback.split(","),param=(cb[2]>0?true:false);if(cb[0]=="open")open(cb[1],param);else if(cb[0]=="close")close(cb[1],param);if(!cP.doCallback)cP.callback=null;};var execUserCallback=function(pane,v_fn){if(!v_fn)return;var fn;try{if(typeof v_fn=="function")fn=v_fn;else if(typeof v_fn!="string")return;else if(v_fn.indexOf(",")>0){var 22 | args=v_fn.split(","),fn=eval(args[0]);if(typeof fn=="function"&&args.length>1)return fn(args[1]);}else 23 | fn=eval(v_fn);if(typeof fn=="function")return fn(pane,$Ps[pane],$.extend({},state[pane]),$.extend({},options[pane]),options.name);}catch(ex){}};var cssNum=function($E,prop){var 24 | val=0,hidden=false,visibility="";if(!$.browser.msie){if($.curCSS($E[0],"display",true)=="none"){hidden=true;visibility=$.curCSS($E[0],"visibility",true);$E.css({display:"block",visibility:"hidden"});}}val=parseInt($.curCSS($E[0],prop,true),10)||0;if(hidden){$E.css({display:"none"});if(visibility&&visibility!="hidden")$E.css({visibility:visibility});}return val;};var cssW=function(e,outerWidth){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else 25 | $E=$(e);if(outerWidth<=0)return 0;else if(!(outerWidth>0))outerWidth=isStr(e)?getPaneSize(e):$E.outerWidth();if(!$.boxModel)return outerWidth;else 26 | return outerWidth 27 | -cssNum($E,"paddingLeft")-cssNum($E,"paddingRight")-($.curCSS($E[0],"borderLeftStyle",true)=="none"?0:cssNum($E,"borderLeftWidth"))-($.curCSS($E[0],"borderRightStyle",true)=="none"?0:cssNum($E,"borderRightWidth"));};var cssH=function(e,outerHeight){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else 28 | $E=$(e);if(outerHeight<=0)return 0;else if(!(outerHeight>0))outerHeight=(isStr(e))?getPaneSize(e):$E.outerHeight();if(!$.boxModel)return outerHeight;else 29 | return outerHeight 30 | -cssNum($E,"paddingTop")-cssNum($E,"paddingBottom")-($.curCSS($E[0],"borderTopStyle",true)=="none"?0:cssNum($E,"borderTopWidth"))-($.curCSS($E[0],"borderBottomStyle",true)=="none"?0:cssNum($E,"borderBottomWidth"));};var cssSize=function(pane,outerSize){if(c[pane].dir=="horz")return cssH(pane,outerSize);else 31 | return cssW(pane,outerSize);};var getPaneSize=function(pane,inclSpace){var 32 | $P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden)return 0;else if(s.isClosed||(s.isSliding&&inclSpace))return cSp;else if(c[pane].dir=="horz")return $P.outerHeight()+oSp;else 33 | return $P.outerWidth()+oSp;};var setPaneMinMaxSizes=function(pane){var 34 | d=cDims,edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$altPane=$Ps[altSide[pane]],paneSpacing=o.spacing_open,altPaneSpacing=options[altSide[pane]].spacing_open,altPaneSize=(!$altPane?0:(dir=="horz"?$altPane.outerHeight():$altPane.outerWidth())),containerSize=(dir=="horz"?d.innerHeight:d.innerWidth),limitSize=containerSize-paneSpacing-altPaneSize-altPaneSpacing,minSize=s.minSize||0,maxSize=Math.min(s.maxSize||9999,limitSize),minPos,maxPos;switch(pane){case"north":minPos=d.offsetTop+minSize;maxPos=d.offsetTop+maxSize;break;case"west":minPos=d.offsetLeft+minSize;maxPos=d.offsetLeft+maxSize;break;case"south":minPos=d.offsetTop+d.innerHeight-maxSize;maxPos=d.offsetTop+d.innerHeight-minSize;break;case"east":minPos=d.offsetLeft+d.innerWidth-maxSize;maxPos=d.offsetLeft+d.innerWidth-minSize;break;}$.extend(s,{minSize:minSize,maxSize:maxSize,minPosition:minPos,maxPosition:maxPos});};var getPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};with(d){width=cDims.innerWidth-left-right;height=cDims.innerHeight-bottom-top;top+=cDims.top;bottom+=cDims.bottom;left+=cDims.left;right+=cDims.right;}return d;};var getElemDims=function($E){var 35 | d={},e,b,p;$.each("Left,Right,Top,Bottom".split(","),function(){e=str(this);b=d["border"+e]=cssNum($E,"border"+e+"Width");p=d["padding"+e]=cssNum($E,"padding"+e);d["offset"+e]=b+p;if($E==$Container)d[e.toLowerCase()]=($.boxModel?p:0);});d.innerWidth=d.outerWidth=$E.outerWidth();d.innerHeight=d.outerHeight=$E.outerHeight();if($.boxModel){d.innerWidth-=(d.offsetLeft+d.offsetRight);d.innerHeight-=(d.offsetTop+d.offsetBottom);}return d;};var setTimer=function(pane,action,fn,ms){var 36 | Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name])return;else Timers[name]=setTimeout(fn,ms);};var clearTimer=function(pane,action){var 37 | Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name]){clearTimeout(Timers[name]);delete Timers[name];return true;}else 38 | return false;};var create=function(){initOptions();initContainer();initPanes();initHandles();initResizable();sizeContent("all");if(options.scrollToBookmarkOnLoad)with(self.location)if(hash)replace(hash);initHotkeys();$(window).resize(function(){var timerID="timerLayout_"+state.id;if(window[timerID])clearTimeout(window[timerID]);window[timerID]=null;if(true||$.browser.msie)window[timerID]=setTimeout(resizeAll,100);else 39 | resizeAll();});};var initContainer=function(){try{if($Container[0].tagName=="BODY"){$("html").css({height:"100%",overflow:"hidden"});$("body").css({position:"relative",height:"100%",overflow:"hidden",margin:0,padding:0,border:"none"});}else{var 40 | CSS={overflow:"hidden"},p=$Container.css("position"),h=$Container.css("height");if(!$Container.hasClass("ui-layout-pane")){if(!p||"fixed,absolute,relative".indexOf(p)<0)CSS.position="relative";if(!h||h=="auto")CSS.height="100%";}$Container.css(CSS);}}catch(ex){}cDims=state.container=getElemDims($Container);};var initHotkeys=function(){$.each(c.borderPanes.split(","),function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).keydown(keyDown);return false;}});};var initOptions=function(){opts=transformData(opts);if(opts.effects){$.extend(effects,opts.effects);delete opts.effects;}$.each("name,scrollToBookmarkOnLoad".split(","),function(idx,key){if(opts[key]!==undefined)options[key]=opts[key];else if(opts.defaults[key]!==undefined){options[key]=opts.defaults[key];delete opts.defaults[key];}});$.each("paneSelector,resizerCursor,customHotkey".split(","),function(idx,key){delete opts.defaults[key];});$.extend(options.defaults,opts.defaults);c.center=$.extend(true,{},c.defaults,c.center);$.extend(options.center,opts.center);var o_Center=$.extend(true,{},options.defaults,opts.defaults,options.center);$.each("paneClass,contentSelector,contentIgnoreSelector,applyDefaultStyles,showOverflowOnHover".split(","),function(idx,key){options.center[key]=o_Center[key];});var defs=options.defaults;$.each(c.borderPanes.split(","),function(i,pane){c[pane]=$.extend(true,{},c.defaults,c[pane]);o=options[pane]=$.extend(true,{},options.defaults,options[pane],opts.defaults,opts[pane]);if(!o.paneClass)o.paneClass=defaults.paneClass;if(!o.resizerClass)o.resizerClass=defaults.resizerClass;if(!o.togglerClass)o.togglerClass=defaults.togglerClass;$.each(["_open","_close",""],function(i,n){var 41 | sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n;o[sName]=opts[pane][sName]||opts[pane].fxName||opts.defaults[sName]||opts.defaults.fxName||o[sName]||o.fxName||defs[sName]||defs.fxName||"none";var fxName=o[sName];if(fxName=="none"||!$.effects||!$.effects[fxName]||(!effects[fxName]&&!o[sSettings]&&!o.fxSettings))fxName=o[sName]="none";var 42 | fx=effects[fxName]||{},fx_all=fx.all||{},fx_pane=fx[pane]||{};o[sSettings]=$.extend({},fx_all,fx_pane,defs.fxSettings||{},defs[sSettings]||{},o.fxSettings,o[sSettings],opts.defaults.fxSettings,opts.defaults[sSettings]||{},opts[pane].fxSettings,opts[pane][sSettings]||{});o[sSpeed]=opts[pane][sSpeed]||opts[pane].fxSpeed||opts.defaults[sSpeed]||opts.defaults.fxSpeed||o[sSpeed]||o[sSettings].duration||o.fxSpeed||o.fxSettings.duration||defs.fxSpeed||defs.fxSettings.duration||fx_pane.duration||fx_all.duration||"normal";});});};var initPanes=function(){$.each(c.allPanes.split(","),function(){var 43 | pane=str(this),o=options[pane],s=state[pane],fx=s.fx,dir=c[pane].dir,size=o.size=="auto"||isNaN(o.size)?0:o.size,minSize=o.minSize||1,maxSize=o.maxSize||9999,spacing=o.spacing_open||0,sel=o.paneSelector,isIE6=($.browser.msie&&$.browser.version<7),CSS={},$P,$C;$Cs[pane]=false;if(sel.substr(0,1)==="#")$P=$Ps[pane]=$Container.find(sel+":first");else{$P=$Ps[pane]=$Container.children(sel+":first");if(!$P.length)$P=$Ps[pane]=$Container.children("form:first").children(sel+":first");}if(!$P.length){$Ps[pane]=false;return true;}$P.attr("pane",pane).addClass(o.paneClass+" "+o.paneClass+"-"+pane);if(pane!="center"){s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false;s.noRoom=false;c[pane].pins=[];}CSS=$.extend({visibility:"visible",display:"block"},c.defaults.cssReq,c[pane].cssReq);if(o.applyDefaultStyles)$.extend(CSS,c.defaults.cssDef,c[pane].cssDef);$P.css(CSS);CSS={};switch(pane){case"north":CSS.top=cDims.top;CSS.left=cDims.left;CSS.right=cDims.right;break;case"south":CSS.bottom=cDims.bottom;CSS.left=cDims.left;CSS.right=cDims.right;break;case"west":CSS.left=cDims.left;break;case"east":CSS.right=cDims.right;break;case"center":}if(dir=="horz"){if(size===0||size=="auto"){$P.css({height:"auto"});size=$P.outerHeight();}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerHeight-spacing);CSS.height=max(1,cssH(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.height+1);$P.css(CSS);}else if(dir=="vert"){if(size===0||size=="auto"){$P.css({width:"auto",float:"left"});size=$P.outerWidth();$P.css({float:"none"});}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerWidth-spacing);CSS.width=max(1,cssW(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.width+1);$P.css(CSS);sizeMidPanes(pane,null,true);}else if(pane=="center"){$P.css(CSS);sizeMidPanes("center",null,true);}if(o.initClosed&&o.closable){$P.hide().addClass("closed");s.isClosed=true;}else if(o.initHidden||o.initClosed){hide(pane,true);s.isHidden=true;}else 44 | $P.addClass("open");if(o.showOverflowOnHover)$P.hover(allowOverflow,resetOverflow);if(o.contentSelector){$C=$Cs[pane]=$P.children(o.contentSelector+":first");if(!$C.length){$Cs[pane]=false;return true;}$C.css(c.content.cssReq);if(o.applyDefaultStyles)$C.css(c.content.cssDef);$P.css({overflow:"hidden"});}});};var initHandles=function(){$.each(c.borderPanes.split(","),function(){var 45 | pane=str(this),o=options[pane],s=state[pane],rClass=o.resizerClass,tClass=o.togglerClass,$P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P||(!o.closable&&!o.resizable))return;var 46 | edge=c[pane].edge,isOpen=$P.is(":visible"),spacing=(isOpen?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(isOpen?"-open":"-closed"),$R,$T;$R=$Rs[pane]=$("");if(isOpen&&o.resizable);else if(!isOpen&&o.slidable)$R.attr("title",o.sliderTip).css("cursor",o.sliderCursor);$R.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-resizer":"")).attr("resizer",pane).css(c.resizers.cssReq).css(edge,cDims[edge]+getPaneSize(pane)).addClass(rClass+" "+rClass+_pane+" "+rClass+_state+" "+rClass+_pane+_state).appendTo($Container);if(o.applyDefaultStyles)$R.css(c.resizers.cssDef);if(o.closable){$T=$Ts[pane]=$("
    ");$T.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-toggler":"")).css(c.togglers.cssReq).attr("title",(isOpen?o.togglerTip_open:o.togglerTip_closed)).click(function(evt){toggle(pane);evt.stopPropagation();}).mouseover(function(evt){evt.stopPropagation();}).addClass(tClass+" "+tClass+_pane+" "+tClass+_state+" "+tClass+_pane+_state).appendTo($R);if(o.togglerContent_open)$(""+o.togglerContent_open+"").addClass("content content-open").css("display",s.isClosed?"none":"block").appendTo($T);if(o.togglerContent_closed)$(""+o.togglerContent_closed+"").addClass("content content-closed").css("display",s.isClosed?"block":"none").appendTo($T);if(o.applyDefaultStyles)$T.css(c.togglers.cssDef);if(!isOpen)bindStartSlidingEvent(pane,true);}});sizeHandles("all",true);};var initResizable=function(){var 47 | draggingAvailable=(typeof $.fn.draggable=="function"),minPosition,maxPosition,edge;$.each(c.borderPanes.split(","),function(){var 48 | pane=str(this),o=options[pane],s=state[pane];if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true;}var 49 | rClass=o.resizerClass,dragClass=rClass+"-drag",dragPaneClass=rClass+"-"+pane+"-drag",draggingClass=rClass+"-dragging",draggingPaneClass=rClass+"-"+pane+"-dragging",draggingClassSet=false,$P=$Ps[pane],$R=$Rs[pane];if(!s.isClosed)$R.attr("title",o.resizerTip).css("cursor",o.resizerCursor);$R.draggable({containment:$Container[0],axis:(c[pane].dir=="horz"?"y":"x"),delay:200,distance:1,helper:"clone",opacity:o.resizerDragOpacity,zIndex:c.zIndex.resizing,start:function(e,ui){if(false===execUserCallback(pane,o.onresize_start))return false;s.isResizing=true;clearTimer(pane,"closeSlider");$R.addClass(dragClass+" "+dragPaneClass);draggingClassSet=false;var resizerWidth=(pane=="east"||pane=="south"?o.spacing_open:0);setPaneMinMaxSizes(pane);s.minPosition-=resizerWidth;s.maxPosition-=resizerWidth;edge=(c[pane].dir=="horz"?"top":"left");$(o.maskIframesOnResize===true?"iframe":o.maskIframesOnResize).each(function(){$('
    ').css({background:"#fff",opacity:"0.001",zIndex:9,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css($(this).offset()).appendTo(this.parentNode);});},drag:function(e,ui){if(!draggingClassSet){$(".ui-draggable-dragging").addClass(draggingClass+" "+draggingPaneClass).children().css("visibility","hidden");draggingClassSet=true;if(s.isSliding)$Ps[pane].css("zIndex",c.zIndex.sliding);}if(ui.position[edge]s.maxPosition)ui.position[edge]=s.maxPosition;},stop:function(e,ui){var 50 | dragPos=ui.position,resizerPos,newSize;$R.removeClass(dragClass+" "+dragPaneClass);switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=cDims.outerHeight-dragPos.top-$R.outerHeight();break;case"east":resizerPos=cDims.outerWidth-dragPos.left-$R.outerWidth();break;}newSize=resizerPos-cDims[c[pane].edge];sizePane(pane,newSize);$("div.ui-layout-mask").remove();s.isResizing=false;}});});};var hide=function(pane,onInit){var 51 | o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||s.isHidden)return;if(false===execUserCallback(pane,o.onhide_start))return;s.isSliding=false;if($R)$R.hide();if(onInit||s.isClosed){s.isClosed=true;s.isHidden=true;$P.hide();sizeMidPanes(c[pane].dir=="horz"?"all":"center");execUserCallback(pane,o.onhide_end||o.onhide);}else{s.isHiding=true;close(pane,false);}};var show=function(pane,openPane){var 52 | o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||!s.isHidden)return;if(false===execUserCallback(pane,o.onshow_start))return;s.isSliding=false;s.isShowing=true;if($R&&o.spacing_open>0)$R.show();if(openPane===false)close(pane,true);else 53 | open(pane);};var toggle=function(pane){var s=state[pane];if(s.isHidden)show(pane);else if(s.isClosed)open(pane);else 54 | close(pane);};var close=function(pane,force,noAnimation){var 55 | $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&!s.isClosed&&(o.fxName_close!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_sliding="-sliding",_closed="-closed",isShowing=s.isShowing,isHiding=s.isHiding;delete s.isShowing;delete s.isHiding;if(!$P||(!o.resizable&&!o.closable))return;else if(!force&&s.isClosed&&!isShowing)return;if(c.isLayoutBusy){setFlowCallback("close",pane,force);return;}if(!isShowing&&false===execUserCallback(pane,o.onclose_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;s.isClosed=true;if(isHiding)s.isHidden=true;else if(isShowing)s.isHidden=false;syncPinBtns(pane,false);if(!s.isSliding)sizeMidPanes(c[pane].dir=="horz"?"all":"center");if($R){$R.css(edge,cDims[edge]).removeClass(rClass+_open+" "+rClass+_pane+_open).removeClass(rClass+_sliding+" "+rClass+_pane+_sliding).addClass(rClass+_closed+" "+rClass+_pane+_closed);if(o.resizable)$R.draggable("disable").css("cursor","default").attr("title","");if($T){$T.removeClass(tClass+_open+" "+tClass+_pane+_open).addClass(tClass+_closed+" "+tClass+_pane+_closed).attr("title",o.togglerTip_closed);}sizeHandles();}if(doFX){lockPaneForFX(pane,true);$P.hide(o.fxName_close,o.fxSettings_close,o.fxSpeed_close,function(){lockPaneForFX(pane,false);if(!s.isClosed)return;close_2();});}else{$P.hide();close_2();}function close_2(){bindStartSlidingEvent(pane,true);if(!isShowing)execUserCallback(pane,o.onclose_end||o.onclose);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);if(isHiding)execUserCallback(pane,o.onhide_end||o.onhide);execFlowCallback(pane);}};var open=function(pane,slide,noAnimation){var 56 | $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding",isShowing=s.isShowing;delete s.isShowing;if(!$P||(!o.resizable&&!o.closable))return;else if(!s.isClosed&&!s.isSliding)return;if(s.isHidden&&!isShowing){show(pane,true);return;}if(c.isLayoutBusy){setFlowCallback("open",pane,slide);return;}if(false===execUserCallback(pane,o.onopen_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;if(s.isSliding&&!slide)bindStopSlidingEvents(pane,false);s.isClosed=false;if(isShowing)s.isHidden=false;setPaneMinMaxSizes(pane);if(s.size>s.maxSize)$P.css(c[pane].sizeType,max(1,cssSize(pane,s.maxSize)));bindStartSlidingEvent(pane,false);if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);if(s.isClosed)return;open_2();});}else{$P.show();open_2();}function open_2(){if(!s.isSliding)sizeMidPanes(c[pane].dir=="vert"?"center":"all");if($R){$R.css(edge,cDims[edge]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open).addClass(!s.isSliding?"":rClass+_sliding+" "+rClass+_pane+_sliding);if(o.resizable)$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.resizerTip);else 57 | $R.css("cursor","default");if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.togglerTip_open);}sizeHandles("all");}sizeContent(pane);syncPinBtns(pane,!s.isSliding);execUserCallback(pane,o.onopen_end||o.onopen);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);execFlowCallback(pane);}};var lockPaneForFX=function(pane,doLock){var $P=$Ps[pane];if(doLock){$P.css({zIndex:c.zIndex.animation});if(pane=="south")$P.css({top:cDims.top+cDims.innerHeight-$P.outerHeight()});else if(pane=="east")$P.css({left:cDims.left+cDims.innerWidth-$P.outerWidth()});}else{if(!state[pane].isSliding)$P.css({zIndex:c.zIndex.pane_normal});if(pane=="south")$P.css({top:"auto"});else if(pane=="east")$P.css({left:"auto"});}};var bindStartSlidingEvent=function(pane,enable){var 58 | o=options[pane],$R=$Rs[pane],trigger=o.slideTrigger_open;if(!$R||!o.slidable)return;if(trigger!="click"&&trigger!="dblclick"&&trigger!="mouseover")trigger="click";$R 59 | [enable?"bind":"unbind"](trigger,slideOpen).css("cursor",(enable?o.sliderCursor:"default")).attr("title",(enable?o.sliderTip:""));};var bindStopSlidingEvents=function(pane,enable){var 60 | o=options[pane],s=state[pane],trigger=o.slideTrigger_close,action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];s.isSliding=enable;clearTimer(pane,"closeSlider");$P.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.pane_normal)});$R.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.resizer_normal)});if(trigger!="click"&&trigger!="mouseout")trigger="mouseout";if(enable){$P.bind(trigger,slideClosed);$R.bind(trigger,slideClosed);if(trigger="mouseout"){$P.bind("mouseover",cancelMouseOut);$R.bind("mouseover",cancelMouseOut);}}else{$P.unbind(trigger);$R.unbind(trigger);if(trigger="mouseout"){$P.unbind("mouseover");$R.unbind("mouseover");clearTimer(pane,"closeSlider");}}function cancelMouseOut(evt){clearTimer(pane,"closeSlider");evt.stopPropagation();}};var slideOpen=function(){var pane=$(this).attr("resizer");if(state[pane].isClosed){bindStopSlidingEvents(pane,true);open(pane,true);}};var slideClosed=function(){var 61 | $E=$(this),pane=$E.attr("pane")||$E.attr("resizer"),o=options[pane],s=state[pane];if(s.isClosed||s.isResizing)return;else if(o.slideTrigger_close=="click")close_NOW();else 62 | setTimer(pane,"closeSlider",close_NOW,300);function close_NOW(){bindStopSlidingEvents(pane,false);if(!s.isClosed)close(pane);}};var sizePane=function(pane,size){var 63 | edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];setPaneMinMaxSizes(pane);s.minSize=max(s.minSize,o.minSize);if(o.maxSize>0)s.maxSize=min(s.maxSize,o.maxSize);size=max(size,s.minSize);size=min(size,s.maxSize);s.size=size;$R.css(edge,size+cDims[edge]);$P.css(c[pane].sizeType,max(1,cssSize(pane,size)));if(!s.isSliding)sizeMidPanes(dir=="horz"?"all":"center");sizeHandles();sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);};var sizeMidPanes=function(panes,overrideDims,onInit){if(!panes||panes=="all")panes="east,west,center";var d=getPaneDims();if(overrideDims)$.extend(d,overrideDims);$.each(panes.split(","),function(){if(!$Ps[this])return;var 64 | pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],hasRoom=true,CSS={};if(pane=="center"){d=getPaneDims();CSS=$.extend({},d);CSS.width=max(1,cssW(pane,CSS.width));CSS.height=max(1,cssH(pane,CSS.height));hasRoom=(CSS.width>1&&CSS.height>1);if($.browser.msie&&(!$.boxModel||$.browser.version<7)){if($Ps.north)$Ps.north.css({width:cssW($Ps.north,cDims.innerWidth)});if($Ps.south)$Ps.south.css({width:cssW($Ps.south,cDims.innerWidth)});}}else{CSS.top=d.top;CSS.bottom=d.bottom;CSS.height=max(1,cssH(pane,d.height));hasRoom=(CSS.height>1);}if(hasRoom){$P.css(CSS);if(s.noRoom){s.noRoom=false;if(s.isHidden)return;else show(pane,!s.isClosed);}if(!onInit){sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);}}else if(!s.noRoom){s.noRoom=true;if(s.isHidden)return;if(onInit){$P.hide();if($R)$R.hide();}else hide(pane);}});};var sizeContent=function(panes){if(!panes||panes=="all")panes=c.allPanes;$.each(panes.split(","),function(){if(!$Cs[this])return;var 65 | pane=str(this),ignore=options[pane].contentIgnoreSelector,$P=$Ps[pane],$C=$Cs[pane],e_C=$C[0],height=cssH($P);;$P.children().each(function(){if(this==e_C)return;var $E=$(this);if(!ignore||!$E.is(ignore))height-=$E.outerHeight();});if(height>0)height=cssH($C,height);if(height<1)$C.hide();else 66 | $C.css({height:height}).show();});};var sizeHandles=function(panes,onInit){if(!panes||panes=="all")panes=c.borderPanes;$.each(panes.split(","),function(){var 67 | pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane];if(!$P||!$R||(!o.resizable&&!o.closable))return;var 68 | dir=c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,offset,CSS={};if(spacing==0){$R.hide();return;}else if(!s.noRoom&&!s.isHidden)$R.show();if(dir=="horz"){paneLen=$P.outerWidth();$R.css({width:max(1,cssW($R,paneLen)),height:max(1,cssH($R,spacing)),left:cssNum($P,"left")});}else{paneLen=$P.outerHeight();$R.css({height:max(1,cssH($R,paneLen)),width:max(1,cssW($R,spacing)),top:cDims.top+getPaneSize("north",true)});}if($T){if(togLen==0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return;}else 69 | $T.show();if(!(togLen>0)||togLen=="100%"||togLen>paneLen){togLen=paneLen;offset=0;}else{if(typeof togAlign=="string"){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=Math.floor((paneLen-togLen)/2);}}else{var x=parseInt(togAlign);if(togAlign>=0)offset=x;else offset=paneLen-togLen+x;}}var 70 | $TC_o=(o.togglerContent_open?$T.children(".content-open"):false),$TC_c=(o.togglerContent_closed?$T.children(".content-closed"):false),$TC=(s.isClosed?$TC_c:$TC_o);if($TC_o)$TC_o.css("display",s.isClosed?"none":"block");if($TC_c)$TC_c.css("display",s.isClosed?"block":"none");if(dir=="horz"){var width=cssW($T,togLen);$T.css({width:max(0,width),height:max(1,cssH($T,spacing)),left:offset});if($TC)$TC.css("marginLeft",Math.floor((width-$TC.outerWidth())/2));}else{var height=cssH($T,togLen);$T.css({height:max(0,height),width:max(1,cssW($T,spacing)),top:offset});if($TC)$TC.css("marginTop",Math.floor((height-$TC.outerHeight())/2));}}if(onInit&&o.initHidden){$R.hide();if($T)$T.hide();}});};var resizeAll=function(){var 71 | oldW=cDims.innerWidth,oldH=cDims.innerHeight;cDims=state.container=getElemDims($Container);var 72 | checkH=(cDims.innerHeights.maxSize)sizePane(pane,s.maxSize);}});sizeMidPanes("all");sizeHandles("all");};function keyDown(evt){if(!evt)return true;var code=evt.keyCode;if(code<33)return true;var 73 | PANE={38:"north",40:"south",37:"west",39:"east"},isCursorKey=(code>=37&&code<=40),ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,pane=false,s,o,k,m,el;if(!CTRL&&!SHIFT)return true;else if(isCursorKey&&options[PANE[code]].enableCursorHotkey)pane=PANE[code];else 74 | $.each(c.borderPanes.split(","),function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false;}}});if(!pane)return true;o=options[pane];s=state[pane];if(!o.enableCursorHotkey||s.isHidden||!$Ps[pane])return true;el=evt.target||evt.srcElement;if(el&&SHIFT&&isCursorKey&&(el.tagName=="TEXTAREA"||(el.tagName=="INPUT"&&(code==37||code==39))))return true;toggle(pane);evt.stopPropagation();evt.returnValue=false;return false;};function allowOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).attr("pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var 75 | pane=$P.attr("pane"),s=state[pane];if(s.cssSaved)resetOverflow(pane);if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return;}var 76 | newCSS={zIndex:(c.zIndex.pane_normal+1)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible";}if(ofX&&ofX!="visible"&&ofX!="auto"){curCSS.overflowX=ofX;newCSS.overflowX="visible";}if(ofY&&ofY!="visible"&&ofY!="auto"){curCSS.overflowY=ofX;newCSS.overflowY="visible";}s.cssSaved=curCSS;$P.css(newCSS);$.each(c.allPanes.split(","),function(i,p){if(p!=pane)resetOverflow(p);});};function resetOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).hasClass("ui-layout-pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var 77 | pane=$P.attr("pane"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing)$P.css("zIndex",c.zIndex.pane_normal);$P.css(CSS);s.cssSaved=false;};function getBtn(selector,pane,action){var 78 | $E=$(selector),err="Error Adding Button \n\nInvalid ";if(!$E.length)alert(err+"selector: "+selector);else if(c.borderPanes.indexOf(pane)==-1)alert(err+"pane: "+pane);else{var btn=options[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane);return $E;}return false;};function addToggleBtn(selector,pane){var $E=getBtn(selector,pane,"toggle");if($E)$E.attr("title",state[pane].isClosed?"Open":"Close").click(function(evt){toggle(pane);evt.stopPropagation();});};function addOpenBtn(selector,pane){var $E=getBtn(selector,pane,"open");if($E)$E.attr("title","Open").click(function(evt){open(pane);evt.stopPropagation();});};function addCloseBtn(selector,pane){var $E=getBtn(selector,pane,"close");if($E)$E.attr("title","Close").click(function(evt){close(pane);evt.stopPropagation();});};function addPinBtn(selector,pane){var $E=getBtn(selector,pane,"pin");if($E){var s=state[pane];$E.click(function(evt){setPinState($(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed)open(pane);else close(pane);evt.stopPropagation();});setPinState($E,pane,(!s.isClosed&&!s.isSliding));c[pane].pins.push(selector);}};function syncPinBtns(pane,doPin){$.each(c[pane].pins,function(i,selector){setPinState($(selector),pane,doPin);});};function setPinState($Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin==(updown=="down"))return;var 79 | root=options[pane].buttonClass,class1=root+"-pin",class2=class1+"-"+pane,UP1=class1+"-up",UP2=class2+"-up",DN1=class1+"-down",DN2=class2+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?"Un-Pin":"Pin").removeClass(doPin?UP1:DN1).removeClass(doPin?UP2:DN2).addClass(doPin?DN1:UP1).addClass(doPin?DN2:UP2);};var 80 | $Container=$(this).css({overflow:"hidden"}),$Ps={},$Cs={},$Rs={},$Ts={},c=config,cDims=state.container;create();return{options:options,state:state,panes:$Ps,toggle:toggle,open:open,close:close,hide:hide,show:show,resizeContent:sizeContent,sizePane:sizePane,resizeAll:resizeAll,addToggleBtn:addToggleBtn,addOpenBtn:addOpenBtn,addCloseBtn:addCloseBtn,addPinBtn:addPinBtn,allowOverflow:allowOverflow,resetOverflow:resetOverflow,cssWidth:cssW,cssHeight:cssH};}})(jQuery); --------------------------------------------------------------------------------