From 1a4267444e34ad5e8a90864e396d851f083571b0 Mon Sep 17 00:00:00 2001 From: Sebastian Silva Date: Wed, 12 Oct 2011 01:03:11 +0000 Subject: Tidy up and make Gecko default. --- diff --git a/activity.py b/activity.py index 1c07f73..bd2aed3 100644 --- a/activity.py +++ b/activity.py @@ -34,7 +34,7 @@ USE_GECKO=True if not USE_GECKO: try: import webkit - from inspector import Inspector + from websdk.inspector import Inspector except ImportError: try: import websdk.webkit_local as webkit @@ -45,11 +45,7 @@ if not USE_GECKO: if USE_GECKO: import hulahop hulahop.startup(os.path.join(activity.get_activity_root(), 'data/gecko')) - from browser import Browser - -def sleep (t): - gobject.timeout_add (int (t*1000), gtk.main_quit) - gtk.main () + from websdk.browser import Browser def yieldsleep(func): def start(*args, **kwds): @@ -134,6 +130,17 @@ class HelloWorldActivity(activity.Activity): toolbar_box.toolbar.insert(separator, -1) separator.show() + #play_image = gtk.image_new_from_stock(gtk.STOCK_MEDIA_PLAY, + # gtk.ICON_SIZE_BUTTON) + #play_image.show() + + start_button = ToolButton('go-home') + #start_button.set_icon_widget(play_image) + start_button.show() + start_button.connect('clicked', self.__start_button_cb) + + toolbar_box.toolbar.insert(start_button, -1) + debug_button = ToolButton("activity-debug") toolbar_box.toolbar.insert(debug_button, -1) debug_button.connect('clicked', self.__debug_button_cb) @@ -159,7 +166,7 @@ class HelloWorldActivity(activity.Activity): else: self.web_view = Browser() - self.open("file:///%s/websdk/static/init.html" % self.bundle_dir) + self.open("file:///%s/studio/static/init.html" % self.bundle_dir) self.set_canvas(self.web_view) self.web_view.show() self.waitforport() @@ -171,17 +178,18 @@ class HelloWorldActivity(activity.Activity): if len(self._shared_activity.get_joined_buddies())==1: print "We are alone" + def __start_button_cb(self, widget): + self.open("http://localhost:%s/" % self.port) + return True + def __debug_button_cb(self, widget): - #self.inspector.emit('inspect-web-view') - #self.inspector.show() - self.open("file:///home/icarito/Descargas/CHUAS") + self.open("http://localhost:%s/debug" % self.port) return True @yieldsleep def waitforport(self): while 1: if isOpen("127.0.0.1", self.port): - print "port is open" if self._shared_activity: # we are shared self.open("http://localhost:%s/" % self.port) else: @@ -201,7 +209,7 @@ class HelloWorldActivity(activity.Activity): return True def start_server(self): - self.serverprocess = subprocess.Popen(("python", "websdk/studio.py", str(self.port))) + self.serverprocess = subprocess.Popen(("python", "studio/studio.py", str(self.port))) if self._shared_activity: self.share_server() diff --git a/bin/websdk-launcher b/bin/websdk-launcher index a4a6201..a881a98 100755 --- a/bin/websdk-launcher +++ b/bin/websdk-launcher @@ -1,4 +1,3 @@ #!/bin/sh export PYTHONPATH=$SUGAR_BUNDLE_PATH/websdk:$PYTHONPATH -echo $PYTHONPATH exec sugar-activity activity.HelloWorldActivity "$@" diff --git a/browser.py b/browser.py deleted file mode 100644 index e6ad639..0000000 --- a/browser.py +++ /dev/null @@ -1,59 +0,0 @@ -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import os -import time -import logging -from gettext import gettext as _ - -import gobject -import gtk -import hulahop -import xpcom -from xpcom.nsError import * -from xpcom import components -from xpcom.components import interfaces -from hulahop.webview import WebView - -from sugar.datastore import datastore -from sugar import profile -from sugar import env -from sugar.activity import activity -from sugar.graphics import style - -_ZOOM_AMOUNT = 0.1 - -class Browser(WebView): - def __init__(self): - WebView.__init__(self) - - def do_setup(self): - WebView.do_setup(self) - - def zoom_in(self): - contentViewer = self.doc_shell.queryInterface( \ - interfaces.nsIDocShell).contentViewer - if contentViewer is not None: - markupDocumentViewer = contentViewer.queryInterface( \ - interfaces.nsIMarkupDocumentViewer) - markupDocumentViewer.fullZoom += _ZOOM_AMOUNT - - def zoom_out(self): - contentViewer = self.doc_shell.queryInterface( \ - interfaces.nsIDocShell).contentViewer - if contentViewer is not None: - markupDocumentViewer = contentViewer.queryInterface( \ - interfaces.nsIMarkupDocumentViewer) - markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT - diff --git a/inspector.py b/inspector.py deleted file mode 100644 index df3db38..0000000 --- a/inspector.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2008 Jan Alonzo -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import gtk -import webkit - -class Inspector (gtk.Window): - def __init__ (self, inspector): - """initialize the WebInspector class""" - gtk.Window.__init__(self) - self.set_default_size(600, 480) - - self._web_inspector = inspector - - self._web_inspector.connect("inspect-web-view", - self._inspect_web_view_cb) - self._web_inspector.connect("show-window", - self._show_window_cb) - self._web_inspector.connect("attach-window", - self._attach_window_cb) - self._web_inspector.connect("detach-window", - self._detach_window_cb) - self._web_inspector.connect("close-window", - self._close_window_cb) - self._web_inspector.connect("finished", - self._finished_cb) - - self.connect("delete-event", self._close_window_cb) - - def _inspect_web_view_cb (self, inspector, web_view): - """Called when the 'inspect' menu item is activated""" - scrolled_window = gtk.ScrolledWindow() - scrolled_window.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC - scrolled_window.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC - webview = webkit.WebView() - scrolled_window.add(webview) - scrolled_window.show_all() - - self.add(scrolled_window) - return webview - - def _show_window_cb (self, inspector): - """Called when the inspector window should be displayed""" - self.present() - return True - - def _attach_window_cb (self, inspector): - """Called when the inspector should displayed in the same - window as the WebView being inspected - """ - return False - - def _detach_window_cb (self, inspector): - """Called when the inspector should appear in a separate window""" - return False - - def _close_window_cb (self, inspector, view): - """Called when the inspector window should be closed""" - self.hide() - return True - - def _finished_cb (self, inspector): - """Called when inspection is done""" - self._web_inspector = 0 - self.destroy() - return False diff --git a/serve.py b/serve.py deleted file mode 100644 index 4528876..0000000 --- a/serve.py +++ /dev/null @@ -1,10 +0,0 @@ -#import webbrowser -import sys -port=5000 -try: - port=int(sys.argv[1]) -except: - pass -from websdk.studio import app -#webbrowser.open('localhost:5000') -app.run(port=port) diff --git a/websdk/static/css/main.css b/websdk/static/css/main.css deleted file mode 100644 index f7cbf25..0000000 --- a/websdk/static/css/main.css +++ /dev/null @@ -1,118 +0,0 @@ -body { - background-color: #c0c0c0; - height: 99%; - margin: 0; - font-size: 88%; - font-family: DejaVu Sans; -} - -p.subtitle { - font-size: 10pt; - margin-top: 5px; -} - -li { - margin-bottom: 1em -} - -hr { - border: 0; - color: #9E9E9E; - background-color: #9E9E9E; - height: 1px; - width: 100%; - text-align: left; -} - -#content { - margin: 40px; -} - -input.btn { - color: white; - /* background-color: #808080; */ -} - -#beta { - font-size: 12pt; - color: red; - display: none; -} - -#editor { - margin: 0; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 85%; - margin-left: 15%; -} - -#editor .wymeditor { -} - -#editor-sidebar { - width: 15%; - padding: 5px; -} - -.bling { - display: none; -} - -div#filer { - display: none; -} - -#filer ul{ - list-style: none; - width: 100%; - padding: 0; - margin-left: 10px; -} - -#filer ul li { - text-align: center; - vertical-align: top; -} - - -#filer ul li a:hover{ - color: white; - background-color: #808080; -} - -#filer ul li a{ - color: black; - text-decoration: none; - font-size: 8pt; - width: 50px; - height: 70px; - float:left; - padding:20px; - padding-top:5px; -} - -#filer ul li a span { - height: 56px; - display: none; -} -#filer ul li a img { - height: 56px; -} - -#filer-header { - background-color: #808080; - color: white; - margin: 0; - padding: 0; - padding-top: 7px; - padding-bottom: 7px; - width: 100%; -} - -#filer-header span{ - padding-left: 10px; -} diff --git a/websdk/static/css/sugar-theme/images/ui-bg_flat_100_c0c0c0_40x100.png b/websdk/static/css/sugar-theme/images/ui-bg_flat_100_c0c0c0_40x100.png deleted file mode 100644 index 299f267..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_flat_100_c0c0c0_40x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_flat_50_aaaaaa_40x100.png b/websdk/static/css/sugar-theme/images/ui-bg_flat_50_aaaaaa_40x100.png deleted file mode 100644 index 5b5dab2..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_flat_50_aaaaaa_40x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_flat_65_ffffff_40x100.png b/websdk/static/css/sugar-theme/images/ui-bg_flat_65_ffffff_40x100.png deleted file mode 100644 index ac8b229..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_flat_65_ffffff_40x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_flat_75_282828_40x100.png b/websdk/static/css/sugar-theme/images/ui-bg_flat_75_282828_40x100.png deleted file mode 100644 index 89c6362..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_flat_75_282828_40x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_flat_75_808080_40x100.png b/websdk/static/css/sugar-theme/images/ui-bg_flat_75_808080_40x100.png deleted file mode 100644 index 6864463..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_flat_75_808080_40x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_glow-ball_20_282828_600x600.png b/websdk/static/css/sugar-theme/images/ui-bg_glow-ball_20_282828_600x600.png deleted file mode 100644 index d05eb5b..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_glow-ball_20_282828_600x600.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_5_282828_1x100.png b/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_5_282828_1x100.png deleted file mode 100644 index 68a36c5..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_5_282828_1x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_95_c0c0c0_1x100.png b/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_95_c0c0c0_1x100.png deleted file mode 100644 index 81722a4..0000000 --- a/websdk/static/css/sugar-theme/images/ui-bg_highlight-hard_95_c0c0c0_1x100.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-icons_000000_256x240.png b/websdk/static/css/sugar-theme/images/ui-icons_000000_256x240.png deleted file mode 100644 index 7c211aa..0000000 --- a/websdk/static/css/sugar-theme/images/ui-icons_000000_256x240.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-icons_2e83ff_256x240.png b/websdk/static/css/sugar-theme/images/ui-icons_2e83ff_256x240.png deleted file mode 100644 index 09d1cdc..0000000 --- a/websdk/static/css/sugar-theme/images/ui-icons_2e83ff_256x240.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-icons_cd0a0a_256x240.png b/websdk/static/css/sugar-theme/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 2ab019b..0000000 --- a/websdk/static/css/sugar-theme/images/ui-icons_cd0a0a_256x240.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/images/ui-icons_ffffff_256x240.png b/websdk/static/css/sugar-theme/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index 42f8f99..0000000 --- a/websdk/static/css/sugar-theme/images/ui-icons_ffffff_256x240.png +++ /dev/null Binary files differ diff --git a/websdk/static/css/sugar-theme/jquery-ui-1.8.15.custom.css b/websdk/static/css/sugar-theme/jquery-ui-1.8.15.custom.css deleted file mode 100644 index 2409c32..0000000 --- a/websdk/static/css/sugar-theme/jquery-ui-1.8.15.custom.css +++ /dev/null @@ -1,568 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* - * jQuery UI CSS Framework 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=DejaVu%20Sans&fwDefault=normal&fsDefault=1.1em&cornerRadius=10px&bgColorHeader=282828&bgTextureHeader=01_flat.png&bgImgOpacityHeader=75&borderColorHeader=282828&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=c0c0c0&bgTextureContent=01_flat.png&bgImgOpacityContent=100&borderColorContent=c0c0c0&fcContent=000000&iconColorContent=000000&bgColorDefault=808080&bgTextureDefault=01_flat.png&bgImgOpacityDefault=75&borderColorDefault=808080&fcDefault=ffffff&iconColorDefault=ffffff&bgColorHover=808080&bgTextureHover=01_flat.png&bgImgOpacityHover=75&borderColorHover=808080&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=ffffff&bgTextureActive=01_flat.png&bgImgOpacityActive=65&borderColorActive=c0c0c0&fcActive=000000&iconColorActive=000000&bgColorHighlight=282828&bgTextureHighlight=04_highlight_hard.png&bgImgOpacityHighlight=5&borderColorHighlight=000&fcHighlight=fff&iconColorHighlight=2e83ff&bgColorError=c0c0c0&bgTextureError=04_highlight_hard.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=282828&bgTextureOverlay=21_glow_ball.png&bgImgOpacityOverlay=20&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=50&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: DejaVu Sans; font-size: .9em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: DejaVu Sans; font-size: 1em; } -.ui-widget-content { border: 1px solid #c0c0c0; background: #c0c0c0 url(images/ui-bg_flat_100_c0c0c0_40x100.png) 50% 50% repeat-x; color: #000000; } -.ui-widget-content a { color: #000000; } -.ui-widget-header { border: 1px solid #282828; background: #282828 url(images/ui-bg_flat_75_282828_40x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #808080; background: #808080 url(images/ui-bg_flat_75_808080_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; } -.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 #808080; background: #808080 url(images/ui-bg_flat_75_808080_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } -.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #c0c0c0; background: #ffffff url(images/ui-bg_flat_65_ffffff_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #000000; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #000; background: #282828 url(images/ui-bg_highlight-hard_5_282828_1x100.png) 50% top repeat-x; color: #fff; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #fff; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #c0c0c0 url(images/ui-bg_highlight-hard_95_c0c0c0_1x100.png) 50% top repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_000000_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_000000_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_000000_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 12px; -webkit-border-top-left-radius: 12px; -khtml-border-top-left-radius: 12px; border-top-left-radius: 12px; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 12px; -webkit-border-top-right-radius: 12px; -khtml-border-top-right-radius: 12px; border-top-right-radius: 12px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 12px; -webkit-border-bottom-left-radius: 12px; -khtml-border-bottom-left-radius: 12px; border-bottom-left-radius: 12px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 12px; -webkit-border-bottom-right-radius: 12px; -khtml-border-bottom-right-radius: 12px; border-bottom-right-radius: 12px; } - -/* Overlays */ -.ui-widget-overlay { background: #282828 url(images/ui-bg_glow-ball_20_282828_600x600.png) 50% 35% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_50_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* - * jQuery UI Resizable 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizable#theming - */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* - * jQuery UI Selectable 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectable#theming - */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } -/* - * jQuery UI Accordion 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Accordion#theming - */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } -/* - * jQuery UI Autocomplete 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.15 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* - * jQuery UI Button 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Button#theming - */ -.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 */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; margin-bottom: .6em; } - -/*button icon element(s) */ -.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; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.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; } -.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; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ -/* - * jQuery UI Dialog 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog#theming - */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* - * jQuery UI Slider 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* - * jQuery UI Tabs 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs#theming - */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* - * jQuery UI Datepicker 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker#theming - */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* - * jQuery UI Progressbar 1.8.15 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar#theming - */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } diff --git a/websdk/static/icons b/websdk/static/icons deleted file mode 120000 index 9a5906b..0000000 --- a/websdk/static/icons +++ /dev/null @@ -1 +0,0 @@ -../../icons/ \ No newline at end of file diff --git a/websdk/static/images/throbber-120.gif b/websdk/static/images/throbber-120.gif deleted file mode 100644 index a7d0fc8..0000000 --- a/websdk/static/images/throbber-120.gif +++ /dev/null Binary files differ diff --git a/websdk/static/init.html b/websdk/static/init.html deleted file mode 100644 index 6515534..0000000 --- a/websdk/static/init.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/websdk/static/js/ace/ace-uncompressed.js b/websdk/static/js/ace/ace-uncompressed.js deleted file mode 100644 index 389daf2..0000000 --- a/websdk/static/js/ace/ace-uncompressed.js +++ /dev/null @@ -1,15284 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/** - * Define a module along with a payload - * @param module a name for the payload - * @param payload a function to call with (require, exports, module) params - */ - -(function() { - -var global = (function() { - return this; -})(); - -// if we find an existing require function use it. -if (global.require && global.define) { - require.packaged = true; - return; -} - -var _define = function(module, deps, payload) { - if (typeof module !== 'string') { - if (_define.original) - _define.original.apply(window, arguments); - else { - console.error('dropping module because define wasn\'t a string.'); - console.trace(); - } - return; - } - - if (arguments.length == 2) - payload = deps; - - if (!define.modules) - define.modules = {}; - - define.modules[module] = payload; -}; -if (global.define) - _define.original = global.define; - -global.define = _define; - - -/** - * Get at functionality define()ed using the function above - */ -var _require = function(module, callback) { - if (Object.prototype.toString.call(module) === "[object Array]") { - var params = []; - for (var i = 0, l = module.length; i < l; ++i) { - var dep = lookup(module[i]); - if (!dep && _require.original) - return _require.original.apply(window, arguments); - params.push(dep); - } - if (callback) { - callback.apply(null, params); - } - } - else if (typeof module === 'string') { - var payload = lookup(module); - if (!payload && _require.original) - return _require.original.apply(window, arguments); - - if (callback) { - callback(); - } - - return payload; - } - else { - if (_require.original) - return _require.original.apply(window, arguments); - } -}; - -if (global.require) - _require.original = global.require; - -global.require = _require; -require.packaged = true; - -/** - * Internal function to lookup moduleNames and resolve them by calling the - * definition function if needed. - */ -var lookup = function(moduleName) { - var module = define.modules[moduleName]; - if (module == null) { - console.error('Missing module: ' + moduleName); - return null; - } - - if (typeof module === 'function') { - var exports = {}; - module(require, exports, { id: moduleName, uri: '' }); - // cache the resulting module object for next time - define.modules[moduleName] = exports; - return exports; - } - - return module; -}; - -})();// vim:set ts=4 sts=4 sw=4 st: -// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License -// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project) -// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified -// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License -// -- Irakli Gozalishvili Copyright (C) 2010 MIT License - -/*! - Copyright (c) 2009, 280 North Inc. http://280north.com/ - MIT License. http://github.com/280north/narwhal/blob/master/README.md -*/ - -define('pilot/fixoldbrowsers', ['require', 'exports', 'module' ], function(require, exports, module) { - -/** - * Brings an environment as close to ECMAScript 5 compliance - * as is possible with the facilities of erstwhile engines. - * - * ES5 Draft - * http://www.ecma-international.org/publications/files/drafts/tc39-2009-050.pdf - * - * NOTE: this is a draft, and as such, the URL is subject to change. If the - * link is broken, check in the parent directory for the latest TC39 PDF. - * http://www.ecma-international.org/publications/files/drafts/ - * - * Previous ES5 Draft - * http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf - * This is a broken link to the previous draft of ES5 on which most of the - * numbered specification references and quotes herein were taken. Updating - * these references and quotes to reflect the new document would be a welcome - * volunteer project. - * - * @module - */ - -/*whatsupdoc*/ - -// -// Function -// ======== -// - -// ES-5 15.3.4.5 -// http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf - -if (!Function.prototype.bind) { - var slice = Array.prototype.slice; - Function.prototype.bind = function bind(that) { // .length is 1 - // 1. Let Target be the this value. - var target = this; - // 2. If IsCallable(Target) is false, throw a TypeError exception. - // XXX this gets pretty close, for all intents and purposes, letting - // some duck-types slide - if (typeof target.apply !== "function" || typeof target.call !== "function") - return new TypeError(); - // 3. Let A be a new (possibly empty) internal list of all of the - // argument values provided after thisArg (arg1, arg2 etc), in order. - var args = slice.call(arguments); - // 4. Let F be a new native ECMAScript object. - // 9. Set the [[Prototype]] internal property of F to the standard - // built-in Function prototype object as specified in 15.3.3.1. - // 10. Set the [[Call]] internal property of F as described in - // 15.3.4.5.1. - // 11. Set the [[Construct]] internal property of F as described in - // 15.3.4.5.2. - // 12. Set the [[HasInstance]] internal property of F as described in - // 15.3.4.5.3. - // 13. The [[Scope]] internal property of F is unused and need not - // exist. - var bound = function bound() { - - if (this instanceof bound) { - // 15.3.4.5.2 [[Construct]] - // When the [[Construct]] internal method of a function object, - // F that was created using the bind function is called with a - // list of arguments ExtraArgs the following steps are taken: - // 1. Let target be the value of F's [[TargetFunction]] - // internal property. - // 2. If target has no [[Construct]] internal method, a - // TypeError exception is thrown. - // 3. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 4. Let args be a new list containing the same values as the - // list boundArgs in the same order followed by the same - // values as the list ExtraArgs in the same order. - - var self = Object.create(target.prototype); - target.apply(self, args.concat(slice.call(arguments))); - return self; - - } else { - // 15.3.4.5.1 [[Call]] - // When the [[Call]] internal method of a function object, F, - // which was created using the bind function is called with a - // this value and a list of arguments ExtraArgs the following - // steps are taken: - // 1. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 2. Let boundThis be the value of F's [[BoundThis]] internal - // property. - // 3. Let target be the value of F's [[TargetFunction]] internal - // property. - // 4. Let args be a new list containing the same values as the list - // boundArgs in the same order followed by the same values as - // the list ExtraArgs in the same order. 5. Return the - // result of calling the [[Call]] internal method of target - // providing boundThis as the this value and providing args - // as the arguments. - - // equiv: target.call(this, ...boundArgs, ...args) - return target.call.apply( - target, - args.concat(slice.call(arguments)) - ); - - } - - }; - bound.length = ( - // 14. If the [[Class]] internal property of Target is "Function", then - typeof target === "function" ? - // a. Let L be the length property of Target minus the length of A. - // b. Set the length own property of F to either 0 or L, whichever is larger. - Math.max(target.length - args.length, 0) : - // 15. Else set the length own property of F to 0. - 0 - ) - // 16. The length own property of F is given attributes as specified in - // 15.3.5.1. - // TODO - // 17. Set the [[Extensible]] internal property of F to true. - // TODO - // 18. Call the [[DefineOwnProperty]] internal method of F with - // arguments "caller", PropertyDescriptor {[[Value]]: null, - // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: - // false}, and false. - // TODO - // 19. Call the [[DefineOwnProperty]] internal method of F with - // arguments "arguments", PropertyDescriptor {[[Value]]: null, - // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: - // false}, and false. - // TODO - // NOTE Function objects created using Function.prototype.bind do not - // have a prototype property. - // XXX can't delete it in pure-js. - return bound; - }; -} - -// Shortcut to an often accessed properties, in order to avoid multiple -// dereference that costs universally. -// _Please note: Shortcuts are defined after `Function.prototype.bind` as we -// us it in defining shortcuts. -var call = Function.prototype.call; -var prototypeOfArray = Array.prototype; -var prototypeOfObject = Object.prototype; -var owns = call.bind(prototypeOfObject.hasOwnProperty); - -var defineGetter, defineSetter, lookupGetter, lookupSetter, supportsAccessors; -// If JS engine supports accessors creating shortcuts. -if ((supportsAccessors = owns(prototypeOfObject, '__defineGetter__'))) { - defineGetter = call.bind(prototypeOfObject.__defineGetter__); - defineSetter = call.bind(prototypeOfObject.__defineSetter__); - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); -} - - -// -// Array -// ===== -// - -// ES5 15.4.3.2 -if (!Array.isArray) { - Array.isArray = function isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; -} - -// ES5 15.4.4.18 -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(block, thisObject) { - var len = +this.length; - for (var i = 0; i < len; i++) { - if (i in this) { - block.call(thisObject, this[i], i, this); - } - } - }; -} - -// ES5 15.4.4.19 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map -if (!Array.prototype.map) { - Array.prototype.map = function map(fun /*, thisp*/) { - var len = +this.length; - if (typeof fun !== "function") - throw new TypeError(); - - var res = new Array(len); - var thisp = arguments[1]; - for (var i = 0; i < len; i++) { - if (i in this) - res[i] = fun.call(thisp, this[i], i, this); - } - - return res; - }; -} - -// ES5 15.4.4.20 -if (!Array.prototype.filter) { - Array.prototype.filter = function filter(block /*, thisp */) { - var values = []; - var thisp = arguments[1]; - for (var i = 0; i < this.length; i++) - if (block.call(thisp, this[i])) - values.push(this[i]); - return values; - }; -} - -// ES5 15.4.4.16 -if (!Array.prototype.every) { - Array.prototype.every = function every(block /*, thisp */) { - var thisp = arguments[1]; - for (var i = 0; i < this.length; i++) - if (!block.call(thisp, this[i])) - return false; - return true; - }; -} - -// ES5 15.4.4.17 -if (!Array.prototype.some) { - Array.prototype.some = function some(block /*, thisp */) { - var thisp = arguments[1]; - for (var i = 0; i < this.length; i++) - if (block.call(thisp, this[i])) - return true; - return false; - }; -} - -// ES5 15.4.4.21 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(fun /*, initial*/) { - var len = +this.length; - if (typeof fun !== "function") - throw new TypeError(); - - // no value to return if no initial value and an empty array - if (len === 0 && arguments.length === 1) - throw new TypeError(); - - var i = 0; - if (arguments.length >= 2) { - var rv = arguments[1]; - } else { - do { - if (i in this) { - rv = this[i++]; - break; - } - - // if array contains no values, no initial value to return - if (++i >= len) - throw new TypeError(); - } while (true); - } - - for (; i < len; i++) { - if (i in this) - rv = fun.call(null, rv, this[i], i, this); - } - - return rv; - }; -} - -// ES5 15.4.4.22 -// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight -if (!Array.prototype.reduceRight) { - Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { - var len = +this.length; - if (typeof fun !== "function") - throw new TypeError(); - - // no value to return if no initial value, empty array - if (len === 0 && arguments.length === 1) - throw new TypeError(); - - var i = len - 1; - if (arguments.length >= 2) { - var rv = arguments[1]; - } else { - do { - if (i in this) { - rv = this[i--]; - break; - } - - // if array contains no values, no initial value to return - if (--i < 0) - throw new TypeError(); - } while (true); - } - - for (; i >= 0; i--) { - if (i in this) - rv = fun.call(null, rv, this[i], i, this); - } - - return rv; - }; -} - -// ES5 15.4.4.14 -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function indexOf(value /*, fromIndex */ ) { - var length = this.length; - if (!length) - return -1; - var i = arguments[1] || 0; - if (i >= length) - return -1; - if (i < 0) - i += length; - for (; i < length; i++) { - if (!owns(this, i)) - continue; - if (value === this[i]) - return i; - } - return -1; - }; -} - -// ES5 15.4.4.15 -if (!Array.prototype.lastIndexOf) { - Array.prototype.lastIndexOf = function lastIndexOf(value /*, fromIndex */) { - var length = this.length; - if (!length) - return -1; - var i = arguments[1] || length; - if (i < 0) - i += length; - i = Math.min(i, length - 1); - for (; i >= 0; i--) { - if (!owns(this, i)) - continue; - if (value === this[i]) - return i; - } - return -1; - }; -} - -// -// Object -// ====== -// - -// ES5 15.2.3.2 -if (!Object.getPrototypeOf) { - // https://github.com/kriskowal/es5-shim/issues#issue/2 - // http://ejohn.org/blog/objectgetprototypeof/ - // recommended by fschaefer on github - Object.getPrototypeOf = function getPrototypeOf(object) { - return object.__proto__ || object.constructor.prototype; - // or undefined if not available in this engine - }; -} - -// ES5 15.2.3.3 -if (!Object.getOwnPropertyDescriptor) { - var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + - "non-object: "; - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if ((typeof object !== "object" && typeof object !== "function") || object === null) - throw new TypeError(ERR_NON_OBJECT + object); - // If object does not owns property return undefined immediately. - if (!owns(object, property)) - return undefined; - - var despriptor, getter, setter; - - // If object has a property then it's for sure both `enumerable` and - // `configurable`. - despriptor = { enumerable: true, configurable: true }; - - // If JS engine supports accessor properties then property may be a - // getter or setter. - if (supportsAccessors) { - // Unfortunately `__lookupGetter__` will return a getter even - // if object has own non getter property along with a same named - // inherited getter. To avoid misbehavior we temporary remove - // `__proto__` so that `__lookupGetter__` will return getter only - // if it's owned by an object. - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - - // Once we have getter and setter we can put values back. - object.__proto__ = prototype; - - if (getter || setter) { - if (getter) descriptor.get = getter; - if (setter) descriptor.set = setter; - - // If it was accessor property we're done and return here - // in order to avoid adding `value` to the descriptor. - return descriptor; - } - } - - // If we got this far we know that object has an own property that is - // not an accessor so we set it as a value and return descriptor. - descriptor.value = object[property]; - return descriptor; - }; -} - -// ES5 15.2.3.4 -if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; -} - -// ES5 15.2.3.5 -if (!Object.create) { - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = { "__proto__": null }; - } else { - if (typeof prototype !== "object") - throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - // IE has no built-in implementation of `Object.getPrototypeOf` - // neither `__proto__`, but this manually setting `__proto__` will - // guarantee that `Object.getPrototypeOf` will work as expected with - // objects created using `Object.create` - object.__proto__ = prototype; - } - if (typeof properties !== "undefined") - Object.defineProperties(object, properties); - return object; - }; -} - -// ES5 15.2.3.6 -if (!Object.defineProperty) { - var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; - var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " - var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + - "on this javascript engine"; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if (typeof object !== "object" && typeof object !== "function") - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - if (typeof object !== "object" || object === null) - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - - // If it's a data property. - if (owns(descriptor, "value")) { - // fail silently if "writable", "enumerable", or "configurable" - // are requested but not supported - /* - // alternate approach: - if ( // can't implement these features; allow false but not true - !(owns(descriptor, "writable") ? descriptor.writable : true) || - !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) || - !(owns(descriptor, "configurable") ? descriptor.configurable : true) - ) - throw new RangeError( - "This implementation of Object.defineProperty does not " + - "support configurable, enumerable, or writable." - ); - */ - - if (supportsAccessors && (lookupGetter(object, property) || - lookupSetter(object, property))) - { - // As accessors are supported only on engines implementing - // `__proto__` we can safely override `__proto__` while defining - // a property to make sure that we don't hit an inherited - // accessor. - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - // Deleting a property anyway since getter / setter may be - // defined on object itself. - delete object[property]; - object[property] = descriptor.value; - // Setting original `__proto__` back now. - object.prototype; - } else { - object[property] = descriptor.value; - } - } else { - if (!supportsAccessors) - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - // If we got that far then getters and setters can be defined !! - if (owns(descriptor, "get")) - defineGetter(object, property, descriptor.get); - if (owns(descriptor, "set")) - defineSetter(object, property, descriptor.set); - } - - return object; - }; -} - -// ES5 15.2.3.7 -if (!Object.defineProperties) { - Object.defineProperties = function defineProperties(object, properties) { - for (var property in properties) { - if (owns(properties, property)) - Object.defineProperty(object, property, properties[property]); - } - return object; - }; -} - -// ES5 15.2.3.8 -if (!Object.seal) { - Object.seal = function seal(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// ES5 15.2.3.9 -if (!Object.freeze) { - Object.freeze = function freeze(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// detect a Rhino bug and patch it -try { - Object.freeze(function () {}); -} catch (exception) { - Object.freeze = (function freeze(freezeObject) { - return function freeze(object) { - if (typeof object === "function") { - return object; - } else { - return freezeObject(object); - } - }; - })(Object.freeze); -} - -// ES5 15.2.3.10 -if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; -} - -// ES5 15.2.3.11 -if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - return false; - }; -} - -// ES5 15.2.3.12 -if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - return false; - }; -} - -// ES5 15.2.3.13 -if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - return true; - }; -} - -// ES5 15.2.3.14 -// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation -if (!Object.keys) { - - var hasDontEnumBug = true, - dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ], - dontEnumsLength = dontEnums.length; - - for (var key in {"toString": null}) - hasDontEnumBug = false; - - Object.keys = function keys(object) { - - if ( - typeof object !== "object" && typeof object !== "function" - || object === null - ) - throw new TypeError("Object.keys called on a non-object"); - - var keys = []; - for (var name in object) { - if (owns(object, name)) { - keys.push(name); - } - } - - if (hasDontEnumBug) { - for (var i = 0, ii = dontEnumsLength; i < ii; i++) { - var dontEnum = dontEnums[i]; - if (owns(object, dontEnum)) { - keys.push(dontEnum); - } - } - } - - return keys; - }; - -} - -// -// Date -// ==== -// - -// ES5 15.9.5.43 -// Format a Date object as a string according to a subset of the ISO-8601 standard. -// Useful in Atom, among other things. -if (!Date.prototype.toISOString) { - Date.prototype.toISOString = function toISOString() { - return ( - this.getUTCFullYear() + "-" + - (this.getUTCMonth() + 1) + "-" + - this.getUTCDate() + "T" + - this.getUTCHours() + ":" + - this.getUTCMinutes() + ":" + - this.getUTCSeconds() + "Z" - ); - } -} - -// ES5 15.9.4.4 -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} - -// ES5 15.9.5.44 -if (!Date.prototype.toJSON) { - Date.prototype.toJSON = function toJSON(key) { - // This function provides a String representation of a Date object for - // use by JSON.stringify (15.12.3). When the toJSON method is called - // with argument key, the following steps are taken: - - // 1. Let O be the result of calling ToObject, giving it the this - // value as its argument. - // 2. Let tv be ToPrimitive(O, hint Number). - // 3. If tv is a Number and is not finite, return null. - // XXX - // 4. Let toISO be the result of calling the [[Get]] internal method of - // O with argument "toISOString". - // 5. If IsCallable(toISO) is false, throw a TypeError exception. - if (typeof this.toISOString !== "function") - throw new TypeError(); - // 6. Return the result of calling the [[Call]] internal method of - // toISO with O as the this value and an empty argument list. - return this.toISOString(); - - // NOTE 1 The argument is ignored. - - // NOTE 2 The toJSON function is intentionally generic; it does not - // require that its this value be a Date object. Therefore, it can be - // transferred to other kinds of objects for use as a method. However, - // it does require that any such object have a toISOString method. An - // object is free to use the argument key to filter its - // stringification. - }; -} - -// 15.9.4.2 Date.parse (string) -// 15.9.1.15 Date Time String Format -// Date.parse -// based on work shared by Daniel Friesen (dantman) -// http://gist.github.com/303249 -if (isNaN(Date.parse("T00:00"))) { - // XXX global assignment won't work in embeddings that use - // an alternate object for the context. - Date = (function(NativeDate) { - - // Date.length === 7 - var Date = function(Y, M, D, h, m, s, ms) { - var length = arguments.length; - if (this instanceof NativeDate) { - var date = length === 1 && String(Y) === Y ? // isString(Y) - // We explicitly pass it through parse: - new NativeDate(Date.parse(Y)) : - // We have to manually make calls depending on argument - // length here - length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) : - length >= 6 ? new NativeDate(Y, M, D, h, m, s) : - length >= 5 ? new NativeDate(Y, M, D, h, m) : - length >= 4 ? new NativeDate(Y, M, D, h) : - length >= 3 ? new NativeDate(Y, M, D) : - length >= 2 ? new NativeDate(Y, M) : - length >= 1 ? new NativeDate(Y) : - new NativeDate(); - // Prevent mixups with unfixed Date object - date.constructor = Date; - return date; - } - return NativeDate.apply(this, arguments); - }; - - // 15.9.1.15 Date Time String Format - var isoDateExpression = new RegExp("^" + - "(?:" + // optional year-month-day - "(" + // year capture - "(?:[+-]\\d\\d)?" + // 15.9.1.15.1 Extended years - "\\d\\d\\d\\d" + // four-digit year - ")" + - "(?:-" + // optional month-day - "(\\d\\d)" + // month capture - "(?:-" + // optional day - "(\\d\\d)" + // day capture - ")?" + - ")?" + - ")?" + - "(?:T" + // hour:minute:second.subsecond - "(\\d\\d)" + // hour capture - ":(\\d\\d)" + // minute capture - "(?::" + // optional :second.subsecond - "(\\d\\d)" + // second capture - "(?:\\.(\\d\\d\\d))?" + // milisecond capture - ")?" + - ")?" + - "(?:" + // time zone - "Z|" + // UTC capture - "([+-])(\\d\\d):(\\d\\d)" + // timezone offset - // capture sign, hour, minute - ")?" + - "$"); - - // Copy any custom methods a 3rd party library may have added - for (var key in NativeDate) - Date[key] = NativeDate[key]; - - // Copy "native" methods explicitly; they may be non-enumerable - Date.now = NativeDate.now; - Date.UTC = NativeDate.UTC; - Date.prototype = NativeDate.prototype; - Date.prototype.constructor = Date; - - // Upgrade Date.parse to handle the ISO dates we use - // TODO review specification to ascertain whether it is - // necessary to implement partial ISO date strings. - Date.parse = function parse(string) { - var match = isoDateExpression.exec(string); - if (match) { - match.shift(); // kill match[0], the full match - // recognize times without dates before normalizing the - // numeric values, for later use - var timeOnly = match[0] === undefined; - // parse numerics - for (var i = 0; i < 10; i++) { - // skip + or - for the timezone offset - if (i === 7) - continue; - // Note: parseInt would read 0-prefix numbers as - // octal. Number constructor or unary + work better - // here: - match[i] = +(match[i] || (i < 3 ? 1 : 0)); - // match[1] is the month. Months are 0-11 in JavaScript - // Date objects, but 1-12 in ISO notation, so we - // decrement. - if (i === 1) - match[i]--; - } - // if no year-month-date is provided, return a milisecond - // quantity instead of a UTC date number value. - if (timeOnly) - return ((match[3] * 60 + match[4]) * 60 + match[5]) * 1000 + match[6]; - - // account for an explicit time zone offset if provided - var offset = (match[8] * 60 + match[9]) * 60 * 1000; - if (match[6] === "-") - offset = -offset; - - return NativeDate.UTC.apply(this, match.slice(0, 7)) + offset; - } - return NativeDate.parse.apply(this, arguments); - }; - - return Date; - })(Date); -} - -// -// String -// ====== -// - -// ES5 15.5.4.20 -if (!String.prototype.trim) { - // http://blog.stevenlevithan.com/archives/faster-trim-javascript - var trimBeginRegexp = /^\s\s*/; - var trimEndRegexp = /\s\s*$/; - String.prototype.trim = function trim() { - return String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); - }; -} - -});/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/ace', ['require', 'exports', 'module' , 'pilot/index', 'pilot/fixoldbrowsers', 'pilot/plugin_manager', 'pilot/dom', 'pilot/event', 'ace/editor', 'ace/edit_session', 'ace/undomanager', 'ace/virtual_renderer', 'ace/theme/textmate', 'pilot/environment'], function(require, exports, module) { - - require("pilot/index"); - require("pilot/fixoldbrowsers"); - var catalog = require("pilot/plugin_manager").catalog; - catalog.registerPlugins([ "pilot/index" ]); - - var Dom = require("pilot/dom"); - var Event = require("pilot/event"); - - var Editor = require("ace/editor").Editor; - var EditSession = require("ace/edit_session").EditSession; - var UndoManager = require("ace/undomanager").UndoManager; - var Renderer = require("ace/virtual_renderer").VirtualRenderer; - - exports.edit = function(el) { - if (typeof(el) == "string") { - el = document.getElementById(el); - } - - var doc = new EditSession(Dom.getInnerText(el)); - doc.setUndoManager(new UndoManager()); - el.innerHTML = ''; - - var editor = new Editor(new Renderer(el, require("ace/theme/textmate"))); - editor.setSession(doc); - - var env = require("pilot/environment").create(); - catalog.startupPlugins({ env: env }).then(function() { - env.document = doc; - env.editor = editor; - editor.resize(); - Event.addListener(window, "resize", function() { - editor.resize(); - }); - el.env = env; - }); - // Store env on editor such that it can be accessed later on from - // the returned object. - editor.env = env; - return editor; - }; -});/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/index', ['require', 'exports', 'module' , 'pilot/fixoldbrowsers', 'pilot/types/basic', 'pilot/types/command', 'pilot/types/settings', 'pilot/commands/settings', 'pilot/commands/basic', 'pilot/settings/canon', 'pilot/canon'], function(require, exports, module) { - -exports.startup = function(data, reason) { - require('pilot/fixoldbrowsers'); - - require('pilot/types/basic').startup(data, reason); - require('pilot/types/command').startup(data, reason); - require('pilot/types/settings').startup(data, reason); - require('pilot/commands/settings').startup(data, reason); - require('pilot/commands/basic').startup(data, reason); - // require('pilot/commands/history').startup(data, reason); - require('pilot/settings/canon').startup(data, reason); - require('pilot/canon').startup(data, reason); -}; - -exports.shutdown = function(data, reason) { - require('pilot/types/basic').shutdown(data, reason); - require('pilot/types/command').shutdown(data, reason); - require('pilot/types/settings').shutdown(data, reason); - require('pilot/commands/settings').shutdown(data, reason); - require('pilot/commands/basic').shutdown(data, reason); - // require('pilot/commands/history').shutdown(data, reason); - require('pilot/settings/canon').shutdown(data, reason); - require('pilot/canon').shutdown(data, reason); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/types/basic', ['require', 'exports', 'module' , 'pilot/types'], function(require, exports, module) { - -var types = require("pilot/types"); -var Type = types.Type; -var Conversion = types.Conversion; -var Status = types.Status; - -/** - * These are the basic types that we accept. They are vaguely based on the - * Jetpack settings system (https://wiki.mozilla.org/Labs/Jetpack/JEP/24) - * although clearly more restricted. - * - *

In addition to these types, Jetpack also accepts range, member, password - * that we are thinking of adding. - * - *

This module probably should not be accessed directly, but instead used - * through types.js - */ - -/** - * 'text' is the default if no type is given. - */ -var text = new Type(); - -text.stringify = function(value) { - return value; -}; - -text.parse = function(value) { - if (typeof value != 'string') { - throw new Error('non-string passed to text.parse()'); - } - return new Conversion(value); -}; - -text.name = 'text'; - -/** - * We don't currently plan to distinguish between integers and floats - */ -var number = new Type(); - -number.stringify = function(value) { - if (!value) { - return null; - } - return '' + value; -}; - -number.parse = function(value) { - if (typeof value != 'string') { - throw new Error('non-string passed to number.parse()'); - } - - if (value.replace(/\s/g, '').length === 0) { - return new Conversion(null, Status.INCOMPLETE, ''); - } - - var reply = new Conversion(parseInt(value, 10)); - if (isNaN(reply.value)) { - reply.status = Status.INVALID; - reply.message = 'Can\'t convert "' + value + '" to a number.'; - } - - return reply; -}; - -number.decrement = function(value) { - return value - 1; -}; - -number.increment = function(value) { - return value + 1; -}; - -number.name = 'number'; - -/** - * One of a known set of options - */ -function SelectionType(typeSpec) { - if (!Array.isArray(typeSpec.data) && typeof typeSpec.data !== 'function') { - throw new Error('instances of SelectionType need typeSpec.data to be an array or function that returns an array:' + JSON.stringify(typeSpec)); - } - Object.keys(typeSpec).forEach(function(key) { - this[key] = typeSpec[key]; - }, this); -}; - -SelectionType.prototype = new Type(); - -SelectionType.prototype.stringify = function(value) { - return value; -}; - -SelectionType.prototype.parse = function(str) { - if (typeof str != 'string') { - throw new Error('non-string passed to parse()'); - } - if (!this.data) { - throw new Error('Missing data on selection type extension.'); - } - var data = (typeof(this.data) === 'function') ? this.data() : this.data; - - // The matchedValue could be the boolean value false - var hasMatched = false; - var matchedValue; - var completions = []; - data.forEach(function(option) { - if (str == option) { - matchedValue = this.fromString(option); - hasMatched = true; - } - else if (option.indexOf(str) === 0) { - completions.push(this.fromString(option)); - } - }, this); - - if (hasMatched) { - return new Conversion(matchedValue); - } - else { - // This is something of a hack it basically allows us to tell the - // setting type to forget its last setting hack. - if (this.noMatch) { - this.noMatch(); - } - - if (completions.length > 0) { - var msg = 'Possibilities' + - (str.length === 0 ? '' : ' for \'' + str + '\''); - return new Conversion(null, Status.INCOMPLETE, msg, completions); - } - else { - var msg = 'Can\'t use \'' + str + '\'.'; - return new Conversion(null, Status.INVALID, msg, completions); - } - } -}; - -SelectionType.prototype.fromString = function(str) { - return str; -}; - -SelectionType.prototype.decrement = function(value) { - var data = (typeof this.data === 'function') ? this.data() : this.data; - var index; - if (value == null) { - index = data.length - 1; - } - else { - var name = this.stringify(value); - var index = data.indexOf(name); - index = (index === 0 ? data.length - 1 : index - 1); - } - return this.fromString(data[index]); -}; - -SelectionType.prototype.increment = function(value) { - var data = (typeof this.data === 'function') ? this.data() : this.data; - var index; - if (value == null) { - index = 0; - } - else { - var name = this.stringify(value); - var index = data.indexOf(name); - index = (index === data.length - 1 ? 0 : index + 1); - } - return this.fromString(data[index]); -}; - -SelectionType.prototype.name = 'selection'; - -/** - * SelectionType is a base class for other types - */ -exports.SelectionType = SelectionType; - -/** - * true/false values - */ -var bool = new SelectionType({ - name: 'bool', - data: [ 'true', 'false' ], - stringify: function(value) { - return '' + value; - }, - fromString: function(str) { - return str === 'true' ? true : false; - } -}); - - -/** - * A we don't know right now, but hope to soon. - */ -function DeferredType(typeSpec) { - if (typeof typeSpec.defer !== 'function') { - throw new Error('Instances of DeferredType need typeSpec.defer to be a function that returns a type'); - } - Object.keys(typeSpec).forEach(function(key) { - this[key] = typeSpec[key]; - }, this); -}; - -DeferredType.prototype = new Type(); - -DeferredType.prototype.stringify = function(value) { - return this.defer().stringify(value); -}; - -DeferredType.prototype.parse = function(value) { - return this.defer().parse(value); -}; - -DeferredType.prototype.decrement = function(value) { - var deferred = this.defer(); - return (deferred.decrement ? deferred.decrement(value) : undefined); -}; - -DeferredType.prototype.increment = function(value) { - var deferred = this.defer(); - return (deferred.increment ? deferred.increment(value) : undefined); -}; - -DeferredType.prototype.name = 'deferred'; - -/** - * DeferredType is a base class for other types - */ -exports.DeferredType = DeferredType; - - -/** - * A set of objects of the same type - */ -function ArrayType(typeSpec) { - if (typeSpec instanceof Type) { - this.subtype = typeSpec; - } - else if (typeof typeSpec === 'string') { - this.subtype = types.getType(typeSpec); - if (this.subtype == null) { - throw new Error('Unknown array subtype: ' + typeSpec); - } - } - else { - throw new Error('Can\' handle array subtype'); - } -}; - -ArrayType.prototype = new Type(); - -ArrayType.prototype.stringify = function(values) { - // TODO: Check for strings with spaces and add quotes - return values.join(' '); -}; - -ArrayType.prototype.parse = function(value) { - return this.defer().parse(value); -}; - -ArrayType.prototype.name = 'array'; - -/** - * Registration and de-registration. - */ -var isStarted = false; -exports.startup = function() { - if (isStarted) { - return; - } - isStarted = true; - types.registerType(text); - types.registerType(number); - types.registerType(bool); - types.registerType(SelectionType); - types.registerType(DeferredType); - types.registerType(ArrayType); -}; - -exports.shutdown = function() { - isStarted = false; - types.unregisterType(text); - types.unregisterType(number); - types.unregisterType(bool); - types.unregisterType(SelectionType); - types.unregisterType(DeferredType); - types.unregisterType(ArrayType); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/types', ['require', 'exports', 'module' ], function(require, exports, module) { - -/** - * Some types can detect validity, that is to say they can distinguish between - * valid and invalid values. - * TODO: Change these constants to be numbers for more performance? - */ -var Status = { - /** - * The conversion process worked without any problem, and the value is - * valid. There are a number of failure states, so the best way to check - * for failure is (x !== Status.VALID) - */ - VALID: { - toString: function() { return 'VALID'; }, - valueOf: function() { return 0; } - }, - - /** - * A conversion process failed, however it was noted that the string - * provided to 'parse()' could be VALID by the addition of more characters, - * so the typing may not be actually incorrect yet, just unfinished. - * @see Status.INVALID - */ - INCOMPLETE: { - toString: function() { return 'INCOMPLETE'; }, - valueOf: function() { return 1; } - }, - - /** - * The conversion process did not work, the value should be null and a - * reason for failure should have been provided. In addition some completion - * values may be available. - * @see Status.INCOMPLETE - */ - INVALID: { - toString: function() { return 'INVALID'; }, - valueOf: function() { return 2; } - }, - - /** - * A combined status is the worser of the provided statuses - */ - combine: function(statuses) { - var combined = Status.VALID; - for (var i = 0; i < statuses.length; i++) { - if (statuses[i].valueOf() > combined.valueOf()) { - combined = statuses[i]; - } - } - return combined; - } -}; -exports.Status = Status; - -/** - * The type.parse() method returns a Conversion to inform the user about not - * only the result of a Conversion but also about what went wrong. - * We could use an exception, and throw if the conversion failed, but that - * seems to violate the idea that exceptions should be exceptional. Typos are - * not. Also in order to store both a status and a message we'd still need - * some sort of exception type... - */ -function Conversion(value, status, message, predictions) { - /** - * The result of the conversion process. Will be null if status != VALID - */ - this.value = value; - - /** - * The status of the conversion. - * @see Status - */ - this.status = status || Status.VALID; - - /** - * A message to go with the conversion. This could be present for any status - * including VALID in the case where we want to note a warning for example. - * I18N: On the one hand this nasty and un-internationalized, however with - * a command line it is hard to know where to start. - */ - this.message = message; - - /** - * A array of strings which are the systems best guess at better inputs than - * the one presented. - * We generally expect there to be about 7 predictions (to match human list - * comprehension ability) however it is valid to provide up to about 20, - * or less. It is the job of the predictor to decide a smart cut-off. - * For example if there are 4 very good matches and 4 very poor ones, - * probably only the 4 very good matches should be presented. - */ - this.predictions = predictions || []; -} -exports.Conversion = Conversion; - -/** - * Most of our types are 'static' e.g. there is only one type of 'text', however - * some types like 'selection' and 'deferred' are customizable. The basic - * Type type isn't useful, but does provide documentation about what types do. - */ -function Type() { -}; -Type.prototype = { - /** - * Convert the given value to a string representation. - * Where possible, there should be round-tripping between values and their - * string representations. - */ - stringify: function(value) { throw new Error("not implemented"); }, - - /** - * Convert the given str to an instance of this type. - * Where possible, there should be round-tripping between values and their - * string representations. - * @return Conversion - */ - parse: function(str) { throw new Error("not implemented"); }, - - /** - * The plug-in system, and other things need to know what this type is - * called. The name alone is not enough to fully specify a type. Types like - * 'selection' and 'deferred' need extra data, however this function returns - * only the name, not the extra data. - *

In old bespin, equality was based on the name. This may turn out to be - * important in Ace too. - */ - name: undefined, - - /** - * If there is some concept of a higher value, return it, - * otherwise return undefined. - */ - increment: function(value) { - return undefined; - }, - - /** - * If there is some concept of a lower value, return it, - * otherwise return undefined. - */ - decrement: function(value) { - return undefined; - }, - - /** - * There is interesting information (like predictions) in a conversion of - * nothing, the output of this can sometimes be customized. - * @return Conversion - */ - getDefault: function() { - return this.parse(''); - } -}; -exports.Type = Type; - -/** - * Private registry of types - * Invariant: types[name] = type.name - */ -var types = {}; - -/** - * Add a new type to the list available to the system. - * You can pass 2 things to this function - either an instance of Type, in - * which case we return this instance when #getType() is called with a 'name' - * that matches type.name. - * Also you can pass in a constructor (i.e. function) in which case when - * #getType() is called with a 'name' that matches Type.prototype.name we will - * pass the typeSpec into this constructor. See #reconstituteType(). - */ -exports.registerType = function(type) { - if (typeof type === 'object') { - if (type instanceof Type) { - if (!type.name) { - throw new Error('All registered types must have a name'); - } - types[type.name] = type; - } - else { - throw new Error('Can\'t registerType using: ' + type); - } - } - else if (typeof type === 'function') { - if (!type.prototype.name) { - throw new Error('All registered types must have a name'); - } - types[type.prototype.name] = type; - } - else { - throw new Error('Unknown type: ' + type); - } -}; - -exports.registerTypes = function registerTypes(types) { - Object.keys(types).forEach(function (name) { - var type = types[name]; - type.name = name; - exports.registerType(type); - }); -}; - -/** - * Remove a type from the list available to the system - */ -exports.deregisterType = function(type) { - delete types[type.name]; -}; - -/** - * See description of #exports.registerType() - */ -function reconstituteType(name, typeSpec) { - if (name.substr(-2) === '[]') { // i.e. endsWith('[]') - var subtypeName = name.slice(0, -2); - return new types['array'](subtypeName); - } - - var type = types[name]; - if (typeof type === 'function') { - type = new type(typeSpec); - } - return type; -} - -/** - * Find a type, previously registered using #registerType() - */ -exports.getType = function(typeSpec) { - if (typeof typeSpec === 'string') { - return reconstituteType(typeSpec); - } - - if (typeof typeSpec === 'object') { - if (!typeSpec.name) { - throw new Error('Missing \'name\' member to typeSpec'); - } - return reconstituteType(typeSpec.name, typeSpec); - } - - throw new Error('Can\'t extract type from ' + typeSpec); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/types/command', ['require', 'exports', 'module' , 'pilot/canon', 'pilot/types/basic', 'pilot/types'], function(require, exports, module) { - -var canon = require("pilot/canon"); -var SelectionType = require("pilot/types/basic").SelectionType; -var types = require("pilot/types"); - - -/** - * Select from the available commands - */ -var command = new SelectionType({ - name: 'command', - data: function() { - return canon.getCommandNames(); - }, - stringify: function(command) { - return command.name; - }, - fromString: function(str) { - return canon.getCommand(str); - } -}); - - -/** - * Registration and de-registration. - */ -exports.startup = function() { - types.registerType(command); -}; - -exports.shutdown = function() { - types.unregisterType(command); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/canon', ['require', 'exports', 'module' , 'pilot/console', 'pilot/stacktrace', 'pilot/oop', 'pilot/useragent', 'pilot/keys', 'pilot/event_emitter', 'pilot/typecheck', 'pilot/catalog', 'pilot/types', 'pilot/lang'], function(require, exports, module) { - -var console = require('pilot/console'); -var Trace = require('pilot/stacktrace').Trace; -var oop = require('pilot/oop'); -var useragent = require('pilot/useragent'); -var keyUtil = require('pilot/keys'); -var EventEmitter = require('pilot/event_emitter').EventEmitter; -var typecheck = require('pilot/typecheck'); -var catalog = require('pilot/catalog'); -var Status = require('pilot/types').Status; -var types = require('pilot/types'); -var lang = require('pilot/lang'); - -/* -// TODO: this doesn't belong here - or maybe anywhere? -var dimensionsChangedExtensionSpec = { - name: 'dimensionsChanged', - description: 'A dimensionsChanged is a way to be notified of ' + - 'changes to the dimension of Skywriter' -}; -exports.startup = function(data, reason) { - catalog.addExtensionSpec(commandExtensionSpec); -}; -exports.shutdown = function(data, reason) { - catalog.removeExtensionSpec(commandExtensionSpec); -}; -*/ - -var commandExtensionSpec = { - name: 'command', - description: 'A command is a bit of functionality with optional ' + - 'typed arguments which can do something small like moving ' + - 'the cursor around the screen, or large like cloning a ' + - 'project from VCS.', - indexOn: 'name' -}; - -exports.startup = function(data, reason) { - // TODO: this is probably all kinds of evil, but we need something working - catalog.addExtensionSpec(commandExtensionSpec); -}; - -exports.shutdown = function(data, reason) { - catalog.removeExtensionSpec(commandExtensionSpec); -}; - -/** - * Manage a list of commands in the current canon - */ - -/** - * A Command is a discrete action optionally with a set of ways to customize - * how it happens. This is here for documentation purposes. - * TODO: Document better - */ -var thingCommand = { - name: 'thing', - description: 'thing is an example command', - params: [{ - name: 'param1', - description: 'an example parameter', - type: 'text', - defaultValue: null - }], - exec: function(env, args, request) { - thing(); - } -}; - -/** - * A lookup hash of our registered commands - */ -var commands = {}; - -/** - * A lookup has for command key bindings that use a string as sender. - */ -var commmandKeyBinding = {}; - -/** - * Array with command key bindings that use a function to determ the sender. - */ -var commandKeyBindingFunc = { }; - -function splitSafe(s, separator, limit, bLowerCase) { - return (bLowerCase && s.toLowerCase() || s) - .replace(/(?:^\s+|\n|\s+$)/g, "") - .split(new RegExp("[\\s ]*" + separator + "[\\s ]*", "g"), limit || 999); -} - -function parseKeys(keys, val, ret) { - var key, - hashId = 0, - parts = splitSafe(keys, "\\-", null, true), - i = 0, - l = parts.length; - - for (; i < l; ++i) { - if (keyUtil.KEY_MODS[parts[i]]) - hashId = hashId | keyUtil.KEY_MODS[parts[i]]; - else - key = parts[i] || "-"; //when empty, the splitSafe removed a '-' - } - - if (ret == null) { - return { - key: key, - hashId: hashId - } - } else { - (ret[hashId] || (ret[hashId] = {}))[key] = val; - } -} - -var platform = useragent.isMac ? "mac" : "win"; -function buildKeyHash(command) { - var binding = command.bindKey, - key = binding[platform], - ckb = commmandKeyBinding, - ckbf = commandKeyBindingFunc - - if (!binding.sender) { - throw new Error('All key bindings must have a sender'); - } - if (!binding.mac && binding.mac !== null) { - throw new Error('All key bindings must have a mac key binding'); - } - if (!binding.win && binding.win !== null) { - throw new Error('All key bindings must have a windows key binding'); - } - if(!binding[platform]) { - // No keymapping for this platform. - return; - } - if (typeof binding.sender == 'string') { - var targets = splitSafe(binding.sender, "\\|", null, true); - targets.forEach(function(target) { - if (!ckb[target]) { - ckb[target] = { }; - } - key.split("|").forEach(function(keyPart) { - parseKeys(keyPart, command, ckb[target]); - }); - }); - } else if (typecheck.isFunction(binding.sender)) { - var val = { - command: command, - sender: binding.sender - }; - - keyData = parseKeys(key); - if (!ckbf[keyData.hashId]) { - ckbf[keyData.hashId] = { }; - } - if (!ckbf[keyData.hashId][keyData.key]) { - ckbf[keyData.hashId][keyData.key] = [ val ]; - } else { - ckbf[keyData.hashId][keyData.key].push(val); - } - } else { - throw new Error('Key binding must have a sender that is a string or function'); - } -} - -function findKeyCommand(env, sender, hashId, textOrKey) { - // Convert keyCode to the string representation. - if (typecheck.isNumber(textOrKey)) { - textOrKey = keyUtil.keyCodeToString(textOrKey); - } - - // Check bindings with functions as sender first. - var bindFuncs = (commandKeyBindingFunc[hashId] || {})[textOrKey] || []; - for (var i = 0; i < bindFuncs.length; i++) { - if (bindFuncs[i].sender(env, sender, hashId, textOrKey)) { - return bindFuncs[i].command; - } - } - - var ckbr = commmandKeyBinding[sender] - return ckbr && ckbr[hashId] && ckbr[hashId][textOrKey]; -} - -function execKeyCommand(env, sender, hashId, textOrKey) { - var command = findKeyCommand(env, sender, hashId, textOrKey); - if (command) { - return exec(command, env, sender, { }); - } else { - return false; - } -} - -/** - * A sorted list of command names, we regularly want them in order, so pre-sort - */ -var commandNames = []; - -/** - * This registration method isn't like other Ace registration methods because - * it doesn't return a decorated command because there is no functional - * decoration to be done. - * TODO: Are we sure that in the future there will be no such decoration? - */ -function addCommand(command) { - if (!command.name) { - throw new Error('All registered commands must have a name'); - } - if (command.params == null) { - command.params = []; - } - if (!Array.isArray(command.params)) { - throw new Error('command.params must be an array in ' + command.name); - } - // Replace the type - command.params.forEach(function(param) { - if (!param.name) { - throw new Error('In ' + command.name + ': all params must have a name'); - } - upgradeType(command.name, param); - }, this); - commands[command.name] = command; - - if (command.bindKey) { - buildKeyHash(command); - } - - commandNames.push(command.name); - commandNames.sort(); -}; - -function upgradeType(name, param) { - var lookup = param.type; - param.type = types.getType(lookup); - if (param.type == null) { - throw new Error('In ' + name + '/' + param.name + - ': can\'t find type for: ' + JSON.stringify(lookup)); - } -} - -function removeCommand(command) { - var name = (typeof command === 'string' ? command : command.name); - delete commands[name]; - lang.arrayRemove(commandNames, name); -}; - -function getCommand(name) { - return commands[name]; -}; - -function getCommandNames() { - return commandNames; -}; - -/** - * Default ArgumentProvider that is used if no ArgumentProvider is provided - * by the command's sender. - */ -function defaultArgsProvider(request, callback) { - var args = request.args, - params = request.command.params; - - for (var i = 0; i < params.length; i++) { - var param = params[i]; - - // If the parameter is already valid, then don't ask for it anymore. - if (request.getParamStatus(param) != Status.VALID || - // Ask for optional parameters as well. - param.defaultValue === null) - { - var paramPrompt = param.description; - if (param.defaultValue === null) { - paramPrompt += " (optional)"; - } - var value = prompt(paramPrompt, param.defaultValue || ""); - // No value but required -> nope. - if (!value) { - callback(); - return; - } else { - args[param.name] = value; - } - } - } - callback(); -} - -/** - * Entry point for keyboard accelerators or anything else that wants to execute - * a command. A new request object is created and a check performed, if the - * passed in arguments are VALID/INVALID or INCOMPLETE. If they are INCOMPLETE - * the ArgumentProvider on the sender is called or otherwise the default - * ArgumentProvider to get the still required arguments. - * If they are valid (or valid after the ArgumentProvider is done), the command - * is executed. - * - * @param command Either a command, or the name of one - * @param env Current environment to execute the command in - * @param sender String that should be the same as the senderObject stored on - * the environment in env[sender] - * @param args Arguments for the command - * @param typed (Optional) - */ -function exec(command, env, sender, args, typed) { - if (typeof command === 'string') { - command = commands[command]; - } - if (!command) { - // TODO: Should we complain more than returning false? - return false; - } - - var request = new Request({ - sender: sender, - command: command, - args: args || {}, - typed: typed - }); - - /** - * Executes the command and ensures request.done is called on the request in - * case it's not marked to be done already or async. - */ - function execute() { - command.exec(env, request.args, request); - - // If the request isn't asnync and isn't done, then make it done. - if (!request.isAsync && !request.isDone) { - request.done(); - } - } - - - if (request.getStatus() == Status.INVALID) { - console.error("Canon.exec: Invalid parameter(s) passed to " + - command.name); - return false; - } - // If the request isn't complete yet, try to complete it. - else if (request.getStatus() == Status.INCOMPLETE) { - // Check if the sender has a ArgsProvider, otherwise use the default - // build in one. - var argsProvider; - var senderObj = env[sender]; - if (!senderObj || !senderObj.getArgsProvider || - !(argsProvider = senderObj.getArgsProvider())) - { - argsProvider = defaultArgsProvider; - } - - // Ask the paramProvider to complete the request. - argsProvider(request, function() { - if (request.getStatus() == Status.VALID) { - execute(); - } - }); - return true; - } else { - execute(); - return true; - } -}; - -exports.removeCommand = removeCommand; -exports.addCommand = addCommand; -exports.getCommand = getCommand; -exports.getCommandNames = getCommandNames; -exports.findKeyCommand = findKeyCommand; -exports.exec = exec; -exports.execKeyCommand = execKeyCommand; -exports.upgradeType = upgradeType; - - -/** - * We publish a 'output' event whenever new command begins output - * TODO: make this more obvious - */ -oop.implement(exports, EventEmitter); - - -/** - * Current requirements are around displaying the command line, and provision - * of a 'history' command and cursor up|down navigation of history. - *

Future requirements could include: - *

    - *
  • Multiple command lines - *
  • The ability to recall key presses (i.e. requests with no output) which - * will likely be needed for macro recording or similar - *
  • The ability to store the command history either on the server or in the - * browser local storage. - *
- *

The execute() command doesn't really live here, except as part of that - * last future requirement, and because it doesn't really have anywhere else to - * live. - */ - -/** - * The array of requests that wish to announce their presence - */ -var requests = []; - -/** - * How many requests do we store? - */ -var maxRequestLength = 100; - -/** - * To create an invocation, you need to do something like this (all the ctor - * args are optional): - *

- * var request = new Request({
- *     command: command,
- *     args: args,
- *     typed: typed
- * });
- * 
- * @constructor - */ -function Request(options) { - options = options || {}; - - // Will be used in the keyboard case and the cli case - this.command = options.command; - - // Will be used only in the cli case - this.args = options.args; - this.typed = options.typed; - - // Have we been initialized? - this._begunOutput = false; - - this.start = new Date(); - this.end = null; - this.completed = false; - this.error = false; -}; - -oop.implement(Request.prototype, EventEmitter); - -/** - * Return the status of a parameter on the request object. - */ -Request.prototype.getParamStatus = function(param) { - var args = this.args || {}; - - // Check if there is already a value for this parameter. - if (param.name in args) { - // If there is no value set and then the value is VALID if it's not - // required or INCOMPLETE if not set yet. - if (args[param.name] == null) { - if (param.defaultValue === null) { - return Status.VALID; - } else { - return Status.INCOMPLETE; - } - } - - // Check if the parameter value is valid. - var reply, - // The passed in value when parsing a type is a string. - argsValue = args[param.name].toString(); - - // Type.parse can throw errors. - try { - reply = param.type.parse(argsValue); - } catch (e) { - return Status.INVALID; - } - - if (reply.status != Status.VALID) { - return reply.status; - } - } - // Check if the param is marked as required. - else if (param.defaultValue === undefined) { - // The parameter is not set on the args object but it's required, - // which means, things are invalid. - return Status.INCOMPLETE; - } - - return Status.VALID; -} - -/** - * Return the status of a parameter name on the request object. - */ -Request.prototype.getParamNameStatus = function(paramName) { - var params = this.command.params || []; - - for (var i = 0; i < params.length; i++) { - if (params[i].name == paramName) { - return this.getParamStatus(params[i]); - } - } - - throw "Parameter '" + paramName + - "' not defined on command '" + this.command.name + "'"; -} - -/** - * Checks if all required arguments are set on the request such that it can - * get executed. - */ -Request.prototype.getStatus = function() { - var args = this.args || {}, - params = this.command.params; - - // If there are not parameters, then it's valid. - if (!params || params.length == 0) { - return Status.VALID; - } - - var status = []; - for (var i = 0; i < params.length; i++) { - status.push(this.getParamStatus(params[i])); - } - - return Status.combine(status); -} - -/** - * Lazy init to register with the history should only be done on output. - * init() is expensive, and won't be used in the majority of cases - */ -Request.prototype._beginOutput = function() { - this._begunOutput = true; - this.outputs = []; - - requests.push(this); - // This could probably be optimized with some maths, but 99.99% of the - // time we will only be off by one, and I'm feeling lazy. - while (requests.length > maxRequestLength) { - requests.shiftObject(); - } - - exports._dispatchEvent('output', { requests: requests, request: this }); -}; - -/** - * Sugar for: - *
request.error = true; request.done(output);
- */ -Request.prototype.doneWithError = function(content) { - this.error = true; - this.done(content); -}; - -/** - * Declares that this function will not be automatically done when - * the command exits - */ -Request.prototype.async = function() { - this.isAsync = true; - if (!this._begunOutput) { - this._beginOutput(); - } -}; - -/** - * Complete the currently executing command with successful output. - * @param output Either DOM node, an SproutCore element or something that - * can be used in the content of a DIV to create a DOM node. - */ -Request.prototype.output = function(content) { - if (!this._begunOutput) { - this._beginOutput(); - } - - if (typeof content !== 'string' && !(content instanceof Node)) { - content = content.toString(); - } - - this.outputs.push(content); - this.isDone = true; - this._dispatchEvent('output', {}); - - return this; -}; - -/** - * All commands that do output must call this to indicate that the command - * has finished execution. - */ -Request.prototype.done = function(content) { - this.completed = true; - this.end = new Date(); - this.duration = this.end.getTime() - this.start.getTime(); - - if (content) { - this.output(content); - } - - // Ensure to finish the request only once. - if (!this.isDone) { - this.isDone = true; - this._dispatchEvent('output', {}); - } -}; -exports.Request = Request; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * Patrick Walton (pwalton@mozilla.com) - * Julian Viereck (jviereck@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -define('pilot/console', ['require', 'exports', 'module' ], function(require, exports, module) { - -/** - * This object represents a "safe console" object that forwards debugging - * messages appropriately without creating a dependency on Firebug in Firefox. - */ - -var noop = function() {}; - -// These are the functions that are available in Chrome 4/5, Safari 4 -// and Firefox 3.6. Don't add to this list without checking browser support -var NAMES = [ - "assert", "count", "debug", "dir", "dirxml", "error", "group", "groupEnd", - "info", "log", "profile", "profileEnd", "time", "timeEnd", "trace", "warn" -]; - -if (typeof(window) === 'undefined') { - // We're in a web worker. Forward to the main thread so the messages - // will show up. - NAMES.forEach(function(name) { - exports[name] = function() { - var args = Array.prototype.slice.call(arguments); - var msg = { op: 'log', method: name, args: args }; - postMessage(JSON.stringify(msg)); - }; - }); -} else { - // For each of the console functions, copy them if they exist, stub if not - NAMES.forEach(function(name) { - if (window.console && window.console[name]) { - exports[name] = Function.prototype.bind.call(window.console[name], window.console); - } else { - exports[name] = noop; - } - }); -} - -}); -define('pilot/stacktrace', ['require', 'exports', 'module' , 'pilot/useragent', 'pilot/console'], function(require, exports, module) { - -var ua = require("pilot/useragent"); -var console = require('pilot/console'); - -// Changed to suit the specific needs of running within Skywriter - -// Domain Public by Eric Wendelin http://eriwen.com/ (2008) -// Luke Smith http://lucassmith.name/ (2008) -// Loic Dachary (2008) -// Johan Euphrosine (2008) -// Øyvind Sean Kinsey http://kinsey.no/blog -// -// Information and discussions -// http://jspoker.pokersource.info/skin/test-printstacktrace.html -// http://eriwen.com/javascript/js-stack-trace/ -// http://eriwen.com/javascript/stacktrace-update/ -// http://pastie.org/253058 -// http://browsershots.org/http://jspoker.pokersource.info/skin/test-printstacktrace.html -// - -// -// guessFunctionNameFromLines comes from firebug -// -// Software License Agreement (BSD License) -// -// Copyright (c) 2007, Parakey Inc. -// All rights reserved. -// -// Redistribution and use of this software in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above -// copyright notice, this list of conditions and the -// following disclaimer. -// -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// * Neither the name of Parakey Inc. nor the names of its -// contributors may be used to endorse or promote products -// derived from this software without specific prior -// written permission of Parakey Inc. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -/** - * Different browsers create stack traces in different ways. - * Feature Browser detection baby ;). - */ -var mode = (function() { - - // We use SC's browser detection here to avoid the "break on error" - // functionality provided by Firebug. Firebug tries to do the right - // thing here and break, but it happens every time you load the page. - // bug 554105 - if (ua.isGecko) { - return 'firefox'; - } else if (ua.isOpera) { - return 'opera'; - } else { - return 'other'; - } - - // SC doesn't do any detection of Chrome at this time. - - // this is the original feature detection code that is used as a - // fallback. - try { - (0)(); - } catch (e) { - if (e.arguments) { - return 'chrome'; - } - if (e.stack) { - return 'firefox'; - } - if (window.opera && !('stacktrace' in e)) { //Opera 9- - return 'opera'; - } - } - return 'other'; -})(); - -/** - * - */ -function stringifyArguments(args) { - for (var i = 0; i < args.length; ++i) { - var argument = args[i]; - if (typeof argument == 'object') { - args[i] = '#object'; - } else if (typeof argument == 'function') { - args[i] = '#function'; - } else if (typeof argument == 'string') { - args[i] = '"' + argument + '"'; - } - } - return args.join(','); -} - -/** - * Extract a stack trace from the format emitted by each browser. - */ -var decoders = { - chrome: function(e) { - var stack = e.stack; - if (!stack) { - console.log(e); - return []; - } - return stack.replace(/^.*?\n/, ''). - replace(/^.*?\n/, ''). - replace(/^.*?\n/, ''). - replace(/^[^\(]+?[\n$]/gm, ''). - replace(/^\s+at\s+/gm, ''). - replace(/^Object.\s*\(/gm, '{anonymous}()@'). - split('\n'); - }, - - firefox: function(e) { - var stack = e.stack; - if (!stack) { - console.log(e); - return []; - } - // stack = stack.replace(/^.*?\n/, ''); - stack = stack.replace(/(?:\n@:0)?\s+$/m, ''); - stack = stack.replace(/^\(/gm, '{anonymous}('); - return stack.split('\n'); - }, - - // Opera 7.x and 8.x only! - opera: function(e) { - var lines = e.message.split('\n'), ANON = '{anonymous}', - lineRE = /Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i, i, j, len; - - for (i = 4, j = 0, len = lines.length; i < len; i += 2) { - if (lineRE.test(lines[i])) { - lines[j++] = (RegExp.$3 ? RegExp.$3 + '()@' + RegExp.$2 + RegExp.$1 : ANON + '()@' + RegExp.$2 + ':' + RegExp.$1) + - ' -- ' + - lines[i + 1].replace(/^\s+/, ''); - } - } - - lines.splice(j, lines.length - j); - return lines; - }, - - // Safari, Opera 9+, IE, and others - other: function(curr) { - var ANON = '{anonymous}', fnRE = /function\s*([\w\-$]+)?\s*\(/i, stack = [], j = 0, fn, args; - - var maxStackSize = 10; - while (curr && stack.length < maxStackSize) { - fn = fnRE.test(curr.toString()) ? RegExp.$1 || ANON : ANON; - args = Array.prototype.slice.call(curr['arguments']); - stack[j++] = fn + '(' + stringifyArguments(args) + ')'; - - //Opera bug: if curr.caller does not exist, Opera returns curr (WTF) - if (curr === curr.caller && window.opera) { - //TODO: check for same arguments if possible - break; - } - curr = curr.caller; - } - return stack; - } -}; - -/** - * - */ -function NameGuesser() { -} - -NameGuesser.prototype = { - - sourceCache: {}, - - ajax: function(url) { - var req = this.createXMLHTTPObject(); - if (!req) { - return; - } - req.open('GET', url, false); - req.setRequestHeader('User-Agent', 'XMLHTTP/1.0'); - req.send(''); - return req.responseText; - }, - - createXMLHTTPObject: function() { - // Try XHR methods in order and store XHR factory - var xmlhttp, XMLHttpFactories = [ - function() { - return new XMLHttpRequest(); - }, function() { - return new ActiveXObject('Msxml2.XMLHTTP'); - }, function() { - return new ActiveXObject('Msxml3.XMLHTTP'); - }, function() { - return new ActiveXObject('Microsoft.XMLHTTP'); - } - ]; - for (var i = 0; i < XMLHttpFactories.length; i++) { - try { - xmlhttp = XMLHttpFactories[i](); - // Use memoization to cache the factory - this.createXMLHTTPObject = XMLHttpFactories[i]; - return xmlhttp; - } catch (e) {} - } - }, - - getSource: function(url) { - if (!(url in this.sourceCache)) { - this.sourceCache[url] = this.ajax(url).split('\n'); - } - return this.sourceCache[url]; - }, - - guessFunctions: function(stack) { - for (var i = 0; i < stack.length; ++i) { - var reStack = /{anonymous}\(.*\)@(\w+:\/\/([-\w\.]+)+(:\d+)?[^:]+):(\d+):?(\d+)?/; - var frame = stack[i], m = reStack.exec(frame); - if (m) { - var file = m[1], lineno = m[4]; //m[7] is character position in Chrome - if (file && lineno) { - var functionName = this.guessFunctionName(file, lineno); - stack[i] = frame.replace('{anonymous}', functionName); - } - } - } - return stack; - }, - - guessFunctionName: function(url, lineNo) { - try { - return this.guessFunctionNameFromLines(lineNo, this.getSource(url)); - } catch (e) { - return 'getSource failed with url: ' + url + ', exception: ' + e.toString(); - } - }, - - guessFunctionNameFromLines: function(lineNo, source) { - var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/; - var reGuessFunction = /['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*(function|eval|new Function)/; - // Walk backwards from the first line in the function until we find the line which - // matches the pattern above, which is the function definition - var line = '', maxLines = 10; - for (var i = 0; i < maxLines; ++i) { - line = source[lineNo - i] + line; - if (line !== undefined) { - var m = reGuessFunction.exec(line); - if (m) { - return m[1]; - } - else { - m = reFunctionArgNames.exec(line); - } - if (m && m[1]) { - return m[1]; - } - } - } - return '(?)'; - } -}; - -var guesser = new NameGuesser(); - -var frameIgnorePatterns = [ - /http:\/\/localhost:4020\/sproutcore.js:/ -]; - -exports.ignoreFramesMatching = function(regex) { - frameIgnorePatterns.push(regex); -}; - -/** - * Create a stack trace from an exception - * @param ex {Error} The error to create a stacktrace from (optional) - * @param guess {Boolean} If we should try to resolve the names of anonymous functions - */ -exports.Trace = function Trace(ex, guess) { - this._ex = ex; - this._stack = decoders[mode](ex); - - if (guess) { - this._stack = guesser.guessFunctions(this._stack); - } -}; - -/** - * Log to the console a number of lines (default all of them) - * @param lines {number} Maximum number of lines to wrote to console - */ -exports.Trace.prototype.log = function(lines) { - if (lines <= 0) { - // You aren't going to have more lines in your stack trace than this - // and it still fits in a 32bit integer - lines = 999999999; - } - - var printed = 0; - for (var i = 0; i < this._stack.length && printed < lines; i++) { - var frame = this._stack[i]; - var display = true; - frameIgnorePatterns.forEach(function(regex) { - if (regex.test(frame)) { - display = false; - } - }); - if (display) { - console.debug(frame); - printed++; - } - } -}; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/useragent', ['require', 'exports', 'module' ], function(require, exports, module) { - -var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); -var ua = navigator.userAgent; -var av = navigator.appVersion; - -/** Is the user using a browser that identifies itself as Windows */ -exports.isWin = (os == "win"); - -/** Is the user using a browser that identifies itself as Mac OS */ -exports.isMac = (os == "mac"); - -/** Is the user using a browser that identifies itself as Linux */ -exports.isLinux = (os == "linux"); - -exports.isIE = ! + "\v1"; - -/** Is this Firefox or related? */ -exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko"; - -/** oldGecko == rev < 2.0 **/ -exports.isOldGecko = exports.isGecko && /rv\:1/.test(navigator.userAgent); - -/** Is this Opera */ -exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; - -/** Is the user using a browser that identifies itself as WebKit */ -exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; - -exports.isAIR = ua.indexOf("AdobeAIR") >= 0; - -exports.isIPad = ua.indexOf("iPad") >= 0; - -/** - * I hate doing this, but we need some way to determine if the user is on a Mac - * The reason is that users have different expectations of their key combinations. - * - * Take copy as an example, Mac people expect to use CMD or APPLE + C - * Windows folks expect to use CTRL + C - */ -exports.OS = { - LINUX: 'LINUX', - MAC: 'MAC', - WINDOWS: 'WINDOWS' -}; - -/** - * Return an exports.OS constant - */ -exports.getOS = function() { - if (exports.isMac) { - return exports.OS['MAC']; - } else if (exports.isLinux) { - return exports.OS['LINUX']; - } else { - return exports.OS['WINDOWS']; - } -}; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/oop', ['require', 'exports', 'module' ], function(require, exports, module) { - -exports.inherits = (function() { - var tempCtor = function() {}; - return function(ctor, superCtor) { - tempCtor.prototype = superCtor.prototype; - ctor.super_ = superCtor.prototype; - ctor.prototype = new tempCtor(); - ctor.prototype.constructor = ctor; - } -}()); - -exports.mixin = function(obj, mixin) { - for (var key in mixin) { - obj[key] = mixin[key]; - } -}; - -exports.implement = function(proto, mixin) { - exports.mixin(proto, mixin); -}; - -}); -/*! @license -========================================================================== -SproutCore -- JavaScript Application Framework -copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc. - -For more information about SproutCore, visit http://www.sproutcore.com - - -========================================================================== -@license */ - -// Most of the following code is taken from SproutCore with a few changes. - -define('pilot/keys', ['require', 'exports', 'module' , 'pilot/oop'], function(require, exports, module) { - -var oop = require("pilot/oop"); - -/** - * Helper functions and hashes for key handling. - */ -var Keys = (function() { - var ret = { - MODIFIER_KEYS: { - 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta' - }, - - KEY_MODS: { - "ctrl": 1, "alt": 2, "option" : 2, - "shift": 4, "meta": 8, "command": 8 - }, - - FUNCTION_KEYS : { - 8 : "Backspace", - 9 : "Tab", - 13 : "Return", - 19 : "Pause", - 27 : "Esc", - 32 : "Space", - 33 : "PageUp", - 34 : "PageDown", - 35 : "End", - 36 : "Home", - 37 : "Left", - 38 : "Up", - 39 : "Right", - 40 : "Down", - 44 : "Print", - 45 : "Insert", - 46 : "Delete", - 112: "F1", - 113: "F2", - 114: "F3", - 115: "F4", - 116: "F5", - 117: "F6", - 118: "F7", - 119: "F8", - 120: "F9", - 121: "F10", - 122: "F11", - 123: "F12", - 144: "Numlock", - 145: "Scrolllock" - }, - - PRINTABLE_KEYS: { - 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', - 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', - 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', - 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', - 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', - 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', - 188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\', - 221: ']', 222: '\"' - } - }; - - // A reverse map of FUNCTION_KEYS - for (i in ret.FUNCTION_KEYS) { - var name = ret.FUNCTION_KEYS[i].toUpperCase(); - ret[name] = parseInt(i, 10); - } - - // Add the MODIFIER_KEYS, FUNCTION_KEYS and PRINTABLE_KEYS to the KEY - // variables as well. - oop.mixin(ret, ret.MODIFIER_KEYS); - oop.mixin(ret, ret.PRINTABLE_KEYS); - oop.mixin(ret, ret.FUNCTION_KEYS); - - return ret; -})(); -oop.mixin(exports, Keys); - -exports.keyCodeToString = function(keyCode) { - return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); -} - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Irakli Gozalishvili (http://jeditoolkit.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { - -var EventEmitter = {}; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry = this._eventRegistry || {}; - - var listeners = this._eventRegistry[eventName]; - if (!listeners || !listeners.length) return; - - var e = e || {}; - e.type = eventName; - - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/lang', ['require', 'exports', 'module' ], function(require, exports, module) { - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; - -exports.stringRepeat = function (string, count) { - return new Array(count + 1).join(string); -}; - -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; - -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, '') -}; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); -}; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; -}; - -exports.copyArray = function(array){ - var copy = []; - for (i=0, l=array.length; i (http://jeditoolkit.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/settings', ['require', 'exports', 'module' , 'pilot/console', 'pilot/oop', 'pilot/types', 'pilot/event_emitter', 'pilot/catalog'], function(require, exports, module) { - -/** - * This plug-in manages settings. - */ - -var console = require('pilot/console'); -var oop = require('pilot/oop'); -var types = require('pilot/types'); -var EventEmitter = require('pilot/event_emitter').EventEmitter; -var catalog = require('pilot/catalog'); - -var settingExtensionSpec = { - name: 'setting', - description: 'A setting is something that the application offers as a ' + - 'way to customize how it works', - register: 'env.settings.addSetting', - indexOn: 'name' -}; - -exports.startup = function(data, reason) { - catalog.addExtensionSpec(settingExtensionSpec); -}; - -exports.shutdown = function(data, reason) { - catalog.removeExtensionSpec(settingExtensionSpec); -}; - - -/** - * Create a new setting. - * @param settingSpec An object literal that looks like this: - * { - * name: 'thing', - * description: 'Thing is an example setting', - * type: 'string', - * defaultValue: 'something' - * } - */ -function Setting(settingSpec, settings) { - this._settings = settings; - - Object.keys(settingSpec).forEach(function(key) { - this[key] = settingSpec[key]; - }, this); - - this.type = types.getType(this.type); - if (this.type == null) { - throw new Error('In ' + this.name + - ': can\'t find type for: ' + JSON.stringify(settingSpec.type)); - } - - if (!this.name) { - throw new Error('Setting.name == undefined. Ignoring.', this); - } - - if (!this.defaultValue === undefined) { - throw new Error('Setting.defaultValue == undefined', this); - } - - if (this.onChange) { - this.on('change', this.onChange.bind(this)) - } - - this.set(this.defaultValue); -} -Setting.prototype = { - get: function() { - return this.value; - }, - - set: function(value) { - if (this.value === value) { - return; - } - - this.value = value; - if (this._settings.persister) { - this._settings.persister.persistValue(this._settings, this.name, value); - } - - this._dispatchEvent('change', { setting: this, value: value }); - }, - - /** - * Reset the value of the key setting to it's default - */ - resetValue: function() { - this.set(this.defaultValue); - } -}; -oop.implement(Setting.prototype, EventEmitter); - - -/** - * A base class for all the various methods of storing settings. - *

Usage: - *

- * // Create manually, or require 'settings' from the container.
- * // This is the manual version:
- * var settings = plugins.catalog.getObject('settings');
- * // Add a new setting
- * settings.addSetting({ name:'foo', ... });
- * // Display the default value
- * alert(settings.get('foo'));
- * // Alter the value, which also publishes the change etc.
- * settings.set('foo', 'bar');
- * // Reset the value to the default
- * settings.resetValue('foo');
- * 
- * @constructor - */ -function Settings(persister) { - // Storage for deactivated values - this._deactivated = {}; - - // Storage for the active settings - this._settings = {}; - // We often want sorted setting names. Cache - this._settingNames = []; - - if (persister) { - this.setPersister(persister); - } -}; - -Settings.prototype = { - /** - * Function to add to the list of available settings. - *

Example usage: - *

-     * var settings = plugins.catalog.getObject('settings');
-     * settings.addSetting({
-     *     name: 'tabsize', // For use in settings.get('X')
-     *     type: 'number',  // To allow value checking.
-     *     defaultValue: 4  // Default value for use when none is directly set
-     * });
-     * 
- * @param {object} settingSpec Object containing name/type/defaultValue members. - */ - addSetting: function(settingSpec) { - var setting = new Setting(settingSpec, this); - this._settings[setting.name] = setting; - this._settingNames.push(setting.name); - this._settingNames.sort(); - }, - - addSettings: function addSettings(settings) { - Object.keys(settings).forEach(function (name) { - var setting = settings[name]; - if (!('name' in setting)) setting.name = name; - this.addSetting(setting); - }, this); - }, - - removeSetting: function(setting) { - var name = (typeof setting === 'string' ? setting : setting.name); - setting = this._settings[name]; - delete this._settings[name]; - util.arrayRemove(this._settingNames, name); - settings.removeAllListeners('change'); - }, - - removeSettings: function removeSettings(settings) { - Object.keys(settings).forEach(function(name) { - var setting = settings[name]; - if (!('name' in setting)) setting.name = name; - this.removeSettings(setting); - }, this); - }, - - getSettingNames: function() { - return this._settingNames; - }, - - getSetting: function(name) { - return this._settings[name]; - }, - - /** - * A Persister is able to store settings. It is an object that defines - * two functions: - * loadInitialValues(settings) and persistValue(settings, key, value). - */ - setPersister: function(persister) { - this._persister = persister; - if (persister) { - persister.loadInitialValues(this); - } - }, - - resetAll: function() { - this.getSettingNames().forEach(function(key) { - this.resetValue(key); - }, this); - }, - - /** - * Retrieve a list of the known settings and their values - */ - _list: function() { - var reply = []; - this.getSettingNames().forEach(function(setting) { - reply.push({ - 'key': setting, - 'value': this.getSetting(setting).get() - }); - }, this); - return reply; - }, - - /** - * Prime the local cache with the defaults. - */ - _loadDefaultValues: function() { - this._loadFromObject(this._getDefaultValues()); - }, - - /** - * Utility to load settings from an object - */ - _loadFromObject: function(data) { - // We iterate over data rather than keys so we don't forget values - // which don't have a setting yet. - for (var key in data) { - if (data.hasOwnProperty(key)) { - var setting = this._settings[key]; - if (setting) { - var value = setting.type.parse(data[key]); - this.set(key, value); - } else { - this.set(key, data[key]); - } - } - } - }, - - /** - * Utility to grab all the settings and export them into an object - */ - _saveToObject: function() { - return this.getSettingNames().map(function(key) { - return this._settings[key].type.stringify(this.get(key)); - }.bind(this)); - }, - - /** - * The default initial settings - */ - _getDefaultValues: function() { - return this.getSettingNames().map(function(key) { - return this._settings[key].spec.defaultValue; - }.bind(this)); - } -}; -exports.settings = new Settings(); - -/** - * Save the settings in a cookie - * This code has not been tested since reboot - * @constructor - */ -function CookiePersister() { -}; - -CookiePersister.prototype = { - loadInitialValues: function(settings) { - settings._loadDefaultValues(); - var data = cookie.get('settings'); - settings._loadFromObject(JSON.parse(data)); - }, - - persistValue: function(settings, key, value) { - try { - var stringData = JSON.stringify(settings._saveToObject()); - cookie.set('settings', stringData); - } catch (ex) { - console.error('Unable to JSONify the settings! ' + ex); - return; - } - } -}; - -exports.CookiePersister = CookiePersister; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Skywriter Team (skywriter@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/commands/settings', ['require', 'exports', 'module' , 'pilot/canon'], function(require, exports, module) { - - -var setCommandSpec = { - name: 'set', - params: [ - { - name: 'setting', - type: 'setting', - description: 'The name of the setting to display or alter', - defaultValue: null - }, - { - name: 'value', - type: 'settingValue', - description: 'The new value for the chosen setting', - defaultValue: null - } - ], - description: 'define and show settings', - exec: function(env, args, request) { - var html; - if (!args.setting) { - // 'set' by itself lists all the settings - var names = env.settings.getSettingNames(); - html = ''; - // first sort the settingsList based on the name - names.sort(function(name1, name2) { - return name1.localeCompare(name2); - }); - - names.forEach(function(name) { - var setting = env.settings.getSetting(name); - var url = 'https://wiki.mozilla.org/Labs/Skywriter/Settings#' + - setting.name; - html += '' + - setting.name + - ' = ' + - setting.value + - '
'; - }); - } else { - // set with only a setting, shows the value for that setting - if (args.value === undefined) { - html = '' + setting.name + ' = ' + - setting.get(); - } else { - // Actually change the setting - args.setting.set(args.value); - html = 'Setting: ' + args.setting.name + ' = ' + - args.setting.get(); - } - } - request.done(html); - } -}; - -var unsetCommandSpec = { - name: 'unset', - params: [ - { - name: 'setting', - type: 'setting', - description: 'The name of the setting to return to defaults' - } - ], - description: 'unset a setting entirely', - exec: function(env, args, request) { - var setting = env.settings.get(args.setting); - if (!setting) { - request.doneWithError('No setting with the name ' + - args.setting + '.'); - return; - } - - setting.reset(); - request.done('Reset ' + setting.name + ' to default: ' + - env.settings.get(args.setting)); - } -}; - -var canon = require('pilot/canon'); - -exports.startup = function(data, reason) { - canon.addCommand(setCommandSpec); - canon.addCommand(unsetCommandSpec); -}; - -exports.shutdown = function(data, reason) { - canon.removeCommand(setCommandSpec); - canon.removeCommand(unsetCommandSpec); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Skywriter Team (skywriter@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/commands/basic', ['require', 'exports', 'module' , 'pilot/typecheck', 'pilot/canon'], function(require, exports, module) { - - -var checks = require("pilot/typecheck"); -var canon = require('pilot/canon'); - -/** - * - */ -var helpMessages = { - plainPrefix: - '

Welcome to Skywriter - Code in the Cloud

', - plainSuffix: - 'For more information, see the Skywriter Wiki.' -}; - -/** - * 'help' command - */ -var helpCommandSpec = { - name: 'help', - params: [ - { - name: 'search', - type: 'text', - description: 'Search string to narrow the output.', - defaultValue: null - } - ], - description: 'Get help on the available commands.', - exec: function(env, args, request) { - var output = []; - - var command = canon.getCommand(args.search); - if (command && command.exec) { - // caught a real command - output.push(command.description ? - command.description : - 'No description for ' + args.search); - } else { - var showHidden = false; - - if (!args.search && helpMessages.plainPrefix) { - output.push(helpMessages.plainPrefix); - } - - if (command) { - // We must be looking at sub-commands - output.push('

Sub-Commands of ' + command.name + '

'); - output.push('

' + command.description + '

'); - } - else if (args.search) { - if (args.search == 'hidden') { // sneaky, sneaky. - args.search = ''; - showHidden = true; - } - output.push('

Commands starting with \'' + args.search + '\':

'); - } - else { - output.push('

Available Commands:

'); - } - - var commandNames = canon.getCommandNames(); - commandNames.sort(); - - output.push(''); - for (var i = 0; i < commandNames.length; i++) { - command = canon.getCommand(commandNames[i]); - if (!showHidden && command.hidden) { - continue; - } - if (command.description === undefined) { - // Ignore editor actions - continue; - } - if (args.search && command.name.indexOf(args.search) !== 0) { - // Filtered out by the user - continue; - } - if (!args.search && command.name.indexOf(' ') != -1) { - // sub command - continue; - } - if (command && command.name == args.search) { - // sub command, and we've already given that help - continue; - } - - // todo add back a column with parameter information, perhaps? - - output.push(''); - output.push(''); - output.push(''); - output.push(''); - } - output.push('
' + command.name + '' + command.description + '
'); - - if (!args.search && helpMessages.plainSuffix) { - output.push(helpMessages.plainSuffix); - } - } - - request.done(output.join('')); - } -}; - -/** - * 'eval' command - */ -var evalCommandSpec = { - name: 'eval', - params: [ - { - name: 'javascript', - type: 'text', - description: 'The JavaScript to evaluate' - } - ], - description: 'evals given js code and show the result', - hidden: true, - exec: function(env, args, request) { - var result; - var javascript = args.javascript; - try { - result = eval(javascript); - } catch (e) { - result = 'Error: ' + e.message + ''; - } - - var msg = ''; - var type = ''; - var x; - - if (checks.isFunction(result)) { - // converts the function to a well formated string - msg = (result + '').replace(/\n/g, '
').replace(/ /g, ' '); - type = 'function'; - } else if (checks.isObject(result)) { - if (Array.isArray(result)) { - type = 'array'; - } else { - type = 'object'; - } - - var items = []; - var value; - - for (x in result) { - if (result.hasOwnProperty(x)) { - if (checks.isFunction(result[x])) { - value = '[function]'; - } else if (checks.isObject(result[x])) { - value = '[object]'; - } else { - value = result[x]; - } - - items.push({name: x, value: value}); - } - } - - items.sort(function(a,b) { - return (a.name.toLowerCase() < b.name.toLowerCase()) ? -1 : 1; - }); - - for (x = 0; x < items.length; x++) { - msg += '' + items[x].name + ': ' + items[x].value + '
'; - } - - } else { - msg = result; - type = typeof result; - } - - request.done('Result for eval \'' + javascript + '\'' + - ' (type: '+ type+'):

'+ msg); - } -}; - -/** - * 'version' command - */ -var versionCommandSpec = { - name: 'version', - description: 'show the Skywriter version', - hidden: true, - exec: function(env, args, request) { - var version = 'Skywriter ' + skywriter.versionNumber + ' (' + - skywriter.versionCodename + ')'; - request.done(version); - } -}; - -/** - * 'skywriter' command - */ -var skywriterCommandSpec = { - name: 'skywriter', - hidden: true, - exec: function(env, args, request) { - var index = Math.floor(Math.random() * messages.length); - request.done('Skywriter ' + messages[index]); - } -}; -var messages = [ - 'really wants you to trick it out in some way.', - 'is your Web editor.', - 'would love to be like Emacs on the Web.', - 'is written on the Web platform, so you can tweak it.' -]; - - -var canon = require('pilot/canon'); - -exports.startup = function(data, reason) { - canon.addCommand(helpCommandSpec); - canon.addCommand(evalCommandSpec); - // canon.addCommand(versionCommandSpec); - canon.addCommand(skywriterCommandSpec); -}; - -exports.shutdown = function(data, reason) { - canon.removeCommand(helpCommandSpec); - canon.removeCommand(evalCommandSpec); - // canon.removeCommand(versionCommandSpec); - canon.removeCommand(skywriterCommandSpec); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/settings/canon', ['require', 'exports', 'module' ], function(require, exports, module) { - - -var historyLengthSetting = { - name: "historyLength", - description: "How many typed commands do we recall for reference?", - type: "number", - defaultValue: 50 -}; - -exports.startup = function(data, reason) { - data.env.settings.addSetting(historyLengthSetting); -}; - -exports.shutdown = function(data, reason) { - data.env.settings.removeSetting(historyLengthSetting); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/plugin_manager', ['require', 'exports', 'module' , 'pilot/promise'], function(require, exports, module) { - -var Promise = require("pilot/promise").Promise; - -exports.REASONS = { - APP_STARTUP: 1, - APP_SHUTDOWN: 2, - PLUGIN_ENABLE: 3, - PLUGIN_DISABLE: 4, - PLUGIN_INSTALL: 5, - PLUGIN_UNINSTALL: 6, - PLUGIN_UPGRADE: 7, - PLUGIN_DOWNGRADE: 8 -}; - -exports.Plugin = function(name) { - this.name = name; - this.status = this.INSTALLED; -}; - -exports.Plugin.prototype = { - /** - * constants for the state - */ - NEW: 0, - INSTALLED: 1, - REGISTERED: 2, - STARTED: 3, - UNREGISTERED: 4, - SHUTDOWN: 5, - - install: function(data, reason) { - var pr = new Promise(); - if (this.status > this.NEW) { - pr.resolve(this); - return pr; - } - require([this.name], function(pluginModule) { - if (pluginModule.install) { - pluginModule.install(data, reason); - } - this.status = this.INSTALLED; - pr.resolve(this); - }.bind(this)); - return pr; - }, - - register: function(data, reason) { - var pr = new Promise(); - if (this.status != this.INSTALLED) { - pr.resolve(this); - return pr; - } - require([this.name], function(pluginModule) { - if (pluginModule.register) { - pluginModule.register(data, reason); - } - this.status = this.REGISTERED; - pr.resolve(this); - }.bind(this)); - return pr; - }, - - startup: function(data, reason) { - reason = reason || exports.REASONS.APP_STARTUP; - var pr = new Promise(); - if (this.status != this.REGISTERED) { - pr.resolve(this); - return pr; - } - require([this.name], function(pluginModule) { - if (pluginModule.startup) { - pluginModule.startup(data, reason); - } - this.status = this.STARTED; - pr.resolve(this); - }.bind(this)); - return pr; - }, - - shutdown: function(data, reason) { - if (this.status != this.STARTED) { - return; - } - pluginModule = require(this.name); - if (pluginModule.shutdown) { - pluginModule.shutdown(data, reason); - } - } -}; - -exports.PluginCatalog = function() { - this.plugins = {}; -}; - -exports.PluginCatalog.prototype = { - registerPlugins: function(pluginList, data, reason) { - var registrationPromises = []; - pluginList.forEach(function(pluginName) { - var plugin = this.plugins[pluginName]; - if (plugin === undefined) { - plugin = new exports.Plugin(pluginName); - this.plugins[pluginName] = plugin; - registrationPromises.push(plugin.register(data, reason)); - } - }.bind(this)); - return Promise.group(registrationPromises); - }, - - startupPlugins: function(data, reason) { - var startupPromises = []; - for (var pluginName in this.plugins) { - var plugin = this.plugins[pluginName]; - startupPromises.push(plugin.startup(data, reason)); - } - return Promise.group(startupPromises); - } -}; - -exports.catalog = new exports.PluginCatalog(); - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/promise', ['require', 'exports', 'module' , 'pilot/console', 'pilot/stacktrace'], function(require, exports, module) { - -var console = require("pilot/console"); -var Trace = require('pilot/stacktrace').Trace; - -/** - * A promise can be in one of 2 states. - * The ERROR and SUCCESS states are terminal, the PENDING state is the only - * start state. - */ -var ERROR = -1; -var PENDING = 0; -var SUCCESS = 1; - -/** - * We give promises and ID so we can track which are outstanding - */ -var _nextId = 0; - -/** - * Debugging help if 2 things try to complete the same promise. - * This can be slow (especially on chrome due to the stack trace unwinding) so - * we should leave this turned off in normal use. - */ -var _traceCompletion = false; - -/** - * Outstanding promises. Handy list for debugging only. - */ -var _outstanding = []; - -/** - * Recently resolved promises. Also for debugging only. - */ -var _recent = []; - -/** - * Create an unfulfilled promise - */ -Promise = function () { - this._status = PENDING; - this._value = undefined; - this._onSuccessHandlers = []; - this._onErrorHandlers = []; - - // Debugging help - this._id = _nextId++; - //this._createTrace = new Trace(new Error()); - _outstanding[this._id] = this; -}; - -/** - * Yeay for RTTI. - */ -Promise.prototype.isPromise = true; - -/** - * Have we either been resolve()ed or reject()ed? - */ -Promise.prototype.isComplete = function() { - return this._status != PENDING; -}; - -/** - * Have we resolve()ed? - */ -Promise.prototype.isResolved = function() { - return this._status == SUCCESS; -}; - -/** - * Have we reject()ed? - */ -Promise.prototype.isRejected = function() { - return this._status == ERROR; -}; - -/** - * Take the specified action of fulfillment of a promise, and (optionally) - * a different action on promise rejection. - */ -Promise.prototype.then = function(onSuccess, onError) { - if (typeof onSuccess === 'function') { - if (this._status === SUCCESS) { - onSuccess.call(null, this._value); - } else if (this._status === PENDING) { - this._onSuccessHandlers.push(onSuccess); - } - } - - if (typeof onError === 'function') { - if (this._status === ERROR) { - onError.call(null, this._value); - } else if (this._status === PENDING) { - this._onErrorHandlers.push(onError); - } - } - - return this; -}; - -/** - * Like then() except that rather than returning this we return - * a promise which - */ -Promise.prototype.chainPromise = function(onSuccess) { - var chain = new Promise(); - chain._chainedFrom = this; - this.then(function(data) { - try { - chain.resolve(onSuccess(data)); - } catch (ex) { - chain.reject(ex); - } - }, function(ex) { - chain.reject(ex); - }); - return chain; -}; - -/** - * Supply the fulfillment of a promise - */ -Promise.prototype.resolve = function(data) { - return this._complete(this._onSuccessHandlers, SUCCESS, data, 'resolve'); -}; - -/** - * Renege on a promise - */ -Promise.prototype.reject = function(data) { - return this._complete(this._onErrorHandlers, ERROR, data, 'reject'); -}; - -/** - * Internal method to be called on resolve() or reject(). - * @private - */ -Promise.prototype._complete = function(list, status, data, name) { - // Complain if we've already been completed - if (this._status != PENDING) { - console.group('Promise already closed'); - console.error('Attempted ' + name + '() with ', data); - console.error('Previous status = ', this._status, - ', previous value = ', this._value); - console.trace(); - - if (this._completeTrace) { - console.error('Trace of previous completion:'); - this._completeTrace.log(5); - } - console.groupEnd(); - return this; - } - - if (_traceCompletion) { - this._completeTrace = new Trace(new Error()); - } - - this._status = status; - this._value = data; - - // Call all the handlers, and then delete them - list.forEach(function(handler) { - handler.call(null, this._value); - }, this); - this._onSuccessHandlers.length = 0; - this._onErrorHandlers.length = 0; - - // Remove the given {promise} from the _outstanding list, and add it to the - // _recent list, pruning more than 20 recent promises from that list. - delete _outstanding[this._id]; - _recent.push(this); - while (_recent.length > 20) { - _recent.shift(); - } - - return this; -}; - -/** - * Takes an array of promises and returns a promise that that is fulfilled once - * all the promises in the array are fulfilled - * @param group The array of promises - * @return the promise that is fulfilled when all the array is fulfilled - */ -Promise.group = function(promiseList) { - if (!(promiseList instanceof Array)) { - promiseList = Array.prototype.slice.call(arguments); - } - - // If the original array has nothing in it, return now to avoid waiting - if (promiseList.length === 0) { - return new Promise().resolve([]); - } - - var groupPromise = new Promise(); - var results = []; - var fulfilled = 0; - - var onSuccessFactory = function(index) { - return function(data) { - results[index] = data; - fulfilled++; - // If the group has already failed, silently drop extra results - if (groupPromise._status !== ERROR) { - if (fulfilled === promiseList.length) { - groupPromise.resolve(results); - } - } - }; - }; - - promiseList.forEach(function(promise, index) { - var onSuccess = onSuccessFactory(index); - var onError = groupPromise.reject.bind(groupPromise); - promise.then(onSuccess, onError); - }); - - return groupPromise; -}; - -exports.Promise = Promise; -exports._outstanding = _outstanding; -exports._recent = _recent; - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/dom', ['require', 'exports', 'module' ], function(require, exports, module) { - -var XHTML_NS = "http://www.w3.org/1999/xhtml"; - -exports.createElement = function(tag, ns) { - return document.createElementNS ? - document.createElementNS(ns || XHTML_NS, tag) : - document.createElement(tag); -}; - -exports.setText = function(elem, text) { - if (elem.innerText !== undefined) { - elem.innerText = text; - } - if (elem.textContent !== undefined) { - elem.textContent = text; - } -}; - -if (!document.documentElement.classList) { - exports.hasCssClass = function(el, name) { - var classes = el.className.split(/\s+/g); - return classes.indexOf(name) !== -1; - }; - - /** - * Add a CSS class to the list of classes on the given node - */ - exports.addCssClass = function(el, name) { - if (!exports.hasCssClass(el, name)) { - el.className += " " + name; - } - }; - - /** - * Remove a CSS class from the list of classes on the given node - */ - exports.removeCssClass = function(el, name) { - var classes = el.className.split(/\s+/g); - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - classes.splice(index, 1); - } - el.className = classes.join(" "); - }; - - exports.toggleCssClass = function(el, name) { - var classes = el.className.split(/\s+/g), add = true; - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - add = false; - classes.splice(index, 1); - } - if(add) - classes.push(name); - - el.className = classes.join(" "); - return add; - }; -} else { - exports.hasCssClass = function(el, name) { - return el.classList.contains(name); - }; - - exports.addCssClass = function(el, name) { - el.classList.add(name); - }; - - exports.removeCssClass = function(el, name) { - el.classList.remove(name); - }; - - exports.toggleCssClass = function(el, name) { - return el.classList.toggle(name); - }; -} - -/** - * Add or remove a CSS class from the list of classes on the given node - * depending on the value of include - */ -exports.setCssClass = function(node, className, include) { - if (include) { - exports.addCssClass(node, className); - } else { - exports.removeCssClass(node, className); - } -}; - -exports.importCssString = function(cssText, doc){ - doc = doc || document; - - if (doc.createStyleSheet) { - var sheet = doc.createStyleSheet(); - sheet.cssText = cssText; - } - else { - var style = doc.createElementNS ? - doc.createElementNS(XHTML_NS, "style") : - doc.createElement("style"); - - style.appendChild(doc.createTextNode(cssText)); - - var head = doc.getElementsByTagName("head")[0] || doc.documentElement; - head.appendChild(style); - } -}; - -exports.getInnerWidth = function(element) { - return (parseInt(exports.computedStyle(element, "paddingLeft")) - + parseInt(exports.computedStyle(element, "paddingRight")) + element.clientWidth); -}; - -exports.getInnerHeight = function(element) { - return (parseInt(exports.computedStyle(element, "paddingTop")) - + parseInt(exports.computedStyle(element, "paddingBottom")) + element.clientHeight); -}; - -if (window.pageYOffset !== undefined) { - exports.getPageScrollTop = function() { - return window.pageYOffset; - }; - - exports.getPageScrollLeft = function() { - return window.pageXOffset; - }; -} -else { - exports.getPageScrollTop = function() { - return document.body.scrollTop; - }; - - exports.getPageScrollLeft = function() { - return document.body.scrollLeft; - }; -} - -if (window.getComputedStyle) - exports.computedStyle = function(element, style) { - if (style) - return (window.getComputedStyle(element, "") || {})[style] || ""; - return window.getComputedStyle(element, "") || {} - }; -else - exports.computedStyle = function(element, style) { - if (style) - return element.currentStyle[style]; - return element.currentStyle - }; - -exports.scrollbarWidth = function() { - - var inner = exports.createElement("p"); - inner.style.width = "100%"; - inner.style.height = "200px"; - - var outer = exports.createElement("div"); - var style = outer.style; - - style.position = "absolute"; - style.left = "-10000px"; - style.overflow = "hidden"; - style.width = "200px"; - style.height = "150px"; - - outer.appendChild(inner); - - var body = document.body || document.documentElement; - body.appendChild(outer); - - var noScrollbar = inner.offsetWidth; - - style.overflow = "scroll"; - var withScrollbar = inner.offsetWidth; - - if (noScrollbar == withScrollbar) { - withScrollbar = outer.clientWidth; - } - - body.removeChild(outer); - - return noScrollbar-withScrollbar; -}; - -/** - * Optimized set innerHTML. This is faster than plain innerHTML if the element - * already contains a lot of child elements. - * - * See http://blog.stevenlevithan.com/archives/faster-than-innerhtml for details - */ -exports.setInnerHtml = function(el, innerHtml) { - var element = el.cloneNode(false);//document.createElement("div"); - element.innerHTML = innerHtml; - el.parentNode.replaceChild(element, el); - return element; -}; - -exports.setInnerText = function(el, innerText) { - if (document.body && "textContent" in document.body) - el.textContent = innerText; - else - el.innerText = innerText; - -}; - -exports.getInnerText = function(el) { - if (document.body && "textContent" in document.body) - return el.textContent; - else - return el.innerText || el.textContent || ""; -}; - -exports.getParentWindow = function(document) { - return document.defaultView || document.parentWindow; -}; - -exports.getSelectionStart = function(textarea) { - // TODO IE - var start; - try { - start = textarea.selectionStart || 0; - } catch (e) { - start = 0; - } - return start; -}; - -exports.setSelectionStart = function(textarea, start) { - // TODO IE - return textarea.selectionStart = start; -}; - -exports.getSelectionEnd = function(textarea) { - // TODO IE - var end; - try { - end = textarea.selectionEnd || 0; - } catch (e) { - end = 0; - } - return end; -}; - -exports.setSelectionEnd = function(textarea, end) { - // TODO IE - return textarea.selectionEnd = end; -}; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/event', ['require', 'exports', 'module' , 'pilot/keys', 'pilot/useragent', 'pilot/dom'], function(require, exports, module) { - -var keys = require("pilot/keys"); -var useragent = require("pilot/useragent"); -var dom = require("pilot/dom"); - -exports.addListener = function(elem, type, callback) { - if (elem.addEventListener) { - return elem.addEventListener(type, callback, false); - } - if (elem.attachEvent) { - var wrapper = function() { - callback(window.event); - }; - callback._wrapper = wrapper; - elem.attachEvent("on" + type, wrapper); - } -}; - -exports.removeListener = function(elem, type, callback) { - if (elem.removeEventListener) { - return elem.removeEventListener(type, callback, false); - } - if (elem.detachEvent) { - elem.detachEvent("on" + type, callback._wrapper || callback); - } -}; - -/** -* Prevents propagation and clobbers the default action of the passed event -*/ -exports.stopEvent = function(e) { - exports.stopPropagation(e); - exports.preventDefault(e); - return false; -}; - -exports.stopPropagation = function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; -}; - -exports.preventDefault = function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; -}; - -exports.getDocumentX = function(e) { - if (e.clientX) { - return e.clientX + dom.getPageScrollLeft(); - } else { - return e.pageX; - } -}; - -exports.getDocumentY = function(e) { - if (e.clientY) { - return e.clientY + dom.getPageScrollTop(); - } else { - return e.pageY; - } -}; - -/** - * @return {Number} 0 for left button, 1 for middle button, 2 for right button - */ -exports.getButton = function(e) { - if (e.type == "dblclick") - return 0; - else if (e.type == "contextmenu") - return 2; - - // DOM Event - if (e.preventDefault) { - return e.button; - } - // old IE - else { - return {1:0, 2:2, 4:1}[e.button]; - } -}; - -if (document.documentElement.setCapture) { - exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseMove(e) { - eventHandler(e); - return exports.stopPropagation(e); - } - - function onReleaseCapture(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(); - - exports.removeListener(el, "mousemove", eventHandler); - exports.removeListener(el, "mouseup", onReleaseCapture); - exports.removeListener(el, "losecapture", onReleaseCapture); - - el.releaseCapture(); - } - - exports.addListener(el, "mousemove", eventHandler); - exports.addListener(el, "mouseup", onReleaseCapture); - exports.addListener(el, "losecapture", onReleaseCapture); - el.setCapture(); - }; -} -else { - exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseMove(e) { - eventHandler(e); - e.stopPropagation(); - } - - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(); - - document.removeEventListener("mousemove", onMouseMove, true); - document.removeEventListener("mouseup", onMouseUp, true); - - e.stopPropagation(); - } - - document.addEventListener("mousemove", onMouseMove, true); - document.addEventListener("mouseup", onMouseUp, true); - }; -} - -exports.addMouseWheelListener = function(el, callback) { - var listener = function(e) { - if (e.wheelDelta !== undefined) { - if (e.wheelDeltaX !== undefined) { - e.wheelX = -e.wheelDeltaX / 8; - e.wheelY = -e.wheelDeltaY / 8; - } else { - e.wheelX = 0; - e.wheelY = -e.wheelDelta / 8; - } - } - else { - if (e.axis && e.axis == e.HORIZONTAL_AXIS) { - e.wheelX = (e.detail || 0) * 5; - e.wheelY = 0; - } else { - e.wheelX = 0; - e.wheelY = (e.detail || 0) * 5; - } - } - callback(e); - }; - exports.addListener(el, "DOMMouseScroll", listener); - exports.addListener(el, "mousewheel", listener); -}; - -exports.addMultiMouseDownListener = function(el, button, count, timeout, callback) { - var clicks = 0; - var startX, startY; - - var listener = function(e) { - clicks += 1; - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - - setTimeout(function() { - clicks = 0; - }, timeout || 600); - } - - var isButton = exports.getButton(e) == button; - if (!isButton || Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5) - clicks = 0; - - if (clicks == count) { - clicks = 0; - callback(e); - } - - if (isButton) - return exports.preventDefault(e); - }; - - exports.addListener(el, "mousedown", listener); - useragent.isIE && exports.addListener(el, "dblclick", listener); -}; - -function normalizeCommandKeys(callback, e, keyCode) { - var hashId = 0; - if (useragent.isOpera && useragent.isMac) { - hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) - | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); - } else { - hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) - | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); - } - - if (keyCode in keys.MODIFIER_KEYS) { - switch (keys.MODIFIER_KEYS[keyCode]) { - case "Alt": - hashId = 2; - break; - case "Shift": - hashId = 4; - break - case "Ctrl": - hashId = 1; - break; - default: - hashId = 8; - break; - } - keyCode = 0; - } - - if (hashId & 8 && (keyCode == 91 || keyCode == 93)) { - keyCode = 0; - } - - // If there is no hashID and the keyCode is not a function key, then - // we don't call the callback as we don't handle a command key here - // (it's a normal key/character input). - if (hashId == 0 && !(keyCode in keys.FUNCTION_KEYS)) { - return false; - } - - return callback(e, hashId, keyCode); -} - -exports.addCommandKeyListener = function(el, callback) { - var addListener = exports.addListener; - if (useragent.isOldGecko) { - // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown - // event if the user pressed the key for a longer time. Instead, the - // keydown event was fired once and later on only the keypress event. - // To emulate the 'right' keydown behavior, the keyCode of the initial - // keyDown event is stored and in the following keypress events the - // stores keyCode is used to emulate a keyDown event. - var lastKeyDownKeyCode = null; - addListener(el, "keydown", function(e) { - lastKeyDownKeyCode = e.keyCode; - }); - addListener(el, "keypress", function(e) { - return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); - }); - } else { - var lastDown = null; - - addListener(el, "keydown", function(e) { - lastDown = e.keyIdentifier || e.keyCode; - return normalizeCommandKeys(callback, e, e.keyCode); - }); - - // repeated keys are fired as keypress and not keydown events - if (useragent.isMac && useragent.isOpera) { - addListener(el, "keypress", function(e) { - var keyId = e.keyIdentifier || e.keyCode; - if (lastDown !== keyId) { - return normalizeCommandKeys(callback, e, e.keyCode); - } else { - lastDown = null; - } - }); - } - } -}; - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Irakli Gozalishvili (http://jeditoolkit.com) - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/editor', ['require', 'exports', 'module' , 'pilot/fixoldbrowsers', 'pilot/oop', 'pilot/event', 'pilot/lang', 'pilot/useragent', 'ace/keyboard/textinput', 'ace/mouse_handler', 'ace/keyboard/keybinding', 'ace/edit_session', 'ace/search', 'ace/range', 'pilot/event_emitter'], function(require, exports, module) { - -require("pilot/fixoldbrowsers"); - -var oop = require("pilot/oop"); -var event = require("pilot/event"); -var lang = require("pilot/lang"); -var useragent = require("pilot/useragent"); -var TextInput = require("ace/keyboard/textinput").TextInput; -var MouseHandler = require("ace/mouse_handler").MouseHandler; -//var TouchHandler = require("ace/touch_handler").TouchHandler; -var KeyBinding = require("ace/keyboard/keybinding").KeyBinding; -var EditSession = require("ace/edit_session").EditSession; -var Search = require("ace/search").Search; -var Range = require("ace/range").Range; -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -var Editor =function(renderer, session) { - var container = renderer.getContainerElement(); - this.container = container; - this.renderer = renderer; - - this.textInput = new TextInput(renderer.getTextAreaContainer(), this); - this.keyBinding = new KeyBinding(this); - - // TODO detect touch event support - if (useragent.isIPad) { - //this.$mouseHandler = new TouchHandler(this); - } else { - this.$mouseHandler = new MouseHandler(this); - } - - this.$blockScrolling = 0; - this.$search = new Search().set({ - wrap: true - }); - - this.setSession(session || new EditSession("")); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$forwardEvents = { - gutterclick: 1, - gutterdblclick: 1 - }; - - this.$originalAddEventListener = this.addEventListener; - this.$originalRemoveEventListener = this.removeEventListener; - - this.addEventListener = function(eventName, callback) { - if (this.$forwardEvents[eventName]) { - return this.renderer.addEventListener(eventName, callback); - } else { - return this.$originalAddEventListener(eventName, callback); - } - }; - - this.removeEventListener = function(eventName, callback) { - if (this.$forwardEvents[eventName]) { - return this.renderer.removeEventListener(eventName, callback); - } else { - return this.$originalRemoveEventListener(eventName, callback); - } - }; - - this.setKeyboardHandler = function(keyboardHandler) { - this.keyBinding.setKeyboardHandler(keyboardHandler); - }; - - this.getKeyboardHandler = function() { - return this.keyBinding.getKeyboardHandler(); - }; - - this.setSession = function(session) { - if (this.session == session) return; - - if (this.session) { - var oldSession = this.session; - this.session.removeEventListener("change", this.$onDocumentChange); - this.session.removeEventListener("changeMode", this.$onChangeMode); - this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - this.session.removeEventListener("changeTabSize", this.$onChangeTabSize); - this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit); - this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode); - this.session.removeEventListener("onChangeFold", this.$onChangeFold); - this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker); - this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker); - this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint); - this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); - this.session.removeEventListener("changeOverwrite", this.$onCursorChange); - - var selection = this.session.getSelection(); - selection.removeEventListener("changeCursor", this.$onCursorChange); - selection.removeEventListener("changeSelection", this.$onSelectionChange); - - this.session.setScrollTopRow(this.renderer.getScrollTopRow()); - } - - this.session = session; - - this.$onDocumentChange = this.onDocumentChange.bind(this); - session.addEventListener("change", this.$onDocumentChange); - this.renderer.setSession(session); - - this.$onChangeMode = this.onChangeMode.bind(this); - session.addEventListener("changeMode", this.$onChangeMode); - - this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); - session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); - - this.$onChangeTabSize = this.renderer.updateText.bind(this.renderer); - session.addEventListener("changeTabSize", this.$onChangeTabSize); - - this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); - session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); - - this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); - session.addEventListener("changeWrapMode", this.$onChangeWrapMode); - - this.$onChangeFold = this.onChangeFold.bind(this); - session.addEventListener("changeFold", this.$onChangeFold); - - this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); - this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); - - this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); - this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); - - this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); - this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); - - this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); - this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); - - this.$onCursorChange = this.onCursorChange.bind(this); - this.session.addEventListener("changeOverwrite", this.$onCursorChange); - - this.selection = session.getSelection(); - this.selection.addEventListener("changeCursor", this.$onCursorChange); - - this.$onSelectionChange = this.onSelectionChange.bind(this); - this.selection.addEventListener("changeSelection", this.$onSelectionChange); - - this.onChangeMode(); - - this.onCursorChange(); - this.onSelectionChange(); - this.onChangeFrontMarker(); - this.onChangeBackMarker(); - this.onChangeBreakpoint(); - this.onChangeAnnotation(); - this.renderer.scrollToRow(session.getScrollTopRow()); - this.renderer.updateFull(); - - this._dispatchEvent("changeSession", { - session: session, - oldSession: oldSession - }); - }; - - this.getSession = function() { - return this.session; - }; - - this.getSelection = function() { - return this.selection; - }; - - this.resize = function() { - this.renderer.onResize(); - }; - - this.setTheme = function(theme) { - this.renderer.setTheme(theme); - }; - - this.getTheme = function() { - return this.renderer.getTheme(); - } - - this.setStyle = function(style) { - this.renderer.setStyle(style) - }; - - this.unsetStyle = function(style) { - this.renderer.unsetStyle(style) - } - - this.$highlightBrackets = function() { - if (this.session.$bracketHighlight) { - this.session.removeMarker(this.session.$bracketHighlight); - this.session.$bracketHighlight = null; - } - - if (this.$highlightPending) { - return; - } - - // perform highlight async to not block the browser during navigation - var self = this; - this.$highlightPending = true; - setTimeout(function() { - self.$highlightPending = false; - - var pos = self.session.findMatchingBracket(self.getCursorPosition()); - if (pos) { - var range = new Range(pos.row, pos.column, pos.row, pos.column+1); - self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket"); - } - }, 10); - }; - - this.focus = function() { - // Safari needs the timeout - // iOS and Firefox need it called immediately - // to be on the save side we do both - // except for IE - var _self = this; - if (!useragent.isIE) { - setTimeout(function() { - _self.textInput.focus(); - }); - } - this.textInput.focus(); - }; - - this.blur = function() { - this.textInput.blur(); - }; - - this.onFocus = function() { - this.renderer.showCursor(); - this.renderer.visualizeFocus(); - this._dispatchEvent("focus"); - }; - - this.onBlur = function() { - this.renderer.hideCursor(); - this.renderer.visualizeBlur(); - this._dispatchEvent("blur"); - }; - - this.onDocumentChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines") - var lastRow = range.end.row; - else - lastRow = Infinity; - this.renderer.updateLines(range.start.row, lastRow); - - // update cursor because tab characters can influence the cursor position - this.renderer.updateCursor(); - }; - - this.onTokenizerUpdate = function(e) { - var rows = e.data; - this.renderer.updateLines(rows.first, rows.last); - }; - - this.onCursorChange = function(e) { - this.renderer.updateCursor(); - - if (!this.$blockScrolling) { - this.renderer.scrollCursorIntoView(); - } - - // move text input over the cursor - // this is required for iOS and IME - this.renderer.moveTextAreaToCursor(this.textInput.getElement()); - - this.$highlightBrackets(); - this.$updateHighlightActiveLine(); - }; - - this.$updateHighlightActiveLine = function() { - var session = this.getSession(); - - if (session.$highlightLineMarker) { - session.removeMarker(session.$highlightLineMarker); - } - session.$highlightLineMarker = null; - - if (this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var cursor = this.getCursorPosition(), - foldLine = this.session.getFoldLine(cursor.row); - var range; - if (foldLine) { - range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); - } else { - range = new Range(cursor.row, 0, cursor.row+1, 0); - } - session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "line"); - } - }; - - this.onSelectionChange = function(e) { - var session = this.getSession(); - - if (session.$selectionMarker) { - session.removeMarker(session.$selectionMarker); - } - session.$selectionMarker = null; - - if (!this.selection.isEmpty()) { - var range = this.selection.getRange(); - var style = this.getSelectionStyle(); - session.$selectionMarker = session.addMarker(range, "ace_selection", style); - } else { - this.$updateHighlightActiveLine(); - } - - if (this.$highlightSelectedWord) - this.session.getMode().highlightSelection(this); - }; - - this.onChangeFrontMarker = function() { - this.renderer.updateFrontMarkers(); - }; - - this.onChangeBackMarker = function() { - this.renderer.updateBackMarkers(); - }; - - this.onChangeBreakpoint = function() { - this.renderer.setBreakpoints(this.session.getBreakpoints()); - }; - - this.onChangeAnnotation = function() { - this.renderer.setAnnotations(this.session.getAnnotations()); - }; - - this.onChangeMode = function() { - this.renderer.updateText() - }; - - this.onChangeWrapLimit = function() { - this.renderer.updateFull(); - }; - - this.onChangeWrapMode = function() { - this.renderer.onResize(true); - }; - - this.onChangeFold = function() { - // Update the active line marker as due to folding changes the current - // line range on the screen might have changed. - this.$updateHighlightActiveLine(); - // TODO: This might be too much updating. Okay for now. - this.renderer.updateFull(); - }; - - this.getCopyText = function() { - if (!this.selection.isEmpty()) { - return this.session.getTextRange(this.getSelectionRange()); - } - else { - return ""; - } - }; - - this.onCut = function() { - if (this.$readOnly) - return; - - if (!this.selection.isEmpty()) { - this.session.remove(this.getSelectionRange()) - this.clearSelection(); - } - }; - - this.insert = function(text) { - if (this.$readOnly) - return; - - var session = this.session; - var mode = session.getMode(); - - var cursor = this.getCursorPosition(); - - if (this.getBehavioursEnabled()) { - // Get a transform if the current mode wants one. - var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); - if (transform) - text = transform.text; - } - - text = text.replace("\t", this.session.getTabString()); - - // remove selected text - if (!this.selection.isEmpty()) { - var cursor = this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - else if (this.session.getOverwrite()) { - var range = new Range.fromPoints(cursor, cursor); - range.end.column += text.length; - this.session.remove(range); - } - - this.clearSelection(); - - var start = cursor.column; - var lineState = session.getState(cursor.row); - var shouldOutdent = mode.checkOutdent(lineState, session.getLine(cursor.row), text); - var line = session.getLine(cursor.row); - var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - var end = session.insert(cursor, text); - - if (transform && transform.selection) { - if (transform.selection.length == 2) { // Transform relative to the current column - this.selection.setSelectionRange( - new Range(cursor.row, start + transform.selection[0], - cursor.row, start + transform.selection[1])); - } else { // Transform relative to the current row. - this.selection.setSelectionRange( - new Range(cursor.row + transform.selection[0], - transform.selection[1], - cursor.row + transform.selection[2], - transform.selection[3])); - } - } - - var lineState = session.getState(cursor.row); - - // TODO disabled multiline auto indent - // possibly doing the indent before inserting the text - // if (cursor.row !== end.row) { - if (session.getDocument().isNewLine(text)) { - this.moveCursorTo(cursor.row+1, 0); - - var size = session.getTabSize(); - var minIndent = Number.MAX_VALUE; - - for (var row = cursor.row + 1; row <= end.row; ++row) { - var indent = 0; - - line = session.getLine(row); - for (var i = 0; i < line.length; ++i) - if (line.charAt(i) == '\t') - indent += size; - else if (line.charAt(i) == ' ') - indent += 1; - else - break; - if (/[^\s]/.test(line)) - minIndent = Math.min(indent, minIndent); - } - - for (var row = cursor.row + 1; row <= end.row; ++row) { - var outdent = minIndent; - - line = session.getLine(row); - for (var i = 0; i < line.length && outdent > 0; ++i) - if (line.charAt(i) == '\t') - outdent -= size; - else if (line.charAt(i) == ' ') - outdent -= 1; - session.remove(new Range(row, 0, row, i)); - } - session.indentRows(cursor.row + 1, end.row, lineIndent); - } else { - if (shouldOutdent) { - mode.autoOutdent(lineState, session, cursor.row); - } - } - }; - - this.onTextInput = function(text) { - this.keyBinding.onTextInput(text); - }; - - this.onCommandKey = function(e, hashId, keyCode) { - this.keyBinding.onCommandKey(e, hashId, keyCode); - }; - - this.setOverwrite = function(overwrite) { - this.session.setOverwrite(overwrite); - }; - - this.getOverwrite = function() { - return this.session.getOverwrite(); - }; - - this.toggleOverwrite = function() { - this.session.toggleOverwrite(); - }; - - this.setScrollSpeed = function(speed) { - this.$mouseHandler.setScrollSpeed(speed); - }; - - this.getScrollSpeed = function() { - return this.$mouseHandler.getScrollSpeed() - }; - - this.$selectionStyle = "line"; - this.setSelectionStyle = function(style) { - if (this.$selectionStyle == style) return; - - this.$selectionStyle = style; - this.onSelectionChange(); - this._dispatchEvent("changeSelectionStyle", {data: style}); - }; - - this.getSelectionStyle = function() { - return this.$selectionStyle; - }; - - this.$highlightActiveLine = true; - this.setHighlightActiveLine = function(shouldHighlight) { - if (this.$highlightActiveLine == shouldHighlight) return; - - this.$highlightActiveLine = shouldHighlight; - this.$updateHighlightActiveLine(); - }; - - this.getHighlightActiveLine = function() { - return this.$highlightActiveLine; - }; - - this.$highlightSelectedWord = true; - this.setHighlightSelectedWord = function(shouldHighlight) { - if (this.$highlightSelectedWord == shouldHighlight) - return; - - this.$highlightSelectedWord = shouldHighlight; - if (shouldHighlight) - this.session.getMode().highlightSelection(this); - else - this.session.getMode().clearSelectionHighlight(this); - }; - - this.getHighlightSelectedWord = function() { - return this.$highlightSelectedWord; - }; - - this.setShowInvisibles = function(showInvisibles) { - if (this.getShowInvisibles() == showInvisibles) - return; - - this.renderer.setShowInvisibles(showInvisibles); - }; - - this.getShowInvisibles = function() { - return this.renderer.getShowInvisibles(); - }; - - this.setShowPrintMargin = function(showPrintMargin) { - this.renderer.setShowPrintMargin(showPrintMargin); - }; - - this.getShowPrintMargin = function() { - return this.renderer.getShowPrintMargin(); - }; - - this.setPrintMarginColumn = function(showPrintMargin) { - this.renderer.setPrintMarginColumn(showPrintMargin); - }; - - this.getPrintMarginColumn = function() { - return this.renderer.getPrintMarginColumn(); - }; - - this.$readOnly = false; - this.setReadOnly = function(readOnly) { - this.$readOnly = readOnly; - }; - - this.getReadOnly = function() { - return this.$readOnly; - }; - - this.$modeBehaviours = false; - this.setBehavioursEnabled = function (enabled) { - this.$modeBehaviours = enabled; - } - - this.getBehavioursEnabled = function () { - return this.$modeBehaviours; - } - - this.removeRight = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) { - this.selection.selectRight(); - } - this.session.remove(this.getSelectionRange()) - this.clearSelection(); - }; - - this.removeLeft = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectLeft(); - - var range = this.getSelectionRange(); - if (this.getBehavioursEnabled()) { - var session = this.session; - var state = session.getState(range.start.row); - var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); - if (new_range !== false) { - range = new_range; - } - } - - this.session.remove(range); - this.clearSelection(); - }; - - this.removeWordRight = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectWordRight(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeWordLeft = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectWordLeft(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeToLineStart = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectLineStart(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - this.removeToLineEnd = function() { - if (this.$readOnly) - return; - - if (this.selection.isEmpty()) - this.selection.selectLineEnd(); - - var range = this.getSelectionRange(); - if (range.start.column == range.end.column && range.start.row == range.end.row) { - range.end.column = 0; - range.end.row++; - } - - this.session.remove(range); - this.clearSelection(); - }; - - this.splitLine = function() { - if (this.$readOnly) - return; - - if (!this.selection.isEmpty()) { - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - - var cursor = this.getCursorPosition(); - this.insert("\n"); - this.moveCursorToPosition(cursor); - }; - - this.transposeLetters = function() { - if (this.$readOnly) - return; - - if (!this.selection.isEmpty()) { - return; - } - - var cursor = this.getCursorPosition(); - var column = cursor.column; - if (column == 0) - return; - - var line = this.session.getLine(cursor.row); - if (column < line.length) { - var swap = line.charAt(column) + line.charAt(column-1); - var range = new Range(cursor.row, column-1, cursor.row, column+1) - } - else { - var swap = line.charAt(column-1) + line.charAt(column-2); - var range = new Range(cursor.row, column-2, cursor.row, column) - } - this.session.replace(range, swap); - }; - - this.indent = function() { - if (this.$readOnly) - return; - - var session = this.session; - var range = this.getSelectionRange(); - - if (range.start.row < range.end.row || range.start.column < range.end.column) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - } else { - var indentString; - - if (this.session.getUseSoftTabs()) { - var size = session.getTabSize(), - position = this.getCursorPosition(), - column = session.documentToScreenColumn(position.row, position.column), - count = (size - column % size); - - indentString = lang.stringRepeat(" ", count); - } else - indentString = "\t"; - return this.onTextInput(indentString); - } - }; - - this.blockOutdent = function() { - if (this.$readOnly) - return; - - var selection = this.session.getSelection(); - this.session.outdentRows(selection.getRange()); - }; - - this.toggleCommentLines = function() { - if (this.$readOnly) - return; - - var state = this.session.getState(this.getCursorPosition().row); - var rows = this.$getSelectedRows() - this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); - }; - - this.removeLines = function() { - if (this.$readOnly) - return; - - var rows = this.$getSelectedRows(); - this.session.remove(new Range(rows.first, 0, rows.last+1, 0)); - this.clearSelection(); - }; - - this.moveLinesDown = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesDown(firstRow, lastRow); - }); - }; - - this.moveLinesUp = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.moveLinesUp(firstRow, lastRow); - }); - }; - - this.moveText = function(range, toPosition) { - if (this.$readOnly) - return null; - - return this.session.moveText(range, toPosition); - }; - - this.copyLinesUp = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - this.session.duplicateLines(firstRow, lastRow); - return 0; - }); - }; - - this.copyLinesDown = function() { - if (this.$readOnly) - return; - - this.$moveLines(function(firstRow, lastRow) { - return this.session.duplicateLines(firstRow, lastRow); - }); - }; - - - this.$moveLines = function(mover) { - var rows = this.$getSelectedRows(); - - var linesMoved = mover.call(this, rows.first, rows.last); - - var selection = this.selection; - selection.setSelectionAnchor(rows.last+linesMoved+1, 0); - selection.$moveSelection(function() { - selection.moveCursorTo(rows.first+linesMoved, 0); - }); - }; - - this.$getSelectedRows = function() { - var range = this.getSelectionRange().collapseRows(); - - return { - first: range.start.row, - last: range.end.row - }; - }; - - this.onCompositionStart = function(text) { - this.renderer.showComposition(this.getCursorPosition()); - }; - - this.onCompositionUpdate = function(text) { - this.renderer.setCompositionText(text); - }; - - this.onCompositionEnd = function() { - this.renderer.hideComposition(); - }; - - - this.getFirstVisibleRow = function() { - return this.renderer.getFirstVisibleRow(); - }; - - this.getLastVisibleRow = function() { - return this.renderer.getLastVisibleRow(); - }; - - this.isRowVisible = function(row) { - return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); - }; - - this.$getVisibleRowCount = function() { - return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; - }; - - this.$getPageDownRow = function() { - return this.renderer.getScrollBottomRow(); - }; - - this.$getPageUpRow = function() { - var firstRow = this.renderer.getScrollTopRow(); - var lastRow = this.renderer.getScrollBottomRow(); - - return firstRow - (lastRow - firstRow); - }; - - this.selectPageDown = function() { - var row = this.$getPageDownRow() + Math.floor(this.$getVisibleRowCount() / 2); - - this.scrollPageDown(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); - }; - - this.selectPageUp = function() { - var visibleRows = this.renderer.getScrollTopRow() - this.renderer.getScrollBottomRow(); - var row = this.$getPageUpRow() + Math.round(visibleRows / 2); - - this.scrollPageUp(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); - }; - - this.gotoPageDown = function() { - var row = this.$getPageDownRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); - }; - - this.gotoPageUp = function() { - var row = this.$getPageUpRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); - }; - - this.scrollPageDown = function() { - this.scrollToRow(this.$getPageDownRow()); - }; - - this.scrollPageUp = function() { - this.renderer.scrollToRow(this.$getPageUpRow()); - }; - - this.scrollToRow = function(row) { - this.renderer.scrollToRow(row); - }; - - this.scrollToLine = function(line, center) { - this.renderer.scrollToLine(line, center); - }; - - this.centerSelection = function() { - var range = this.getSelectionRange(); - var line = Math.floor(range.start.row + (range.end.row - range.start.row) / 2); - this.renderer.scrollToLine(line, true); - }; - - this.getCursorPosition = function() { - return this.selection.getCursor(); - }; - - this.getCursorPositionScreen = function() { - return this.session.documentToScreenPosition(this.getCursorPosition()); - }; - - this.getSelectionRange = function() { - return this.selection.getRange(); - }; - - - this.selectAll = function() { - this.$blockScrolling += 1; - this.selection.selectAll(); - this.$blockScrolling -= 1; - }; - - this.clearSelection = function() { - this.selection.clearSelection(); - }; - - this.moveCursorTo = function(row, column) { - this.selection.moveCursorTo(row, column); - }; - - this.moveCursorToPosition = function(pos) { - this.selection.moveCursorToPosition(pos); - }; - - - this.gotoLine = function(lineNumber, row) { - this.selection.clearSelection(); - - this.$blockScrolling += 1; - this.moveCursorTo(lineNumber-1, row || 0); - this.$blockScrolling -= 1; - - if (!this.isRowVisible(this.getCursorPosition().row)) { - this.scrollToLine(lineNumber, true); - } - }, - - this.navigateTo = function(row, column) { - this.clearSelection(); - this.moveCursorTo(row, column); - }; - - this.navigateUp = function(times) { - this.selection.clearSelection(); - times = times || 1; - this.selection.moveCursorBy(-times, 0); - }; - - this.navigateDown = function(times) { - this.selection.clearSelection(); - times = times || 1; - this.selection.moveCursorBy(times, 0); - }; - - this.navigateLeft = function(times) { - if (!this.selection.isEmpty()) { - var selectionStart = this.getSelectionRange().start; - this.moveCursorToPosition(selectionStart); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorLeft(); - } - } - this.clearSelection(); - }; - - this.navigateRight = function(times) { - if (!this.selection.isEmpty()) { - var selectionEnd = this.getSelectionRange().end; - this.moveCursorToPosition(selectionEnd); - } - else { - times = times || 1; - while (times--) { - this.selection.moveCursorRight(); - } - } - this.clearSelection(); - }; - - this.navigateLineStart = function() { - this.selection.moveCursorLineStart(); - this.clearSelection(); - }; - - this.navigateLineEnd = function() { - this.selection.moveCursorLineEnd(); - this.clearSelection(); - }; - - this.navigateFileEnd = function() { - this.selection.moveCursorFileEnd(); - this.clearSelection(); - }; - - this.navigateFileStart = function() { - this.selection.moveCursorFileStart(); - this.clearSelection(); - }; - - this.navigateWordRight = function() { - this.selection.moveCursorWordRight(); - this.clearSelection(); - }; - - this.navigateWordLeft = function() { - this.selection.moveCursorWordLeft(); - this.clearSelection(); - }; - - this.replace = function(replacement, options) { - if (options) - this.$search.set(options); - - var range = this.$search.find(this.session); - this.$tryReplace(range, replacement); - if (range !== null) - this.selection.setSelectionRange(range); - }, - - this.replaceAll = function(replacement, options) { - if (options) { - this.$search.set(options); - } - - var ranges = this.$search.findAll(this.session); - if (!ranges.length) - return; - - var selection = this.getSelectionRange(); - this.clearSelection(); - this.selection.moveCursorTo(0, 0); - - this.$blockScrolling += 1; - for (var i = ranges.length - 1; i >= 0; --i) - this.$tryReplace(ranges[i], replacement); - - this.selection.setSelectionRange(selection); - this.$blockScrolling -= 1; - }, - - this.$tryReplace = function(range, replacement) { - var input = this.session.getTextRange(range); - var replacement = this.$search.replace(input, replacement); - if (replacement !== null) { - range.end = this.session.replace(range, replacement); - return range; - } else { - return null; - } - }; - - this.getLastSearchOptions = function() { - return this.$search.getOptions(); - }; - - this.find = function(needle, options) { - this.clearSelection(); - options = options || {}; - options.needle = needle; - this.$search.set(options); - this.$find(); - }, - - this.findNext = function(options) { - options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = false; - this.$search.set(options); - this.$find(); - }; - - this.findPrevious = function(options) { - options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = true; - this.$search.set(options); - this.$find(); - }; - - this.$find = function(backwards) { - if (!this.selection.isEmpty()) { - this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())}); - } - - if (typeof backwards != "undefined") - this.$search.set({backwards: backwards}); - - var range = this.$search.find(this.session); - if (range) { - this.gotoLine(range.end.row+1, range.end.column); - this.selection.setSelectionRange(range); - } - }; - - this.undo = function() { - this.session.getUndoManager().undo(); - }; - - this.redo = function() { - this.session.getUndoManager().redo(); - }; - - this.destroy = function() { - this.renderer.destroy(); - } - -}).call(Editor.prototype); - - -exports.Editor = Editor; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/keyboard/textinput', ['require', 'exports', 'module' , 'pilot/event', 'pilot/useragent', 'pilot/dom'], function(require, exports, module) { - -var event = require("pilot/event"); -var useragent = require("pilot/useragent"); -var dom = require("pilot/dom"); - -var TextInput = function(parentNode, host) { - - var text = dom.createElement("textarea"); - text.style.left = "-10000px"; - parentNode.appendChild(text); - - var PLACEHOLDER = String.fromCharCode(0); - sendText(); - - var inCompostion = false; - var copied = false; - var tempStyle = ''; - - function sendText(valueToSend) { - if (!copied) { - var value = valueToSend || text.value; - if (value) { - if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { - value = value.slice(0, -1); - if (value) - host.onTextInput(value); - } else - host.onTextInput(value); - } - } - copied = false; - - // Safari doesn't fire copy events if no text is selected - text.value = PLACEHOLDER; - text.select(); - } - - var onTextInput = function(e) { - if (useragent.isIE && text.value.charCodeAt(0) > 128) return; - setTimeout(function() { - if (!inCompostion) - sendText(); - }, 0); - }; - - var onCompositionStart = function(e) { - inCompostion = true; - if (!useragent.isIE) { - sendText(); - text.value = ""; - }; - host.onCompositionStart(); - if (!useragent.isGecko) setTimeout(onCompositionUpdate, 0); - }; - - var onCompositionUpdate = function() { - if (!inCompostion) return; - host.onCompositionUpdate(text.value); - }; - - var onCompositionEnd = function(e) { - inCompostion = false; - host.onCompositionEnd(); - if (useragent.isGecko) { - sendText(); - } else { - setTimeout(function () { - if (!inCompostion) - sendText(); - }, 0); - } - }; - - var onCopy = function(e) { - copied = true; - var copyText = host.getCopyText(); - if(copyText) - text.value = copyText; - else - e.preventDefault(); - text.select(); - setTimeout(function () { - sendText(); - }, 0); - }; - - var onCut = function(e) { - copied = true; - var copyText = host.getCopyText(); - if(copyText) { - text.value = copyText; - host.onCut(); - } else - e.preventDefault(); - text.select(); - setTimeout(function () { - sendText(); - }, 0); - }; - - event.addCommandKeyListener(text, host.onCommandKey.bind(host)); - event.addListener(text, "keypress", onTextInput); - if (useragent.isIE) { - var keytable = { 13:1, 27:1 }; - event.addListener(text, "keyup", function (e) { - if (inCompostion && (!text.value || keytable[e.keyCode])) - setTimeout(onCompositionEnd, 0); - if ((text.value.charCodeAt(0)|0) < 129) { - return; - }; - inCompostion ? onCompositionUpdate() : onCompositionStart(); - }); - }; - event.addListener(text, "textInput", onTextInput); - event.addListener(text, "paste", function(e) { - // Some browsers support the event.clipboardData API. Use this to get - // the pasted content which increases speed if pasting a lot of lines. - if (e.clipboardData && e.clipboardData.getData) { - sendText(e.clipboardData.getData("text/plain")); - e.preventDefault(); - } else - // If a browser doesn't support any of the things above, use the regular - // method to detect the pasted input. - { - onTextInput(); - } - }); - if (!useragent.isIE) { - event.addListener(text, "propertychange", onTextInput); - }; - - if (useragent.isIE) { - event.addListener(text, "beforecopy", function(e) { - var copyText = host.getCopyText(); - if(copyText) - clipboardData.setData("Text", copyText); - else - e.preventDefault(); - }); - event.addListener(parentNode, "keydown", function(e) { - if (e.ctrlKey && e.keyCode == 88) { - var copyText = host.getCopyText(); - if (copyText) { - clipboardData.setData("Text", copyText); - host.onCut(); - } - event.preventDefault(e) - } - }); - } - else { - event.addListener(text, "copy", onCopy); - event.addListener(text, "cut", onCut); - } - - event.addListener(text, "compositionstart", onCompositionStart); - if (useragent.isGecko) { - event.addListener(text, "text", onCompositionUpdate); - }; - if (useragent.isWebKit) { - event.addListener(text, "keyup", onCompositionUpdate); - }; - event.addListener(text, "compositionend", onCompositionEnd); - - event.addListener(text, "blur", function() { - host.onBlur(); - }); - - event.addListener(text, "focus", function() { - host.onFocus(); - text.select(); - }); - - this.focus = function() { - host.onFocus(); - text.select(); - text.focus(); - }; - - this.blur = function() { - text.blur(); - }; - - this.getElement = function() { - return text; - }; - - this.onContextMenu = function(mousePos, isEmpty){ - if (mousePos) { - if(!tempStyle) - tempStyle = text.style.cssText; - text.style.cssText = 'position:fixed; z-index:1000;' + - 'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;' - - } - if (isEmpty) - text.value=''; - } - - this.onContextMenuClose = function(){ - setTimeout(function () { - if (tempStyle) { - text.style.cssText = tempStyle; - tempStyle = ''; - } - sendText(); - }, 0); - } -}; - -exports.TextInput = TextInput; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mouse_handler', ['require', 'exports', 'module' , 'pilot/event', 'pilot/dom'], function(require, exports, module) { - -var event = require("pilot/event"); -var dom = require("pilot/dom"); - -var STATE_UNKNOWN = 0; -var STATE_SELECT = 1; -var STATE_DRAG = 2; - -var DRAG_TIMER = 250; // milliseconds -var DRAG_OFFSET = 5; // pixels - -var MouseHandler = function(editor) { - this.editor = editor; - event.addListener(editor.container, "mousedown", function(e) { - editor.focus(); - return event.preventDefault(e); - }); - event.addListener(editor.container, "selectstart", function(e) { - return event.preventDefault(e); - }); - - var mouseTarget = editor.renderer.getMouseEventTarget(); - event.addListener(mouseTarget, "mousedown", this.onMouseDown.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 2, 500, this.onMouseDoubleClick.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 3, 600, this.onMouseTripleClick.bind(this)); - event.addMultiMouseDownListener(mouseTarget, 0, 4, 600, this.onMouseQuadClick.bind(this)); - event.addMouseWheelListener(mouseTarget, this.onMouseWheel.bind(this)); -}; - -(function() { - - this.$scrollSpeed = 1; - this.setScrollSpeed = function(speed) { - this.$scrollSpeed = speed; - }; - - this.getScrollSpeed = function() { - return this.$scrollSpeed; - }; - - this.$getEventPosition = function(e) { - var pageX = event.getDocumentX(e); - var pageY = event.getDocumentY(e); - var pos = this.editor.renderer.screenToTextCoordinates(pageX, pageY); - pos.row = Math.max(0, Math.min(pos.row, this.editor.session.getLength()-1)); - return pos; - }; - - this.$distance = function(ax, ay, bx, by) { - return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); - }; - - this.onMouseDown = function(e) { - var pageX = event.getDocumentX(e); - var pageY = event.getDocumentY(e); - var pos = this.$getEventPosition(e); - var editor = this.editor; - var self = this; - var selectionRange = editor.getSelectionRange(); - var selectionEmpty = selectionRange.isEmpty(); - var state = STATE_UNKNOWN; - var inSelection = false; - - var button = event.getButton(e); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if(button == 2) { - editor.textInput.onContextMenu({x: pageX, y: pageY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } else { - // Select the fold as the user clicks it. - var fold = editor.session.getFoldAt(pos.row, pos.column, 1); - if (fold) { - editor.selection.setSelectionRange(fold.range); - return; - } - - inSelection = !editor.getReadOnly() - && !selectionEmpty - && selectionRange.contains(pos.row, pos.column); - } - - if (!inSelection) { - // Directly pick STATE_SELECT, since the user is not clicking inside - // a selection. - onStartSelect(pos); - } - - var mousePageX, mousePageY; - var overwrite = editor.getOverwrite(); - var mousedownTime = (new Date()).getTime(); - var dragCursor, dragRange; - - var onMouseSelection = function(e) { - mousePageX = event.getDocumentX(e); - mousePageY = event.getDocumentY(e); - }; - - var onMouseSelectionEnd = function() { - clearInterval(timerId); - if (state == STATE_UNKNOWN) - onStartSelect(pos); - else if (state == STATE_DRAG) - onMouseDragSelectionEnd(); - - self.$clickSelection = null; - state = STATE_UNKNOWN; - }; - - var onMouseDragSelectionEnd = function() { - dom.removeCssClass(editor.container, "ace_dragging"); - editor.session.removeMarker(dragSelectionMarker); - - if (!self.$clickSelection) { - if (!dragCursor) { - editor.moveCursorToPosition(pos); - editor.selection.clearSelection(pos.row, pos.column); - } - } - - if (!dragCursor) - return; - - if (dragRange.contains(dragCursor.row, dragCursor.column)) { - dragCursor = null; - return; - } - - editor.clearSelection(); - var newRange = editor.moveText(dragRange, dragCursor); - if (!newRange) { - dragCursor = null; - return; - } - - editor.selection.setSelectionRange(newRange); - }; - - var onSelectionInterval = function() { - if (mousePageX === undefined || mousePageY === undefined) - return; - - if (state == STATE_UNKNOWN) { - var distance = self.$distance(pageX, pageY, mousePageX, mousePageY); - var time = (new Date()).getTime(); - - - if (distance > DRAG_OFFSET) { - state = STATE_SELECT; - var cursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - cursor.row = Math.max(0, Math.min(cursor.row, editor.session.getLength()-1)); - onStartSelect(cursor); - } else if ((time - mousedownTime) > DRAG_TIMER) { - state = STATE_DRAG; - dragRange = editor.getSelectionRange(); - var style = editor.getSelectionStyle(); - dragSelectionMarker = editor.session.addMarker(dragRange, "ace_selection", style); - editor.clearSelection(); - dom.addCssClass(editor.container, "ace_dragging"); - } - - } - - if (state == STATE_DRAG) - onDragSelectionInterval(); - else if (state == STATE_SELECT) - onUpdateSelectionInterval(); - }; - - function onStartSelect(pos) { - if (e.shiftKey) - editor.selection.selectToPosition(pos) - else { - if (!self.$clickSelection) { - editor.moveCursorToPosition(pos); - editor.selection.clearSelection(pos.row, pos.column); - } - } - state = STATE_SELECT; - } - - var onUpdateSelectionInterval = function() { - var cursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - cursor.row = Math.max(0, Math.min(cursor.row, editor.session.getLength()-1)); - - if (self.$clickSelection) { - if (self.$clickSelection.contains(cursor.row, cursor.column)) { - editor.selection.setSelectionRange(self.$clickSelection); - } else { - if (self.$clickSelection.compare(cursor.row, cursor.column) == -1) { - var anchor = self.$clickSelection.end; - } else { - var anchor = self.$clickSelection.start; - } - editor.selection.setSelectionAnchor(anchor.row, anchor.column); - editor.selection.selectToPosition(cursor); - } - } - else { - editor.selection.selectToPosition(cursor); - } - - editor.renderer.scrollCursorIntoView(); - }; - - var onDragSelectionInterval = function() { - dragCursor = editor.renderer.screenToTextCoordinates(mousePageX, mousePageY); - dragCursor.row = Math.max(0, Math.min(dragCursor.row, - editor.session.getLength() - 1)); - - editor.moveCursorToPosition(dragCursor); - }; - - event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); - var timerId = setInterval(onSelectionInterval, 20); - - return event.preventDefault(e); - }; - - this.onMouseDoubleClick = function(e) { - var editor = this.editor; - var pos = this.$getEventPosition(e); - - // If the user dclicked on a fold, then expand it. - var fold = editor.session.getFoldAt(pos.row, pos.column, 1); - if (fold) { - editor.session.expandFold(fold); - } else { - editor.moveCursorToPosition(pos); - editor.selection.selectWord(); - this.$clickSelection = editor.getSelectionRange(); - } - }; - - this.onMouseTripleClick = function(e) { - var pos = this.$getEventPosition(e); - this.editor.moveCursorToPosition(pos); - this.editor.selection.selectLine(); - this.$clickSelection = this.editor.getSelectionRange(); - }; - - this.onMouseQuadClick = function(e) { - this.editor.selectAll(); - this.$clickSelection = this.editor.getSelectionRange(); - }; - - this.onMouseWheel = function(e) { - var speed = this.$scrollSpeed * 2; - - this.editor.renderer.scrollBy(e.wheelX * speed, e.wheelY * speed); - return event.preventDefault(e); - }; - - -}).call(MouseHandler.prototype); - -exports.MouseHandler = MouseHandler; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/keyboard/keybinding', ['require', 'exports', 'module' , 'pilot/useragent', 'pilot/keys', 'pilot/event', 'pilot/settings', 'pilot/canon', 'ace/commands/default_commands'], function(require, exports, module) { - -var useragent = require("pilot/useragent"); -var keyUtil = require("pilot/keys"); -var event = require("pilot/event"); -var settings = require("pilot/settings").settings; -var canon = require("pilot/canon"); -require("ace/commands/default_commands"); - -var KeyBinding = function(editor) { - this.$editor = editor; - this.$data = { }; - this.$keyboardHandler = null; -}; - -(function() { - this.setKeyboardHandler = function(keyboardHandler) { - if (this.$keyboardHandler != keyboardHandler) { - this.$data = { }; - this.$keyboardHandler = keyboardHandler; - } - }; - - this.getKeyboardHandler = function() { - return this.$keyboardHandler; - }; - - this.$callKeyboardHandler = function (e, hashId, keyOrText, keyCode) { - var env = {editor: this.$editor}, - toExecute; - - if (this.$keyboardHandler) { - toExecute = - this.$keyboardHandler.handleKeyboard(this.$data, hashId, keyOrText, keyCode, e); - } - - // If there is nothing to execute yet, then use the default keymapping. - if (!toExecute || !toExecute.command) { - if (hashId != 0 || keyCode != 0) { - toExecute = { - command: canon.findKeyCommand(env, "editor", hashId, keyOrText) - } - } else { - toExecute = { - command: "inserttext", - args: { - text: keyOrText - } - } - } - } - - if (toExecute) { - var success = canon.exec(toExecute.command, - env, "editor", toExecute.args); - if (success) { - return event.stopEvent(e); - } - } - }; - - this.onCommandKey = function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - this.$callKeyboardHandler(e, hashId, keyString, keyCode); - }; - - this.onTextInput = function(text) { - this.$callKeyboardHandler({}, 0, text, 0); - } - -}).call(KeyBinding.prototype); - -exports.KeyBinding = KeyBinding; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/commands/default_commands', ['require', 'exports', 'module' , 'pilot/lang', 'pilot/canon'], function(require, exports, module) { - -var lang = require("pilot/lang"); -var canon = require("pilot/canon"); - -function bindKey(win, mac) { - return { - win: win, - mac: mac, - sender: "editor" - }; -} - -canon.addCommand({ - name: "null", - exec: function(env, args, request) { } -}); - -canon.addCommand({ - name: "selectall", - bindKey: bindKey("Ctrl-A", "Command-A"), - exec: function(env, args, request) { env.editor.selectAll(); } -}); -canon.addCommand({ - name: "removeline", - bindKey: bindKey("Ctrl-D", "Command-D"), - exec: function(env, args, request) { env.editor.removeLines(); } -}); -canon.addCommand({ - name: "gotoline", - bindKey: bindKey("Ctrl-L", "Command-L"), - exec: function(env, args, request) { - var line = parseInt(prompt("Enter line number:")); - if (!isNaN(line)) { - env.editor.gotoLine(line); - } - } -}); -canon.addCommand({ - name: "togglecomment", - bindKey: bindKey("Ctrl-7", "Command-7"), - exec: function(env, args, request) { env.editor.toggleCommentLines(); } -}); -canon.addCommand({ - name: "findnext", - bindKey: bindKey("Ctrl-K", "Command-G"), - exec: function(env, args, request) { env.editor.findNext(); } -}); -canon.addCommand({ - name: "findprevious", - bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), - exec: function(env, args, request) { env.editor.findPrevious(); } -}); -canon.addCommand({ - name: "find", - bindKey: bindKey("Ctrl-F", "Command-F"), - exec: function(env, args, request) { - var needle = prompt("Find:"); - env.editor.find(needle); - } -}); -canon.addCommand({ - name: "replace", - bindKey: bindKey("Ctrl-R", "Command-Option-F"), - exec: function(env, args, request) { - var needle = prompt("Find:"); - if (!needle) - return; - var replacement = prompt("Replacement:"); - if (!replacement) - return; - env.editor.replace(replacement, {needle: needle}); - } -}); -canon.addCommand({ - name: "replaceall", - bindKey: bindKey("Ctrl-Shift-R", "Command-Shift-Option-F"), - exec: function(env, args, request) { - var needle = prompt("Find:"); - if (!needle) - return; - var replacement = prompt("Replacement:"); - if (!replacement) - return; - env.editor.replaceAll(replacement, {needle: needle}); - } -}); -canon.addCommand({ - name: "undo", - bindKey: bindKey("Ctrl-Z", "Command-Z"), - exec: function(env, args, request) { env.editor.undo(); } -}); -canon.addCommand({ - name: "redo", - bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), - exec: function(env, args, request) { env.editor.redo(); } -}); -canon.addCommand({ - name: "overwrite", - bindKey: bindKey("Insert", "Insert"), - exec: function(env, args, request) { env.editor.toggleOverwrite(); } -}); -canon.addCommand({ - name: "copylinesup", - bindKey: bindKey("Ctrl-Alt-Up", "Command-Option-Up"), - exec: function(env, args, request) { env.editor.copyLinesUp(); } -}); -canon.addCommand({ - name: "movelinesup", - bindKey: bindKey("Alt-Up", "Option-Up"), - exec: function(env, args, request) { env.editor.moveLinesUp(); } -}); -canon.addCommand({ - name: "selecttostart", - bindKey: bindKey("Ctrl-Shift-Home|Alt-Shift-Up", "Command-Shift-Up"), - exec: function(env, args, request) { env.editor.getSelection().selectFileStart(); } -}); -canon.addCommand({ - name: "gotostart", - bindKey: bindKey("Ctrl-Home|Ctrl-Up", "Command-Home|Command-Up"), - exec: function(env, args, request) { env.editor.navigateFileStart(); } -}); -canon.addCommand({ - name: "selectup", - bindKey: bindKey("Shift-Up", "Shift-Up"), - exec: function(env, args, request) { env.editor.getSelection().selectUp(); } -}); -canon.addCommand({ - name: "golineup", - bindKey: bindKey("Up", "Up|Ctrl-P"), - exec: function(env, args, request) { env.editor.navigateUp(args.times); } -}); -canon.addCommand({ - name: "copylinesdown", - bindKey: bindKey("Ctrl-Alt-Down", "Command-Option-Down"), - exec: function(env, args, request) { env.editor.copyLinesDown(); } -}); -canon.addCommand({ - name: "movelinesdown", - bindKey: bindKey("Alt-Down", "Option-Down"), - exec: function(env, args, request) { env.editor.moveLinesDown(); } -}); -canon.addCommand({ - name: "selecttoend", - bindKey: bindKey("Ctrl-Shift-End|Alt-Shift-Down", "Command-Shift-Down"), - exec: function(env, args, request) { env.editor.getSelection().selectFileEnd(); } -}); -canon.addCommand({ - name: "gotoend", - bindKey: bindKey("Ctrl-End|Ctrl-Down", "Command-End|Command-Down"), - exec: function(env, args, request) { env.editor.navigateFileEnd(); } -}); -canon.addCommand({ - name: "selectdown", - bindKey: bindKey("Shift-Down", "Shift-Down"), - exec: function(env, args, request) { env.editor.getSelection().selectDown(); } -}); -canon.addCommand({ - name: "golinedown", - bindKey: bindKey("Down", "Down|Ctrl-N"), - exec: function(env, args, request) { env.editor.navigateDown(args.times); } -}); -canon.addCommand({ - name: "selectwordleft", - bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), - exec: function(env, args, request) { env.editor.getSelection().selectWordLeft(); } -}); -canon.addCommand({ - name: "gotowordleft", - bindKey: bindKey("Ctrl-Left", "Option-Left"), - exec: function(env, args, request) { env.editor.navigateWordLeft(); } -}); -canon.addCommand({ - name: "selecttolinestart", - bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), - exec: function(env, args, request) { env.editor.getSelection().selectLineStart(); } -}); -canon.addCommand({ - name: "gotolinestart", - bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), - exec: function(env, args, request) { env.editor.navigateLineStart(); } -}); -canon.addCommand({ - name: "selectleft", - bindKey: bindKey("Shift-Left", "Shift-Left"), - exec: function(env, args, request) { env.editor.getSelection().selectLeft(); } -}); -canon.addCommand({ - name: "gotoleft", - bindKey: bindKey("Left", "Left|Ctrl-B"), - exec: function(env, args, request) { env.editor.navigateLeft(args.times); } -}); -canon.addCommand({ - name: "selectwordright", - bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), - exec: function(env, args, request) { env.editor.getSelection().selectWordRight(); } -}); -canon.addCommand({ - name: "gotowordright", - bindKey: bindKey("Ctrl-Right", "Option-Right"), - exec: function(env, args, request) { env.editor.navigateWordRight(); } -}); -canon.addCommand({ - name: "selecttolineend", - bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), - exec: function(env, args, request) { env.editor.getSelection().selectLineEnd(); } -}); -canon.addCommand({ - name: "gotolineend", - bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), - exec: function(env, args, request) { env.editor.navigateLineEnd(); } -}); -canon.addCommand({ - name: "selectright", - bindKey: bindKey("Shift-Right", "Shift-Right"), - exec: function(env, args, request) { env.editor.getSelection().selectRight(); } -}); -canon.addCommand({ - name: "gotoright", - bindKey: bindKey("Right", "Right|Ctrl-F"), - exec: function(env, args, request) { env.editor.navigateRight(args.times); } -}); -canon.addCommand({ - name: "selectpagedown", - bindKey: bindKey("Shift-PageDown", "Shift-PageDown"), - exec: function(env, args, request) { env.editor.selectPageDown(); } -}); -canon.addCommand({ - name: "pagedown", - bindKey: bindKey(null, "PageDown"), - exec: function(env, args, request) { env.editor.scrollPageDown(); } -}); -canon.addCommand({ - name: "gotopagedown", - bindKey: bindKey("PageDown", "Option-PageDown|Ctrl-V"), - exec: function(env, args, request) { env.editor.gotoPageDown(); } -}); -canon.addCommand({ - name: "selectpageup", - bindKey: bindKey("Shift-PageUp", "Shift-PageUp"), - exec: function(env, args, request) { env.editor.selectPageUp(); } -}); -canon.addCommand({ - name: "pageup", - bindKey: bindKey(null, "PageUp"), - exec: function(env, args, request) { env.editor.scrollPageUp(); } -}); -canon.addCommand({ - name: "gotopageup", - bindKey: bindKey("PageUp", "Option-PageUp"), - exec: function(env, args, request) { env.editor.gotoPageUp(); } -}); -canon.addCommand({ - name: "selectlinestart", - bindKey: bindKey("Shift-Home", "Shift-Home"), - exec: function(env, args, request) { env.editor.getSelection().selectLineStart(); } -}); -canon.addCommand({ - name: "selectlineend", - bindKey: bindKey("Shift-End", "Shift-End"), - exec: function(env, args, request) { env.editor.getSelection().selectLineEnd(); } -}); -canon.addCommand({ - name: "del", - bindKey: bindKey("Delete", "Delete|Ctrl-D"), - exec: function(env, args, request) { env.editor.removeRight(); } -}); -canon.addCommand({ - name: "backspace", - bindKey: bindKey( - "Ctrl-Backspace|Command-Backspace|Option-Backspace|Shift-Backspace|Backspace", - "Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H" - ), - exec: function(env, args, request) { env.editor.removeLeft(); } -}); -canon.addCommand({ - name: "removetolinestart", - bindKey: bindKey(null, "Option-Backspace"), - exec: function(env, args, request) { env.editor.removeToLineStart(); } -}); -canon.addCommand({ - name: "removetolineend", - bindKey: bindKey(null, "Ctrl-K"), - exec: function(env, args, request) { env.editor.removeToLineEnd(); } -}); -canon.addCommand({ - name: "removewordleft", - bindKey: bindKey(null, "Alt-Backspace|Ctrl-Alt-Backspace"), - exec: function(env, args, request) { env.editor.removeWordLeft(); } -}); -canon.addCommand({ - name: "removewordright", - bindKey: bindKey(null, "Alt-Delete"), - exec: function(env, args, request) { env.editor.removeWordRight(); } -}); -canon.addCommand({ - name: "outdent", - bindKey: bindKey("Shift-Tab", "Shift-Tab"), - exec: function(env, args, request) { env.editor.blockOutdent(); } -}); -canon.addCommand({ - name: "indent", - bindKey: bindKey("Tab", "Tab"), - exec: function(env, args, request) { env.editor.indent(); } -}); -canon.addCommand({ - name: "inserttext", - exec: function(env, args, request) { - env.editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); - } -}); -canon.addCommand({ - name: "centerselection", - bindKey: bindKey(null, "Ctrl-L"), - exec: function(env, args, request) { env.editor.centerSelection(); } -}); -canon.addCommand({ - name: "splitline", - bindKey: bindKey(null, "Ctrl-O"), - exec: function(env, args, request) { env.editor.splitLine(); } -}); -canon.addCommand({ - name: "transposeletters", - bindKey: bindKey("Ctrl-T", "Ctrl-T"), - exec: function(env, args, request) { env.editor.transposeLetters(); } -}); - -});/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/edit_session', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/lang', 'pilot/event_emitter', 'ace/selection', 'ace/mode/text', 'ace/range', 'ace/document', 'ace/background_tokenizer', 'ace/edit_session/folding'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; -var Selection = require("ace/selection").Selection; -var TextMode = require("ace/mode/text").Mode; -var Range = require("ace/range").Range; -var Document = require("ace/document").Document; -var BackgroundTokenizer = require("ace/background_tokenizer").BackgroundTokenizer; - -var EditSession = function(text, mode) { - this.$modified = true; - this.$breakpoints = []; - this.$frontMarkers = {}; - this.$backMarkers = {}; - this.$markerId = 1; - this.$rowCache = []; - this.$rowCacheSize = 1000; - this.$wrapData = []; - this.$foldData = []; - this.$foldData.toString = function() { - var str = ""; - this.forEach(function(foldLine) { - str += "\n" + foldLine.toString(); - }); - return str; - } - this.$docChangeCounter = 0; - - if (text instanceof Document) { - this.setDocument(text); - } else { - this.setDocument(new Document(text)); - } - - this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); -}; - - -(function() { - - oop.implement(this, EventEmitter); - - this.setDocument = function(doc) { - if (this.doc) - throw new Error("Document is already set"); - - this.doc = doc; - doc.on("change", this.onChange.bind(this)); - doc.on("changeStart", this.onChangeStart.bind(this)); - doc.on("changeEnd", this.onChangeEnd.bind(this)); - this.on("changeFold", this.onChangeFold.bind(this)); - }; - - this.getDocument = function() { - return this.doc; - }; - - this.onChangeStart = function() { - this.$docChangeCounter ++; - }; - - this.$resetRowCache = function(row) { - if (row == 0) { - this.$rowCache = []; - return; - } - var rowCache = this.$rowCache; - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].docRow >= row) { - rowCache.splice(i, rowCache.length); - return; - } - } - } - - this.onChangeEnd = function() { - this.$docChangeCounter --; - if (this.$docChangeCounter == 0 - && !this.$fromUndo && this.$undoManager) - { - if (this.$deltasFold.length) { - this.$deltas.push({ - group: "fold", - deltas: this.$deltasFold - }); - this.$deltasFold = []; - } - if (this.$deltasDoc) { - this.$deltas.push({ - group: "doc", - deltas: this.$deltasDoc - }); - this.$deltasDoc = []; - } - this.$informUndoManager.schedule(); - } - }; - - this.onChangeFold = function(e) { - var fold = e.data; - this.$resetRowCache(fold.start.row); - }; - - this.onChange = function(e) { - var delta = e.data; - this.$modified = true; - - this.$resetRowCache(delta.range.start.row); - - var removedFolds = this.$updateInternalDataOnChange(e); - if (!this.$fromUndo && this.$undoManager && !delta.ignore) { - this.$deltasDoc.push(delta); - if (removedFolds && removedFolds.length != 0) { - this.$deltasFold.push({ - action: "removeFolds", - folds: removedFolds - }); - } - } - - this.bgTokenizer.start(delta.range.start.row); - this._dispatchEvent("change", e); - }; - - this.setValue = function(text) { - this.doc.setValue(text); - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - this.getUndoManager().reset(); - }; - - this.getValue = - this.toString = function() { - return this.doc.getValue(); - }; - - this.getSelection = function() { - return this.selection; - }; - - this.getState = function(row) { - return this.bgTokenizer.getState(row); - }; - - this.getTokens = function(firstRow, lastRow) { - return this.bgTokenizer.getTokens(firstRow, lastRow); - }; - - this.setUndoManager = function(undoManager) { - this.$undoManager = undoManager; - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - - if (this.$informUndoManager) { - this.$informUndoManager.cancel(); - } - - if (undoManager) { - var self = this; - this.$syncInformUndoManager = function() { - self.$informUndoManager.cancel(); - if (self.$deltas.length > 0) - undoManager.execute({ - action : "aceupdate", - args : [self.$deltas, self] - }); - self.$deltas = []; - } - this.$informUndoManager = - lang.deferredCall(this.$syncInformUndoManager); - } - }; - - this.$defaultUndoManager = { - undo: function() {}, - redo: function() {}, - reset: function() {} - }; - - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager; - }, - - this.getTabString = function() { - if (this.getUseSoftTabs()) { - return lang.stringRepeat(" ", this.getTabSize()); - } else { - return "\t"; - } - }; - - this.$useSoftTabs = true; - this.setUseSoftTabs = function(useSoftTabs) { - if (this.$useSoftTabs === useSoftTabs) return; - - this.$useSoftTabs = useSoftTabs; - }; - - this.getUseSoftTabs = function() { - return this.$useSoftTabs; - }; - - this.$tabSize = 4; - this.setTabSize = function(tabSize) { - if (isNaN(tabSize) || this.$tabSize === tabSize) return; - - this.$modified = true; - this.$tabSize = tabSize; - this._dispatchEvent("changeTabSize"); - }; - - this.getTabSize = function() { - return this.$tabSize; - }; - - this.isTabStop = function(position) { - return this.$useSoftTabs && (position.column % this.$tabSize == 0); - }; - - this.$overwrite = false; - this.setOverwrite = function(overwrite) { - if (this.$overwrite == overwrite) return; - - this.$overwrite = overwrite; - this._dispatchEvent("changeOverwrite"); - }; - - this.getOverwrite = function() { - return this.$overwrite; - }; - - this.toggleOverwrite = function() { - this.setOverwrite(!this.$overwrite); - }; - - this.getBreakpoints = function() { - return this.$breakpoints; - }; - - this.setBreakpoints = function(rows) { - this.$breakpoints = []; - for (var i=0; i 0) { - inToken = !!line.charAt(column - 1).match(this.tokenRe); - } - - if (!inToken) { - inToken = !!line.charAt(column).match(this.tokenRe); - } - - var re = inToken ? this.tokenRe : this.nonTokenRe; - - var start = column; - if (start > 0) { - do { - start--; - } - while (start >= 0 && line.charAt(start).match(re)); - start++; - } - - var end = column; - while (end < line.length && line.charAt(end).match(re)) { - end++; - } - - return new Range(row, start, row, end); - }; - - this.setNewLineMode = function(newLineMode) { - this.doc.setNewLineMode(newLineMode); - }; - - this.getNewLineMode = function() { - return this.doc.getNewLineMode(); - }; - - this.$useWorker = true; - this.setUseWorker = function(useWorker) { - if (this.$useWorker == useWorker) - return; - - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); - }; - - this.getUseWorker = function() { - return this.$useWorker; - }; - - this.onReloadTokenizer = function(e) { - var rows = e.data; - this.bgTokenizer.start(rows.first); - this._dispatchEvent("tokenizerUpdate", e); - }; - - this.$mode = null; - this.setMode = function(mode) { - if (this.$mode === mode) return; - this.$mode = mode; - - this.$stopWorker(); - - if (this.$useWorker) - this.$startWorker(); - - var tokenizer = mode.getTokenizer(); - - if(tokenizer.addEventListener !== undefined) { - var onReloadTokenizer = this.onReloadTokenizer.bind(this); - tokenizer.addEventListener("update", onReloadTokenizer); - } - - if (!this.bgTokenizer) { - this.bgTokenizer = new BackgroundTokenizer(tokenizer); - var _self = this; - this.bgTokenizer.addEventListener("update", function(e) { - _self._dispatchEvent("tokenizerUpdate", e); - }); - } else { - this.bgTokenizer.setTokenizer(tokenizer); - } - - this.bgTokenizer.setDocument(this.getDocument()); - this.bgTokenizer.start(0); - - this._dispatchEvent("changeMode"); - }; - - this.$stopWorker = function() { - if (this.$worker) - this.$worker.terminate(); - - this.$worker = null; - }; - - this.$startWorker = function() { - if (typeof Worker !== "undefined" && !require.noWorker) { - try { - this.$worker = this.$mode.createWorker(this); - } catch (e) { - console.log("Could not load worker"); - console.log(e); - this.$worker = null; - } - } - else - this.$worker = null; - }; - - this.getMode = function() { - return this.$mode; - }; - - this.$scrollTop = 0; - this.setScrollTopRow = function(scrollTopRow) { - if (this.$scrollTop === scrollTopRow) return; - - this.$scrollTop = scrollTopRow; - this._dispatchEvent("changeScrollTop"); - }; - - this.getScrollTopRow = function() { - return this.$scrollTop; - }; - - this.getWidth = function() { - this.$computeWidth(); - return this.width; - }; - - this.getScreenWidth = function() { - this.$computeWidth(); - return this.screenWidth; - }; - - this.$computeWidth = function(force) { - if (this.$modified || force) { - this.$modified = false; - - var lines = this.doc.getAllLines(); - var longestLine = 0; - var longestScreenLine = 0; - - for ( var i = 0; i < lines.length; i++) { - var foldLine = this.getFoldLine(i), - line, len; - - line = lines[i]; - if (foldLine) { - var end = foldLine.range.end; - line = this.getFoldDisplayLine(foldLine); - // Continue after the foldLine.end.row. All the lines in - // between are folded. - i = end.row; - } - len = line.length; - longestLine = Math.max(longestLine, len); - if (!this.$useWrapMode) { - longestScreenLine = Math.max( - longestScreenLine, - this.$getStringScreenWidth(line)[0] - ); - } - } - this.width = longestLine; - - if (this.$useWrapMode) { - this.screenWidth = this.$wrapLimit; - } else { - this.screenWidth = longestScreenLine; - } - } - }; - - /** - * Get a verbatim copy of the given line as it is in the document - */ - this.getLine = function(row) { - return this.doc.getLine(row); - }; - - this.getLines = function(firstRow, lastRow) { - return this.doc.getLines(firstRow, lastRow); - }; - - this.getLength = function() { - return this.doc.getLength(); - }; - - this.getTextRange = function(range) { - return this.doc.getTextRange(range); - }; - - this.findMatchingBracket = function(position) { - if (position.column == 0) return null; - - var charBeforeCursor = this.getLine(position.row).charAt(position.column-1); - if (charBeforeCursor == "") return null; - - var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); - if (!match) { - return null; - } - - if (match[1]) { - return this.$findClosingBracket(match[1], position); - } else { - return this.$findOpeningBracket(match[2], position); - } - }; - - this.$brackets = { - ")": "(", - "(": ")", - "]": "[", - "[": "]", - "{": "}", - "}": "{" - }; - - this.$findOpeningBracket = function(bracket, position) { - var openBracket = this.$brackets[bracket]; - - var column = position.column - 2; - var row = position.row; - var depth = 1; - - var line = this.getLine(row); - - while (true) { - while(column >= 0) { - var ch = line.charAt(column); - if (ch == openBracket) { - depth -= 1; - if (depth == 0) { - return {row: row, column: column}; - } - } - else if (ch == bracket) { - depth +=1; - } - column -= 1; - } - row -=1; - if (row < 0) break; - - var line = this.getLine(row); - var column = line.length-1; - } - return null; - }; - - this.$findClosingBracket = function(bracket, position) { - var closingBracket = this.$brackets[bracket]; - - var column = position.column; - var row = position.row; - var depth = 1; - - var line = this.getLine(row); - var lineCount = this.getLength(); - - while (true) { - while(column < line.length) { - var ch = line.charAt(column); - if (ch == closingBracket) { - depth -= 1; - if (depth == 0) { - return {row: row, column: column}; - } - } - else if (ch == bracket) { - depth +=1; - } - column += 1; - } - row +=1; - if (row >= lineCount) break; - - var line = this.getLine(row); - var column = 0; - } - return null; - }; - - this.insert = function(position, text) { - return this.doc.insert(position, text); - }; - - this.remove = function(range) { - return this.doc.remove(range); - }; - - this.undoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = deltas.length - 1; i != -1; i--) { - delta = deltas[i]; - if (delta.group == "doc") { - this.doc.revertDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, true, lastUndoRange); - } else { - delta.deltas.forEach(function(foldDelta) { - this.addFolds(foldDelta.folds); - }, this); - } - } - this.$fromUndo = false; - lastUndoRange && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }, - - this.redoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = 0; i < deltas.length; i++) { - delta = deltas[i]; - if (delta.group == "doc") { - this.doc.applyDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, false, lastUndoRange); - } - } - this.$fromUndo = false; - lastUndoRange && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }, - - this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { - function isInsert(delta) { - var insert = - delta.action == "insertText" || delta.action == "insertLines"; - return isUndo ? !insert : insert; - } - - var delta = deltas[0]; - var range, point; - var lastDeltaIsInsert = false; - if (isInsert(delta)) { - range = delta.range.clone(); - lastDeltaIsInsert = true; - } else { - range = Range.fromPoints(delta.range.start, delta.range.start); - lastDeltaIsInsert = false; - } - - for (var i = 1; i < deltas.length; i++) { - delta = deltas[i]; - if (isInsert(delta)) { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range.setStart(delta.range.start); - } - point = delta.range.end; - if (range.compare(point.row, point.column) == 1) { - range.setEnd(delta.range.end); - } - lastDeltaIsInsert = true; - } else { - point = delta.range.start; - if (range.compare(point.row, point.column) == -1) { - range = - Range.fromPoints(delta.range.start, delta.range.start); - } - lastDeltaIsInsert = false; - } - } - - // Check if this range and the last undo range has something in common. - // If true, merge the ranges. - if (lastUndoRange != null) { - var cmp = lastUndoRange.compareRange(range); - if (cmp == 1) { - range.setStart(lastUndoRange.start); - } else if (cmp == -1) { - range.setEnd(lastUndoRange.end); - } - } - - return range; - }, - - this.replace = function(range, text) { - return this.doc.replace(range, text); - }; - - /** - * Move a range of text from the given range to the given position. - * - * @param fromRange {Range} The range of text you want moved within the - * document. - * @param toPosition {Object} The location (row and column) where you want - * to move the text to. - * @return {Range} The new range where the text was moved to. - */ - this.moveText = function(fromRange, toPosition) { - var text = this.getTextRange(fromRange); - this.remove(fromRange); - - var toRow = toPosition.row; - var toColumn = toPosition.column; - - // Make sure to update the insert location, when text is removed in - // front of the chosen point of insertion. - if (!fromRange.isMultiLine() && fromRange.start.row == toRow && - fromRange.end.column < toColumn) - toColumn -= text.length; - - if (fromRange.isMultiLine() && fromRange.end.row < toRow) { - var lines = this.doc.$split(text); - toRow -= lines.length - 1; - } - - var endRow = toRow + fromRange.end.row - fromRange.start.row; - var endColumn = fromRange.isMultiLine() ? - fromRange.end.column : - toColumn + fromRange.end.column - fromRange.start.column; - - var toRange = new Range(toRow, toColumn, endRow, endColumn); - - this.insert(toRange.start, text); - - return toRange; - }; - - this.indentRows = function(startRow, endRow, indentString) { - indentString = indentString.replace(/\t/g, this.getTabString()); - for (var row=startRow; row<=endRow; row++) { - this.insert({row: row, column:0}, indentString); - } - }; - - this.outdentRows = function (range) { - var rowRange = range.collapseRows(); - var deleteRange = new Range(0, 0, 0, 0); - var size = this.getTabSize(); - - for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { - var line = this.getLine(i); - - deleteRange.start.row = i; - deleteRange.end.row = i; - for (var j = 0; j < size; ++j) - if (line.charAt(j) != ' ') - break; - if (j < size && line.charAt(j) == '\t') { - deleteRange.start.column = j; - deleteRange.end.column = j + 1; - } else { - deleteRange.start.column = 0; - deleteRange.end.column = j; - } - this.remove(deleteRange); - } - }; - - this.moveLinesUp = function(firstRow, lastRow) { - if (firstRow <= 0) return 0; - - var removed = this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow - 1, removed); - return -1; - }; - - this.moveLinesDown = function(firstRow, lastRow) { - if (lastRow >= this.doc.getLength()-1) return 0; - - var removed = this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow+1, removed); - return 1; - }; - - this.duplicateLines = function(firstRow, lastRow) { - var firstRow = this.$clipRowToDocument(firstRow); - var lastRow = this.$clipRowToDocument(lastRow); - - var lines = this.getLines(firstRow, lastRow); - this.doc.insertLines(firstRow, lines); - - var addedRows = lastRow - firstRow + 1; - return addedRows; - }; - - this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.doc.getLength()-1)); - }; - - // WRAPMODE - this.$wrapLimit = 80; - this.$useWrapMode = false; - this.$wrapLimitRange = { - min : null, - max : null - }; - - this.setUseWrapMode = function(useWrapMode) { - if (useWrapMode != this.$useWrapMode) { - this.$useWrapMode = useWrapMode; - this.$modified = true; - this.$resetRowCache(0); - - // If wrapMode is activaed, the wrapData array has to be initialized. - if (useWrapMode) { - var len = this.getLength(); - this.$wrapData = []; - for (i = 0; i < len; i++) { - this.$wrapData.push([]); - } - this.$updateWrapData(0, len - 1); - } - - this._dispatchEvent("changeWrapMode"); - } - }; - - this.getUseWrapMode = function() { - return this.$useWrapMode; - }; - - // Allow the wrap limit to move freely between min and max. Either - // parameter can be null to allow the wrap limit to be unconstrained - // in that direction. Or set both parameters to the same number to pin - // the limit to that value. - this.setWrapLimitRange = function(min, max) { - if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { - this.$wrapLimitRange.min = min; - this.$wrapLimitRange.max = max; - this.$modified = true; - // This will force a recalculation of the wrap limit - this._dispatchEvent("changeWrapMode"); - } - }; - - // This should generally only be called by the renderer when a resize - // is detected. - this.adjustWrapLimit = function(desiredLimit) { - var wrapLimit = this.$constrainWrapLimit(desiredLimit); - if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { - this.$wrapLimit = wrapLimit; - this.$modified = true; - if (this.$useWrapMode) { - this.$updateWrapData(0, this.getLength() - 1); - this.$resetRowCache(0) - this._dispatchEvent("changeWrapLimit"); - } - return true; - } - return false; - }; - - this.$constrainWrapLimit = function(wrapLimit) { - var min = this.$wrapLimitRange.min; - if (min) - wrapLimit = Math.max(min, wrapLimit); - - var max = this.$wrapLimitRange.max; - if (max) - wrapLimit = Math.min(max, wrapLimit); - - // What would a limit of 0 even mean? - return Math.max(1, wrapLimit); - }; - - this.getWrapLimit = function() { - return this.$wrapLimit; - }; - - this.getWrapLimitRange = function() { - // Avoid unexpected mutation by returning a copy - return { - min : this.$wrapLimitRange.min, - max : this.$wrapLimitRange.max - }; - }; - - this.$updateInternalDataOnChange = function(e) { - var useWrapMode = this.$useWrapMode; - var len; - var action = e.data.action; - var firstRow = e.data.range.start.row, - lastRow = e.data.range.end.row, - start = e.data.range.start, - end = e.data.range.end; - var removedFolds = null; - - if (action.indexOf("Lines") != -1) { - if (action == "insertLines") { - lastRow = firstRow + (e.data.lines.length); - } else { - lastRow = firstRow; - } - len = e.data.lines.length; - } else { - len = lastRow - firstRow; - } - - if (len != 0) { - if (action.indexOf("remove") != -1) { - useWrapMode && this.$wrapData.splice(firstRow, len); - - var foldLines = this.$foldData; - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - var foldLine = this.getFoldLine(end.row); - var idx = 0; - if (foldLine) { - foldLine.addRemoveChars(end.row, end.column, start.column - end.column); - foldLine.shiftRow(-len); - - var foldLineBefore = this.getFoldLine(firstRow); - if (foldLineBefore && foldLineBefore !== foldLine) { - foldLineBefore.merge(foldLine); - foldLine = foldLineBefore; - } - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= end.row) { - foldLine.shiftRow(-len); - } - } - - lastRow = firstRow; - } else { - var args; - if (useWrapMode) { - args = [firstRow, 0]; - for (var i = 0; i < len; i++) args.push([]); - this.$wrapData.splice.apply(this.$wrapData, args); - } - - // If some new line is added inside of a foldLine, then split - // the fold line up. - var foldLines = this.$foldData; - var foldLine = this.getFoldLine(firstRow); - var idx = 0; - if (foldLine) { - var cmp = foldLine.range.compareInside(start.row, start.column) - // Inside of the foldLine range. Need to split stuff up. - if (cmp == 0) { - foldLine = foldLine.split(start.row, start.column); - foldLine.shiftRow(len); - foldLine.addRemoveChars( - lastRow, 0, end.column - start.column); - } else - // Infront of the foldLine but same row. Need to shift column. - if (cmp == -1) { - foldLine.addRemoveChars(firstRow, 0, end.column - start.column); - foldLine.shiftRow(len); - } - // Nothing to do if the insert is after the foldLine. - idx = foldLines.indexOf(foldLine) + 1; - } - - for (idx; idx < foldLines.length; idx++) { - var foldLine = foldLines[idx]; - if (foldLine.start.row >= firstRow) { - foldLine.shiftRow(len); - } - } - } - } else { - // Realign folds. E.g. if you add some new chars before a fold, the - // fold should "move" to the right. - var column; - len = Math.abs(e.data.range.start.column - e.data.range.end.column); - if (action.indexOf("remove") != -1) { - // Get all the folds in the change range and remove them. - removedFolds = this.getFoldsInRange(e.data.range); - this.removeFolds(removedFolds); - - len = -len; - } - var foldLine = this.getFoldLine(firstRow); - if (foldLine) { - foldLine.addRemoveChars(firstRow, start.column, len); - } - } - - if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { - console.error("doc.getLength() and $wrapData.length have to be the same!"); - } - - useWrapMode && this.$updateWrapData(firstRow, lastRow); - - return removedFolds; - }; - - this.$updateWrapData = function(firstRow, lastRow) { - var lines = this.doc.getAllLines(); - var tabSize = this.getTabSize(); - var wrapData = this.$wrapData; - var wrapLimit = this.$wrapLimit; - var tokens; - var foldLine; - - var row = firstRow; - lastRow = Math.min(lastRow, lines.length - 1); - while (row <= lastRow) { - foldLine = this.getFoldLine(row); - if (!foldLine) { - tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row])); - } else { - tokens = []; - foldLine.walk( - function(placeholder, row, column, lastColumn) { - var walkTokens; - if (placeholder) { - walkTokens = this.$getDisplayTokens( - placeholder, tokens.length); - walkTokens[0] = PLACEHOLDER_START; - for (var i = 1; i < walkTokens.length; i++) { - walkTokens[i] = PLACEHOLDER_BODY; - } - } else { - walkTokens = this.$getDisplayTokens( - lines[row].substring(lastColumn, column), - tokens.length); - } - tokens = tokens.concat(walkTokens); - }.bind(this), - foldLine.end.row, - lines[foldLine.end.row].length + 1 - ); - // Remove spaces/tabs from the back of the token array. - while (tokens.length != 0 - && tokens[tokens.length - 1] >= SPACE) - { - tokens.pop(); - } - } - wrapData[row] = - this.$computeWrapSplits(tokens, wrapLimit, tabSize); - - row = this.getRowFoldEnd(row) + 1; - } - }; - - // "Tokens" - var CHAR = 1, - CHAR_EXT = 2, - PLACEHOLDER_START = 3, - PLACEHOLDER_BODY = 4, - SPACE = 10, - TAB = 11, - TAB_SPACE = 12; - - this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) { - if (tokens.length == 0) { - return []; - } - - var tabSize = this.getTabSize(); - var splits = []; - var displayLength = tokens.length; - var lastSplit = 0, lastDocSplit = 0; - - function addSplit(screenPos) { - var displayed = tokens.slice(lastSplit, screenPos); - - // The document size is the current size - the extra width for tabs - // and multipleWidth characters. - var len = displayed.length; - displayed.join(""). - // Get all the TAB_SPACEs. - replace(/12/g, function(m) { - len -= 1; - }). - // Get all the CHAR_EXT/multipleWidth characters. - replace(/2/g, function(m) { - len -= 1; - }); - - lastDocSplit += len; - splits.push(lastDocSplit); - lastSplit = screenPos; - } - - while (displayLength - lastSplit > wrapLimit) { - // This is, where the split should be. - var split = lastSplit + wrapLimit; - - // If there is a space or tab at this split position, then making - // a split is simple. - if (tokens[split] >= SPACE) { - // Include all following spaces + tabs in this split as well. - while (tokens[split] >= SPACE) { - split ++; - } - addSplit(split); - continue; - } - - // === ELSE === - // Check if split is inside of a placeholder. Placeholder are - // not splitable. Therefore, seek the beginning of the placeholder - // and try to place the split beofre the placeholder's start. - if (tokens[split] == PLACEHOLDER_START - || tokens[split] == PLACEHOLDER_BODY) - { - // Seek the start of the placeholder and do the split - // before the placeholder. By definition there always - // a PLACEHOLDER_START between split and lastSplit. - for (split; split != lastSplit - 1; split--) { - if (tokens[split] == PLACEHOLDER_START) { - // split++; << No incremental here as we want to - // have the position before the Placeholder. - break; - } - } - - // If the PLACEHOLDER_START is not the index of the - // last split, then we can do the split - if (split > lastSplit) { - addSplit(split); - continue; - } - - // If the PLACEHOLDER_START IS the index of the last - // split, then we have to place the split after the - // placeholder. So, let's seek for the end of the placeholder. - split = lastSplit + wrapLimit; - for (split; split < tokens.length; split++) { - if (tokens[split] != PLACEHOLDER_BODY) - { - break; - } - } - - // If spilt == tokens.length, then the placeholder is the last - // thing in the line and adding a new split doesn't make sense. - if (split == tokens.length) { - break; // Breaks the while-loop. - } - - // Finally, add the split... - addSplit(split); - continue; - } - - // === ELSE === - // Search for the first non space/tab/placeholder token backwards. - for (split; split != lastSplit - 1; split--) { - if (tokens[split] >= PLACEHOLDER_START) { - split++; - break; - } - } - // If we found one, then add the split. - if (split > lastSplit) { - addSplit(split); - continue; - } - - // === ELSE === - split = lastSplit + wrapLimit; - // The split is inside of a CHAR or CHAR_EXT token and no space - // around -> force a split. - addSplit(lastSplit + wrapLimit); - } - return splits; - } - - /** - * @param - * offset: The offset in screenColumn at which position str starts. - * Important for calculating the realTabSize. - */ - this.$getDisplayTokens = function(str, offset) { - var arr = []; - var tabSize; - offset = offset || 0; - - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // Tab - if (c == 9) { - tabSize = this.getScreenTabSize(arr.length + offset); - arr.push(TAB); - for (var n = 1; n < tabSize; n++) { - arr.push(TAB_SPACE); - } - } - // Space - else if(c == 32) { - arr.push(SPACE); - } - // full width characters - else if (isFullWidth(c)) { - arr.push(CHAR, CHAR_EXT); - } else { - arr.push(CHAR); - } - } - return arr; - } - - /** - * Calculates the width of the a string on the screen while assuming that - * the string starts at the first column on the screen. - * - * @param string str String to calculate the screen width of - * @return array - * [0]: number of columns for str on screen. - * [1]: docColumn position that was read until (useful with screenColumn) - */ - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { - if (maxScreenColumn == 0) { - return [0, 0]; - } - if (maxScreenColumn == null) { - maxScreenColumn = screenColumn + - str.length * Math.max(this.getTabSize(), 2); - } - screenColumn = screenColumn || 0; - - var c, column; - for (column = 0; column < str.length; column++) { - c = str.charCodeAt(column); - // tab - if (c == 9) { - screenColumn += this.getScreenTabSize(screenColumn); - } - // full width characters - else if (isFullWidth(c)) { - screenColumn += 2; - } else { - screenColumn += 1; - } - if (screenColumn > maxScreenColumn) { - break - } - } - - return [screenColumn, column]; - } - - this.getRowLength = function(row) { - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1; - } else { - return this.$wrapData[row].length + 1; - } - } - - this.getRowHeight = function(config, row) { - return this.getRowLength(row) * config.lineHeight; - } - - this.getScreenLastRowColumn = function(screenRow) { - // Note: This won't work if someone has more then - // 1.7976931348623158e+307 characters in one row. But I think we can - // live with this limitation ;) - return this.screenToDocumentColumn(screenRow, Number.MAX_VALUE / 10) - }; - - this.getDocumentLastRowColumn = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.getScreenLastRowColumn(screenRow); - }; - - this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); - }; - - this.getRowSplitData = function(row) { - if (!this.$useWrapMode) { - return undefined; - } else { - return this.$wrapData[row]; - } - }; - - /** - * Returns the width of a tab character at screenColumn. - */ - this.getScreenTabSize = function(screenColumn) { - return this.$tabSize - screenColumn % this.$tabSize; - }; - - this.screenToDocumentRow = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).row; - }; - - this.screenToDocumentColumn = function(screenRow, screenColumn) { - return this.screenToDocumentPosition(screenRow, screenColumn).column; - }; - - this.screenToDocumentPosition = function(screenRow, screenColumn) { - var line; - var docRow = 0; - var docColumn = 0; - var column; - var foldLineRowLength; - var row = 0; - var rowLength = 0; - var splits = null; - - var rowCache = this.$rowCache; - var doCache = !rowCache.length; - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].screenRow < screenRow) { - row = rowCache[i].screenRow; - docRow = rowCache[i].docRow; - doCache = i == rowCache.length - 1; - } - } - var docRowCacheLast = docRow; - // clamp row before clamping column, for selection on last line - var maxRow = this.getLength() - 1; - - var foldLine = this.getNextFold(docRow); - var foldStart = foldLine ?foldLine.start.row :Infinity; - - while (row <= screenRow) { - if (doCache - && docRow - docRowCacheLast > this.$rowCacheSize) { - rowCache.push({ - docRow: docRow, - screenRow: row - }); - docRowCacheLast = docRow; - } - rowLength = this.getRowLength(docRow); - if (row + rowLength - 1 >= screenRow || docRow >= maxRow) { - break; - } else { - row += rowLength; - docRow++; - if(docRow > foldStart) { - docRow = foldLine.end.row+1; - foldLine = this.getNextFold(docRow); - foldStart = foldLine ?foldLine.start.row :Infinity; - } - } - } - - if (foldLine && foldLine.start.row <= docRow) - line = this.getFoldDisplayLine(foldLine); - else { - line = this.getLine(docRow); - foldLine = null; - } - - if (this.$useWrapMode) { - splits = this.$wrapData[docRow]; - if (splits) { - column = splits[screenRow - row] - if(screenRow > row && splits.length) { - docColumn = splits[screenRow - row - 1] || splits[splits.length - 1]; - line = line.substring(docColumn); - } - } - } - - docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; - - // Need to do some clamping action here. - if (this.$useWrapMode) { - if (docColumn >= column) { - // We remove one character at the end such that the docColumn - // position returned is not associated to the next row on the - // screen. - docColumn = column - 1; - } - } else { - docColumn = Math.min(docColumn, line.length); - } - - if (foldLine) { - return foldLine.idxToPosition(docColumn); - } - - return { - row: docRow, - column: docColumn - } - }; - - this.documentToScreenPosition = function(docRow, docColumn) { - // Normalize the passed in arguments. - if (docColumn == null) { - docColumn = docRow.column; - docRow = docRow.row; - } - - var wrapData; - // Special case in wrapMode if the doc is at the end of the document. - if (this.$useWrapMode) { - wrapData = this.$wrapData; - if (docRow > wrapData.length - 1) { - return { - row: this.getScreenLength(), - column: wrapData.length == 0 - ? 0 - : (wrapData[wrapData.length - 1].length - 1) - }; - } - } - - var screenRow = 0; - var screenColumn = 0; - var foldStartRow = null; - var fold = null; - - // Clamp the docRow position in case it's inside of a folded block. - fold = this.getFoldAt(docRow, docColumn, 1); - if (fold) { - docRow = fold.start.row; - docColumn = fold.start.column; - } - - var rowEnd, row = 0; - var rowCache = this.$rowCache; - // - var doCache = !rowCache.length; - for (var i = 0; i < rowCache.length; i++) { - if (rowCache[i].docRow < docRow) { - screenRow = rowCache[i].screenRow; - row = rowCache[i].docRow; - doCache = i == rowCache.length - 1; - } - } - var docRowCacheLast = row; - - var foldLine = this.getNextFold(row); - var foldStart = foldLine ?foldLine.start.row :Infinity; - - while (row < docRow) { - if (row >= foldStart) { - rowEnd = foldLine.end.row + 1; - if (rowEnd > docRow) - break; - foldLine = this.getNextFold(rowEnd); - foldStart = foldLine ?foldLine.start.row :Infinity; - } else { - rowEnd = row + 1; - } - if (doCache - && row - docRowCacheLast > this.$rowCacheSize) { - rowCache.push({ - docRow: row, - screenRow: screenRow - }); - docRowCacheLast = row; - } - - screenRow += this.getRowLength(row); - row = rowEnd; - } - - // Calculate the text line that is displayed in docRow on the screen. - var textLine = ""; - // Check if the final row we want to reach is inside of a fold. - if (foldLine && row >= foldStart) { - textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); - foldStartRow = foldLine.start.row; - } else { - textLine = this.getLine(docRow).substring(0, docColumn); - foldStartRow = docRow; - } - // Clamp textLine if in wrapMode. - if (this.$useWrapMode) { - var wrapRow = wrapData[foldStartRow]; - var screenRowOffset = 0; - while (textLine.length >= wrapRow[screenRowOffset]) { - screenRow ++; - screenRowOffset++; - } - textLine = textLine.substring( - wrapRow[screenRowOffset - 1] || 0, textLine.length); - } - - return { - row: screenRow, - column: this.$getStringScreenWidth(textLine)[0] - }; - }; - - this.documentToScreenColumn = function(row, docColumn) { - return this.documentToScreenPosition(row, docColumn).column; - }; - - this.documentToScreenRow = function(docRow, docColumn) { - return this.documentToScreenPosition(docRow, docColumn).row; - }; - - this.getScreenLength = function() { - var screenRows = 0; - var lastFoldLine = null; - var foldLine = null; - if (!this.$useWrapMode) { - screenRows = this.getLength(); - - // Remove the folded lines again. - var foldData = this.$foldData; - for (var i = 0; i < foldData.length; i++) { - foldLine = foldData[i]; - screenRows -= foldLine.end.row - foldLine.start.row; - } - } else { - for (var row = 0; row < this.$wrapData.length; row++) { - if (foldLine = this.getFoldLine(row, lastFoldLine)) { - row = foldLine.end.row; - screenRows += 1; - } else { - screenRows += this.$wrapData[row].length + 1; - } - } - } - - return screenRows; - } - - // For every keystroke this gets called once per char in the whole doc!! - // Wouldn't hurt to make it a bit faster for c >= 0x1100 - function isFullWidth(c) { - if (c < 0x1100) - return false; - return c >= 0x1100 && c <= 0x115F || - c >= 0x11A3 && c <= 0x11A7 || - c >= 0x11FA && c <= 0x11FF || - c >= 0x2329 && c <= 0x232A || - c >= 0x2E80 && c <= 0x2E99 || - c >= 0x2E9B && c <= 0x2EF3 || - c >= 0x2F00 && c <= 0x2FD5 || - c >= 0x2FF0 && c <= 0x2FFB || - c >= 0x3000 && c <= 0x303E || - c >= 0x3041 && c <= 0x3096 || - c >= 0x3099 && c <= 0x30FF || - c >= 0x3105 && c <= 0x312D || - c >= 0x3131 && c <= 0x318E || - c >= 0x3190 && c <= 0x31BA || - c >= 0x31C0 && c <= 0x31E3 || - c >= 0x31F0 && c <= 0x321E || - c >= 0x3220 && c <= 0x3247 || - c >= 0x3250 && c <= 0x32FE || - c >= 0x3300 && c <= 0x4DBF || - c >= 0x4E00 && c <= 0xA48C || - c >= 0xA490 && c <= 0xA4C6 || - c >= 0xA960 && c <= 0xA97C || - c >= 0xAC00 && c <= 0xD7A3 || - c >= 0xD7B0 && c <= 0xD7C6 || - c >= 0xD7CB && c <= 0xD7FB || - c >= 0xF900 && c <= 0xFAFF || - c >= 0xFE10 && c <= 0xFE19 || - c >= 0xFE30 && c <= 0xFE52 || - c >= 0xFE54 && c <= 0xFE66 || - c >= 0xFE68 && c <= 0xFE6B || - c >= 0xFF01 && c <= 0xFF60 || - c >= 0xFFE0 && c <= 0xFFE6; - }; - -}).call(EditSession.prototype); - -require("ace/edit_session/folding").Folding.call(EditSession.prototype); - -exports.EditSession = EditSession; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/selection', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/lang', 'pilot/event_emitter', 'ace/range'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; -var Range = require("ace/range").Range; - -var Selection = function(session) { - this.session = session; - this.doc = session.getDocument(); - - this.clearSelection(); - this.selectionLead = this.doc.createAnchor(0, 0); - this.selectionAnchor = this.doc.createAnchor(0, 0); - - var _self = this; - this.selectionLead.on("change", function(e) { - _self._dispatchEvent("changeCursor"); - if (!_self.$isEmpty) - _self._dispatchEvent("changeSelection"); - if (e.old.row == e.value.row) - _self.$updateDesiredColumn(); - }); - - this.selectionAnchor.on("change", function() { - if (!_self.$isEmpty) - _self._dispatchEvent("changeSelection"); - }); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.isEmpty = function() { - return (this.$isEmpty || ( - this.selectionAnchor.row == this.selectionLead.row && - this.selectionAnchor.column == this.selectionLead.column - )); - }; - - this.isMultiLine = function() { - if (this.isEmpty()) { - return false; - } - - return this.getRange().isMultiLine(); - }; - - this.getCursor = function() { - return this.selectionLead.getPosition(); - }; - - this.setSelectionAnchor = function(row, column) { - this.selectionAnchor.setPosition(row, column); - - if (this.$isEmpty) { - this.$isEmpty = false; - this._dispatchEvent("changeSelection"); - } - }; - - this.getSelectionAnchor = function() { - if (this.$isEmpty) - return this.getSelectionLead() - else - return this.selectionAnchor.getPosition(); - }; - - this.getSelectionLead = function() { - return this.selectionLead.getPosition(); - }; - - this.shiftSelection = function(columns) { - if (this.$isEmpty) { - this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); - return; - }; - - var anchor = this.getSelectionAnchor(); - var lead = this.getSelectionLead(); - - var isBackwards = this.isBackwards(); - - if (!isBackwards || anchor.column !== 0) - this.setSelectionAnchor(anchor.row, anchor.column + columns); - - if (isBackwards || lead.column !== 0) { - this.$moveSelection(function() { - this.moveCursorTo(lead.row, lead.column + columns); - }); - } - }; - - this.isBackwards = function() { - var anchor = this.selectionAnchor; - var lead = this.selectionLead; - return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); - }; - - this.getRange = function() { - var anchor = this.selectionAnchor; - var lead = this.selectionLead; - - if (this.isEmpty()) - return Range.fromPoints(lead, lead); - - if (this.isBackwards()) { - return Range.fromPoints(lead, anchor); - } - else { - return Range.fromPoints(anchor, lead); - } - }; - - this.clearSelection = function() { - if (!this.$isEmpty) { - this.$isEmpty = true; - this._dispatchEvent("changeSelection"); - } - }; - - this.selectAll = function() { - var lastRow = this.doc.getLength() - 1; - this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); - this.moveCursorTo(0, 0); - }; - - this.setSelectionRange = function(range, reverse) { - if (reverse) { - this.setSelectionAnchor(range.end.row, range.end.column); - this.selectTo(range.start.row, range.start.column); - } else { - this.setSelectionAnchor(range.start.row, range.start.column); - this.selectTo(range.end.row, range.end.column); - } - this.$updateDesiredColumn(); - }; - - this.$updateDesiredColumn = function() { - var cursor = this.getCursor(); - this.$desiredColumn = this.session.documentToScreenColumn(cursor.row, cursor.column); - }; - - this.$moveSelection = function(mover) { - var lead = this.selectionLead; - if (this.$isEmpty) - this.setSelectionAnchor(lead.row, lead.column); - - mover.call(this); - }; - - this.selectTo = function(row, column) { - this.$moveSelection(function() { - this.moveCursorTo(row, column); - }); - }; - - this.selectToPosition = function(pos) { - this.$moveSelection(function() { - this.moveCursorToPosition(pos); - }); - }; - - this.selectUp = function() { - this.$moveSelection(this.moveCursorUp); - }; - - this.selectDown = function() { - this.$moveSelection(this.moveCursorDown); - }; - - this.selectRight = function() { - this.$moveSelection(this.moveCursorRight); - }; - - this.selectLeft = function() { - this.$moveSelection(this.moveCursorLeft); - }; - - this.selectLineStart = function() { - this.$moveSelection(this.moveCursorLineStart); - }; - - this.selectLineEnd = function() { - this.$moveSelection(this.moveCursorLineEnd); - }; - - this.selectFileEnd = function() { - this.$moveSelection(this.moveCursorFileEnd); - }; - - this.selectFileStart = function() { - this.$moveSelection(this.moveCursorFileStart); - }; - - this.selectWordRight = function() { - this.$moveSelection(this.moveCursorWordRight); - }; - - this.selectWordLeft = function() { - this.$moveSelection(this.moveCursorWordLeft); - }; - - this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); - }; - - this.selectLine = function() { - var rowStart = this.selectionLead.row; - var rowEnd; - - var foldLine = this.session.getFoldLine(rowStart); - if (foldLine) { - rowStart = foldLine.start.row; - rowEnd = foldLine.end.row; - } else { - rowEnd = rowStart; - } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); - }; - - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0); - }; - - this.moveCursorDown = function() { - this.moveCursorBy(1, 0); - }; - - this.moveCursorLeft = function() { - var cursor = this.selectionLead.getPosition(), - fold; - - if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - } else if (cursor.column == 0) { - // cursor is a line (start - if (cursor.row > 0) { - this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); - } - } - else { - var tabSize = this.session.getTabSize(); - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize) - this.moveCursorBy(0, -tabSize); - else - this.moveCursorBy(0, -1); - } - }; - - this.moveCursorRight = function() { - var cursor = this.selectionLead.getPosition(), - fold; - if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { - this.moveCursorTo(fold.end.row, fold.end.column); - } else if (this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) { - if (this.selectionLead.row < this.doc.getLength() - 1) { - this.moveCursorTo(this.selectionLead.row + 1, 0); - } - } - else { - var tabSize = this.session.getTabSize(); - var cursor = this.selectionLead; - if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize) - this.moveCursorBy(0, tabSize); - else - this.moveCursorBy(0, 1); - } - }; - - this.moveCursorLineStart = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - var screenRow = this.session.documentToScreenRow(row, column); - - // Determ the doc-position of the first character at the screen line. - var firstColumnPosition = - this.session.screenToDocumentPosition(screenRow, 0); - - // Determ the string "before" the cursor. - var beforeCursor = this.session.getDisplayLine( - row, column, - firstColumnPosition.row, firstColumnPosition.column); - - // - var leadingSpace = beforeCursor.match(/^\s*/); - if (leadingSpace[0].length == 0 - || leadingSpace[0].length >= column - firstColumnPosition.column) - { - this.moveCursorTo( - firstColumnPosition.row, firstColumnPosition.column); - } else { - this.moveCursorTo( - firstColumnPosition.row, - firstColumnPosition.column + leadingSpace[0].length); - } - }; - - this.moveCursorLineEnd = function() { - var lead = this.selectionLead; - var lastRowColumnPosition = - this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); - this.moveCursorTo( - lastRowColumnPosition.row, - lastRowColumnPosition.column - ); - }; - - this.moveCursorFileEnd = function() { - var row = this.doc.getLength() - 1; - var column = this.doc.getLine(row).length; - this.moveCursorTo(row, column); - }; - - this.moveCursorFileStart = function() { - this.moveCursorTo(0, 0); - }; - - this.moveCursorWordRight = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - var line = this.doc.getLine(row); - var rightOfCursor = line.substring(column); - - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - - var fold; - if (fold = this.session.getFoldAt(row, column, 1)) { - this.moveCursorTo(fold.end.row, fold.end.column); - return; - } else if (column == line.length) { - this.moveCursorRight(); - return; - } - else if (match = this.session.nonTokenRe.exec(rightOfCursor)) { - column += this.session.nonTokenRe.lastIndex; - this.session.nonTokenRe.lastIndex = 0; - } - else if (match = this.session.tokenRe.exec(rightOfCursor)) { - column += this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - - this.moveCursorWordLeft = function() { - var row = this.selectionLead.row; - var column = this.selectionLead.column; - - var fold; - if (fold = this.session.getFoldAt(row, column, -1)) { - this.moveCursorTo(fold.start.row, fold.start.column); - return; - } - - if (column == 0) { - this.moveCursorLeft(); - return; - } - - var str = this.session.getFoldStringAt(row, column, -1); - if (str == null) { - str = this.doc.getLine(row).substring(0, column) - } - var leftOfCursor = lang.stringReverse(str); - - var match; - this.session.nonTokenRe.lastIndex = 0; - this.session.tokenRe.lastIndex = 0; - - if (match = this.session.nonTokenRe.exec(leftOfCursor)) { - column -= this.session.nonTokenRe.lastIndex; - this.session.nonTokenRe.lastIndex = 0; - } - else if (match = this.session.tokenRe.exec(leftOfCursor)) { - column -= this.session.tokenRe.lastIndex; - this.session.tokenRe.lastIndex = 0; - } - - this.moveCursorTo(row, column); - }; - - this.moveCursorBy = function(rows, chars) { - var screenPos = this.session.documentToScreenPosition( - this.selectionLead.row, - this.selectionLead.column - ); - var screenCol = (chars == 0 && this.$desiredColumn) || screenPos.column; - var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenCol); - - this.moveCursorTo(docPos.row, docPos.column + chars, chars == 0); - }; - - this.moveCursorToPosition = function(position) { - this.moveCursorTo(position.row, position.column); - }; - - this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) { - // Ensure the row/column is not inside of a fold. - var fold = this.session.getFoldAt(row, column, 1); - if (fold) { - row = fold.start.row; - column = fold.start.column; - } - this.selectionLead.setPosition(row, column); - if (!preventUpdateDesiredColumn) - this.$updateDesiredColumn(this.selectionLead.column); - }; - - this.moveCursorToScreen = function(row, column, preventUpdateDesiredColumn) { - var pos = this.session.screenToDocumentPosition(row, column); - row = pos.row; - column = pos.column; - this.moveCursorTo(row, column, preventUpdateDesiredColumn); - }; - -}).call(Selection.prototype); - -exports.Selection = Selection; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) { - -var Range = function(startRow, startColumn, endRow, endColumn) { - this.start = { - row: startRow, - column: startColumn - }; - - this.end = { - row: endRow, - column: endColumn - }; -}; - -(function() { - - this.toString = function() { - return ("Range: [" + this.start.row + "/" + this.start.column + - "] -> [" + this.end.row + "/" + this.end.column + "]"); - }; - - this.contains = function(row, column) { - return this.compare(row, column) == 0; - }; - - /** - * Compares this range (A) with another range (B), where B is the passed in - * range. - * - * Return values: - * -2: (B) is infront of (A) and doesn't intersect with (A) - * -1: (B) begins before (A) but ends inside of (A) - * 0: (B) is completly inside of (A) OR (A) is complety inside of (B) - * +1: (B) begins inside of (A) but ends outside of (A) - * +2: (B) is after (A) and doesn't intersect with (A) - * - * 42: FTW state: (B) ends in (A) but starts outside of (A) - */ - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - - cmp = this.compare(end.row, end.column); - if (cmp == 1) { - cmp = this.compare(start.row, start.column); - if (cmp == 1) { - return 2; - } else if (cmp == 0) { - return 1; - } else { - return 0; - } - } else if (cmp == -1) { - return -2; - } else { - cmp = this.compare(start.row, start.column); - if (cmp == -1) { - return -1; - } else if (cmp == 1) { - return 42; - } else { - return 0; - } - } - } - - this.containsRange = function(range) { - var cmp = this.compareRange(range); - return (cmp == -1 || cmp == 0 || cmp == 1); - } - - this.isEnd = function(row, column) { - return this.end.row == row && this.end.column == column; - } - - this.isStart = function(row, column) { - return this.start.row == row && this.start.column == column; - } - - this.setStart = function(row, column) { - if (typeof row == "object") { - this.start.column = row.column; - this.start.row = row.row; - } else { - this.start.row = row; - this.start.column = column; - } - } - - this.setEnd = function(row, column) { - if (typeof row == "object") { - this.end.column = row.column; - this.end.row = row.row; - } else { - this.end.row = row; - this.end.column = column; - } - } - - this.inside = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column) || this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.insideStart = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isEnd(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.insideEnd = function(row, column) { - if (this.compare(row, column) == 0) { - if (this.isStart(row, column)) { - return false; - } else { - return true; - } - } - return false; - } - - this.compare = function(row, column) { - if (!this.isMultiLine()) { - if (row === this.start.row) { - return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); - }; - } - - if (row < this.start.row) - return -1; - - if (row > this.end.row) - return 1; - - if (this.start.row === row) - return column >= this.start.column ? 0 : -1; - - if (this.end.row === row) - return column <= this.end.column ? 0 : 1; - - return 0; - }; - - /** - * Like .compare(), but if isStart is true, return -1; - */ - this.compareStart = function(row, column) { - if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - } - - /** - * Like .compare(), but if isEnd is true, return 1; - */ - this.compareEnd = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else { - return this.compare(row, column); - } - } - - this.compareInside = function(row, column) { - if (this.end.row == row && this.end.column == column) { - return 1; - } else if (this.start.row == row && this.start.column == column) { - return -1; - } else { - return this.compare(row, column); - } - } - - this.clipRows = function(firstRow, lastRow) { - if (this.end.row > lastRow) { - var end = { - row: lastRow+1, - column: 0 - }; - } - - if (this.start.row > lastRow) { - var start = { - row: lastRow+1, - column: 0 - }; - } - - if (this.start.row < firstRow) { - var start = { - row: firstRow, - column: 0 - }; - } - - if (this.end.row < firstRow) { - var end = { - row: firstRow, - column: 0 - }; - } - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.extend = function(row, column) { - var cmp = this.compare(row, column); - - if (cmp == 0) - return this; - else if (cmp == -1) - var start = {row: row, column: column}; - else - var end = {row: row, column: column}; - - return Range.fromPoints(start || this.start, end || this.end); - }; - - this.isEmpty = function() { - return (this.start.row == this.end.row && this.start.column == this.end.column); - }; - - this.isMultiLine = function() { - return (this.start.row !== this.end.row); - }; - - this.clone = function() { - return Range.fromPoints(this.start, this.end); - }; - - this.collapseRows = function() { - if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) - else - return new Range(this.start.row, 0, this.end.row, 0) - }; - - this.toScreenRange = function(session) { - var screenPosStart = - session.documentToScreenPosition(this.start); - var screenPosEnd = - session.documentToScreenPosition(this.end); - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); - }; - -}).call(Range.prototype); - - -Range.fromPoints = function(start, end) { - return new Range(start.row, start.column, end.row, end.column); -}; - -exports.Range = Range; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * Chris Spencer - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/text', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/behaviour'], function(require, exports, module) { - -var Tokenizer = require("ace/tokenizer").Tokenizer; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; -var Behaviour = require("ace/mode/behaviour").Behaviour; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); - this.$behaviour = new Behaviour(); -}; - -(function() { - - this.getTokenizer = function() { - return this.$tokenizer; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - }; - - this.getNextLineIndent = function(state, line, tab) { - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - - this.createWorker = function(session) { - return null; - }; - - this.highlightSelection = function(editor) { - var session = editor.session; - if (!session.$selectionOccurrences) - session.$selectionOccurrences = []; - - if (session.$selectionOccurrences.length) - this.clearSelectionHighlight(editor); - - var selection = editor.getSelectionRange(); - if (selection.isEmpty() || selection.isMultiLine()) - return; - - var startOuter = selection.start.column - 1; - var endOuter = selection.end.column + 1; - var line = session.getLine(selection.start.row); - var lineCols = line.length; - var needle = line.substring(Math.max(startOuter, 0), - Math.min(endOuter, lineCols)); - - // Make sure the outer characters are not part of the word. - if ((startOuter >= 0 && /^[\w\d]/.test(needle)) || - (endOuter <= lineCols && /[\w\d]$/.test(needle))) - return; - - needle = line.substring(selection.start.column, selection.end.column); - if (!/^[\w\d]+$/.test(needle)) - return; - - var cursor = editor.getCursorPosition(); - - var newOptions = { - wrap: true, - wholeWord: true, - caseSensitive: true, - needle: needle - }; - - var currentOptions = editor.$search.getOptions(); - editor.$search.set(newOptions); - - var ranges = editor.$search.findAll(session); - ranges.forEach(function(range) { - if (!range.contains(cursor.row, cursor.column)) { - var marker = session.addMarker(range, "ace_selected_word"); - session.$selectionOccurrences.push(marker); - } - }); - - editor.$search.set(currentOptions); - }; - - this.clearSelectionHighlight = function(editor) { - if (!editor.session.$selectionOccurrences) - return; - - editor.session.$selectionOccurrences.forEach(function(marker) { - editor.session.removeMarker(marker); - }); - - editor.session.$selectionOccurrences = []; - }; - - this.createModeDelegates = function (mapping) { - if (!this.$embeds) { - return; - } - this.$modes = {}; - for (var i = 0; i < this.$embeds.length; i++) { - if (mapping[this.$embeds[i]]) { - this.$modes[this.$embeds[i]] = new mapping[this.$embeds[i]](); - } - } - - var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction']; - - for (var i = 0; i < delegations.length; i++) { - (function(scope) { - var functionName = delegations[i]; - var defaultHandler = scope[functionName]; - scope[delegations[i]] = function() { - return this.$delegator(functionName, arguments, defaultHandler); - } - } (this)); - } - } - - this.$delegator = function(method, args, defaultHandler) { - var state = args[0]; - - for (var i = 0; i < this.$embeds.length; i++) { - if (!this.$modes[this.$embeds[i]]) continue; - - var split = state.split(this.$embeds[i]); - if (!split[0] && split[1]) { - args[0] = split[1]; - var mode = this.$modes[this.$embeds[i]]; - return mode[method].apply(mode, args); - } - } - var ret = defaultHandler.apply(this, args); - return defaultHandler ? ret : undefined; - }; - - this.transformAction = function(state, action, editor, session, param) { - if (this.$behaviour) { - var behaviours = this.$behaviour.getBehaviours(); - for (var key in behaviours) { - if (behaviours[key][action]) { - var ret = behaviours[key][action].apply(this, arguments); - if (ret !== false) { - return ret; - } - } - } - } - return false; - } - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/tokenizer', ['require', 'exports', 'module' ], function(require, exports, module) { - -var Tokenizer = function(rules) { - this.rules = rules; - - this.regExps = {}; - this.matchMappings = {}; - for ( var key in this.rules) { - var rule = this.rules[key]; - var state = rule; - var ruleRegExps = []; - var matchTotal = 0; - var mapping = this.matchMappings[key] = {}; - - for ( var i = 0; i < state.length; i++) { - // Count number of matching groups. 2 extra groups from the full match - // And the catch-all on the end (used to force a match); - var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; - - // Replace any backreferences and offset appropriately. - var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - - mapping[matchTotal] = { - rule: i, - len: matchcount - }; - matchTotal += matchcount; - - ruleRegExps.push(adjustedregex); - } - - this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); - - } -}; - -(function() { - - this.getLineTokens = function(line, startState) { - var currentState = startState; - var state = this.rules[currentState]; - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - re.lastIndex = 0; - - var match, tokens = []; - - var lastIndex = 0; - - var token = { - type: null, - value: "" - }; - - while (match = re.exec(line)) { - var type = "text"; - var value = [match[0]]; - - for ( var i = 0; i < match.length-2; i++) { - if (match[i + 1] !== undefined) { - var rule = state[mapping[i].rule]; - - if (mapping[i].len > 1) { - value = match.slice(i+2, i+1+mapping[i].len); - } - - if (typeof rule.token == "function") - type = rule.token.apply(this, value); - else - type = rule.token; - - if (rule.next && rule.next !== currentState) { - currentState = rule.next; - state = this.rules[currentState]; - mapping = this.matchMappings[currentState]; - lastIndex = re.lastIndex; - - re = this.regExps[currentState]; - re.lastIndex = lastIndex; - } - break; - } - }; - - if (typeof type == "string") { - if (typeof value != "string") { - value = [value.join("")]; - } - type = [type]; - } - - for ( var i = 0; i < value.length; i++) { - if (token.type !== type[i]) { - if (token.type) { - tokens.push(token); - } - - token = { - type: type[i], - value: value[i] - } - } else { - token.value += value[i]; - } - } - - if (lastIndex == line.length) - break; - - lastIndex = re.lastIndex; - }; - - if (token.type) - tokens.push(token); - - return { - tokens : tokens, - state : currentState - }; - }; - -}).call(Tokenizer.prototype); - -exports.Tokenizer = Tokenizer; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/text_highlight_rules', ['require', 'exports', 'module' , 'pilot/lang'], function(require, exports, module) { - -var lang = require("pilot/lang"); - -var TextHighlightRules = function() { - - // regexp must not have capturing parentheses - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ { - token : "empty_line", - regex : '^$' - }, { - token : "text", - regex : ".+" - } ] - }; -}; - -(function() { - - this.addRules = function(rules, prefix) { - for (var key in rules) { - var state = rules[key]; - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/behaviour', ['require', 'exports', 'module' ], function(require, exports, module) { - -var Behaviour = function() { - this.$behaviours = {}; -}; - -(function () { - - this.add = function (name, action, callback) { - switch (undefined) { - case this.$behaviours: - this.$behaviours = {}; - case this.$behaviours[name]: - this.$behaviours[name] = {}; - } - this.$behaviours[name][action] = callback; - } - - this.addBehaviours = function (behaviours) { - for (var key in behaviours) { - for (var action in behaviours[key]) { - this.add(key, action, behaviours[key][action]); - } - } - } - - this.remove = function (name) { - if (this.$behaviours && this.$behaviours[name]) { - delete this.$behaviours[name]; - } - } - - this.inherit = function (mode, filter) { - if (typeof mode === "function") { - var behaviours = new mode().getBehaviours(filter); - } else { - var behaviours = mode.getBehaviours(filter); - } - this.addBehaviours(behaviours); - } - - this.getBehaviours = function (filter) { - if (!filter) { - return this.$behaviours; - } else { - var ret = {} - for (var i = 0; i < filter.length; i++) { - if (this.$behaviours[filter[i]]) { - ret[filter[i]] = this.$behaviours[filter[i]]; - } - } - return ret; - } - } - -}).call(Behaviour.prototype); - -exports.Behaviour = Behaviour; -});/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/document', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; -var Range = require("ace/range").Range; -var Anchor = require("ace/anchor").Anchor; - -var Document = function(text) { - this.$lines = []; - - if (Array.isArray(text)) { - this.insertLines(0, text); - } - // There has to be one line at least in the document. If you pass an empty - // string to the insert function, nothing will happen. Workaround. - else if (text.length == 0) { - this.$lines = [""]; - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.setValue = function(text) { - var len = this.getLength(); - this.remove(new Range(0, 0, len, this.getLine(len-1).length)); - this.insert({row: 0, column:0}, text); - }; - - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - - // check for IE split bug - if ("aaa".split(/a/).length == 0) - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - } - else - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - - - this.$detectNewLine = function(text) { - var match = text.match(/^.*?(\r?\n)/m); - if (match) { - this.$autoNewLine = match[1]; - } else { - this.$autoNewLine = "\n"; - } - }; - - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - - case "unix": - return "\n"; - - case "auto": - return this.$autoNewLine; - } - }, - - this.$autoNewLine = "\n"; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) return; - - this.$newLineMode = newLineMode; - }; - - this.getNewLineMode = function() { - return this.$newLineMode; - }; - - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - - /** - * Get a verbatim copy of the given line as it is in the document - */ - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - - /** - * Returns all lines in the document as string array. Warning: The caller - * should not modify this array! - */ - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - - this.getLength = function() { - return this.$lines.length; - }; - - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.$lines[range.start.row].substring(range.start.column, - range.end.column); - } - else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); - return lines.join(this.getNewLineCharacter()); - } - }; - - this.$clipPosition = function(position) { - var length = this.getLength(); - if (position.row >= length) { - position.row = Math.max(0, length - 1); - position.column = this.getLine(length-1).length; - } - return position; - } - - this.insert = function(position, text) { - if (text.length == 0) - return position; - - position = this.$clipPosition(position); - - if (this.getLength() <= 1) - this.$detectNewLine(text); - - var lines = this.$split(text); - var firstLine = lines.splice(0, 1)[0]; - var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; - - this._dispatchEvent("changeStart"); - position = this.insertInLine(position, firstLine); - if (lastLine !== null) { - position = this.insertNewLine(position); // terminate first line - position = this.insertLines(position.row, lines); - position = this.insertInLine(position, lastLine || ""); - } - this._dispatchEvent("changeEnd"); - return position; - }; - - this.insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - - var args = [row, 0]; - args.push.apply(args, lines); - this.$lines.splice.apply(this.$lines, args); - - this._dispatchEvent("changeStart"); - var range = new Range(row, 0, row + lines.length, 0); - var delta = { - action: "insertLines", - range: range, - lines: lines - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - return range.end; - }, - - this.insertNewLine = function(position) { - position = this.$clipPosition(position); - var line = this.$lines[position.row] || ""; - - this._dispatchEvent("changeStart"); - this.$lines[position.row] = line.substring(0, position.column); - this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); - - var end = { - row : position.row + 1, - column : 0 - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: this.getNewLineCharacter() - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - - return end; - }; - - this.insertInLine = function(position, text) { - if (text.length == 0) - return position; - - var line = this.$lines[position.row] || ""; - - this._dispatchEvent("changeStart"); - this.$lines[position.row] = line.substring(0, position.column) + text - + line.substring(position.column); - - var end = { - row : position.row, - column : position.column + text.length - }; - - var delta = { - action: "insertText", - range: Range.fromPoints(position, end), - text: text - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - - return end; - }; - - this.remove = function(range) { - // clip to document - range.start = this.$clipPosition(range.start); - range.end = this.$clipPosition(range.end); - - if (range.isEmpty()) - return range.start; - - var firstRow = range.start.row; - var lastRow = range.end.row; - - this._dispatchEvent("changeStart"); - if (range.isMultiLine()) { - var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; - var lastFullRow = lastRow - 1; - - if (range.end.column > 0) - this.removeInLine(lastRow, 0, range.end.column); - - if (lastFullRow >= firstFullRow) - this.removeLines(firstFullRow, lastFullRow); - - if (firstFullRow != firstRow) { - this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); - this.removeNewLine(range.start.row); - } - } - else { - this.removeInLine(firstRow, range.start.column, range.end.column); - } - this._dispatchEvent("changeEnd"); - return range.start; - }; - - this.removeInLine = function(row, startColumn, endColumn) { - if (startColumn == endColumn) - return; - - var range = new Range(row, startColumn, row, endColumn); - var line = this.getLine(row); - var removed = line.substring(startColumn, endColumn); - var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); - this._dispatchEvent("changeStart"); - this.$lines.splice(row, 1, newLine); - - var delta = { - action: "removeText", - range: range, - text: removed - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - return range.start; - }; - - /** - * Removes a range of full lines - * - * @param firstRow {Integer} The first row to be removed - * @param lastRow {Integer} The last row to be removed - * @return {String[]} The removed lines - */ - this.removeLines = function(firstRow, lastRow) { - this._dispatchEvent("changeStart"); - var range = new Range(firstRow, 0, lastRow + 1, 0); - var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); - - var delta = { - action: "removeLines", - range: range, - nl: this.getNewLineCharacter(), - lines: removed - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - return removed; - }; - - this.removeNewLine = function(row) { - var firstLine = this.getLine(row); - var secondLine = this.getLine(row+1); - - var range = new Range(row, firstLine.length, row+1, 0); - var line = firstLine + secondLine; - - this._dispatchEvent("changeStart"); - this.$lines.splice(row, 2, line); - - var delta = { - action: "removeText", - range: range, - text: this.getNewLineCharacter() - }; - this._dispatchEvent("change", { data: delta }); - this._dispatchEvent("changeEnd"); - }; - - this.replace = function(range, text) { - if (text.length == 0 && range.isEmpty()) - return range.start; - - // Shortcut: If the text we want to insert is the same as it is already - // in the document, we don't have to replace anything. - if (text == this.getTextRange(range)) - return range.end; - - this._dispatchEvent("changeStart"); - this.remove(range); - if (text) { - var end = this.insert(range.start, text); - } - else { - end = range.start; - } - this._dispatchEvent("changeEnd"); - - return end; - }; - - this.applyDeltas = function(deltas) { - for (var i=0; i=0; i--) { - var delta = deltas[i]; - - var range = Range.fromPoints(delta.range.start, delta.range.end); - - if (delta.action == "insertLines") - this.removeLines(range.start.row, range.end.row - 1) - else if (delta.action == "insertText") - this.remove(range) - else if (delta.action == "removeLines") - this.insertLines(range.start.row, delta.lines) - else if (delta.action == "removeText") - this.insert(range.start, delta.text) - } - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/anchor', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/event_emitter'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -/** - * An Anchor is a floating pointer in the document. Whenever text is inserted or - * deleted before the cursor, the position of the cursor is updated - */ -var Anchor = exports.Anchor = function(doc, row, column) { - this.document = doc; - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); - - this.$onChange = this.onChange.bind(this); - doc.on("change", this.$onChange); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - - this.getDocument = function() { - return this.document; - }; - - this.onChange = function(e) { - var delta = e.data; - var range = delta.range; - - if (range.start.row == range.end.row && range.start.row != this.row) - return; - - if (range.start.row > this.row) - return; - - if (range.start.row == this.row && range.start.column > this.column) - return; - - var row = this.row; - var column = this.column; - - if (delta.action === "insertText") { - if (range.start.row === row && range.start.column <= column) { - if (range.start.row === range.end.row) { - column += range.end.column - range.start.column; - } - else { - column -= range.start.column; - row += range.end.row - range.start.row; - } - } - else if (range.start.row !== range.end.row && range.start.row < row) { - row += range.end.row - range.start.row; - } - } else if (delta.action === "insertLines") { - if (range.start.row <= row) { - row += range.end.row - range.start.row; - } - } - else if (delta.action == "removeText") { - if (range.start.row == row && range.start.column < column) { - if (range.end.column >= column) - column = range.start.column; - else - column = Math.max(0, column - (range.end.column - range.start.column)); - - } else if (range.start.row !== range.end.row && range.start.row < row) { - if (range.end.row == row) { - column = Math.max(0, column - range.end.column) + range.start.column; - } - row -= (range.end.row - range.start.row); - } - else if (range.end.row == row) { - row -= range.end.row - range.start.row; - column = Math.max(0, column - range.end.column) + range.start.column; - } - } else if (delta.action == "removeLines") { - if (range.start.row <= row) { - if (range.end.row <= row) - row -= range.end.row - range.start.row; - else { - row = range.start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - - this.setPosition = function(row, column, noClip) { - if (noClip) { - pos = { - row: row, - column: column - }; - } - else { - pos = this.$clipPositionToDocument(row, column); - } - - if (this.row == pos.row && this.column == pos.column) - return; - - var old = { - row: this.row, - column: this.column - }; - - this.row = pos.row; - this.column = pos.column; - this._dispatchEvent("change", { - old: old, - value: pos - }); - }; - - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - - this.$clipPositionToDocument = function(row, column) { - var pos = {}; - - if (row >= this.document.getLength()) { - pos.row = Math.max(0, this.document.getLength() - 1); - pos.column = this.document.getLine(pos.row).length; - } - else if (row < 0) { - pos.row = 0; - pos.column = 0; - } - else { - pos.row = row; - pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); - } - - if (column < 0) - pos.column = 0; - - return pos; - }; - -}).call(Anchor.prototype); - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/background_tokenizer', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/event_emitter'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -var BackgroundTokenizer = function(tokenizer, editor) { - this.running = false; - this.lines = []; - this.currentLine = 0; - this.tokenizer = tokenizer; - - var self = this; - - this.$worker = function() { - if (!self.running) { return; } - - var workerStart = new Date(); - var startLine = self.currentLine; - var doc = self.doc; - - var processedLines = 0; - - var len = doc.getLength(); - while (self.currentLine < len) { - self.lines[self.currentLine] = self.$tokenizeRows(self.currentLine, self.currentLine)[0]; - self.currentLine++; - - // only check every 5 lines - processedLines += 1; - if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) { - self.fireUpdateEvent(startLine, self.currentLine-1); - self.running = setTimeout(self.$worker, 20); - return; - } - } - - self.running = false; - - self.fireUpdateEvent(startLine, len - 1); - }; -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - this.lines = []; - - this.start(0); - }; - - this.setDocument = function(doc) { - this.doc = doc; - this.lines = []; - - this.stop(); - }; - - this.fireUpdateEvent = function(firstRow, lastRow) { - var data = { - first: firstRow, - last: lastRow - }; - this._dispatchEvent("update", {data: data}); - }; - - this.start = function(startRow) { - this.currentLine = Math.min(startRow || 0, this.currentLine, - this.doc.getLength()); - - // remove all cached items below this line - this.lines.splice(this.currentLine, this.lines.length); - - this.stop(); - // pretty long delay to prevent the tokenizer from interfering with the user - this.running = setTimeout(this.$worker, 700); - }; - - this.stop = function() { - if (this.running) - clearTimeout(this.running); - this.running = false; - }; - - this.getTokens = function(firstRow, lastRow) { - return this.$tokenizeRows(firstRow, lastRow); - }; - - this.getState = function(row) { - return this.$tokenizeRows(row, row)[0].state; - }; - - this.$tokenizeRows = function(firstRow, lastRow) { - if (!this.doc) - return []; - - var rows = []; - - // determine start state - var state = "start"; - var doCache = false; - if (firstRow > 0 && this.lines[firstRow - 1]) { - state = this.lines[firstRow - 1].state; - doCache = true; - } else if (firstRow == 0) { - state = "start"; - doCache = true; - } else if (this.lines.length > 0) { - // Guess that we haven't changed state. - state = this.lines[this.lines.length-1].state; - } - - var lines = this.doc.getLines(firstRow, lastRow); - for (var row=firstRow; row<=lastRow; row++) { - if (!this.lines[row]) { - var tokens = this.tokenizer.getLineTokens(lines[row-firstRow] || "", state); - var state = tokens.state; - rows.push(tokens); - - if (doCache) { - this.lines[row] = tokens; - } - } - else { - var tokens = this.lines[row]; - state = tokens.state; - rows.push(tokens); - } - } - return rows; - }; - -}).call(BackgroundTokenizer.prototype); - -exports.BackgroundTokenizer = BackgroundTokenizer; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/edit_session/folding', ['require', 'exports', 'module' , 'ace/range', 'ace/edit_session/fold_line'], function(require, exports, module) { - -var Range = require("ace/range").Range; -var FoldLine = require("ace/edit_session/fold_line").FoldLine; - -/** - * Simple fold-data struct. - **/ -function Fold(range, placeholder) { - this.foldLine = null; - this.placeholder = placeholder; - this.range = range; - this.start = range.start; - this.end = range.end; - - this.sameRow = range.start.row == range.end.row; - this.subFolds = []; -} - -Fold.prototype.toString = function() { - return '"' + this.placeholder + '" ' + this.range.toString(); -} - -Fold.prototype.setFoldLine = function(foldLine) { - this.foldLine = foldLine; - this.subFolds.forEach(function(fold) { - fold.setFoldLine(foldLine); - }); -} - -Fold.prototype.clone = function() { - var range = this.range.clone(); - var fold = new Fold(range, this.placeholder); - this.subFolds.forEach(function(subFold) { - fold.subFolds.push(subFold.clone()); - }); - return fold; -} - -function Folding() { - /** - * Looks up a fold at a given row/column. Possible values for side: - * -1: ignore a fold if fold.start = row/column - * +1: ignore a fold if fold.end = row/column - */ - this.getFoldAt = function(row, column, side) { - var foldLine = this.getFoldLine(row); - if (foldLine) { - var folds = foldLine.folds, - fold; - - for (var i = 0; i < folds.length; i++) { - fold = folds[i]; - if (fold.range.contains(row, column)) { - if (side == 1 && fold.range.isEnd(row, column)) { - continue; - } else if (side == -1 && fold.range.isStart(row, column)) { - continue; - } - return fold; - } - } - } else { - return null; - } - } - - /** - * Returns all folds in the given range. Note, that this will return folds - * - */ - this.getFoldsInRange = function(range) { - range = range.clone(); - var start = range.start, - end = range.end; - var foldLines = this.$foldData, - folds, - fold; - var cmp, - foundFolds = []; - - start.column += 1; - end.column -= 1; - - for (var i = 0; i < foldLines.length; i++) { - cmp = foldLines[i].range.compareRange(range); - // Range is before foldLine. No intersection. This means, - // there might be other foldLines that intersect. - if (cmp == 2) { - continue; - } else - // Range is after foldLine. There can't be any other foldLines then, - // so let's give up. - if (cmp == -2) { - break; - } - - folds = foldLines[i].folds; - for (var j = 0; j < folds.length; j++) { - fold = folds[j]; - cmp = fold.range.compareRange(range); - if (cmp == -2) { - break; - } else if (cmp == 2) { - continue; - } else - // WTF-state: Can happen due to -1/+1 to start/end column. - if (cmp == 42) { - break; - } - foundFolds.push(fold); - } - } - return foundFolds; - } - - /** - * Returns the string between folds at the given position. - * E.g. - * foob|arwolrd -> "bar" - * foobarwol|rd -> "world" - * foobarwolrd -> - * - * where | means the position of row/column - * - * The trim option determs if the return string should be trimed according - * to the "side" passed with the trim value: - * - * E.g. - * foob|arwolrd -trim=-1> "b" - * foobarwol|rd -trim=+1> "rld" - * fo|obarwolrd -trim=00> "foo" - */ - this.getFoldStringAt = function(row, column, trim, foldLine) { - var foldLine = foldLine || this.getFoldLine(row); - if (!foldLine) { - return null; - } else { - var fold, lastFold, cmp, str; - lastFold = { - end: { column: 0 } - }; - // TODO: Refactor to use getNextFoldTo function. - for (var i = 0; i < foldLine.folds.length; i++) { - fold = foldLine.folds[i]; - cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - str = this.getLine(fold.start.row). - substring(lastFold.end.column, fold.start.column); - break; - } else if (cmp == 0) { - return null; - } - lastFold = fold; - } - if (!str) { - str = this.getLine(fold.start.row). - substring(lastFold.end.column); - } - if (trim == -1) { - return str.substring(0, column - lastFold.end.column); - } else if (trim == 1) { - return str.substring(column - lastFold.end.column) - } else { - return str; - } - } - } - - this.getFoldLine = function(docRow, startFoldLine) { - var foldData = this.$foldData; - var i = 0; - if(startFoldLine) - i = foldData.indexOf(startFoldLine); - if(i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { - return foldLine; - } else if (foldLine.end.row > docRow) { - return null; - } - } - return null; - } - - // returns the fold which starts after or contains docRow - this.getNextFold = function(docRow, startFoldLine) { - var foldData = this.$foldData, ans; - var i = 0; - if(startFoldLine) - i = foldData.indexOf(startFoldLine); - if(i == -1) - i = 0; - for (i; i < foldData.length; i++) { - var foldLine = foldData[i]; - if (foldLine.end.row >= docRow) { - return foldLine; - } - } - return null; - } - - this.getFoldedRowCount = function(first, last) { - var foldData = this.$foldData, rowCount = last-first+1; - for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i], - end = foldLine.end.row, - start = foldLine.start.row; - if(end >= last) { - if(start < last) { - if(start >= first) - rowCount -= last-start; - else - rowCount = 0;//in one fold - } - break; - } else if(end >= first){ - if (start >= first) //fold inside range - rowCount -= end-start; - else - rowCount -= end-first+1; - } - } - return rowCount; - } - - this.$addFoldLine = function(foldLine) { - this.$foldData.push(foldLine); - this.$foldData.sort(function(a, b) { - return a.start.row - b.start.row; - }); - return foldLine; - } - - /** - * Adds a new fold. - * - * @returns - * The new created Fold object or an existing fold object in case the - * passed in range fits an existing fold exactly. - */ - this.addFold = function(placeholder, startRow, startColumn, endRow, endColumn) { - var range; - var foldData = this.$foldData; - var foldRow = null; - var foldLine; - var fold; - var argsFold; - var folds; - var added = false; - - if (placeholder instanceof Fold) { - argsFold = placeholder; - startRow = argsFold.range; - placeholder = argsFold.placeholder; - } - - // Normalize parameters. - if (!(startRow instanceof Range)) { - range = new Range(startRow, startColumn, endRow, endColumn); - } else { - range = startRow; - startRow = range.start.row; - startColumn = range.start.column; - endRow = range.end.row; - endColumn = range.end.column; - } - - // --- Some checking --- - if (placeholder.length < 2) { - throw "Placeholder has to be at least 2 characters"; - } - - if (startRow == endRow && endColumn - startColumn < 2) { - throw "The range has to be at least 2 characters width"; - } - - fold = this.getFoldAt(startRow, startColumn, 1); - if (fold - && fold.range.isEnd(endRow, endColumn) - && fold.range.isStart(startRow, startColumn)) - { - return fold; - } - - fold = this.getFoldAt(startRow, startColumn, 1); - if (fold && !fold.range.isStart(startRow, startColumn)) { - throw "A fold can't start inside of an already existing fold"; - } - - fold = this.getFoldAt(endRow, endColumn, -1); - if (fold && !fold.range.isEnd(endRow, endColumn)) { - throw "A fold can't end inside of an already existing fold"; - } - - if (endRow >= this.doc.getLength()) { - throw "End of fold is outside of the document."; - } - - if (endColumn > this.getLine(endRow).length - || startColumn > this.getLine(startRow).length) - { - throw "End of fold is outside of the document."; - } - - // --- Start adding the fold --- - // Use the passed in fold or create a new one. - fold = argsFold || new Fold(range, placeholder); - - // Check if there are folds in the range we create the new fold for. - folds = this.getFoldsInRange(range); - if (folds.length > 0) { - // Remove the folds from fold data. - this.removeFolds(folds); - // Add the removed folds as subfolds on the new fold. - fold.subFolds = folds; - } - - for (var i = 0; i < foldData.length; i++) { - foldLine = foldData[i]; - if (endRow == foldLine.start.row) { - foldLine.addFold(fold); - added = true; - break; - } else if (startRow == foldLine.end.row) { - foldLine.addFold(fold); - added = true; - if (!fold.sameRow) { - // Check if we might have to merge two FoldLines. - foldLineNext = foldData[i + 1]; - if (foldLineNext && foldLineNext.start.row == endRow) { - // We need to merge! - foldLine.merge(foldLineNext); - break; - } - } - break; - } else if (endRow <= foldLine.start.row) { - break; - } - } - - if (!added) { - foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); - } - - if (this.$useWrapMode) { - this.$updateWrapData(foldLine.start.row, foldLine.start.row); - } - - // Notify that fold data has changed. - this.$modified = true; - this._dispatchEvent("changeFold", { data: fold }); - - return fold; - }; - - this.addFolds = function(folds) { - folds.forEach(function(fold) { - this.addFold(fold); - }, this); - }; - - this.removeFold = function(fold) { - var foldLine = fold.foldLine; - var startRow = foldLine.start.row; - var endRow = foldLine.end.row; - - var foldLines = this.$foldData, - folds = foldLine.folds; - // Simple case where there is only one fold in the FoldLine such that - // the entire fold line can get removed directly. - if (folds.length == 1) { - foldLines.splice(foldLines.indexOf(foldLine), 1); - } else - // If the fold is the last fold of the foldLine, just remove it. - if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { - folds.pop(); - foldLine.end.row = folds[folds.length - 1].end.row; - foldLine.end.column = folds[folds.length - 1].end.column; - } else - // If the fold is the first fold of the foldLine, just remove it. - if (foldLine.range.isStart(fold.start.row, fold.start.column)) { - folds.shift(); - foldLine.start.row = folds[0].start.row; - foldLine.start.column = folds[0].start.column; - } else - // We know there are more then 2 folds and the fold is not at the edge. - // This means, the fold is somewhere in between. - // - // If the fold is in one row, we just can remove it. - if (fold.sameRow) { - folds.splice(folds.indexOf(fold), 1); - } else - // The fold goes over more then one row. This means remvoing this fold - // will cause the fold line to get splitted up. - { - var newFoldLine = foldLine.split(fold.start.row, fold.start.column); - newFoldLine.folds.shift(); - foldLine.start.row = folds[0].start.row; - foldLine.start.column = folds[0].start.column; - this.$addFoldLine(newFoldLine); - } - - if (this.$useWrapMode) { - this.$updateWrapData(startRow, endRow); - } - - // Notify that fold data has changed. - this.$modified = true; - this._dispatchEvent("changeFold", { data: fold }); - } - - this.removeFolds = function(folds) { - // We need to clone the folds array passed in as it might be the folds - // array of a fold line and as we call this.removeFold(fold), folds - // are removed from folds and changes the current index. - var cloneFolds = []; - for (var i = 0; i < folds.length; i++) { - cloneFolds.push(folds[i]); - } - - cloneFolds.forEach(function(fold) { - this.removeFold(fold); - }, this); - this.$modified = true; - } - - this.expandFold = function(fold) { - this.removeFold(fold); - fold.subFolds.forEach(function(fold) { - this.addFold(fold); - }, this); - fold.subFolds = []; - } - - this.expandFolds = function(folds) { - folds.forEach(function(fold) { - this.expandFold(fold); - }, this); - } - - /** - * Checks if a given documentRow is folded. This is true if there are some - * folded parts such that some parts of the line is still visible. - **/ - this.isRowFolded = function(docRow, startFoldRow) { - return !!this.getFoldLine(docRow, startFoldRow); - }; - - this.getRowFoldEnd = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return (foldLine - ? foldLine.end.row - : docRow) - }; - - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { - if (startRow == null) { - startRow = foldLine.start.row; - startColumn = 0; - } - - if (endRow == null) { - endRow = foldLine.end.row; - endColumn = this.getLine(endRow).length; - } - - // Build the textline using the FoldLine walker. - var line = ""; - var doc = this.doc; - var textLine = ""; - - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (row < startRow) { - return; - } else if (row == startRow) { - if (column < startColumn) { - return; - } - lastColumn = Math.max(startColumn, lastColumn); - } - if (placeholder) { - textLine += placeholder; - } else { - textLine += doc.getLine(row).substring(lastColumn, column); - } - }.bind(this), endRow, endColumn); - return textLine; - }; - - this.getDisplayLine = function(row, endColumn, startRow, startColumn) { - var foldLine = this.getFoldLine(row); - - if (!foldLine) { - var line; - line = this.doc.getLine(row); - return line.substring(startColumn || 0, endColumn || line.length); - } else { - return this.getFoldDisplayLine( - foldLine, row, endColumn, startRow, startColumn); - } - }; - - this.$cloneFoldData = function() { - var foldData = this.$foldData; - var fd = []; - fd = this.$foldData.map(function(foldLine) { - var folds = foldLine.folds.map(function(fold) { - return fold.clone(); - }); - return new FoldLine(fd, folds); - }); - - return fd; - }; -} - -exports.Folding = Folding; - -});/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/edit_session/fold_line', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { - -var Range = require("ace/range").Range; - -/** - * If the an array is passed in, the folds are expected to be sorted already. - */ -function FoldLine(foldData, folds) { - this.foldData = foldData; - if (Array.isArray(folds)) { - this.folds = folds; - } else { - folds = this.folds = [ folds ]; - } - - var last = folds[folds.length - 1] - this.range = new Range(folds[0].start.row, folds[0].start.column, - last.end.row, last.end.column); - this.start = this.range.start; - this.end = this.range.end; - - this.folds.forEach(function(fold) { - fold.setFoldLine(this); - }, this); -} - -(function() { - /** - * Note: This doesn't update wrapData! - */ - this.shiftRow = function(shift) { - this.start.row += shift; - this.end.row += shift; - this.folds.forEach(function(fold) { - fold.start.row += shift; - fold.end.row += shift; - }); - } - - this.addFold = function(fold) { - if (fold.sameRow) { - if (fold.start.row < this.startRow || fold.endRow > this.endRow) { - throw "Can't add a fold to this FoldLine as it has no connection"; - } - this.folds.push(fold); - this.folds.sort(function(a, b) { - return -a.range.compareEnd(b.start.row, b.start.column); - }); - if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } - } else if (fold.start.row == this.end.row) { - this.folds.push(fold); - this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (fold.end.row == this.start.row) { - this.folds.unshift(fold); - this.start.row = fold.start.row; - this.start.column = fold.start.column; - } else { - throw "Trying to add fold to FoldRow that doesn't have a matching row"; - } - fold.foldLine = this; - } - - this.containsRow = function(row) { - return row >= this.start.row && row <= this.end.row; - } - - this.walk = function(callback, endRow, endColumn) { - var lastEnd = 0, - folds = this.folds, - fold, - comp, stop, isNewRow = true; - - if (endRow == null) { - endRow = this.end.row; - endColumn = this.end.column; - } - - for (var i = 0; i < folds.length; i++) { - fold = folds[i]; - - comp = fold.range.compareStart(endRow, endColumn); - // This fold is after the endRow/Column. - if (comp == -1) { - callback(null, endRow, endColumn, lastEnd, isNewRow); - return; - } - - stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); - stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); - - // If the user requested to stop the walk or endRow/endColumn is - // inside of this fold (comp == 0), then end here. - if (stop || comp == 0) { - return; - } - - // Note the new lastEnd might not be on the same line. However, - // it's the callback's job to recognize this. - isNewRow = !fold.sameRow; - lastEnd = fold.end.column; - } - callback(null, endRow, endColumn, lastEnd, isNewRow); - } - - this.getNextFoldTo = function(row, column) { - var fold, cmp; - for (var i = 0; i < this.folds.length; i++) { - fold = this.folds[i]; - cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - return { - fold: fold, - kind: "after" - }; - } else if (cmp == 0) { - return { - fold: fold, - kind: "inside" - } - } - } - return null; - } - - this.addRemoveChars = function(row, column, len) { - var ret = this.getNextFoldTo(row, column), - fold, folds; - if (ret) { - fold = ret.fold; - if (ret.kind == "inside" - && fold.start.column != column - && fold.start.row != row) - { - throw "Moving characters inside of a fold should never be reached"; - } else if (fold.start.row == row) { - folds = this.folds; - var i = folds.indexOf(fold); - if (i == 0) { - this.start.column += len; - } - for (i; i < folds.length; i++) { - fold = folds[i]; - fold.start.column += len; - if (!fold.sameRow) { - return; - } - fold.end.column += len; - } - this.end.column += len; - } - } - } - - this.split = function(row, column) { - var fold = this.getNextFoldTo(row, column).fold, - folds = this.folds; - var foldData = this.foldData; - - if (!fold) { - return null; - } - var i = folds.indexOf(fold); - var foldBefore = folds[i - 1]; - this.end.row = foldBefore.end.row; - this.end.column = foldBefore.end.column; - - // Remove the folds after row/column and create a new FoldLine - // containing these removed folds. - folds = folds.splice(i, folds.length - i); - - var newFoldLine = new FoldLine(foldData, folds); - foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); - return newFoldLine; - } - - this.merge = function(foldLineNext) { - var folds = foldLineNext.folds; - for (var i = 0; i < folds.length; i++) { - this.addFold(folds[i]); - } - // Remove the foldLineNext - no longer needed, as - // it's merged now with foldLineNext. - var foldData = this.foldData; - foldData.splice(foldData.indexOf(foldLineNext), 1); - } - - this.toString = function() { - var ret = [this.range.toString() + ": [" ]; - - this.folds.forEach(function(fold) { - ret.push(" " + fold.toString()); - }); - ret.push("]") - return ret.join("\n"); - } - - this.idxToPosition = function(idx) { - var lastFoldEndColumn = 0; - var fold; - - for (var i = 0; i < this.folds.length; i++) { - var fold = this.folds[i]; - - idx -= fold.start.column - lastFoldEndColumn; - if (idx < 0) { - return { - row: fold.start.row, - column: fold.start.column + idx - }; - } - - idx -= fold.placeholder.length; - if (idx < 0) { - return fold.start; - } - - lastFoldEndColumn = fold.end.column; - } - - return { - row: this.end.row, - column: this.end.column + idx - }; - } -}).call(FoldLine.prototype); - -exports.FoldLine = FoldLine; -});/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/search', ['require', 'exports', 'module' , 'pilot/lang', 'pilot/oop', 'ace/range'], function(require, exports, module) { - -var lang = require("pilot/lang"); -var oop = require("pilot/oop"); -var Range = require("ace/range").Range; - -var Search = function() { - this.$options = { - needle: "", - backwards: false, - wrap: false, - caseSensitive: false, - wholeWord: false, - scope: Search.ALL, - regExp: false - }; -}; - -Search.ALL = 1; -Search.SELECTION = 2; - -(function() { - - this.set = function(options) { - oop.mixin(this.$options, options); - return this; - }; - - this.getOptions = function() { - return lang.copyObject(this.$options); - }; - - this.find = function(session) { - if (!this.$options.needle) - return null; - - if (this.$options.backwards) { - var iterator = this.$backwardMatchIterator(session); - } else { - iterator = this.$forwardMatchIterator(session); - } - - var firstRange = null; - iterator.forEach(function(range) { - firstRange = range; - return true; - }); - - return firstRange; - }; - - this.findAll = function(session) { - if (!this.$options.needle) - return []; - - if (this.$options.backwards) { - var iterator = this.$backwardMatchIterator(session); - } else { - iterator = this.$forwardMatchIterator(session); - } - - var ranges = []; - iterator.forEach(function(range) { - ranges.push(range); - }); - - return ranges; - }; - - this.replace = function(input, replacement) { - var re = this.$assembleRegExp(); - var match = re.exec(input); - if (match && match[0].length == input.length) { - if (this.$options.regExp) { - return input.replace(re, replacement); - } else { - return replacement; - } - } else { - return null; - } - }; - - this.$forwardMatchIterator = function(session) { - var re = this.$assembleRegExp(); - var self = this; - - return { - forEach: function(callback) { - self.$forwardLineIterator(session).forEach(function(line, startIndex, row) { - if (startIndex) { - line = line.substring(startIndex); - } - - var matches = []; - - line.replace(re, function(str) { - var offset = arguments[arguments.length-2]; - matches.push({ - str: str, - offset: startIndex + offset - }); - return str; - }); - - for (var i=0; i= 0; i--) { - var match = matches[i]; - var range = self.$rangeFromMatch(row, match.offset, match.str.length); - if (callback(range)) - return true; - } - }); - } - }; - }; - - this.$rangeFromMatch = function(row, column, length) { - return new Range(row, column, row, column+length); - }; - - this.$assembleRegExp = function() { - if (this.$options.regExp) { - var needle = this.$options.needle; - } else { - needle = lang.escapeRegExp(this.$options.needle); - } - - if (this.$options.wholeWord) { - needle = "\\b" + needle + "\\b"; - } - - var modifier = "g"; - if (!this.$options.caseSensitive) { - modifier += "i"; - } - - var re = new RegExp(needle, modifier); - return re; - }; - - this.$forwardLineIterator = function(session) { - var searchSelection = this.$options.scope == Search.SELECTION; - - var range = session.getSelection().getRange(); - var start = session.getSelection().getCursor(); - - var firstRow = searchSelection ? range.start.row : 0; - var firstColumn = searchSelection ? range.start.column : 0; - var lastRow = searchSelection ? range.end.row : session.getLength() - 1; - - var wrap = this.$options.wrap; - var inWrap = false; - - function getLine(row) { - var line = session.getLine(row); - if (searchSelection && row == range.end.row) { - line = line.substring(0, range.end.column); - } - if (inWrap && row == start.row) { - line = line.substring(0, start.column); - } - return line; - } - - return { - forEach: function(callback) { - var row = start.row; - - var line = getLine(row); - var startIndex = start.column; - - var stop = false; - inWrap = false; - - while (!callback(line, startIndex, row)) { - - if (stop) { - return; - } - - row++; - startIndex = 0; - - if (row > lastRow) { - if (wrap) { - row = firstRow; - startIndex = firstColumn; - inWrap = true; - } else { - return; - } - } - - if (row == start.row) - stop = true; - - line = getLine(row); - } - } - }; - }; - - this.$backwardLineIterator = function(session) { - var searchSelection = this.$options.scope == Search.SELECTION; - - var range = session.getSelection().getRange(); - var start = searchSelection ? range.end : range.start; - - var firstRow = searchSelection ? range.start.row : 0; - var firstColumn = searchSelection ? range.start.column : 0; - var lastRow = searchSelection ? range.end.row : session.getLength() - 1; - - var wrap = this.$options.wrap; - - return { - forEach : function(callback) { - var row = start.row; - - var line = session.getLine(row).substring(0, start.column); - var startIndex = 0; - var stop = false; - var inWrap = false; - - while (!callback(line, startIndex, row)) { - - if (stop) - return; - - row--; - startIndex = 0; - - if (row < firstRow) { - if (wrap) { - row = lastRow; - inWrap = true; - } else { - return; - } - } - - if (row == start.row) - stop = true; - - line = session.getLine(row); - if (searchSelection) { - if (row == firstRow) - startIndex = firstColumn; - else if (row == lastRow) - line = line.substring(0, range.end.column); - } - - if (inWrap && row == start.row) - startIndex = start.column; - } - } - }; - }; - -}).call(Search.prototype); - -exports.Search = Search; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/undomanager', ['require', 'exports', 'module' ], function(require, exports, module) { - -var UndoManager = function() { - this.reset(); -}; - -(function() { - - this.execute = function(options) { - var deltas = options.args[0]; - this.$doc = options.args[1]; - this.$undoStack.push(deltas); - this.$redoStack = []; - }; - - this.undo = function(dontSelect) { - var deltas = this.$undoStack.pop(); - var undoSelectionRange = null; - if (deltas) { - undoSelectionRange = - this.$doc.undoChanges(deltas, dontSelect); - this.$redoStack.push(deltas); - } - return undoSelectionRange; - }; - - this.redo = function(dontSelect) { - var deltas = this.$redoStack.pop(); - var redoSelectionRange = null; - if (deltas) { - redoSelectionRange = - this.$doc.redoChanges(deltas, dontSelect); - this.$undoStack.push(deltas); - } - return redoSelectionRange; - }; - - this.reset = function() { - this.$undoStack = []; - this.$redoStack = []; - }; - - this.hasUndo = function() { - return this.$undoStack.length > 0; - }; - - this.hasRedo = function() { - return this.$redoStack.length > 0; - }; - -}).call(UndoManager.prototype); - -exports.UndoManager = UndoManager; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Irakli Gozalishvili (http://jeditoolkit.com) - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/virtual_renderer', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/dom', 'pilot/event', 'pilot/useragent', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'pilot/event_emitter', 'text/ace/css/editor.css'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var dom = require("pilot/dom"); -var event = require("pilot/event"); -var useragent = require("pilot/useragent"); -var GutterLayer = require("ace/layer/gutter").Gutter; -var MarkerLayer = require("ace/layer/marker").Marker; -var TextLayer = require("ace/layer/text").Text; -var CursorLayer = require("ace/layer/cursor").Cursor; -var ScrollBar = require("ace/scrollbar").ScrollBar; -var RenderLoop = require("ace/renderloop").RenderLoop; -var EventEmitter = require("pilot/event_emitter").EventEmitter; -var editorCss = require("text/ace/css/editor.css"); - -// import CSS once -dom.importCssString(editorCss); - -var VirtualRenderer = function(container, theme) { - this.container = container; - dom.addCssClass(this.container, "ace_editor"); - - this.setTheme(theme); - - this.$gutter = dom.createElement("div"); - this.$gutter.className = "ace_gutter"; - this.container.appendChild(this.$gutter); - - this.scroller = dom.createElement("div"); - this.scroller.className = "ace_scroller"; - this.container.appendChild(this.scroller); - - this.content = dom.createElement("div"); - this.content.className = "ace_content"; - this.scroller.appendChild(this.content); - - this.$gutterLayer = new GutterLayer(this.$gutter); - this.$markerBack = new MarkerLayer(this.content); - - var textLayer = this.$textLayer = new TextLayer(this.content); - this.canvas = textLayer.element; - - this.$markerFront = new MarkerLayer(this.content); - - this.characterWidth = textLayer.getCharacterWidth(); - this.lineHeight = textLayer.getLineHeight(); - - this.$cursorLayer = new CursorLayer(this.content); - this.$cursorPadding = 8; - - // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; - - this.scrollBar = new ScrollBar(container); - this.scrollBar.addEventListener("scroll", this.onScroll.bind(this)); - - this.scrollTop = 0; - - this.cursorPos = { - row : 0, - column : 0 - }; - - var _self = this; - this.$textLayer.addEventListener("changeCharaterSize", function() { - _self.characterWidth = textLayer.getCharacterWidth(); - _self.lineHeight = textLayer.getLineHeight(); - _self.$updatePrintMargin(); - _self.onResize(true); - - _self.$loop.schedule(_self.CHANGE_FULL); - }); - event.addListener(this.$gutter, "click", this.$onGutterClick.bind(this)); - event.addListener(this.$gutter, "dblclick", this.$onGutterClick.bind(this)); - - this.$size = { - width: 0, - height: 0, - scrollerHeight: 0, - scrollerWidth: 0 - }; - - this.$loop = new RenderLoop(this.$renderChanges.bind(this)); - this.$loop.schedule(this.CHANGE_FULL); - - this.setPadding(4); - this.$updatePrintMargin(); -}; - -(function() { - this.showGutter = true; - - this.CHANGE_CURSOR = 1; - this.CHANGE_MARKER = 2; - this.CHANGE_GUTTER = 4; - this.CHANGE_SCROLL = 8; - this.CHANGE_LINES = 16; - this.CHANGE_TEXT = 32; - this.CHANGE_SIZE = 64; - this.CHANGE_MARKER_BACK = 128; - this.CHANGE_MARKER_FRONT = 256; - this.CHANGE_FULL = 512; - - oop.implement(this, EventEmitter); - - this.setSession = function(session) { - this.session = session; - this.$cursorLayer.setSession(session); - this.$markerBack.setSession(session); - this.$markerFront.setSession(session); - this.$gutterLayer.setSession(session); - this.$textLayer.setSession(session); - this.$loop.schedule(this.CHANGE_FULL); - }; - - /** - * Triggers partial update of the text layer - */ - this.updateLines = function(firstRow, lastRow) { - if (lastRow === undefined) - lastRow = Infinity; - - if (!this.$changedLines) { - this.$changedLines = { - firstRow: firstRow, - lastRow: lastRow - }; - } - else { - if (this.$changedLines.firstRow > firstRow) - this.$changedLines.firstRow = firstRow; - - if (this.$changedLines.lastRow < lastRow) - this.$changedLines.lastRow = lastRow; - } - - this.$loop.schedule(this.CHANGE_LINES); - }; - - /** - * Triggers full update of the text layer - */ - this.updateText = function() { - this.$loop.schedule(this.CHANGE_TEXT); - }; - - /** - * Triggers a full update of all layers - */ - this.updateFull = function() { - this.$loop.schedule(this.CHANGE_FULL); - }; - - this.updateFontSize = function() { - this.$textLayer.checkForSizeChanges(); - }; - - /** - * Triggers resize of the editor - */ - this.onResize = function(force) { - var changes = this.CHANGE_SIZE; - - var height = dom.getInnerHeight(this.container); - if (force || this.$size.height != height) { - this.$size.height = height; - - this.scroller.style.height = height + "px"; - this.scrollBar.setHeight(this.scroller.clientHeight); - - if (this.session) { - this.scrollToY(this.getScrollTop()); - changes = changes | this.CHANGE_FULL; - } - } - - var width = dom.getInnerWidth(this.container); - if (force || this.$size.width != width) { - this.$size.width = width; - - var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0; - this.scroller.style.left = gutterWidth + "px"; - this.scroller.style.width = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()) + "px"; - - if (this.session.getUseWrapMode()) { - var availableWidth = this.scroller.clientWidth - this.$padding * 2; - var limit = Math.floor(availableWidth / this.characterWidth) - 1; - if (this.session.adjustWrapLimit(limit) || force) { - changes = changes | this.CHANGE_FULL; - } - } - } - - this.$size.scrollerWidth = this.scroller.clientWidth; - this.$size.scrollerHeight = this.scroller.clientHeight; - this.$loop.schedule(changes); - }; - - this.$onGutterClick = function(e) { - var pageX = event.getDocumentX(e); - var pageY = event.getDocumentY(e); - - this._dispatchEvent("gutter" + e.type, { - row: this.screenToTextCoordinates(pageX, pageY).row, - htmlEvent: e - }); - }; - - this.setShowInvisibles = function(showInvisibles) { - if (this.$textLayer.setShowInvisibles(showInvisibles)) - this.$loop.schedule(this.CHANGE_TEXT); - }; - - this.getShowInvisibles = function() { - return this.$textLayer.showInvisibles; - }; - - this.$showPrintMargin = true; - this.setShowPrintMargin = function(showPrintMargin) { - this.$showPrintMargin = showPrintMargin; - this.$updatePrintMargin(); - }; - - this.getShowPrintMargin = function() { - return this.$showPrintMargin; - }; - - this.$printMarginColumn = 80; - this.setPrintMarginColumn = function(showPrintMargin) { - this.$printMarginColumn = showPrintMargin; - this.$updatePrintMargin(); - }; - - this.getPrintMarginColumn = function() { - return this.$printMarginColumn; - }; - - this.getShowGutter = function(){ - return this.showGutter; - }; - - this.setShowGutter = function(show){ - if(this.showGutter === show) - return; - this.$gutter.style.display = show ? "block" : "none"; - this.showGutter = show; - this.onResize(true); - }; - - this.$updatePrintMargin = function() { - var containerEl; - - if (!this.$showPrintMargin && !this.$printMarginEl) - return; - - if (!this.$printMarginEl) { - containerEl = dom.createElement("div"); - containerEl.className = "ace_print_margin_layer"; - this.$printMarginEl = dom.createElement("div"); - this.$printMarginEl.className = "ace_print_margin"; - containerEl.appendChild(this.$printMarginEl); - this.content.insertBefore(containerEl, this.$textLayer.element); - } - - var style = this.$printMarginEl.style; - style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding * 2) + "px"; - style.visibility = this.$showPrintMargin ? "visible" : "hidden"; - }; - - this.getContainerElement = function() { - return this.container; - }; - - this.getMouseEventTarget = function() { - return this.content; - }; - - this.getTextAreaContainer = function() { - return this.container; - }; - - this.moveTextAreaToCursor = function(textarea) { - // in IE the native cursor always shines through - if (useragent.isIE) - return; - - var pos = this.$cursorLayer.getPixelPosition(); - if (!pos) - return; - - var bounds = this.content.getBoundingClientRect(); - var offset = (this.layerConfig && this.layerConfig.offset) || 0; - - textarea.style.left = (bounds.left + pos.left + this.$padding) + "px"; - textarea.style.top = (bounds.top + pos.top - this.scrollTop + offset) + "px"; - }; - - this.getFirstVisibleRow = function() { - return (this.layerConfig || {}).firstRow || 0; - }; - - this.getFirstFullyVisibleRow = function(){ - if (!this.layerConfig) - return 0; - - return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); - }; - - this.getLastFullyVisibleRow = function() { - if (!this.layerConfig) - return 0; - - var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); - return this.layerConfig.firstRow - 1 + flint; - }; - - this.getLastVisibleRow = function() { - return (this.layerConfig || {}).lastRow || 0; - }; - - this.$padding = null; - this.setPadding = function(padding) { - this.$padding = padding; - this.content.style.padding = "0 " + padding + "px"; - this.$loop.schedule(this.CHANGE_FULL); - this.$updatePrintMargin(); - }; - - this.getHScrollBarAlwaysVisible = function() { - return this.$horizScrollAlwaysVisible; - }; - - this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - if (this.$horizScrollAlwaysVisible != alwaysVisible) { - this.$horizScrollAlwaysVisible = alwaysVisible; - if (!this.$horizScrollAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - } - }; - - this.onScroll = function(e) { - this.scrollToY(e.data); - }; - - this.$updateScrollBar = function() { - this.scrollBar.setInnerHeight(this.layerConfig.maxHeight); - this.scrollBar.setScrollTop(this.scrollTop); - }; - - this.$renderChanges = function(changes) { - if (!changes || !this.session) - return; - - // text, scrolling and resize changes can cause the view port size to change - if (!this.layerConfig || - changes & this.CHANGE_FULL || - changes & this.CHANGE_SIZE || - changes & this.CHANGE_TEXT || - changes & this.CHANGE_LINES || - changes & this.CHANGE_SCROLL - ) - this.$computeLayerConfig(); - - // full - if (changes & this.CHANGE_FULL) { - this.$textLayer.update(this.layerConfig); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - this.$markerBack.update(this.layerConfig); - this.$markerFront.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar(); - return; - } - - // scrolling - if (changes & this.CHANGE_SCROLL) { - if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) - this.$textLayer.update(this.layerConfig); - else - this.$textLayer.scrollLines(this.layerConfig); - - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - this.$markerBack.update(this.layerConfig); - this.$markerFront.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar(); - return; - } - - if (changes & this.CHANGE_TEXT) { - this.$textLayer.update(this.layerConfig); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } - else if (changes & this.CHANGE_LINES) { - this.$updateLines(); - this.$updateScrollBar(); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } else if (changes & this.CHANGE_GUTTER) { - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } - - if (changes & this.CHANGE_CURSOR) - this.$cursorLayer.update(this.layerConfig); - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { - this.$markerFront.update(this.layerConfig); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { - this.$markerBack.update(this.layerConfig); - } - - if (changes & this.CHANGE_SIZE) - this.$updateScrollBar(); - }; - - this.$computeLayerConfig = function() { - var session = this.session; - - var offset = this.scrollTop % this.lineHeight; - var minHeight = this.$size.scrollerHeight + this.lineHeight; - - var longestLine = this.$getLongestLine(); - var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine); - - var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0; - var horizScrollChanged = this.$horizScroll !== horizScroll; - this.$horizScroll = horizScroll; - if (horizScrollChanged) - this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden"; - - var maxHeight = this.session.getScreenLength() * this.lineHeight; - this.scrollTop = Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)); - - var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; - var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); - var lastRow = firstRow + lineCount; - - // Map lines on the screen to lines in the document. - var firstRowScreen, firstRowHeight; - var lineHeight = { lineHeight: this.lineHeight }; - firstRow = session.screenToDocumentRow(firstRow, 0); - - // Check if firstRow is inside of a foldLine. If true, then use the first - // row of the foldLine. - var foldLine = session.getFoldLine(firstRow); - if (foldLine) { - firstRow = foldLine.start.row; - } - - firstRowScreen = session.documentToScreenRow(firstRow, 0); - firstRowHeight = session.getRowHeight(lineHeight, firstRow); - - lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); - minHeight = this.$size.scrollerHeight + session.getRowHeight(lineHeight, lastRow)+ - firstRowHeight; - - offset = this.scrollTop - firstRowScreen * this.lineHeight; - - this.layerConfig = { - width : longestLine, - padding : this.$padding, - firstRow : firstRow, - firstRowScreen: firstRowScreen, - lastRow : lastRow, - lineHeight : this.lineHeight, - characterWidth : this.characterWidth, - minHeight : minHeight, - maxHeight : maxHeight, - offset : offset, - height : this.$size.scrollerHeight - }; - - // For debugging. - // console.log(JSON.stringify(this.layerConfig)); - - this.$gutterLayer.element.style.marginTop = (-offset) + "px"; - this.content.style.marginTop = (-offset) + "px"; - this.content.style.width = longestLine + "px"; - this.content.style.height = minHeight + "px"; - - // scroller.scrollWidth was smaller than scrollLeft we needed - if (this.$desiredScrollLeft) { - this.scrollToX(this.$desiredScrollLeft); - this.$desiredScrollLeft = 0; - } - - // Horizontal scrollbar visibility may have changed, which changes - // the client height of the scroller - if (horizScrollChanged) - this.onResize(true); - }; - - this.$updateLines = function() { - var firstRow = this.$changedLines.firstRow; - var lastRow = this.$changedLines.lastRow; - this.$changedLines = null; - - var layerConfig = this.layerConfig; - - // if the update changes the width of the document do a full redraw - if (layerConfig.width != this.$getLongestLine()) - return this.$textLayer.update(layerConfig); - - if (firstRow > layerConfig.lastRow + 1) { return; } - if (lastRow < layerConfig.firstRow) { return; } - - // if the last row is unknown -> redraw everything - if (lastRow === Infinity) { - if (this.showGutter) - this.$gutterLayer.update(layerConfig); - this.$textLayer.update(layerConfig); - return; - } - - // else update only the changed rows - this.$textLayer.updateLines(layerConfig, firstRow, lastRow); - }; - - this.$getLongestLine = function() { - var charCount = this.session.getScreenWidth() + 1; - if (this.$textLayer.showInvisibles) - charCount += 1; - - return Math.max(this.$size.scrollerWidth - this.$padding * 2, Math.round(charCount * this.characterWidth)); - }; - - this.updateFrontMarkers = function() { - this.$markerFront.setMarkers(this.session.getMarkers(true)); - this.$loop.schedule(this.CHANGE_MARKER_FRONT); - }; - - this.updateBackMarkers = function() { - this.$markerBack.setMarkers(this.session.getMarkers()); - this.$loop.schedule(this.CHANGE_MARKER_BACK); - }; - - this.addGutterDecoration = function(row, className){ - this.$gutterLayer.addGutterDecoration(row, className); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.removeGutterDecoration = function(row, className){ - this.$gutterLayer.removeGutterDecoration(row, className); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.setBreakpoints = function(rows) { - this.$gutterLayer.setBreakpoints(rows); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.setAnnotations = function(annotations) { - this.$gutterLayer.setAnnotations(annotations); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - this.updateCursor = function() { - this.$loop.schedule(this.CHANGE_CURSOR); - }; - - this.hideCursor = function() { - this.$cursorLayer.hideCursor(); - }; - - this.showCursor = function() { - this.$cursorLayer.showCursor(); - }; - - this.scrollCursorIntoView = function() { - // the editor is not visible - if (this.$size.scrollerHeight === 0) - return; - - var pos = this.$cursorLayer.getPixelPosition(); - - var left = pos.left + this.$padding; - var top = pos.top; - - if (this.scrollTop > top) { - this.scrollToY(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { - this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight); - } - - var scrollLeft = this.scroller.scrollLeft; - - if (scrollLeft > left) { - this.scrollToX(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - if (left > this.layerConfig.width) - this.$desiredScrollLeft = left + 2 * this.characterWidth; - else - this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); - } - }; - - this.getScrollTop = function() { - return this.scrollTop; - }; - - this.getScrollLeft = function() { - return this.scroller.scrollLeft; - }; - - this.getScrollTopRow = function() { - return this.scrollTop / this.lineHeight; - }; - - this.getScrollBottomRow = function() { - return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); - }; - - this.scrollToRow = function(row) { - this.scrollToY(row * this.lineHeight); - }; - - this.scrollToLine = function(line, center) { - var lineHeight = { lineHeight: this.lineHeight }; - var offset = 0; - for (var l = 1; l < line; l++) { - offset += this.session.getRowHeight(lineHeight, l-1); - } - - if (center) { - offset -= this.$size.scrollerHeight / 2; - } - this.scrollToY(offset); - }; - - this.scrollToY = function(scrollTop) { - // after calling scrollBar.setScrollTop - // scrollbar sends us event with same scrollTop. ignore it - scrollTop = Math.max(0, scrollTop); - if (this.scrollTop !== scrollTop) { - this.$loop.schedule(this.CHANGE_SCROLL); - this.scrollTop = scrollTop; - } - }; - - this.scrollToX = function(scrollLeft) { - if (scrollLeft <= this.$padding) - scrollLeft = 0; - - this.scroller.scrollLeft = scrollLeft; - }; - - this.scrollBy = function(deltaX, deltaY) { - deltaY && this.scrollToY(this.scrollTop + deltaY); - deltaX && this.scrollToX(this.scroller.scrollLeft + deltaX); - }; - - this.screenToTextCoordinates = function(pageX, pageY) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) - / this.characterWidth); - var row = Math.floor((pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) - / this.lineHeight); - - return this.session.screenToDocumentPosition(row, Math.max(col, 0)); - }; - - this.textToScreenCoordinates = function(row, column) { - var canvasPos = this.scroller.getBoundingClientRect(); - var pos = this.session.documentToScreenPosition(row, column); - - var x = this.$padding + Math.round(pos.column * this.characterWidth); - var y = pos.row * this.lineHeight; - - return { - pageX: canvasPos.left + x - this.getScrollLeft(), - pageY: canvasPos.top + y - this.getScrollTop() - }; - }; - - this.visualizeFocus = function() { - dom.addCssClass(this.container, "ace_focus"); - }; - - this.visualizeBlur = function() { - dom.removeCssClass(this.container, "ace_focus"); - }; - - this.showComposition = function(position) { - if (!this.$composition) { - this.$composition = dom.createElement("div"); - this.$composition.className = "ace_composition"; - this.content.appendChild(this.$composition); - } - - this.$composition.innerHTML = " "; - - var pos = this.$cursorLayer.getPixelPosition(); - var style = this.$composition.style; - style.top = pos.top + "px"; - style.left = (pos.left + this.$padding) + "px"; - style.height = this.lineHeight + "px"; - - this.hideCursor(); - }; - - this.setCompositionText = function(text) { - dom.setInnerText(this.$composition, text); - }; - - this.hideComposition = function() { - this.showCursor(); - - if (!this.$composition) - return; - - var style = this.$composition.style; - style.top = "-10000px"; - style.left = "-10000px"; - }; - - this.setTheme = function(theme) { - var _self = this; - - this.$themeValue = theme; - if (!theme || typeof theme == "string") { - theme = theme || "ace/theme/textmate"; - require([theme], function(theme) { - afterLoad(theme); - }); - } else { - afterLoad(theme); - } - - function afterLoad(theme) { - if (_self.$theme) - dom.removeCssClass(_self.container, _self.$theme); - - _self.$theme = theme ? theme.cssClass : null; - - if (_self.$theme) - dom.addCssClass(_self.container, _self.$theme); - - // force re-measure of the gutter width - if (_self.$size) { - _self.$size.width = 0; - _self.onResize(); - } - } - }; - - this.getTheme = function() { - return this.$themeValue; - }; - - // Methods allows to add / remove CSS classnames to the editor element. - // This feature can be used by plug-ins to provide a visual indication of - // a certain mode that editor is in. - - this.setStyle = function setStyle(style) { - dom.addCssClass(this.container, style); - }; - - this.unsetStyle = function unsetStyle(style) { - dom.removeCssClass(this.container, style); - }; - - this.destroy = function() { - this.$textLayer.destroy(); - this.$cursorLayer.destroy(); - }; - -}).call(VirtualRenderer.prototype); - -exports.VirtualRenderer = VirtualRenderer; -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/layer/gutter', ['require', 'exports', 'module' , 'pilot/dom'], function(require, exports, module) { - -var dom = require("pilot/dom"); - -var Gutter = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - parentEl.appendChild(this.element); - - this.$breakpoints = []; - this.$annotations = []; - this.$decorations = []; -}; - -(function() { - - this.setSession = function(session) { - this.session = session; - }; - - this.addGutterDecoration = function(row, className){ - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " ace_" + className; - } - - this.removeGutterDecoration = function(row, className){ - this.$decorations[row] = this.$decorations[row].replace(" ace_" + className, ""); - }; - - this.setBreakpoints = function(rows) { - this.$breakpoints = rows.concat(); - }; - - this.setAnnotations = function(annotations) { - // iterate over sparse array - this.$annotations = []; - for (var row in annotations) if (annotations.hasOwnProperty(row)) { - var rowAnnotations = annotations[row]; - if (!rowAnnotations) - continue; - - var rowInfo = this.$annotations[row] = { - text: [] - }; - for (var i=0; i foldStart) { - i = fold.end.row + 1; - fold = this.session.getNextFold(i); - foldStart = fold ?fold.start.row :Infinity; - } - if(i > lastRow) - break; - - var annotation = this.$annotations[i] || emptyAnno; - html.push("
", (i+1)); - - var wrappedRowLength = this.session.getRowLength(i) - 1; - while (wrappedRowLength--) { - html.push("
¦
"); - } - - html.push(""); - - i++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - this.element.style.height = config.minHeight + "px"; - }; - -}).call(Gutter.prototype); - -exports.Gutter = Gutter; - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/layer/marker', ['require', 'exports', 'module' , 'ace/range', 'pilot/dom'], function(require, exports, module) { - -var Range = require("ace/range").Range; -var dom = require("pilot/dom"); - -var Marker = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - parentEl.appendChild(this.element); -}; - -(function() { - - this.setSession = function(session) { - this.session = session; - }; - - this.setMarkers = function(markers) { - this.markers = markers; - }; - - this.update = function(config) { - var config = config || this.config; - if (!config) - return; - - this.config = config; - - var html = []; - for ( var key in this.markers) { - var marker = this.markers[key]; - - var range = marker.range.clipRows(config.firstRow, config.lastRow); - if (range.isEmpty()) continue; - - range = range.toScreenRange(this.session); - - if (marker.renderer) { - var top = this.$getTop(range.start.row, config); - var left = Math.round(range.start.column * config.characterWidth); - marker.renderer(html, range, left, top, config); - } - else if (range.isMultiLine()) { - if (marker.type == "text") { - this.drawTextMarker(html, range, marker.clazz, config); - } else { - this.drawMultiLineMarker(html, range, marker.clazz, config); - } - } - else { - this.drawSingleLineMarker(html, range, marker.clazz, config); - } - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$getTop = function(row, layerConfig) { - return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; - }; - - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) { - // selection start - var row = range.start.row; - - var lineRange = new Range(row, range.start.column, - row, this.session.getScreenLastRowColumn(row)); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1); - - // selection end - var row = range.end.row; - var lineRange = new Range(row, 0, row, range.end.column); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig); - - for (var row = range.start.row + 1; row < range.end.row; row++) { - lineRange.start.row = row; - lineRange.end.row = row; - lineRange.end.column = this.session.getScreenLastRowColumn(row); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1); - } - }; - - this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig) { - // from selection start to the end of the line - var height = layerConfig.lineHeight; - var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth)); - var top = this.$getTop(range.start.row, layerConfig); - var left = Math.round(range.start.column * layerConfig.characterWidth); - - stringBuilder.push( - "
" - ); - - // from start of the last line to the selection end - var top = this.$getTop(range.end.row, layerConfig); - var width = Math.round(range.end.column * layerConfig.characterWidth); - - stringBuilder.push( - "
" - ); - - // all the complete lines - var height = (range.end.row - range.start.row - 1) * layerConfig.lineHeight; - if (height < 0) - return; - var top = this.$getTop(range.start.row + 1, layerConfig); - - stringBuilder.push( - "
" - ); - }; - - this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength) { - var height = layerConfig.lineHeight; - var width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth); - var top = this.$getTop(range.start.row, layerConfig); - var left = Math.round(range.start.column * layerConfig.characterWidth); - - stringBuilder.push( - "
" - ); - }; - -}).call(Marker.prototype); - -exports.Marker = Marker; - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/layer/text', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/dom', 'pilot/lang', 'pilot/useragent', 'pilot/event_emitter'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var dom = require("pilot/dom"); -var lang = require("pilot/lang"); -var useragent = require("pilot/useragent"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -var Text = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - parentEl.appendChild(this.element); - - this.$characterSize = this.$measureSizes() || {width: 0, height: 0}; - this.$pollSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "¶"; - this.EOL_CHAR = "¬"; - this.TAB_CHAR = "→"; - this.SPACE_CHAR = "·"; - - this.getLineHeight = function() { - return this.$characterSize.height || 1; - }; - - this.getCharacterWidth = function() { - return this.$characterSize.width || 1; - }; - - this.checkForSizeChanges = function() { - var size = this.$measureSizes(); - if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { - this.$characterSize = size; - this._dispatchEvent("changeCharaterSize", {data: size}); - } - }; - - this.$pollSizeChanges = function() { - var self = this; - this.$pollSizeChangesTimer = setInterval(function() { - self.checkForSizeChanges(); - }, 500); - }; - - this.$fontStyles = { - fontFamily : 1, - fontSize : 1, - fontWeight : 1, - fontStyle : 1, - lineHeight : 1 - }; - - this.$measureSizes = function() { - var n = 1000; - if (!this.$measureNode) { - var measureNode = this.$measureNode = dom.createElement("div"); - var style = measureNode.style; - - style.width = style.height = "auto"; - style.left = style.top = (-n * 40) + "px"; - - style.visibility = "hidden"; - style.position = "absolute"; - style.overflow = "visible"; - style.whiteSpace = "nowrap"; - - // in FF 3.6 monospace fonts can have a fixed sub pixel width. - // that's why we have to measure many characters - // Note: characterWidth can be a float! - measureNode.innerHTML = lang.stringRepeat("Xy", n); - - if (document.body) { - document.body.appendChild(measureNode); - } else { - var container = this.element.parentNode; - while (!dom.hasCssClass(container, "ace_editor")) - container = container.parentNode; - container.appendChild(measureNode); - } - - } - - var style = this.$measureNode.style; - var computedStyle = dom.computedStyle(this.element); - for (var prop in this.$fontStyles) - style[prop] = computedStyle[prop]; - - var size = { - height: this.$measureNode.offsetHeight, - width: this.$measureNode.offsetWidth / (n * 2) - }; - - // Size and width can be null if the editor is not visible or - // detached from the document - if (size.width == 0 && size.height == 0) - return null; - - return size; - }; - - this.setSession = function(session) { - this.session = session; - }; - - this.showInvisibles = false; - this.setShowInvisibles = function(showInvisibles) { - if (this.showInvisibles == showInvisibles) - return false; - - this.showInvisibles = showInvisibles; - return true; - }; - - this.$tabStrings = []; - this.$computeTabString = function() { - var tabSize = this.session.getTabSize(); - var tabStr = this.$tabStrings = [0]; - for (var i = 1; i < tabSize + 1; i++) { - if (this.showInvisibles) { - tabStr.push("" - + this.TAB_CHAR - + new Array(i).join(" ") - + ""); - } else { - tabStr.push(new Array(i+1).join(" ")); - } - } - - }; - - this.updateLines = function(config, firstRow, lastRow) { - this.$computeTabString(); - // Due to wrap line changes there can be new lines if e.g. - // the line to updated wrapped in the meantime. - if (this.config.lastRow != config.lastRow || - this.config.firstRow != config.firstRow) { - this.scrollLines(config); - } - this.config = config; - - var first = Math.max(firstRow, config.firstRow); - var last = Math.min(lastRow, config.lastRow); - - var lineElements = this.element.childNodes, - lineElementsIdx = 0; - - for (var row = config.firstRow; row < first; row++) { - var foldLine = this.session.getFoldLine(row); - if (foldLine) { - if (foldLine.containsRow(first)) { - break; - } else { - row = foldLine.end.row; - } - } - lineElementsIdx ++; - } - - for (var i=first; i<=last; i++) { - var lineElement = lineElements[lineElementsIdx++]; - if (!lineElement) - continue; - - var html = []; - var tokens = this.session.getTokens(i, i); - this.$renderLine(html, i, tokens[0].tokens); - lineElement = dom.setInnerHtml(lineElement, html.join("")); - - i = this.session.getRowFoldEnd(i); - } - }; - - this.scrollLines = function(config) { - this.$computeTabString(); - var oldConfig = this.config; - this.config = config; - - if (!oldConfig || oldConfig.lastRow < config.firstRow) - return this.update(config); - - if (config.lastRow < oldConfig.firstRow) - return this.update(config); - - var el = this.element; - if (oldConfig.firstRow < config.firstRow) - for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) - el.removeChild(el.firstChild); - - if (oldConfig.lastRow > config.lastRow) - for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) - el.removeChild(el.lastChild); - - if (config.firstRow < oldConfig.firstRow) { - var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); - if (el.firstChild) - el.insertBefore(fragment, el.firstChild); - else - el.appendChild(fragment); - } - - if (config.lastRow > oldConfig.lastRow) { - var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); - el.appendChild(fragment); - } - }; - - this.$renderLinesFragment = function(config, firstRow, lastRow) { - var fragment = document.createDocumentFragment(), - row = firstRow, - fold = this.session.getNextFold(row), - foldStart = fold ?fold.start.row :Infinity; - - while (true) { - if(row > foldStart) { - row = fold.end.row+1; - fold = this.session.getNextFold(row); - foldStart = fold ?fold.start.row :Infinity; - } - if(row > lastRow) - break; - - var lineEl = dom.createElement("div"); - - lineEl.className = "ace_line"; - - var html = []; - // Get the tokens per line as there might be some lines in between - // beeing folded. - // OPTIMIZE: If there is a long block of unfolded lines, just make - // this call once for that big block of unfolded lines. - var tokens = this.session.getTokens(row, row); - if (tokens.length == 1) - this.$renderLine(html, row, tokens[0].tokens); - - // don't use setInnerHtml since we are working with an empty DIV - lineEl.innerHTML = html.join(""); - fragment.appendChild(lineEl); - - row++; - } - return fragment; - }; - - this.update = function(config) { - this.$computeTabString(); - this.config = config; - - var html = []; - var firstRow = config.firstRow, lastRow = config.lastRow; - - var row = firstRow, - fold = this.session.getNextFold(row), - foldStart = fold ?fold.start.row :Infinity; - - while (true) { - if(row > foldStart) { - row = fold.end.row+1; - fold = this.session.getNextFold(row); - foldStart = fold ?fold.start.row :Infinity; - } - if(row > lastRow) - break; - - html.push("
"); - // Get the tokens per line as there might be some lines in between - // beeing folded. - // OPTIMIZE: If there is a long block of unfolded lines, just make - // this call once for that big block of unfolded lines. - var tokens = this.session.getTokens(row, row); - if (tokens.length == 1) - this.$renderLine(html, row, tokens[0].tokens); - html.push("
"); - - row++; - } - this.element = dom.setInnerHtml(this.element, html.join("")); - }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderToken = function(stringBuilder, screenColumn, token, value) { - var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; - var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { - return new Array(c.length+1).join(" "); - } else if (c == "\t") { - var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); - screenColumn += tabSize - 1; - return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { - return " "; - } - } else { - screenColumn += 1; - return "" + c + ""; - } - }; - - var output = value.replace(replaceReg, replaceFunc); - - if (!this.$textToken[token.type]) { - var classes = "ace_" + token.type.replace(/\./g, " ace_"); - stringBuilder.push("", output, ""); - } - else { - stringBuilder.push(output); - } - return value.length; - }; - - this.$renderLineCore = function(stringBuilder, lastRow, tokens, splits) { - var chars = 0, - split = 0, - splitChars, - characterWidth = this.config.characterWidth, - screenColumn = 0, - self = this; - - function addToken(token, value) { - screenColumn += self.$renderToken( - stringBuilder, screenColumn, token, value); - } - - if (!splits || splits.length == 0) { - splitChars = Number.MAX_VALUE; - } else { - splitChars = splits[0]; - } - - stringBuilder.push("
"); - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - var value = token.value; - - if (chars + value.length < splitChars) { - addToken(token, value); - chars += value.length; - } else { - while (chars + value.length >= splitChars) { - addToken(token, value.substring(0, splitChars - chars)); - value = value.substring(splitChars - chars); - chars = splitChars; - stringBuilder.push("
", - "
"); - - split ++; - screenColumn = 0; - splitChars = splits[split] || Number.MAX_VALUE; - } - if (value.length != 0) { - chars += value.length; - addToken(token, value); - } - } - } - - if (this.showInvisibles) { - if (lastRow !== this.session.getLength() - 1) { - stringBuilder.push("" + this.EOL_CHAR + ""); - } else { - stringBuilder.push("" + this.EOF_CHAR + ""); - } - } - stringBuilder.push("
"); - }; - - this.$renderLine = function(stringBuilder, row, tokens) { - // Check if the line to render is folded or not. If not, things are - // simple, otherwise, we need to fake some things... - if (!this.session.isRowFolded(row)) { - var splits = this.session.getRowSplitData(row); - this.$renderLineCore(stringBuilder, row, tokens, splits); - } else { - this.$renderFoldLine(stringBuilder, row, tokens); - } - }; - - this.$renderFoldLine = function(stringBuilder, row, tokens) { - var session = this.session, - foldLine = session.getFoldLine(row), - renderTokens = []; - - function addTokens(tokens, from, to) { - var idx = 0, col = 0; - while ((col + tokens[idx].value.length) < from) { - col += tokens[idx].value.length; - idx++; - - if (idx == tokens.length) { - return; - } - } - if (col != from) { - var value = tokens[idx].value.substring(from - col); - // Check if the token value is longer then the from...to spacing. - if (value.length > (to - from)) { - value = value.substring(0, to - from); - } - - renderTokens.push({ - type: tokens[idx].type, - value: value - }); - - col = from + value.length; - idx += 1; - } - - while (col < to) { - var value = tokens[idx].value; - if (value.length + col > to) { - value = value.substring(0, to - col); - } - renderTokens.push({ - type: tokens[idx].type, - value: value - }); - col += value.length; - idx += 1; - } - } - - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (placeholder) { - renderTokens.push({ - type: "fold", - value: placeholder - }); - } else { - if (isNewRow) { - tokens = this.session.getTokens(row, row)[0].tokens; - } - if (tokens.length != 0) { - addTokens(tokens, lastColumn, column); - } - } - }.bind(this), foldLine.end.row, this.session.getLine(foldLine.end.row).length); - - // TODO: Build a fake splits array! - var splits = this.session.$useWrapMode?this.session.$wrapData[row]:null; - this.$renderLineCore(stringBuilder, row, renderTokens, splits); - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - }; - -}).call(Text.prototype); - -exports.Text = Text; - -}); -/* vim:ts=4:sts=4:sw=4: - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Julian Viereck - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/layer/cursor', ['require', 'exports', 'module' , 'pilot/dom'], function(require, exports, module) { - -var dom = require("pilot/dom"); - -var Cursor = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - parentEl.appendChild(this.element); - - this.cursor = dom.createElement("div"); - this.cursor.className = "ace_cursor ace_hidden"; - this.element.appendChild(this.cursor); - - this.isVisible = false; -}; - -(function() { - - this.setSession = function(session) { - this.session = session; - }; - - this.hideCursor = function() { - this.isVisible = false; - dom.addCssClass(this.cursor, "ace_hidden"); - clearInterval(this.blinkId); - }; - - this.showCursor = function() { - this.isVisible = true; - dom.removeCssClass(this.cursor, "ace_hidden"); - this.cursor.style.visibility = "visible"; - this.restartTimer(); - }; - - this.restartTimer = function() { - clearInterval(this.blinkId); - if (!this.isVisible) { - return; - } - - var cursor = this.cursor; - this.blinkId = setInterval(function() { - cursor.style.visibility = "hidden"; - setTimeout(function() { - cursor.style.visibility = "visible"; - }, 400); - }, 1000); - }; - - this.getPixelPosition = function(onScreen) { - if (!this.config || !this.session) { - return { - left : 0, - top : 0 - }; - } - - var position = this.session.selection.getCursor(); - var pos = this.session.documentToScreenPosition(position); - var cursorLeft = Math.round(pos.column * this.config.characterWidth); - var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * - this.config.lineHeight; - - return { - left : cursorLeft, - top : cursorTop - }; - }; - - this.update = function(config) { - this.config = config; - - this.pixelPos = this.getPixelPosition(true); - - this.cursor.style.left = this.pixelPos.left + "px"; - this.cursor.style.top = this.pixelPos.top + "px"; - this.cursor.style.width = config.characterWidth + "px"; - this.cursor.style.height = config.lineHeight + "px"; - - var overwrite = this.session.getOverwrite() - if (overwrite != this.overwrite) { - this.overwrite = overwrite; - if (overwrite) - dom.addCssClass(this.cursor, "ace_overwrite"); - else - dom.removeCssClass(this.cursor, "ace_overwrite"); - } - - this.restartTimer(); - }; - - this.destroy = function() { - clearInterval(this.blinkId); - } - -}).call(Cursor.prototype); - -exports.Cursor = Cursor; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/scrollbar', ['require', 'exports', 'module' , 'pilot/oop', 'pilot/dom', 'pilot/event', 'pilot/event_emitter'], function(require, exports, module) { - -var oop = require("pilot/oop"); -var dom = require("pilot/dom"); -var event = require("pilot/event"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -var ScrollBar = function(parent) { - this.element = dom.createElement("div"); - this.element.className = "ace_sb"; - - this.inner = dom.createElement("div"); - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - this.width = dom.scrollbarWidth(); - this.element.style.width = this.width + "px"; - - event.addListener(this.element, "scroll", this.onScroll.bind(this)); -}; - -(function() { - oop.implement(this, EventEmitter); - - this.onScroll = function() { - this._dispatchEvent("scroll", {data: this.element.scrollTop}); - }; - - this.getWidth = function() { - return this.width; - }; - - this.setHeight = function(height) { - this.element.style.height = height + "px"; - }; - - this.setInnerHeight = function(height) { - this.inner.style.height = height + "px"; - }; - - this.setScrollTop = function(scrollTop) { - this.element.scrollTop = scrollTop; - }; - -}).call(ScrollBar.prototype); - -exports.ScrollBar = ScrollBar; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/renderloop', ['require', 'exports', 'module' , 'pilot/event'], function(require, exports, module) { - -var event = require("pilot/event"); - -var RenderLoop = function(onRender) { - this.onRender = onRender; - this.pending = false; - this.changes = 0; -}; - -(function() { - - this.schedule = function(change) { - //this.onRender(change); - //return; - this.changes = this.changes | change; - if (!this.pending) { - this.pending = true; - var _self = this; - this.setTimeoutZero(function() { - _self.pending = false; - var changes = _self.changes; - _self.changes = 0; - _self.onRender(changes); - }) - } - }; - - this.setTimeoutZero = window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame; - - if (this.setTimeoutZero) { - - this.setTimeoutZero = this.setTimeoutZero.bind(window) - } else if (window.postMessage) { - - this.messageName = "zero-timeout-message"; - - this.setTimeoutZero = function(callback) { - if (!this.attached) { - var _self = this; - event.addListener(window, "message", function(e) { - if (_self.callback && e.data == _self.messageName) { - event.stopPropagation(e); - _self.callback(); - } - }); - this.attached = true; - } - this.callback = callback; - window.postMessage(this.messageName, "*"); - } - - } else { - - this.setTimeoutZero = function(callback) { - setTimeout(callback, 0); - } - } - -}).call(RenderLoop.prototype); - -exports.RenderLoop = RenderLoop; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/textmate', ['require', 'exports', 'module' , 'pilot/dom'], function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-tm .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-tm .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-tm .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-tm .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-tm .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-tm .ace_print_margin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-tm .ace_text-layer {\ - cursor: text;\ -}\ -\ -.ace-tm .ace_cursor {\ - border-left: 2px solid black;\ -}\ -\ -.ace-tm .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid black;\ -}\ - \ -.ace-tm .ace_line .ace_invisible {\ - color: rgb(191, 191, 191);\ -}\ -\ -.ace-tm .ace_line .ace_keyword {\ - color: blue;\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_buildin {\ - color: rgb(88, 72, 246);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_language {\ - color: rgb(88, 92, 246);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_library {\ - color: rgb(6, 150, 14);\ -}\ -\ -.ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ -}\ -\ -.ace-tm .ace_line .ace_fold {\ - background-color: #E4E4E4;\ - border-radius: 3px;\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_function {\ - color: rgb(60, 76, 114);\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_constant {\ - color: rgb(6, 150, 14);\ -}\ -\ -.ace-tm .ace_line .ace_support.ace_type,\ -.ace-tm .ace_line .ace_support.ace_class {\ - color: rgb(109, 121, 222);\ -}\ -\ -.ace-tm .ace_line .ace_keyword.ace_operator {\ - color: rgb(104, 118, 135);\ -}\ -\ -.ace-tm .ace_line .ace_string {\ - color: rgb(3, 106, 7);\ -}\ -\ -.ace-tm .ace_line .ace_comment {\ - color: rgb(76, 136, 107);\ -}\ -\ -.ace-tm .ace_line .ace_comment.ace_doc {\ - color: rgb(0, 102, 255);\ -}\ -\ -.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\ - color: rgb(128, 159, 191);\ -}\ -\ -.ace-tm .ace_line .ace_constant.ace_numeric {\ - color: rgb(0, 0, 205);\ -}\ -\ -.ace-tm .ace_line .ace_variable {\ - color: rgb(49, 132, 149);\ -}\ -\ -.ace-tm .ace_line .ace_xml_pe {\ - color: rgb(104, 104, 91);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_selection {\ - background: rgb(181, 213, 255);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_step {\ - background: rgb(252, 255, 0);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_stack {\ - background: rgb(164, 229, 101);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgb(192, 192, 192);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_active_line {\ - background: rgb(232, 242, 254);\ -}\ -\ -.ace-tm .ace_marker-layer .ace_selected_word {\ - background: rgb(250, 250, 255);\ - border: 1px solid rgb(200, 200, 250);\ -}\ -\ -.ace-tm .ace_string.ace_regex {\ - color: rgb(255, 0, 0)\ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-tm"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is DomTemplate. - * - * The Initial Developer of the Original Code is Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/environment', ['require', 'exports', 'module' , 'pilot/settings'], function(require, exports, module) { - - -var settings = require("pilot/settings").settings; - -/** - * Create an environment object - */ -function create() { - return { - settings: settings - }; -}; - -exports.create = create; - - -}); -define("text/ace/css/editor.css", [], ".ace_editor {" + - " position: absolute;" + - " overflow: hidden;" + - "" + - " font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace;" + - " font-size: 12px;" + - "}" + - "" + - ".ace_scroller {" + - " position: absolute;" + - " overflow-x: scroll;" + - " overflow-y: hidden;" + - "}" + - "" + - ".ace_content {" + - " position: absolute;" + - " box-sizing: border-box;" + - " -moz-box-sizing: border-box;" + - " -webkit-box-sizing: border-box;" + - "}" + - "" + - ".ace_composition {" + - " position: absolute;" + - " background: #555;" + - " color: #DDD;" + - " z-index: 4;" + - "}" + - "" + - ".ace_gutter {" + - " position: absolute;" + - " overflow-x: hidden;" + - " overflow-y: hidden;" + - " height: 100%;" + - "}" + - "" + - ".ace_gutter-cell.ace_error {" + - " background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");" + - " background-repeat: no-repeat;" + - " background-position: 4px center;" + - "}" + - "" + - ".ace_gutter-cell.ace_warning {" + - " background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");" + - " background-repeat: no-repeat;" + - " background-position: 4px center;" + - "}" + - "" + - ".ace_editor .ace_sb {" + - " position: absolute;" + - " overflow-x: hidden;" + - " overflow-y: scroll;" + - " right: 0;" + - "}" + - "" + - ".ace_editor .ace_sb div {" + - " position: absolute;" + - " width: 1px;" + - " left: 0;" + - "}" + - "" + - ".ace_editor .ace_print_margin_layer {" + - " z-index: 0;" + - " position: absolute;" + - " overflow: hidden;" + - " margin: 0;" + - " left: 0;" + - " height: 100%;" + - " width: 100%;" + - "}" + - "" + - ".ace_editor .ace_print_margin {" + - " position: absolute;" + - " height: 100%;" + - "}" + - "" + - ".ace_editor textarea {" + - " position: fixed;" + - " z-index: -1;" + - " width: 10px;" + - " height: 30px;" + - " opacity: 0;" + - " background: transparent;" + - " appearance: none;" + - " border: none;" + - " resize: none;" + - " outline: none;" + - " overflow: hidden;" + - "}" + - "" + - ".ace_layer {" + - " z-index: 1;" + - " position: absolute;" + - " overflow: hidden;" + - " white-space: nowrap;" + - " height: 100%;" + - " width: 100%;" + - "}" + - "" + - ".ace_text-layer {" + - " font-family: Monaco, \"Courier New\", monospace;" + - " color: black;" + - "}" + - "" + - ".ace_cjk {" + - " display: inline-block;" + - " text-align: center;" + - "}" + - "" + - ".ace_cursor-layer {" + - " z-index: 4;" + - " cursor: text;" + - " pointer-events: none;" + - "}" + - "" + - ".ace_cursor {" + - " z-index: 4;" + - " position: absolute;" + - "}" + - "" + - ".ace_cursor.ace_hidden {" + - " opacity: 0.2;" + - "}" + - "" + - ".ace_line {" + - " white-space: nowrap;" + - "}" + - "" + - ".ace_marker-layer {" + - " cursor: text;" + - " pointer-events: none;" + - "}" + - "" + - ".ace_marker-layer .ace_step {" + - " position: absolute;" + - " z-index: 3;" + - "}" + - "" + - ".ace_marker-layer .ace_selection {" + - " position: absolute;" + - " z-index: 4;" + - "}" + - "" + - ".ace_marker-layer .ace_bracket {" + - " position: absolute;" + - " z-index: 5;" + - "}" + - "" + - ".ace_marker-layer .ace_active_line {" + - " position: absolute;" + - " z-index: 2;" + - "}" + - "" + - ".ace_marker-layer .ace_selected_word {" + - " position: absolute;" + - " z-index: 6;" + - " box-sizing: border-box;" + - " -moz-box-sizing: border-box;" + - " -webkit-box-sizing: border-box;" + - "}" + - "" + - ".ace_line .ace_fold {" + - " cursor: pointer;" + - "}" + - "" + - ".ace_dragging .ace_marker-layer, .ace_dragging .ace_text-layer {" + - " cursor: move;" + - "}" + - ""); - -define("text/styles.css", [], "html {" + - " height: 100%;" + - " width: 100%;" + - " overflow: hidden;" + - "}" + - "" + - "body {" + - " overflow: hidden;" + - " margin: 0;" + - " padding: 0;" + - " height: 100%;" + - " width: 100%;" + - " font-family: Arial, Helvetica, sans-serif, Tahoma, Verdana, sans-serif;" + - " font-size: 12px;" + - " background: rgb(14, 98, 165);" + - " color: white;" + - "}" + - "" + - "#logo {" + - " padding: 15px;" + - " margin-left: 65px;" + - "}" + - "" + - "#editor {" + - " position: absolute;" + - " top: 0px;" + - " left: 280px;" + - " bottom: 0px;" + - " right: 0px;" + - " background: white;" + - "}" + - "" + - "#controls {" + - " padding: 5px;" + - "}" + - "" + - "#controls td {" + - " text-align: right;" + - "}" + - "" + - "#controls td + td {" + - " text-align: left;" + - "}" + - "" + - "#cockpitInput {" + - " position: absolute;" + - " left: 280px;" + - " right: 0px;" + - " bottom: 0;" + - "" + - " border: none; outline: none;" + - " font-family: consolas, courier, monospace;" + - " font-size: 120%;" + - "}" + - "" + - "#cockpitOutput {" + - " padding: 10px;" + - " margin: 0 15px;" + - " border: 1px solid #AAA;" + - " -moz-border-radius-topleft: 10px;" + - " -moz-border-radius-topright: 10px;" + - " border-top-left-radius: 4px; border-top-right-radius: 4px;" + - " background: #DDD; color: #000;" + - "}"); - -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -require(["ace/ace"], function(ace) { - window.ace = ace; -}); \ No newline at end of file diff --git a/websdk/static/js/ace/ace.js b/websdk/static/js/ace/ace.js deleted file mode 100644 index 7ac56c0..0000000 --- a/websdk/static/js/ace/ace.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=function(){return this}();if(a.require&&a.define)require.packaged=!0;else{var b=function(a,c,d){typeof a!="string"?b.original?b.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(arguments.length==2&&(d=c),define.modules||(define.modules={}),define.modules[a]=d)};a.define&&(b.original=a.define),a.define=b;var c=function(a,b){if(Object.prototype.toString.call(a)==="[object Array]"){var e=[];for(var f=0,g=a.length;f=2)var e=arguments[1];else do{if(d in this){e=this[d++];break}if(++d>=c)throw new TypeError}while(!0);for(;d=2)var e=arguments[1];else do{if(d in this){e=this[d--];break}if(--d<0)throw new TypeError}while(!0);for(;d>=0;d--)d in this&&(e=b.call(null,e,this[d],d,this));return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=this.length;if(!c)return-1;var d=arguments[1]||0;if(d>=c)return-1;d<0&&(d+=c);for(;d=0;d--){if(!h(this,d))continue;if(b===this[d])return d}return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||b.constructor.prototype});if(!Object.getOwnPropertyDescriptor){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(n+b);if(!h(b,c))return undefined;var d,e,f;d={enumerable:!0,configurable:!0};if(m){var i=b.__proto__;b.__proto__=g;var e=k(b,c),f=l(b,c);b.__proto__=i;if(e||f){e&&(descriptor.get=e),f&&(descriptor.set=f);return descriptor}}descriptor.value=b[c];return descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={"__proto__":null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}typeof c!="undefined"&&Object.defineProperties(d,c);return d});if(!Object.defineProperty){var o="Property description must be an object: ",p="Object.defineProperty called on non-object: ",q="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function")throw new TypeError(p+b);if(typeof b!="object"||b===null)throw new TypeError(o+d);if(h(d,"value"))if(m&&(k(b,c)||l(b,c))){var e=b.__proto__;b.__proto__=g,delete b[c],b[c]=d.value,b.prototype}else b[c]=d.value;else{if(!m)throw new TypeError(q);h(d,"get")&&i(b,c,d.get),h(d,"set")&&j(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)h(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(r){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){return!0});if(!Object.keys){var s=!0,t=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=t.length;for(var v in{toString:null})s=!1;Object.keys=function a(b){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError("Object.keys called on a non-object");var a=[];for(var c in b)h(b,c)&&a.push(c);if(s)for(var d=0,e=u;d=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;k.constructor=b;return k}return a.apply(this,arguments)},c=new RegExp("^(?:((?:[+-]\\d\\d)?\\d\\d\\d\\d)(?:-(\\d\\d)(?:-(\\d\\d))?)?)?(?:T(\\d\\d):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?)?(?:Z|([+-])(\\d\\d):(\\d\\d))?$");for(var d in a)b[d]=a[d];b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();var f=e[0]===undefined;for(var g=0;g<10;g++){if(g===7)continue;e[g]=+(e[g]||(g<3?1:0)),g===1&&e[g]--}if(f)return((e[3]*60+e[4])*60+e[5])*1e3+e[6];var h=(e[8]*60+e[9])*60*1e3;e[6]==="-"&&(h=-h);return a.UTC.apply(this,e.slice(0,7))+h}return a.parse.apply(this,arguments)};return b}(Date));if(!String.prototype.trim){var w=/^\s\s*/,x=/\s\s*$/;String.prototype.trim=function(){return String(this).replace(w,"").replace(x,"")}}}),define("ace/ace",["require","exports","module","pilot/index","pilot/fixoldbrowsers","pilot/plugin_manager","pilot/dom","pilot/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/theme/textmate","pilot/environment"],function(a,b,c){a("pilot/index"),a("pilot/fixoldbrowsers");var d=a("pilot/plugin_manager").catalog;d.registerPlugins(["pilot/index"]);var e=a("pilot/dom"),f=a("pilot/event"),g=a("ace/editor").Editor,h=a("ace/edit_session").EditSession,i=a("ace/undomanager").UndoManager,j=a("ace/virtual_renderer").VirtualRenderer;b.edit=function(b){typeof b=="string"&&(b=document.getElementById(b));var c=new h(e.getInnerText(b));c.setUndoManager(new i),b.innerHTML="";var k=new g(new j(b,a("ace/theme/textmate")));k.setSession(c);var l=a("pilot/environment").create();d.startupPlugins({env:l}).then(function(){l.document=c,l.editor=k,k.resize(),f.addListener(window,"resize",function(){k.resize()}),b.env=l}),k.env=l;return k}}),define("pilot/index",["require","exports","module","pilot/fixoldbrowsers","pilot/types/basic","pilot/types/command","pilot/types/settings","pilot/commands/settings","pilot/commands/basic","pilot/settings/canon","pilot/canon"],function(a,b,c){b.startup=function(b,c){a("pilot/fixoldbrowsers"),a("pilot/types/basic").startup(b,c),a("pilot/types/command").startup(b,c),a("pilot/types/settings").startup(b,c),a("pilot/commands/settings").startup(b,c),a("pilot/commands/basic").startup(b,c),a("pilot/settings/canon").startup(b,c),a("pilot/canon").startup(b,c)},b.shutdown=function(b,c){a("pilot/types/basic").shutdown(b,c),a("pilot/types/command").shutdown(b,c),a("pilot/types/settings").shutdown(b,c),a("pilot/commands/settings").shutdown(b,c),a("pilot/commands/basic").shutdown(b,c),a("pilot/settings/canon").shutdown(b,c),a("pilot/canon").shutdown(b,c)}}),define("pilot/types/basic",["require","exports","module","pilot/types"],function(a,b,c){function m(a){if(a instanceof e)this.subtype=a;else{if(typeof a!="string")throw new Error("Can' handle array subtype");this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}}function l(a){if(typeof a.defer!="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function j(a){if(!Array.isArray(a.data)&&typeof a.data!="function")throw new Error("instances of SelectionType need typeSpec.data to be an array or function that returns an array:"+JSON.stringify(a));Object.keys(a).forEach(function(b){this[b]=a[b]},this)}var d=a("pilot/types"),e=d.Type,f=d.Conversion,g=d.Status,h=new e;h.stringify=function(a){return a},h.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to text.parse()");return new f(a)},h.name="text";var i=new e;i.stringify=function(a){if(!a)return null;return""+a},i.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to number.parse()");if(a.replace(/\s/g,"").length===0)return new f(null,g.INCOMPLETE,"");var b=new f(parseInt(a,10));isNaN(b.value)&&(b.status=g.INVALID,b.message="Can't convert \""+a+'" to a number.');return b},i.decrement=function(a){return a-1},i.increment=function(a){return a+1},i.name="number",j.prototype=new e,j.prototype.stringify=function(a){return a},j.prototype.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to parse()");if(!this.data)throw new Error("Missing data on selection type extension.");var b=typeof this.data=="function"?this.data():this.data,c=!1,d,e=[];b.forEach(function(b){a==b?(d=this.fromString(b),c=!0):b.indexOf(a)===0&&e.push(this.fromString(b))},this);if(c)return new f(d);this.noMatch&&this.noMatch();if(e.length>0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data=="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data=="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array";var n=!1;b.startup=function(){n||(n=!0,d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m))},b.shutdown=function(){n=!1,d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types",["require","exports","module"],function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d=="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb.valueOf()&&(b=a[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a=="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.registerTypes=function(c){Object.keys(c).forEach(function(a){var d=c[a];d.name=a,b.registerType(d)})},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a=="string")return h(a);if(typeof a=="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/types/command",["require","exports","module","pilot/canon","pilot/types/basic","pilot/types"],function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/canon",["require","exports","module","pilot/console","pilot/stacktrace","pilot/oop","pilot/useragent","pilot/keys","pilot/event_emitter","pilot/typecheck","pilot/catalog","pilot/types","pilot/lang"],function(a,b,c){function J(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=!1,this.start=new Date,this.end=null,this.completed=!1,this.error=!1}function G(a,b,c,e,f){function h(){a.exec(b,g.args,g),!g.isAsync&&!g.isDone&&g.done()}typeof a=="string"&&(a=q[a]);if(!a)return!1;var g=new J({sender:c,command:a,args:e||{},typed:f});if(g.getStatus()==l.INVALID){d.error("Canon.exec: Invalid parameter(s) passed to "+a.name);return!1}if(g.getStatus()==l.INCOMPLETE){var i,j=b[c];if(!j||!j.getArgsProvider||!(i=j.getArgsProvider()))i=F;i(g,function(){g.getStatus()==l.VALID&&h()});return!0}h();return!0}function F(a,b){var c=a.args,d=a.command.params;for(var e=0;eI)H.shiftObject();b._dispatchEvent("output",{requests:H,request:this})},J.prototype.doneWithError=function(a){this.error=!0,this.done(a)},J.prototype.async=function(){this.isAsync=!0,this._begunOutput||this._beginOutput()},J.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this.isDone=!0,this._dispatchEvent("output",{});return this},J.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this.isDone||(this.isDone=!0,this._dispatchEvent("output",{}))},b.Request=J}),define("pilot/console",["require","exports","module"],function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window=="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/stacktrace",["require","exports","module","pilot/useragent","pilot/console"],function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e=0,b.isIPad=e.indexOf("iPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("pilot/oop",["require","exports","module"],function(a,b,c){b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),define("pilot/keys",["require","exports","module","pilot/oop"],function(a,b,c){var d=a("pilot/oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(i in a.FUNCTION_KEYS){var b=a.FUNCTION_KEYS[i].toUpperCase();a[b]=parseInt(i,10)}d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS);return a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),define("pilot/event_emitter",["require","exports","module"],function(a,b,c){var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!!c&&!!c.length){var b=b||{};b.type=a;for(var d=0;d'+c.name+" = "+c.value+"
"})}else b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/commands/basic",["require","exports","module","pilot/typecheck","pilot/canon"],function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

Welcome to Skywriter - Code in the Cloud

',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

Sub-Commands of "+e.name+"

"),d.push("

"+e.description+"

")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

Commands starting with '"+b.search+"':

")):d.push("

Available Commands:

");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
'+e.name+""+e.description+"
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"'"+" (type: "+type+"):

"+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/settings/canon",["require","exports","module"],function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/plugin_manager",["require","exports","module","pilot/promise"],function(a,b,c){var d=a("pilot/promise").Promise;b.REASONS={APP_STARTUP:1,APP_SHUTDOWN:2,PLUGIN_ENABLE:3,PLUGIN_DISABLE:4,PLUGIN_INSTALL:5,PLUGIN_UNINSTALL:6,PLUGIN_UPGRADE:7,PLUGIN_DOWNGRADE:8},b.Plugin=function(a){this.name=a,this.status=this.INSTALLED},b.Plugin.prototype={NEW:0,INSTALLED:1,REGISTERED:2,STARTED:3,UNREGISTERED:4,SHUTDOWN:5,install:function(b,c){var e=new d;if(this.status>this.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",["require","exports","module","pilot/console","pilot/stacktrace"],function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a=="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b=="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&d===a.length&&b.resolve(c)}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/dom",["require","exports","module"],function(a,b,c){var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},document.documentElement.classList?(b.hasCssClass=function(a,b){return a.classList.contains(b)},b.addCssClass=function(a,b){a.classList.add(b)},b.removeCssClass=function(a,b){a.classList.remove(b)},b.toggleCssClass=function(a,b){return a.classList.toggle(b)}):(b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}d&&c.push(b),a.className=c.join(" ");return d}),b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var e=b.createElementNS?b.createElementNS(d,"style"):b.createElement("style");e.appendChild(b.createTextNode(a));var f=b.getElementsByTagName("head")[0]||b.documentElement;f.appendChild(e)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},window.pageYOffset!==undefined?(b.getPageScrollTop=function(){return window.pageYOffset},b.getPageScrollLeft=function(){return window.pageXOffset}):(b.getPageScrollTop=function(){return document.body.scrollTop},b.getPageScrollLeft=function(){return document.body.scrollLeft}),window.getComputedStyle?b.computedStyle=function(a,b){if(b)return(window.getComputedStyle(a,"")||{})[b]||"";return window.getComputedStyle(a,"")||{}}:b.computedStyle=function(a,b){if(b)return a.currentStyle[b];return a.currentStyle},b.scrollbarWidth=function(){var a=b.createElement("p");a.style.width="100%",a.style.height="200px";var c=b.createElement("div"),d=c.style;d.position="absolute",d.left="-10000px",d.overflow="hidden",d.width="200px",d.height="150px",c.appendChild(a);var e=document.body||document.documentElement;e.appendChild(c);var f=a.offsetWidth;d.overflow="scroll";var g=a.offsetWidth;f==g&&(g=c.clientWidth),e.removeChild(c);return f-g},b.setInnerHtml=function(a,b){var c=a.cloneNode(!1);c.innerHTML=b,a.parentNode.replaceChild(c,a);return c},b.setInnerText=function(a,b){document.body&&"textContent"in document.body?a.textContent=b:a.innerText=b},b.getInnerText=function(a){return document.body&&"textContent"in document.body?a.textContent:a.innerText||a.textContent||""},b.getParentWindow=function(a){return a.defaultView||a.parentWindow},b.getSelectionStart=function(a){var b;try{b=a.selectionStart||0}catch(c){b=0}return b},b.setSelectionStart=function(a,b){return a.selectionStart=b},b.getSelectionEnd=function(a){var b;try{b=a.selectionEnd||0}catch(c){b=0}return b},b.setSelectionEnd=function(a,b){return a.selectionEnd=b}}),define("pilot/event",["require","exports","module","pilot/keys","pilot/useragent","pilot/dom"],function(a,b,c){function g(a,b,c){var f=0;e.isOpera&&e.isMac?f=0|(b.metaKey?1:0)|(b.altKey?2:0)|(b.shiftKey?4:0)|(b.ctrlKey?8:0):f=0|(b.ctrlKey?1:0)|(b.altKey?2:0)|(b.shiftKey?4:0)|(b.metaKey?8:0);if(c in d.MODIFIER_KEYS){switch(d.MODIFIER_KEYS[c]){case"Alt":f=2;break;case"Shift":f=4;break;case"Ctrl":f=1;break;default:f=8}c=0}f&8&&(c==91||c==93)&&(c=0);if(f==0&&!(c in d.FUNCTION_KEYS))return!1;return a(b,f,c)}var d=a("pilot/keys"),e=a("pilot/useragent"),f=a("pilot/dom");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){return a.clientX?a.clientX+f.getPageScrollLeft():a.pageX},b.getDocumentY=function(a){return a.clientY?a.clientY+f.getPageScrollTop():a.pageY},b.getButton=function(a){if(a.type=="dblclick")return 0;if(a.type=="contextmenu")return 2;return a.preventDefault?a.button:{1:0,2:2,4:1}[a.button]},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,d,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));var e=b.getButton(a)==c;if(!e||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){h=a.keyIdentifier||a.keyCode;return g(c,a,a.keyCode)}),e.isMac&&e.isOpera&&d(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(h!==b)return g(c,a,a.keyCode);h=null})}}}),define("ace/editor",["require","exports","module","pilot/fixoldbrowsers","pilot/oop","pilot/event","pilot/lang","pilot/useragent","ace/keyboard/textinput","ace/mouse_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","pilot/event_emitter"],function(a,b,c){a("pilot/fixoldbrowsers");var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("pilot/useragent"),h=a("ace/keyboard/textinput").TextInput,i=a("ace/mouse_handler").MouseHandler,j=a("ace/keyboard/keybinding").KeyBinding,k=a("ace/edit_session").EditSession,l=a("ace/search").Search,m=a("ace/range").Range,n=a("pilot/event_emitter").EventEmitter,o=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new h(a.getTextAreaContainer(),this),this.keyBinding=new j(this),g.isIPad||(this.$mouseHandler=new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session!=a){if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange),this.session.setScrollTopRow(this.renderer.getScrollTopRow())}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull(),this._dispatchEvent("changeSession",{session:a,oldSession:b})}},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){var a=this;g.isIE||setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._dispatchEvent("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._dispatchEvent("blur")},this.onDocumentChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines")var d=c.end.row;else d=Infinity;this.renderer.updateLines(c.start.row,d),this.renderer.updateCursor()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(a){this.renderer.updateCursor(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.renderer.moveTextAreaToCursor(this.textInput.getElement()),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),a.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row),d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","line")}},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){return this.selection.isEmpty()?"":this.session.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection())},this.insert=function(a){if(!this.$readOnly){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace("\t",this.session.getTabString());if(!this.selection.isEmpty()){var d=this.session.remove(this.getSelectionRange());this.clearSelection()}else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)=="\t"?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}else i&&c.autoOutdent(h,b,d.row)}},this.onTextInput=function(a){this.keyBinding.onTextInput(a)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){this.$highlightSelectedWord!=a&&(this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this))},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!1,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.session.remove(this.getSelectionRange()),this.clearSelection())},this.removeLeft=function(){if(!this.$readOnly){this.selection.isEmpty()&&this.selection.selectLeft();var a=this.getSelectionRange();if(this.getBehavioursEnabled()){var b=this.session,c=b.getState(a.start.row),d=b.getMode().transformAction(c,"deletion",this,b,a);d!==!1&&(a=d)}this.session.remove(a),this.clearSelection()}},this.removeWordRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection())},this.removeWordLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection())},this.removeToLineStart=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection())},this.removeToLineEnd=function(){if(!this.$readOnly){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()}},this.splitLine=function(){if(!this.$readOnly){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)}},this.transposeLetters=function(){if(!this.$readOnly){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b==0)return;var c=this.session.getLine(a.row);if(b hint.end) { - hint.distance = cursor - hint.end; - } - else { - hint.distance = 0; - } - }, this); - } - // Sort - hints.sort(function(hint1, hint2) { - // Compare first based on distance from cursor - if (cursor !== undefined) { - var diff = hint1.distance - hint2.distance; - if (diff != 0) { - return diff; - } - } - // otherwise go with hint severity - return hint2.status - hint1.status; - }); - // tidy-up - if (cursor !== undefined) { - hints.forEach(function(hint) { - delete hint.distance; - }, this); - } - return hints; -}; -exports.Hint = Hint; - -/** - * A Hint that arose as a result of a Conversion - */ -function ConversionHint(conversion, arg) { - this.status = conversion.status; - this.message = conversion.message; - if (arg) { - this.start = arg.start; - this.end = arg.end; - } - else { - this.start = 0; - this.end = 0; - } - this.predictions = conversion.predictions; -}; -oop.inherits(ConversionHint, Hint); - - -/** - * We record where in the input string an argument comes so we can report errors - * against those string positions. - * We publish a 'change' event when-ever the text changes - * @param emitter Arguments use something else to pass on change events. - * Currently this will be the creating Requisition. This prevents dependency - * loops and prevents us from needing to merge listener lists. - * @param text The string (trimmed) that contains the argument - * @param start The position of the text in the original input string - * @param end See start - * @param prefix Knowledge of quotation marks and whitespace used prior to the - * text in the input string allows us to re-generate the original input from - * the arguments. - * @param suffix Any quotation marks and whitespace used after the text. - * Whitespace is normally placed in the prefix to the succeeding argument, but - * can be used here when this is the last argument. - * @constructor - */ -function Argument(emitter, text, start, end, prefix, suffix) { - this.emitter = emitter; - this.setText(text); - this.start = start; - this.end = end; - this.prefix = prefix; - this.suffix = suffix; -} -Argument.prototype = { - /** - * Return the result of merging these arguments. - * TODO: What happens when we're merging arguments for the single string - * case and some of the arguments are in quotation marks? - */ - merge: function(following) { - if (following.emitter != this.emitter) { - throw new Error('Can\'t merge Arguments from different EventEmitters'); - } - return new Argument( - this.emitter, - this.text + this.suffix + following.prefix + following.text, - this.start, following.end, - this.prefix, - following.suffix); - }, - - /** - * See notes on events in Assignment. We might need to hook changes here - * into a CliRequisition so they appear of the command line. - */ - setText: function(text) { - if (text == null) { - throw new Error('Illegal text for Argument: ' + text); - } - var ev = { argument: this, oldText: this.text, text: text }; - this.text = text; - this.emitter._dispatchEvent('argumentChange', ev); - }, - - /** - * Helper when we're putting arguments back together - */ - toString: function() { - // TODO: There is a bug here - we should re-escape escaped characters - // But can we do that reliably? - return this.prefix + this.text + this.suffix; - } -}; - -/** - * Merge an array of arguments into a single argument. - * All Arguments in the array are expected to have the same emitter - */ -Argument.merge = function(argArray, start, end) { - start = (start === undefined) ? 0 : start; - end = (end === undefined) ? argArray.length : end; - - var joined; - for (var i = start; i < end; i++) { - var arg = argArray[i]; - if (!joined) { - joined = arg; - } - else { - joined = joined.merge(arg); - } - } - return joined; -}; - -/** - * We sometimes need a way to say 'this error occurs where ever the cursor is' - */ -Argument.AT_CURSOR = -1; - - -/** - * A link between a parameter and the data for that parameter. - * The data for the parameter is available as in the preferred type and as - * an Argument for the CLI. - *

We also record validity information where applicable. - *

For values, null and undefined have distinct definitions. null means - * that a value has been provided, undefined means that it has not. - * Thus, null is a valid default value, and common because it identifies an - * parameter that is optional. undefined means there is no value from - * the command line. - * @constructor - */ -function Assignment(param, requisition) { - this.param = param; - this.requisition = requisition; - this.setValue(param.defaultValue); -}; -Assignment.prototype = { - /** - * The parameter that we are assigning to - * @readonly - */ - param: undefined, - - /** - * Report on the status of the last parse() conversion. - * @see types.Conversion - */ - conversion: undefined, - - /** - * The current value in a type as specified by param.type - */ - value: undefined, - - /** - * The string version of the current value - */ - arg: undefined, - - /** - * The current value (i.e. not the string representation) - * Use setValue() to mutate - */ - value: undefined, - setValue: function(value) { - if (this.value === value) { - return; - } - - if (value === undefined) { - this.value = this.param.defaultValue; - this.conversion = this.param.getDefault ? - this.param.getDefault() : - this.param.type.getDefault(); - this.arg = undefined; - } else { - this.value = value; - this.conversion = undefined; - var text = (value == null) ? '' : this.param.type.stringify(value); - if (this.arg) { - this.arg.setText(text); - } - } - - this.requisition._assignmentChanged(this); - }, - - /** - * The textual representation of the current value - * Use setValue() to mutate - */ - arg: undefined, - setArgument: function(arg) { - if (this.arg === arg) { - return; - } - this.arg = arg; - this.conversion = this.param.type.parse(arg.text); - this.conversion.arg = arg; // TODO: make this automatic? - this.value = this.conversion.value; - this.requisition._assignmentChanged(this); - }, - - /** - * Create a list of the hints associated with this parameter assignment. - * Generally there will be only one hint generated because we're currently - * only displaying one hint at a time, ordering by distance from cursor - * and severity. Since distance from cursor will be the same for all hints - * from this assignment all but the most severe will ever be used. It might - * make sense with more experience to alter this to function to be getHint() - */ - getHint: function() { - // Allow the parameter to provide documentation - if (this.param.getCustomHint && this.value && this.arg) { - var hint = this.param.getCustomHint(this.value, this.arg); - if (hint) { - return hint; - } - } - - // If there is no argument, use the cursor position - var message = '' + this.param.name + ': '; - if (this.param.description) { - // TODO: This should be a short description - do we need to trim? - message += this.param.description.trim(); - - // Ensure the help text ends with '. ' - if (message.charAt(message.length - 1) !== '.') { - message += '.'; - } - if (message.charAt(message.length - 1) !== ' ') { - message += ' '; - } - } - var status = Status.VALID; - var start = this.arg ? this.arg.start : Argument.AT_CURSOR; - var end = this.arg ? this.arg.end : Argument.AT_CURSOR; - var predictions; - - // Non-valid conversions will have useful information to pass on - if (this.conversion) { - status = this.conversion.status; - if (this.conversion.message) { - message += this.conversion.message; - } - predictions = this.conversion.predictions; - } - - // Hint if the param is required, but not provided - var argProvided = this.arg && this.arg.text !== ''; - var dataProvided = this.value !== undefined || argProvided; - if (this.param.defaultValue === undefined && !dataProvided) { - status = Status.INVALID; - message += 'Required<\strong>'; - } - - return new Hint(status, message, start, end, predictions); - }, - - /** - * Basically setValue(conversion.predictions[0]) done in a safe - * way. - */ - complete: function() { - if (this.conversion && this.conversion.predictions && - this.conversion.predictions.length > 0) { - this.setValue(this.conversion.predictions[0]); - } - }, - - /** - * If the cursor is at 'position', do we have sufficient data to start - * displaying the next hint. This is both complex and important. - * For example, if the user has just typed:

    - *
  • 'set tabstop ' then they clearly want to know about the valid - * values for the tabstop setting, so the hint is based on the next - * parameter. - *
  • 'set tabstop' (without trailing space) - they will probably still - * want to know about the valid values for the tabstop setting because - * there is no confusion about the setting in question. - *
  • 'set tabsto' they've not finished typing a setting name so the hint - * should be based on the current parameter. - *
  • 'set tabstop' (when there is an additional tabstopstyle setting) we - * can't make assumptions about the setting - we're not finished. - *
- *

Note that the input for 2 and 4 is identical, only the configuration - * has changed, so hint display is environmental. - * - *

This function works out if the cursor is before the end of this - * assignment (assuming that we've asked the same thing of the previous - * assignment) and then attempts to work out if we should use the hint from - * the next assignment even though technically the cursor is still inside - * this one due to the rules above. - */ - isPositionCaptured: function(position) { - if (!this.arg) { - return false; - } - - // Note we don't check if position >= this.arg.start because that's - // implied by the fact that we're asking the assignments in turn, and - // we want to avoid thing falling between the cracks, but we do need - // to check that the argument does have a position - if (this.arg.start === -1) { - return false; - } - - // We're clearly done if the position is past the end of the text - if (position > this.arg.end) { - return false; - } - - // If we're AT the end, the position is captured if either the status - // is not valid or if there are other valid options including current - if (position === this.arg.end) { - return this.conversion.status !== Status.VALID || - this.conversion.predictions.length !== 0; - } - - // Otherwise we're clearly inside - return true; - }, - - /** - * Replace the current value with the lower value if such a concept - * exists. - */ - decrement: function() { - var replacement = this.param.type.decrement(this.value); - if (replacement != null) { - this.setValue(replacement); - } - }, - - /** - * Replace the current value with the higher value if such a concept - * exists. - */ - increment: function() { - var replacement = this.param.type.increment(this.value); - if (replacement != null) { - this.setValue(replacement); - } - }, - - /** - * Helper when we're rebuilding command lines. - */ - toString: function() { - return this.arg ? this.arg.toString() : ''; - } -}; -exports.Assignment = Assignment; - - -/** - * This is a special parameter to reflect the command itself. - */ -var commandParam = { - name: '__command', - type: 'command', - description: 'The command to execute', - - /** - * Provide some documentation for a command. - */ - getCustomHint: function(command, arg) { - var docs = []; - docs.push(' > '); - docs.push(command.name); - if (command.params && command.params.length > 0) { - command.params.forEach(function(param) { - if (param.defaultValue === undefined) { - docs.push(' [' + param.name + ']'); - } - else { - docs.push(' [' + param.name + ']'); - } - }, this); - } - docs.push('
'); - - docs.push(command.description ? command.description : '(No description)'); - docs.push('
'); - - if (command.params && command.params.length > 0) { - docs.push('

    '); - command.params.forEach(function(param) { - docs.push('
  • '); - docs.push('' + param.name + ': '); - docs.push(param.description ? param.description : '(No description)'); - if (param.defaultValue === undefined) { - docs.push(' [Required]'); - } - else if (param.defaultValue === null) { - docs.push(' [Optional]'); - } - else { - docs.push(' [Default: ' + param.defaultValue + ']'); - } - docs.push('
  • '); - }, this); - docs.push('
'); - } - - return new Hint(Status.VALID, docs.join(''), arg); - } -}; - -/** - * A Requisition collects the information needed to execute a command. - * There is no point in a requisition for parameter-less commands because there - * is no information to collect. A Requisition is a collection of assignments - * of values to parameters, each handled by an instance of Assignment. - * CliRequisition adds functions for parsing input from a command line to this - * class. - *

Events

- * We publish the following events:
    - *
  • argumentChange: The text of some argument has changed. It is likely that - * any UI component displaying this argument will need to be updated. (Note that - * this event is actually published by the Argument itself - see the docs for - * Argument for more details) - * The event object looks like: { argument: A, oldText: B, text: B } - *
  • commandChange: The command has changed. It is likely that a UI - * structure will need updating to match the parameters of the new command. - * The event object looks like { command: A } - * @constructor - */ -function Requisition(env) { - this.env = env; - this.commandAssignment = new Assignment(commandParam, this); -} - -Requisition.prototype = { - /** - * The command that we are about to execute. - * @see setCommandConversion() - * @readonly - */ - commandAssignment: undefined, - - /** - * The count of assignments. Excludes the commandAssignment - * @readonly - */ - assignmentCount: undefined, - - /** - * The object that stores of Assignment objects that we are filling out. - * The Assignment objects are stored under their param.name for named - * lookup. Note: We make use of the property of Javascript objects that - * they are not just hashmaps, but linked-list hashmaps which iterate in - * insertion order. - * Excludes the commandAssignment. - */ - _assignments: undefined, - - /** - * The store of hints generated by the assignments. We are trying to prevent - * the UI from needing to access this in broad form, but instead use - * methods that query part of this structure. - */ - _hints: undefined, - - /** - * When the command changes, we need to keep a bunch of stuff in sync - */ - _assignmentChanged: function(assignment) { - // This is all about re-creating Assignments - if (assignment.param.name !== '__command') { - return; - } - - this._assignments = {}; - - if (assignment.value) { - assignment.value.params.forEach(function(param) { - this._assignments[param.name] = new Assignment(param, this); - }, this); - } - - this.assignmentCount = Object.keys(this._assignments).length; - this._dispatchEvent('commandChange', { command: assignment.value }); - }, - - /** - * Assignments have an order, so we need to store them in an array. - * But we also need named access ... - */ - getAssignment: function(nameOrNumber) { - var name = (typeof nameOrNumber === 'string') ? - nameOrNumber : - Object.keys(this._assignments)[nameOrNumber]; - return this._assignments[name]; - }, - - /** - * Where parameter name == assignment names - they are the same. - */ - getParameterNames: function() { - return Object.keys(this._assignments); - }, - - /** - * A *shallow* clone of the assignments. - * This is useful for systems that wish to go over all the assignments - * finding values one way or another and wish to trim an array as they go. - */ - cloneAssignments: function() { - return Object.keys(this._assignments).map(function(name) { - return this._assignments[name]; - }, this); - }, - - /** - * Collect the statuses from the Assignments. - * The hints returned are sorted by severity - */ - _updateHints: function() { - // TODO: work out when to clear this out for the plain Requisition case - // this._hints = []; - this.getAssignments(true).forEach(function(assignment) { - this._hints.push(assignment.getHint()); - }, this); - Hint.sort(this._hints); - - // We would like to put some initial help here, but for anyone but - // a complete novice a 'type help' message is very annoying, so we - // need to find a way to only display this message once, or for - // until the user click a 'close' button or similar - // TODO: Add special case for '' input - }, - - /** - * Returns the most severe status - */ - getWorstHint: function() { - return this._hints[0]; - }, - - /** - * Extract the names and values of all the assignments, and return as - * an object. - */ - getArgsObject: function() { - var args = {}; - this.getAssignments().forEach(function(assignment) { - args[assignment.param.name] = assignment.value; - }, this); - return args; - }, - - /** - * Access the arguments as an array. - * @param includeCommand By default only the parameter arguments are - * returned unless (includeCommand === true), in which case the list is - * prepended with commandAssignment.arg - */ - getAssignments: function(includeCommand) { - var args = []; - if (includeCommand === true) { - args.push(this.commandAssignment); - } - Object.keys(this._assignments).forEach(function(name) { - args.push(this.getAssignment(name)); - }, this); - return args; - }, - - /** - * Reset all the assignments to their default values - */ - setDefaultValues: function() { - this.getAssignments().forEach(function(assignment) { - assignment.setValue(undefined); - }, this); - }, - - /** - * Helper to call canon.exec - */ - exec: function() { - canon.exec(this.commandAssignment.value, - this.env, - "cli", - this.getArgsObject(), - this.toCanonicalString()); - }, - - /** - * Extract a canonical version of the input - */ - toCanonicalString: function() { - var line = []; - line.push(this.commandAssignment.value.name); - Object.keys(this._assignments).forEach(function(name) { - var assignment = this._assignments[name]; - var type = assignment.param.type; - // TODO: This will cause problems if there is a non-default value - // after a default value. Also we need to decide when to use - // named parameters in place of positional params. Both can wait. - if (assignment.value !== assignment.param.defaultValue) { - line.push(' '); - line.push(type.stringify(assignment.value)); - } - }, this); - return line.join(''); - } -}; -oop.implement(Requisition.prototype, EventEmitter); -exports.Requisition = Requisition; - - -/** - * An object used during command line parsing to hold the various intermediate - * data steps. - *

    The 'output' of the update is held in 2 objects: input.hints which is an - * array of hints to display to the user. In the future this will become a - * single value. - *

    The other output value is input.requisition which gives access to an - * args object for use in executing the final command. - * - *

    The majority of the functions in this class are called in sequence by the - * constructor. Their task is to add to hints fill out the requisition. - *

    The general sequence is:

      - *
    • _tokenize(): convert _typed into _parts - *
    • _split(): convert _parts into _command and _unparsedArgs - *
    • _assign(): convert _unparsedArgs into requisition - *
    - * - * @param typed {string} The instruction as typed by the user so far - * @param options {object} A list of optional named parameters. Can be any of: - * flags: Flags for us to check against the predicates specified with the - * commands. Defaulted to keyboard.buildFlags({ }); - * if not specified. - * @constructor - */ -function CliRequisition(env, options) { - Requisition.call(this, env); - - if (options && options.flags) { - /** - * TODO: We were using a default of keyboard.buildFlags({ }); - * This allowed us to have commands that only existed in certain contexts - * - i.e. Javascript specific commands. - */ - this.flags = options.flags; - } -} -oop.inherits(CliRequisition, Requisition); -(function() { - /** - * Called by the UI when ever the user interacts with a command line input - * @param input A structure that details the state of the input field. - * It should look something like: { typed:a, cursor: { start:b, end:c } } - * Where a is the contents of the input field, and b and c are the start - * and end of the cursor/selection respectively. - */ - CliRequisition.prototype.update = function(input) { - this.input = input; - this._hints = []; - - var args = this._tokenize(input.typed); - this._split(args); - - if (this.commandAssignment.value) { - this._assign(args); - } - - this._updateHints(); - }; - - /** - * Return an array of Status scores so we can create a marked up - * version of the command line input. - */ - CliRequisition.prototype.getInputStatusMarkup = function() { - // 'scores' is an array which tells us what chars are errors - // Initialize with everything VALID - var scores = this.toString().split('').map(function(ch) { - return Status.VALID; - }); - // For all chars in all hints, check and upgrade the score - this._hints.forEach(function(hint) { - for (var i = hint.start; i <= hint.end; i++) { - if (hint.status > scores[i]) { - scores[i] = hint.status; - } - } - }, this); - return scores; - }; - - /** - * Reconstitute the input from the args - */ - CliRequisition.prototype.toString = function() { - return this.getAssignments(true).map(function(assignment) { - return assignment.toString(); - }, this).join(''); - }; - - var superUpdateHints = CliRequisition.prototype._updateHints; - /** - * Marks up hints in a number of ways: - * - Makes INCOMPLETE hints that are not near the cursor INVALID since - * they can't be completed by typing - * - Finds the most severe hint, and annotates the array with it - * - Finds the hint to display, and also annotates the array with it - * TODO: I'm wondering if array annotation is evil and we should replace - * this with an object. Need to find out more. - */ - CliRequisition.prototype._updateHints = function() { - superUpdateHints.call(this); - - // Not knowing about cursor positioning, the requisition and assignments - // can't know this, but anything they mark as INCOMPLETE is actually - // INVALID unless the cursor is actually inside that argument. - var c = this.input.cursor; - this._hints.forEach(function(hint) { - var startInHint = c.start >= hint.start && c.start <= hint.end; - var endInHint = c.end >= hint.start && c.end <= hint.end; - var inHint = startInHint || endInHint; - if (!inHint && hint.status === Status.INCOMPLETE) { - hint.status = Status.INVALID; - } - }, this); - - Hint.sort(this._hints); - }; - - /** - * Accessor for the hints array. - * While we could just use the hints property, using getHints() is - * preferred for symmetry with Requisition where it needs a function due to - * lack of an atomic update system. - */ - CliRequisition.prototype.getHints = function() { - return this._hints; - }; - - /** - * Look through the arguments attached to our assignments for the assignment - * at the given position. - */ - CliRequisition.prototype.getAssignmentAt = function(position) { - var assignments = this.getAssignments(true); - for (var i = 0; i < assignments.length; i++) { - var assignment = assignments[i]; - if (!assignment.arg) { - // There is no argument in this assignment, we've fallen off - // the end of the obvious answers - it must be this one. - return assignment; - } - if (assignment.isPositionCaptured(position)) { - return assignment; - } - } - - return assignment; - }; - - /** - * Split up the input taking into account ' and " - */ - CliRequisition.prototype._tokenize = function(typed) { - // For blank input, place a dummy empty argument into the list - if (typed == null || typed.length === 0) { - return [ new Argument(this, '', 0, 0, '', '') ]; - } - - var OUTSIDE = 1; // The last character was whitespace - var IN_SIMPLE = 2; // The last character was part of a parameter - var IN_SINGLE_Q = 3; // We're inside a single quote: ' - var IN_DOUBLE_Q = 4; // We're inside double quotes: " - - var mode = OUTSIDE; - - // First we un-escape. This list was taken from: - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Unicode - // We are generally converting to their real values except for \', \" - // and '\ ' which we are converting to unicode private characters so we - // can distinguish them from ', " and ' ', which have special meaning. - // They need swapping back post-split - see unescape2() - typed = typed - .replace(/\\\\/g, '\\') - .replace(/\\b/g, '\b') - .replace(/\\f/g, '\f') - .replace(/\\n/g, '\n') - .replace(/\\r/g, '\r') - .replace(/\\t/g, '\t') - .replace(/\\v/g, '\v') - .replace(/\\n/g, '\n') - .replace(/\\r/g, '\r') - .replace(/\\ /g, '\uF000') - .replace(/\\'/g, '\uF001') - .replace(/\\"/g, '\uF002'); - - function unescape2(str) { - return str - .replace(/\uF000/g, ' ') - .replace(/\uF001/g, '\'') - .replace(/\uF002/g, '"'); - } - - var i = 0; - var start = 0; // Where did this section start? - var prefix = ''; - var args = []; - - while (true) { - if (i >= typed.length) { - // There is nothing else to read - tidy up - if (mode !== OUTSIDE) { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, start, i, prefix, '')); - } - else { - if (i !== start) { - // There's a bunch of whitespace at the end of the - // command add it to the last argument's suffix, - // creating an empty argument if needed. - var extra = typed.substring(start, i); - var lastArg = args[args.length - 1]; - if (!lastArg) { - lastArg = new Argument(this, '', i, i, extra, ''); - args.push(lastArg); - } - else { - lastArg.suffix += extra; - } - } - } - break; - } - - var c = typed[i]; - switch (mode) { - case OUTSIDE: - if (c === '\'') { - prefix = typed.substring(start, i + 1); - mode = IN_SINGLE_Q; - start = i + 1; - } - else if (c === '"') { - prefix = typed.substring(start, i + 1); - mode = IN_DOUBLE_Q; - start = i + 1; - } - else if (/ /.test(c)) { - // Still whitespace, do nothing - } - else { - prefix = typed.substring(start, i); - mode = IN_SIMPLE; - start = i; - } - break; - - case IN_SIMPLE: - // There is an edge case of xx'xx which we are assuming to - // be a single parameter (and same with ") - if (c === ' ') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start, i, prefix, '')); - mode = OUTSIDE; - start = i; - prefix = ''; - } - break; - - case IN_SINGLE_Q: - if (c === '\'') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start - 1, i + 1, prefix, c)); - mode = OUTSIDE; - start = i + 1; - prefix = ''; - } - break; - - case IN_DOUBLE_Q: - if (c === '"') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start - 1, i + 1, prefix, c)); - mode = OUTSIDE; - start = i + 1; - prefix = ''; - } - break; - } - - i++; - } - - return args; - }; - - /** - * Looks in the canon for a command extension that matches what has been - * typed at the command line. - */ - CliRequisition.prototype._split = function(args) { - var argsUsed = 1; - var arg; - - while (argsUsed <= args.length) { - var arg = Argument.merge(args, 0, argsUsed); - this.commandAssignment.setArgument(arg); - - if (!this.commandAssignment.value) { - // Not found. break with value == null - break; - } - - /* - // Previously we needed a way to hide commands depending context. - // We have not resurrected that feature yet. - if (!keyboard.flagsMatch(command.predicates, this.flags)) { - // If the predicates say 'no match' then go LA LA LA - command = null; - break; - } - */ - - if (this.commandAssignment.value.exec) { - // Valid command, break with command valid - for (var i = 0; i < argsUsed; i++) { - args.shift(); - } - break; - } - - argsUsed++; - } - }; - - /** - * Work out which arguments are applicable to which parameters. - *

    This takes #_command.params and #_unparsedArgs and creates a map of - * param names to 'assignment' objects, which have the following properties: - *

      - *
    • param - The matching parameter. - *
    • index - Zero based index into where the match came from on the input - *
    • value - The matching input - *
    - */ - CliRequisition.prototype._assign = function(args) { - if (args.length === 0) { - this.setDefaultValues(); - return; - } - - // Create an error if the command does not take parameters, but we have - // been given them ... - if (this.assignmentCount === 0) { - // TODO: previously we were doing some extra work to avoid this if - // we determined that we had args that were all whitespace, but - // probably given our tighter tokenize() this won't be an issue? - this._hints.push(new Hint(Status.INVALID, - this.commandAssignment.value.name + - ' does not take any parameters', - Argument.merge(args))); - return; - } - - // Special case: if there is only 1 parameter, and that's of type - // text we put all the params into the first param - if (this.assignmentCount === 1) { - var assignment = this.getAssignment(0); - if (assignment.param.type.name === 'text') { - assignment.setArgument(Argument.merge(args)); - return; - } - } - - var assignments = this.cloneAssignments(); - var names = this.getParameterNames(); - - // Extract all the named parameters - var used = []; - assignments.forEach(function(assignment) { - var namedArgText = '--' + assignment.name; - - var i = 0; - while (true) { - var arg = args[i]; - if (namedArgText !== arg.text) { - i++; - if (i >= args.length) { - break; - } - continue; - } - - // boolean parameters don't have values, default to false - if (assignment.param.type.name === 'boolean') { - assignment.setValue(true); - } - else { - if (i + 1 < args.length) { - // Missing value portion of this named param - this._hints.push(new Hint(Status.INCOMPLETE, - 'Missing value for: ' + namedArgText, - args[i])); - } - else { - args.splice(i + 1, 1); - assignment.setArgument(args[i + 1]); - } - } - - lang.arrayRemove(names, assignment.name); - args.splice(i, 1); - // We don't need to i++ if we splice - } - }, this); - - // What's left are positional parameters assign in order - names.forEach(function(name) { - var assignment = this.getAssignment(name); - if (args.length === 0) { - // No more values - assignment.setValue(undefined); // i.e. default - } - else { - var arg = args[0]; - args.splice(0, 1); - assignment.setArgument(arg); - } - }, this); - - if (args.length > 0) { - var remaining = Argument.merge(args); - this._hints.push(new Hint(Status.INVALID, - 'Input \'' + remaining.text + '\' makes no sense.', - remaining)); - } - }; - -})(); -exports.CliRequisition = CliRequisition; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/settings', ['require', 'exports', 'module' , 'pilot/types', 'pilot/types/basic'], function(require, exports, module) { - - -var types = require("pilot/types"); -var SelectionType = require('pilot/types/basic').SelectionType; - -var direction = new SelectionType({ - name: 'direction', - data: [ 'above', 'below' ] -}); - -var hintDirectionSetting = { - name: "hintDirection", - description: "Are hints shown above or below the command line?", - type: "direction", - defaultValue: "above" -}; - -var outputDirectionSetting = { - name: "outputDirection", - description: "Is the output window shown above or below the command line?", - type: "direction", - defaultValue: "above" -}; - -var outputHeightSetting = { - name: "outputHeight", - description: "What height should the output panel be?", - type: "number", - defaultValue: 300 -}; - -exports.startup = function(data, reason) { - types.registerType(direction); - data.env.settings.addSetting(hintDirectionSetting); - data.env.settings.addSetting(outputDirectionSetting); - data.env.settings.addSetting(outputHeightSetting); -}; - -exports.shutdown = function(data, reason) { - types.unregisterType(direction); - data.env.settings.removeSetting(hintDirectionSetting); - data.env.settings.removeSetting(outputDirectionSetting); - data.env.settings.removeSetting(outputHeightSetting); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/cli_view', ['require', 'exports', 'module' , 'text!cockpit/ui/cli_view.css', 'pilot/event', 'pilot/dom', 'pilot/keys', 'pilot/canon', 'pilot/types', 'cockpit/cli', 'cockpit/ui/request_view'], function(require, exports, module) { - - -var editorCss = require("text!cockpit/ui/cli_view.css"); -var event = require("pilot/event"); -var dom = require("pilot/dom"); - -dom.importCssString(editorCss); - -var event = require("pilot/event"); -var keys = require("pilot/keys"); -var canon = require("pilot/canon"); -var Status = require('pilot/types').Status; - -var CliRequisition = require('cockpit/cli').CliRequisition; -var Hint = require('cockpit/cli').Hint; -var RequestView = require('cockpit/ui/request_view').RequestView; - -var NO_HINT = new Hint(Status.VALID, '', 0, 0); - -/** - * On startup we need to: - * 1. Add 3 sets of elements to the DOM for: - * - command line output - * - input hints - * - completion - * 2. Attach a set of events so the command line works - */ -exports.startup = function(data, reason) { - var cli = new CliRequisition(data.env); - var cliView = new CliView(cli, data.env); - data.env.cli = cli; -}; - -/** - * A class to handle the simplest UI implementation - */ -function CliView(cli, env) { - cli.cliView = this; - this.cli = cli; - this.doc = document; - this.win = dom.getParentWindow(this.doc); - this.env = env; - - // TODO: we should have a better way to specify command lines??? - this.element = this.doc.getElementById('cockpitInput'); - if (!this.element) { - // console.log('No element with an id of cockpit. Bailing on cli'); - return; - } - - this.settings = env.settings; - this.hintDirection = this.settings.getSetting('hintDirection'); - this.outputDirection = this.settings.getSetting('outputDirection'); - this.outputHeight = this.settings.getSetting('outputHeight'); - - // If the requisition tells us something has changed, we use this to know - // if we should ignore it - this.isUpdating = false; - - this.createElements(); - this.update(); -} -CliView.prototype = { - /** - * Create divs for completion, hints and output - */ - createElements: function() { - var input = this.element; - - this.element.spellcheck = false; - - this.output = this.doc.getElementById('cockpitOutput'); - this.popupOutput = (this.output == null); - if (!this.output) { - this.output = this.doc.createElement('div'); - this.output.id = 'cockpitOutput'; - this.output.className = 'cptOutput'; - input.parentNode.insertBefore(this.output, input.nextSibling); - - var setMaxOutputHeight = function() { - this.output.style.maxHeight = this.outputHeight.get() + 'px'; - }.bind(this); - this.outputHeight.addEventListener('change', setMaxOutputHeight); - setMaxOutputHeight(); - } - - this.completer = this.doc.createElement('div'); - this.completer.className = 'cptCompletion VALID'; - - this.completer.style.color = dom.computedStyle(input, "color"); - this.completer.style.fontSize = dom.computedStyle(input, "fontSize"); - this.completer.style.fontFamily = dom.computedStyle(input, "fontFamily"); - this.completer.style.fontWeight = dom.computedStyle(input, "fontWeight"); - this.completer.style.fontStyle = dom.computedStyle(input, "fontStyle"); - input.parentNode.insertBefore(this.completer, input.nextSibling); - - // Transfer background styling to the completer. - this.completer.style.backgroundColor = input.style.backgroundColor; - input.style.backgroundColor = 'transparent'; - - this.hinter = this.doc.createElement('div'); - this.hinter.className = 'cptHints'; - input.parentNode.insertBefore(this.hinter, input.nextSibling); - - var resizer = this.resizer.bind(this); - event.addListener(this.win, 'resize', resizer); - this.hintDirection.addEventListener('change', resizer); - this.outputDirection.addEventListener('change', resizer); - resizer(); - - canon.addEventListener('output', function(ev) { - new RequestView(ev.request, this); - }.bind(this)); - event.addCommandKeyListener(input, this.onCommandKey.bind(this)); - event.addListener(input, 'keyup', this.onKeyUp.bind(this)); - - // cursor position affects hint severity. TODO: shortcuts for speed - event.addListener(input, 'mouseup', function(ev) { - this.isUpdating = true; - this.update(); - this.isUpdating = false; - }.bind(this)); - - this.cli.addEventListener('argumentChange', this.onArgChange.bind(this)); - - event.addListener(input, "focus", function() { - dom.addCssClass(this.output, "cptFocusPopup"); - dom.addCssClass(this.hinter, "cptFocusPopup"); - }.bind(this)); - - function hideOutput() { - dom.removeCssClass(this.output, "cptFocusPopup"); - dom.removeCssClass(this.hinter, "cptFocusPopup"); - }; - event.addListener(input, "blur", hideOutput.bind(this)); - hideOutput.call(this); - }, - - /** - * We need to see the output of the latest command entered - */ - scrollOutputToBottom: function() { - // Certain browsers have a bug such that scrollHeight is too small - // when content does not fill the client area of the element - var scrollHeight = Math.max(this.output.scrollHeight, this.output.clientHeight); - this.output.scrollTop = scrollHeight - this.output.clientHeight; - }, - - /** - * To be called on window resize or any time we want to align the elements - * with the input box. - */ - resizer: function() { - var rect = this.element.getClientRects()[0]; - - this.completer.style.top = rect.top + 'px'; - var height = rect.bottom - rect.top; - this.completer.style.height = height + 'px'; - this.completer.style.lineHeight = height + 'px'; - this.completer.style.left = rect.left + 'px'; - var width = rect.right - rect.left; - this.completer.style.width = width + 'px'; - - if (this.hintDirection.get() === 'below') { - this.hinter.style.top = rect.bottom + 'px'; - this.hinter.style.bottom = 'auto'; - } - else { - this.hinter.style.top = 'auto'; - this.hinter.style.bottom = (this.doc.documentElement.clientHeight - rect.top) + 'px'; - } - this.hinter.style.left = (rect.left + 30) + 'px'; - this.hinter.style.maxWidth = (width - 110) + 'px'; - - if (this.popupOutput) { - if (this.outputDirection.get() === 'below') { - this.output.style.top = rect.bottom + 'px'; - this.output.style.bottom = 'auto'; - } - else { - this.output.style.top = 'auto'; - this.output.style.bottom = (this.doc.documentElement.clientHeight - rect.top) + 'px'; - } - this.output.style.left = rect.left + 'px'; - this.output.style.width = (width - 80) + 'px'; - } - }, - - /** - * Ensure that TAB isn't handled by the browser - */ -onCommandKey: function(ev, hashId, keyCode) { - var stopEvent; - if (keyCode === keys.TAB || - keyCode === keys.UP || - keyCode === keys.DOWN) { - stopEvent = true; - } else if (hashId != 0 || keyCode != 0) { - stopEvent = canon.execKeyCommand(this.env, 'cli', hashId, keyCode); - } - stopEvent && event.stopEvent(ev); - }, - - /** - * The main keyboard processing loop - */ - onKeyUp: function(ev) { - var handled; - /* - var handled = keyboardManager.processKeyEvent(ev, this, { - isCommandLine: true, isKeyUp: true - }); - */ - - // RETURN does a special exec/highlight thing - if (ev.keyCode === keys.RETURN) { - var worst = this.cli.getWorstHint(); - // Deny RETURN unless the command might work - if (worst.status === Status.VALID) { - this.cli.exec(); - this.element.value = ''; - } - else { - // If we've denied RETURN because the command was not VALID, - // select the part of the command line that is causing problems - // TODO: if there are 2 errors are we picking the right one? - dom.setSelectionStart(this.element, worst.start); - dom.setSelectionEnd(this.element, worst.end); - } - } - - this.update(); - - // Special actions which delegate to the assignment - var current = this.cli.getAssignmentAt(dom.getSelectionStart(this.element)); - if (current) { - // TAB does a special complete thing - if (ev.keyCode === keys.TAB) { - current.complete(); - this.update(); - } - - // UP/DOWN look for some history - if (ev.keyCode === keys.UP) { - current.increment(); - this.update(); - } - if (ev.keyCode === keys.DOWN) { - current.decrement(); - this.update(); - } - } - - return handled; - }, - - /** - * Actually parse the input and make sure we're all up to date - */ - update: function() { - this.isUpdating = true; - var input = { - typed: this.element.value, - cursor: { - start: dom.getSelectionStart(this.element), - end: dom.getSelectionEnd(this.element.selectionEnd) - } - }; - this.cli.update(input); - - var display = this.cli.getAssignmentAt(input.cursor.start).getHint(); - - // 1. Update the completer with prompt/error marker/TAB info - dom.removeCssClass(this.completer, Status.VALID.toString()); - dom.removeCssClass(this.completer, Status.INCOMPLETE.toString()); - dom.removeCssClass(this.completer, Status.INVALID.toString()); - - var completion = '> '; - if (this.element.value.length > 0) { - var scores = this.cli.getInputStatusMarkup(); - completion += this.markupStatusScore(scores); - } - - // Display the "-> prediction" at the end of the completer - if (this.element.value.length > 0 && - display.predictions && display.predictions.length > 0) { - var tab = display.predictions[0]; - completion += '  ⇥ ' + (tab.name ? tab.name : tab); - } - this.completer.innerHTML = completion; - dom.addCssClass(this.completer, this.cli.getWorstHint().status.toString()); - - // 2. Update the hint element - var hint = ''; - if (this.element.value.length !== 0) { - hint += display.message; - if (display.predictions && display.predictions.length > 0) { - hint += ': [ '; - display.predictions.forEach(function(prediction) { - hint += (prediction.name ? prediction.name : prediction); - hint += ' | '; - }, this); - hint = hint.replace(/\| $/, ']'); - } - } - - this.hinter.innerHTML = hint; - if (hint.length === 0) { - dom.addCssClass(this.hinter, 'cptNoPopup'); - } - else { - dom.removeCssClass(this.hinter, 'cptNoPopup'); - } - - this.isUpdating = false; - }, - - /** - * Markup an array of Status values with spans - */ - markupStatusScore: function(scores) { - var completion = ''; - // Create mark-up - var i = 0; - var lastStatus = -1; - while (true) { - if (lastStatus !== scores[i]) { - completion += ''; - lastStatus = scores[i]; - } - completion += this.element.value[i]; - i++; - if (i === this.element.value.length) { - completion += ''; - break; - } - if (lastStatus !== scores[i]) { - completion += ''; - } - } - - return completion; - }, - - /** - * Update the input element to reflect the changed argument - */ - onArgChange: function(ev) { - if (this.isUpdating) { - return; - } - - var prefix = this.element.value.substring(0, ev.argument.start); - var suffix = this.element.value.substring(ev.argument.end); - var insert = typeof ev.text === 'string' ? ev.text : ev.text.name; - this.element.value = prefix + insert + suffix; - // Fix the cursor. - var insertEnd = (prefix + insert).length; - this.element.selectionStart = insertEnd; - this.element.selectionEnd = insertEnd; - } -}; -exports.CliView = CliView; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/request_view', ['require', 'exports', 'module' , 'pilot/dom', 'pilot/event', 'text!cockpit/ui/request_view.html', 'pilot/domtemplate', 'text!cockpit/ui/request_view.css'], function(require, exports, module) { - -var dom = require("pilot/dom"); -var event = require("pilot/event"); -var requestViewHtml = require("text!cockpit/ui/request_view.html"); -var Templater = require("pilot/domtemplate").Templater; - -var requestViewCss = require("text!cockpit/ui/request_view.css"); -dom.importCssString(requestViewCss); - -/** - * Pull the HTML into the DOM, but don't add it to the document - */ -var templates = document.createElement('div'); -templates.innerHTML = requestViewHtml; -var row = templates.querySelector('.cptRow'); - -/** - * Work out the path for images. - * TODO: This should probably live in some utility area somewhere - */ -function imageUrl(path) { - var dataUrl; - try { - dataUrl = require('text!cockpit/ui/' + path); - } catch (e) { } - if (dataUrl) { - return dataUrl; - } - - var filename = module.id.split('/').pop() + '.js'; - var imagePath; - - if (module.uri.substr(-filename.length) !== filename) { - console.error('Can\'t work out path from module.uri/module.id'); - return path; - } - - if (module.uri) { - var end = module.uri.length - filename.length - 1; - return module.uri.substr(0, end) + "/" + path; - } - - return filename + path; -} - - -/** - * Adds a row to the CLI output display - */ -function RequestView(request, cliView) { - this.request = request; - this.cliView = cliView; - this.imageUrl = imageUrl; - - // Elements attached to this by the templater. For info only - this.rowin = null; - this.rowout = null; - this.output = null; - this.hide = null; - this.show = null; - this.duration = null; - this.throb = null; - - new Templater().processNode(row.cloneNode(true), this); - - this.cliView.output.appendChild(this.rowin); - this.cliView.output.appendChild(this.rowout); - - this.request.addEventListener('output', this.onRequestChange.bind(this)); -}; - -RequestView.prototype = { - /** - * A single click on an invocation line in the console copies the command to - * the command line - */ - copyToInput: function() { - this.cliView.element.value = this.request.typed; - }, - - /** - * A double click on an invocation line in the console executes the command - */ - executeRequest: function(ev) { - this.cliView.cli.update({ - typed: this.request.typed, - cursor: { start:0, end:0 } - }); - this.cliView.cli.exec(); - }, - - hideOutput: function(ev) { - this.output.style.display = 'none'; - dom.addCssClass(this.hide, 'cmd_hidden'); - dom.removeCssClass(this.show, 'cmd_hidden'); - - event.stopPropagation(ev); - }, - - showOutput: function(ev) { - this.output.style.display = 'block'; - dom.removeCssClass(this.hide, 'cmd_hidden'); - dom.addCssClass(this.show, 'cmd_hidden'); - - event.stopPropagation(ev); - }, - - remove: function(ev) { - this.cliView.output.removeChild(this.rowin); - this.cliView.output.removeChild(this.rowout); - event.stopPropagation(ev); - }, - - onRequestChange: function(ev) { - this.duration.innerHTML = this.request.duration ? - 'completed in ' + (this.request.duration / 1000) + ' sec ' : - ''; - - this.output.innerHTML = ''; - this.request.outputs.forEach(function(output) { - var node; - if (typeof output == 'string') { - node = document.createElement('p'); - node.innerHTML = output; - } else { - node = output; - } - this.output.appendChild(node); - }, this); - this.cliView.scrollOutputToBottom(); - - dom.setCssClass(this.output, 'cmd_error', this.request.error); - - this.throb.style.display = this.request.completed ? 'none' : 'block'; - } -}; -exports.RequestView = RequestView; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is DomTemplate. - * - * The Initial Developer of the Original Code is Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('pilot/domtemplate', ['require', 'exports', 'module' ], function(require, exports, module) { - - -// WARNING: do not 'use_strict' without reading the notes in envEval; - -/** - * A templater that allows one to quickly template DOM nodes. - */ -function Templater() { - this.scope = []; -}; - -/** - * Recursive function to walk the tree processing the attributes as it goes. - * @param node the node to process. If you pass a string in instead of a DOM - * element, it is assumed to be an id for use with document.getElementById() - * @param data the data to use for node processing. - */ -Templater.prototype.processNode = function(node, data) { - if (typeof node === 'string') { - node = document.getElementById(node); - } - if (data === null || data === undefined) { - data = {}; - } - this.scope.push(node.nodeName + (node.id ? '#' + node.id : '')); - try { - // Process attributes - if (node.attributes && node.attributes.length) { - // We need to handle 'foreach' and 'if' first because they might stop - // some types of processing from happening, and foreach must come first - // because it defines new data on which 'if' might depend. - if (node.hasAttribute('foreach')) { - this.processForEach(node, data); - return; - } - if (node.hasAttribute('if')) { - if (!this.processIf(node, data)) { - return; - } - } - // Only make the node available once we know it's not going away - data.__element = node; - // It's good to clean up the attributes when we've processed them, - // but if we do it straight away, we mess up the array index - var attrs = Array.prototype.slice.call(node.attributes); - for (var i = 0; i < attrs.length; i++) { - var value = attrs[i].value; - var name = attrs[i].name; - this.scope.push(name); - try { - if (name === 'save') { - // Save attributes are a setter using the node - value = this.stripBraces(value); - this.property(value, data, node); - node.removeAttribute('save'); - } else if (name.substring(0, 2) === 'on') { - // Event registration relies on property doing a bind - value = this.stripBraces(value); - var func = this.property(value, data); - if (typeof func !== 'function') { - this.handleError('Expected ' + value + - ' to resolve to a function, but got ' + typeof func); - } - node.removeAttribute(name); - var capture = node.hasAttribute('capture' + name.substring(2)); - node.addEventListener(name.substring(2), func, capture); - if (capture) { - node.removeAttribute('capture' + name.substring(2)); - } - } else { - // Replace references in all other attributes - var self = this; - var newValue = value.replace(/\$\{[^}]*\}/g, function(path) { - return self.envEval(path.slice(2, -1), data, value); - }); - // Remove '_' prefix of attribute names so the DOM won't try - // to use them before we've processed the template - if (name.charAt(0) === '_') { - node.removeAttribute(name); - node.setAttribute(name.substring(1), newValue); - } else if (value !== newValue) { - attrs[i].value = newValue; - } - } - } finally { - this.scope.pop(); - } - } - } - - // Loop through our children calling processNode. First clone them, so the - // set of nodes that we visit will be unaffected by additions or removals. - var childNodes = Array.prototype.slice.call(node.childNodes); - for (var j = 0; j < childNodes.length; j++) { - this.processNode(childNodes[j], data); - } - - if (node.nodeType === Node.TEXT_NODE) { - this.processTextNode(node, data); - } - } finally { - this.scope.pop(); - } -}; - -/** - * Handle - * @param node An element with an 'if' attribute - * @param data The data to use with envEval - * @returns true if processing should continue, false otherwise - */ -Templater.prototype.processIf = function(node, data) { - this.scope.push('if'); - try { - var originalValue = node.getAttribute('if'); - var value = this.stripBraces(originalValue); - var recurse = true; - try { - var reply = this.envEval(value, data, originalValue); - recurse = !!reply; - } catch (ex) { - this.handleError('Error with \'' + value + '\'', ex); - recurse = false; - } - if (!recurse) { - node.parentNode.removeChild(node); - } - node.removeAttribute('if'); - return recurse; - } finally { - this.scope.pop(); - } -}; - -/** - * Handle and the special case of - * - * @param node An element with a 'foreach' attribute - * @param data The data to use with envEval - */ -Templater.prototype.processForEach = function(node, data) { - this.scope.push('foreach'); - try { - var originalValue = node.getAttribute('foreach'); - var value = originalValue; - - var paramName = 'param'; - if (value.charAt(0) === '$') { - // No custom loop variable name. Use the default: 'param' - value = this.stripBraces(value); - } else { - // Extract the loop variable name from 'NAME in ${ARRAY}' - var nameArr = value.split(' in '); - paramName = nameArr[0].trim(); - value = this.stripBraces(nameArr[1].trim()); - } - node.removeAttribute('foreach'); - try { - var self = this; - // Process a single iteration of a loop - var processSingle = function(member, clone, ref) { - ref.parentNode.insertBefore(clone, ref); - data[paramName] = member; - self.processNode(clone, data); - delete data[paramName]; - }; - - // processSingle is no good for nodes where we want to work on - // the childNodes rather than the node itself - var processAll = function(scope, member) { - self.scope.push(scope); - try { - if (node.nodeName === 'LOOP') { - for (var i = 0; i < node.childNodes.length; i++) { - var clone = node.childNodes[i].cloneNode(true); - processSingle(member, clone, node); - } - } else { - var clone = node.cloneNode(true); - clone.removeAttribute('foreach'); - processSingle(member, clone, node); - } - } finally { - self.scope.pop(); - } - }; - - var reply = this.envEval(value, data, originalValue); - if (Array.isArray(reply)) { - reply.forEach(function(data, i) { - processAll('' + i, data); - }, this); - } else { - for (var param in reply) { - if (reply.hasOwnProperty(param)) { - processAll(param, param); - } - } - } - node.parentNode.removeChild(node); - } catch (ex) { - this.handleError('Error with \'' + value + '\'', ex); - } - } finally { - this.scope.pop(); - } -}; - -/** - * Take a text node and replace it with another text node with the ${...} - * sections parsed out. We replace the node by altering node.parentNode but - * we could probably use a DOM Text API to achieve the same thing. - * @param node The Text node to work on - * @param data The data to use in calls to envEval - */ -Templater.prototype.processTextNode = function(node, data) { - // Replace references in other attributes - var value = node.data; - // We can't use the string.replace() with function trick (see generic - // attribute processing in processNode()) because we need to support - // functions that return DOM nodes, so we can't have the conversion to a - // string. - // Instead we process the string as an array of parts. In order to split - // the string up, we first replace '${' with '\uF001$' and '}' with '\uF002' - // We can then split using \uF001 or \uF002 to get an array of strings - // where scripts are prefixed with $. - // \uF001 and \uF002 are just unicode chars reserved for private use. - value = value.replace(/\$\{([^}]*)\}/g, '\uF001$$$1\uF002'); - var parts = value.split(/\uF001|\uF002/); - if (parts.length > 1) { - parts.forEach(function(part) { - if (part === null || part === undefined || part === '') { - return; - } - if (part.charAt(0) === '$') { - part = this.envEval(part.slice(1), data, node.data); - } - // It looks like this was done a few lines above but see envEval - if (part === null) { - part = "null"; - } - if (part === undefined) { - part = "undefined"; - } - // if (isDOMElement(part)) { ... } - if (typeof part.cloneNode !== 'function') { - part = node.ownerDocument.createTextNode(part.toString()); - } - node.parentNode.insertBefore(part, node); - }, this); - node.parentNode.removeChild(node); - } -}; - -/** - * Warn of string does not begin '${' and end '}' - * @param str the string to check. - * @return The string stripped of ${ and }, or untouched if it does not match - */ -Templater.prototype.stripBraces = function(str) { - if (!str.match(/\$\{.*\}/g)) { - this.handleError('Expected ' + str + ' to match ${...}'); - return str; - } - return str.slice(2, -1); -}; - -/** - * Combined getter and setter that works with a path through some data set. - * For example: - *
      - *
    • property('a.b', { a: { b: 99 }}); // returns 99 - *
    • property('a', { a: { b: 99 }}); // returns { b: 99 } - *
    • property('a', { a: { b: 99 }}, 42); // returns 99 and alters the - * input data to be { a: { b: 42 }} - *
    - * @param path An array of strings indicating the path through the data, or - * a string to be cut into an array using split('.') - * @param data An object to look in for the path argument - * @param newValue (optional) If defined, this value will replace the - * original value for the data at the path specified. - * @return The value pointed to by path before any - * newValue is applied. - */ -Templater.prototype.property = function(path, data, newValue) { - this.scope.push(path); - try { - if (typeof path === 'string') { - path = path.split('.'); - } - var value = data[path[0]]; - if (path.length === 1) { - if (newValue !== undefined) { - data[path[0]] = newValue; - } - if (typeof value === 'function') { - return function() { - return value.apply(data, arguments); - }; - } - return value; - } - if (!value) { - this.handleError('Can\'t find path=' + path); - return null; - } - return this.property(path.slice(1), value, newValue); - } finally { - this.scope.pop(); - } -}; - -/** - * Like eval, but that creates a context of the variables in env in - * which the script is evaluated. - * WARNING: This script uses 'with' which is generally regarded to be evil. - * The alternative is to create a Function at runtime that takes X parameters - * according to the X keys in the env object, and then call that function using - * the values in the env object. This is likely to be slow, but workable. - * @param script The string to be evaluated. - * @param env The environment in which to eval the script. - * @param context Optional debugging string in case of failure - * @return The return value of the script, or the error message if the script - * execution failed. - */ -Templater.prototype.envEval = function(script, env, context) { - with (env) { - try { - this.scope.push(context); - return eval(script); - } catch (ex) { - this.handleError('Template error evaluating \'' + script + '\'', ex); - return script; - } finally { - this.scope.pop(); - } - } -}; - -/** - * A generic way of reporting errors, for easy overloading in different - * environments. - * @param message the error message to report. - * @param ex optional associated exception. - */ -Templater.prototype.handleError = function(message, ex) { - this.logError(message); - this.logError('In: ' + this.scope.join(' > ')); - if (ex) { - this.logError(ex); - } -}; - - -/** - * A generic way of reporting errors, for easy overloading in different - * environments. - * @param message the error message to report. - */ -Templater.prototype.logError = function(message) { - window.console && window.console.log && console.log(message); -}; - -exports.Templater = Templater; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Skywriter Team (skywriter@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/commands/basic', ['require', 'exports', 'module' , 'pilot/canon'], function(require, exports, module) { - - -var canon = require('pilot/canon'); - -/** - * '!' command - */ -var bangCommandSpec = { - name: 'sh', - description: 'Execute a system command (requires server support)', - params: [ - { - name: 'command', - type: 'text', - description: 'The string to send to the os shell.' - } - ], - exec: function(env, args, request) { - var req = new XMLHttpRequest(); - req.open('GET', '/exec?args=' + args.command, true); - req.onreadystatechange = function(ev) { - if (req.readyState == 4) { - if (req.status == 200) { - request.done('
    ' + req.responseText + '
    '); - } - } - }; - req.send(null); - } -}; - -var canon = require('pilot/canon'); - -exports.startup = function(data, reason) { - canon.addCommand(bangCommandSpec); -}; - -exports.shutdown = function(data, reason) { - canon.removeCommand(bangCommandSpec); -}; - - -}); -define("text!cockpit/ui/cli_view.css", [], "" + - "#cockpitInput { padding-left: 16px; }" + - "" + - ".cptOutput { overflow: auto; position: absolute; z-index: 999; display: none; }" + - "" + - ".cptCompletion { padding: 0; position: absolute; z-index: -1000; }" + - ".cptCompletion.VALID { background: #FFF; }" + - ".cptCompletion.INCOMPLETE { background: #DDD; }" + - ".cptCompletion.INVALID { background: #DDD; }" + - ".cptCompletion span { color: #FFF; }" + - ".cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }" + - ".cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }" + - "span.cptPrompt { color: #66F; font-weight: bold; }" + - "" + - "" + - ".cptHints {" + - " color: #000;" + - " position: absolute;" + - " border: 1px solid rgba(230, 230, 230, 0.8);" + - " background: rgba(250, 250, 250, 0.8);" + - " -moz-border-radius-topleft: 10px;" + - " -moz-border-radius-topright: 10px;" + - " border-top-left-radius: 10px; border-top-right-radius: 10px;" + - " z-index: 1000;" + - " padding: 8px;" + - " display: none;" + - "}" + - "" + - ".cptFocusPopup { display: block; }" + - ".cptFocusPopup.cptNoPopup { display: none; }" + - "" + - ".cptHints ul { margin: 0; padding: 0 15px; }" + - "" + - ".cptGt { font-weight: bold; font-size: 120%; }" + - ""); - -define("text!cockpit/ui/request_view.css", [], "" + - ".cptRowIn {" + - " display: box; display: -moz-box; display: -webkit-box;" + - " box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;" + - " box-align: center; -moz-box-align: center; -webkit-box-align: center;" + - " color: #333;" + - " background-color: #EEE;" + - " width: 100%;" + - " font-family: consolas, courier, monospace;" + - "}" + - ".cptRowIn > * { padding-left: 2px; padding-right: 2px; }" + - ".cptRowIn > img { cursor: pointer; }" + - ".cptHover { display: none; }" + - ".cptRowIn:hover > .cptHover { display: block; }" + - ".cptRowIn:hover > .cptHover.cptHidden { display: none; }" + - ".cptOutTyped {" + - " box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;" + - " font-weight: bold; color: #000; font-size: 120%;" + - "}" + - ".cptRowOutput { padding-left: 10px; line-height: 1.2em; }" + - ".cptRowOutput strong," + - ".cptRowOutput b," + - ".cptRowOutput th," + - ".cptRowOutput h1," + - ".cptRowOutput h2," + - ".cptRowOutput h3 { color: #000; }" + - ".cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }" + - ".cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }" + - ".cptRowOutput input[type=password]," + - ".cptRowOutput input[type=text]," + - ".cptRowOutput textarea {" + - " color: #000; font-size: 120%;" + - " background: transparent; padding: 3px;" + - " border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;" + - "}" + - ".cptRowOutput table," + - ".cptRowOutput td," + - ".cptRowOutput th { border: 0; padding: 0 2px; }" + - ".cptRowOutput .right { text-align: right; }" + - ""); - -define("text!cockpit/ui/request_view.html", [], "" + - "
    " + - " " + - "
    " + - "" + - " " + - "
    >
    " + - "
    ${request.typed}
    " + - "" + - " " + - "
    " + - " \"Hide" + - " \"Show" + - " \"Remove" + - "" + - "
    " + - "" + - " " + - "
    " + - "
    " + - " " + - "
    " + - "
    " + - ""); - -define("text!cockpit/ui/images/pinaction.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClklEQVQ4EX1TXUhUQRQ+Z3Zmd+9uN1q2P3UpZaEwcikKekkqLKggKHJ96MHe9DmLkCDa9U198Id8kErICmIlRAN96UdE6QdBW/tBA5Uic7E0zN297L17p5mb1zYjD3eYc+d83zlnON8g5xzWNUSEdUBkHTJasRWySPP7fw3hfwkk2GoNsc0vOaJRHo1GV/GiMctkTIJRFlpZli8opK+htmf83gXeG63oteOtra0u25e7TYJIJELb26vYCACTgUe1lXV86BTn745l+MsyHqs53S/Aq4VEUa9Y6ko14eYY4u3AyM3HYwdKU35DZyblGR2+qq6W0X2Nnh07xynnVYpHORx/E1/GvvqaAZUayjMjdM2f/Lgr5E+fV93zR4u3zKCLughsZqKwAzAxaz6dPY6JgjLUF+eSP5OpjmAw2E8DvldHSvJMKPg08aRor1tc4BuALu6mOwGWdQC3mKIqRsC8mKd8wYfD78/earzSYzdMDW9QgKb0Is8CBY1mQXOiaXAHEpMDE5XTJqIq4EiyxUqKlpfkF0pyV1OTAoFAhmTmyCCoDsZNZvIkUjELQpipo0sQqYZAswZHwsEEE10M0pq2SSZY9HqNcDicJcNTpBvQJz40UbSOTh1B8bDpuY0w9Hb3kkn9lPAlBLfhfD39XTtX/blFJqiqrjbkTi63Hbofj2uL4GMsmzFgbDJ/vmMgv/lB4syJ0oXO7d3j++vio6GFsYmD6cHJreWc3/jRVVHhsOYvM8iZ36mtjPDBk/xDZE8CoHlbrlAssbTxDdDJvdb536L7I6S7Vy++6Gi4Xi9BsUthJRaLOYSPz4XALKI4j4iObd/e5UtDKUjZzYyYRyGAJv01Zj8kC5cbs5WY83hQnv0DzCXl+r8APElkq0RU6oMAAAAASUVORK5CYII="); - -define("text!cockpit/ui/images/throbber.gif", [], "data:image/gif;base64,R0lGODlh3AATAPQAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWliH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFg8PwKIMHnLF63N2438f0mv1I2O8buXjvaOPtaHx7fn96goR4hmuId4qDdX95c4+RG4GCBoyAjpmQhZN0YGYFXitdZBIVGAoKoq4CG6Qaswi1CBtkcG6ytrYJubq8vbfAcMK9v7q7D8O1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQgDLAQGCQoLDA0QCwUHqfYSFw/xEPz88/X38Onr14+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdE/9chIeBgDoB7gjaWUWTlYAFE3LqzDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKwgcWABB5y1acFNZmEvXwoJ2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCLYMIFCzwLEprg84OsDus/tvqdezZf13Hvr2B9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebc3A8vjf5QWf15Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrAxAJoCDHbgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBBAJNv1DVV01MZdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJgxQCwT40PjfAV4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA00AqVB4hG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAXHx/EoCzboAcdhcLDdgwJ6nua03YZ8PMFPoBMca215eg98G36IgYNvDgOGh4lqjHd7fXOTjYV9nItvhJaIfYF4jXuIf4CCbHmOBZySdoOtj5eja59wBmYFXitdHhwSFRgKxhobBgUPAmdoyxoI0tPJaM5+u9PaCQZzZ9gP2tPcdM7L4tLVznPn6OQb18nh6NV0fu3i5OvP8/nd1qjwaasHcIPAcf/gBSyAAMMwBANYEAhWYQGDBhAyLihwYJiEjx8fYMxIcsGDAxVA/yYIOZIkBAaGPIK8INJlRpgrPeasaRPmx5QgJfB0abLjz50tSeIM+pFmUo0nQQIV+vRlTJUSnNq0KlXCSq09ozIFexEBAYkeNiwgOaEtn2LFpGEQsKCtXbcSjOmVlqDuhAx3+eg1Jo3u37sZBA9GoMAw4MB5FyMwfLht4sh7G/utPGHlYAV8Nz9OnOBz4c2VFWem/Pivar0aKCP2LFn2XwhnVxBwsPbuBAQbEGiIFg1BggoWkidva5z4cL7IlStfkED48OIYoiufYIH68+cKPkqfnsB58ePjmZd3Dj199/XE20tv6/27XO3S6z9nPCz9BP3FISDefL/Bt192/uWmAv8BFzAQAQUWWFaaBgqA11hbHWTIXWIVXifNhRlq6FqF1sm1QQYhdiAhbNEYc2KKK1pXnAIvhrjhBh0KxxiINlqQAY4UXjdcjSJyeAx2G2BYJJD7NZQkjCPKuCORKnbAIXsuKhlhBxEomAIBBzgIYXIfHfmhAAyMR2ZkHk62gJoWlNlhi33ZJZ2cQiKTJoG05Wjcm3xith9dcOK5X51tLRenoHTuud2iMnaolp3KGXrdBo7eKYF5p/mXgJcogClmcgzAR5gCKymXYqlCgmacdhp2UCqL96mq4nuDBTmgBasaCFp4sHaQHHUsGvNRiiGyep1exyIra2mS7dprrtA5++z/Z8ZKYGuGsy6GqgTIDvupRGE+6CO0x3xI5Y2mOTkBjD4ySeGU79o44mcaSEClhglgsKyJ9S5ZTGY0Bnzrj+3SiKK9Rh5zjAALCywZBk/ayCWO3hYM5Y8Dn6qxxRFsgAGoJwwgDQRtYXAAragyQOmaLKNZKGaEuUlpyiub+ad/KtPqpntypvvnzR30DBtjMhNodK6Eqrl0zU0/GjTUgG43wdN6Ra2pAhGtAAZGE5Ta8TH6wknd2IytNKaiZ+Or79oR/tcvthIcAPe7DGAs9Edwk6r3qWoTaNzY2fb9HuHh2S343Hs1VIHhYtOt+Hh551rh24vP5YvXSGzh+eeghy76GuikU9FFEainrvrqrLfu+uuwxy777LTXfkIIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAWHB2l4CDZo9IDjcBja7UEhTV+3DXi3PJFA8xMcbHiDBgMPG31pgHBvg4Z9iYiBjYx7kWocb26OD398mI2EhoiegJlud4UFiZ5sm6Kdn2mBr5t7pJ9rlG0cHg5gXitdaxwFGArIGgoaGwYCZ3QFDwjU1AoIzdCQzdPV1c0bZ9vS3tUJBmjQaGXl1OB0feze1+faiBvk8wjnimn55e/o4OtWjp+4NPIKogsXjaA3g/fiGZBQAcEAFgQGOChgYEEDCCBBLihwQILJkxIe/3wMKfJBSQkJYJpUyRIkgwcVUJq8QLPmTYoyY6ZcyfJmTp08iYZc8MBkhZgxk9aEcPOlzp5FmwI9KdWn1qASurJkClRoWKwhq6IUqpJBAwQEMBYroAHkhLt3+RyzhgCDgAV48Wbgg+waAnoLMgTOm6DwQ8CLBzdGdvjw38V5JTg2lzhyTMeUEwBWHPgzZc4TSOM1bZia6LuqJxCmnOxv7NSsl1mGHHiw5tOuIWeAEHcFATwJME/ApgFBc3MVLEgPvE+Ddb4JokufPmFBAuvPXWu3MIF89wTOmxvOvp179evQtwf2nr6aApPyzVd3jn089e/8xdfeXe/xdZ9/d1ngHf98lbHH3V0LMrgPgsWpcFwBEFBgHmyNXWeYAgLc1UF5sG2wTHjIhNjBiIKZCN81GGyQwYq9uajeMiBOQGOLJ1KjTI40kmfBYNfc2NcGIpI4pI0vyrhjiT1WFqOOLEIZnjVOVpmajYfBiCSNLGbA5YdOkjdihSkQwIEEEWg4nQUmvYhYe+bFKaFodN5lp3rKvJYfnBKAJ+gGDMi3mmbwWYfng7IheuWihu5p32XcSWdSj+stkF95dp64jJ+RBipocHkCCp6PCiRQ6INookCAAwy0yd2CtNET3Yo7RvihBjFZAOaKDHT43DL4BQnsZMo8xx6uI1oQrHXXhHZrB28G62n/YSYxi+uzP2IrgbbHbiaer7hCiOxDFWhrbmGnLVuus5NFexhFuHLX6gkEECorlLpZo0CWJG4pLjIACykmBsp0eSSVeC15TDJeUhlkowlL+SWLNJpW2WEF87urXzNWSZ6JOEb7b8g1brZMjCg3ezBtWKKc4MvyEtwybPeaMAA1ECRoAQYHYLpbeYYCLfQ+mtL5c9CnfQpYpUtHOSejEgT9ogZ/GSqd0f2m+LR5WzOtHqlQX1pYwpC+WbXKqSYtpJ5Mt4a01lGzS3akF60AxkcTaLgAyRBPWCoDgHfJqwRuBuzdw/1ml3iCwTIeLUWJN0v4McMe7uasCTxseNWPSxc5RbvIgD7geZLbGrqCG3jepUmbbze63Y6fvjiOylbwOITPfIHEFsAHL/zwxBdvPBVdFKH88sw37/zz0Ecv/fTUV2/99SeEAAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2cw8BQEm3T6yHEYHHD4oKCuD9qGvNsxT6QTgAkcHHmFeX11fm17hXwPG35qgnhxbwMPkXaLhgZ9gWp3bpyegX4DcG+inY+Qn6eclpiZkHh6epetgLSUcBxlD2csXXdvBQrHGgoaGhsGaIkFDwjTCArTzX+QadHU3c1ofpHc3dcGG89/4+TYktvS1NYI7OHu3fEJ5tpqBu/k+HX7+nXDB06SuoHm0KXhR65cQT8P3FRAMIAFgVMPwDCAwLHjggIHJIgceeFBg44eC/+ITCCBZYKSJ1FCWPBgpE2YMmc+qNCypwScMmnaXAkUJYOaFVyKLOqx5tCXJnMelcBzJNSYKIX2ZPkzqsyjPLku9Zr1QciVErYxaICAgEUOBRJIgzChbt0MLOPFwyBggV27eCUcmxZvg9+/dfPGo5bg8N/Ag61ZM4w4seDF1fpWhizZmoa+GSortgcaMWd/fkP/HY0MgWbTipVV++wY8GhvqSG4XUEgoYTKE+Qh0OCvggULiBckWEZ4Ggbjx5HXVc58IPQJ0idQJ66XanTpFraTe348+XLizRNcz658eHMN3rNPT+C+G/nodqk3t6a+fN3j+u0Xn3nVTQPfdRPspkL/b+dEIN8EeMm2GAYbTNABdrbJ1hyFFv5lQYTodSZABhc+loCEyhxTYYkZopdMMiNeiBxyIFajV4wYHpfBBspUl8yKHu6ooV5APsZjQxyyeNeJ3N1IYod38cgdPBUid6GCKfRWgAYU4IccSyHew8B3doGJHmMLkGkZcynKk2Z50Ym0zJzLbDCmfBbI6eIyCdyJmJmoqZmnBAXy9+Z/yOlZDZpwYihnj7IZpuYEevrYJ5mJEuqiof4l+NYDEXQpXQcMnNjZNDx1oGqJ4S2nF3EsqWrhqqVWl6JIslpAK5MaIqDeqjJq56qN1aTaQaPbHTPYr8Be6Gsyyh6Da7OkmmqP/7GyztdrNVQBm5+pgw3X7aoYKhfZosb6hyUKBHCgQKij1rghkOAJuZg1SeYIIY+nIpDvf/sqm4yNG5CY64f87qdAwSXKGqFkhPH1ZHb2EgYtw3bpKGVkPz5pJAav+gukjB1UHE/HLNJobWcSX8jiuicMMBFd2OmKwQFs2tjXpDfnPE1j30V3c7iRHlrzBD2HONzODyZtsQJMI4r0AUNaE3XNHQw95c9GC001MpIxDacFQ+ulTNTZlU3O1eWVHa6vb/pnQUUrgHHSBKIuwG+bCPyEqbAg25gMVV1iOB/IGh5YOKLKIQ6xBAcUHmzjIcIqgajZ+Ro42DcvXl7j0U4WOUd+2IGu7DWjI1pt4DYq8BPm0entuGSQY/4tBi9Ss0HqfwngBQtHbCH88MQXb/zxyFfRRRHMN+/889BHL/301Fdv/fXYZ39CCAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2fAKXsKm7R6Q+Y43vABep0mGwwOPH7w2CT+gHZ3d3lyagl+CQNvg4yGh36LcHoGfHR/ZYOElQ9/a4ocmoRygIiRk5p8pYmZjXePaYBujHoOqp5qZHBlHAUFXitddg8PBg8KGsgayxvGkAkFDwgICtPTzX2mftHW3QnOpojG3dbYkNjk1waxsdDS1N7ga9zw1t/aifTk35fu6Qj3numL14fOuHTNECHqU4DDgQEsCCwidiHBAwYQMmpcUOCAhI8gJVzUuLGThAQnP/9abEAyI4MCIVOKZNnyJUqUJxNcGNlywYOQgHZirGkSJ8gHNEky+AkS58qWEJYC/bMzacmbQHkqNdlUJ1KoSz2i9COhmQYCEXtVrCBgwYS3cCf8qTcNQ9u4cFFOq2bPLV65Cf7dxZthbjW+CgbjnWtNgWPFcAsHdoxgWWK/iyV045sAc2S96SDn1exYw17REwpLQEYt2eW/qtPZRQAB7QoC61RW+GsBwYZ/CXb/XRCYLsAKFizEtUAc+G7lcZsjroscOvTmsoUvx15PwccJ0N8yL17N9PG/E7jv9S4hOV7pdIPDdZ+ePDzv2qMXn2b5+wTbKuAWnF3oZbABZY0lVmD/ApQd9thybxno2GGuCVDggaUpoyBsB1bGGgIYbJCBcuFJiOAyGohIInQSmmdeiBnMF2GHfNUlIoc1rncjYRjW6NgGf3VQGILWwNjBfxEZcAFbC7gHXQcfUYOYdwzQNxo5yUhQZXhvRYlMeVSuSOJHKJa5AQMQThBlZWZ6Bp4Fa1qzTAJbijcBlJrtxeaZ4lnnpZwpukWieGQmYx5ATXIplwTL8DdNZ07CtWYybNIJF4Ap4NZHe0920AEDk035kafieQrqXofK5ympn5JHKYjPrfoWcR8WWQGp4Ul32KPVgXdnqxM6OKqspjIYrGPDrlrsZtRIcOuR86nHFwbPvmes/6PH4frrqbvySh+mKGhaAARPzjjdhCramdoGGOhp44i+zogBkSDuWC5KlE4r4pHJkarXrj++Raq5iLmWLlxHBteavjG+6amJrUkJJI4Ro5sBv9AaOK+jAau77sbH7nspCwNIYIACffL7J4JtWQnen421nNzMcB6AqpRa9klonmBSiR4GNi+cJZpvwgX0ejj71W9yR+eIgaVvQgf0l/A8nWjUFhwtZYWC4hVnkZ3p/PJqNQ5NnwUQrQCGBBBMQIGTtL7abK+5JjAv1fi9bS0GLlJHgdjEgYzzARTwC1fgEWdJuKKBZzj331Y23qB3i9v5aY/rSUC4w7PaLeWXmr9NszMFoN79eeiM232o33EJAIzaSGwh++y012777bhT0UURvPfu++/ABy/88MQXb/zxyCd/QggAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEBY5nwCk7xIWNer0hO95wziC9Ttg5b4ND/+Y87IBqZAaEe29zGwmJigmDfHoGiImTjXiQhJEPdYyWhXwDmpuVmHwOoHZqjI6kZ3+MqhyemJKAdo6Ge3OKbEd4ZRwFBV4rc4MPrgYPChrMzAgbyZSJBcoI1tfQoYsJydfe2amT3d7W0OGp1OTl0YtqyQrq0Lt11PDk3KGoG+nxBpvTD9QhwCctm0BzbOyMIwdOUwEDEgawIOCB2oMLgB4wgMCx44IHBySIHClBY0ePfyT/JCB5weRJCAwejFw58kGDlzBTqqTZcuPLmCIBiWx58+VHmiRLFj0JVCVLl0xl7qSZwCbOo0lFWv0pdefQrVFDJtr5gMBEYBgxqBWwYILbtxPsqMPAFu7blfa81bUbN4HAvXAzyLWnoDBguHIRFF6m4LBbwQngMYPXuC3fldbyPrMcGLM3w5wRS1iWWUNlvnElKDZtz/EEwaqvYahQoexEfyILi4RrYYKFZwJ3810QWZ2ECrx9Ew+O3K6F5Yq9zXbb+y30a7olJJ+wnLC16W97Py+uwdtx1NcLWzs/3G9e07stVPc9kHJ0BcLtQp+c3ewKAgYkUAFpCaAmmHqKLSYA/18WHEiZPRhsQF1nlLFWmIR8ZbDBYs0YZuCGpGXWmG92aWiPMwhEOOEEHXRwIALlwXjhio+BeE15IzpnInaLbZBBhhti9x2GbnVQo2Y9ZuCfCgBeMCB+DJDIolt4iVhOaNSJdCOBUfIlkmkyMpPAAvKJ59aXzTQzJo0WoJnmQF36Jp6W1qC4gWW9GZladCiyJd+KnsHImgRRVjfnaDEKuiZvbcYWo5htzefbl5LFWNeSKQAo1QXasdhiiwwUl2B21H3aQaghXnPcp1NagCqYslXAqnV+zYWcpNwVp9l5eepJnHqL4SdBi56CGlmw2Zn6aaiZjZqfb8Y2m+Cz1O0n3f+tnvrGbF6kToApCgAWoNWPeh754JA0vmajiAr4iOuOW7abQXVGNriBWoRdOK8FxNqLwX3oluubhv8yluRbegqGb536ykesuoXhyJqPQJIGbLvQhkcwjKs1zBvBwSZIsbcsDCCBAAf4ya+UEhyQoIiEJtfoZ7oxUOafE2BwgMWMqUydfC1LVtiArk0QtGkWEopzlqM9aJrKHfw5c6wKjFkmXDrbhwFockodtMGFLWpXy9JdiXN1ZDNszV4WSLQCGBKoQYHUyonqrHa4ErewAgMmcAAF7f2baIoVzC2p3gUvJtLcvIWqloy6/R04mIpLwDhciI8qLOB5yud44pHPLbA83hFDWPjNbuk9KnySN57Av+TMBvgEAgzzNhJb5K777rz37vvvVHRRxPDEF2/88cgnr/zyzDfv/PPQnxACACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIUCwcMpO84OT2HDbm8GHLQjnn6wE3g83SA3DB55G3llfHxnfnZ4gglvew6Gf4ySgmYGlpCJknochWiId3kJcZZyDn93i6KPl4eniopwq6SIoZKxhpenbhtHZRxhXisDopwPgHkGDxrLGgjLG8mC0gkFDwjX2AgJ0bXJ2djbgNJsAtbfCNB2oOnn6MmKbeXt226K1fMGi6j359D69ua+QZskjd+3cOvY9XNgp4ABCQNYEDBl7EIeCQkeMIDAseOCBwckiBSZ4ILGjh4B/40kaXIjSggMHmBcifHky5gYE6zM2OAlzGM6Z5rs+fIjTZ0tfcYMSlLCUJ8fL47kCVXmTjwPiKJkUCDnyqc3CxzQmYeAxAEGLGJYiwCDgAUT4sqdgOebArdw507IUNfuW71xdZ7DC5iuhGsKErf9CxhPYgUaEhPWyzfBMgUIJDPW6zhb5M1y+R5GjFkBaLmCM0dOfHqvztXYJnMejaFCBQlmVxAYsEGkYnQV4lqYMNyCtnYSggNekAC58uJxmTufW5w55mwKkg+nLp105uTC53a/nhg88fMTmDfDVl65Xum/IZt/3/zaag3a5W63nll1dvfiWbaaZLmpQIABCVQA2f9lAhTG112PQWYadXE9+FtmEwKWwQYQJrZagxomsOCAGVImInsSbpCBhhwug6KKcXXQQYUcYuDMggrASFmNzjjzzIrh7cUhhhHqONeGpSEW2QYxHsmjhxpgUGAKB16g4IIbMNCkXMlhaJ8GWVJo2I3NyKclYF1GxgyYDEAnXHJrMpNAm/rFBSczPiYAlwXF8ZnmesvoOdyMbx7m4o0S5LWdn4bex2Z4xYmEzaEb5EUcnxbA+WWglqIn6aHPTInCgVbdlZyMqMrIQHMRSiaBBakS1903p04w434n0loBoQFOt1yu2YAnY68RXiNsqh2s2qqxuyKb7Imtmgcrqsp6h8D/fMSpapldx55nwayK/SfqCQd2hcFdAgDp5GMvqhvakF4mZuS710WGIYy30khekRkMu92GNu6bo7r/ttjqwLaua5+HOdrKq5Cl3dcwi+xKiLBwwwom4b0E6xvuYyqOa8IAEghwQAV45VvovpkxBl2mo0W7AKbCZXoAhgMmWnOkEqx2JX5nUufbgJHpXCfMOGu2QAd8eitpW1eaNrNeMGN27mNz0swziYnpSbXN19gYtstzfXrdYjNHtAIYGFVwwAEvR1dfxdjKxVzAP0twAAW/ir2w3nzTd3W4yQWO3t0DfleB4XYnEHCEhffdKgaA29p0eo4fHLng9qoG+OVyXz0gMeWGY7qq3xhiRIEAwayNxBawxy777LTXbjsVXRSh++689+7778AHL/zwxBdv/PEnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLD4BlwHGg0ubBpuzdm9Dk9eCTu+MTZkDb4PXYbeIIcHHxqf4F3gnqGY2kOdQmCjHCGfpCSjHhmh2N+knmEkJmKg3uHfgaaeY2qn6t2i4t7sKAPbwIJD2VhXisDCQZgDrKDBQ8aGgjKyhvDlJMJyAjV1gjCunkP1NfVwpRtk93e2ZVt5NfCk27jD97f0LPP7/Dr4pTp1veLgvrx7AL+Q/BM25uBegoYkDCABYFhEobhkUBRwoMGEDJqXPDgQMUEFC9c1LjxQUUJICX/iMRIEgIDkycrjmzJMSXFlDNJvkwJsmdOjQwKfDz5M+PLoSGLQqgZU6XSoB/voHxawGbFlS2XGktAwKEADB0xiEWAodqGBRPSqp1wx5qCamDRrp2Qoa3bagLkzrULF4GCvHPTglRAmKxZvWsHayBcliDitHUlvGWM97FgCdYWVw4c2e/kw4HZJlCwmDBhwHPrjraGYTHqtaoxVKggoesKAgd2SX5rbUMFCxOAC8cGDwHFwBYWJCgu4XfwtcqZV0grPHj0u2SnqwU+IXph3rK5b1fOu7Bx5+K7L6/2/Xhg8uyXnQ8dvfRiDe7TwyfNuzlybKYpgIFtKhAgwEKkKcOf/wChZbBBgMucRh1so5XH3wbI1WXafRJy9iCErmX4IWHNaIAhZ6uxBxeGHXQA24P3yYfBBhmgSBozESpwongWOBhggn/N1aKG8a1YY2oVAklgCgQUUwGJ8iXAgItrWUARbwpqIOWEal0ZoYJbzmWlZCWSlsAC6VkwZonNbMAAl5cpg+NiZwpnJ0Xylegmlc+tWY1mjnGnZnB4QukMA9UJRxGOf5r4ppqDjjmnfKilh2ejGiyJAgF1XNmYbC2GmhZ5AcJVgajcXecNqM9Rx8B6bingnlotviqdkB3YCg+rtOaapFsUhSrsq6axJ6sEwoZK7I/HWpCsr57FBxJ1w8LqV/81zbkoXK3LfVeNpic0KRQG4NHoIW/XEmZuaiN6tti62/moWbk18uhjqerWS6GFpe2YVotskVssWfBOAHACrZHoWcGQwQhlvmsdXBZ/F9YLMF2jzUuYBP4a7CLCnoEHrgkDSCDAARUILAGaVVqAwQHR8pZXomm9/ONhgjrbgc2lyYxmpIRK9uSNjrXs8gEbTrYyl2ryTJmsLCdKkWzFQl1lWlOXGmifal6p9VnbQfpyY2SZyXKVV7JmZkMrgIFSyrIeUJ2r7YKnXdivUg1kAgdQ8B7IzJjGsd9zKSdwyBL03WpwDGxwuOASEP5vriO2F3nLjQdIrpaRDxqcBdgIHGA74pKrZXiR2ZWuZt49m+o3pKMC3p4Av7SNxBa456777rz37jsVXRQh/PDEF2/88cgnr/zyzDfv/PMnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLDUPAMHGi0weEpbN7wI8cxTzsGj4R+n+DUxwaBeBt7hH1/gYIPhox+Y3Z3iwmGk36BkIN8egOIl3h8hBuOkAaZhQlna4BrpnyWa4mleZOFjrGKcXoFA2ReKwMJBgISDw6abwUPGggazc0bBqG0G8kI1tcIwZp51djW2nC03d7BjG8J49jl4cgP3t/RetLp1+vT6O7v5fKhAvnk0UKFogeP3zmCCIoZkDCABQFhChQYuKBHgkUJkxpA2MhxQYEDFhNcvPBAI8eNCx7/gMQYckPJkxsZPLhIM8FLmDJrYiRp8mTKkCwT8IQJwSPQkENhpgQpEunNkzlpWkwKdSbGihKocowqVSvKWQkIOBSgQOYFDBgQpI0oYMGEt3AzTLKm4BqGtnDjirxW95vbvG/nWlub8G9euRsiqqWLF/AEkRoiprX2wLDeDQgkW9PQGLDgyNc665WguK8C0XAnRY6oGPUEuRLsgk5g+a3cCxUqSBC7gsCBBXcVq6swwULx4hayvctGPK8FCwsSLE9A3Hje6NOrHzeOnW695sffRi/9HfDz7sIVSNB+XXrmugo0rHcM3X388o6jr44ceb51uNjF1xcC8zk3wXiS8aYC/wESaLABBs7ch0ECjr2WAGvLsLZBeHqVFl9kGxooV0T81TVhBo6NiOEyJ4p4IYnNRBQiYCN6x4wCG3ZAY2If8jXjYRcyk2FmG/5nXAY8wqhWAii+1YGOSGLoY4VRfqiAgikwmIeS1gjAgHkWYLQZf9m49V9gDWYWY5nmTYCRM2TS5pxxb8IZGV5nhplmhJyZadxzbrpnZ2d/6rnZgHIid5xIMDaDgJfbLdrgMkKW+Rygz1kEZz1mehabkBpgiQIByVikwGTqVfDkk2/Vxxqiqur4X3fksHccre8xlxerDLiHjQIVUAgXr77yFeyuOvYqXGbMrbrqBMqaFpFFzhL7qv9i1FX7ZLR0LUNdcc4e6Cus263KbV+inkAAHhJg0BeITR6WmHcaxhvXg/AJiKO9R77ILF1FwmVdAu6WBu+ZFua72mkZWMfqBElKu0G8rFZ5n4ATp5jkmvsOq+Nj7u63ZMMPv4bveyYy6fDH+C6brgnACHBABQUrkGirz2FwAHnM4Mmhzq9yijOrOi/MKabH6VwBiYwZdukEQAvILKTWXVq0ZvH5/CfUM7M29Zetthp1eht0eqkFYw8IKXKA6mzXfTeH7fZg9zW0AhgY0TwthUa6Ch9dBeIsbsFrYkRBfgTfiG0FhwMWnbsoq3cABUYOnu/ejU/A6uNeT8u4wMb1WnBCyJJTLjjnr8o3OeJrUcpc5oCiPqAEkz8tXuLkPeDL3Uhs4fvvwAcv/PDEU9FFEcgnr/zyzDfv/PPQRy/99NRXf0IIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIWCw/AoDziOtCHt8BQ28PjmzK57Hom8fo42+P8DeAkbeYQcfX9+gYOFg4d1bIGEjQmPbICClI9/YwaLjHAJdJeKmZOViGtpn3qOqZineoeJgG8CeWUbBV4rAwkGAhIVGL97hGACGsrKCAgbBoTRhLvN1c3PepnU1s2/oZO6AtzdBoPf4eMI3tIJyOnF0YwFD+nY8e3z7+Xfefnj9uz8cVsXCh89axgk7BrAggAwBQsYIChwQILFixIeNIDAseOCBwcSXMy2sSPHjxJE/6a0eEGjSY4MQGK86PIlypUJEmYsaTKmyJ8JW/Ls6HMkzaEn8YwMWtPkx4pGd76E4DMPRqFTY860OGhogwYagBFoKEABA46DEGBAoEBB0AUT4sqdIFKBNbcC4M6dkEEk22oYFOTdG9fvWrtsBxM23MytYL17666t9phwXwlum2lIDHmuSA2IGyuOLOHv38qLMbdFjHruZbWgRXeOe1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+Rxl8e13rZxN+CEydtVsFkd+vDjE7C/q52wOvb4s7+faz025frbxefWbSoQIAEDEUCwgf9j7bUlwHN9ZVaegxDK1xYzFMJH24L5saXABhlYxiEzHoKoIV8LYqAMaw9aZqFmJUK4YHuNfRjiXhmk+NcyJgaIolvM8BhiBx3IleN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA=="); - -define("text!cockpit/ui/images/closer.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAj9JREFUeNp0ks+LUlEUx7/vV1o8Z8wUx3IEHcQmiBiQlomjRNCiZpEuEqF/oEUwq/6EhvoHggmRcJUQBM1CRJAW0aLIaGQimZJxJsWxyV/P9/R1zzWlFl04vPvOPZ9z7rnnK5imidmKRCIq+zxgdoPZ1T/ut8xeM3tcKpW6s1hhBkaj0Qj7bDebTX+324WmadxvsVigqipcLleN/d4rFoulORiLxTZY8ItOp8MBCpYkiYPj8Xjus9vtlORWoVB4KcTjcQc732dLpSRXvCZaAws6Q4WDdqsO52kNH+oCRFGEz+f7ydwBKRgMPmTXi49GI1x2D/DsznesB06ws2eDbI7w9HYN6bVjvGss4KAjwDAMq81mM2SW5Wa/3weBbz42UL9uYnVpiO2Nr9ANHSGXib2Wgm9tCYIggGKJEVkvlwgi5/FQRmTLxO6hgJVzI1x0T/fJrBtHJxPeL6tI/fsZLA6ot8lkQi8HRVbw94gkWYI5MaHrOjcCGSNRxZosy9y5cErDzn0Dqx7gcwO8WtBp4PndI35GMYqiUMUvBL5yOBz8yRfFNpbPmqgcCFh/IuHa1nR/YXGM8+oUpFhihEQiwcdRLpfVRqOBtWXWq34Gra6AXq8Hp2piZcmKT4cKnE4nwuHwdByVSmWQz+d32WCTlHG/qaHHREN9kgi0sYQfv0R4PB4EAgESQDKXy72fSy6VSnHJVatVf71eR7vd5n66mtfrRSgU4pLLZrOlf7RKK51Ok8g3/yPyR5lMZi7y3wIMAME4EigHWgKnAAAAAElFTkSuQmCC"); - -define("text!cockpit/ui/images/pinin.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZ0lEQVQ4Ea2TPUsDQRCGZ89Eo4FACkULEQs1CH4Uamfjn7GxEYJFIFXgChFsbPwzNnZioREkaiHBQtEiEEiMRm/dZ8OEGAxR4sBxx877Pju7M2estTJIxLrNuVwuMxQEx0ZkzcFHyRtjXt02559RtB2GYanTYzoryOfz+6l4Nbszf2niwffKmpGRo9sVW22mDgqFwp5C2gDMm+P32a3JB1N+n5JifUGeP9JeNxGryPLYjcwMP8rJ07Q9fZltQzyAstOJ2vVu5sKc1ZZkRBrOcKeb+HexPidvkpCN5JUcllZtpZFc5DgBWc5M2eysZuMuofMBSA4NWjx4PUCsXefMlI0QY3ewRg4NWi4ZTQsgrjYXema+e4VqtEMK6KXvu+4B9Bklt90vVKMeD2BI6DOt4rZ/Gk7WyKFBi4fNPIAJY0joM61SCCZ9tI1o0OIB8D+DBIkYaJRbCBH9mZgNt+bb++ufSSF/eX8BYcDeAzuQJVUAAAAASUVORK5CYII="); - -define("text!cockpit/ui/images/plus.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4yFTwuJTkAAAH7SURBVCjPdZKxa1NRFMZ/956XZMgFyyMlCZRA4hBx6lBcQ00GoYi4tEstFPwLAs7iLDi7FWuHThaUggihBDI5OWRoQAmBQFISQgvvpbwX3rsOaR4K+o2H8zvfOZxPWWtZqVarGaAJPAEe3ZW/A1+Bd+1221v1qhW4vb1dA44mk0nZ8zyCIAAgk8lgjGF9fb0PHF5cXLQTsF6vP/c879P19TVBEJDJZBARAKIoSmpra2sYY561Wq3PqtFouMBgMBgYay3ZbJZ/yfd9tNaUSqUboOKISPPq6sqsVvZ9H4AvL34B8PTj/QSO45jpdHovn883Ha31znw+JwzDpCEMQx4UloM8zyOdTif3zudztNY7jog8DMMQpRRxHPPt5TCBAEZvxlyOFTsfykRRBICIlB2t9a21Nh3HMXEc8+d7VhJHWCwWyzcohdZaHBHpO46z6fs+IsLj94XECaD4unCHL8FsNouI/HRE5Nx13c3ZbIbWOnG5HKtl+53TSq7rIiLnand31wUGnU7HjEYjlFLJZN/3yRnL1FMYY8jlcmxtbd0AFel2u7dnZ2eXxpi9xWJBEASkUimstYgIQSSkUimKxSKVSgVjzN7p6emPJHL7+/s14KjX65WHwyGz2SxZbWNjg2q12gcOT05O2n9lFeDg4MAAr/4T8rfHx8dJyH8DvvbYGzKvWukAAAAASUVORK5CYII="); - -define("text!cockpit/ui/images/minus.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4xMrIJw5EAAAHcSURBVCjPhZIxSxtxGMZ/976XhJA/RA5EAyJcFksnp64hjUPBoXRyCYLQTyD0UxScu0nFwalCQSgFCVk7dXAwUAiBDA2RO4W7yN1x9+9gcyhU+pteHt4H3pfncay1LOl0OgY4BN4Ar/7KP4BvwNFwOIyWu87S2O12O8DxfD73oygiSRIAarUaxhhWV1fHwMFgMBiWxl6v9y6Koi+3t7ckSUKtVkNVAcjzvNRWVlYwxry9vLz86uzs7HjAZDKZGGstjUaDfxHHMSLC5ubmHdB2VfVwNpuZ5clxHPMcRVFwc3PTXFtbO3RFZHexWJCmabnweAaoVqvlv4vFAhHZdVX1ZZqmOI5DURR8fz/lxbp9Yrz+7bD72SfPcwBU1XdF5N5aWy2KgqIoeBzPEnWVLMseYnAcRERdVR27rrsdxzGqyutP6898+GBsNBqo6i9XVS88z9sOggAR4X94noeqXoiIHPm+H9XrdYIgIAxDwjAkTVPCMESzBy3LMprNJr7v34nIkV5dXd2fn59fG2P2siwjSRIqlQrWWlSVJFcqlQqtVot2u40xZu/s7OxnWbl+v98BjkejkT+dTgmCoDxtY2ODra2tMXBweno6fNJVgP39fQN8eKbkH09OTsqS/wHFRdHPfTSfjwAAAABJRU5ErkJggg=="); - -define("text!cockpit/ui/images/dot_clear.gif", [], "data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"); - -define("text!cockpit/ui/images/pins.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGYklEQVRIDbVWe0yURxCf/R735o6DO0FBe0RFsaL4iLXGIKa2SY3P6JGa2GpjlJjUV9NosbU++tYUbEnaQIrVaKJBG7WiNFQFUWO1UUEsVg2CAgoeHHLewcH32O58cBdQsX9Y5+7LfrszOzO/2ZnZj1BKgTBiIwVGVvKd49OVVYunDlXn6wdBKh+ogXrv+DOz1melIb+3LM5fNv2XPYE5EHY+L3PJljN5zavHpJjsQNsA/JJEgyC2+WTjy3b0GfoJW8O4aoHtDwiHQrj5lw1LLyyb1bp5zAjJTus9klrVpdD6TqH2ngVO+0dsRJnp06cLIYU4fx7NnRI3bu7UIYOeJ/McnuY88q3k62gc0S4Dgf5qhICQtIXS2lqD7BhSduPk3YfyzXaANhBBJDxYdUqCywB2qS4RdyUuSkTF/VJxcbH5j8N7/75RuFrN3Zh8OS8zqf5m4UpPeenOyP42dbtBeuvVnCdkK1e4PfPouX03mo9se+c33M8wqDk5Ofqed8REUTicQhbySUxp9u3KlMSHTtrFU6Kyn03lz15PPpW25vsZeYSIKyiVURcqeZJOH9lTNZLfnxRjU/uwrjbEUBWsapcSO2Hq4k0VfZg9EzxdDNCEjDxgNqRDme9umz/btwlsHRIEePHgAf73RdnHZ6LTuIUBN7OBQ+c1Fdnp6cZ1BQUdeRuWZi97o3ktDQQkVeFFzqJARd1A5a0Vr7ta6Kp6TZjtZ+NTIOoKF6qDrL7e0QQIUCiqMMKk8Z1Q/SCSKvzocf2B6NEN0SQn/kTO6fKJ0zqjZUlQBSpJ0GjR77w0aoc1Pr6S5/kVJrNpakV5hR+LWKN4t7sLX+p0rx2vqSta64olIulUKUgCSXLWE1R4KPPSj+5vhm2hdDOG+CkQBmhhyyKq6SaFYWTn5bB3QJRNz54AuXKn8TJjhu0Wbv+wNEKQjVhnmKopjo4FxXmetCRnC4F7BhCiCUepqAepRh0TM/gjjzOOSK2NgWZPc05qampRWJHb7dbOffep2ednzLzgczlbrQA6gHYF9BYDh9GY+FjddMweHMscmMuep07gXlMQoqw9ALoYu5MJsak9QmJA2IvAgVmoCRciooyPujJtNCv1uHt3TmK9gegFKrG9kh6oXwZiIEAtBIjORGKNTWR/WeW8XVkbjuJepLAyloM8LmTN//njKZPbraATZaLjCHEww9Ei4FFiPg6Ja5gT6gxYgLgnRDHRQwJXbz2GOw0d4A3K4GXlUtMahJjYVxiYbrwOmxIS10bFnIBOSi6Tl9Jgs0zbOEX18wyEwgLPMrxD1Y4aCK8kmTpgYcpAF27Mzs42Hjx4kA8BICUlJfKArR7LcEvTB1xEC9AoEw9OPagWkVU/D1oesmK6U911zEczMVe01oZjiMggg6ux2Qk379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/GPQcVDe0QYT0CIxGFvUorfvBxZsRfVrUuWruMBAb/lXCUofoFNZfzGJtowXOX0vwUSFK4BgyMKm6P6s9wQUZld+jrYyMDC0iIQDaJdG4IyZQfL3RfbFcCBIlRgc+u3CjaTApuZ9KsANgG8PNzHlWWD3tCxd6kafNNiFp5HAalAkkJ0SCV2H3CgOD9Nc/FqrXuyb0Eocvfhq171p5eyuJ1omKJEP5rQGe/FOOnXtq335z8YmvYo9cHb2t8spIb3lVSseZW46FlGY/Sk9P50P2w20UlWJUkUHIushfc5PXGAzCo0PlD2pnpCYfCXga3lu+fPlevEhWrVrFyrN/Orfv87FOW9tlqb2Kc9pV8DzioMk3UNUbXM+8B/ATBr8C8CKdvGXWGD/9sqm3dkxtzA4McMjHMB8D2ftheYXo+qzt3pXvz8/PP/vk+v8537V+yYW87Zu+RZ1ZbrexoKAA/SBpaWn4+aL5w5zGk+/jW59JiMkESW5urpiVlWXENRb1H/Yf2I9txIxz5IdkX3TsraukpsbQjz6090yb4XsAvQoRE0YvJdamtIIbOnRoUVlZ2ftsLVQzIdEXHntsaZdimssVfCpFui109+BnWPsXaWLI/zactygAAAAASUVORK5CYII="); - -define("text!cockpit/ui/images/pinout.png", [], "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAACyUlEQVQ4EW1TXUgUURQ+Z3ZmnVV3QV2xJbVSEIowQbAfLQx8McLoYX2qjB58MRSkP3vZppceYhGxgrZaIughlYpE7CHFWiiKyj9II0qxWmwlNh1Xtp2f27mz7GDlZX7uuXO+73zfuXeQMQYIgAyALppgyBtse32stsw86txkHhATn+FbfPfzxnPB+vR3RMJYuTwW6bbB4a6WS5O3Yu2VlXIesDiAamiQNKVlVXfx5I0GJ7DY7p0/+erU4dgeMJIA31WNxZmAgibOreXDqF55sY4SFUURqbi+nkjgwTyAbHhLX8yOLsSM2QRA3JRAAgd4RGPbVhkKEp8qeJ7PFyW3fw++YHtC7CkaD0amqyqihSwlMQQ0wa07IjPVI/vbexreIUrVaQV2D4RMQ/o7m12Mdfx4H3PfB9FNzTR1U2cO0Bi45aV6xNvFBNaoIAfbSiwLlqi9/hR/R3Nrhua+Oqi9TEKiB02C7YXz+Pba4MTDrpbLiMAxNgmXb+HpwVkZdoIrkn9isW7nRw/TZYaagZArAWyhfqsSDL/c9aTx7JUjGZCtYExRqCzAwGblwr6aFQ84nTo6qZ7XCeCVQNckE/KSWolvoQnxeoFFgIh8G/nA+kBAxxuQO5m9eFrwLIGJHgcyM63VFMhRSgNVyJr7og8y1vbTQpH8DIEVgxuYuexw0QECIalq5FYgEmpkgoFYltU/lnrqDz5osirSFpF7lrHAFKSWHYfEs+mY/82UnAStyMlW8sUPsVIciTZgz3jV1ebg0CEOpgPF22s1z1YQYKSXPJ1hbAhR8T26WdLhkuVfAzPR+YO1Ox5n58SmCcF6e3uzAoHA77RkevJdWH/3+f2O9TGf3w3fWQ2Hw5F/13mcsWAT+vv6DK4kFApJ/d3d1k+kJtbCrmxXHS3n8ER6b3CQbAqaEHVra6sGxcXW4SovLx+empxapS//FfwD9kpMJjMMBBAAAAAASUVORK5CYII="); - diff --git a/websdk/static/js/ace/cockpit.js b/websdk/static/js/ace/cockpit.js deleted file mode 100644 index ecdc74c..0000000 --- a/websdk/static/js/ace/cockpit.js +++ /dev/null @@ -1 +0,0 @@ -define("cockpit/index",["require","exports","module","pilot/index","cockpit/cli","cockpit/ui/settings","cockpit/ui/cli_view","cockpit/commands/basic"],function(a,b,c){b.startup=function(b,c){a("pilot/index"),a("cockpit/cli").startup(b,c),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cli_view").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/cli",["require","exports","module","pilot/console","pilot/lang","pilot/oop","pilot/event_emitter","pilot/types","pilot/canon"],function(a,b,c){function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}function q(a){this.env=a,this.commandAssignment=new o(p,this)}function o(a,b){this.param=a,this.requisition=b,this.setValue(a.defaultValue)}function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c=="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}var d=a("pilot/console"),e=a("pilot/lang"),f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/types"),i=a("pilot/types").Status,j=a("pilot/types").Conversion,k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)},l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l,f.inherits(m,l),n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID,d=this.arg?this.arg.start:n.AT_CURSOR,e=this.arg?this.arg.end:n.AT_CURSOR,f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="",h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return!1;if(this.arg.start===-1)return!1;if(a>this.arg.end)return!1;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return!0},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
    "),c.push(a.description?a.description:"(No description)"),c.push("
    "),a.params&&a.params.length>0&&(c.push("
      "),a.params.forEach(function(a){c.push("
    • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
    • ")},this),c.push("
    "));return new l(i.VALID,c.join(""),b)}};q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name==="__command"&&(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a=="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(!0).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===!0&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,"cli",this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b],d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q,f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(!0).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end,d=b.end>=a.start&&b.end<=a.end,e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(!0);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h),o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==='"'?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==='"'){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1,c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(!0):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/ui/settings",["require","exports","module","pilot/types","pilot/types/basic"],function(a,b,c){var d=a("pilot/types"),e=a("pilot/types/basic").SelectionType,f=new e({name:"direction",data:["above","below"]}),g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"},h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"},i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("cockpit/ui/cli_view",["require","exports","module","text!cockpit/ui/cli_view.css","pilot/event","pilot/dom","pilot/keys","pilot/canon","pilot/types","cockpit/cli","cockpit/ui/request_view"],function(a,b,c){function n(a,b){a.cliView=this,this.cli=a,this.doc=document,this.win=f.getParentWindow(this.doc),this.env=b,this.element=this.doc.getElementById("cockpitInput");!this.element||(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=!1,this.createElements(),this.update())}var d=a("text!cockpit/ui/cli_view.css"),e=a("pilot/event"),f=a("pilot/dom");f.importCssString(d);var e=a("pilot/event"),g=a("pilot/keys"),h=a("pilot/canon"),i=a("pilot/types").Status,j=a("cockpit/cli").CliRequisition,k=a("cockpit/cli").Hint,l=a("cockpit/ui/request_view").RequestView,m=new k(i.VALID,"",0,0);b.startup=function(a,b){var c=new j(a.env),d=new n(c,a.env);a.env.cli=c},n.prototype={createElements:function(){function d(){f.removeCssClass(this.output,"cptFocusPopup"),f.removeCssClass(this.hinter,"cptFocusPopup")}var a=this.element;this.element.spellcheck=!1,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptOutput",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID",this.completer.style.color=f.computedStyle(a,"color"),this.completer.style.fontSize=f.computedStyle(a,"fontSize"),this.completer.style.fontFamily=f.computedStyle(a,"fontFamily"),this.completer.style.fontWeight=f.computedStyle(a,"fontWeight"),this.completer.style.fontStyle=f.computedStyle(a,"fontStyle"),a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints",a.parentNode.insertBefore(this.hinter,a.nextSibling);var c=this.resizer.bind(this);e.addListener(this.win,"resize",c),this.hintDirection.addEventListener("change",c),this.outputDirection.addEventListener("change",c),c(),h.addEventListener("output",function(a){new l(a.request,this)}.bind(this)),e.addCommandKeyListener(a,this.onCommandKey.bind(this)),e.addListener(a,"keyup",this.onKeyUp.bind(this)),e.addListener(a,"mouseup",function(a){this.isUpdating=!0,this.update(),this.isUpdating=!1}.bind(this)),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this)),e.addListener(a,"focus",function(){f.addCssClass(this.output,"cptFocusPopup"),f.addCssClass(this.hinter,"cptFocusPopup")}.bind(this)),e.addListener(a,"blur",d.bind(this)),d.call(this)},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px";var b=a.bottom-a.top;this.completer.style.height=b+"px",this.completer.style.lineHeight=b+"px",this.completer.style.left=a.left+"px";var c=a.right-a.left;this.completer.style.width=c+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.doc.documentElement.clientHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=c-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.doc.documentElement.clientHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=c-80+"px")},onCommandKey:function(a,b,c){var d;if(c===g.TAB||c===g.UP||c===g.DOWN)d=!0;else if(b!=0||c!=0)d=h.execKeyCommand(this.env,"cli",b,c);d&&e.stopEvent(a)},onKeyUp:function(a){var b;if(a.keyCode===g.RETURN){var c=this.cli.getWorstHint();c.status===i.VALID?(this.cli.exec(),this.element.value=""):(f.setSelectionStart(this.element,c.start),f.setSelectionEnd(this.element,c.end))}this.update();var d=this.cli.getAssignmentAt(f.getSelectionStart(this.element));d&&(a.keyCode===g.TAB&&(d.complete(),this.update()),a.keyCode===g.UP&&(d.increment(),this.update()),a.keyCode===g.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=!0;var a={typed:this.element.value,cursor:{start:f.getSelectionStart(this.element),end:f.getSelectionEnd(this.element.selectionEnd)}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();f.removeCssClass(this.completer,i.VALID.toString()),f.removeCssClass(this.completer,i.INCOMPLETE.toString()),f.removeCssClass(this.completer,i.INVALID.toString());var c='> ';if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var e=b.predictions[0];c+="  ⇥ "+(e.name?e.name:e)}this.completer.innerHTML=c,f.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var g="";this.element.value.length!==0&&(g+=b.message,b.predictions&&b.predictions.length>0&&(g+=": [ ",b.predictions.forEach(function(a){g+=a.name?a.name:a,g+=" | "},this),g=g.replace(/\| $/,"]"))),this.hinter.innerHTML=g,g.length===0?f.addCssClass(this.hinter,"cptNoPopup"):f.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=!1},markupStatusScore:function(a){var b="",c=0,d=-1;for(;;){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start),c=this.element.value.substring(a.argument.end),d=typeof a.text=="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=n}),define("cockpit/ui/request_view",["require","exports","module","pilot/dom","pilot/event","text!cockpit/ui/request_view.html","pilot/domtemplate","text!cockpit/ui/request_view.css"],function(a,b,c){function l(a,b){this.request=a,this.cliView=b,this.imageUrl=k,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(!0),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}function k(b){var d;try{d=a("text!cockpit/ui/"+b)}catch(e){}if(d)return d;var f=c.id.split("/").pop()+".js",g;if(c.uri.substr(-f.length)!==f){console.error("Can't work out path from module.uri/module.id");return b}if(c.uri){var h=c.uri.length-f.length-1;return c.uri.substr(0,h)+"/"+b}return f+b}var d=a("pilot/dom"),e=a("pilot/event"),f=a("text!cockpit/ui/request_view.html"),g=a("pilot/domtemplate").Templater,h=a("text!cockpit/ui/request_view.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow");l.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=l}),define("pilot/domtemplate",["require","exports","module"],function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a=="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if")&&!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a=="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d=="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){window.console&&window.console.log&&console.log(a)},exports.Templater=Templater}),define("cockpit/commands/basic",["require","exports","module","pilot/canon"],function(a,b,c){var d=a("pilot/canon"),e={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,!0),d.onreadystatechange=function(a){d.readyState==4&&d.status==200&&c.done("
    "+d.responseText+"
    ")},d.send(null)}},d=a("pilot/canon");b.startup=function(a,b){d.addCommand(e)},b.shutdown=function(a,b){d.removeCommand(e)}}),define("text!cockpit/ui/cli_view.css",[],"#cockpitInput { padding-left: 16px; }.cptOutput { overflow: auto; position: absolute; z-index: 999; display: none; }.cptCompletion { padding: 0; position: absolute; z-index: -1000; }.cptCompletion.VALID { background: #FFF; }.cptCompletion.INCOMPLETE { background: #DDD; }.cptCompletion.INVALID { background: #DDD; }.cptCompletion span { color: #FFF; }.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }span.cptPrompt { color: #66F; font-weight: bold; }.cptHints { color: #000; position: absolute; border: 1px solid rgba(230, 230, 230, 0.8); background: rgba(250, 250, 250, 0.8); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; border-top-left-radius: 10px; border-top-right-radius: 10px; z-index: 1000; padding: 8px; display: none;}.cptFocusPopup { display: block; }.cptFocusPopup.cptNoPopup { display: none; }.cptHints ul { margin: 0; padding: 0 15px; }.cptGt { font-weight: bold; font-size: 120%; }"),define("text!cockpit/ui/request_view.css",[],".cptRowIn { display: box; display: -moz-box; display: -webkit-box; box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal; box-align: center; -moz-box-align: center; -webkit-box-align: center; color: #333; background-color: #EEE; width: 100%; font-family: consolas, courier, monospace;}.cptRowIn > * { padding-left: 2px; padding-right: 2px; }.cptRowIn > img { cursor: pointer; }.cptHover { display: none; }.cptRowIn:hover > .cptHover { display: block; }.cptRowIn:hover > .cptHover.cptHidden { display: none; }.cptOutTyped { box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1; font-weight: bold; color: #000; font-size: 120%;}.cptRowOutput { padding-left: 10px; line-height: 1.2em; }.cptRowOutput strong,.cptRowOutput b,.cptRowOutput th,.cptRowOutput h1,.cptRowOutput h2,.cptRowOutput h3 { color: #000; }.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }.cptRowOutput input[type=password],.cptRowOutput input[type=text],.cptRowOutput textarea { color: #000; font-size: 120%; background: transparent; padding: 3px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;}.cptRowOutput table,.cptRowOutput td,.cptRowOutput th { border: 0; padding: 0 2px; }.cptRowOutput .right { text-align: right; }"),define("text!cockpit/ui/request_view.html",[],'
    >
    ${request.typed}
    Hide command output Show command output Remove this command from the history
    '),define("text!cockpit/ui/images/pinaction.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClklEQVQ4EX1TXUhUQRQ+Z3Zmd+9uN1q2P3UpZaEwcikKekkqLKggKHJ96MHe9DmLkCDa9U198Id8kErICmIlRAN96UdE6QdBW/tBA5Uic7E0zN297L17p5mb1zYjD3eYc+d83zlnON8g5xzWNUSEdUBkHTJasRWySPP7fw3hfwkk2GoNsc0vOaJRHo1GV/GiMctkTIJRFlpZli8opK+htmf83gXeG63oteOtra0u25e7TYJIJELb26vYCACTgUe1lXV86BTn745l+MsyHqs53S/Aq4VEUa9Y6ko14eYY4u3AyM3HYwdKU35DZyblGR2+qq6W0X2Nnh07xynnVYpHORx/E1/GvvqaAZUayjMjdM2f/Lgr5E+fV93zR4u3zKCLughsZqKwAzAxaz6dPY6JgjLUF+eSP5OpjmAw2E8DvldHSvJMKPg08aRor1tc4BuALu6mOwGWdQC3mKIqRsC8mKd8wYfD78/earzSYzdMDW9QgKb0Is8CBY1mQXOiaXAHEpMDE5XTJqIq4EiyxUqKlpfkF0pyV1OTAoFAhmTmyCCoDsZNZvIkUjELQpipo0sQqYZAswZHwsEEE10M0pq2SSZY9HqNcDicJcNTpBvQJz40UbSOTh1B8bDpuY0w9Hb3kkn9lPAlBLfhfD39XTtX/blFJqiqrjbkTi63Hbofj2uL4GMsmzFgbDJ/vmMgv/lB4syJ0oXO7d3j++vio6GFsYmD6cHJreWc3/jRVVHhsOYvM8iZ36mtjPDBk/xDZE8CoHlbrlAssbTxDdDJvdb536L7I6S7Vy++6Gi4Xi9BsUthJRaLOYSPz4XALKI4j4iObd/e5UtDKUjZzYyYRyGAJv01Zj8kC5cbs5WY83hQnv0DzCXl+r8APElkq0RU6oMAAAAASUVORK5CYII="),define("text!cockpit/ui/images/throbber.gif",[],"data:image/gif;base64,R0lGODlh3AATAPQAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWliH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFg8PwKIMHnLF63N2438f0mv1I2O8buXjvaOPtaHx7fn96goR4hmuId4qDdX95c4+RG4GCBoyAjpmQhZN0YGYFXitdZBIVGAoKoq4CG6Qaswi1CBtkcG6ytrYJubq8vbfAcMK9v7q7D8O1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQgDLAQGCQoLDA0QCwUHqfYSFw/xEPz88/X38Onr14+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdE/9chIeBgDoB7gjaWUWTlYAFE3LqzDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKwgcWABB5y1acFNZmEvXwoJ2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCLYMIFCzwLEprg84OsDus/tvqdezZf13Hvr2B9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebc3A8vjf5QWf15Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrAxAJoCDHbgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBBAJNv1DVV01MZdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJgxQCwT40PjfAV4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA00AqVB4hG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAXHx/EoCzboAcdhcLDdgwJ6nua03YZ8PMFPoBMca215eg98G36IgYNvDgOGh4lqjHd7fXOTjYV9nItvhJaIfYF4jXuIf4CCbHmOBZySdoOtj5eja59wBmYFXitdHhwSFRgKxhobBgUPAmdoyxoI0tPJaM5+u9PaCQZzZ9gP2tPcdM7L4tLVznPn6OQb18nh6NV0fu3i5OvP8/nd1qjwaasHcIPAcf/gBSyAAMMwBANYEAhWYQGDBhAyLihwYJiEjx8fYMxIcsGDAxVA/yYIOZIkBAaGPIK8INJlRpgrPeasaRPmx5QgJfB0abLjz50tSeIM+pFmUo0nQQIV+vRlTJUSnNq0KlXCSq09ozIFexEBAYkeNiwgOaEtn2LFpGEQsKCtXbcSjOmVlqDuhAx3+eg1Jo3u37sZBA9GoMAw4MB5FyMwfLht4sh7G/utPGHlYAV8Nz9OnOBz4c2VFWem/Pivar0aKCP2LFn2XwhnVxBwsPbuBAQbEGiIFg1BggoWkidva5z4cL7IlStfkED48OIYoiufYIH68+cKPkqfnsB58ePjmZd3Dj199/XE20tv6/27XO3S6z9nPCz9BP3FISDefL/Bt192/uWmAv8BFzAQAQUWWFaaBgqA11hbHWTIXWIVXifNhRlq6FqF1sm1QQYhdiAhbNEYc2KKK1pXnAIvhrjhBh0KxxiINlqQAY4UXjdcjSJyeAx2G2BYJJD7NZQkjCPKuCORKnbAIXsuKhlhBxEomAIBBzgIYXIfHfmhAAyMR2ZkHk62gJoWlNlhi33ZJZ2cQiKTJoG05Wjcm3xith9dcOK5X51tLRenoHTuud2iMnaolp3KGXrdBo7eKYF5p/mXgJcogClmcgzAR5gCKymXYqlCgmacdhp2UCqL96mq4nuDBTmgBasaCFp4sHaQHHUsGvNRiiGyep1exyIra2mS7dprrtA5++z/Z8ZKYGuGsy6GqgTIDvupRGE+6CO0x3xI5Y2mOTkBjD4ySeGU79o44mcaSEClhglgsKyJ9S5ZTGY0Bnzrj+3SiKK9Rh5zjAALCywZBk/ayCWO3hYM5Y8Dn6qxxRFsgAGoJwwgDQRtYXAAragyQOmaLKNZKGaEuUlpyiub+ad/KtPqpntypvvnzR30DBtjMhNodK6Eqrl0zU0/GjTUgG43wdN6Ra2pAhGtAAZGE5Ta8TH6wknd2IytNKaiZ+Or79oR/tcvthIcAPe7DGAs9Edwk6r3qWoTaNzY2fb9HuHh2S343Hs1VIHhYtOt+Hh551rh24vP5YvXSGzh+eeghy76GuikU9FFEainrvrqrLfu+uuwxy777LTXfkIIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAWHB2l4CDZo9IDjcBja7UEhTV+3DXi3PJFA8xMcbHiDBgMPG31pgHBvg4Z9iYiBjYx7kWocb26OD398mI2EhoiegJlud4UFiZ5sm6Kdn2mBr5t7pJ9rlG0cHg5gXitdaxwFGArIGgoaGwYCZ3QFDwjU1AoIzdCQzdPV1c0bZ9vS3tUJBmjQaGXl1OB0feze1+faiBvk8wjnimn55e/o4OtWjp+4NPIKogsXjaA3g/fiGZBQAcEAFgQGOChgYEEDCCBBLihwQILJkxIe/3wMKfJBSQkJYJpUyRIkgwcVUJq8QLPmTYoyY6ZcyfJmTp08iYZc8MBkhZgxk9aEcPOlzp5FmwI9KdWn1qASurJkClRoWKwhq6IUqpJBAwQEMBYroAHkhLt3+RyzhgCDgAV48Wbgg+waAnoLMgTOm6DwQ8CLBzdGdvjw38V5JTg2lzhyTMeUEwBWHPgzZc4TSOM1bZia6LuqJxCmnOxv7NSsl1mGHHiw5tOuIWeAEHcFATwJME/ApgFBc3MVLEgPvE+Ddb4JokufPmFBAuvPXWu3MIF89wTOmxvOvp179evQtwf2nr6aApPyzVd3jn089e/8xdfeXe/xdZ9/d1ngHf98lbHH3V0LMrgPgsWpcFwBEFBgHmyNXWeYAgLc1UF5sG2wTHjIhNjBiIKZCN81GGyQwYq9uajeMiBOQGOLJ1KjTI40kmfBYNfc2NcGIpI4pI0vyrhjiT1WFqOOLEIZnjVOVpmajYfBiCSNLGbA5YdOkjdihSkQwIEEEWg4nQUmvYhYe+bFKaFodN5lp3rKvJYfnBKAJ+gGDMi3mmbwWYfng7IheuWihu5p32XcSWdSj+stkF95dp64jJ+RBipocHkCCp6PCiRQ6INookCAAwy0yd2CtNET3Yo7RvihBjFZAOaKDHT43DL4BQnsZMo8xx6uI1oQrHXXhHZrB28G62n/YSYxi+uzP2IrgbbHbiaer7hCiOxDFWhrbmGnLVuus5NFexhFuHLX6gkEECorlLpZo0CWJG4pLjIACykmBsp0eSSVeC15TDJeUhlkowlL+SWLNJpW2WEF87urXzNWSZ6JOEb7b8g1brZMjCg3ezBtWKKc4MvyEtwybPeaMAA1ECRoAQYHYLpbeYYCLfQ+mtL5c9CnfQpYpUtHOSejEgT9ogZ/GSqd0f2m+LR5WzOtHqlQX1pYwpC+WbXKqSYtpJ5Mt4a01lGzS3akF60AxkcTaLgAyRBPWCoDgHfJqwRuBuzdw/1ml3iCwTIeLUWJN0v4McMe7uasCTxseNWPSxc5RbvIgD7geZLbGrqCG3jepUmbbze63Y6fvjiOylbwOITPfIHEFsAHL/zwxBdvPBVdFKH88sw37/zz0Ecv/fTUV2/99SeEAAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2cw8BQEm3T6yHEYHHD4oKCuD9qGvNsxT6QTgAkcHHmFeX11fm17hXwPG35qgnhxbwMPkXaLhgZ9gWp3bpyegX4DcG+inY+Qn6eclpiZkHh6epetgLSUcBxlD2csXXdvBQrHGgoaGhsGaIkFDwjTCArTzX+QadHU3c1ofpHc3dcGG89/4+TYktvS1NYI7OHu3fEJ5tpqBu/k+HX7+nXDB06SuoHm0KXhR65cQT8P3FRAMIAFgVMPwDCAwLHjggIHJIgceeFBg44eC/+ITCCBZYKSJ1FCWPBgpE2YMmc+qNCypwScMmnaXAkUJYOaFVyKLOqx5tCXJnMelcBzJNSYKIX2ZPkzqsyjPLku9Zr1QciVErYxaICAgEUOBRJIgzChbt0MLOPFwyBggV27eCUcmxZvg9+/dfPGo5bg8N/Ag61ZM4w4seDF1fpWhizZmoa+GSortgcaMWd/fkP/HY0MgWbTipVV++wY8GhvqSG4XUEgoYTKE+Qh0OCvggULiBckWEZ4Ggbjx5HXVc58IPQJ0idQJ66XanTpFraTe348+XLizRNcz658eHMN3rNPT+C+G/nodqk3t6a+fN3j+u0Xn3nVTQPfdRPspkL/b+dEIN8EeMm2GAYbTNABdrbJ1hyFFv5lQYTodSZABhc+loCEyhxTYYkZopdMMiNeiBxyIFajV4wYHpfBBspUl8yKHu6ooV5APsZjQxyyeNeJ3N1IYod38cgdPBUid6GCKfRWgAYU4IccSyHew8B3doGJHmMLkGkZcynKk2Z50Ym0zJzLbDCmfBbI6eIyCdyJmJmoqZmnBAXy9+Z/yOlZDZpwYihnj7IZpuYEevrYJ5mJEuqiof4l+NYDEXQpXQcMnNjZNDx1oGqJ4S2nF3EsqWrhqqVWl6JIslpAK5MaIqDeqjJq56qN1aTaQaPbHTPYr8Be6Gsyyh6Da7OkmmqP/7GyztdrNVQBm5+pgw3X7aoYKhfZosb6hyUKBHCgQKij1rghkOAJuZg1SeYIIY+nIpDvf/sqm4yNG5CY64f87qdAwSXKGqFkhPH1ZHb2EgYtw3bpKGVkPz5pJAav+gukjB1UHE/HLNJobWcSX8jiuicMMBFd2OmKwQFs2tjXpDfnPE1j30V3c7iRHlrzBD2HONzODyZtsQJMI4r0AUNaE3XNHQw95c9GC001MpIxDacFQ+ulTNTZlU3O1eWVHa6vb/pnQUUrgHHSBKIuwG+bCPyEqbAg25gMVV1iOB/IGh5YOKLKIQ6xBAcUHmzjIcIqgajZ+Ro42DcvXl7j0U4WOUd+2IGu7DWjI1pt4DYq8BPm0entuGSQY/4tBi9Ss0HqfwngBQtHbCH88MQXb/zxyFfRRRHMN+/889BHL/301Fdv/fXYZ39CCAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2fAKXsKm7R6Q+Y43vABep0mGwwOPH7w2CT+gHZ3d3lyagl+CQNvg4yGh36LcHoGfHR/ZYOElQ9/a4ocmoRygIiRk5p8pYmZjXePaYBujHoOqp5qZHBlHAUFXitddg8PBg8KGsgayxvGkAkFDwgICtPTzX2mftHW3QnOpojG3dbYkNjk1waxsdDS1N7ga9zw1t/aifTk35fu6Qj3numL14fOuHTNECHqU4DDgQEsCCwidiHBAwYQMmpcUOCAhI8gJVzUuLGThAQnP/9abEAyI4MCIVOKZNnyJUqUJxNcGNlywYOQgHZirGkSJ8gHNEky+AkS58qWEJYC/bMzacmbQHkqNdlUJ1KoSz2i9COhmQYCEXtVrCBgwYS3cCf8qTcNQ9u4cFFOq2bPLV65Cf7dxZthbjW+CgbjnWtNgWPFcAsHdoxgWWK/iyV045sAc2S96SDn1exYw17REwpLQEYt2eW/qtPZRQAB7QoC61RW+GsBwYZ/CXb/XRCYLsAKFizEtUAc+G7lcZsjroscOvTmsoUvx15PwccJ0N8yL17N9PG/E7jv9S4hOV7pdIPDdZ+ePDzv2qMXn2b5+wTbKuAWnF3oZbABZY0lVmD/ApQd9thybxno2GGuCVDggaUpoyBsB1bGGgIYbJCBcuFJiOAyGohIInQSmmdeiBnMF2GHfNUlIoc1rncjYRjW6NgGf3VQGILWwNjBfxEZcAFbC7gHXQcfUYOYdwzQNxo5yUhQZXhvRYlMeVSuSOJHKJa5AQMQThBlZWZ6Bp4Fa1qzTAJbijcBlJrtxeaZ4lnnpZwpukWieGQmYx5ATXIplwTL8DdNZ07CtWYybNIJF4Ap4NZHe0920AEDk035kafieQrqXofK5ympn5JHKYjPrfoWcR8WWQGp4Ul32KPVgXdnqxM6OKqspjIYrGPDrlrsZtRIcOuR86nHFwbPvmes/6PH4frrqbvySh+mKGhaAARPzjjdhCramdoGGOhp44i+zogBkSDuWC5KlE4r4pHJkarXrj++Raq5iLmWLlxHBteavjG+6amJrUkJJI4Ro5sBv9AaOK+jAau77sbH7nspCwNIYIACffL7J4JtWQnen421nNzMcB6AqpRa9klonmBSiR4GNi+cJZpvwgX0ejj71W9yR+eIgaVvQgf0l/A8nWjUFhwtZYWC4hVnkZ3p/PJqNQ5NnwUQrQCGBBBMQIGTtL7abK+5JjAv1fi9bS0GLlJHgdjEgYzzARTwC1fgEWdJuKKBZzj331Y23qB3i9v5aY/rSUC4w7PaLeWXmr9NszMFoN79eeiM232o33EJAIzaSGwh++y012777bhT0UURvPfu++/ABy/88MQXb/zxyCd/QggAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEBY5nwCk7xIWNer0hO95wziC9Ttg5b4ND/+Y87IBqZAaEe29zGwmJigmDfHoGiImTjXiQhJEPdYyWhXwDmpuVmHwOoHZqjI6kZ3+MqhyemJKAdo6Ge3OKbEd4ZRwFBV4rc4MPrgYPChrMzAgbyZSJBcoI1tfQoYsJydfe2amT3d7W0OGp1OTl0YtqyQrq0Lt11PDk3KGoG+nxBpvTD9QhwCctm0BzbOyMIwdOUwEDEgawIOCB2oMLgB4wgMCx44IHBySIHClBY0ePfyT/JCB5weRJCAwejFw58kGDlzBTqqTZcuPLmCIBiWx58+VHmiRLFj0JVCVLl0xl7qSZwCbOo0lFWv0pdefQrVFDJtr5gMBEYBgxqBWwYILbtxPsqMPAFu7blfa81bUbN4HAvXAzyLWnoDBguHIRFF6m4LBbwQngMYPXuC3fldbyPrMcGLM3w5wRS1iWWUNlvnElKDZtz/EEwaqvYahQoexEfyILi4RrYYKFZwJ3810QWZ2ECrx9Ew+O3K6F5Yq9zXbb+y30a7olJJ+wnLC16W97Py+uwdtx1NcLWzs/3G9e07stVPc9kHJ0BcLtQp+c3ewKAgYkUAFpCaAmmHqKLSYA/18WHEiZPRhsQF1nlLFWmIR8ZbDBYs0YZuCGpGXWmG92aWiPMwhEOOEEHXRwIALlwXjhio+BeE15IzpnInaLbZBBhhti9x2GbnVQo2Y9ZuCfCgBeMCB+DJDIolt4iVhOaNSJdCOBUfIlkmkyMpPAAvKJ59aXzTQzJo0WoJnmQF36Jp6W1qC4gWW9GZladCiyJd+KnsHImgRRVjfnaDEKuiZvbcYWo5htzefbl5LFWNeSKQAo1QXasdhiiwwUl2B21H3aQaghXnPcp1NagCqYslXAqnV+zYWcpNwVp9l5eepJnHqL4SdBi56CGlmw2Zn6aaiZjZqfb8Y2m+Cz1O0n3f+tnvrGbF6kToApCgAWoNWPeh754JA0vmajiAr4iOuOW7abQXVGNriBWoRdOK8FxNqLwX3oluubhv8yluRbegqGb536ykesuoXhyJqPQJIGbLvQhkcwjKs1zBvBwSZIsbcsDCCBAAf4ya+UEhyQoIiEJtfoZ7oxUOafE2BwgMWMqUydfC1LVtiArk0QtGkWEopzlqM9aJrKHfw5c6wKjFkmXDrbhwFockodtMGFLWpXy9JdiXN1ZDNszV4WSLQCGBKoQYHUyonqrHa4ErewAgMmcAAF7f2baIoVzC2p3gUvJtLcvIWqloy6/R04mIpLwDhciI8qLOB5yud44pHPLbA83hFDWPjNbuk9KnySN57Av+TMBvgEAgzzNhJb5K777rz37vvvVHRRxPDEF2/88cgnr/zyzDfv/PPQnxACACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIUCwcMpO84OT2HDbm8GHLQjnn6wE3g83SA3DB55G3llfHxnfnZ4gglvew6Gf4ySgmYGlpCJknochWiId3kJcZZyDn93i6KPl4eniopwq6SIoZKxhpenbhtHZRxhXisDopwPgHkGDxrLGgjLG8mC0gkFDwjX2AgJ0bXJ2djbgNJsAtbfCNB2oOnn6MmKbeXt226K1fMGi6j359D69ua+QZskjd+3cOvY9XNgp4ABCQNYEDBl7EIeCQkeMIDAseOCBwckiBSZ4ILGjh4B/40kaXIjSggMHmBcifHky5gYE6zM2OAlzGM6Z5rs+fIjTZ0tfcYMSlLCUJ8fL47kCVXmTjwPiKJkUCDnyqc3CxzQmYeAxAEGLGJYiwCDgAUT4sqdgOebArdw507IUNfuW71xdZ7DC5iuhGsKErf9CxhPYgUaEhPWyzfBMgUIJDPW6zhb5M1y+R5GjFkBaLmCM0dOfHqvztXYJnMejaFCBQlmVxAYsEGkYnQV4lqYMNyCtnYSggNekAC58uJxmTufW5w55mwKkg+nLp105uTC53a/nhg88fMTmDfDVl65Xum/IZt/3/zaag3a5W63nll1dvfiWbaaZLmpQIABCVQA2f9lAhTG112PQWYadXE9+FtmEwKWwQYQJrZagxomsOCAGVImInsSbpCBhhwug6KKcXXQQYUcYuDMggrASFmNzjjzzIrh7cUhhhHqONeGpSEW2QYxHsmjhxpgUGAKB16g4IIbMNCkXMlhaJ8GWVJo2I3NyKclYF1GxgyYDEAnXHJrMpNAm/rFBSczPiYAlwXF8ZnmesvoOdyMbx7m4o0S5LWdn4bex2Z4xYmEzaEb5EUcnxbA+WWglqIn6aHPTInCgVbdlZyMqMrIQHMRSiaBBakS1903p04w434n0loBoQFOt1yu2YAnY68RXiNsqh2s2qqxuyKb7Imtmgcrqsp6h8D/fMSpapldx55nwayK/SfqCQd2hcFdAgDp5GMvqhvakF4mZuS710WGIYy30khekRkMu92GNu6bo7r/ttjqwLaua5+HOdrKq5Cl3dcwi+xKiLBwwwom4b0E6xvuYyqOa8IAEghwQAV45VvovpkxBl2mo0W7AKbCZXoAhgMmWnOkEqx2JX5nUufbgJHpXCfMOGu2QAd8eitpW1eaNrNeMGN27mNz0swziYnpSbXN19gYtstzfXrdYjNHtAIYGFVwwAEvR1dfxdjKxVzAP0twAAW/ir2w3nzTd3W4yQWO3t0DfleB4XYnEHCEhffdKgaA29p0eo4fHLng9qoG+OVyXz0gMeWGY7qq3xhiRIEAwayNxBawxy777LTXbjsVXRSh++689+7778AHL/zwxBdv/PEnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLD4BlwHGg0ubBpuzdm9Dk9eCTu+MTZkDb4PXYbeIIcHHxqf4F3gnqGY2kOdQmCjHCGfpCSjHhmh2N+knmEkJmKg3uHfgaaeY2qn6t2i4t7sKAPbwIJD2VhXisDCQZgDrKDBQ8aGgjKyhvDlJMJyAjV1gjCunkP1NfVwpRtk93e2ZVt5NfCk27jD97f0LPP7/Dr4pTp1veLgvrx7AL+Q/BM25uBegoYkDCABYFhEobhkUBRwoMGEDJqXPDgQMUEFC9c1LjxQUUJICX/iMRIEgIDkycrjmzJMSXFlDNJvkwJsmdOjQwKfDz5M+PLoSGLQqgZU6XSoB/voHxawGbFlS2XGktAwKEADB0xiEWAodqGBRPSqp1wx5qCamDRrp2Qoa3bagLkzrULF4GCvHPTglRAmKxZvWsHayBcliDitHUlvGWM97FgCdYWVw4c2e/kw4HZJlCwmDBhwHPrjraGYTHqtaoxVKggoesKAgd2SX5rbUMFCxOAC8cGDwHFwBYWJCgu4XfwtcqZV0grPHj0u2SnqwU+IXph3rK5b1fOu7Bx5+K7L6/2/Xhg8uyXnQ8dvfRiDe7TwyfNuzlybKYpgIFtKhAgwEKkKcOf/wChZbBBgMucRh1so5XH3wbI1WXafRJy9iCErmX4IWHNaIAhZ6uxBxeGHXQA24P3yYfBBhmgSBozESpwongWOBhggn/N1aKG8a1YY2oVAklgCgQUUwGJ8iXAgItrWUARbwpqIOWEal0ZoYJbzmWlZCWSlsAC6VkwZonNbMAAl5cpg+NiZwpnJ0Xylegmlc+tWY1mjnGnZnB4QukMA9UJRxGOf5r4ppqDjjmnfKilh2ejGiyJAgF1XNmYbC2GmhZ5AcJVgajcXecNqM9Rx8B6bingnlotviqdkB3YCg+rtOaapFsUhSrsq6axJ6sEwoZK7I/HWpCsr57FBxJ1w8LqV/81zbkoXK3LfVeNpic0KRQG4NHoIW/XEmZuaiN6tti62/moWbk18uhjqerWS6GFpe2YVotskVssWfBOAHACrZHoWcGQwQhlvmsdXBZ/F9YLMF2jzUuYBP4a7CLCnoEHrgkDSCDAARUILAGaVVqAwQHR8pZXomm9/ONhgjrbgc2lyYxmpIRK9uSNjrXs8gEbTrYyl2ryTJmsLCdKkWzFQl1lWlOXGmifal6p9VnbQfpyY2SZyXKVV7JmZkMrgIFSyrIeUJ2r7YKnXdivUg1kAgdQ8B7IzJjGsd9zKSdwyBL03WpwDGxwuOASEP5vriO2F3nLjQdIrpaRDxqcBdgIHGA74pKrZXiR2ZWuZt49m+o3pKMC3p4Av7SNxBa456777rz37jsVXRQh/PDEF2/88cgnr/zyzDfv/PMnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLDUPAMHGi0weEpbN7wI8cxTzsGj4R+n+DUxwaBeBt7hH1/gYIPhox+Y3Z3iwmGk36BkIN8egOIl3h8hBuOkAaZhQlna4BrpnyWa4mleZOFjrGKcXoFA2ReKwMJBgISDw6abwUPGggazc0bBqG0G8kI1tcIwZp51djW2nC03d7BjG8J49jl4cgP3t/RetLp1+vT6O7v5fKhAvnk0UKFogeP3zmCCIoZkDCABQFhChQYuKBHgkUJkxpA2MhxQYEDFhNcvPBAI8eNCx7/gMQYckPJkxsZPLhIM8FLmDJrYiRp8mTKkCwT8IQJwSPQkENhpgQpEunNkzlpWkwKdSbGihKocowqVSvKWQkIOBSgQOYFDBgQpI0oYMGEt3AzTLKm4BqGtnDjirxW95vbvG/nWlub8G9euRsiqqWLF/AEkRoiprX2wLDeDQgkW9PQGLDgyNc665WguK8C0XAnRY6oGPUEuRLsgk5g+a3cCxUqSBC7gsCBBXcVq6swwULx4hayvctGPK8FCwsSLE9A3Hje6NOrHzeOnW695sffRi/9HfDz7sIVSNB+XXrmugo0rHcM3X388o6jr44ceb51uNjF1xcC8zk3wXiS8aYC/wESaLABBs7ch0ECjr2WAGvLsLZBeHqVFl9kGxooV0T81TVhBo6NiOEyJ4p4IYnNRBQiYCN6x4wCG3ZAY2If8jXjYRcyk2FmG/5nXAY8wqhWAii+1YGOSGLoY4VRfqiAgikwmIeS1gjAgHkWYLQZf9m49V9gDWYWY5nmTYCRM2TS5pxxb8IZGV5nhplmhJyZadxzbrpnZ2d/6rnZgHIid5xIMDaDgJfbLdrgMkKW+Rygz1kEZz1mehabkBpgiQIByVikwGTqVfDkk2/Vxxqiqur4X3fksHccre8xlxerDLiHjQIVUAgXr77yFeyuOvYqXGbMrbrqBMqaFpFFzhL7qv9i1FX7ZLR0LUNdcc4e6Cus263KbV+inkAAHhJg0BeITR6WmHcaxhvXg/AJiKO9R77ILF1FwmVdAu6WBu+ZFua72mkZWMfqBElKu0G8rFZ5n4ATp5jkmvsOq+Nj7u63ZMMPv4bveyYy6fDH+C6brgnACHBABQUrkGirz2FwAHnM4Mmhzq9yijOrOi/MKabH6VwBiYwZdukEQAvILKTWXVq0ZvH5/CfUM7M29Zetthp1eht0eqkFYw8IKXKA6mzXfTeH7fZg9zW0AhgY0TwthUa6Ch9dBeIsbsFrYkRBfgTfiG0FhwMWnbsoq3cABUYOnu/ejU/A6uNeT8u4wMb1WnBCyJJTLjjnr8o3OeJrUcpc5oCiPqAEkz8tXuLkPeDL3Uhs4fvvwAcv/PDEU9FFEcgnr/zyzDfv/PPQRy/99NRXf0IIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIWCw/AoDziOtCHt8BQ28PjmzK57Hom8fo42+P8DeAkbeYQcfX9+gYOFg4d1bIGEjQmPbICClI9/YwaLjHAJdJeKmZOViGtpn3qOqZineoeJgG8CeWUbBV4rAwkGAhIVGL97hGACGsrKCAgbBoTRhLvN1c3PepnU1s2/oZO6AtzdBoPf4eMI3tIJyOnF0YwFD+nY8e3z7+Xfefnj9uz8cVsXCh89axgk7BrAggAwBQsYIChwQILFixIeNIDAseOCBwcSXMy2sSPHjxJE/6a0eEGjSY4MQGK86PIlypUJEmYsaTKmyJ8JW/Ls6HMkzaEn8YwMWtPkx4pGd76E4DMPRqFTY860OGhogwYagBFoKEABA46DEGBAoEBB0AUT4sqdIFKBNbcC4M6dkEEk22oYFOTdG9fvWrtsBxM23MytYL17666t9phwXwlum2lIDHmuSA2IGyuOLOHv38qLMbdFjHruZbWgRXeOe1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+Rxl8e13rZxN+CEydtVsFkd+vDjE7C/q52wOvb4s7+faz025frbxefWbSoQIAEDEUCwgf9j7bUlwHN9ZVaegxDK1xYzFMJH24L5saXABhlYxiEzHoKoIV8LYqAMaw9aZqFmJUK4YHuNfRjiXhmk+NcyJgaIolvM8BhiBx3IleN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA=="),define("text!cockpit/ui/images/closer.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAj9JREFUeNp0ks+LUlEUx7/vV1o8Z8wUx3IEHcQmiBiQlomjRNCiZpEuEqF/oEUwq/6EhvoHggmRcJUQBM1CRJAW0aLIaGQimZJxJsWxyV/P9/R1zzWlFl04vPvOPZ9z7rnnK5imidmKRCIq+zxgdoPZ1T/ut8xeM3tcKpW6s1hhBkaj0Qj7bDebTX+324WmadxvsVigqipcLleN/d4rFoulORiLxTZY8ItOp8MBCpYkiYPj8Xjus9vtlORWoVB4KcTjcQc732dLpSRXvCZaAws6Q4WDdqsO52kNH+oCRFGEz+f7ydwBKRgMPmTXi49GI1x2D/DsznesB06ws2eDbI7w9HYN6bVjvGss4KAjwDAMq81mM2SW5Wa/3weBbz42UL9uYnVpiO2Nr9ANHSGXib2Wgm9tCYIggGKJEVkvlwgi5/FQRmTLxO6hgJVzI1x0T/fJrBtHJxPeL6tI/fsZLA6ot8lkQi8HRVbw94gkWYI5MaHrOjcCGSNRxZosy9y5cErDzn0Dqx7gcwO8WtBp4PndI35GMYqiUMUvBL5yOBz8yRfFNpbPmqgcCFh/IuHa1nR/YXGM8+oUpFhihEQiwcdRLpfVRqOBtWXWq34Gra6AXq8Hp2piZcmKT4cKnE4nwuHwdByVSmWQz+d32WCTlHG/qaHHREN9kgi0sYQfv0R4PB4EAgESQDKXy72fSy6VSnHJVatVf71eR7vd5n66mtfrRSgU4pLLZrOlf7RKK51Ok8g3/yPyR5lMZi7y3wIMAME4EigHWgKnAAAAAElFTkSuQmCC"),define("text!cockpit/ui/images/pinin.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZ0lEQVQ4Ea2TPUsDQRCGZ89Eo4FACkULEQs1CH4Uamfjn7GxEYJFIFXgChFsbPwzNnZioREkaiHBQtEiEEiMRm/dZ8OEGAxR4sBxx877Pju7M2estTJIxLrNuVwuMxQEx0ZkzcFHyRtjXt02559RtB2GYanTYzoryOfz+6l4Nbszf2niwffKmpGRo9sVW22mDgqFwp5C2gDMm+P32a3JB1N+n5JifUGeP9JeNxGryPLYjcwMP8rJ07Q9fZltQzyAstOJ2vVu5sKc1ZZkRBrOcKeb+HexPidvkpCN5JUcllZtpZFc5DgBWc5M2eysZuMuofMBSA4NWjx4PUCsXefMlI0QY3ewRg4NWi4ZTQsgrjYXema+e4VqtEMK6KXvu+4B9Bklt90vVKMeD2BI6DOt4rZ/Gk7WyKFBi4fNPIAJY0joM61SCCZ9tI1o0OIB8D+DBIkYaJRbCBH9mZgNt+bb++ufSSF/eX8BYcDeAzuQJVUAAAAASUVORK5CYII="),define("text!cockpit/ui/images/plus.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4yFTwuJTkAAAH7SURBVCjPdZKxa1NRFMZ/956XZMgFyyMlCZRA4hBx6lBcQ00GoYi4tEstFPwLAs7iLDi7FWuHThaUggihBDI5OWRoQAmBQFISQgvvpbwX3rsOaR4K+o2H8zvfOZxPWWtZqVarGaAJPAEe3ZW/A1+Bd+1221v1qhW4vb1dA44mk0nZ8zyCIAAgk8lgjGF9fb0PHF5cXLQTsF6vP/c879P19TVBEJDJZBARAKIoSmpra2sYY561Wq3PqtFouMBgMBgYay3ZbJZ/yfd9tNaUSqUboOKISPPq6sqsVvZ9H4AvL34B8PTj/QSO45jpdHovn883Ha31znw+JwzDpCEMQx4UloM8zyOdTif3zudztNY7jog8DMMQpRRxHPPt5TCBAEZvxlyOFTsfykRRBICIlB2t9a21Nh3HMXEc8+d7VhJHWCwWyzcohdZaHBHpO46z6fs+IsLj94XECaD4unCHL8FsNouI/HRE5Nx13c3ZbIbWOnG5HKtl+53TSq7rIiLnand31wUGnU7HjEYjlFLJZN/3yRnL1FMYY8jlcmxtbd0AFel2u7dnZ2eXxpi9xWJBEASkUimstYgIQSSkUimKxSKVSgVjzN7p6emPJHL7+/s14KjX65WHwyGz2SxZbWNjg2q12gcOT05O2n9lFeDg4MAAr/4T8rfHx8dJyH8DvvbYGzKvWukAAAAASUVORK5CYII="),define("text!cockpit/ui/images/minus.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4xMrIJw5EAAAHcSURBVCjPhZIxSxtxGMZ/976XhJA/RA5EAyJcFksnp64hjUPBoXRyCYLQTyD0UxScu0nFwalCQSgFCVk7dXAwUAiBDA2RO4W7yN1x9+9gcyhU+pteHt4H3pfncay1LOl0OgY4BN4Ar/7KP4BvwNFwOIyWu87S2O12O8DxfD73oygiSRIAarUaxhhWV1fHwMFgMBiWxl6v9y6Koi+3t7ckSUKtVkNVAcjzvNRWVlYwxry9vLz86uzs7HjAZDKZGGstjUaDfxHHMSLC5ubmHdB2VfVwNpuZ5clxHPMcRVFwc3PTXFtbO3RFZHexWJCmabnweAaoVqvlv4vFAhHZdVX1ZZqmOI5DURR8fz/lxbp9Yrz+7bD72SfPcwBU1XdF5N5aWy2KgqIoeBzPEnWVLMseYnAcRERdVR27rrsdxzGqyutP6898+GBsNBqo6i9XVS88z9sOggAR4X94noeqXoiIHPm+H9XrdYIgIAxDwjAkTVPCMESzBy3LMprNJr7v34nIkV5dXd2fn59fG2P2siwjSRIqlQrWWlSVJFcqlQqtVot2u40xZu/s7OxnWbl+v98BjkejkT+dTgmCoDxtY2ODra2tMXBweno6fNJVgP39fQN8eKbkH09OTsqS/wHFRdHPfTSfjwAAAABJRU5ErkJggg=="),define("text!cockpit/ui/images/dot_clear.gif",[],"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"),define("text!cockpit/ui/images/pins.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGYklEQVRIDbVWe0yURxCf/R735o6DO0FBe0RFsaL4iLXGIKa2SY3P6JGa2GpjlJjUV9NosbU++tYUbEnaQIrVaKJBG7WiNFQFUWO1UUEsVg2CAgoeHHLewcH32O58cBdQsX9Y5+7LfrszOzO/2ZnZj1BKgTBiIwVGVvKd49OVVYunDlXn6wdBKh+ogXrv+DOz1melIb+3LM5fNv2XPYE5EHY+L3PJljN5zavHpJjsQNsA/JJEgyC2+WTjy3b0GfoJW8O4aoHtDwiHQrj5lw1LLyyb1bp5zAjJTus9klrVpdD6TqH2ngVO+0dsRJnp06cLIYU4fx7NnRI3bu7UIYOeJ/McnuY88q3k62gc0S4Dgf5qhICQtIXS2lqD7BhSduPk3YfyzXaANhBBJDxYdUqCywB2qS4RdyUuSkTF/VJxcbH5j8N7/75RuFrN3Zh8OS8zqf5m4UpPeenOyP42dbtBeuvVnCdkK1e4PfPouX03mo9se+c33M8wqDk5Ofqed8REUTicQhbySUxp9u3KlMSHTtrFU6Kyn03lz15PPpW25vsZeYSIKyiVURcqeZJOH9lTNZLfnxRjU/uwrjbEUBWsapcSO2Hq4k0VfZg9EzxdDNCEjDxgNqRDme9umz/btwlsHRIEePHgAf73RdnHZ6LTuIUBN7OBQ+c1Fdnp6cZ1BQUdeRuWZi97o3ktDQQkVeFFzqJARd1A5a0Vr7ta6Kp6TZjtZ+NTIOoKF6qDrL7e0QQIUCiqMMKk8Z1Q/SCSKvzocf2B6NEN0SQn/kTO6fKJ0zqjZUlQBSpJ0GjR77w0aoc1Pr6S5/kVJrNpakV5hR+LWKN4t7sLX+p0rx2vqSta64olIulUKUgCSXLWE1R4KPPSj+5vhm2hdDOG+CkQBmhhyyKq6SaFYWTn5bB3QJRNz54AuXKn8TJjhu0Wbv+wNEKQjVhnmKopjo4FxXmetCRnC4F7BhCiCUepqAepRh0TM/gjjzOOSK2NgWZPc05qampRWJHb7dbOffep2ednzLzgczlbrQA6gHYF9BYDh9GY+FjddMweHMscmMuep07gXlMQoqw9ALoYu5MJsak9QmJA2IvAgVmoCRciooyPujJtNCv1uHt3TmK9gegFKrG9kh6oXwZiIEAtBIjORGKNTWR/WeW8XVkbjuJepLAyloM8LmTN//njKZPbraATZaLjCHEww9Ei4FFiPg6Ja5gT6gxYgLgnRDHRQwJXbz2GOw0d4A3K4GXlUtMahJjYVxiYbrwOmxIS10bFnIBOSi6Tl9Jgs0zbOEX18wyEwgLPMrxD1Y4aCK8kmTpgYcpAF27Mzs42Hjx4kA8BICUlJfKArR7LcEvTB1xEC9AoEw9OPagWkVU/D1oesmK6U911zEczMVe01oZjiMggg6ux2Qk379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/GPQcVDe0QYT0CIxGFvUorfvBxZsRfVrUuWruMBAb/lXCUofoFNZfzGJtowXOX0vwUSFK4BgyMKm6P6s9wQUZld+jrYyMDC0iIQDaJdG4IyZQfL3RfbFcCBIlRgc+u3CjaTApuZ9KsANgG8PNzHlWWD3tCxd6kafNNiFp5HAalAkkJ0SCV2H3CgOD9Nc/FqrXuyb0Eocvfhq171p5eyuJ1omKJEP5rQGe/FOOnXtq335z8YmvYo9cHb2t8spIb3lVSseZW46FlGY/Sk9P50P2w20UlWJUkUHIushfc5PXGAzCo0PlD2pnpCYfCXga3lu+fPlevEhWrVrFyrN/Orfv87FOW9tlqb2Kc9pV8DzioMk3UNUbXM+8B/ATBr8C8CKdvGXWGD/9sqm3dkxtzA4McMjHMB8D2ftheYXo+qzt3pXvz8/PP/vk+v8537V+yYW87Zu+RZ1ZbrexoKAA/SBpaWn4+aL5w5zGk+/jW59JiMkESW5urpiVlWXENRb1H/Yf2I9txIxz5IdkX3TsraukpsbQjz6090yb4XsAvQoRE0YvJdamtIIbOnRoUVlZ2ftsLVQzIdEXHntsaZdimssVfCpFui109+BnWPsXaWLI/zactygAAAAASUVORK5CYII="),define("text!cockpit/ui/images/pinout.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAACyUlEQVQ4EW1TXUgUURQ+Z3ZmnVV3QV2xJbVSEIowQbAfLQx8McLoYX2qjB58MRSkP3vZppceYhGxgrZaIughlYpE7CHFWiiKyj9II0qxWmwlNh1Xtp2f27mz7GDlZX7uuXO+73zfuXeQMQYIgAyALppgyBtse32stsw86txkHhATn+FbfPfzxnPB+vR3RMJYuTwW6bbB4a6WS5O3Yu2VlXIesDiAamiQNKVlVXfx5I0GJ7DY7p0/+erU4dgeMJIA31WNxZmAgibOreXDqF55sY4SFUURqbi+nkjgwTyAbHhLX8yOLsSM2QRA3JRAAgd4RGPbVhkKEp8qeJ7PFyW3fw++YHtC7CkaD0amqyqihSwlMQQ0wa07IjPVI/vbexreIUrVaQV2D4RMQ/o7m12Mdfx4H3PfB9FNzTR1U2cO0Bi45aV6xNvFBNaoIAfbSiwLlqi9/hR/R3Nrhua+Oqi9TEKiB02C7YXz+Pba4MTDrpbLiMAxNgmXb+HpwVkZdoIrkn9isW7nRw/TZYaagZArAWyhfqsSDL/c9aTx7JUjGZCtYExRqCzAwGblwr6aFQ84nTo6qZ7XCeCVQNckE/KSWolvoQnxeoFFgIh8G/nA+kBAxxuQO5m9eFrwLIGJHgcyM63VFMhRSgNVyJr7og8y1vbTQpH8DIEVgxuYuexw0QECIalq5FYgEmpkgoFYltU/lnrqDz5osirSFpF7lrHAFKSWHYfEs+mY/82UnAStyMlW8sUPsVIciTZgz3jV1ebg0CEOpgPF22s1z1YQYKSXPJ1hbAhR8T26WdLhkuVfAzPR+YO1Ox5n58SmCcF6e3uzAoHA77RkevJdWH/3+f2O9TGf3w3fWQ2Hw5F/13mcsWAT+vv6DK4kFApJ/d3d1k+kJtbCrmxXHS3n8ER6b3CQbAqaEHVra6sGxcXW4SovLx+empxapS//FfwD9kpMJjMMBBAAAAAASUVORK5CYII=") \ No newline at end of file diff --git a/websdk/static/js/ace/keybinding-emacs.js b/websdk/static/js/ace/keybinding-emacs.js deleted file mode 100644 index da4aa9d..0000000 --- a/websdk/static/js/ace/keybinding-emacs.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/keyboard/keybinding/emacs",["require","exports","module","ace/keyboard/state_handler"],function(a,b,c){var d=a("ace/keyboard/state_handler").StateHandler,e=a("ace/keyboard/state_handler").matchCharacterOnly,f={start:[{key:"ctrl-x",then:"c-x"},{regex:["(?:command-([0-9]*))*","(down|ctrl-n)"],exec:"golinedown",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(right|ctrl-f)"],exec:"gotoright",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(up|ctrl-p)"],exec:"golineup",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(left|ctrl-b)"],exec:"gotoleft",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{comment:"This binding matches all printable characters except numbers as long as they are no numbers and print them n times.",regex:["(?:command-([0-9]*))","([^0-9]+)*"],match:e,exec:"inserttext",params:[{name:"times",match:1,type:"number",defaultValue:"1"},{name:"text",match:2}]},{comment:"This binding matches numbers as long as there is no meta_number in the buffer.",regex:["(command-[0-9]*)*","([0-9]+)"],match:e,disallowMatches:[1],exec:"inserttext",params:[{name:"text",match:2,type:"text"}]},{regex:["command-([0-9]*)","(command-[0-9]|[0-9])"],comment:"Stops execution if the regex /meta_[0-9]+/ matches to avoid resetting the buffer."}],"c-x":[{key:"ctrl-g",then:"start"},{key:"ctrl-s",exec:"save",then:"start"}]};b.Emacs=new d(f)}),define("ace/keyboard/state_handler",["require","exports","module"],function(a,b,c){function e(a){this.keymapping=this.$buildKeymappingRegex(a)}var d=!1;e.prototype={$buildKeymappingRegex:function(a){for(state in a)this.$buildBindingsRegex(a[state]);return a},$buildBindingsRegex:function(a){a.forEach(function(a){a.key?a.key=new RegExp("^"+a.key+"$"):Array.isArray(a.regex)?(a.key=new RegExp("^"+a.regex[1]+"$"),a.regex=new RegExp(a.regex.join("")+"$")):a.regex&&(a.regex=new RegExp(a.regex+"$"))})},$composeBuffer:function(a,b,c){if(a.state==null||a.buffer==null)a.state="start",a.buffer="";var d=[];b&1&&d.push("ctrl"),b&8&&d.push("command"),b&2&&d.push("option"),b&4&&d.push("shift"),c&&d.push(c);var e=d.join("-"),f=a.buffer+e;b!=2&&(a.buffer=f);return{bufferToUse:f,symbolicName:e}},$find:function(a,b,c,e,f){var g={};this.keymapping[a.state].some(function(h){var i;if(h.key&&!h.key.test(c))return!1;if(h.regex&&!(i=h.regex.exec(b)))return!1;if(h.match&&!h.match(b,e,f,c))return!1;if(h.disallowMatches)for(var j=0;j"},{token:"keyword",regex:"(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},{token:function(c){return c=="this"?"variable.language":a.hasOwnProperty(c)?"keyword":b.hasOwnProperty(c)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.c_cppHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","pilot/oop","ace/mode/behaviour"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column}),m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}return!1}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}return!1}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return!1;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-clojure.js b/websdk/static/js/ace/mode-clojure.js deleted file mode 100644 index 91338d2..0000000 --- a/websdk/static/js/ace/mode-clojure.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/clojure",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/clojure_highlight_rules").ClojureHighlightRules,h=a("ace/mode/matching_parens_outdent").MatchingParensOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,";")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=d,f=this.$tokenizer.getLineTokens(b,a),g=f.tokens,h=f.state;if(g.length&&g[g.length-1].type=="comment")return d;if(a=="start"){var i=b.match(/[\(\[]/);i&&(d+=" "),i=b.match(/[\)]/),i&&(d="")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/clojure_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - -> -> ->> ->> .. / < < <= <= = == > > >= >= accessor aclone add-classpath add-watch agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq zero? zipmap ".split(" ")),b=e.arrayToMap("def do fn if let loop monitor-enter monitor-exit new quote recur set! throw try var".split(" ")),c=e.arrayToMap("true false nil".split(" "));this.$rules={start:[{token:"comment",regex:";.*$"},{token:"comment",regex:"^=begin$",next:"comment"},{token:"keyword",regex:"[\\(|\\)]"},{token:"keyword",regex:"[\\'\\(]"},{token:"keyword",regex:"[\\[|\\]]"},{token:"keyword",regex:"[\\{|\\}|\\#\\{|\\#\\}]"},{token:"keyword",regex:"[\\&]"},{token:"keyword",regex:"[\\#\\^\\{]"},{token:"keyword",regex:"[\\%]"},{token:"keyword",regex:"[@]"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]"},{token:function(d){return b.hasOwnProperty(d)?"keyword":c.hasOwnProperty(d)?"constant.language":a.hasOwnProperty(d)?"support.function":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"[:](?:[a-zA-Z]|d)+"},{token:"string.regexp",regex:'/#"(?:.|(\\")|[^""\n])*"/g'}],comment:[{token:"comment",regex:"^=end$",next:"start"},{token:"comment",regex:".+"}]}};d.inherits(g,f),b.ClojureHighlightRules=g}),define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\)/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\))/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingParensOutdent=e}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-coffee.js b/websdk/static/js/ace/mode-coffee.js deleted file mode 100644 index ca47332..0000000 --- a/websdk/static/js/ace/mode-coffee.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/coffee",["require","exports","module","ace/tokenizer","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/text","ace/worker/worker_client","pilot/oop"],function(a,b,c){function k(){this.$tokenizer=new d((new e).getRules()),this.$outdent=new f}var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/coffee_highlight_rules").CoffeeHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,g=a("ace/range").Range,h=a("ace/mode/text").Mode,i=a("ace/worker/worker_client").WorkerClient,j=a("pilot/oop");j.inherits(k,h),function(){var a=/(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/,b=/^(\s*)#/,c=/^\s*###(?!#)/,d=/^\s*/;this.getNextLineIndent=function(b,c,d){var e=this.$getIndent(c),f=this.$tokenizer.getLineTokens(c,b).tokens;(!f.length||f[f.length-1].type!=="comment")&&b==="start"&&a.test(c)&&(e+=d);return e},this.toggleCommentLines=function(a,e,f,h){console.log("toggle");var i=new g(0,0,0,0);for(var j=f;j<=h;++j){var k=e.getLine(j);if(c.test(k))continue;b.test(k)?k=k.replace(b,"$1"):k=k.replace(d,"$&#"),i.end.row=i.start.row=j,i.end.column=k.length+1,e.replace(i,k)}},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=a.getDocument(),c=new i(["ace","pilot"],"worker-coffee.js","ace/mode/coffee_worker","Worker");c.call("setValue",[b.getValue()]),b.on("change",function(a){a.range={start:a.data.range.start,end:a.data.range.end},c.emit("change",a)}),c.on("error",function(b){a.setAnnotations([b.data])}),c.on("ok",function(b){a.clearAnnotations()})}}.call(k.prototype),b.Mode=k}),define("ace/mode/coffee_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){function d(){var a="[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*",b="(?![$\\w]|\\s*:)",c={token:"string",regex:".+"};this.$rules={start:[{token:"identifier",regex:"(?:@|(?:\\.|::)\\s*)"+a},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof)|s(?:uper|witch)|return|b(?:reak|y)|c(?:ontinue|atch|lass)|i(?:n(?:stanceof)?|s(?:nt)?|f)|e(?:lse|xtends)|f(?:or (?:own)?|inally|unction)|wh(?:ile|en)|n(?:ew|ot?)|d(?:e(?:lete|bugger)|o)|loop|o(?:ff?|[rn])|un(?:less|til)|and|yes)"+b},{token:"constant.language",regex:"(?:true|false|null|undefined)"+b},{token:"invalid.illegal",regex:"(?:c(?:ase|onst)|default|function|v(?:ar|oid)|with|e(?:num|xport)|i(?:mplements|nterface)|let|p(?:ackage|r(?:ivate|otected)|ublic)|static|yield|__(?:hasProp|extends|slice|bind|indexOf))"+b},{token:"language.support.class",regex:"(?:Array|Boolean|Date|Function|Number|Object|R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|TypeError|URIError)"+b},{token:"language.support.function",regex:"(?:Math|JSON|is(?:NaN|Finite)|parse(?:Int|Float)|encodeURI(?:Component)?|decodeURI(?:Component)?)"+b},{token:"identifier",regex:a},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"},{token:"string",regex:"'''",next:"qdoc"},{token:"string",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string.regex",regex:"///",next:"heregex"},{token:"string.regex",regex:"/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"},{token:"comment",regex:"###(?!#)",next:"comment"},{token:"comment",regex:"#.*"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[\\]})]"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],qdoc:[{token:"string",regex:".*?'''",next:"start"},c],qqdoc:[{token:"string",regex:'.*?"""',next:"start"},c],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"start"},c],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"start"},c],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"start"},c],heregex:[{token:"string.regex",regex:".*?///[imgy]{0,4}",next:"start"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],comment:[{token:"comment",regex:".*?###",next:"start"},{token:"comment",regex:".+"}]}}a("pilot/oop").inherits(d,a("ace/mode/text_highlight_rules").TextHighlightRules),b.CoffeeHighlightRules=d}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","pilot/oop","pilot/event_emitter"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(b,c,d,e){this.callbacks=[];if(a.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=a.nameToUrl("ace/worker/worker",null,"_"),g=this.$worker=new Worker(h),i={};for(var j=0;j=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.CSharpHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","pilot/oop","ace/mode/behaviour"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column}),m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}return!1}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}return!1}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return!1;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-css.js b/websdk/static/js/ace/mode-css.js deleted file mode 100644 index c27ad88..0000000 --- a/websdk/static/js/ace/mode-css.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/css",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/css_highlight_rules").CssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/worker/worker_client").WorkerClient,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=a.getDocument(),c=new i(["ace","pilot"],"worker-css.js","ace/mode/css_worker","Worker");c.call("setValue",[b.getValue()]),b.on("change",function(a){a.range={start:a.data.range.start,end:a.data.range.end},c.emit("change",a)}),c.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)})}}.call(j.prototype),b.Mode=j}),define("ace/mode/css_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function g(a){var b=[],c=a.split("");for(var d=0;d=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"comment",regex:"^#!.*$"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.JavaScriptHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","pilot/oop","pilot/event_emitter"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(b,c,d,e){this.callbacks=[];if(a.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=a.nameToUrl("ace/worker/worker",null,"_"),g=this.$worker=new Worker(h),i={};for(var j=0;jf.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/css",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/css_highlight_rules").CssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/worker/worker_client").WorkerClient,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=a.getDocument(),c=new i(["ace","pilot"],"worker-css.js","ace/mode/css_worker","Worker");c.call("setValue",[b.getValue()]),b.on("change",function(a){a.range={start:a.data.range.start,end:a.data.range.end},c.emit("change",a)}),c.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)})}}.call(j.prototype),b.Mode=j}),define("ace/mode/css_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function g(a){var b=[],c=a.split("");for(var d=0;d"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],script:[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"}].concat(a("script")),css:[{token:"text",regex:">",next:"css-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"}].concat(a("style")),tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"}].concat(a("tag")),"style-qstring":b("'","style"),"style-qqstring":b('"',"style"),"script-qstring":b("'","script"),"script-qqstring":b('"',"script"),"tag-qstring":b("'","tag"),"tag-qqstring":b('"',"tag"),cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]},this.embedRules(f,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(e,"css-",[{token:"text",regex:"<\\/(?=style)",next:"tag"}])};d.inherits(h,g),b.HtmlHighlightRules=h}),define("ace/mode/behaviour/xml",["require","exports","module","pilot/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=a("ace/mode/behaviour/cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"comment",regex:"^#!.*$"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.JavaScriptHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","pilot/oop","pilot/event_emitter"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(b,c,d,e){this.callbacks=[];if(a.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=a.nameToUrl("ace/worker/worker",null,"_"),g=this.$worker=new Worker(h),i={};for(var j=0;jf.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/java_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules,h=function(){var a=e.arrayToMap("abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while".split("|")),b=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),c=e.arrayToMap("AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object".split("|")),d=e.arrayToMap("".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},(new f).getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"comment",regex:"\\/\\*\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(e){return e=="this"?"variable.language":a.hasOwnProperty(e)?"keyword":c.hasOwnProperty(e)?"support.function":d.hasOwnProperty(e)?"support.function":b.hasOwnProperty(e)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.JavaHighlightRules=h}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-javascript.js b/websdk/static/js/ace/mode-javascript.js deleted file mode 100644 index f365db4..0000000 --- a/websdk/static/js/ace/mode-javascript.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/javascript",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=a("ace/worker/worker_client").WorkerClient,k=a("ace/mode/behaviour/cstyle").CstyleBehaviour,l=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k};d.inherits(l,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=a.getDocument(),c=new j(["ace","pilot"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");c.call("setValue",[b.getValue()]),b.on("change",function(a){a.range={start:a.data.range.start,end:a.data.range.end},c.emit("change",a)}),c.on("jslint",function(b){var c=[];for(var d=0;d=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"comment",regex:"^#!.*$"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.JavaScriptHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","pilot/oop","pilot/event_emitter"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(b,c,d,e){this.callbacks=[];if(a.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=a.nameToUrl("ace/worker/worker",null,"_"),g=this.$worker=new Worker(h),i={};for(var j=0;jf.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-json.js b/websdk/static/js/ace/mode-json.js deleted file mode 100644 index b4561f6..0000000 --- a/websdk/static/js/ace/mode-json.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/json",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/json_highlight_rules").JsonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=a("ace/mode/behaviour/cstyle").CstyleBehaviour,k=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new j};d.inherits(k,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(k.prototype),b.Mode=k}),define("ace/mode/json_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){this.$rules={start:[{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}]}};d.inherits(g,f),b.JsonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","pilot/oop","ace/mode/behaviour"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column}),m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}return!1}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}return!1}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return!1;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-perl.js b/websdk/static/js/ace/mode-perl.js deleted file mode 100644 index 3ec8330..0000000 --- a/websdk/static/js/ace/mode-perl.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/perl",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/perl_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/perl_highlight_rules").PerlHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/perl_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars".split("|")),b=e.arrayToMap("ARGV|ENV|INC|SIG".split("|")),c=e.arrayToMap("getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|getpeername|setpriority|getprotoent|setprotoent|getpriority|endprotoent|getservent|setservent|endservent|sethostent|socketpair|getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|map|die|uc|lc|do".split("|"));this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0x[0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:function(d){return a.hasOwnProperty(d)?"keyword":b.hasOwnProperty(d)?"constant.language":c.hasOwnProperty(d)?"support.function":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]}};d.inherits(g,f),b.PerlHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-php.js b/websdk/static/js/ace/mode-php.js deleted file mode 100644 index 161648b..0000000 --- a/websdk/static/js/ace/mode-php.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/php",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/php_highlight_rules").PhpHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=a("ace/mode/behaviour/cstyle").CstyleBehaviour,k=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new j};d.inherits(k,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(k.prototype),b.Mode=k}),define("ace/mode/php_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules,h=function(){var a=e.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|zlib_get_coding_type".split("|")),b=e.arrayToMap("abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor".split("|")),c=e.arrayToMap("true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__".split("|")),d=e.arrayToMap("$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|")),g=e.arrayToMap([]);this.$rules={start:[{token:"support",regex:"<\\?(?:php|\\=)"},{token:"support",regex:"\\?>"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment",regex:"#.*$"},(new f).getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(e){if(b.hasOwnProperty(e))return"keyword";if(c.hasOwnProperty(e))return"constant.language";if(d.hasOwnProperty(e))return"variable.language";if(g.hasOwnProperty(e))return"invalid.illegal";if(a.hasOwnProperty(e))return"support.function";if(e=="debugger")return"invalid.deprecated";if(e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|self|parent)$/))return"variable";return"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.PhpHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","pilot/oop","ace/mode/behaviour"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column}),m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}return!1}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}return!1}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);if(g!=="")return{text:'"'+g+'"',selection:!1};var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column-1,h.column);if(j=="\\")return!1;var k=d.getTokens(f.start.row,f.start.row)[0].tokens,l=0,m,n=-1;for(var o=0;of.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-python.js b/websdk/static/js/ace/mode-python.js deleted file mode 100644 index 4c680fa..0000000 --- a/websdk/static/js/ace/mode-python.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-ruby.js b/websdk/static/js/ace/mode-ruby.js deleted file mode 100644 index 7b185e0..0000000 --- a/websdk/static/js/ace/mode-ruby.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/ruby",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/ruby_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|validates_inclusion_of|validates_numericality_of|validates_with|validates_each|authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|cache|expire_fragment|expire_cache_for|observe|cache_sweeper|has_many|has_one|belongs_to|has_and_belongs_to_many".split("|")),b=e.arrayToMap("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield".split("|")),c=e.arrayToMap("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING".split("|")),d=e.arrayToMap("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|$!|root_url|flash|session|cookies|params|request|response|logger".split("|"));this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment",regex:"^=begin$",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"},{token:"variable.instancce",regex:"@{1,2}(?:[a-zA-Z_]|d)+"},{token:"variable.class",regex:"[A-Z](?:[a-zA-Z_]|d)+"},{token:"string",regex:"[:](?:[a-zA-Z]|d)+"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(e){return e=="self"?"variable.language":b.hasOwnProperty(e)?"keyword":c.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"variable.language":a.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"^=end$",next:"start"},{token:"comment",regex:".+"}]}};d.inherits(g,f),b.RubyHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-scss.js b/websdk/static/js/ace/mode-scss.js deleted file mode 100644 index 49a9eb1..0000000 --- a/websdk/static/js/ace/mode-scss.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/scss",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/scss_highlight_rules").ScssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(i.prototype),b.Mode=i}),define("ace/mode/scss_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function i(a){var b=[],c=a.split("");for(var d=0;d|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]}};d.inherits(g,f),b.ScssHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}) \ No newline at end of file diff --git a/websdk/static/js/ace/mode-svg.js b/websdk/static/js/ace/mode-svg.js deleted file mode 100644 index 700e4bb..0000000 --- a/websdk/static/js/ace/mode-svg.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/svg",["require","exports","module","pilot/oop","ace/mode/text","ace/mode/javascript","ace/tokenizer","ace/mode/svg_highlight_rules","ace/mode/behaviour/xml"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/mode/javascript").Mode,g=a("ace/tokenizer").Tokenizer,h=a("ace/mode/svg_highlight_rules").SvgHighlightRules,i=a("ace/mode/behaviour/xml").XmlBehaviour,j=function(){this.highlighter=new h,this.$tokenizer=new g(this.highlighter.getRules()),this.$behaviour=new i,this.$embeds=this.highlighter.getEmbeds(),this.createModeDelegates({"js-":f})};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)},this.checkOutdent=function(a,b,c){return!1}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=a("ace/worker/worker_client").WorkerClient,k=a("ace/mode/behaviour/cstyle").CstyleBehaviour,l=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k};d.inherits(l,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=a.getDocument(),c=new j(["ace","pilot"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");c.call("setValue",[b.getValue()]),b.on("change",function(a){a.range={start:a.data.range.start,end:a.data.range.end},c.emit("change",a)}),c.on("jslint",function(b){var c=[];for(var d=0;d=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"comment",regex:"^#!.*$"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.embedRules(f,"doc-",[(new f).getEndRule("start")])};d.inherits(h,g),b.JavaScriptHighlightRules=h}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"\\s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},this.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/worker/worker_client",["require","exports","module","pilot/oop","pilot/event_emitter"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(b,c,d,e){this.callbacks=[];if(a.packaged)var f=this.$guessBasePath(),g=this.$worker=new Worker(f+c);else{var h=a.nameToUrl("ace/worker/worker",null,"_"),g=this.$worker=new Worker(h),i={};for(var j=0;jf.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/svg_highlight_rules",["require","exports","module","pilot/oop","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,f=a("ace/mode/xml_highlight_rules").XmlHighlightRules,g=function(){f.call(this),this.$rules.start.splice(3,0,{token:"text",regex:"<(?=s*script)",next:"script"}),this.$rules.script=[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],this.embedRules(e,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"}])};d.inherits(g,f),b.SvgHighlightRules=g}),define("ace/mode/xml_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:'["].*$',next:"qqstring"},{token:"string",regex:"'.*?'"},{token:"string",regex:"['].*$",next:"qstring"}],qstring:[{token:"string",regex:".*'",next:"tag"},{token:"string",regex:".+"}],qqstring:[{token:"string",regex:'.*"',next:"tag"},{token:"string",regex:".+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};d.inherits(f,e),b.XmlHighlightRules=f}),define("ace/mode/behaviour/xml",["require","exports","module","pilot/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=a("ace/mode/behaviour/cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k==""},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:'["].*$',next:"qqstring"},{token:"string",regex:"'.*?'"},{token:"string",regex:"['].*$",next:"qstring"}],qstring:[{token:"string",regex:".*'",next:"tag"},{token:"string",regex:".+"}],qqstring:[{token:"string",regex:'.*"',next:"tag"},{token:"string",regex:".+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};d.inherits(f,e),b.XmlHighlightRules=f}),define("ace/mode/behaviour/xml",["require","exports","module","pilot/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/behaviour").Behaviour,f=a("ace/mode/behaviour/cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="f.start.column)break;l+=k[o].value.length}if(!m||n<0&&m.type!=="comment"&&(m.type!=="string"||f.start.column!==m.value.length+l-1&&m.value.lastIndexOf('"')===m.value.length-1))return{text:'""',selection:[1,1]};if(m&&m.type==="string"){var p=i.substring(h.column,h.column+1);if(p=='"')return{text:"",selection:[1,1]}}}return!1}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=='"'){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return new Range(e.start.row,e.start.column,e.start.row,e.end.column+1)}return!1})};d.inherits(f,e),b.CstyleBehaviour=f}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-clouds.js b/websdk/static/js/ace/theme-clouds.js deleted file mode 100644 index c14d3cb..0000000 --- a/websdk/static/js/ace/theme-clouds.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/clouds",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-clouds .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds .ace_scroller {\n background-color: #FFFFFF;\n}\n\n.ace-clouds .ace_text-layer {\n cursor: text;\n color: #000000;\n}\n\n.ace-clouds .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-clouds .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-clouds .ace_marker-layer .ace_selection {\n background: #BDD5FC;\n}\n\n.ace-clouds .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds .ace_marker-layer .ace_active_line {\n background: #FFFBD1;\n}\n\n \n.ace-clouds .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds .ace_keyword {\n color:#AF956F;\n}\n\n.ace-clouds .ace_keyword.ace_operator {\n color:#484848;\n}\n\n.ace-clouds .ace_constant {\n \n}\n\n.ace-clouds .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds .ace_constant.ace_library {\n \n}\n\n.ace-clouds .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds .ace_invalid {\n background-color:#FF002A;\n}\n\n.ace-clouds .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds .ace_support {\n \n}\n\n.ace-clouds .ace_support.ace_function {\n color:#C52727;\n}\n\n.ace-clouds .ace_function.ace_buildin {\n \n}\n\n.ace-clouds .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds .ace_string.ace_regexp {\n \n}\n\n.ace-clouds .ace_comment {\n color:#BCC8BA;\n}\n\n.ace-clouds .ace_comment.ace_doc {\n \n}\n\n.ace-clouds .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds .ace_variable {\n \n}\n\n.ace-clouds .ace_variable.ace_language {\n \n}\n\n.ace-clouds .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-clouds_midnight.js b/websdk/static/js/ace/theme-clouds_midnight.js deleted file mode 100644 index 52137fb..0000000 --- a/websdk/static/js/ace/theme-clouds_midnight.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/clouds_midnight",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-clouds-midnight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds-midnight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds-midnight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds-midnight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds-midnight .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds-midnight .ace_scroller {\n background-color: #191919;\n}\n\n.ace-clouds-midnight .ace_text-layer {\n cursor: text;\n color: #929292;\n}\n\n.ace-clouds-midnight .ace_cursor {\n border-left: 2px solid #7DA5DC;\n}\n\n.ace-clouds-midnight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #7DA5DC;\n}\n \n.ace-clouds-midnight .ace_marker-layer .ace_selection {\n background: #000000;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_active_line {\n background: rgba(215, 215, 215, 0.031);\n}\n\n \n.ace-clouds-midnight .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_keyword {\n color:#927C5D;\n}\n\n.ace-clouds-midnight .ace_keyword.ace_operator {\n color:#4B4B4B;\n}\n\n.ace-clouds-midnight .ace_constant {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds-midnight .ace_constant.ace_library {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds-midnight .ace_invalid {\n color:#FFFFFF;\nbackground-color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds-midnight .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds-midnight .ace_support {\n \n}\n\n.ace-clouds-midnight .ace_support.ace_function {\n color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_function.ace_buildin {\n \n}\n\n.ace-clouds-midnight .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds-midnight .ace_string.ace_regexp {\n \n}\n\n.ace-clouds-midnight .ace_comment {\n color:#3C403B;\n}\n\n.ace-clouds-midnight .ace_comment.ace_doc {\n \n}\n\n.ace-clouds-midnight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds-midnight .ace_variable {\n \n}\n\n.ace-clouds-midnight .ace_variable.ace_language {\n \n}\n\n.ace-clouds-midnight .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds-midnight"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-cobalt.js b/websdk/static/js/ace/theme-cobalt.js deleted file mode 100644 index 51be7b2..0000000 --- a/websdk/static/js/ace/theme-cobalt.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/cobalt",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-cobalt .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-cobalt .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-cobalt .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-cobalt .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-cobalt .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-cobalt .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-cobalt .ace_scroller {\n background-color: #002240;\n}\n\n.ace-cobalt .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-cobalt .ace_marker-layer .ace_selection {\n background: rgba(179, 101, 57, 0.75);\n}\n\n.ace-cobalt .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-cobalt .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_marker-layer .ace_active_line {\n background: rgba(0, 0, 0, 0.35);\n}\n\n \n.ace-cobalt .ace_invisible {\n color: rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_keyword {\n color:#FF9D00;\n}\n\n.ace-cobalt .ace_keyword.ace_operator {\n \n}\n\n.ace-cobalt .ace_constant {\n color:#FF628C;\n}\n\n.ace-cobalt .ace_constant.ace_language {\n \n}\n\n.ace-cobalt .ace_constant.ace_library {\n \n}\n\n.ace-cobalt .ace_constant.ace_numeric {\n \n}\n\n.ace-cobalt .ace_invalid {\n color:#F8F8F8;\nbackground-color:#800F00;\n}\n\n.ace-cobalt .ace_invalid.ace_illegal {\n \n}\n\n.ace-cobalt .ace_invalid.ace_deprecated {\n \n}\n\n.ace-cobalt .ace_support {\n color:#80FFBB;\n}\n\n.ace-cobalt .ace_support.ace_function {\n color:#FFB054;\n}\n\n.ace-cobalt .ace_function.ace_buildin {\n \n}\n\n.ace-cobalt .ace_string {\n \n}\n\n.ace-cobalt .ace_string.ace_regexp {\n color:#80FFC2;\n}\n\n.ace-cobalt .ace_comment {\n font-style:italic;\ncolor:#0088FF;\n}\n\n.ace-cobalt .ace_comment.ace_doc {\n \n}\n\n.ace-cobalt .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-cobalt .ace_variable {\n color:#CCCCCC;\n}\n\n.ace-cobalt .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-cobalt .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-cobalt"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-dawn.js b/websdk/static/js/ace/theme-dawn.js deleted file mode 100644 index 3b98416..0000000 --- a/websdk/static/js/ace/theme-dawn.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/dawn",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-dawn .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-dawn .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-dawn .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-dawn .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-dawn .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-dawn .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-dawn .ace_scroller {\n background-color: #F9F9F9;\n}\n\n.ace-dawn .ace_text-layer {\n cursor: text;\n color: #080808;\n}\n\n.ace-dawn .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-dawn .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-dawn .ace_marker-layer .ace_selection {\n background: rgba(39, 95, 255, 0.30);\n}\n\n.ace-dawn .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-dawn .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_marker-layer .ace_active_line {\n background: rgba(36, 99, 180, 0.12);\n}\n\n \n.ace-dawn .ace_invisible {\n color: rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_keyword {\n color:#794938;\n}\n\n.ace-dawn .ace_keyword.ace_operator {\n \n}\n\n.ace-dawn .ace_constant {\n color:#811F24;\n}\n\n.ace-dawn .ace_constant.ace_language {\n \n}\n\n.ace-dawn .ace_constant.ace_library {\n \n}\n\n.ace-dawn .ace_constant.ace_numeric {\n \n}\n\n.ace-dawn .ace_invalid {\n \n}\n\n.ace-dawn .ace_invalid.ace_illegal {\n text-decoration:underline;\nfont-style:italic;\ncolor:#F8F8F8;\nbackground-color:#B52A1D;\n}\n\n.ace-dawn .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#B52A1D;\n}\n\n.ace-dawn .ace_support {\n color:#691C97;\n}\n\n.ace-dawn .ace_support.ace_function {\n color:#693A17;\n}\n\n.ace-dawn .ace_function.ace_buildin {\n \n}\n\n.ace-dawn .ace_string {\n color:#0B6125;\n}\n\n.ace-dawn .ace_string.ace_regexp {\n color:#CF5628;\n}\n\n.ace-dawn .ace_comment {\n font-style:italic;\ncolor:#5A525F;\n}\n\n.ace-dawn .ace_comment.ace_doc {\n \n}\n\n.ace-dawn .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-dawn .ace_variable {\n color:#234A97;\n}\n\n.ace-dawn .ace_variable.ace_language {\n \n}\n\n.ace-dawn .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-dawn"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-eclipse.js b/websdk/static/js/ace/theme-eclipse.js deleted file mode 100644 index e74e173..0000000 --- a/websdk/static/js/ace/theme-eclipse.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/eclipse",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 50px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-eclipse .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}";d.importCssString(e),b.cssClass="ace-eclipse"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-idle_fingers.js b/websdk/static/js/ace/theme-idle_fingers.js deleted file mode 100644 index 40c7b95..0000000 --- a/websdk/static/js/ace/theme-idle_fingers.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/idle_fingers",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-idle-fingers .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-idle-fingers .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-idle-fingers .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-idle-fingers .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-idle-fingers .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-idle-fingers .ace_scroller {\n background-color: #323232;\n}\n\n.ace-idle-fingers .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-idle-fingers .ace_cursor {\n border-left: 2px solid #91FF00;\n}\n\n.ace-idle-fingers .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #91FF00;\n}\n \n.ace-idle-fingers .ace_marker-layer .ace_selection {\n background: rgba(90, 100, 126, 0.88);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #404040;\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_active_line {\n background: #353637;\n}\n\n \n.ace-idle-fingers .ace_invisible {\n color: #404040;\n}\n\n.ace-idle-fingers .ace_keyword {\n color:#CC7833;\n}\n\n.ace-idle-fingers .ace_keyword.ace_operator {\n \n}\n\n.ace-idle-fingers .ace_constant {\n color:#6C99BB;\n}\n\n.ace-idle-fingers .ace_constant.ace_language {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_library {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_numeric {\n \n}\n\n.ace-idle-fingers .ace_invalid {\n color:#FFFFFF;\nbackground-color:#FF0000;\n}\n\n.ace-idle-fingers .ace_invalid.ace_illegal {\n \n}\n\n.ace-idle-fingers .ace_invalid.ace_deprecated {\n \n}\n\n.ace-idle-fingers .ace_support {\n \n}\n\n.ace-idle-fingers .ace_support.ace_function {\n color:#B83426;\n}\n\n.ace-idle-fingers .ace_function.ace_buildin {\n \n}\n\n.ace-idle-fingers .ace_string {\n color:#A5C261;\n}\n\n.ace-idle-fingers .ace_string.ace_regexp {\n color:#CCCC33;\n}\n\n.ace-idle-fingers .ace_comment {\n font-style:italic;\ncolor:#BC9458;\n}\n\n.ace-idle-fingers .ace_comment.ace_doc {\n \n}\n\n.ace-idle-fingers .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-idle-fingers .ace_variable {\n \n}\n\n.ace-idle-fingers .ace_variable.ace_language {\n \n}\n\n.ace-idle-fingers .ace_xml_pe {\n \n}\n\n.ace-idle-fingers .ace_collab.ace_user1 {\n color:#323232;\nbackground-color:#FFF980; \n}";d.importCssString(e),b.cssClass="ace-idle-fingers"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-kr_theme.js b/websdk/static/js/ace/theme-kr_theme.js deleted file mode 100644 index 2fac8ba..0000000 --- a/websdk/static/js/ace/theme-kr_theme.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/kr_theme",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-kr-theme .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-kr-theme .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-kr-theme .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-kr-theme .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-kr-theme .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-kr-theme .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-kr-theme .ace_scroller {\n background-color: #0B0A09;\n}\n\n.ace-kr-theme .ace_text-layer {\n cursor: text;\n color: #FCFFE0;\n}\n\n.ace-kr-theme .ace_cursor {\n border-left: 2px solid #FF9900;\n}\n\n.ace-kr-theme .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FF9900;\n}\n \n.ace-kr-theme .ace_marker-layer .ace_selection {\n background: rgba(170, 0, 255, 0.45);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_active_line {\n background: #38403D;\n}\n\n \n.ace-kr-theme .ace_invisible {\n color: rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_keyword {\n color:#949C8B;\n}\n\n.ace-kr-theme .ace_keyword.ace_operator {\n \n}\n\n.ace-kr-theme .ace_constant {\n color:rgba(210, 117, 24, 0.76);\n}\n\n.ace-kr-theme .ace_constant.ace_language {\n \n}\n\n.ace-kr-theme .ace_constant.ace_library {\n \n}\n\n.ace-kr-theme .ace_constant.ace_numeric {\n \n}\n\n.ace-kr-theme .ace_invalid {\n color:#F8F8F8;\nbackground-color:#A41300;\n}\n\n.ace-kr-theme .ace_invalid.ace_illegal {\n \n}\n\n.ace-kr-theme .ace_invalid.ace_deprecated {\n \n}\n\n.ace-kr-theme .ace_support {\n color:#9FC28A;\n}\n\n.ace-kr-theme .ace_support.ace_function {\n color:#85873A;\n}\n\n.ace-kr-theme .ace_function.ace_buildin {\n \n}\n\n.ace-kr-theme .ace_string {\n \n}\n\n.ace-kr-theme .ace_string.ace_regexp {\n color:rgba(125, 255, 192, 0.65);\n}\n\n.ace-kr-theme .ace_comment {\n font-style:italic;\ncolor:#706D5B;\n}\n\n.ace-kr-theme .ace_comment.ace_doc {\n \n}\n\n.ace-kr-theme .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-kr-theme .ace_variable {\n color:#D1A796;\n}\n\n.ace-kr-theme .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-kr-theme .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-kr-theme"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-merbivore.js b/websdk/static/js/ace/theme-merbivore.js deleted file mode 100644 index 407e6f6..0000000 --- a/websdk/static/js/ace/theme-merbivore.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/merbivore",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-merbivore .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-merbivore .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-merbivore .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-merbivore .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-merbivore .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-merbivore .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-merbivore .ace_scroller {\n background-color: #161616;\n}\n\n.ace-merbivore .ace_text-layer {\n cursor: text;\n color: #E6E1DC;\n}\n\n.ace-merbivore .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-merbivore .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-merbivore .ace_marker-layer .ace_selection {\n background: #454545;\n}\n\n.ace-merbivore .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-merbivore .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #FCE94F;\n}\n\n.ace-merbivore .ace_marker-layer .ace_active_line {\n background: #333435;\n}\n\n \n.ace-merbivore .ace_invisible {\n color: #404040;\n}\n\n.ace-merbivore .ace_keyword {\n color:#FC6F09;\n}\n\n.ace-merbivore .ace_keyword.ace_operator {\n \n}\n\n.ace-merbivore .ace_constant {\n color:#1EDAFB;\n}\n\n.ace-merbivore .ace_constant.ace_language {\n color:#FDC251;\n}\n\n.ace-merbivore .ace_constant.ace_library {\n color:#8DFF0A;\n}\n\n.ace-merbivore .ace_constant.ace_numeric {\n color:#58C554;\n}\n\n.ace-merbivore .ace_invalid {\n color:#FFFFFF;\n background-color:#990000;\n}\n\n.ace-merbivore .ace_invalid.ace_illegal {\n \n}\n\n.ace-merbivore .ace_invalid.ace_deprecated {\n color:#FFFFFF;\n background-color:#990000;\n}\n\n.ace-merbivore .ace_support {\n \n}\n\n.ace-merbivore .ace_support.ace_function {\n color:#FC6F09;\n}\n\n.ace-merbivore .ace_function.ace_buildin {\n \n}\n\n.ace-merbivore .ace_string {\n color:#8DFF0A;\n}\n\n.ace-merbivore .ace_string.ace_regexp {\n \n}\n\n.ace-merbivore .ace_comment {\n color:#AD2EA4;\n}\n\n.ace-merbivore .ace_comment.ace_doc {\n \n}\n\n.ace-merbivore .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-merbivore .ace_variable {\n \n}\n\n.ace-merbivore .ace_variable.ace_language {\n \n}\n\n.ace-merbivore .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-merbivore"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-merbivore_soft.js b/websdk/static/js/ace/theme-merbivore_soft.js deleted file mode 100644 index 5be28c5..0000000 --- a/websdk/static/js/ace/theme-merbivore_soft.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/merbivore_soft",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-merbivore-soft .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-merbivore-soft .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-merbivore-soft .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-merbivore-soft .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-merbivore-soft .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-merbivore-soft .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-merbivore-soft .ace_scroller {\n background-color: #1C1C1C;\n}\n\n.ace-merbivore-soft .ace_text-layer {\n cursor: text;\n color: #E6E1DC;\n}\n\n.ace-merbivore-soft .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-merbivore-soft .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-merbivore-soft .ace_marker-layer .ace_selection {\n background: #494949;\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #FCE94F;\n}\n\n.ace-merbivore-soft .ace_marker-layer .ace_active_line {\n background: #333435;\n}\n\n \n.ace-merbivore-soft .ace_invisible {\n color: #404040;\n}\n\n.ace-merbivore-soft .ace_keyword {\n color:#FC803A;\n}\n\n.ace-merbivore-soft .ace_keyword.ace_operator {\n \n}\n\n.ace-merbivore-soft .ace_constant {\n color:#68C1D8;\n}\n\n.ace-merbivore-soft .ace_constant.ace_language {\n color:#E1C582;\n}\n\n.ace-merbivore-soft .ace_constant.ace_library {\n color:#8EC65F;\n}\n\n.ace-merbivore-soft .ace_constant.ace_numeric {\n color:#7FC578;\n}\n\n.ace-merbivore-soft .ace_invalid {\n color:#FFFFFF;\n background-color:#FE3838;\n}\n\n.ace-merbivore-soft .ace_invalid.ace_illegal {\n \n}\n\n.ace-merbivore-soft .ace_invalid.ace_deprecated {\n color:#FFFFFF;\n background-color:#FE3838;\n}\n\n.ace-merbivore-soft .ace_support {\n \n}\n\n.ace-merbivore-soft .ace_support.ace_function {\n color:#FC803A;\n}\n\n.ace-merbivore-soft .ace_function.ace_buildin {\n \n}\n\n.ace-merbivore-soft .ace_string {\n color:#8EC65F;\n}\n\n.ace-merbivore-soft .ace_string.ace_regexp {\n \n}\n\n.ace-merbivore-soft .ace_comment {\n color:#AC4BB8;\n}\n\n.ace-merbivore-soft .ace_comment.ace_doc {\n \n}\n\n.ace-merbivore-soft .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-merbivore-soft .ace_variable {\n \n}\n\n.ace-merbivore-soft .ace_variable.ace_language {\n \n}\n\n.ace-merbivore-soft .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-merbivore-soft"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-mono_industrial.js b/websdk/static/js/ace/theme-mono_industrial.js deleted file mode 100644 index 354de6b..0000000 --- a/websdk/static/js/ace/theme-mono_industrial.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/mono_industrial",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-mono-industrial .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-mono-industrial .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-mono-industrial .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-mono-industrial .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-mono-industrial .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-mono-industrial .ace_scroller {\n background-color: #222C28;\n}\n\n.ace-mono-industrial .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-mono-industrial .ace_marker-layer .ace_selection {\n background: rgba(145, 153, 148, 0.40);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_active_line {\n background: rgba(12, 13, 12, 0.25);\n}\n\n \n.ace-mono-industrial .ace_invisible {\n color: rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_keyword {\n color:#A39E64;\n}\n\n.ace-mono-industrial .ace_keyword.ace_operator {\n color:#A8B3AB;\n}\n\n.ace-mono-industrial .ace_constant {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_constant.ace_language {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_library {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_numeric {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_invalid {\n color:#FFFFFF;\nbackground-color:rgba(153, 0, 0, 0.68);\n}\n\n.ace-mono-industrial .ace_invalid.ace_illegal {\n \n}\n\n.ace-mono-industrial .ace_invalid.ace_deprecated {\n \n}\n\n.ace-mono-industrial .ace_support {\n \n}\n\n.ace-mono-industrial .ace_support.ace_function {\n color:#588E60;\n}\n\n.ace-mono-industrial .ace_function.ace_buildin {\n \n}\n\n.ace-mono-industrial .ace_string {\n \n}\n\n.ace-mono-industrial .ace_string.ace_regexp {\n \n}\n\n.ace-mono-industrial .ace_comment {\n color:#666C68;\nbackground-color:#151C19;\n}\n\n.ace-mono-industrial .ace_comment.ace_doc {\n \n}\n\n.ace-mono-industrial .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-mono-industrial .ace_variable {\n \n}\n\n.ace-mono-industrial .ace_variable.ace_language {\n color:#648BD2;\n}\n\n.ace-mono-industrial .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-mono-industrial"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-monokai.js b/websdk/static/js/ace/theme-monokai.js deleted file mode 100644 index 398195f..0000000 --- a/websdk/static/js/ace/theme-monokai.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/monokai",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-monokai .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-monokai .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-monokai .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-monokai .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-monokai .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-monokai .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-monokai .ace_scroller {\n background-color: #272822;\n}\n\n.ace-monokai .ace_text-layer {\n cursor: text;\n color: #F8F8F2;\n}\n\n.ace-monokai .ace_cursor {\n border-left: 2px solid #F8F8F0;\n}\n\n.ace-monokai .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #F8F8F0;\n}\n \n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_active_line {\n background: #49483E;\n}\n\n \n.ace-monokai .ace_invisible {\n color: #49483E;\n}\n\n.ace-monokai .ace_keyword {\n color:#F92672;\n}\n\n.ace-monokai .ace_keyword.ace_operator {\n \n}\n\n.ace-monokai .ace_constant {\n \n}\n\n.ace-monokai .ace_constant.ace_language {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_constant.ace_library {\n \n}\n\n.ace-monokai .ace_constant.ace_numeric {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_invalid {\n color:#F8F8F0;\nbackground-color:#F92672;\n}\n\n.ace-monokai .ace_invalid.ace_illegal {\n \n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color:#F8F8F0;\nbackground-color:#AE81FF;\n}\n\n.ace-monokai .ace_support {\n \n}\n\n.ace-monokai .ace_support.ace_function {\n color:#66D9EF;\n}\n\n.ace-monokai .ace_function.ace_buildin {\n \n}\n\n.ace-monokai .ace_string {\n color:#E6DB74;\n}\n\n.ace-monokai .ace_string.ace_regexp {\n \n}\n\n.ace-monokai .ace_comment {\n color:#75715E;\n}\n\n.ace-monokai .ace_comment.ace_doc {\n \n}\n\n.ace-monokai .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-monokai .ace_variable {\n \n}\n\n.ace-monokai .ace_variable.ace_language {\n \n}\n\n.ace-monokai .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-monokai"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-pastel_on_dark.js b/websdk/static/js/ace/theme-pastel_on_dark.js deleted file mode 100644 index 79cdb10..0000000 --- a/websdk/static/js/ace/theme-pastel_on_dark.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/pastel_on_dark",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-pastel-on-dark .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-pastel-on-dark .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-pastel-on-dark .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-pastel-on-dark .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-pastel-on-dark .ace_scroller {\n background-color: #2c2828;\n}\n\n.ace-pastel-on-dark .ace_text-layer {\n cursor: text;\n color: #8f938f;\n}\n\n.ace-pastel-on-dark .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-pastel-on-dark .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-pastel-on-dark .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-pastel-on-dark .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_keyword {\n color:#757ad8;\n}\n\n.ace-pastel-on-dark .ace_keyword.ace_operator {\n color:#797878;\n}\n\n.ace-pastel-on-dark .ace_constant {\n color:#4fb7c5;\n}\n\n.ace-pastel-on-dark .ace_constant.ace_language {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_library {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_numeric {\n \n}\n\n.ace-pastel-on-dark .ace_invalid {\n \n}\n\n.ace-pastel-on-dark .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-pastel-on-dark .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-pastel-on-dark .ace_support {\n color:#9a9a9a;\n}\n\n.ace-pastel-on-dark .ace_support.ace_function {\n color:#aeb2f8;\n}\n\n.ace-pastel-on-dark .ace_function.ace_buildin {\n \n}\n\n.ace-pastel-on-dark .ace_string {\n color:#66a968;\n}\n\n.ace-pastel-on-dark .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-pastel-on-dark .ace_comment {\n color:#656865;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_variable {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_variable.ace_language {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-pastel-on-dark"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-twilight.js b/websdk/static/js/ace/theme-twilight.js deleted file mode 100644 index 4072462..0000000 --- a/websdk/static/js/ace/theme-twilight.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/twilight",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-twilight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-twilight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-twilight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-twilight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-twilight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-twilight .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-twilight .ace_scroller {\n background-color: #141414;\n}\n\n.ace-twilight .ace_text-layer {\n cursor: text;\n color: #F8F8F8;\n}\n\n.ace-twilight .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-twilight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_keyword {\n color:#CDA869;\n}\n\n.ace-twilight .ace_keyword.ace_operator {\n \n}\n\n.ace-twilight .ace_constant {\n color:#CF6A4C;\n}\n\n.ace-twilight .ace_constant.ace_language {\n \n}\n\n.ace-twilight .ace_constant.ace_library {\n \n}\n\n.ace-twilight .ace_constant.ace_numeric {\n \n}\n\n.ace-twilight .ace_invalid {\n \n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-twilight .ace_support {\n color:#9B859D;\n}\n\n.ace-twilight .ace_support.ace_function {\n color:#DAD085;\n}\n\n.ace-twilight .ace_function.ace_buildin {\n \n}\n\n.ace-twilight .ace_string {\n color:#8F9D6A;\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-twilight .ace_comment {\n font-style:italic;\ncolor:#5F5A60;\n}\n\n.ace-twilight .ace_comment.ace_doc {\n \n}\n\n.ace-twilight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-twilight .ace_variable {\n color:#7587A6;\n}\n\n.ace-twilight .ace_variable.ace_language {\n \n}\n\n.ace-twilight .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-twilight"}) \ No newline at end of file diff --git a/websdk/static/js/ace/theme-vibrant_ink.js b/websdk/static/js/ace/theme-vibrant_ink.js deleted file mode 100644 index ed6ae9e..0000000 --- a/websdk/static/js/ace/theme-vibrant_ink.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/theme/vibrant_ink",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-vibrant-ink .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-vibrant-ink .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-vibrant-ink .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-vibrant-ink .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-vibrant-ink .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-vibrant-ink .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-vibrant-ink .ace_scroller {\n background-color: #0F0F0F;\n}\n\n.ace-vibrant-ink .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-vibrant-ink .ace_marker-layer .ace_selection {\n background: #6699CC;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #99CC99;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_active_line {\n background: #333333;\n}\n\n \n.ace-vibrant-ink .ace_invisible {\n color: #404040;\n}\n\n.ace-vibrant-ink .ace_keyword {\n color:#FF6600;\n}\n\n.ace-vibrant-ink .ace_keyword.ace_operator {\n \n}\n\n.ace-vibrant-ink .ace_constant {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_language {\n color:#339999;\n}\n\n.ace-vibrant-ink .ace_constant.ace_library {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_numeric {\n color:#99CC99;\n}\n\n.ace-vibrant-ink .ace_invalid {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_invalid.ace_illegal {\n \n}\n\n.ace-vibrant-ink .ace_invalid.ace_deprecated {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_support {\n \n}\n\n.ace-vibrant-ink .ace_support.ace_function {\n color:#FFCC00;\n}\n\n.ace-vibrant-ink .ace_function.ace_buildin {\n \n}\n\n.ace-vibrant-ink .ace_string {\n color:#66FF00;\n}\n\n.ace-vibrant-ink .ace_string.ace_regexp {\n \n}\n\n.ace-vibrant-ink .ace_comment {\n color:#9933CC;\n}\n\n.ace-vibrant-ink .ace_comment.ace_doc {\n \n}\n\n.ace-vibrant-ink .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-vibrant-ink .ace_variable {\n \n}\n\n.ace-vibrant-ink .ace_variable.ace_language {\n \n}\n\n.ace-vibrant-ink .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-vibrant-ink"}) \ No newline at end of file diff --git a/websdk/static/js/ace/worker-coffee.js b/websdk/static/js/ace/worker-coffee.js deleted file mode 100644 index 1ffa65f..0000000 --- a/websdk/static/js/ace/worker-coffee.js +++ /dev/null @@ -1 +0,0 @@ -function initSender(){var a=require("pilot/event_emitter").EventEmitter,b=require("pilot/oop"),c=function(){};(function(){b.implement(this,a),this.callback=function(a,b){postMessage({type:"call",id:b,data:a})},this.emit=function(a,b){postMessage({type:"event",name:a,data:b})}}).call(c.prototype);return new c}function initBaseUrls(a){require.tlns=a}var console={log:function(a){postMessage({type:"log",data:a})}},window={console:console},require=function(a){var b=require.modules[a];if(b){b.initialized||(b.exports=b.factory().exports,b.initialized=!0);return b.exports}var c=a.split("/");c[0]=require.tlns[c[0]]||c[0],path=c.join("/")+".js",require.id=a,importScripts(path);return require(a)};require.modules={},require.tlns={};var define=function(a,b,c){arguments.length==2?c=b:arguments.length==1&&(c=a,a=require.id);a.indexOf("text/")!==0&&(require.modules[a]={factory:function(){var a={exports:{}},b=c(require,a.exports,a);b&&(a.exports=b);return a}})},main,sender;onmessage=function(a){var b=a.data;if(b.command)main[b.command].apply(main,b.args);else if(b.init){initBaseUrls(b.tlns),require("pilot/fixoldbrowsers"),sender=initSender();var c=require(b.module)[b.classname];main=new c(sender)}else b.event&&sender&&sender._dispatchEvent(b.event,b.data)},define("pilot/fixoldbrowsers",["require","exports","module"],function(a,b,c){if(!Function.prototype.bind){var d=Array.prototype.slice;Function.prototype.bind=function(b){var c=this;if(typeof c.apply!="function"||typeof c.call!="function")return new TypeError;var e=d.call(arguments),f=function a(){if(this instanceof a){var b=Object.create(c.prototype);c.apply(b,e.concat(d.call(arguments)));return b}return c.call.apply(c,e.concat(d.call(arguments)))};f.length=typeof c=="function"?Math.max(c.length-e.length,0):0;return f}}var e=Function.prototype.call,f=Array.prototype,g=Object.prototype,h=e.bind(g.hasOwnProperty),i,j,k,l,m;if(m=h(g,"__defineGetter__"))i=e.bind(g.__defineGetter__),j=e.bind(g.__defineSetter__),k=e.bind(g.__lookupGetter__),l=e.bind(g.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return Object.prototype.toString.call(b)==="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b,c){var d=+this.length;for(var e=0;e=2)var e=arguments[1];else do{if(d in this){e=this[d++];break}if(++d>=c)throw new TypeError}while(!0);for(;d=2)var e=arguments[1];else do{if(d in this){e=this[d--];break}if(--d<0)throw new TypeError}while(!0);for(;d>=0;d--)d in this&&(e=b.call(null,e,this[d],d,this));return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=this.length;if(!c)return-1;var d=arguments[1]||0;if(d>=c)return-1;d<0&&(d+=c);for(;d=0;d--){if(!h(this,d))continue;if(b===this[d])return d}return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||b.constructor.prototype});if(!Object.getOwnPropertyDescriptor){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(n+b);if(!h(b,c))return undefined;var d,e,f;d={enumerable:!0,configurable:!0};if(m){var i=b.__proto__;b.__proto__=g;var e=k(b,c),f=l(b,c);b.__proto__=i;if(e||f){e&&(descriptor.get=e),f&&(descriptor.set=f);return descriptor}}descriptor.value=b[c];return descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={"__proto__":null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}typeof c!="undefined"&&Object.defineProperties(d,c);return d});if(!Object.defineProperty){var o="Property description must be an object: ",p="Object.defineProperty called on non-object: ",q="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function")throw new TypeError(p+b);if(typeof b!="object"||b===null)throw new TypeError(o+d);if(h(d,"value"))if(m&&(k(b,c)||l(b,c))){var e=b.__proto__;b.__proto__=g,delete b[c],b[c]=d.value,b.prototype}else b[c]=d.value;else{if(!m)throw new TypeError(q);h(d,"get")&&i(b,c,d.get),h(d,"set")&&j(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)h(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(r){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){return!0});if(!Object.keys){var s=!0,t=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=t.length;for(var v in{toString:null})s=!1;Object.keys=function a(b){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError("Object.keys called on a non-object");var a=[];for(var c in b)h(b,c)&&a.push(c);if(s)for(var d=0,e=u;d=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;k.constructor=b;return k}return a.apply(this,arguments)},c=new RegExp("^(?:((?:[+-]\\d\\d)?\\d\\d\\d\\d)(?:-(\\d\\d)(?:-(\\d\\d))?)?)?(?:T(\\d\\d):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?)?(?:Z|([+-])(\\d\\d):(\\d\\d))?$");for(var d in a)b[d]=a[d];b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();var f=e[0]===undefined;for(var g=0;g<10;g++){if(g===7)continue;e[g]=+(e[g]||(g<3?1:0)),g===1&&e[g]--}if(f)return((e[3]*60+e[4])*60+e[5])*1e3+e[6];var h=(e[8]*60+e[9])*60*1e3;e[6]==="-"&&(h=-h);return a.UTC.apply(this,e.slice(0,7))+h}return a.parse.apply(this,arguments)};return b}(Date));if(!String.prototype.trim){var w=/^\s\s*/,x=/\s\s*$/;String.prototype.trim=function(){return String(this).replace(w,"").replace(x,"")}}}),define("pilot/event_emitter",["require","exports","module"],function(a,b,c){var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!!c&&!!c.length){var b=b||{};b.type=a;for(var d=0;d=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length);return a},this.insert=function(a,b){if(b.length==0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];this._dispatchEvent("changeStart"),a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),this._dispatchEvent("changeEnd");return a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c),this._dispatchEvent("changeStart");var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:d}),this._dispatchEvent("changeEnd");return c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;this._dispatchEvent("changeStart");if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);this._dispatchEvent("changeEnd");return a.start},this.removeInLine=function(a,b,c){if(b!=c){var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this._dispatchEvent("changeStart"),this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};this._dispatchEvent("change",{data:i}),this._dispatchEvent("changeEnd");return d.start}},this.removeLines=function(a,b){this._dispatchEvent("changeStart");var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this._dispatchEvent("changeStart"),this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:g}),this._dispatchEvent("changeEnd")},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this._dispatchEvent("changeStart"),this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;this._dispatchEvent("changeEnd");return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),define("ace/range",["require","exports","module"],function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;b=this.compare(c.row,c.column);if(b==1){b=this.compare(d.row,d.column);return b==1?2:b==0?1:0}if(b==-1)return-2;b=this.compare(d.row,d.column);return b==-1?-1:b==1?42:0},this.containsRange=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)||this.isStart(a,b)?!1:!0;return!1},this.insideStart=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)?!1:!0;return!1},this.insideEnd=function(a,b){if(this.compare(a,b)==0)return this.isStart(a,b)?!1:!0;return!1},this.compare=function(a,b){if(!this.isMultiLine()&&a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.rowthis.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0);return c}}).call(f.prototype)}),define("pilot/lang",["require","exports","module"],function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(i=0,l=a.length;i=0||!b&&Y.call(j,c)>=0)g=c.toUpperCase(),g==="WHEN"&&(l=this.tag(),Y.call(x,l)>=0)?g="LEADING_WHEN":g==="FOR"?this.seenFor=!0:g==="UNLESS"?g="IF":Y.call(Q,g)>=0?g="UNARY":Y.call(K,g)>=0&&(g!=="INSTANCEOF"&&this.seenFor?(g="FOR"+g,this.seenFor=!1):(g="RELATION",this.value()==="!"&&(this.tokens.pop(),c="!"+c)));Y.call(v,c)>=0&&(b?(g="IDENTIFIER",c=new String(c),c.reserved=!0):Y.call(L,c)>=0&&this.identifierError(c)),b||(Y.call(h,c)>=0&&(c=i[c]),g=function(){switch(c){case"!":return"UNARY";case"==":case"!=":return"COMPARE";case"&&":case"||":return"LOGIC";case"true":case"false":case"null":case"undefined":return"BOOL";case"break":case"continue":case"debugger":return"STATEMENT";default:return g}}()),this.token(g,c),a&&this.token(":",":");return d.length},a.prototype.numberToken=function(){var a,b;if(!(a=H.exec(this.chunk)))return 0;b=a[0],this.token("NUMBER",b);return b.length},a.prototype.stringToken=function(){var a,b;switch(this.chunk.charAt(0)){case"'":if(!(a=O.exec(this.chunk)))return 0;this.token("STRING",(b=a[0]).replace(C,"\\\n"));break;case'"':if(!(b=this.balancedString(this.chunk,'"')))return 0;0=0))return 0;if(!(a=J.exec(this.chunk)))return 0;c=a[0],this.token("REGEX",c==="//"?"/(?:)/":c);return c.length},a.prototype.heregexToken=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;d=a[0],b=a[1],c=a[2];if(0>b.indexOf("#{")){e=b.replace(r,"").replace(/\//g,"\\/"),this.token("REGEX","/"+(e||"(?:)")+"/"+c);return d.length}this.token("IDENTIFIER","RegExp"),this.tokens.push(["CALL_START","("]),g=[],k=this.interpolateString(b,{regex:!0});for(i=0,j=k.length;ithis.indent){if(d){this.indebt=f-this.indent,this.suppressNewlines();return b.length}a=f-this.indent+this.outdebt,this.token("INDENT",a),this.indents.push(a),this.outdebt=this.indebt=0}else this.indebt=0,this.outdentToken(this.indent-f,d);this.indent=f;return b.length},a.prototype.outdentToken=function(a,b,c){var d,e;while(a>0)e=this.indents.length-1,this.indents[e]===void 0?a=0:this.indents[e]===this.outdebt?(a-=this.outdebt,this.outdebt=0):this.indents[e]=0)&&this.assignmentError();if((h=b[1])==="||"||h==="&&"){b[0]="COMPOUND_ASSIGN",b[1]+="=";return d.length}}if(d===";")c="TERMINATOR";else if(Y.call(B,d)>=0)c="MATH";else if(Y.call(l,d)>=0)c="COMPARE";else if(Y.call(m,d)>=0)c="COMPOUND_ASSIGN";else if(Y.call(Q,d)>=0)c="UNARY";else if(Y.call(N,d)>=0)c="SHIFT";else if(Y.call(z,d)>=0||d==="?"&&(b!=null?b.spaced:void 0))c="LOGIC";else if(b&&!b.spaced)if(d==="("&&(i=b[0],Y.call(f,i)>=0))b[0]==="?"&&(b[0]="FUNC_EXIST"),c="CALL_START";else if(d==="["&&(j=b[0],Y.call(t,j)>=0)){c="INDEX_START";switch(b[0]){case"?":b[0]="INDEX_SOAK";break;case"::":b[0]="INDEX_PROTO"}}this.token(c,d);return d.length},a.prototype.sanitizeHeredoc=function(a,b){var c,d,e,f,g;e=b.indent,d=b.herecomment;if(d){if(o.test(a))throw new Error('block comment cannot contain "*/", starting on line '+(this.line+1));if(a.indexOf("\n")<=0)return a}else while(f=p.exec(a)){c=f[1];if(e===null||0<(g=c.length)&&gg;1<=g?c++:c--){switch(d=a.charAt(c)){case"\\":c++;continue;case b:f.pop();if(!f.length)return a.slice(0,c+1);b=f[f.length-1];continue}b!=="}"||d!=='"'&&d!=="'"?b==="}"&&d==="{"?f.push(b="}"):b==='"'&&e==="#"&&d==="{"&&f.push(b="}"):f.push(b=d),e=d}throw new Error("missing "+f.pop()+", starting on line "+(this.line+1))},a.prototype.interpolateString=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;c==null&&(c={}),e=c.heredoc,m=c.regex,o=[],l=0,f=-1;while(j=b.charAt(f+=1)){if(j==="\\"){f+=1;continue}if(j!=="#"||b.charAt(f+1)!=="{"||!(d=this.balancedString(b.slice(f+1),"}")))continue;l1&&(k.unshift(["(","("]),k.push([")",")"])),o.push(["TOKENS",k])}f+=d.length,l=f+1}f>l&&l1)&&this.token("(","(");for(f=0,q=o.length;f|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/,R=/^[^\n\S]+/,k=/^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/,g=/^[-=]>/,D=/^(?:\n[^\n\S]*)+/,O=/^'[^\\']*(?:\\.[^\\']*)*'/,u=/^`[^\\`]*(?:\\.[^\\`]*)*`/,J=/^\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/[imgy]{0,4}(?!\w)/,q=/^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/,r=/\s+(?:#.*)?/g,C=/\n/g,p=/\n+([^\n\S]*)/g,o=/\*\//,d=/^\s*@?([$A-Za-z_][$\w\x7f-\uffff]*|['"].*['"])[^\n\S]*?[:=][^:=>]/,y=/^\s*(?:,|\??\.(?![.\d])|::)/,P=/\s+$/,G=/^(?:[-+*&|\/%=<>!.\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/,m=["-=","+=","/=","*=","%=","||=","&&=","?=","<<=",">>=",">>>=","&=","^=","|="],Q=["!","~","NEW","TYPEOF","DELETE","DO"],z=["&&","||","&","|","^"],N=["<<",">>",">>>"],l=["==","!=","<",">","<=",">="],B=["*","/","%"],K=["IN","OF","INSTANCEOF"],e=["TRUE","FALSE","NULL","UNDEFINED"],E=["NUMBER","REGEX","BOOL","++","--","]"],F=E.concat(")","}","THIS","IDENTIFIER","STRING"),f=["IDENTIFIER","STRING","REGEX",")","]","}","?","::","@","THIS","SUPER"],t=f.concat("NUMBER","BOOL"),x=["INDENT","OUTDENT","TERMINATOR"]}),define("ace/mode/coffee/rewriter",["require","exports","module"],function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b=0)d+=1;else if(j=e[0],v.call(f,j)>=0)d-=1;a+=1}return a-1},a.prototype.removeLeadingNewlines=function(){var a,b,c,d;d=this.tokens;for(a=0,c=d.length;a=0)))return 1;c.splice(b,1);return 0})},a.prototype.closeOpenCalls=function(){var a,b;b=function(a,b){var c;return(c=a[0])===")"||c==="CALL_END"||a[0]==="OUTDENT"&&this.tag(b-1)===")"},a=function(a,b){return this.tokens[a[0]==="OUTDENT"?b-1:b][0]="CALL_END"};return this.scanTokens(function(c,d){c[0]==="CALL_START"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.closeOpenIndexes=function(){var a,b;b=function(a,b){var c;return(c=a[0])==="]"||c==="INDEX_END"},a=function(a,b){return a[0]="INDEX_END"};return this.scanTokens(function(c,d){c[0]==="INDEX_START"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.addImplicitBraces=function(){var a,b,c,d,e;c=[],d=null,e=0,b=function(a,b){var c,d,e,f,g,h;g=this.tokens.slice(b+1,b+3+1||9e9),c=g[0],f=g[1],e=g[2];if("HERECOMMENT"===(c!=null?c[0]:void 0))return!1;d=a[0];return(d==="TERMINATOR"||d==="OUTDENT")&&(f!=null?f[0]:void 0)!==":"&&((c!=null?c[0]:void 0)!=="@"||(e!=null?e[0]:void 0)!==":")||d===","&&c&&(h=c[0])!=="IDENTIFIER"&&h!=="NUMBER"&&h!=="STRING"&&h!=="@"&&h!=="TERMINATOR"&&h!=="OUTDENT"},a=function(a,b){var c;c=["}","}",a[2]],c.generated=!0;return this.tokens.splice(b,0,c)};return this.scanTokens(function(e,h,i){var j,k,l,m,n,o,p;if(o=l=e[0],v.call(g,o)>=0){c.push([l==="INDENT"&&this.tag(h-1)==="{"?"{":l,h]);return 1}if(v.call(f,l)>=0){d=c.pop();return 1}if(l!==":"||(j=this.tag(h-2))!==":"&&((p=c[c.length-1])!=null?p[0]:void 0)==="{")return 1;c.push(["{"]),k=j==="@"?h-2:h-1;while(this.tag(k-2)==="HERECOMMENT")k-=2;n=new String("{"),n.generated=!0,m=["{",n,e[2]],m.generated=!0,i.splice(k,0,m),this.detectEnd(h+2,b,a);return 2})},a.prototype.addImplicitParentheses=function(){var a,b;b=!1,a=function(a,b){var c;c=a[0]==="OUTDENT"?b+1:b;return this.tokens.splice(c,0,["CALL_END",")",a[2]])};return this.scanTokens(function(c,d,e){var f,g,m,o,p,q,r,s,t,u;r=c[0];if(r==="CLASS"||r==="IF")b=!0;s=e.slice(d-1,d+1+1||9e9),o=s[0],g=s[1],m=s[2],f=!b&&r==="INDENT"&&m&&m.generated&&m[0]==="{"&&o&&(t=o[0],v.call(k,t)>=0),q=!1,p=!1,v.call(n,r)>=0&&(b=!1),o&&!o.spaced&&r==="?"&&(c.call=!0);if(c.fromThen)return 1;if(!(f||(o!=null?o.spaced:void 0)&&(o.call||(u=o[0],v.call(k,u)>=0))&&(v.call(i,r)>=0||!c.spaced&&!c.newLine&&v.call(l,r)>=0)))return 1;e.splice(d,0,["CALL_START","(",c[2]]),this.detectEnd(d+1,function(a,b){var c,d;r=a[0];if(!q&&a.fromThen)return!0;if(r==="IF"||r==="ELSE"||r==="CATCH"||r==="->"||r==="=>")q=!0;if(r==="IF"||r==="ELSE"||r==="SWITCH"||r==="TRY")p=!0;if((r==="."||r==="?."||r==="::")&&this.tag(b-1)==="OUTDENT")return!0;return!a.generated&&this.tag(b-1)!==","&&(v.call(j,r)>=0||r==="INDENT"&&!p)&&(r!=="INDENT"||this.tag(b-2)!=="CLASS"&&(d=this.tag(b-1),v.call(h,d)<0)&&(!(c=this.tokens[b+1])||!c.generated||c[0]!=="{"))},a),o[0]==="?"&&(o[0]="FUNC_EXIST");return 2})},a.prototype.addImplicitIndentation=function(){return this.scanTokens(function(a,b,c){var d,e,f,g,h,i,j,k;i=a[0];if(i==="TERMINATOR"&&this.tag(b+1)==="THEN"){c.splice(b,1);return 0}if(i==="ELSE"&&this.tag(b-1)!=="OUTDENT"){c.splice.apply(c,[b,0].concat(w.call(this.indentation(a))));return 2}if(i==="CATCH"&&((j=this.tag(b+2))==="OUTDENT"||j==="TERMINATOR"||j==="FINALLY")){c.splice.apply(c,[b+2,0].concat(w.call(this.indentation(a))));return 4}if(v.call(p,i)>=0&&this.tag(b+1)!=="INDENT"&&(i!=="ELSE"||this.tag(b+1)!=="IF")){h=i,k=this.indentation(a),f=k[0],g=k[1],h==="THEN"&&(f.fromThen=!0),f.generated=g.generated=!0,c.splice(b+1,0,f),e=function(a,b){var c;return a[1]!==";"&&(c=a[0],v.call(o,c)>=0)&&(a[0]!=="ELSE"||h==="IF"||h==="THEN")},d=function(a,b){return this.tokens.splice(this.tag(b-1)===","?b-1:b,0,g)},this.detectEnd(b+2,e,d),i==="THEN"&&c.splice(b,1);return 1}return 1})},a.prototype.tagPostfixConditionals=function(){var a;a=function(a,b){var c;return(c=a[0])==="TERMINATOR"||c==="INDENT"};return this.scanTokens(function(b,c){var d;if(b[0]!=="IF")return 1;d=b,this.detectEnd(c+1,a,function(a,b){if(a[0]!=="INDENT")return d[0]="POST_"+d[0]});return 1})},a.prototype.ensureBalance=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;d={},f={},m=this.tokens;for(i=0,k=m.length;i0)throw Error("unclosed "+e+" on line "+(f[e]+1))}return this},a.prototype.rewriteClosingParens=function(){var a,b,c;c=[],a={};for(b in m)a[b]=0;return this.scanTokens(function(b,d,e){var h,i,j,k,l,n,o;if(o=l=b[0],v.call(g,o)>=0){c.push(b);return 1}if(v.call(f,l)<0)return 1;if(a[h=m[l]]>0){a[h]-=1,e.splice(d,1);return 0}i=c.pop(),j=i[0],k=m[j];if(l===k)return 1;a[j]+=1,n=[k,j==="INDENT"?i[1]:k],this.tag(d+2)===j?(e.splice(d+3,0,n),c.push(i)):e.splice(d,0,n);return 1})},a.prototype.indentation=function(a){return[["INDENT",2,a[2]],["OUTDENT",2,a[2]]]},a.prototype.tag=function(a){var b;return(b=this.tokens[a])!=null?b[0]:void 0};return a}(),d=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"]],m={},g=[],f=[];for(s=0,t=d.length;s","=>","[","(","{","--","++"],l=["+","-"],h=["->","=>","{","[",","],j=["POST_IF","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR"],p=["ELSE","->","=>","TRY","FINALLY","THEN"],o=["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"],n=["TERMINATOR","INDENT","OUTDENT"]}),define("ace/mode/coffee/helpers",["require","exports","module"],function(a,b,c){var d,e;b.starts=function(a,b,c){return b===a.substr(c,b.length)},b.ends=function(a,b,c){var d;d=b.length;return b===a.substr(a.length-d-(c||0),d)},b.compact=function(a){var b,c,d,e;e=[];for(c=0,d=a.length;c":48,"=>":49,OptComma:50,",":51,Param:52,ParamVar:53,"...":54,Array:55,Object:56,Splat:57,SimpleAssignable:58,Accessor:59,Parenthetical:60,Range:61,This:62,".":63,"?.":64,"::":65,Index:66,INDEX_START:67,IndexValue:68,INDEX_END:69,INDEX_SOAK:70,INDEX_PROTO:71,Slice:72,"{":73,AssignList:74,"}":75,CLASS:76,EXTENDS:77,OptFuncExist:78,Arguments:79,SUPER:80,FUNC_EXIST:81,CALL_START:82,CALL_END:83,ArgList:84,THIS:85,"@":86,"[":87,"]":88,RangeDots:89,"..":90,Arg:91,SimpleArgs:92,TRY:93,Catch:94,FINALLY:95,CATCH:96,THROW:97,"(":98,")":99,WhileSource:100,WHILE:101,WHEN:102,UNTIL:103,Loop:104,LOOP:105,ForBody:106,FOR:107,ForStart:108,ForSource:109,ForVariables:110,OWN:111,ForValue:112,FORIN:113,FOROF:114,BY:115,SWITCH:116,Whens:117,ELSE:118,When:119,LEADING_WHEN:120,IfBlock:121,IF:122,POST_IF:123,UNARY:124,"-":125,"+":126,"--":127,"++":128,"?":129,MATH:130,SHIFT:131,COMPARE:132,LOGIC:133,RELATION:134,COMPOUND_ASSIGN:135,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",13:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"BOOL",37:"=",40:":",42:"RETURN",43:"HERECOMMENT",44:"PARAM_START",46:"PARAM_END",48:"->",49:"=>",51:",",54:"...",63:".",64:"?.",65:"::",67:"INDEX_START",69:"INDEX_END",70:"INDEX_SOAK",71:"INDEX_PROTO",73:"{",75:"}",76:"CLASS",77:"EXTENDS",80:"SUPER",81:"FUNC_EXIST",82:"CALL_START",83:"CALL_END",85:"THIS",86:"@",87:"[",88:"]",90:"..",93:"TRY",95:"FINALLY",96:"CATCH",97:"THROW",98:"(",99:")",101:"WHILE",102:"WHEN",103:"UNTIL",105:"LOOP",107:"FOR",111:"OWN",113:"FORIN",114:"FOROF",115:"BY",116:"SWITCH",118:"ELSE",120:"LEADING_WHEN",122:"IF",123:"POST_IF",124:"UNARY",125:"-",126:"+",127:"--",128:"++",129:"?",130:"MATH",131:"SHIFT",132:"COMPARE",133:"LOGIC",134:"RELATION",135:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[18,3],[18,5],[38,1],[38,3],[38,5],[38,1],[39,1],[39,1],[39,1],[10,2],[10,1],[12,1],[16,5],[16,2],[47,1],[47,1],[50,0],[50,1],[45,0],[45,1],[45,3],[52,1],[52,2],[52,3],[53,1],[53,1],[53,1],[53,1],[57,2],[58,1],[58,2],[58,2],[58,1],[36,1],[36,1],[36,1],[14,1],[14,1],[14,1],[14,1],[14,1],[59,2],[59,2],[59,2],[59,1],[59,1],[66,3],[66,2],[66,2],[68,1],[68,1],[56,4],[74,0],[74,1],[74,3],[74,4],[74,6],[24,1],[24,2],[24,3],[24,4],[24,2],[24,3],[24,4],[24,5],[15,3],[15,3],[15,1],[15,2],[78,0],[78,1],[79,2],[79,4],[62,1],[62,1],[41,2],[55,2],[55,4],[89,1],[89,1],[61,5],[72,3],[72,2],[72,2],[84,1],[84,3],[84,4],[84,4],[84,6],[91,1],[91,1],[92,1],[92,3],[20,2],[20,3],[20,4],[20,5],[94,3],[11,2],[60,3],[60,5],[100,2],[100,4],[100,2],[100,4],[21,2],[21,2],[21,2],[21,1],[104,2],[104,2],[22,2],[22,2],[22,2],[106,2],[106,2],[108,2],[108,3],[112,1],[112,1],[112,1],[110,1],[110,3],[109,2],[109,2],[109,4],[109,4],[109,4],[109,6],[109,6],[23,5],[23,7],[23,4],[23,6],[117,1],[117,2],[119,3],[119,4],[121,3],[121,5],[19,1],[19,3],[19,3],[19,3],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,5],[17,3]],performAction:function(b,c,d,e,f,g,h){var i=g.length-1;switch(f){case 1:return this.$=new e.Block;case 2:return this.$=g[i];case 3:return this.$=g[i-1];case 4:this.$=e.Block.wrap([g[i]]);break;case 5:this.$=g[i-2].push(g[i]);break;case 6:this.$=g[i-1];break;case 7:this.$=g[i];break;case 8:this.$=g[i];break;case 9:this.$=g[i];break;case 10:this.$=g[i];break;case 11:this.$=g[i];break;case 12:this.$=new e.Literal(g[i]);break;case 13:this.$=g[i];break;case 14:this.$=g[i];break;case 15:this.$=g[i];break;case 16:this.$=g[i];break;case 17:this.$=g[i];break;case 18:this.$=g[i];break;case 19:this.$=g[i];break;case 20:this.$=g[i];break;case 21:this.$=g[i];break;case 22:this.$=g[i];break;case 23:this.$=g[i];break;case 24:this.$=new e.Block;break;case 25:this.$=g[i-1];break;case 26:this.$=new e.Literal(g[i]);break;case 27:this.$=new e.Literal(g[i]);break;case 28:this.$=new e.Literal(g[i]);break;case 29:this.$=g[i];break;case 30:this.$=new e.Literal(g[i]);break;case 31:this.$=new e.Literal(g[i]);break;case 32:this.$=function(){var a;a=new e.Literal(g[i]),g[i]==="undefined"&&(a.isUndefined=!0);return a}();break;case 33:this.$=new e.Assign(g[i-2],g[i]);break;case 34:this.$=new e.Assign(g[i-4],g[i-1]);break;case 35:this.$=new e.Value(g[i]);break;case 36:this.$=new e.Assign(new e.Value(g[i-2]),g[i],"object");break;case 37:this.$=new e.Assign(new e.Value(g[i-4]),g[i-1],"object");break;case 38:this.$=g[i];break;case 39:this.$=g[i];break;case 40:this.$=g[i];break;case 41:this.$=g[i];break;case 42:this.$=new e.Return(g[i]);break;case 43:this.$=new e.Return;break;case 44:this.$=new e.Comment(g[i]);break;case 45:this.$=new e.Code(g[i-3],g[i],g[i-1]);break;case 46:this.$=new e.Code([],g[i],g[i-1]);break;case 47:this.$="func";break;case 48:this.$="boundfunc";break;case 49:this.$=g[i];break;case 50:this.$=g[i];break;case 51:this.$=[];break;case 52:this.$=[g[i]];break;case 53:this.$=g[i-2].concat(g[i]);break;case 54:this.$=new e.Param(g[i]);break;case 55:this.$=new e.Param(g[i-1],null,!0);break;case 56:this.$=new e.Param(g[i-2],g[i]);break;case 57:this.$=g[i];break;case 58:this.$=g[i];break;case 59:this.$=g[i];break;case 60:this.$=g[i];break;case 61:this.$=new e.Splat(g[i-1]);break;case 62:this.$=new e.Value(g[i]);break;case 63:this.$=g[i-1].push(g[i]);break;case 64:this.$=new e.Value(g[i-1],[g[i]]);break;case 65:this.$=g[i];break;case 66:this.$=g[i];break;case 67:this.$=new e.Value(g[i]);break;case 68:this.$=new e.Value(g[i]);break;case 69:this.$=g[i];break;case 70:this.$=new e.Value(g[i]);break;case 71:this.$=new e.Value(g[i]);break;case 72:this.$=new e.Value(g[i]);break;case 73:this.$=g[i];break;case 74:this.$=new e.Access(g[i]);break;case 75:this.$=new e.Access(g[i],"soak");break;case 76:this.$=new e.Access(g[i],"proto");break;case 77:this.$=new e.Access(new e.Literal("prototype"));break;case 78:this.$=g[i];break;case 79:this.$=g[i-1];break;case 80:this.$=e.extend(g[i],{soak:!0});break;case 81:this.$=e.extend(g[i],{proto:!0});break;case 82:this.$=new e.Index(g[i]);break;case 83:this.$=new e.Slice(g[i]);break;case 84:this.$=new e.Obj(g[i-2],g[i-3].generated);break;case 85:this.$=[];break;case 86:this.$=[g[i]];break;case 87:this.$=g[i-2].concat(g[i]);break;case 88:this.$=g[i-3].concat(g[i]);break;case 89:this.$=g[i-5].concat(g[i-2]);break;case 90:this.$=new e.Class;break;case 91:this.$=new e.Class(null,null,g[i]);break;case 92:this.$=new e.Class(null,g[i]);break;case 93:this.$=new e.Class(null,g[i-1],g[i]);break;case 94:this.$=new e.Class(g[i]);break;case 95:this.$=new e.Class(g[i-1],null,g[i]);break;case 96:this.$=new e.Class(g[i-2],g[i]);break;case 97:this.$=new e.Class(g[i-3],g[i-1],g[i]);break;case 98:this.$=new e.Call(g[i-2],g[i],g[i-1]);break;case 99:this.$=new e.Call(g[i-2],g[i],g[i-1]);break;case 100:this.$=new e.Call("super",[new e.Splat(new e.Literal("arguments"))]);break;case 101:this.$=new e.Call("super",g[i]);break;case 102:this.$=!1;break;case 103:this.$=!0;break;case 104:this.$=[];break;case 105:this.$=g[i-2];break;case 106:this.$=new e.Value(new e.Literal("this"));break;case 107:this.$=new e.Value(new e.Literal("this"));break;case 108:this.$=new e.Value(new e.Literal("this"),[new e.Access(g[i])],"this");break;case 109:this.$=new e.Arr([]);break;case 110:this.$=new e.Arr(g[i-2]);break;case 111:this.$="inclusive";break;case 112:this.$="exclusive";break;case 113:this.$=new e.Range(g[i-3],g[i-1],g[i-2]);break;case 114:this.$=new e.Range(g[i-2],g[i],g[i-1]);break;case 115:this.$=new e.Range(g[i-1],null,g[i]);break;case 116:this.$=new e.Range(null,g[i],g[i-1]);break;case 117:this.$=[g[i]];break;case 118:this.$=g[i-2].concat(g[i]);break;case 119:this.$=g[i-3].concat(g[i]);break;case 120:this.$=g[i-2];break;case 121:this.$=g[i-5].concat(g[i-2]);break;case 122:this.$=g[i];break;case 123:this.$=g[i];break;case 124:this.$=g[i];break;case 125:this.$=[].concat(g[i-2],g[i]);break;case 126:this.$=new e.Try(g[i]);break;case 127:this.$=new e.Try(g[i-1],g[i][0],g[i][1]);break;case 128:this.$=new e.Try(g[i-2],null,null,g[i]);break;case 129:this.$=new e.Try(g[i-3],g[i-2][0],g[i-2][1],g[i]);break;case 130:this.$=[g[i-1],g[i]];break;case 131:this.$=new e.Throw(g[i]);break;case 132:this.$=new e.Parens(g[i-1]);break;case 133:this.$=new e.Parens(g[i-2]);break;case 134:this.$=new e.While(g[i]);break;case 135:this.$=new e.While(g[i-2],{guard:g[i]});break;case 136:this.$=new e.While(g[i],{invert:!0});break;case 137:this.$=new e.While(g[i-2],{invert:!0,guard:g[i]});break;case 138:this.$=g[i-1].addBody(g[i]);break;case 139:this.$=g[i].addBody(e.Block.wrap([g[i-1]]));break;case 140:this.$=g[i].addBody(e.Block.wrap([g[i-1]]));break;case 141:this.$=g[i];break;case 142:this.$=(new e.While(new e.Literal("true"))).addBody(g[i]);break;case 143:this.$=(new e.While(new e.Literal("true"))).addBody(e.Block.wrap([g[i]]));break;case 144:this.$=new e.For(g[i-1],g[i]);break;case 145:this.$=new e.For(g[i-1],g[i]);break;case 146:this.$=new e.For(g[i],g[i-1]);break;case 147:this.$={source:new e.Value(g[i])};break;case 148:this.$=function(){g[i].own=g[i-1].own,g[i].name=g[i-1][0],g[i].index=g[i-1][1];return g[i]}();break;case 149:this.$=g[i];break;case 150:this.$=function(){g[i].own=!0;return g[i]}();break;case 151:this.$=g[i];break;case 152:this.$=new e.Value(g[i]);break;case 153:this.$=new e.Value(g[i]);break;case 154:this.$=[g[i]];break;case 155:this.$=[g[i-2],g[i]];break;case 156:this.$={source:g[i]};break;case 157:this.$={source:g[i],object:!0};break;case 158:this.$={source:g[i-2],guard:g[i]};break;case 159:this.$={source:g[i-2],guard:g[i],object:!0};break;case 160:this.$={source:g[i-2],step:g[i]};break;case 161:this.$={source:g[i-4],guard:g[i-2],step:g[i]};break;case 162:this.$={source:g[i-4],step:g[i-2],guard:g[i]};break;case 163:this.$=new e.Switch(g[i-3],g[i-1]);break;case 164:this.$=new e.Switch(g[i-5],g[i-3],g[i-1]);break;case 165:this.$=new e.Switch(null,g[i-1]);break;case 166:this.$=new e.Switch(null,g[i-3],g[i-1]);break;case 167:this.$=g[i];break;case 168:this.$=g[i-1].concat(g[i]);break;case 169:this.$=[[g[i-1],g[i]]];break;case 170:this.$=[[g[i-2],g[i-1]]];break;case 171:this.$=new e.If(g[i-1],g[i],{type:g[i-2]});break;case 172:this.$=g[i-4].addElse(new e.If(g[i-1],g[i],{type:g[i-2]}));break;case 173:this.$=g[i];break;case 174:this.$=g[i-2].addElse(g[i]);break;case 175:this.$=new e.If(g[i],e.Block.wrap([g[i-2]]),{type:g[i-1],statement:!0});break;case 176:this.$=new e.If(g[i],e.Block.wrap([g[i-2]]),{type:g[i-1],statement:!0});break;case 177:this.$=new e.Op(g[i-1],g[i]);break;case 178:this.$=new e.Op("-",g[i]);break;case 179:this.$=new e.Op("+",g[i]);break;case 180:this.$=new e.Op("--",g[i]);break;case 181:this.$=new e.Op("++",g[i]);break;case 182:this.$=new e.Op("--",g[i-1],null,!0);break;case 183:this.$=new e.Op("++",g[i-1],null,!0);break;case 184:this.$=new e.Existence(g[i-1]);break;case 185:this.$=new e.Op("+",g[i-2],g[i]);break;case 186:this.$=new e.Op("-",g[i-2],g[i]);break;case 187:this.$=new e.Op(g[i-1],g[i-2],g[i]);break;case 188:this.$=new e.Op(g[i-1],g[i-2],g[i]);break;case 189:this.$=new e.Op(g[i-1],g[i-2],g[i]);break;case 190:this.$=new e.Op(g[i-1],g[i-2],g[i]);break;case 191:this.$=function(){return g[i-1].charAt(0)==="!"?(new e.Op(g[i-1].slice(1),g[i-2],g[i])).invert():new e.Op(g[i-1],g[i-2],g[i])}();break;case 192:this.$=new e.Assign(g[i-2],g[i],g[i-1]);break;case 193:this.$=new e.Assign(g[i-4],g[i-1],g[i-3]);break;case 194:this.$=new e.Extends(g[i-2],g[i])}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[3]},{1:[2,2],6:[1,71]},{6:[1,72]},{1:[2,4],6:[2,4],26:[2,4],99:[2,4]},{4:74,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[1,73],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,7],6:[2,7],26:[2,7],99:[2,7],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,8],6:[2,8],26:[2,8],99:[2,8],100:87,101:[1,62],103:[1,63],106:88,107:[1,65],108:66,123:[1,86]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],46:[2,13],51:[2,13],54:[2,13],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,13],70:[1,97],71:[1,98],75:[2,13],78:89,81:[1,91],82:[2,102],83:[2,13],88:[2,13],90:[2,13],99:[2,13],101:[2,13],102:[2,13],103:[2,13],107:[2,13],115:[2,13],123:[2,13],125:[2,13],126:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],46:[2,14],51:[2,14],54:[2,14],59:100,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,14],70:[1,97],71:[1,98],75:[2,14],78:99,81:[1,91],82:[2,102],83:[2,14],88:[2,14],90:[2,14],99:[2,14],101:[2,14],102:[2,14],103:[2,14],107:[2,14],115:[2,14],123:[2,14],125:[2,14],126:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],46:[2,15],51:[2,15],54:[2,15],69:[2,15],75:[2,15],83:[2,15],88:[2,15],90:[2,15],99:[2,15],101:[2,15],102:[2,15],103:[2,15],107:[2,15],115:[2,15],123:[2,15],125:[2,15],126:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],46:[2,16],51:[2,16],54:[2,16],69:[2,16],75:[2,16],83:[2,16],88:[2,16],90:[2,16],99:[2,16],101:[2,16],102:[2,16],103:[2,16],107:[2,16],115:[2,16],123:[2,16],125:[2,16],126:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],46:[2,17],51:[2,17],54:[2,17],69:[2,17],75:[2,17],83:[2,17],88:[2,17],90:[2,17],99:[2,17],101:[2,17],102:[2,17],103:[2,17],107:[2,17],115:[2,17],123:[2,17],125:[2,17],126:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],46:[2,18],51:[2,18],54:[2,18],69:[2,18],75:[2,18],83:[2,18],88:[2,18],90:[2,18],99:[2,18],101:[2,18],102:[2,18],103:[2,18],107:[2,18],115:[2,18],123:[2,18],125:[2,18],126:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],46:[2,19],51:[2,19],54:[2,19],69:[2,19],75:[2,19],83:[2,19],88:[2,19],90:[2,19],99:[2,19],101:[2,19],102:[2,19],103:[2,19],107:[2,19],115:[2,19],123:[2,19],125:[2,19],126:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],46:[2,20],51:[2,20],54:[2,20],69:[2,20],75:[2,20],83:[2,20],88:[2,20],90:[2,20],99:[2,20],101:[2,20],102:[2,20],103:[2,20],107:[2,20],115:[2,20],123:[2,20],125:[2,20],126:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],46:[2,21],51:[2,21],54:[2,21],69:[2,21],75:[2,21],83:[2,21],88:[2,21],90:[2,21],99:[2,21],101:[2,21],102:[2,21],103:[2,21],107:[2,21],115:[2,21],123:[2,21],125:[2,21],126:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],46:[2,22],51:[2,22],54:[2,22],69:[2,22],75:[2,22],83:[2,22],88:[2,22],90:[2,22],99:[2,22],101:[2,22],102:[2,22],103:[2,22],107:[2,22],115:[2,22],123:[2,22],125:[2,22],126:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],46:[2,23],51:[2,23],54:[2,23],69:[2,23],75:[2,23],83:[2,23],88:[2,23],90:[2,23],99:[2,23],101:[2,23],102:[2,23],103:[2,23],107:[2,23],115:[2,23],123:[2,23],125:[2,23],126:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23]},{1:[2,9],6:[2,9],26:[2,9],99:[2,9],101:[2,9],103:[2,9],107:[2,9],123:[2,9]},{1:[2,10],6:[2,10],26:[2,10],99:[2,10],101:[2,10],103:[2,10],107:[2,10],123:[2,10]},{1:[2,11],6:[2,11],26:[2,11],99:[2,11],101:[2,11],103:[2,11],107:[2,11],123:[2,11]},{1:[2,12],6:[2,12],26:[2,12],99:[2,12],101:[2,12],103:[2,12],107:[2,12],123:[2,12]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],37:[1,101],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],67:[2,69],69:[2,69],70:[2,69],71:[2,69],75:[2,69],81:[2,69],82:[2,69],83:[2,69],88:[2,69],90:[2,69],99:[2,69],101:[2,69],102:[2,69],103:[2,69],107:[2,69],115:[2,69],123:[2,69],125:[2,69],126:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],46:[2,70],51:[2,70],54:[2,70],63:[2,70],64:[2,70],65:[2,70],67:[2,70],69:[2,70],70:[2,70],71:[2,70],75:[2,70],81:[2,70],82:[2,70],83:[2,70],88:[2,70],90:[2,70],99:[2,70],101:[2,70],102:[2,70],103:[2,70],107:[2,70],115:[2,70],123:[2,70],125:[2,70],126:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],46:[2,71],51:[2,71],54:[2,71],63:[2,71],64:[2,71],65:[2,71],67:[2,71],69:[2,71],70:[2,71],71:[2,71],75:[2,71],81:[2,71],82:[2,71],83:[2,71],88:[2,71],90:[2,71],99:[2,71],101:[2,71],102:[2,71],103:[2,71],107:[2,71],115:[2,71],123:[2,71],125:[2,71],126:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],46:[2,72],51:[2,72],54:[2,72],63:[2,72],64:[2,72],65:[2,72],67:[2,72],69:[2,72],70:[2,72],71:[2,72],75:[2,72],81:[2,72],82:[2,72],83:[2,72],88:[2,72],90:[2,72],99:[2,72],101:[2,72],102:[2,72],103:[2,72],107:[2,72],115:[2,72],123:[2,72],125:[2,72],126:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72],134:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],46:[2,73],51:[2,73],54:[2,73],63:[2,73],64:[2,73],65:[2,73],67:[2,73],69:[2,73],70:[2,73],71:[2,73],75:[2,73],81:[2,73],82:[2,73],83:[2,73],88:[2,73],90:[2,73],99:[2,73],101:[2,73],102:[2,73],103:[2,73],107:[2,73],115:[2,73],123:[2,73],125:[2,73],126:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],46:[2,100],51:[2,100],54:[2,100],63:[2,100],64:[2,100],65:[2,100],67:[2,100],69:[2,100],70:[2,100],71:[2,100],75:[2,100],79:102,81:[2,100],82:[1,103],83:[2,100],88:[2,100],90:[2,100],99:[2,100],101:[2,100],102:[2,100],103:[2,100],107:[2,100],115:[2,100],123:[2,100],125:[2,100],126:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100]},{27:107,28:[1,70],41:108,45:104,46:[2,51],51:[2,51],52:105,53:106,55:109,56:110,73:[1,67],86:[1,111],87:[1,112]},{5:113,25:[1,5]},{8:114,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:116,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:117,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{14:119,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:118,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{14:119,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:122,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],37:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,66],70:[2,66],71:[2,66],75:[2,66],77:[1,126],81:[2,66],82:[2,66],83:[2,66],88:[2,66],90:[2,66],99:[2,66],101:[2,66],102:[2,66],103:[2,66],107:[2,66],115:[2,66],123:[2,66],125:[2,66],126:[2,66],127:[1,123],128:[1,124],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[2,66],135:[1,125]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],46:[2,173],51:[2,173],54:[2,173],69:[2,173],75:[2,173],83:[2,173],88:[2,173],90:[2,173],99:[2,173],101:[2,173],102:[2,173],103:[2,173],107:[2,173],115:[2,173],118:[1,127],123:[2,173],125:[2,173],126:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],diff --git a/websdk/static/js/ace/worker-css.js b/websdk/static/js/ace/worker-css.js deleted file mode 100644 index f76ed43..0000000 --- a/websdk/static/js/ace/worker-css.js +++ /dev/null @@ -1 +0,0 @@ -function initSender(){var a=require("pilot/event_emitter").EventEmitter,b=require("pilot/oop"),c=function(){};(function(){b.implement(this,a),this.callback=function(a,b){postMessage({type:"call",id:b,data:a})},this.emit=function(a,b){postMessage({type:"event",name:a,data:b})}}).call(c.prototype);return new c}function initBaseUrls(a){require.tlns=a}var console={log:function(a){postMessage({type:"log",data:a})}},window={console:console},require=function(a){var b=require.modules[a];if(b){b.initialized||(b.exports=b.factory().exports,b.initialized=!0);return b.exports}var c=a.split("/");c[0]=require.tlns[c[0]]||c[0],path=c.join("/")+".js",require.id=a,importScripts(path);return require(a)};require.modules={},require.tlns={};var define=function(a,b,c){arguments.length==2?c=b:arguments.length==1&&(c=a,a=require.id);a.indexOf("text/")!==0&&(require.modules[a]={factory:function(){var a={exports:{}},b=c(require,a.exports,a);b&&(a.exports=b);return a}})},main,sender;onmessage=function(a){var b=a.data;if(b.command)main[b.command].apply(main,b.args);else if(b.init){initBaseUrls(b.tlns),require("pilot/fixoldbrowsers"),sender=initSender();var c=require(b.module)[b.classname];main=new c(sender)}else b.event&&sender&&sender._dispatchEvent(b.event,b.data)},define("pilot/fixoldbrowsers",["require","exports","module"],function(a,b,c){if(!Function.prototype.bind){var d=Array.prototype.slice;Function.prototype.bind=function(b){var c=this;if(typeof c.apply!="function"||typeof c.call!="function")return new TypeError;var e=d.call(arguments),f=function a(){if(this instanceof a){var b=Object.create(c.prototype);c.apply(b,e.concat(d.call(arguments)));return b}return c.call.apply(c,e.concat(d.call(arguments)))};f.length=typeof c=="function"?Math.max(c.length-e.length,0):0;return f}}var e=Function.prototype.call,f=Array.prototype,g=Object.prototype,h=e.bind(g.hasOwnProperty),i,j,k,l,m;if(m=h(g,"__defineGetter__"))i=e.bind(g.__defineGetter__),j=e.bind(g.__defineSetter__),k=e.bind(g.__lookupGetter__),l=e.bind(g.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return Object.prototype.toString.call(b)==="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b,c){var d=+this.length;for(var e=0;e=2)var e=arguments[1];else do{if(d in this){e=this[d++];break}if(++d>=c)throw new TypeError}while(!0);for(;d=2)var e=arguments[1];else do{if(d in this){e=this[d--];break}if(--d<0)throw new TypeError}while(!0);for(;d>=0;d--)d in this&&(e=b.call(null,e,this[d],d,this));return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=this.length;if(!c)return-1;var d=arguments[1]||0;if(d>=c)return-1;d<0&&(d+=c);for(;d=0;d--){if(!h(this,d))continue;if(b===this[d])return d}return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||b.constructor.prototype});if(!Object.getOwnPropertyDescriptor){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(n+b);if(!h(b,c))return undefined;var d,e,f;d={enumerable:!0,configurable:!0};if(m){var i=b.__proto__;b.__proto__=g;var e=k(b,c),f=l(b,c);b.__proto__=i;if(e||f){e&&(descriptor.get=e),f&&(descriptor.set=f);return descriptor}}descriptor.value=b[c];return descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={"__proto__":null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}typeof c!="undefined"&&Object.defineProperties(d,c);return d});if(!Object.defineProperty){var o="Property description must be an object: ",p="Object.defineProperty called on non-object: ",q="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function")throw new TypeError(p+b);if(typeof b!="object"||b===null)throw new TypeError(o+d);if(h(d,"value"))if(m&&(k(b,c)||l(b,c))){var e=b.__proto__;b.__proto__=g,delete b[c],b[c]=d.value,b.prototype}else b[c]=d.value;else{if(!m)throw new TypeError(q);h(d,"get")&&i(b,c,d.get),h(d,"set")&&j(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)h(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(r){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){return!0});if(!Object.keys){var s=!0,t=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=t.length;for(var v in{toString:null})s=!1;Object.keys=function a(b){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError("Object.keys called on a non-object");var a=[];for(var c in b)h(b,c)&&a.push(c);if(s)for(var d=0,e=u;d=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;k.constructor=b;return k}return a.apply(this,arguments)},c=new RegExp("^(?:((?:[+-]\\d\\d)?\\d\\d\\d\\d)(?:-(\\d\\d)(?:-(\\d\\d))?)?)?(?:T(\\d\\d):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?)?(?:Z|([+-])(\\d\\d):(\\d\\d))?$");for(var d in a)b[d]=a[d];b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();var f=e[0]===undefined;for(var g=0;g<10;g++){if(g===7)continue;e[g]=+(e[g]||(g<3?1:0)),g===1&&e[g]--}if(f)return((e[3]*60+e[4])*60+e[5])*1e3+e[6];var h=(e[8]*60+e[9])*60*1e3;e[6]==="-"&&(h=-h);return a.UTC.apply(this,e.slice(0,7))+h}return a.parse.apply(this,arguments)};return b}(Date));if(!String.prototype.trim){var w=/^\s\s*/,x=/\s\s*$/;String.prototype.trim=function(){return String(this).replace(w,"").replace(x,"")}}}),define("pilot/event_emitter",["require","exports","module"],function(a,b,c){var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!!c&&!!c.length){var b=b||{};b.type=a;for(var d=0;d=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length);return a},this.insert=function(a,b){if(b.length==0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];this._dispatchEvent("changeStart"),a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),this._dispatchEvent("changeEnd");return a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c),this._dispatchEvent("changeStart");var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:d}),this._dispatchEvent("changeEnd");return c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;this._dispatchEvent("changeStart");if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);this._dispatchEvent("changeEnd");return a.start},this.removeInLine=function(a,b,c){if(b!=c){var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this._dispatchEvent("changeStart"),this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};this._dispatchEvent("change",{data:i}),this._dispatchEvent("changeEnd");return d.start}},this.removeLines=function(a,b){this._dispatchEvent("changeStart");var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this._dispatchEvent("changeStart"),this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:g}),this._dispatchEvent("changeEnd")},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this._dispatchEvent("changeStart"),this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;this._dispatchEvent("changeEnd");return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),define("ace/range",["require","exports","module"],function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;b=this.compare(c.row,c.column);if(b==1){b=this.compare(d.row,d.column);return b==1?2:b==0?1:0}if(b==-1)return-2;b=this.compare(d.row,d.column);return b==-1?-1:b==1?42:0},this.containsRange=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)||this.isStart(a,b)?!1:!0;return!1},this.insideStart=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)?!1:!0;return!1},this.insideEnd=function(a,b){if(this.compare(a,b)==0)return this.isStart(a,b)?!1:!0;return!1},this.compare=function(a,b){if(!this.isMultiLine()&&a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.rowthis.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0);return c}}).call(f.prototype)}),define("pilot/lang",["require","exports","module"],function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(i=0,l=a.length;i=0&&this._ltIndex-1&&!b[h.type].hide&&(h.channel=b[h.type].channel,this._token=h,this._lt.push(h),this._ltIndexCache.push(this._lt.length-this._ltIndex+e),this._lt.length>5&&this._lt.shift(),this._ltIndexCache.length>5&&this._ltIndexCache.shift(),this._ltIndex=this._lt.length),i=b[h.type];return i&&(i.hide||i.channel!==undefined&&a!==i.channel)?this.get(a):h.type},LA:function(a){var b=a,c;if(a>0){if(a>5)throw new Error("Too much lookahead.");while(b)c=this.get(),b--;while(bthis._tokenData.length?"UNKNOWN_TOKEN":this._tokenData[a].name},tokenType:function(a){return this._tokenData[a]||-1},unget:function(){if(this._ltIndexCache.length)this._ltIndex-=this._ltIndexCache.pop(),this._token=this._lt[this._ltIndex-1];else throw new Error("Too much lookahead.")}},parserlib.util={StringReader:b,SyntaxError:c,SyntaxUnit:d,EventTarget:a,TokenStreamBase:e}})(),function(){function TokenStream(a){TokenStreamBase.call(this,a,Tokens)}function mix(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function isIdentStart(a){return a!=null&&(isNameStart(a)||a=="-")}function isNameChar(a){return a!=null&&(isNameStart(a)||/[0-9\-]/.test(a))}function isNameStart(a){return a!=null&&/[a-z_\u0080-\uFFFF\\]/i.test(a)}function isNewLine(a){return a!=null&&nl.test(a)}function isWhitespace(a){return a!=null&&/\s/.test(a)}function isDigit(a){return a!=null&&/\d/.test(a)}function isHexDigit(a){return a!=null&&h.test(a)}function SelectorSubPart(a,b,c,d){SyntaxUnit.call(this,a,c,d),this.type=b,this.args=[]}function SelectorPart(a,b,c,d,e){SyntaxUnit.call(this,c,d,e),this.elementName=a,this.modifiers=b}function Selector(a,b,c){SyntaxUnit.call(this,a.join(" "),b,c),this.parts=a}function PropertyValuePart(text,line,col){SyntaxUnit.apply(this,arguments),this.type="unknown";var temp;if(/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)){this.type="dimension",this.value=+RegExp.$1,this.units=RegExp.$2;switch(this.units.toLowerCase()){case"em":case"rem":case"ex":case"px":case"cm":case"mm":case"in":case"pt":case"pc":this.type="length";break;case"deg":case"rad":case"grad":this.type="angle";break;case"ms":case"s":this.type="time";break;case"hz":case"khz":this.type="frequency";break;case"dpi":case"dpcm":this.type="resolution"}}else/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?\d+)$/i.test(text)?(this.type="integer",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)$/i.test(text)?(this.type="number",this.value=+RegExp.$1):/^#([a-f0-9]{3,6})/i.test(text)?(this.type="color",temp=RegExp.$1,temp.length==3?(this.red=parseInt(temp.charAt(0)+temp.charAt(0),16),this.green=parseInt(temp.charAt(1)+temp.charAt(1),16),this.blue=parseInt(temp.charAt(2)+temp.charAt(2),16)):(this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16))):/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3):/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100):/^url\(["']?([^\)"']+)["']?\)/i.test(text)?(this.type="uri",this.uri=RegExp.$1):/^["'][^"']*["']/.test(text)?(this.type="string",this.value=eval(text)):Colors[text.toLowerCase()]?(this.type="color",temp=Colors[text.toLowerCase()].substring(1),this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16)):/^[\,\/]$/.test(text)?(this.type="operator",this.value=text):/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)&&(this.type="identifier",this.value=text)}function PropertyValue(a,b,c){SyntaxUnit.call(this,a.join(" "),b,c),this.parts=a}function PropertyName(a,b,c,d){SyntaxUnit.call(this,(b||"")+a,c,d),this.hack=b}function Parser(a){EventTarget.call(this),this.options=a||{},this._tokenStream=null}function MediaQuery(a,b,c,d,e){SyntaxUnit.call(this,(a?a+" ":"")+(b?b+" ":"")+c.join(" and "),d,e),this.modifier=a,this.mediaType=b,this.features=c}function MediaFeature(a,b){SyntaxUnit.call(this,"("+a+(b!==null?":"+b:"")+")",a.startLine,a.startCol),this.name=a,this.value=b}function Combinator(a,b,c){SyntaxUnit.call(this,a,b,c),this.type="unknown",/^\s+$/.test(a)?this.type="descendant":a==">"?this.type="child":a=="+"?this.type="adjacent-sibling":a=="~"&&(this.type="sibling")}var EventTarget=parserlib.util.EventTarget,TokenStreamBase=parserlib.util.TokenStreamBase,StringReader=parserlib.util.StringReader,SyntaxError=parserlib.util.SyntaxError,SyntaxUnit=parserlib.util.SyntaxUnit,Colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};Combinator.prototype=new SyntaxUnit,Combinator.prototype.constructor=Combinator;var Level1Properties={background:1,"background-attachment":1,"background-color":1,"background-image":1,"background-position":1,"background-repeat":1,border:1,"border-bottom":1,"border-bottom-width":1,"border-color":1,"border-left":1,"border-left-width":1,"border-right":1,"border-right-width":1,"border-style":1,"border-top":1,"border-top-width":1,"border-width":1,clear:1,color:1,display:1,"float":1,font:1,"font-family":1,"font-size":1,"font-style":1,"font-variant":1,"font-weight":1,height:1,"letter-spacing":1,"line-height":1,"list-style":1,"list-style-image":1,"list-style-position":1,"list-style-type":1,margin:1,"margin-bottom":1,"margin-left":1,"margin-right":1,"margin-top":1,padding:1,"padding-bottom":1,"padding-left":1,"padding-right":1,"padding-top":1,"text-align":1,"text-decoration":1,"text-indent":1,"text-transform":1,"vertical-align":1,"white-space":1,width:1,"word-spacing":1},Level2Properties={azimuth:1,"cue-after":1,"cue-before":1,cue:1,elevation:1,"pause-after":1,"pause-before":1,pause:1,"pitch-range":1,pitch:1,"play-during":1,richness:1,"speak-header":1,"speak-numeral":1,"speak-punctuation":1,speak:1,"speech-rate":1,stress:1,"voice-family":1,volume:1,orphans:1,"page-break-after":1,"page-break-before":1,"page-break-inside":1,widows:1,cursor:1,"outline-color":1,"outline-style":1,"outline-width":1,outline:1,"background-attachment":1,"background-color":1,"background-image":1,"background-position":1,"background-repeat":1,background:1,"border-collapse":1,"border-color":1,"border-spacing":1,"border-style":1,"border-top":1,"border-top-color":1,"border-top-style":1,"border-top-width":1,"border-width":1,border:1,bottom:1,"caption-side":1,clear:1,clip:1,color:1,content:1,"counter-increment":1,"counter-reset":1,direction:1,display:1,"empty-cells":1,"float":1,"font-family":1,"font-size":1,"font-style":1,"font-variant":1,"font-weight":1,font:1,height:1,left:1,"letter-spacing":1,"line-height":1,"list-style-image":1,"list-style-position":1,"list-style-type":1,"list-style":1,"margin-right":1,"margin-top":1,margin:1,"max-height":1,"max-width":1,"min-height":1,"min-width":1,overflow:1,"padding-top":1,padding:1,position:1,quotes:1,right:1,"table-layout":1,"text-align":1,"text-decoration":1,"text-indent":1,"text-transform":1,top:1,"unicode-bidi":1,"vertical-align":1,visibility:1,"white-space":1,width:1,"word-spacing":1,"z-index":1};MediaFeature.prototype=new SyntaxUnit,MediaFeature.prototype.constructor=MediaFeature,MediaQuery.prototype=new SyntaxUnit,MediaQuery.prototype.constructor=MediaQuery,Parser.prototype=function(){var a=new EventTarget,b,c={constructor:Parser,_stylesheet:function(){var a=this._tokenStream,b=null,c,d;this.fire("startstylesheet"),this._charset(),this._skipCruft();while(a.peek()==Tokens.IMPORT_SYM)this._import(),this._skipCruft();while(a.peek()==Tokens.NAMESPACE_SYM)this._namespace(),this._skipCruft();d=a.peek();while(d>Tokens.EOF){try{switch(d){case Tokens.MEDIA_SYM:this._media(),this._skipCruft();break;case Tokens.PAGE_SYM:this._page(),this._skipCruft();break;case Tokens.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case Tokens.S:this._readWhitespace();break;default:if(!this._ruleset())switch(d){case Tokens.CHARSET_SYM:c=a.LT(1),this._charset(!1);throw new SyntaxError("@charset not allowed here.",c.startLine,c.startCol);case Tokens.IMPORT_SYM:c=a.LT(1),this._import(!1);throw new SyntaxError("@import not allowed here.",c.startLine,c.startCol);case Tokens.NAMESPACE_SYM:c=a.LT(1),this._namespace(!1);throw new SyntaxError("@namespace not allowed here.",c.startLine,c.startCol);default:a.get(),this._unexpectedToken(a.token())}}}catch(e){if(e instanceof SyntaxError&&!this.options.strict)this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col});else throw e}d=a.peek()}d!=Tokens.EOF&&this._unexpectedToken(a.token()),this.fire("endstylesheet")},_charset:function(a){var b=this._tokenStream;b.match(Tokens.CHARSET_SYM)&&(this._readWhitespace(),b.mustMatch(Tokens.STRING),token=b.token(),charset=token.value,this._readWhitespace(),b.mustMatch(Tokens.SEMICOLON),a!==!1&&this.fire({type:"charset",charset:charset}))},_import:function(a){var b=this._tokenStream,c,d,e=[];b.mustMatch(Tokens.IMPORT_SYM),this._readWhitespace(),b.mustMatch([Tokens.STRING,Tokens.URI]),d=b.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),e=this._media_query_list(),b.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),a!==!1&&this.fire({type:"import",uri:d,media:e})},_namespace:function(a){var b=this._tokenStream,c,d;b.mustMatch(Tokens.NAMESPACE_SYM),this._readWhitespace(),b.match(Tokens.IDENT)&&(c=b.token().value,this._readWhitespace()),b.mustMatch([Tokens.STRING,Tokens.URI]),d=b.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),b.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),a!==!1&&this.fire({type:"namespace",prefix:c,uri:d})},_media:function(){var a=this._tokenStream,b;a.mustMatch(Tokens.MEDIA_SYM),this._readWhitespace(),b=this._media_query_list(),a.mustMatch(Tokens.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:b});while(this._ruleset());a.mustMatch(Tokens.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:b})},_media_query_list:function(){var a=this._tokenStream,b=[];this._readWhitespace(),a.peek()==Tokens.IDENT&&b.push(this._media_query());while(a.match(Tokens.COMMA))this._readWhitespace(),b.push(this._media_query());return b},_media_query:function(){var a=this._tokenStream,b=null,c=null,d=null,e=[];a.match(Tokens.IDENT)&&(c=a.token().value.toLowerCase(),c!="only"&&c!="not"?(a.unget(),c=null):d=a.token()),this._readWhitespace(),a.peek()==Tokens.IDENT?(b=this._media_type(),d===null&&(d=a.token())):a.peek()==Tokens.LPAREN&&(d===null&&(d=a.LT(1)),e.push(this._media_expression()));if(b===null&&e.length===0)return null;this._readWhitespace();while(a.match(Tokens.IDENT))a.token().value.toLowerCase()!="and"&&this._unexpectedToken(a.token()),this._readWhitespace(),e.push(this._media_expression());return new MediaQuery(c,b,e,d.startLine,d.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var a=this._tokenStream,b=null,c,d=null;a.mustMatch(Tokens.LPAREN),b=this._media_feature(),this._readWhitespace(),a.match(Tokens.COLON)&&(this._readWhitespace(),c=a.LT(1),d=this._expression()),a.mustMatch(Tokens.RPAREN),this._readWhitespace();return new MediaFeature(b,d?new SyntaxUnit(d,c.startLine,c.startCol):null)},_media_feature:function(){var a=this._tokenStream;a.mustMatch(Tokens.IDENT);return SyntaxUnit.fromToken(a.token())},_page:function(){var a=this._tokenStream,b=null,c=null;a.mustMatch(Tokens.PAGE_SYM),this._readWhitespace(),a.match(Tokens.IDENT)&&(b=a.token().value,b.toLowerCase()==="auto"&&this._unexpectedToken(a.token())),a.peek()==Tokens.COLON&&(c=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:b,pseudo:c}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:b,pseudo:c})},_margin:function(){var a=this._tokenStream,b=this._margin_sym();if(b){this.fire({type:"startpagemargin",margin:b}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:b});return!0}return!1},_margin_sym:function(){var a=this._tokenStream;return a.match([Tokens.TOPLEFTCORNER_SYM,Tokens.TOPLEFT_SYM,Tokens.TOPCENTER_SYM,Tokens.TOPRIGHT_SYM,Tokens.TOPRIGHTCORNER_SYM,Tokens.BOTTOMLEFTCORNER_SYM,Tokens.BOTTOMLEFT_SYM,Tokens.BOTTOMCENTER_SYM,Tokens.BOTTOMRIGHT_SYM,Tokens.BOTTOMRIGHTCORNER_SYM,Tokens.LEFTTOP_SYM,Tokens.LEFTMIDDLE_SYM,Tokens.LEFTBOTTOM_SYM,Tokens.RIGHTTOP_SYM,Tokens.RIGHTMIDDLE_SYM,Tokens.RIGHTBOTTOM_SYM])?SyntaxUnit.fromToken(a.token()):null},_pseudo_page:function(){var a=this._tokenStream;a.mustMatch(Tokens.COLON),a.mustMatch(Tokens.IDENT);return a.token().value},_font_face:function(){var a=this._tokenStream;a.mustMatch(Tokens.FONT_FACE_SYM),this._readWhitespace(),this.fire({type:"startfontface"}),this._readDeclarations(!0),this.fire({type:"endfontface"})},_operator:function(){var a=this._tokenStream,b=null;a.match([Tokens.SLASH,Tokens.COMMA])&&(b=a.token(),this._readWhitespace());return b?PropertyValuePart.fromToken(b):null},_combinator:function(){var a=this._tokenStream,b=null,c;a.match([Tokens.PLUS,Tokens.GREATER,Tokens.TILDE])&&(c=a.token(),b=new Combinator(c.value,c.startLine,c.startCol),this._readWhitespace());return b},_unary_operator:function(){var a=this._tokenStream;return a.match([Tokens.MINUS,Tokens.PLUS])?a.token().value:null},_property:function(){var a=this._tokenStream,b=null,c=null,d,e,f,g;a.peek()==Tokens.STAR&&this.options.starHack&&(a.get(),e=a.token(),c=e.value,f=e.startLine,g=e.startCol),a.match(Tokens.IDENT)&&(e=a.token(),d=e.value,d.charAt(0)=="_"&&this.options.underscoreHack&&(c="_",d=d.substring(1)),b=new PropertyName(d,c,f||e.startLine,g||e.startCol),this._readWhitespace());return b},_ruleset:function(){var a=this._tokenStream,b;try{b=this._selectors_group()}catch(c){if(!(c instanceof SyntaxError&&!this.options.strict))throw c;this.fire({type:"error",error:c,message:c.message,line:c.line,col:c.col}),tt=a.advance([Tokens.RBRACE]);if(tt!=Tokens.RBRACE)throw c;return!0}b&&(this.fire({type:"startrule",selectors:b}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:b}));return b},_selectors_group:function(){var a=this._tokenStream,b=[],c;c=this._selector();if(c!==null){b.push(c);while(a.match(Tokens.COMMA))this._readWhitespace(),c=this._selector(),c!==null?b.push(c):this._unexpectedToken(a.LT(1))}return b.length?b:null},_selector:function(){var a=this._tokenStream,b=[],c=null,d=null,e=null;c=this._simple_selector_sequence();if(c===null)return null;b.push(c);do{d=this._combinator();if(d!==null)b.push(d),c=this._simple_selector_sequence(),c===null?this._unexpectedToken(this.LT(1)):b.push(c);else if(this._readWhitespace())e=new Combinator(a.token().value,a.token().startLine,a.token().startCol),d=this._combinator(),c=this._simple_selector_sequence(),c===null?d!==null&&this._unexpectedToken(a.LT(1)):(d!==null?b.push(d):b.push(e),b.push(c));else break}while(!0);return new Selector(b,b[0].line,b[0].col)},_simple_selector_sequence:function(){var a=this._tokenStream,b=null,c=[],d="",e=[function(){return a.match(Tokens.HASH)?new SelectorSubPart(a.token().value,"id",a.token().startLine,a.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],f=0,g=e.length,h=null,i=!1,j,k;j=a.LT(1).startLine,k=a.LT(1).startCol,b=this._type_selector(),b||(b=this._universal()),b!==null&&(d+=b);for(;;){if(a.peek()===Tokens.S)break;while(f1&&a.unget());return null}b&&(c.text=b+c.text,c.col-=b.length);return c},_class:function(){var a=this._tokenStream,b;if(a.match(Tokens.DOT)){a.mustMatch(Tokens.IDENT),b=a.token();return new SelectorSubPart("."+b.value,"class",b.startLine,b.startCol-1)}return null},_element_name:function(){var a=this._tokenStream,b;if(a.match(Tokens.IDENT)){b=a.token();return new SelectorSubPart(b.value,"elementName",b.startLine,b.startCol)}return null},_namespace_prefix:function(){var a=this._tokenStream,b="";if(a.LA(1)===Tokens.PIPE||a.LA(2)===Tokens.PIPE)a.match([Tokens.IDENT,Tokens.STAR])&&(b+=a.token().value),a.mustMatch(Tokens.PIPE),b+="|";return b.length?b:null},_universal:function(){var a=this._tokenStream,b="",c;c=this._namespace_prefix(),c&&(b+=c),a.match(Tokens.STAR)&&(b+="*");return b.length?b:null},_attrib:function(){var a=this._tokenStream,b=null,c,d;if(a.match(Tokens.LBRACKET)){d=a.token(),b=d.value,b+=this._readWhitespace(),c=this._namespace_prefix(),c&&(b+=c),a.mustMatch(Tokens.IDENT),b+=a.token().value,b+=this._readWhitespace(),a.match([Tokens.PREFIXMATCH,Tokens.SUFFIXMATCH,Tokens.SUBSTRINGMATCH,Tokens.EQUALS,Tokens.INCLUDES,Tokens.DASHMATCH])&&(b+=a.token().value,b+=this._readWhitespace(),a.mustMatch([Tokens.IDENT,Tokens.STRING]),b+=a.token().value,b+=this._readWhitespace()),a.mustMatch(Tokens.RBRACKET);return new SelectorSubPart(b+"]","attribute",d.startLine,d.startCol)}return null},_pseudo:function(){var a=this._tokenStream,b=null,c=":",d,e;a.match(Tokens.COLON)&&(a.match(Tokens.COLON)&&(c+=":"),a.match(Tokens.IDENT)?(b=a.token().value,d=a.token().startLine,e=a.token().startCol-c.length):a.peek()==Tokens.FUNCTION&&(d=a.LT(1).startLine,e=a.LT(1).startCol-c.length,b=this._functional_pseudo()),b&&(b=new SelectorSubPart(c+b,"pseudo",d,e)));return b},_functional_pseudo:function(){var a=this._tokenStream,b=null;a.match(Tokens.FUNCTION)&&(b=a.token().value,b+=this._readWhitespace(),b+=this._expression(),a.mustMatch(Tokens.RPAREN),b+=")");return b},_expression:function(){var a=this._tokenStream,b="";while(a.match([Tokens.PLUS,Tokens.MINUS,Tokens.DIMENSION,Tokens.NUMBER,Tokens.STRING,Tokens.IDENT,Tokens.LENGTH,Tokens.FREQ,Tokens.EMS,Tokens.EXS,Tokens.ANGLE,Tokens.TIME,Tokens.RESOLUTION]))b+=a.token().value,b+=this._readWhitespace();return b.length?b:null},_negation:function(){var a=this._tokenStream,b,c,d="",e,f=null;a.match(Tokens.NOT)&&(d=a.token().value,b=a.token().startLine,c=a.token().startCol,d+=this._readWhitespace(),e=this._negation_arg(),d+=e,d+=this._readWhitespace(),a.match(Tokens.RPAREN),d+=a.token().value,f=new SelectorSubPart(d,"not",b,c),f.args.push(e));return f},_negation_arg:function(){var a=this._tokenStream,b=[this._type_selector,this._universal,function(){return a.match(Tokens.HASH)?new SelectorSubPart(a.token().value,"id",a.token().startLine,a.token().startCol):null},this._class,this._attrib,this._pseudo],c=null,d=0,e=b.length,f,g,h,i;g=a.LT(1).startLine,h=a.LT(1).startCol;while(d0?new PropertyValue(b,b[0].startLine,b[0].startCol):null},_term:function(){var a=this._tokenStream,b=null,c=null,d,e;b=this._unary_operator(),b!==null&&(d=a.token().startLine,e=a.token().startCol),a.peek()==Tokens.IE_FUNCTION&&this.options.ieFilters?(c=this._ie_function(),b===null&&(d=a.token().startLine,e=a.token().startCol)):a.match([Tokens.NUMBER,Tokens.PERCENTAGE,Tokens.LENGTH,Tokens.EMS,Tokens.EXS,Tokens.ANGLE,Tokens.TIME,Tokens.FREQ,Tokens.STRING,Tokens.IDENT,Tokens.URI,Tokens.UNICODE_RANGE])?(c=a.token().value,b===null&&(d=a.token().startLine,e=a.token().startCol),this._readWhitespace()):(c=this._hexcolor(),c===null?(b===null&&(d=a.LT(1).startLine,e=a.LT(1).startCol),c===null&&(a.LA(3)==Tokens.EQUALS&&this.options.ieFilters?c=this._ie_function():c=this._function())):b===null&&(d=a.token().startLine,e=a.token().startCol));return c!==null?new PropertyValuePart(b!==null?b+c:c,d,e):null},_function:function(){var a=this._tokenStream,b=null,c=null;a.match(Tokens.FUNCTION)&&(b=a.token().value,this._readWhitespace(),c=this._expr(),a.match(Tokens.RPAREN),b+=c+")",this._readWhitespace());return b},_ie_function:function(){var a=this._tokenStream,b=null,c=null,d;if(a.match([Tokens.IE_FUNCTION,Tokens.FUNCTION])){b=a.token().value;do{this._readWhitespace()&&(b+=a.token().value),a.LA(0)==Tokens.COMMA&&(b+=a.token().value),a.match(Tokens.IDENT),b+=a.token().value,a.match(Tokens.EQUALS),b+=a.token().value,d=a.peek();while(d!=Tokens.COMMA&&d!=Tokens.S&&d!=Tokens.RPAREN)a.get(),b+=a.token().value,d=a.peek()}while(a.match([Tokens.COMMA,Tokens.S]));a.match(Tokens.RPAREN),b+=")",this._readWhitespace()}return b},_hexcolor:function(){var a=this._tokenStream,b,c=null;if(a.match(Tokens.HASH)){b=a.token(),c=b.value;if(!/#[a-f0-9]{3,6}/i.test(c))throw new SyntaxError("Expected a hex color but found '"+c+"' at line "+b.startLine+", character "+b.startCol+".",b.startLine,b.startCol);this._readWhitespace()}return c},_skipCruft:function(){while(this._tokenStream.match([Tokens.S,Tokens.CDO,Tokens.CDC]));},_readDeclarations:function(a,b){var c=this._tokenStream,d;this._readWhitespace(),a&&c.mustMatch(Tokens.LBRACE),this._readWhitespace();try{for(;;){if(!b||!this._margin()){if(!this._declaration())break;if(!c.match(Tokens.SEMICOLON))break}this._readWhitespace()}c.mustMatch(Tokens.RBRACE),this._readWhitespace()}catch(e){if(!(e instanceof SyntaxError&&!this.options.strict))throw e;this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col}),d=c.advance([Tokens.SEMICOLON,Tokens.RBRACE]);if(d==Tokens.SEMICOLON)this._readDeclarations(!1,b);else if(d!=Tokens.RBRACE)throw e}},_readWhitespace:function(){var a=this._tokenStream,b="";while(a.match(Tokens.S))b+=a.token().value;return b},_unexpectedToken:function(a){throw new SyntaxError("Unexpected token '"+a.value+"' at line "+a.startLine+", char "+a.startCol+".",a.startLine,a.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!=Tokens.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},parse:function(a){this._tokenStream=new TokenStream(a,Tokens),this._stylesheet()},parseStyleSheet:function(a){return this.parse(a)},parseMediaQuery:function(a){this._tokenStream=new TokenStream(a,Tokens);var b=this._media_query();this._verifyEnd();return b},parsePropertyValue:function(a){this._tokenStream=new TokenStream(a,Tokens),this._readWhitespace();var b=this._expr();this._readWhitespace(),this._verifyEnd();return b},parseRule:function(a){this._tokenStream=new TokenStream(a,Tokens),this._readWhitespace();var b=this._ruleset();this._readWhitespace(),this._verifyEnd();return b},parseSelector:function(a){this._tokenStream=new TokenStream(a,Tokens),this._readWhitespace();var b=this._selector();this._readWhitespace(),this._verifyEnd();return b}};for(b in c)a[b]=c[b];return a}(),PropertyName.prototype=new SyntaxUnit,PropertyName.prototype.constructor=PropertyName,PropertyValue.prototype=new SyntaxUnit,PropertyValue.prototype.constructor=PropertyValue,PropertyValuePart.prototype=new SyntaxUnit,PropertyValuePart.prototype.constructor=PropertyValue,PropertyValuePart.fromToken=function(a){return new PropertyValuePart(a.value,a.startLine,a.startCol)},Selector.prototype=new SyntaxUnit,Selector.prototype.constructor=Selector,SelectorPart.prototype=new SyntaxUnit,SelectorPart.prototype.constructor=SelectorPart,SelectorSubPart.prototype=new SyntaxUnit,SelectorSubPart.prototype.constructor=SelectorSubPart;var h=/^[0-9a-fA-F]$/,nonascii=/^[\u0080-\uFFFF]$/,nl=/\n|\r\n|\r|\f/;TokenStream.prototype=mix(new TokenStreamBase,{_getToken:function(a){var b,c=this._reader,d=null,e=c.getLine(),f=c.getCol();b=c.read();while(b){switch(b){case"/":c.peek()=="*"?d=this.commentToken(b,e,f):d=this.charToken(b,e,f);break;case"|":case"~":case"^":case"$":case"*":c.peek()=="="?d=this.comparisonToken(b,e,f):d=this.charToken(b,e,f);break;case'"':case"'":d=this.stringToken(b,e,f);break;case"#":isNameChar(c.peek())?d=this.hashToken(b,e,f):d=this.charToken(b,e,f);break;case".":isDigit(c.peek())?d=this.numberToken(b,e,f):d=this.charToken(b,e,f);break;case"-":c.peek()=="-"?d=this.htmlCommentEndToken(b,e,f):isNameStart(c.peek())?d=this.identOrFunctionToken(b,e,f):d=this.charToken(b,e,f);break;case"!":d=this.importantToken(b,e,f);break;case"@":d=this.atRuleToken(b,e,f);break;case":":d=this.notToken(b,e,f);break;case"<":d=this.htmlCommentStartToken(b,e,f);break;case"U":case"u":if(c.peek()=="+"){d=this.unicodeRangeToken(b,e,f);break};default:isDigit(b)?d=this.numberToken(b,e,f):isWhitespace(b)?d=this.whitespaceToken(b,e,f):isIdentStart(b)?d=this.identOrFunctionToken(b,e,f):d=this.charToken(b,e,f)}break}!d&&b==null&&(d=this.createToken(Tokens.EOF,null,e,f));return d},createToken:function(a,b,c,d,e){var f=this._reader;e=e||{};return{value:b,type:a,channel:e.channel,hide:e.hide||!1,startLine:c,startCol:d,endLine:f.getLine(),endCol:f.getCol()}},atRuleToken:function(a,b,c){var d=a,e=this._reader,f=Tokens.CHAR,g=!1,h,i;e.mark(),h=this.readName(),d=a+h,f=Tokens.type(d.toLowerCase());if(f==Tokens.CHAR||f==Tokens.UNKNOWN)f=Tokens.CHAR,d=a,e.reset();return this.createToken(f,d,b,c)},charToken:function(a,b,c){var d=Tokens.type(a);d==-1&&(d=Tokens.CHAR);return this.createToken(d,a,b,c)},commentToken:function(a,b,c){var d=this._reader,e=this.readComment(a);return this.createToken(Tokens.COMMENT,e,b,c)},comparisonToken:function(a,b,c){var d=this._reader,e=a+d.read(),f=Tokens.type(e)||Tokens.CHAR;return this.createToken(f,e,b,c)},hashToken:function(a,b,c){var d=this._reader,e=this.readName(a);return this.createToken(Tokens.HASH,e,b,c)},htmlCommentStartToken:function(a,b,c){var d=this._reader,e=a;d.mark(),e+=d.readCount(3);if(e=="")return this.createToken(Tokens.CDC,e,b,c);d.reset();return this.charToken(a,b,c)},identOrFunctionToken:function(a,b,c){var d=this._reader,e=this.readName(a),f=Tokens.IDENT;d.peek()=="("?(e+=d.read(),e.toLowerCase()=="url("?(f=Tokens.URI,e=this.readURI(e),e.toLowerCase()=="url("&&(f=Tokens.FUNCTION)):f=Tokens.FUNCTION):d.peek()==":"&&e.toLowerCase()=="progid"&&(e+=d.readTo("("),f=Tokens.IE_FUNCTION);return this.createToken(f,e,b,c)},importantToken:function(a,b,c){var d=this._reader,e=a,f=Tokens.CHAR,g,h;d.mark(),h=d.read();while(h){if(h=="/"){if(d.peek()!="*")break;g=this.readComment(h);if(g=="")break}else if(isWhitespace(h))e+=h+this.readWhitespace();else{if(/i/i.test(h)){g=d.readCount(8),/mportant/i.test(g)&&(e+=h+g,f=Tokens.IMPORTANT_SYM);break}break}h=d.read()}if(f==Tokens.CHAR){d.reset();return this.charToken(a,b,c)}return this.createToken(f,e,b,c)},notToken:function(a,b,c){var d=this._reader,e=a;d.mark(),e+=d.readCount(4);if(e.toLowerCase()==":not(")return this.createToken(Tokens.NOT,e,b,c);d.reset();return this.charToken(a,b,c)},numberToken:function(a,b,c){var d=this._reader,e=this.readNumber(a),f,g=Tokens.NUMBER,h=d.peek();isIdentStart(h)?(f=this.readName(d.read()),e+=f,/em/i.test(f)?g=Tokens.EMS:/ex/i.test(f)?g=Tokens.EXS:/px|cm|mm|in|pt|pc/i.test(f)?g=Tokens.LENGTH:/deg|rad|grad/i.test(f)?g=Tokens.ANGLE:/ms|s/i.test(f)?g=Tokens.TIME:/hz|khz/i.test(f)?g=Tokens.FREQ:/dpi|dpcm/i.test(f)?g=Tokens.RESOLUTION:g=Tokens.DIMENSION):h=="%"&&(e+=d.read(),g=Tokens.PERCENTAGE);return this.createToken(g,e,b,c)},stringToken:function(a,b,c){var d=a,e=a,f=this._reader,g=a,h=Tokens.STRING,i=f.read();while(i){e+=i;if(i==d&&g!="\\")break;if(isNewLine(f.peek())&&i!="\\"){h=Tokens.INVALID;break}g=i,i=f.read()}i==null&&(h=Tokens.INVALID);return this.createToken(h,e,b,c)},unicodeRangeToken:function(a,b,c){var d=this._reader,e=a,f,g=Tokens.CHAR;d.peek()=="+"&&(d.mark(),e+=d.read(),e+=this.readUnicodeRangePart(!0),e.length==2?d.reset():(g=Tokens.UNICODE_RANGE,e.indexOf("?")==-1&&d.peek()=="-"&&(d.mark(),f=d.read(),f+=this.readUnicodeRangePart(!1),f.length==1?d.reset():e+=f)));return this.createToken(g,e,b,c)},whitespaceToken:function(a,b,c){var d=this._reader,e=a+this.readWhitespace();return this.createToken(Tokens.S,e,b,c)},readUnicodeRangePart:function(a){var b=this._reader,c="",d=b.peek();while(isHexDigit(d)&&c.length<6)b.read(),c+=d,d=b.peek();if(a)while(d=="?"&&c.length<6)b.read(),c+=d,d=b.peek();return c},readWhitespace:function(){var a=this._reader,b="",c=a.peek();while(isWhitespace(c))a.read(),b+=c,c=a.peek();return b},readNumber:function(a){var b=this._reader,c=a,d=a==".",e=b.peek();while(e){if(isDigit(e))c+=b.read();else{if(e!=".")break;if(d)break;d=!0,c+=b.read()}e=b.peek()}return c},readString:function(){var a=this._reader,b=a.read(),c=b,d=b,e=a.peek();while(e){e=a.read(),c+=e;if(e==b&&d!="\\")break;if(isNewLine(a.peek())&&e!="\\"){c="";break}d=e,e=a.peek()}e==null&&(c="");return c},readURI:function(a){var b=this._reader,c=a,d="",e=b.peek();b.mark(),e=="'"||e=='"'?d=this.readString():d=this.readURL(),e=b.peek(),d==""||e!=")"?(c=a,b.reset()):c+=d+b.read();return c},readURL:function(){var a=this._reader,b="",c=a.peek();while(/^[!#$%&\\*-~]$/.test(c))b+=a.read(),c=a.peek();return b},readName:function(a){var b=this._reader,c=a||"",d=b.peek();while(d&&isNameChar(d))c+=b.read(),d=b.peek();return c},readComment:function(a){var b=this._reader,c=a||"",d=b.read();if(d=="*"){while(d){c+=d;if(d=="*"&&b.peek()=="/"){c+=b.read();break}d=b.read()}return c}return""}});var Tokens=[{name:"CDO"},{name:"CDC"},{name:"S",whitespace:!0},{name:"COMMENT",comment:!0,hide:!0,channel:"comment"},{name:"INCLUDES",text:"~="},{name:"DASHMATCH",text:"|="},{name:"PREFIXMATCH",text:"^="},{name:"SUFFIXMATCH",text:"$="},{name:"SUBSTRINGMATCH",text:"*="},{name:"STRING"},{name:"IDENT"},{name:"HASH"},{name:"IMPORT_SYM",text:"@import"},{name:"PAGE_SYM",text:"@page"},{name:"MEDIA_SYM",text:"@media"},{name:"FONT_FACE_SYM",text:"@font-face"},{name:"CHARSET_SYM",text:"@charset"},{name:"NAMESPACE_SYM",text:"@namespace"},{name:"IMPORTANT_SYM"},{name:"EMS"},{name:"EXS"},{name:"LENGTH"},{name:"ANGLE"},{name:"TIME"},{name:"FREQ"},{name:"DIMENSION"},{name:"PERCENTAGE"},{name:"NUMBER"},{name:"URI"},{name:"FUNCTION"},{name:"UNICODE_RANGE"},{name:"INVALID"},{name:"PLUS",text:"+"},{name:"GREATER",text:">"},{name:"COMMA",text:","},{name:"TILDE",text:"~"},{name:"NOT"},{name:"TOPLEFTCORNER_SYM",text:"@top-left-corner"},{name:"TOPLEFT_SYM",text:"@top-left"},{name:"TOPCENTER_SYM",text:"@top-center"},{name:"TOPRIGHT_SYM",text:"@top-right"},{name:"TOPRIGHTCORNER_SYM",text:"@top-right-corner"},{name:"BOTTOMLEFTCORNER_SYM",text:"@bottom-left-corner"},{name:"BOTTOMLEFT_SYM",text:"@bottom-left"},{name:"BOTTOMCENTER_SYM",text:"@bottom-center"},{name:"BOTTOMRIGHT_SYM",text:"@bottom-right"},{name:"BOTTOMRIGHTCORNER_SYM",text:"@bottom-right-corner"},{name:"LEFTTOP_SYM",text:"@left-top"},{name:"LEFTMIDDLE_SYM",text:"@left-middle"},{name:"LEFTBOTTOM_SYM",text:"@left-bottom"},{name:"RIGHTTOP_SYM",text:"@right-top"},{name:"RIGHTMIDDLE_SYM",text:"@right-middle"},{name:"RIGHTBOTTOM_SYM",text:"@right-bottom"},{name:"RESOLUTION",state:"media"},{name:"IE_FUNCTION"},{name:"CHAR"},{name:"PIPE",text:"|"},{name:"SLASH",text:"/"},{name:"MINUS",text:"-"},{name:"STAR",text:"*"},{name:"LBRACE",text:"{"},{name:"RBRACE",text:"}"},{name:"LBRACKET",text:"["},{name:"RBRACKET",text:"]"},{name:"EQUALS",text:"="},{name:"COLON",text:":"},{name:"SEMICOLON",text:";"},{name:"LPAREN",text:"("},{name:"RPAREN",text:")"},{name:"DOT",text:"."}];(function(){var a=[],b={};Tokens.UNKNOWN=-1,Tokens.unshift({name:"EOF"});for(var c=0,d=Tokens.length;c1&&b.warn("Don't use adjoining classes.",f.line,f.col,c)}}}})}}),CSSLint.addRule({id:"box-model",name:"Box Model",desc:"Don't use width or height when using padding or border.",browsers:"All",init:function(a,b){var c=this,d={border:1,"border-left":1,"border-right":1,"border-bottom":1,"border-top":1,padding:1,"padding-left":1,"padding-right":1,"padding-bottom":1,"padding-top":1},e;a.addListener("startrule",function(a){e={}}),a.addListener("property",function(a){var b=a.property;if(d[b])e[b]={line:b.line,col:b.col};else if(b=="width"||b=="height")e._flagProperty=b.text}),a.addListener("endrule",function(a){var f;if(e._flagProperty)for(f in d)d.hasOwnProperty(f)&&e[f]&&b.warn("Broken box model: using "+e._flagProperty+" with "+f+".",e[f].line,e[f].col,c)})}}),CSSLint.addRule({id:"display-property-grouping",name:"Display Property Grouping",desc:"Certain properties shouldn't be used with certain display property values.",browsers:"All",init:function(a,b){function f(a,d){e[a]&&b.warn(a+" can't be used with display: "+d+".",e[a].line,e[a].col,c)}var c=this,d={display:1,"float":1,height:1,width:1,margin:1,"margin-left":1,"margin-right":1,"margin-bottom":1,"margin-top":1,padding:1,"padding-left":1,"padding-right":1,"padding-bottom":1,"padding-top":1,"vertical-align":1},e;a.addListener("startrule",function(a){e={}}),a.addListener("property",function(a){var b=a.property;d[b]&&(e[b]={value:a.value.text,line:b.line,col:b.col})}),a.addListener("endrule",function(a){var b=e.display?e.display.value:null;if(b)switch(b){case"inline":f("height",b),f("width",b),f("margin",b),f("margin-left",b),f("margin-right",b),f("margin-top",b),f("margin-bottom",b),f("padding",b),f("padding-left",b),diff --git a/websdk/static/js/ace/worker-javascript.js b/websdk/static/js/ace/worker-javascript.js deleted file mode 100644 index 1156c45..0000000 --- a/websdk/static/js/ace/worker-javascript.js +++ /dev/null @@ -1 +0,0 @@ -function initSender(){var a=require("pilot/event_emitter").EventEmitter,b=require("pilot/oop"),c=function(){};(function(){b.implement(this,a),this.callback=function(a,b){postMessage({type:"call",id:b,data:a})},this.emit=function(a,b){postMessage({type:"event",name:a,data:b})}}).call(c.prototype);return new c}function initBaseUrls(a){require.tlns=a}var console={log:function(a){postMessage({type:"log",data:a})}},window={console:console},require=function(a){var b=require.modules[a];if(b){b.initialized||(b.exports=b.factory().exports,b.initialized=!0);return b.exports}var c=a.split("/");c[0]=require.tlns[c[0]]||c[0],path=c.join("/")+".js",require.id=a,importScripts(path);return require(a)};require.modules={},require.tlns={};var define=function(a,b,c){arguments.length==2?c=b:arguments.length==1&&(c=a,a=require.id);a.indexOf("text/")!==0&&(require.modules[a]={factory:function(){var a={exports:{}},b=c(require,a.exports,a);b&&(a.exports=b);return a}})},main,sender;onmessage=function(a){var b=a.data;if(b.command)main[b.command].apply(main,b.args);else if(b.init){initBaseUrls(b.tlns),require("pilot/fixoldbrowsers"),sender=initSender();var c=require(b.module)[b.classname];main=new c(sender)}else b.event&&sender&&sender._dispatchEvent(b.event,b.data)},define("pilot/fixoldbrowsers",["require","exports","module"],function(a,b,c){if(!Function.prototype.bind){var d=Array.prototype.slice;Function.prototype.bind=function(b){var c=this;if(typeof c.apply!="function"||typeof c.call!="function")return new TypeError;var e=d.call(arguments),f=function a(){if(this instanceof a){var b=Object.create(c.prototype);c.apply(b,e.concat(d.call(arguments)));return b}return c.call.apply(c,e.concat(d.call(arguments)))};f.length=typeof c=="function"?Math.max(c.length-e.length,0):0;return f}}var e=Function.prototype.call,f=Array.prototype,g=Object.prototype,h=e.bind(g.hasOwnProperty),i,j,k,l,m;if(m=h(g,"__defineGetter__"))i=e.bind(g.__defineGetter__),j=e.bind(g.__defineSetter__),k=e.bind(g.__lookupGetter__),l=e.bind(g.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return Object.prototype.toString.call(b)==="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b,c){var d=+this.length;for(var e=0;e=2)var e=arguments[1];else do{if(d in this){e=this[d++];break}if(++d>=c)throw new TypeError}while(!0);for(;d=2)var e=arguments[1];else do{if(d in this){e=this[d--];break}if(--d<0)throw new TypeError}while(!0);for(;d>=0;d--)d in this&&(e=b.call(null,e,this[d],d,this));return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=this.length;if(!c)return-1;var d=arguments[1]||0;if(d>=c)return-1;d<0&&(d+=c);for(;d=0;d--){if(!h(this,d))continue;if(b===this[d])return d}return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||b.constructor.prototype});if(!Object.getOwnPropertyDescriptor){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(n+b);if(!h(b,c))return undefined;var d,e,f;d={enumerable:!0,configurable:!0};if(m){var i=b.__proto__;b.__proto__=g;var e=k(b,c),f=l(b,c);b.__proto__=i;if(e||f){e&&(descriptor.get=e),f&&(descriptor.set=f);return descriptor}}descriptor.value=b[c];return descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={"__proto__":null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}typeof c!="undefined"&&Object.defineProperties(d,c);return d});if(!Object.defineProperty){var o="Property description must be an object: ",p="Object.defineProperty called on non-object: ",q="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function")throw new TypeError(p+b);if(typeof b!="object"||b===null)throw new TypeError(o+d);if(h(d,"value"))if(m&&(k(b,c)||l(b,c))){var e=b.__proto__;b.__proto__=g,delete b[c],b[c]=d.value,b.prototype}else b[c]=d.value;else{if(!m)throw new TypeError(q);h(d,"get")&&i(b,c,d.get),h(d,"set")&&j(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)h(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(r){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){return!0});if(!Object.keys){var s=!0,t=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=t.length;for(var v in{toString:null})s=!1;Object.keys=function a(b){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError("Object.keys called on a non-object");var a=[];for(var c in b)h(b,c)&&a.push(c);if(s)for(var d=0,e=u;d=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;k.constructor=b;return k}return a.apply(this,arguments)},c=new RegExp("^(?:((?:[+-]\\d\\d)?\\d\\d\\d\\d)(?:-(\\d\\d)(?:-(\\d\\d))?)?)?(?:T(\\d\\d):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?)?(?:Z|([+-])(\\d\\d):(\\d\\d))?$");for(var d in a)b[d]=a[d];b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();var f=e[0]===undefined;for(var g=0;g<10;g++){if(g===7)continue;e[g]=+(e[g]||(g<3?1:0)),g===1&&e[g]--}if(f)return((e[3]*60+e[4])*60+e[5])*1e3+e[6];var h=(e[8]*60+e[9])*60*1e3;e[6]==="-"&&(h=-h);return a.UTC.apply(this,e.slice(0,7))+h}return a.parse.apply(this,arguments)};return b}(Date));if(!String.prototype.trim){var w=/^\s\s*/,x=/\s\s*$/;String.prototype.trim=function(){return String(this).replace(w,"").replace(x,"")}}}),define("pilot/event_emitter",["require","exports","module"],function(a,b,c){var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!!c&&!!c.length){var b=b||{};b.type=a;for(var d=0;d=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length);return a},this.insert=function(a,b){if(b.length==0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];this._dispatchEvent("changeStart"),a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),this._dispatchEvent("changeEnd");return a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c),this._dispatchEvent("changeStart");var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:d}),this._dispatchEvent("changeEnd");return c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this._dispatchEvent("changeStart"),this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;this._dispatchEvent("changeStart");if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);this._dispatchEvent("changeEnd");return a.start},this.removeInLine=function(a,b,c){if(b!=c){var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this._dispatchEvent("changeStart"),this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};this._dispatchEvent("change",{data:i}),this._dispatchEvent("changeEnd");return d.start}},this.removeLines=function(a,b){this._dispatchEvent("changeStart");var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};this._dispatchEvent("change",{data:e}),this._dispatchEvent("changeEnd");return d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this._dispatchEvent("changeStart"),this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._dispatchEvent("change",{data:g}),this._dispatchEvent("changeEnd")},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this._dispatchEvent("changeStart"),this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;this._dispatchEvent("changeEnd");return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),define("ace/range",["require","exports","module"],function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;b=this.compare(c.row,c.column);if(b==1){b=this.compare(d.row,d.column);return b==1?2:b==0?1:0}if(b==-1)return-2;b=this.compare(d.row,d.column);return b==-1?-1:b==1?42:0},this.containsRange=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)||this.isStart(a,b)?!1:!0;return!1},this.insideStart=function(a,b){if(this.compare(a,b)==0)return this.isEnd(a,b)?!1:!0;return!1},this.insideEnd=function(a,b){if(this.compare(a,b)==0)return this.isStart(a,b)?!1:!0;return!1},this.compare=function(a,b){if(!this.isMultiLine()&&a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.rowthis.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0);return c}}).call(f.prototype)}),define("pilot/lang",["require","exports","module"],function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(i=0,l=a.length;io)o+=z.indent;!a&&!bP()&&!f&&z.strict&&i["(context)"]["(global)"]&&bd('Missing "use strict" statement.'),c=bQ(),K=f,o-=z.indent,bs()}bl("}",h),o=e}else a?((!b||z.curly)&&bd("Expected '{a}' and instead saw '{b}'.",w,"{",w.value),y=!0,c=[bO()],y=!1):bf("Expected '{a}' and instead saw '{b}'.",w,"{",w.value);i["(verb)"]=null,F=g,n=d,a&&z.noempty&&(!c||c.length===0)&&bd("Empty block.");return c}function bQ(a){var b=[],c,d;while(!w.reach&&w.id!=="(end)")w.id===";"?(bd("Unnecessary semicolon."),bl(";")):b.push(bO());return b}function bP(){if(w.value==="use strict"){K&&bd('Unnecessary "use strict".'),bl(),bl(";"),K=!0,z.newcap=!0,z.undef=!0;return!0}return!1}function bO(a){var b=o,c,d=F,e=w;if(e.id===";")bd("Unnecessary semicolon.",e),bl(";");else{e.identifier&&!e.reserved&&bk().id===":"&&(bl(),bl(":"),F=Object.create(d),bi(e.value,"label"),w.labelled||bd("Label '{a}' on {b} statement.",w,e.value,w.value),Y.test(e.value+":")&&bd("Label '{a}' looks like a javascript url.",e,e.value),w.label=e.value,e=w),a||bs(),c=bm(0,!0),e.block||(!z.expr&&(!c||!c.exps)?bd("Expected an assignment or function call and instead saw an expression.",N):z.nonew&&c.id==="("&&c.left.id==="new"&&bd("Do not use 'new' for side effects."),w.id!==";"?!z.asi&&(!z.lastsemic||w.id!="}"||w.line!=N.line)&&be("Missing semicolon.",N.line,N.from+N.value.length):(bn(N,w),bl(";"),bq(N,w))),o=b,F=d;return c}}function bN(a){var b=0,c;if(w.id===";"&&!y)for(;;){c=bk(b);if(c.reach)return;if(c.id!=="(endline)"){if(c.id==="function"){bd("Inner functions should be listed at the top of the outer function.",c);break}bd("Unreachable '{a}' after '{b}'.",c,c.value,a);break}b+=1}}function bM(a){var b=bL(a);if(b)return b;N.id==="function"&&w.id==="("?bd("Missing name in function declaration."):bf("Expected an identifier and instead saw '{a}'.",w,w.value)}function bL(a){if(w.identifier){bl(),N.reserved&&!z.es5&&(!a||N.value!="undefined")&&bd("Expected an identifier and instead saw '{a}' (a reserved word).",N,N.id);return N.value}}function bK(a,b){var c=bv(a,150);c.led=function(a){z.plusplus?bd("Unexpected use of '{a}'.",this,this.id):(!a.identifier||a.reserved)&&a.id!=="."&&a.id!=="["&&bd("Bad operand.",this),this.left=a;return this};return c}function bJ(a){bv(a,20).exps=!0;return bE(a,function(a,b){z.bitwise&&bd("Unexpected use of '{a}'.",b,b.id),bq(C,N),bq(N,w);if(a){if(a.id==="."||a.id==="["||a.identifier&&!a.reserved){bm(19);return b}a===L["function"]&&bd("Expected an identifier in an assignment, and instead saw a function invocation.",N);return b}bf("Bad assignment.",b)},20)}function bI(a,b,c){var d=bv(a,c);bz(d),d.led=typeof b=="function"?b:function(a){z.bitwise&&bd("Unexpected use of '{a}'.",this,this.id),this.left=a,this.right=bm(c);return this};return d}function bH(a,b){bv(a,20).exps=!0;return bE(a,function(a,b){var c;b.left=a,A[a.value]===!1&&F[a.value]["(global)"]===!0?bd("Read only.",a):a["function"]&&bd("'{a}' is a function.",a,a.value);if(a){if(a.id==="."||a.id==="["){(!a.left||a.left.value==="arguments")&&bd("Bad assignment.",b),b.right=bm(19);return b}if(a.identifier&&!a.reserved){i[a.value]==="exception"&&bd("Do not assign to the exception parameter.",a),b.right=bm(19);return b}a===L["function"]&&bd("Expected an identifier in an assignment and instead saw a function invocation.",N)}bf("Bad assignment.",b)},20)}function bG(a){return a&&(a.type==="(number)"&&+a.value===0||a.type==="(string)"&&a.value===""||a.type==="null"&&!z.eqnull||a.type==="true"||a.type==="false"||a.type==="undefined")}function bF(a,b){var c=bv(a,100);c.led=function(a){br(C,N),bq(N,w);var c=bm(100);a&&a.id==="NaN"||c&&c.id==="NaN"?bd("Use the isNaN function to compare with NaN.",this):b&&b.apply(this,[a,c]),a.id==="!"&&bd("Confusing use of '{a}'.",a,"!"),c.id==="!"&&bd("Confusing use of '{a}'.",a,"!"),this.left=a,this.right=c;return this};return c}function bE(a,b,c,d){var e=bv(a,c);bz(e),e.led=function(a){d||(br(C,N),bq(N,w));if(typeof b=="function")return b(a,this);this.left=a,this.right=bm(c);return this};return e}function bD(a,b){return bC(a,function(){typeof b=="function"&&b(this);return this})}function bC(a,b){var c=bB(a,b);c.identifier=c.reserved=!0;return c}function bB(a,b){var c=bw(a);c.type=a,c.nud=b;return c}function bA(a,b){var c=bv(a,150);bz(c),c.nud=typeof b=="function"?b:function(){this.right=bm(150),this.arity="unary";if(this.id==="++"||this.id==="--")z.plusplus?bd("Unexpected use of '{a}'.",this,this.id):(!this.right.identifier||this.right.reserved)&&this.right.id!=="."&&this.right.id!=="["&&bd("Bad operand.",this);return this};return c}function bz(a){var b=a.id.charAt(0);if(b>="a"&&b<="z"||b>="A"&&b<="Z")a.identifier=a.reserved=!0;return a}function by(a,b){var c=bx(a,b);c.block=!0;return c}function bx(a,b){var c=bw(a);c.identifier=c.reserved=!0,c.fud=b;return c}function bw(a){return bv(a,0)}function bv(a,b){var c=L[a];if(!c||typeof c!="object")L[a]=c={id:a,lbp:b,value:a};return c}function bu(){N.line!==w.line?z.laxbreak||bd("Bad line breaking before '{a}'.",N,w.id):N.character!==w.from&&z.white&&bd("Unexpected space after '{a}'.",w,N.value),bl(","),bq(N,w)}function bt(a){a=a||N,a.line!==w.line&&bd("Line breaking error '{a}'.",a,a.value)}function bs(a){var b;z.white&&w.id!=="(end)"&&(b=o+(a||0),w.from!==b&&bd("Expected '{a}' to have an indentation at {b} instead at {c}.",w,w.value,b,w.from))}function br(a,b){a=a||N,b=b||w,!z.laxbreak&&a.line!==b.line?bd("Bad line breaking before '{a}'.",b,b.id):z.white&&(a=a||N,b=b||w,a.character===b.from&&bd("Missing space after '{a}'.",w,a.value))}function bq(a,b){z.white&&(a=a||N,b=b||w,a.line===b.line&&a.character===b.from&&bd("Missing space after '{a}'.",w,a.value))}function bp(a,b){a=a||N,b=b||w,z.white&&!a.comment&&a.line===b.line&&bn(a,b)}function bo(a,b){a=a||N,b=b||w,z.white&&(a.character!==b.from||a.line!==b.line)&&bd("Unexpected space before '{a}'.",b,b.value)}function bn(a,b){a=a||N,b=b||w,z.white&&a.character!==b.from&&a.line===b.line&&bd("Unexpected space after '{a}'.",b,a.value)}function bm(b,c){var d,e=!1;w.id==="(end)"&&bf("Unexpected early end of program.",N),bl(),c&&(a="anonymous",i["(verb)"]=N.value);if(c===!0&&N.fud)d=N.fud();else{if(N.nud)d=N.nud();else{if(w.type==="(number)"&&N.id==="."){bd("A leading decimal point can be confused with a dot: '.{a}'.",N,w.value),bl();return N}bf("Expected an identifier and instead saw '{a}'.",N,N.id)}while(b=z.maxerr&&bc("Too many errors.",i,h);return j}function bc(a,b,c){var d=Math.floor(b/r.length*100);throw{name:"JSHintError",line:b,character:c,message:a+" ("+d+"% scanned)."}}function bb(){z.couch&&ba(A,f),z.rhino&&ba(A,E),z.prototypejs&&ba(A,D),z.node&&ba(A,x),z.devel&&ba(A,g),z.browser&&ba(A,e),z.jquery&&ba(A,q),z.mootools&&ba(A,v),z.wsh&&ba(A,Q),z.globalstrict&&z.strict!==!1&&(z.strict=!0)}function ba(a,b){var c;for(c in b)_(b,c)&&(a[c]=b[c])}function _(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function $(){}"use strict";var a,b={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},c={asi:!0,bitwise:!0,boss:!0,browser:!0,couch:!0,curly:!0,debug:!0,devel:!0,eqeqeq:!0,eqnull:!0,es5:!0,evil:!0,expr:!0,forin:!0,globalstrict:!0,immed:!0,jquery:!0,latedef:!0,laxbreak:!0,loopfunc:!0,mootools:!0,newcap:!0,noarg:!0,node:!0,noempty:!0,nonew:!0,nomen:!0,onevar:!0,passfail:!0,plusplus:!0,prototypejs:!0,regexdash:!0,regexp:!0,rhino:!0,undef:!0,shadow:!0,strict:!0,sub:!0,supernew:!0,trailing:!0,white:!0,wsh:!0},e={ArrayBuffer:!1,ArrayBufferView:!1,addEventListener:!1,applicationCache:!1,blur:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,DataView:!1,defaultStatus:!1,document:!1,event:!1,FileReader:!1,Float32Array:!1,Float64Array:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,history:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Image:!1,length:!1,localStorage:!1,location:!1,moveBy:!1,moveTo:!1,name:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,setInterval:!1,setTimeout:!1,status:!1,top:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,WebSocket:!1,window:!1,Worker:!1,XMLHttpRequest:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},f={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1},g={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"/":"\\/","\\":"\\\\"},i,j=["closure","exception","global","label","outer","unused","var"],k,l,m,n,o,p,q={$:!1,jQuery:!1},r,s,t,u,v={$:!1,$$:!1,Assets:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,Iframe:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},w,x={__filename:!1,__dirname:!1,exports:!1,Buffer:!1,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1},y,z,A,B,C,D={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},E={defineClass:!1,deserialize:!1,gc:!1,help:!1,load:!1,loadClass:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},F,G,H,I={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},J={E:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,MAX_VALUE:!0,MIN_VALUE:!0,NEGATIVE_INFINITY:!0,PI:!0,POSITIVE_INFINITY:!0,SQRT1_2:!0,SQRT2:!0},K,L={},M,N,O,P,Q={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0},R=/@cc|<\/?|script|\]\s*\]|<\s*!|</i,S=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,T=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jshint|jslint|members?|global)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/,U=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,V=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,W=/\*\/|\/\*/,X=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,Y=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,Z=/^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/;typeof Array.isArray!="function"&&(Array.isArray=function(a){return Object.prototype.toString.apply(a)==="[object Array]"}),typeof Object.create!="function"&&(Object.create=function(a){$.prototype=a;return new $}),typeof Object.keys!="function"&&(Object.keys=function(a){var b=[],c;for(c in a)_(a,c)&&b.push(c);return b}),typeof String.prototype.entityify!="function"&&(String.prototype.entityify=function(){return this.replace(/&/g,"&").replace(//g,">")}),typeof String.prototype.isAlpha!="function"&&(String.prototype.isAlpha=function(){return this>="a"&&this<="z￿"||this>="A"&&this<="Z￿"}),typeof String.prototype.isDigit!="function"&&(String.prototype.isDigit=function(){return this>="0"&&this<="9"}),typeof String.prototype.supplant!="function"&&(String.prototype.supplant=function(a){return this.replace(/\{([^{}]*)\}/g,function(b,c){var d=a[c];return typeof d=="string"||typeof d=="number"?d:b})}),typeof String.prototype.name!="function"&&(String.prototype.name=function(){if(X.test(this))return this;if(U.test(this))return'"'+this.replace(V,function(a){var b=h[a];if(b)return b;return"\\u"+("0000"+a.charCodeAt().toString(16)).slice(-4)})+'"';return'"'+this+'"'});var bh=function(){function g(a,e){var f,g;a==="(color)"||a==="(range)"?g={type:a}:a==="(punctuator)"||a==="(identifier)"&&_(L,e)?g=L[e]||L["(error)"]:g=L[a],g=Object.create(g),(a==="(string)"||a==="(range)")&&Y.test(e)&&be("Script URL.",d,c),a==="(identifier)"&&(g.identifier=!0,e==="__iterator__"||e==="__proto__"?bg("Reserved name '{a}'.",d,c,e):z.nomen&&(e.charAt(0)==="_"||e.charAt(e.length-1)==="_")&&be("Unexpected {a} in '{b}'.",d,c,"dangling '_'",e)),g.value=e,g.line=d,g.character=b,g.from=c,f=g.id,f!=="(endline)"&&(B=f&&("(,=:[!&|?{};".indexOf(f.charAt(f.length-1))>=0||f==="return"));return g}function f(){var a,c;if(d>=r.length)return!1;b=1,e=r[d],d+=1,a=e.search(/ \t/),a>=0&&be("Mixed spaces and tabs.",d,a+1),e=e.replace(/\t/g,M),a=e.search(S),a>=0&&be("Unsafe character.",d,a),z.maxlen&&z.maxlen=32&&c<=126&&c!==34&&c!==92&&c!==39&&be("Unnecessary escapement.",d,b),b+=a,h=String.fromCharCode(c)}var h,i,j="";p&&a!=='"'&&be("Strings must use doublequote.",d,b),i=0;for(;;){while(i>=e.length)i=0,f()||bg("Unclosed string.",d,c);h=e.charAt(i);if(h===a){b+=1,e=e.substr(i+1);return g("(string)",j,a)}if(h<" "){if(h==="\n"||h==="\r")break;be("Control character in string: {a}.",d,b+i,e.slice(0,i))}else if(h==="\\"){i+=1,b+=1,h=e.charAt(i);switch(h){case"\\":case'"':case"/":break;case"'":p&&be("Avoid \\'.",d,b);break;case"b":h="\b";break;case"f":h="\f";break;case"n":h="\n";break;case"r":h="\r";break;case"t":h="\t";break;case"u":k(4);break;case"v":p&&be("Avoid \\v.",d,b),h=" ";break;case"x":p&&be("Avoid \\x-.",d,b),k(2);break;default:be("Bad escapement.",d,b)}}j+=h,b+=1,i+=1}}function s(a){var d=a.exec(e),f;if(d){n=d[0].length,f=d[1],h=f.charAt(0),e=e.substr(n),c=b+n-f.length,b+=n;return f}}var a,h,i,j,k,l,m,n,o,q,r;for(;;){if(!e)return g(f()?"(endline)":"(end)","");r=s(T);if(!r){r="",h="";while(e&&e<"!")e=e.substr(1);e&&bg("Unexpected '{a}'.",d,b,e.substr(0,1))}else{if(h.isAlpha()||h==="_"||h==="$")return g("(identifier)",r);if(h.isDigit()){isFinite(Number(r))||be("Bad number '{a}'.",d,b,r),e.substr(0,1).isAlpha()&&be("Missing space after '{a}'.",d,b,r),h==="0"&&(j=r.substr(1,1),j.isDigit()?N.id!=="."&&be("Don't use extra leading zeros '{a}'.",d,b,r):p&&(j==="x"||j==="X")&&be("Avoid 0x-. '{a}'.",d,b,r)),r.substr(r.length-1)==="."&&be("A trailing decimal point can be confused with a dot '{a}'.",d,b,r);return g("(number)",r)}switch(r){case'"':case"'":return t(r);case"//":G&&be("Unexpected comment.",d,b),e="",N.comment=!0;break;case"/*":G&&be("Unexpected comment.",d,b);for(;;){m=e.search(W);if(m>=0)break;f()||bg("Unclosed comment.",d,b)}b+=m+2,e.substr(m,1)==="/"&&bg("Nested comment.",d,b),e=e.substr(m+2),N.comment=!0;break;case"/*members":case"/*member":case"/*jshint":case"/*jslint":case"/*global":case"*/":return{value:r,type:"special",line:d,character:b,from:c};case"":break;case"/":N.id==="/="&&bg("A regular expression literal can be confused with '/='.",d,c);if(B){k=0,i=0,n=0;for(;;){a=!0,h=e.charAt(n),n+=1;switch(h){case"":bg("Unclosed regular expression.",d,c);return;case"/":k>0&&be("Unescaped '{a}'.",d,c+n,"/"),h=e.substr(0,n-1),q={g:!0,i:!0,m:!0};while(q[e.charAt(n)]===!0)q[e.charAt(n)]=!1,n+=1;b+=n,e=e.substr(n),q=e.charAt(0),(q==="/"||q==="*")&&bg("Confusing regular expression.",d,c);return g("(regexp)",h);case"\\":h=e.charAt(n),h<" "?be("Unexpected control character in regular expression.",d,c+n):h==="<"&&be("Unexpected escaped character '{a}' in regular expression.",d,c+n,h),n+=1;break;case"(":k+=1,a=!1;if(e.charAt(n)==="?"){n+=1;switch(e.charAt(n)){case":":case"=":case"!":n+=1;break;default:be("Expected '{a}' and instead saw '{b}'.",d,c+n,":",e.charAt(n))}}else i+=1;break;case"|":a=!1;break;case")":k===0?be("Unescaped '{a}'.",d,c+n,")"):k-=1;break;case" ":q=1;while(e.charAt(n)===" ")n+=1,q+=1;q>1&&be("Spaces are hard to count. Use {{a}}.",d,c+n,q);break;case"[":h=e.charAt(n),h==="^"&&(n+=1,z.regexp?be("Insecure '{a}'.",d,c+n,h):e.charAt(n)==="]"&&bg("Unescaped '{a}'.",d,c+n,"^")),q=!1,h==="]"&&(be("Empty class.",d,c+n-1),q=!0);klass:do{h=e.charAt(n),n+=1;switch(h){case"[":case"^":be("Unescaped '{a}'.",d,c+n,h),q=!0;break;case"-":q?q=!1:(be("Unescaped '{a}'.",d,c+n,"-"),q=!0);break;case"]":!q&&!z.regexdash&&be("Unescaped '{a}'.",d,c+n-1,"-");break klass;case"\\":h=e.charAt(n),h<" "?be("Unexpected control character in regular expression.",d,c+n):h==="<"&&be("Unexpected escaped character '{a}' in regular expression.",d,c+n,h),n+=1,q=!0;break;case"/":be("Unescaped '{a}'.",d,c+n-1,"/"),q=!0;break;case"<":q=!0;break;default:q=!0}}while(h);break;case".":z.regexp&&be("Insecure '{a}'.",d,c+n,h);break;case"]":case"?":case"{":case"}":case"+":case"*":be("Unescaped '{a}'.",d,c+n,h)}if(a)switch(e.charAt(n)){case"?":case"+":case"*":n+=1,e.charAt(n)==="?"&&(n+=1);break;case"{":n+=1,h=e.charAt(n),(h<"0"||h>"9")&&be("Expected a number and instead saw '{a}'.",d,c+n,h),n+=1,o=+h;for(;;){h=e.charAt(n);if(h<"0"||h>"9")break;n+=1,o=+h+o*10}l=o;if(h===","){n+=1,l=Infinity,h=e.charAt(n);if(h>="0"&&h<="9"){n+=1,l=+h;for(;;){h=e.charAt(n);if(h<"0"||h>"9")break;n+=1,l=+h+l*10}}}e.charAt(n)!=="}"?be("Expected '{a}' and instead saw '{b}'.",d,c+n,"}",h):n+=1,e.charAt(n)==="?"&&(n+=1),o>l&&be("'{a}' should not be greater than '{b}'.",d,c+n,o,l)}}h=e.substr(0,n-1),b+=n,e=e.substr(n);return g("(regexp)",h)}return g("(punctuator)",r);case"#":return g("(punctuator)",r);default:return g("(punctuator)",r)}}}}}}();bB("(number)",function(){return this}),bB("(string)",function(){return this}),L["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var b=this.value,c=F[b],d;typeof c=="function"?c=undefined:typeof c=="boolean"&&(d=i,i=k[0],bi(b,"var"),c=i,i=d);if(i===c)switch(i[b]){case"unused":i[b]="var";break;case"unction":i[b]="function",this["function"]=!0;break;case"function":this["function"]=!0;break;case"label":bd("'{a}' is a statement label.",N,b)}else if(i["(global)"])a!="typeof"&&a!="delete"&&z.undef&&typeof A[b]!="boolean"&&bd("'{a}' is not defined.",N,b),bT(N);else switch(i[b]){case"closure":case"function":case"var":case"unused":bd("'{a}' used out of scope.",N,b);break;case"label":bd("'{a}' is a statement label.",N,b);break;case"outer":case"global":break;default:if(c===!0)i[b]=!0;else if(c===null)bd("'{a}' is not allowed.",N,b),bT(N);else if(typeof c!="object")a!="typeof"&&a!="delete"&&z.undef?bd("'{a}' is not defined.",N,b):i[b]=!0,bT(N);else switch(c[b]){case"function":case"unction":this["function"]=!0,c[b]="closure",i[b]=c["(global)"]?"global":"outer";break;case"var":case"unused":c[b]="closure",i[b]=c["(global)"]?"global":"outer";break;case"closure":case"parameter":i[b]=c["(global)"]?"global":"outer";break;case"label":bd("'{a}' is a statement label.",N,b)}}return this},led:function(){bf("Expected an operator and instead saw '{a}'.",w,w.value)}},bB("(regexp)",function(){return this}),bw("(endline)"),bw("(begin)"),bw("(end)").reach=!0,bw(""),bw("(error)").reach=!0,bw("}").reach=!0,bw(")"),bw("]"),bw('"').reach=!0,bw("'").reach=!0,bw(";"),bw(":").reach=!0,bw(","),bw("#"),bw("@"),bC("else"),bC("case").reach=!0,bC("catch"),bC("default").reach=!0,bC("finally"),bD("arguments",function(a){K&&i["(global)"]&&bd("Strict violation.",a)}),bD("eval"),bD("false"),bD("Infinity"),bD("NaN"),bD("null"),bD("this",function(a){K&&(i["(statement)"]&&i["(name)"].charAt(0)>"Z"||i["(global)"])&&bd("Strict violation.",a)}),bD("true"),bD("undefined"),bH("=","assign",20),bH("+=","assignadd",20),bH("-=","assignsub",20),bH("*=","assignmult",20),bH("/=","assigndiv",20).nud=function(){bf("A regular expression literal can be confused with '/='.")},bH("%=","assignmod",20),bJ("&=","assignbitand",20),bJ("|=","assignbitor",20),bJ("^=","assignbitxor",20),bJ("<<=","assignshiftleft",20),bJ(">>=","assignshiftright",20),bJ(">>>=","assignshiftrightunsigned",20),bE("?",function(a,b){b.left=a,b.right=bm(10),bl(":"),b["else"]=bm(10);return b},30),bE("||","or",40),bE("&&","and",50),bI("|","bitor",70),bI("^","bitxor",80),bI("&","bitand",90),bF("==",function(a,b){var c=z.eqnull&&(a.value=="null"||b.value=="null");!c&&z.eqeqeq?bd("Expected '{a}' and instead saw '{b}'.",this,"===","=="):bG(a)?bd("Use '{a}' to compare with '{b}'.",this,"===",a.value):bG(b)&&bd("Use '{a}' to compare with '{b}'.",this,"===",b.value);return this}),bF("==="),bF("!=",function(a,b){z.eqeqeq?bd("Expected '{a}' and instead saw '{b}'.",this,"!==","!="):bG(a)?bd("Use '{a}' to compare with '{b}'.",this,"!==",a.value):bG(b)&&bd("Use '{a}' to compare with '{b}'.",this,"!==",b.value);return this}),bF("!=="),bF("<"),bF(">"),bF("<="),bF(">="),bI("<<","shiftleft",120),bI(">>","shiftright",120),bI(">>>","shiftrightunsigned",120),bE("in","in",120),bE("instanceof","instanceof",120),bE("+",function(a,b){var c=bm(130);if(a&&c&&a.id==="(string)"&&c.id==="(string)"){a.value+=c.value,a.character=c.character,Y.test(a.value)&&bd("JavaScript URL.",a);return a}b.left=a,b.right=c;return b},130),bA("+","num"),bA("+++",function(){bd("Confusing pluses."),this.right=bm(150),this.arity="unary";return this}),bE("+++",function(a){bd("Confusing pluses."),this.left=a,this.right=bm(130);return this},130),bE("-","sub",130),bA("-","neg"),bA("---",function(){bd("Confusing minuses."),this.right=bm(150),this.arity="unary";return this}),bE("---",function(a){bd("Confusing minuses."),this.left=a,this.right=bm(130);return this},130),bE("*","mult",140),bE("/","div",140),bE("%","mod",140),bK("++","postinc"),bA("++","preinc"),L["++"].exps=!0,bK("--","postdec"),bA("--","predec"),L["--"].exps=!0,bA("delete",function(){var a=bm(0);(!a||a.id!=="."&&a.id!=="[")&&bd("Variables should not be deleted."),this.first=a;return this}).exps=!0,bA("~",function(){z.bitwise&&bd("Unexpected '{a}'.",this,"~"),bm(150);return this}),bA("!",function(){this.right=bm(150),this.arity="unary",b[this.right.id]===!0&&bd("Confusing use of '{a}'.",this,"!");return this}),bA("typeof","typeof"),bA("new",function(){var a=bm(155),b;if(a&&a.id!=="function")if(a.identifier){a["new"]=!0;switch(a.value){case"Object":bd("Use the object literal notation {}.",N);break;case"Number":case"String":case"Boolean":case"Math":case"JSON":bd("Do not use {a} as a constructor.",N,a.value);break;case"Function":z.evil||bd("The Function constructor is eval.");break;case"Date":case"RegExp":break;default:a.id!=="function"&&(b=a.value.substr(0,1),z.newcap&&(b<"A"||b>"Z")&&bd("A constructor name should start with an uppercase letter.",N))}}else a.id!=="."&&a.id!=="["&&a.id!=="("&&bd("Bad constructor.",N);else z.supernew||bd("Weird construction. Delete 'new'.",this);bn(N,w),w.id!=="("&&!z.supernew&&bd("Missing '()' invoking a constructor."),this.first=a;return this}),L["new"].exps=!0,bA("void").exps=!0,bE(".",function(a,b){bn(C,N),bo();var c=bM();typeof c=="string"&&bS(c),b.left=a,b.right=c,z.noarg&&a&&a.value==="arguments"&&(c==="callee"||c==="caller")?bd("Avoid arguments.{a}.",a,c):!z.evil&&a&&a.value==="document"&&(c==="write"||c==="writeln")&&bd("document.write can be a form of eval.",a),!z.evil&&(c==="eval"||c==="execScript")&&bd("eval is evil.");return b},160,!0),bE("(",function(a,b){C.id!=="}"&&C.id!==")"&&bo(C,N),bp(),z.immed&&!a.immed&&a.id==="function"&&bd("Wrap an immediate function invocation in parentheses to assist the reader in understanding that the expression is the result of a function, and not the function itself.");var c=0,d=[];a&&a.type==="(identifier)"&&a.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&a.value!=="Number"&&a.value!=="String"&&a.value!=="Boolean"&&a.value!=="Date"&&(a.value==="Math"?bd("Math is not a function.",a):z.newcap&&bd("Missing 'new' prefix when invoking a constructor.",a));if(w.id!==")")for(;;){d[d.length]=bm(10),c+=1;if(w.id!==",")break;bu()}bl(")"),bp(C,N),typeof a=="object"&&(a.value==="parseInt"&&c===1&&bd("Missing radix parameter.",a),z.evil||(a.value==="eval"||a.value==="Function"||a.value==="execScript"?bd("eval is evil.",a):d[0]&&d[0].id==="(string)"&&(a.value==="setTimeout"||a.value==="setInterval")&&bd("Implied eval is evil. Pass a function instead of a string.",a)),!a.identifier&&a.id!=="."&&a.id!=="["&&a.id!=="("&&a.id!=="&&"&&a.id!=="||"&&a.id!=="?"&&bd("Bad invocation.",a)),b.left=a;return b},155,!0).exps=!0,bA("(",function(){bp(),w.id==="function"&&(w.immed=!0);var a=bm(0);bl(")",this),bp(C,N),z.immed&&a.id==="function"&&(w.id==="("?bd("Move the invocation into the parens that contain the function.",w):bd("Do not wrap function literals in parens unless they are to be immediately invoked.",this));return a}),bE("[",function(a,b){bo(C,N),bp();var c=bm(0),d;c&&c.type==="(string)"&&(!z.evil&&(c.value==="eval"||c.value==="execScript")&&bd("eval is evil.",b),bS(c.value),!z.sub&&X.test(c.value)&&(d=L[c.value],(!d||!d.reserved)&&bd("['{a}'] is better written in dot notation.",c,c.value))),bl("]",b),bp(C,N),b.left=a,b.right=c;return b},160,!0),bA("[",function(){var a=N.line!==w.line;this.first=[],a&&(o+=z.indent,w.from===o+z.indent&&(o+=z.indent));while(w.id!=="(end)"){while(w.id===",")bd("Extra comma."),bl(",");if(w.id==="]")break;a&&N.line!==w.line&&bs(),this.first.push(bm(10));if(w.id!==",")break;bu();if(w.id==="]"&&!z.es5){bd("Extra comma.",N);break}}a&&(o-=z.indent,bs()),bl("]",this);return this},160),function(a){a.nud=function(){var a,b,c,d,e,f={},g;a=N.line!==w.line,a&&(o+=z.indent,w.from===o+z.indent&&(o+=z.indent));for(;;){if(w.id==="}")break;a&&bs();if(w.value==="get"&&bk().id!==":")bl("get"),z.es5||bf("get/set are ES5 features."),c=bU(),c||bf("Missing property name."),g=w,bn(N,w),b=bW(),!z.loopfunc&&i["(loopage)"]&&bd("Don't make functions within a loop.",g),e=b["(params)"],e&&bd("Unexpected parameter '{a}' in get {b} function.",g,e[0],c),bn(N,w),bl(","),bs(),bl("set"),d=bU(),c!==d&&bf("Expected {a} and instead saw {b}.",N,c,d),g=w,bn(N,w),b=bW(),e=b["(params)"],(!e||e.length!==1||e[0]!=="value")&&bd("Expected (value) in set {a} function.",g,c);else{c=bU();if(typeof c!="string")break;bl(":"),bq(N,w),bm(10)}f[c]===!0&&bd("Duplicate member '{a}'.",w,c),f[c]=!0,bS(c);if(w.id===",")bu(),w.id===","?bd("Extra comma.",N):w.id==="}"&&!z.es5&&bd("Extra comma.",N);else break}a&&(o-=z.indent,bs()),bl("}",this);return this},a.fud=function(){bf("Expected to see a statement and instead saw a block.",N)}}(bw("{"));var bX=bx("var",function(a){var b,c,d;i["(onevar)"]&&z.onevar?bd("Too many var statements."):i["(global)"]||(i["(onevar)"]=!0),this.first=[];for(;;){bq(N,w),b=bM(),i["(global)"]&&A[b]===!1&&bd("Redefinition of '{a}'.",N,b),bi(b,"unused");if(a)break;c=N,this.first.push(N),w.id==="="&&(bq(N,w),bl("="),bq(N,w),w.id==="undefined"&&bd("It is not necessary to initialize '{a}' to 'undefined'.",N,b),bk(0).id==="="&&w.identifier&&bf("Variable {a} was not declared correctly.",w,w.value),d=bm(0),c.first=d);if(w.id!==",")break;bu()}return this});bX.exps=!0,by("function",function(){n&&bd("Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",N);var a=bM();bn(N,w),bi(a,"unction"),bW(a,!0),w.id==="("&&w.line===N.line&&bf("Function declarations are not invocable. Wrap the whole function invocation in parens.");return this}),bA("function",function(){var a=bL();a?bn(N,w):bq(N,w),bW(a),!z.loopfunc&&i["(loopage)"]&&bd("Don't make functions within a loop.");return this}),by("if",function(){var a=w;bl("("),bq(this,a),bp(),bm(20),w.id==="="&&(z.boss||bd("Expected a conditional expression and instead saw an assignment."),bl("="),bm(20)),bl(")",a),bp(C,N),bR(!0,!0),w.id==="else"&&(bq(N,w),bl("else"),w.id==="if"||w.id==="switch"?bO(!0):bR(!0,!0));return this}),by("try",function(){var a,b,c;bR(!1),w.id==="catch"&&(bl("catch"),bq(N,w),bl("("),c=F,F=Object.create(c),b=w.value,w.type!=="(identifier)"?bd("Expected an identifier and instead saw '{a}'.",w,b):bi(b,"exception"),bl(),bl(")"),bR(!1),a=!0,F=c);if(w.id==="finally")bl("finally"),bR(!1);else{a||bf("Expected '{a}' and instead saw '{b}'.",w,"catch",w.value);return this}}),by("while",function(){var a=w;i["(breakage)"]+=1,i["(loopage)"]+=1,bl("("),bq(this,a),bp(),bm(20),w.id==="="&&(z.boss||bd("Expected a conditional expression and instead saw an assignment."),bl("="),bm(20)),bl(")",a),bp(C,N),bR(!0,!0),i["(breakage)"]-=1,i["(loopage)"]-=1;return this}).labelled=!0,bC("with"),by("switch",function(){var a=w,b=!1;i["(breakage)"]+=1,bl("("),bq(this,a),bp(),this.condition=bm(20),bl(")",a),bp(C,N),bq(N,w),a=w,bl("{"),bq(N,w),o+=z.indent,this.cases=[];for(;;)switch(w.id){case"case":switch(i["(verb)"]){case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:Z.test(r[w.line-2])||bd("Expected a 'break' statement before 'case'.",N)}bs(-z.indent),bl("case"),this.cases.push(bm(20)),b=!0,bl(":"),i["(verb)"]="case";break;case"default":switch(i["(verb)"]){case"break":case"continue":case"return":case"throw":break;default:Z.test(r[w.line-2])||bd("Expected a 'break' statement before 'default'.",N)}bs(-z.indent),bl("default"),b=!0,bl(":");break;case"}":o-=z.indent,bs(),bl("}",a),(this.cases.length===1||this.condition.id==="true"||this.condition.id==="false")&&bd("This 'switch' should be an 'if'.",this),i["(breakage)"]-=1,i["(verb)"]=undefined;return;case"(end)":bf("Missing '{a}'.",w,"}");return;default:if(b)switch(N.id){case",":bf("Each value should have its own case label.");return;case":":bQ();break;default:bf("Missing ':' on a case clause.",N)}else bf("Expected '{a}' and instead saw '{b}'.",w,"case",w.value)}}).labelled=!0,bx("debugger",function(){z.debug||bd("All 'debugger' statements should be removed.");return this}).exps=!0,function(){var a=bx("do",function(){i["(breakage)"]+=1,i["(loopage)"]+=1,this.first=bR(!0),bl("while");var a=w;bq(N,a),bl("("),bp(),bm(20),w.id==="="&&(z.boss||bd("Expected a conditional expression and instead saw an assignment."),bl("="),bm(20)),bl(")",a),bp(C,N),i["(breakage)"]-=1,i["(loopage)"]-=1;return this});a.labelled=!0,a.exps=!0}(),by("for",function(){var a,b=w;i["(breakage)"]+=1,i["(loopage)"]+=1,bl("("),bq(this,b),bp();if(bk(w.id==="var"?1:0).id==="in"){if(w.id==="var")bl("var"),bX.fud.call(bX,!0);else{switch(i[w.value]){case"unused":i[w.value]="var";break;case"var":break;default:bd("Bad for in variable '{a}'.",w,w.value)}bl()}bl("in"),bm(20),bl(")",b),a=bR(!0,!0),z.forin&&(a.length>1||typeof a[0]!="object"||a[0].value!=="if")&&bd("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",this),i["(breakage)"]-=1,i["(loopage)"]-=1;return this}if(w.id!==";")if(w.id==="var")bl("var"),bX.fud.call(bX);else for(;;){bm(0,"for");if(w.id!==",")break;bu()}bt(N),bl(";"),w.id!==";"&&(bm(20),w.id==="="&&(z.boss||bd("Expected a conditional expression and instead saw an assignment."),bl("="),bm(20))),bt(N),bl(";"),w.id===";"&&bf("Expected '{a}' and instead saw '{b}'.",w,")",";");if(w.id!==")")for(;;){bm(0,"for");if(w.id!==",")break;bu()}bl(")",b),bp(C,N),bR(!0,!0),i["(breakage)"]-=1,i["(loopage)"]-=1;return this}).labelled=!0,bx("break",function(){var a=w.value;i["(breakage)"]===0&&bd("Unexpected '{a}'.",w,this.value),bt(this),w.id!==";"&&N.line===w.line&&(i[a]!=="label"?bd("'{a}' is not a statement label.",w,a):F[a]!==i&&bd("'{a}' is out of scope.",w,a),this.first=w,bl()),bN("break");return this}).exps=!0,bx("continue",function(){var a=w.value;i["(breakage)"]===0&&bd("Unexpected '{a}'.",w,this.value),bt(this),w.id!==";"?N.line===w.line&&(i[a]!=="label"?bd("'{a}' is not a statement label.",w,a):F[a]!==i&&bd("'{a}' is out of scope.",w,a),this.first=w,bl()):i["(loopage)"]||bd("Unexpected '{a}'.",w,this.value),bN("continue");return this}).exps=!0,bx("return",function(){bt(this),w.id==="(regexp)"&&bd("Wrap the /regexp/ literal in parens to disambiguate the slash operator."),w.id!==";"&&!w.reach&&(bq(N,w),this.first=bm(20)),bN("return");return this}).exps=!0,bx("throw",function(){bt(this),bq(N,w),this.first=bm(20),bN("throw");return this}).exps=!0,bC("class"),bC("const"),bC("enum"),bC("export"),bC("extends"),bC("import"),bC("super"),bC("let"),bC("yield"),bC("implements"),bC("interface"),bC("package"),bC("private"),bC("protected"),bC("public"),bC("static");var bZ=function(a,b,c){var e,f,g;d.errors=[],A=Object.create(I),ba(A,c||{});if(b){e=b.predef;if(e)if(Array.isArray(e))for(f=0;f0&&(a.implieds=d),O.length>0&&(a.urls=O),c=Object.keys(F),c.length>0&&(a.globals=c);for(f=1;f0&&(a.unused=l),h=[];for(i in t)if(typeof t[i]=="number"){a.member=t;break}return a},bZ.report=function(a){function o(a,b){var c,d,e;if(b){m.push("
    "+a+" "),b=b.sort();for(d=0;d")}}var b=bZ.data(),c=[],d,e,f,g,h,i,j,k="",l,m=[],n;if(b.errors||b.implieds||b.unused){f=!0,m.push("
    Error:");if(b.errors)for(h=0;hProblem"+(isFinite(d.line)?" at line "+d.line+" character "+d.character:"")+": "+d.reason.entityify()+"

    "+(e&&(e.length>80?e.slice(0,77)+"...":e).entityify())+"

    "));if(b.implieds){n=[];for(h=0;h"+b.implieds[h].name+" "+b.implieds[h].line+"";m.push("

    Implied global: "+n.join(", ")+"

    ")}if(b.unused){n=[];for(h=0;h"+b.unused[h].name+" "+b.unused[h].line+" "+b.unused[h]["function"]+"";m.push("

    Unused variable: "+n.join(", ")+"

    ")}b.json&&m.push("

    JSON: bad.

    "),m.push("
    ")}if(!a){m.push("
    "),b.urls&&o("URLs
    ",b.urls,"
    "),b.json&&!f?m.push("

    JSON: good.

    "):b.globals?m.push("
    Global "+b.globals.sort().join(", ")+"
    "):m.push("
    No new global variables introduced.
    ");for(h=0;h
    "+g.line+"-"+g.last+" "+(g.name||"")+"("+(g.param?g.param.join(", "):"")+")
    "),o("Unused",g.unused),o("Closure",g.closure),o("Variable",g["var"]),o("Exception",g.exception),o("Outer",g.outer),o("Global",g.global),o("Label",g.label);if(b.member){c=Object.keys(b.member);if(c.length){c=c.sort(),k="
    /*members ",j=10;for(h=0;h72&&(m.push(k+"
    "),k=" ",j=1),j+=l.length+2,b.member[i]===1&&(l=""+l+""),h*/
    ")}m.push("
    ")}}return m.join("")},bZ.jshint=bZ,bZ.edition="2011-04-16";return bZ}();typeof b=="object"&&b&&(b.JSHINT=d)}),define("ace/narcissus/jsparse",["require","exports","module","ace/narcissus/jslex","ace/narcissus/jsdefs"],function(require,exports,module){function parseStdin(a,b){for(;;)try{var c=new lexer.Tokenizer(diff --git a/websdk/static/js/jquery-1.6.2.js b/websdk/static/js/jquery-1.6.2.js deleted file mode 100644 index f3201aa..0000000 --- a/websdk/static/js/jquery-1.6.2.js +++ /dev/null @@ -1,8981 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z])/ig, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.6.2", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.done( fn ); - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery._Deferred(); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNaN: function( obj ) { - return obj == null || !rdigit.test( obj ) || isNaN( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return (new Function( "return " + data ))(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - // (xml & tmp used internally) - parseXML: function( data , xml , tmp ) { - - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - - tmp = xml.documentElement; - - if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { - jQuery.error( "Invalid XML: " + data ); - } - - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Converts a dashed string to camelCased string; - // Used by both the css and data modules - camelCase: function( string ) { - return string.replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array ) { - - if ( indexOf ) { - return indexOf.call( array, elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return (new Date()).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -var // Promise methods - promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), - // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - // Create a simple deferred (one callbacks list) - _Deferred: function() { - var // callbacks list - callbacks = [], - // stored [ context , args ] - fired, - // to avoid firing when already doing so - firing, - // flag to know if the deferred has been cancelled - cancelled, - // the deferred itself - deferred = { - - // done( f1, f2, ...) - done: function() { - if ( !cancelled ) { - var args = arguments, - i, - length, - elem, - type, - _fired; - if ( fired ) { - _fired = fired; - fired = 0; - } - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - deferred.done.apply( deferred, elem ); - } else if ( type === "function" ) { - callbacks.push( elem ); - } - } - if ( _fired ) { - deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); - } - } - return this; - }, - - // resolve with given context and args - resolveWith: function( context, args ) { - if ( !cancelled && !fired && !firing ) { - // make sure args are available (#8421) - args = args || []; - firing = 1; - try { - while( callbacks[ 0 ] ) { - callbacks.shift().apply( context, args ); - } - } - finally { - fired = [ context, args ]; - firing = 0; - } - } - return this; - }, - - // resolve with this as context and given arguments - resolve: function() { - deferred.resolveWith( this, arguments ); - return this; - }, - - // Has this deferred been resolved? - isResolved: function() { - return !!( firing || fired ); - }, - - // Cancel - cancel: function() { - cancelled = 1; - callbacks = []; - return this; - } - }; - - return deferred; - }, - - // Full fledged deferred (two callbacks list) - Deferred: function( func ) { - var deferred = jQuery._Deferred(), - failDeferred = jQuery._Deferred(), - promise; - // Add errorDeferred methods, then and promise - jQuery.extend( deferred, { - then: function( doneCallbacks, failCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ); - return this; - }, - always: function() { - return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); - }, - fail: failDeferred.done, - rejectWith: failDeferred.resolveWith, - reject: failDeferred.resolve, - isRejected: failDeferred.isResolved, - pipe: function( fnDone, fnFail ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject ); - } else { - newDefer[ action ]( returned ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - if ( promise ) { - return promise; - } - promise = obj = {}; - } - var i = promiseMethods.length; - while( i-- ) { - obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; - } - return obj; - } - }); - // Make sure only one callback list will be used - deferred.done( failDeferred.cancel ).fail( deferred.cancel ); - // Unexpose cancel - delete deferred.cancel; - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = arguments, - i = 0, - length = args.length, - count = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - // Strange bug in FF4: - // Values changed onto the arguments object sometimes end up as undefined values - // outside the $.when method. Cloning the object into a fresh array solves the issue - deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); - } - }; - } - if ( length > 1 ) { - for( ; i < length; i++ ) { - if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return deferred.promise(); - } -}); - - - -jQuery.support = (function() { - - var div = document.createElement( "div" ), - documentElement = document.documentElement, - all, - a, - select, - opt, - input, - marginDiv, - support, - fragment, - body, - testElementParent, - testElement, - testElementStyle, - tds, - events, - eventName, - i, - isSupported; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
    a"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName( "tbody" ).length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName( "link" ).length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55$/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains it's value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.firstChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - div.innerHTML = ""; - - // Figure out if the W3C box model works as expected - div.style.width = div.style.paddingLeft = "1px"; - - body = document.getElementsByTagName( "body" )[ 0 ]; - // We use our own, invisible, body unless the body is already present - // in which case we use a div (#9239) - testElement = document.createElement( body ? "div" : "body" ); - testElementStyle = { - visibility: "hidden", - width: 0, - height: 0, - border: 0, - margin: 0 - }; - if ( body ) { - jQuery.extend( testElementStyle, { - position: "absolute", - left: -1000, - top: -1000 - }); - } - for ( i in testElementStyle ) { - testElement.style[ i ] = testElementStyle[ i ]; - } - testElement.appendChild( div ); - testElementParent = body || documentElement; - testElementParent.insertBefore( testElement, testElementParent.firstChild ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - support.boxModel = div.offsetWidth === 2; - - if ( "zoom" in div.style ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
    "; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.innerHTML = "
    t
    "; - tds = div.getElementsByTagName( "td" ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE < 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( document.defaultView && document.defaultView.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Remove the body element we added - testElement.innerHTML = ""; - testElementParent.removeChild( testElement ); - - // Technique from Juriy Zaytsev - // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - } ) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - // Null connected elements to avoid leaks in IE - testElement = fragment = select = opt = body = marginDiv = div = input = null; - - return support; -})(); - -// Keep track of boxModel -jQuery.boxModel = jQuery.support.boxModel; - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([a-z])([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; - } else { - id = jQuery.expando; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery - // metadata on plain JS objects when the object is serialized using - // JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); - } else { - cache[ id ] = jQuery.extend(cache[ id ], name); - } - } - - thisCache = cache[ id ]; - - // Internal jQuery data is stored in a separate object inside the object's data - // cache in order to avoid key collisions between internal data and user-defined - // data - if ( pvt ) { - if ( !thisCache[ internalKey ] ) { - thisCache[ internalKey ] = {}; - } - - thisCache = thisCache[ internalKey ]; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should - // not attempt to inspect the internal events object using jQuery.data, as this - // internal data object is undocumented and subject to change. - if ( name === "events" && !thisCache[name] ) { - return thisCache[ internalKey ] && thisCache[ internalKey ].events; - } - - return getByName ? - // Check for both converted-to-camel and non-converted data property names - thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] : - thisCache; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var internalKey = jQuery.expando, isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; - - if ( thisCache ) { - delete thisCache[ name ]; - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !isEmptyDataObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( pvt ) { - delete cache[ id ][ internalKey ]; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - var internalCache = cache[ id ][ internalKey ]; - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - if ( jQuery.support.deleteExpando || cache != window ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the entire user cache at once because it's faster than - // iterating through each key, but we need to continue to persist internal - // data if it existed - if ( internalCache ) { - cache[ id ] = {}; - // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery - // metadata on plain JS objects when the object is serialized using - // JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - - cache[ id ][ internalKey ] = internalCache; - - // Otherwise, we need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - } else if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } else { - elem[ jQuery.expando ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 ) { - var attr = this[0].attributes, name; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var $this = jQuery( this ), - args = [ parts[0], value ]; - - $this.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - $this.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - !jQuery.isNaN( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON -// property to be considered empty objects; this property always exists in -// order to make sure JSON.stringify does not expose internal metadata -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery.data( elem, deferDataKey, undefined, true ); - if ( defer && - ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && - ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery.data( elem, queueDataKey, undefined, true ) && - !jQuery.data( elem, markDataKey, undefined, true ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.resolve(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = (type || "fx") + "mark"; - jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); - if ( count ) { - jQuery.data( elem, key, count, true ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - if ( elem ) { - type = (type || "fx") + "queue"; - var q = jQuery.data( elem, type, undefined, true ); - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery.data( elem, type, jQuery.makeArray(data), true ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - defer; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift("inprogress"); - } - - fn.call(elem, function() { - jQuery.dequeue(elem, type); - }); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue( type, function() { - var elem = this; - setTimeout(function() { - jQuery.dequeue( elem, type ); - }, time ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { - count++; - tmp.done( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - rinvalidChar = /\:|^on/, - formHook, boolHook; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = (value || "").split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return undefined; - } - - var isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attrFix: { - // Always normalize to ensure hook usage - tabindex: "tabIndex" - }, - - attr: function( elem, name, value, pass ) { - var nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( !("getAttribute" in elem) ) { - return jQuery.prop( elem, name, value ); - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // Normalize the name if needed - if ( notxml ) { - name = jQuery.attrFix[ name ] || name; - - hooks = jQuery.attrHooks[ name ]; - - if ( !hooks ) { - // Use boolHook for boolean attributes - if ( rboolean.test( name ) ) { - - hooks = boolHook; - - // Use formHook for forms and if the name contains certain characters - } else if ( formHook && name !== "className" && - (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { - - hooks = formHook; - } - } - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return undefined; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, name ) { - var propName; - if ( elem.nodeType === 1 ) { - name = jQuery.attrFix[ name ] || name; - - if ( jQuery.support.getSetAttribute ) { - // Use removeAttribute in browsers that support it - elem.removeAttribute( name ); - } else { - jQuery.attr( elem, name, "" ); - elem.removeAttributeNode( elem.getAttributeNode( name ) ); - } - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { - elem[ propName ] = false; - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabIndex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - }, - // Use the value property for back compat - // Use the formHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( formHook && jQuery.nodeName( elem, "button" ) ) { - return formHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( formHook && jQuery.nodeName( elem, "button" ) ) { - return formHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return (elem[ name ] = value); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: {} -}); - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - return jQuery.prop( elem, name ) ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !jQuery.support.getSetAttribute ) { - - // propFix is more comprehensive and contains all fixes - jQuery.attrFix = jQuery.propFix; - - // Use this for any attribute on a form in IE6/7 - formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - // Return undefined if nodeValue is empty string - return ret && ret.nodeValue !== "" ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Check form objects in IE (multiple bugs related) - // Only use nodeValue if the attribute node exists on the form - var ret = elem.getAttributeNode( name ); - if ( ret ) { - ret.nodeValue = value; - return value; - } - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return (elem.style.cssText = "" + value); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }); -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); - } - } - }); -}); - - - - -var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspaces = / /g, - rescape = /[^\w\s.|`]/g, - fcleanup = function( nm ) { - return nm.replace(rescape, "\\$&"); - }; - -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function( elem, types, handler, data ) { - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - if ( handler === false ) { - handler = returnFalse; - } else if ( !handler ) { - // Fixes bug #7229. Fix recommended by jdalton - return; - } - - var handleObjIn, handleObj; - - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure - var elemData = jQuery._data( elem ); - - // If no elemData is found then we must be trying to bind to one of the - // banned noData elements - if ( !elemData ) { - return; - } - - var events = elemData.events, - eventHandle = elemData.handle; - - if ( !events ) { - elemData.events = events = {}; - } - - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native events in IE. - eventHandle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split(" "); - - var type, i = 0, namespaces; - - while ( (type = types[ i++ ]) ) { - handleObj = handleObjIn ? - jQuery.extend({}, handleObjIn) : - { handler: handler, data: data }; - - // Namespaced event handlers - if ( type.indexOf(".") > -1 ) { - namespaces = type.split("."); - type = namespaces.shift(); - handleObj.namespace = namespaces.slice(0).sort().join("."); - - } else { - namespaces = []; - handleObj.namespace = ""; - } - - handleObj.type = type; - if ( !handleObj.guid ) { - handleObj.guid = handler.guid; - } - - // Get the current list of functions bound to this event - var handlers = events[ type ], - special = jQuery.event.special[ type ] || {}; - - // Init the event handler queue - if ( !handlers ) { - handlers = events[ type ] = []; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add the function to the element's handler list - handlers.push( handleObj ); - - // Keep track of which events have been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, pos ) { - // don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - if ( handler === false ) { - handler = returnFalse; - } - - var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - events = elemData && elemData.events; - - if ( !elemData || !events ) { - return; - } - - // types is actually an event object here - if ( types && types.type ) { - handler = types.handler; - types = types.type; - } - - // Unbind all events for the element - if ( !types || typeof types === "string" && types.charAt(0) === "." ) { - types = types || ""; - - for ( type in events ) { - jQuery.event.remove( elem, type + types ); - } - - return; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(" "); - - while ( (type = types[ i++ ]) ) { - origType = type; - handleObj = null; - all = type.indexOf(".") < 0; - namespaces = []; - - if ( !all ) { - // Namespaced event handlers - namespaces = type.split("."); - type = namespaces.shift(); - - namespace = new RegExp("(^|\\.)" + - jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - eventType = events[ type ]; - - if ( !eventType ) { - continue; - } - - if ( !handler ) { - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( all || namespace.test( handleObj.namespace ) ) { - jQuery.event.remove( elem, origType, handleObj.handler, j ); - eventType.splice( j--, 1 ); - } - } - - continue; - } - - special = jQuery.event.special[ type ] || {}; - - for ( j = pos || 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( handler.guid === handleObj.guid ) { - // remove the given handler for the given type - if ( all || namespace.test( handleObj.namespace ) ) { - if ( pos == null ) { - eventType.splice( j--, 1 ); - } - - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - - if ( pos != null ) { - break; - } - } - } - - // remove generic event handler if no more handlers exist - if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - ret = null; - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - var handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - delete elemData.events; - delete elemData.handle; - - if ( jQuery.isEmptyObject( elemData ) ) { - jQuery.removeData( elem, undefined, true ); - } - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Event object or event type - var type = event.type || event, - namespaces = [], - exclusive; - - if ( type.indexOf("!") >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.exclusive = exclusive; - event.namespace = namespaces.join("."); - event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - - // triggerHandler() and global events don't bubble or run the default action - if ( onlyHandlers || !elem ) { - event.preventDefault(); - event.stopPropagation(); - } - - // Handle a global trigger - if ( !elem ) { - // TODO: Stop taunting the data cache; remove global events and always attach to document - jQuery.each( jQuery.cache, function() { - // internalKey variable is just used to make it easier to find - // and potentially change this stuff later; currently it just - // points to jQuery.expando - var internalKey = jQuery.expando, - internalCache = this[ internalKey ]; - if ( internalCache && internalCache.events && internalCache.events[ type ] ) { - jQuery.event.trigger( event, data, internalCache.handle.elem ); - } - }); - return; - } - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - event.target = elem; - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - var cur = elem, - // IE doesn't like method names with a colon (#3533, #8272) - ontype = type.indexOf(":") < 0 ? "on" + type : ""; - - // Fire event on the current element, then bubble up the DOM tree - do { - var handle = jQuery._data( cur, "handle" ); - - event.currentTarget = cur; - if ( handle ) { - handle.apply( cur, data ); - } - - // Trigger an inline bound script - if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { - event.result = false; - event.preventDefault(); - } - - // Bubble up to document, then to window - cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; - } while ( cur && !event.isPropagationStopped() ); - - // If nobody prevented the default action, do it now - if ( !event.isDefaultPrevented() ) { - var old, - special = jQuery.event.special[ type ] || {}; - - if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction)() check here because IE6/7 fails that test. - // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. - try { - if ( ontype && elem[ type ] ) { - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - jQuery.event.triggered = type; - elem[ type ](); - } - } catch ( ieError ) {} - - if ( old ) { - elem[ ontype ] = old; - } - - jQuery.event.triggered = undefined; - } - } - - return event.result; - }, - - handle: function( event ) { - event = jQuery.event.fix( event || window.event ); - // Snapshot the handlers list since a called handler may add/remove events. - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), - run_all = !event.exclusive && !event.namespace, - args = Array.prototype.slice.call( arguments, 0 ); - - // Use the fix-ed Event rather than the (read-only) native event - args[0] = event; - event.currentTarget = this; - - for ( var j = 0, l = handlers.length; j < l; j++ ) { - var handleObj = handlers[ j ]; - - // Triggered event must 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event. - if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handleObj.handler; - event.data = handleObj.data; - event.handleObj = handleObj; - - var ret = handleObj.handler.apply( this, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ) { - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) { - // Fixes #1925 where srcElement might not be defined either - event.target = event.srcElement || document; - } - - // check if target is a textnode (safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var eventDocument = event.target.ownerDocument || document, - doc = eventDocument.documentElement, - body = eventDocument.body; - - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { - event.which = event.charCode != null ? event.charCode : event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button !== undefined ) { - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function( handleObj ) { - jQuery.event.add( this, - liveConvert( handleObj.origType, handleObj.selector ), - jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); - }, - - remove: function( handleObj ) { - jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); - } - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !this.preventDefault ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function( event ) { - - // Check if mouse(over|out) are still within the same parent element - var related = event.relatedTarget, - inside = false, - eventType = event.type; - - event.type = event.data; - - if ( related !== this ) { - - if ( related ) { - inside = jQuery.contains( this, related ); - } - - if ( !inside ) { - - jQuery.event.handle.apply( this, arguments ); - - event.type = eventType; - } - } -}, - -// In case of event delegation, we only need to rename the event.type, -// liveHandler will take care of the rest. -delegate = function( event ) { - event.type = event.data; - jQuery.event.handle.apply( this, arguments ); -}; - -// Create mouseenter and mouseleave events -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - setup: function( data ) { - jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); - }, - teardown: function( data ) { - jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); - } - }; -}); - -// submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function( data, namespaces ) { - if ( !jQuery.nodeName( this, "form" ) ) { - jQuery.event.add(this, "click.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { - trigger( "submit", this, arguments ); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { - trigger( "submit", this, arguments ); - } - }); - - } else { - return false; - } - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialSubmit" ); - } - }; - -} - -// change delegation, happens here so we have bind. -if ( !jQuery.support.changeBubbles ) { - - var changeFilters, - - getVal = function( elem ) { - var type = elem.type, val = elem.value; - - if ( type === "radio" || type === "checkbox" ) { - val = elem.checked; - - } else if ( type === "select-multiple" ) { - val = elem.selectedIndex > -1 ? - jQuery.map( elem.options, function( elem ) { - return elem.selected; - }).join("-") : - ""; - - } else if ( jQuery.nodeName( elem, "select" ) ) { - val = elem.selectedIndex; - } - - return val; - }, - - testChange = function testChange( e ) { - var elem = e.target, data, val; - - if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { - return; - } - - data = jQuery._data( elem, "_change_data" ); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if ( e.type !== "focusout" || elem.type !== "radio" ) { - jQuery._data( elem, "_change_data", val ); - } - - if ( data === undefined || val === data ) { - return; - } - - if ( data != null || val ) { - e.type = "change"; - e.liveFired = undefined; - jQuery.event.trigger( e, arguments[1], elem ); - } - }; - - jQuery.event.special.change = { - filters: { - focusout: testChange, - - beforedeactivate: testChange, - - click: function( e ) { - var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; - - if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { - testChange.call( this, e ); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function( e ) { - var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; - - if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple" ) { - testChange.call( this, e ); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information - beforeactivate: function( e ) { - var elem = e.target; - jQuery._data( elem, "_change_data", getVal(elem) ); - } - }, - - setup: function( data, namespaces ) { - if ( this.type === "file" ) { - return false; - } - - for ( var type in changeFilters ) { - jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); - } - - return rformElems.test( this.nodeName ); - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialChange" ); - - return rformElems.test( this.nodeName ); - } - }; - - changeFilters = jQuery.event.special.change.filters; - - // Handle when the input is .focus()'d - changeFilters.focus = changeFilters.beforeactivate; -} - -function trigger( type, elem, args ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - // Don't pass args or remember liveFired; they apply to the donor event. - var event = jQuery.extend( {}, args[ 0 ] ); - event.type = type; - event.originalEvent = {}; - event.liveFired = undefined; - jQuery.event.handle.call( elem, event ); - if ( event.isDefaultPrevented() ) { - args[ 0 ].preventDefault(); - } -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - - function handler( donor ) { - // Donor event is always a native one; fix it and switch its type. - // Let focusin/out handler cancel the donor focus/blur event. - var e = jQuery.event.fix( donor ); - e.type = fix; - e.originalEvent = {}; - jQuery.event.trigger( e, null, e.target ); - if ( e.isDefaultPrevented() ) { - donor.preventDefault(); - } - } - }); -} - -jQuery.each(["bind", "one"], function( i, name ) { - jQuery.fn[ name ] = function( type, data, fn ) { - var handler; - - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ name ](key, data, type[key], fn); - } - return this; - } - - if ( arguments.length === 2 || data === false ) { - fn = data; - data = undefined; - } - - if ( name === "one" ) { - handler = function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }; - handler.guid = fn.guid || jQuery.guid++; - } else { - handler = fn; - } - - if ( type === "unload" && name !== "one" ) { - this.one( type, data, fn ); - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.add( this[i], type, handler, data ); - } - } - - return this; - }; -}); - -jQuery.fn.extend({ - unbind: function( type, fn ) { - // Handle object literals - if ( typeof type === "object" && !type.preventDefault ) { - for ( var key in type ) { - this.unbind(key, type[key]); - } - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.remove( this[i], type, fn ); - } - } - - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.live( types, data, fn, selector ); - }, - - undelegate: function( selector, types, fn ) { - if ( arguments.length === 0 ) { - return this.unbind( "live" ); - - } else { - return this.die( types, null, fn, selector ); - } - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -var liveMap = { - focus: "focusin", - blur: "focusout", - mouseenter: "mouseover", - mouseleave: "mouseout" -}; - -jQuery.each(["live", "die"], function( i, name ) { - jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { - var type, i = 0, match, namespaces, preType, - selector = origSelector || this.selector, - context = origSelector ? this : jQuery( this.context ); - - if ( typeof types === "object" && !types.preventDefault ) { - for ( var key in types ) { - context[ name ]( key, data, types[key], selector ); - } - - return this; - } - - if ( name === "die" && !types && - origSelector && origSelector.charAt(0) === "." ) { - - context.unbind( origSelector ); - - return this; - } - - if ( data === false || jQuery.isFunction( data ) ) { - fn = data || returnFalse; - data = undefined; - } - - types = (types || "").split(" "); - - while ( (type = types[ i++ ]) != null ) { - match = rnamespaces.exec( type ); - namespaces = ""; - - if ( match ) { - namespaces = match[0]; - type = type.replace( rnamespaces, "" ); - } - - if ( type === "hover" ) { - types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); - continue; - } - - preType = type; - - if ( liveMap[ type ] ) { - types.push( liveMap[ type ] + namespaces ); - type = type + namespaces; - - } else { - type = (liveMap[ type ] || type) + namespaces; - } - - if ( name === "live" ) { - // bind live handler - for ( var j = 0, l = context.length; j < l; j++ ) { - jQuery.event.add( context[j], "live." + liveConvert( type, selector ), - { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); - } - - } else { - // unbind live handler - context.unbind( "live." + liveConvert( type, selector ), fn ); - } - } - - return this; - }; -}); - -function liveHandler( event ) { - var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, - elems = [], - selectors = [], - events = jQuery._data( this, "events" ); - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) - if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { - return; - } - - if ( event.namespace ) { - namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.liveFired = this; - - var live = events.live.slice(0); - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { - selectors.push( handleObj.selector ); - - } else { - live.splice( j--, 1 ); - } - } - - match = jQuery( event.target ).closest( selectors, event.currentTarget ); - - for ( i = 0, l = match.length; i < l; i++ ) { - close = match[i]; - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { - elem = close.elem; - related = null; - - // Those two events require additional checking - if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { - event.type = handleObj.preType; - related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; - - // Make sure not to accidentally match a child element with the same selector - if ( related && jQuery.contains( elem, related ) ) { - related = elem; - } - } - - if ( !related || related !== elem ) { - elems.push({ elem: elem, handleObj: handleObj, level: close.level }); - } - } - } - } - - for ( i = 0, l = elems.length; i < l; i++ ) { - match = elems[i]; - - if ( maxLevel && match.level > maxLevel ) { - break; - } - - event.currentTarget = match.elem; - event.data = match.handleObj.data; - event.handleObj = match.handleObj; - - ret = match.handleObj.origHandler.apply( match.elem, arguments ); - - if ( ret === false || event.isPropagationStopped() ) { - maxLevel = match.level; - - if ( ret === false ) { - stop = false; - } - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - - return stop; -} - -function liveConvert( type, selector ) { - return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); -} - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.bind( name, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var match, - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var found, item, - filter = Expr.filter[ type ], - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - var first = match[2], - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -Sizzle.getText = function( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += Sizzle.getText( elem.childNodes ); - } - } - - return ret; -}; - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

    "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
    "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( typeof selector === "string" ? - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array - if ( jQuery.isArray( selectors ) ) { - var match, selector, - matches = {}, - level = 1; - - if ( cur && selectors.length ) { - for ( i = 0, l = selectors.length; i < l; i++ ) { - selector = selectors[i]; - - if ( !matches[ selector ] ) { - matches[ selector ] = POS.test( selector ) ? - jQuery( selector, context || this.context ) : - selector; - } - } - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( selector in matches ) { - match = matches[ selector ]; - - if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { - ret.push({ selector: selector, elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - if ( !elem || typeof elem === "string" ) { - return jQuery.inArray( this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery( elem ) : this.parent().children() ); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ), - // The variable 'args' was introduced in - // https://github.com/jquery/jquery/commit/52a0238 - // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. - // http://code.google.com/p/v8/issues/detail?id=1050 - args = slice.call(arguments); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, args.join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -} - - - - -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /", "" ], - legend: [ 1, "
    ", "
    " ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - col: [ 2, "", "
    " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and " - + "" - + "" - + WYMeditor.DIALOG_BODY - + "", - - dialogLinkHtml: "" - + "
    " - + "
    " - + "" - + "{Link}" - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - + "", - - dialogImageHtml: "" - + "
    " - + "
    " - + "" - + "{Image}" - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - + "", - - dialogTableHtml: "" - + "
    " - + "
    " - + "" - + "{Table}" - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - + "", - - dialogPasteHtml: "" - + "
    " - + "" - + "
    " - + "{Paste_From_Word}" - + "
    " - + "" - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - + "", - - dialogPreviewHtml: "", - - dialogStyles: [], - - stringDelimiterLeft: "{", - stringDelimiterRight:"}", - - preInit: null, - preBind: null, - postInit: null, - - preInitDialog: null, - postInitDialog: null - - }, options); - - return this.each(function() { - - new WYMeditor.editor(jQuery(this),options); - }); -}; - -/* @name extend - * @description Returns the WYMeditor instance based on its index - */ -jQuery.extend({ - wymeditors: function(i) { - return (WYMeditor.INSTANCES[i]); - } -}); - - -/********** WYMeditor **********/ - -/* @name Wymeditor - * @description WYMeditor class - */ - -/* @name init - * @description Initializes a WYMeditor instance - */ -WYMeditor.editor.prototype.init = function() { - - //load subclass - browser specific - //unsupported browsers: do nothing - if (jQuery.browser.msie) { - var WymClass = new WYMeditor.WymClassExplorer(this); - } - else if (jQuery.browser.mozilla) { - var WymClass = new WYMeditor.WymClassMozilla(this); - } - else if (jQuery.browser.opera) { - var WymClass = new WYMeditor.WymClassOpera(this); - } - else if (jQuery.browser.safari) { - var WymClass = new WYMeditor.WymClassSafari(this); - } - - if(WymClass) { - - if(jQuery.isFunction(this._options.preInit)) this._options.preInit(this); - - var SaxListener = new WYMeditor.XhtmlSaxListener(); - jQuery.extend(SaxListener, WymClass); - this.parser = new WYMeditor.XhtmlParser(SaxListener); - - if(this._options.styles || this._options.stylesheet){ - this.configureEditorUsingRawCss(); - } - - this.helper = new WYMeditor.XmlHelper(); - - //extend the Wymeditor object - //don't use jQuery.extend since 1.1.4 - //jQuery.extend(this, WymClass); - for (var prop in WymClass) { this[prop] = WymClass[prop]; } - - //load wymbox - this._box = jQuery(this._element).hide().after(this._options.boxHtml).next().addClass('wym_box_' + this._index); - - //store the instance index in wymbox and element replaced by editor instance - //but keep it compatible with jQuery < 1.2.3, see #122 - if( jQuery.isFunction( jQuery.fn.data ) ) { - jQuery.data(this._box.get(0), WYMeditor.WYM_INDEX, this._index); - jQuery.data(this._element.get(0), WYMeditor.WYM_INDEX, this._index); - } - - var h = WYMeditor.Helper; - - //construct the iframe - var iframeHtml = this._options.iframeHtml; - iframeHtml = h.replaceAll(iframeHtml, WYMeditor.INDEX, this._index); - iframeHtml = h.replaceAll(iframeHtml, WYMeditor.IFRAME_BASE_PATH, this._options.iframeBasePath); - - //construct wymbox - var boxHtml = jQuery(this._box).html(); - - boxHtml = h.replaceAll(boxHtml, WYMeditor.LOGO, this._options.logoHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS, this._options.toolsHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS,this._options.containersHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES, this._options.classesHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.HTML, this._options.htmlHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.IFRAME, iframeHtml); - boxHtml = h.replaceAll(boxHtml, WYMeditor.STATUS, this._options.statusHtml); - - //construct tools list - var aTools = eval(this._options.toolsItems); - var sTools = ""; - - for(var i = 0; i < aTools.length; i++) { - var oTool = aTools[i]; - if(oTool.name && oTool.title) - var sTool = this._options.toolsItemHtml; - var sTool = h.replaceAll(sTool, WYMeditor.TOOL_NAME, oTool.name); - sTool = h.replaceAll(sTool, WYMeditor.TOOL_TITLE, this._options.stringDelimiterLeft - + oTool.title - + this._options.stringDelimiterRight); - sTool = h.replaceAll(sTool, WYMeditor.TOOL_CLASS, oTool.css); - sTools += sTool; - } - - boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS_ITEMS, sTools); - - //construct classes list - var aClasses = eval(this._options.classesItems); - var sClasses = ""; - - for(var i = 0; i < aClasses.length; i++) { - var oClass = aClasses[i]; - if(oClass.name && oClass.title) - var sClass = this._options.classesItemHtml; - sClass = h.replaceAll(sClass, WYMeditor.CLASS_NAME, oClass.name); - sClass = h.replaceAll(sClass, WYMeditor.CLASS_TITLE, oClass.title); - sClasses += sClass; - } - - boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES_ITEMS, sClasses); - - //construct containers list - var aContainers = eval(this._options.containersItems); - var sContainers = ""; - - for(var i = 0; i < aContainers.length; i++) { - var oContainer = aContainers[i]; - if(oContainer.name && oContainer.title) - var sContainer = this._options.containersItemHtml; - sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_NAME, oContainer.name); - sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_TITLE, - this._options.stringDelimiterLeft - + oContainer.title - + this._options.stringDelimiterRight); - sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_CLASS, oContainer.css); - sContainers += sContainer; - } - - boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS_ITEMS, sContainers); - - //l10n - boxHtml = this.replaceStrings(boxHtml); - - //load html in wymbox - jQuery(this._box).html(boxHtml); - - //hide the html value - jQuery(this._box).find(this._options.htmlSelector).hide(); - - //enable the skin - this.loadSkin(); - - } -}; - -WYMeditor.editor.prototype.bindEvents = function() { - - //copy the instance - var wym = this; - - //handle click event on tools buttons - jQuery(this._box).find(this._options.toolSelector).click(function() { - wym._iframe.contentWindow.focus(); //See #154 - wym.exec(jQuery(this).attr(WYMeditor.NAME)); - return(false); - }); - - //handle click event on containers buttons - jQuery(this._box).find(this._options.containerSelector).click(function() { - wym.container(jQuery(this).attr(WYMeditor.NAME)); - return(false); - }); - - //handle keyup event on html value: set the editor value - //handle focus/blur events to check if the element has focus, see #147 - jQuery(this._box).find(this._options.htmlValSelector) - .keyup(function() { jQuery(wym._doc.body).html(jQuery(this).val());}) - .focus(function() { jQuery(this).toggleClass('hasfocus'); }) - .blur(function() { jQuery(this).toggleClass('hasfocus'); }); - - //handle click event on classes buttons - jQuery(this._box).find(this._options.classSelector).click(function() { - - var aClasses = eval(wym._options.classesItems); - var sName = jQuery(this).attr(WYMeditor.NAME); - - var oClass = WYMeditor.Helper.findByName(aClasses, sName); - - if(oClass) { - var jqexpr = oClass.expr; - wym.toggleClass(sName, jqexpr); - } - wym._iframe.contentWindow.focus(); //See #154 - return(false); - }); - - //handle event on update element - jQuery(this._options.updateSelector) - .bind(this._options.updateEvent, function() { - wym.update(); - }); -}; - -WYMeditor.editor.prototype.ready = function() { - return(this._doc != null); -}; - - -/********** METHODS **********/ - -/* @name box - * @description Returns the WYMeditor container - */ -WYMeditor.editor.prototype.box = function() { - return(this._box); -}; - -/* @name html - * @description Get/Set the html value - */ -WYMeditor.editor.prototype.html = function(html) { - - if(typeof html === 'string') jQuery(this._doc.body).html(html); - else return(jQuery(this._doc.body).html()); -}; - -/* @name xhtml - * @description Cleans up the HTML - */ -WYMeditor.editor.prototype.xhtml = function() { - return this.parser.parse(this.html()); -}; - -/* @name exec - * @description Executes a button command - */ -WYMeditor.editor.prototype.exec = function(cmd) { - - //base function for execCommand - //open a dialog or exec - switch(cmd) { - case WYMeditor.CREATE_LINK: - var container = this.container(); - if(container || this._selected_image) this.dialog(WYMeditor.DIALOG_LINK); - break; - - case WYMeditor.INSERT_IMAGE: - this.dialog(WYMeditor.DIALOG_IMAGE); - break; - - case WYMeditor.INSERT_TABLE: - this.dialog(WYMeditor.DIALOG_TABLE); - break; - - case WYMeditor.PASTE: - this.dialog(WYMeditor.DIALOG_PASTE); - break; - - case WYMeditor.TOGGLE_HTML: - this.update(); - this.toggleHtml(); - break; - - case WYMeditor.PREVIEW: - this.dialog(WYMeditor.PREVIEW, this._options.dialogFeaturesPreview); - break; - - default: - this._exec(cmd); - break; - } -}; - -/* @name container - * @description Get/Set the selected container - */ -WYMeditor.editor.prototype.container = function(sType) { - - if(sType) { - - var container = null; - - if(sType.toLowerCase() == WYMeditor.TH) { - - container = this.container(); - - //find the TD or TH container - switch(container.tagName.toLowerCase()) { - - case WYMeditor.TD: case WYMeditor.TH: - break; - default: - var aTypes = new Array(WYMeditor.TD,WYMeditor.TH); - container = this.findUp(this.container(), aTypes); - break; - } - - //if it exists, switch - if(container!=null) { - - sType = (container.tagName.toLowerCase() == WYMeditor.TD)? WYMeditor.TH: WYMeditor.TD; - this.switchTo(container,sType); - this.update(); - } - } else { - - //set the container type - var aTypes=new Array(WYMeditor.P,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5, - WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE); - container = this.findUp(this.container(), aTypes); - - if(container) { - - var newNode = null; - - //blockquotes must contain a block level element - if(sType.toLowerCase() == WYMeditor.BLOCKQUOTE) { - - var blockquote = this.findUp(this.container(), WYMeditor.BLOCKQUOTE); - - if(blockquote == null) { - - newNode = this._doc.createElement(sType); - container.parentNode.insertBefore(newNode,container); - newNode.appendChild(container); - this.setFocusToNode(newNode.firstChild); - - } else { - - var nodes = blockquote.childNodes; - var lgt = nodes.length; - var firstNode = null; - - if(lgt > 0) firstNode = nodes.item(0); - for(var x=0; x') ) + - '

    '; - } - - // Insert where appropriate - if (container && container.tagName.toLowerCase() != WYMeditor.BODY) { - // No .last() pre jQuery 1.4 - //focusNode = jQuery(html).insertAfter(container).last()[0]; - paragraphs = jQuery(html, this._doc).insertAfter(container); - focusNode = paragraphs[paragraphs.length - 1]; - } else { - paragraphs = jQuery(html, this._doc).appendTo(this._doc.body); - focusNode = paragraphs[paragraphs.length - 1]; - } - - // Do some minor cleanup (#131) - if (jQuery(container).text() == '') { - jQuery(container).remove(); - } - // And remove br (if editor was empty) - jQuery('body > br', this._doc).remove(); - - // Restore focus - this.setFocusToNode(focusNode); -}; - -WYMeditor.editor.prototype.insert = function(html) { - // Do we have a selection? - var selection = this._iframe.contentWindow.getSelection(), - range, - node; - if (selection.focusNode != null) { - // Overwrite selection with provided html - range = selection.getRangeAt(0); - node = range.createContextualFragment(html); - range.deleteContents(); - range.insertNode(node); - } else { - // Fall back to the internal paste function if there's no selection - this.paste(html) - } -}; - -WYMeditor.editor.prototype.wrap = function(left, right) { - this.insert(left + this._iframe.contentWindow.getSelection().toString() + right); -}; - -WYMeditor.editor.prototype.unwrap = function() { - this.insert(this._iframe.contentWindow.getSelection().toString()); -}; - -WYMeditor.editor.prototype.setFocusToNode = function(node, toStart) { - var range = this._doc.createRange(), - selection = this._iframe.contentWindow.getSelection(); - toStart = toStart ? 0 : 1; - - range.selectNodeContents(node); - selection.addRange(range); - selection.collapse(node, toStart); - this._iframe.contentWindow.focus(); -}; - -WYMeditor.editor.prototype.addCssRules = function(doc, aCss) { - var styles = doc.styleSheets[0]; - if(styles) { - for(var i = 0; i < aCss.length; i++) { - var oCss = aCss[i]; - if(oCss.name && oCss.css) this.addCssRule(styles, oCss); - } - } -}; - -/********** CONFIGURATION **********/ - -WYMeditor.editor.prototype.computeBasePath = function() { - return jQuery(jQuery.grep(jQuery('script'), function(s){ - return (s.src && s.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/ )) - })).attr('src').replace(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/, ''); -}; - -WYMeditor.editor.prototype.computeWymPath = function() { - return jQuery(jQuery.grep(jQuery('script'), function(s){ - return (s.src && s.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/ )) - })).attr('src'); -}; - -WYMeditor.editor.prototype.computeJqueryPath = function() { - return jQuery(jQuery.grep(jQuery('script'), function(s){ - return (s.src && s.src.match(/jquery(-(.*)){0,1}(\.pack|\.min|\.packed)?\.js(\?.*)?$/ )) - })).attr('src'); -}; - -WYMeditor.editor.prototype.computeCssPath = function() { - return jQuery(jQuery.grep(jQuery('link'), function(s){ - return (s.href && s.href.match(/wymeditor\/skins\/(.*)screen\.css(\?.*)?$/ )) - })).attr('href'); -}; - -WYMeditor.editor.prototype.configureEditorUsingRawCss = function() { - - var CssParser = new WYMeditor.WymCssParser(); - if(this._options.stylesheet){ - CssParser.parse(jQuery.ajax({url: this._options.stylesheet,async:false}).responseText); - }else{ - CssParser.parse(this._options.styles, false); - } - - if(this._options.classesItems.length == 0) { - this._options.classesItems = CssParser.css_settings.classesItems; - } - if(this._options.editorStyles.length == 0) { - this._options.editorStyles = CssParser.css_settings.editorStyles; - } - if(this._options.dialogStyles.length == 0) { - this._options.dialogStyles = CssParser.css_settings.dialogStyles; - } -}; - -/********** EVENTS **********/ - -WYMeditor.editor.prototype.listen = function() { - //don't use jQuery.find() on the iframe body - //because of MSIE + jQuery + expando issue (#JQ1143) - //jQuery(this._doc.body).find("*").bind("mouseup", this.mouseup); - - jQuery(this._doc.body).bind("mousedown", this.mousedown); -}; - -WYMeditor.editor.prototype.mousedown = function(evt) { - var wym = WYMeditor.INSTANCES[this.ownerDocument.title]; - wym._selected_image = (evt.target.tagName.toLowerCase() == WYMeditor.IMG) ? evt.target : null; -}; - -/********** SKINS **********/ - -/* - * Function: WYMeditor.loadCss - * Loads a stylesheet in the document. - * - * Parameters: - * href - The CSS path. - */ -WYMeditor.loadCss = function(href) { - - var link = document.createElement('link'); - link.rel = 'stylesheet'; - link.href = href; - - var head = jQuery('head').get(0); - head.appendChild(link); -}; - -/* - * Function: WYMeditor.editor.loadSkin - * Loads the skin CSS and initialization script (if needed). - */ -WYMeditor.editor.prototype.loadSkin = function() { - - //does the user want to automatically load the CSS (default: yes)? - //we also test if it hasn't been already loaded by another instance - //see below for a better (second) test - if(this._options.loadSkin && !WYMeditor.SKINS[this._options.skin]) { - - //check if it hasn't been already loaded - //so we don't load it more than once - //(we check the existing elements) - - var found = false; - var rExp = new RegExp(this._options.skin - + '\/' + WYMeditor.SKINS_DEFAULT_CSS + '$'); - - jQuery('link').each( function() { - if(this.href.match(rExp)) found = true; - }); - - //load it, using the skin path - if(!found) WYMeditor.loadCss( this._options.skinPath - + WYMeditor.SKINS_DEFAULT_CSS ); - } - - //put the classname (ex. wym_skin_default) on wym_box - jQuery(this._box).addClass( "wym_skin_" + this._options.skin ); - - //does the user want to use some JS to initialize the skin (default: yes)? - //also check if it hasn't already been loaded by another instance - if(this._options.initSkin && !WYMeditor.SKINS[this._options.skin]) { - - eval(jQuery.ajax({url:this._options.skinPath - + WYMeditor.SKINS_DEFAULT_JS, async:false}).responseText); - } - - //init the skin, if needed - if(WYMeditor.SKINS[this._options.skin] - && WYMeditor.SKINS[this._options.skin].init) - WYMeditor.SKINS[this._options.skin].init(this); - -}; - - -/********** DIALOGS **********/ - -WYMeditor.INIT_DIALOG = function(index) { - - var wym = window.opener.WYMeditor.INSTANCES[index]; - var doc = window.document; - var selected = wym.selected(); - var dialogType = jQuery(wym._options.dialogTypeSelector).val(); - var sStamp = wym.uniqueStamp(); - - switch(dialogType) { - - case WYMeditor.DIALOG_LINK: - //ensure that we select the link to populate the fields - if(selected && selected.tagName && selected.tagName.toLowerCase != WYMeditor.A) - selected = jQuery(selected).parentsOrSelf(WYMeditor.A); - - //fix MSIE selection if link image has been clicked - if(!selected && wym._selected_image) - selected = jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A); - break; - - } - - //pre-init functions - if(jQuery.isFunction(wym._options.preInitDialog)) - wym._options.preInitDialog(wym,window); - - //add css rules from options - var styles = doc.styleSheets[0]; - var aCss = eval(wym._options.dialogStyles); - - wym.addCssRules(doc, aCss); - - //auto populate fields if selected container (e.g. A) - if(selected) { - jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF)); - jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC)); - jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE)); - jQuery(wym._options.relSelector).val(jQuery(selected).attr(WYMeditor.REL)); - jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT)); - } - - //auto populate image fields if selected image - if(wym._selected_image) { - jQuery(wym._options.dialogImageSelector + " " + wym._options.srcSelector) - .val(jQuery(wym._selected_image).attr(WYMeditor.SRC)); - jQuery(wym._options.dialogImageSelector + " " + wym._options.titleSelector) - .val(jQuery(wym._selected_image).attr(WYMeditor.TITLE)); - jQuery(wym._options.dialogImageSelector + " " + wym._options.altSelector) - .val(jQuery(wym._selected_image).attr(WYMeditor.ALT)); - } - - jQuery(wym._options.dialogLinkSelector + " " - + wym._options.submitSelector).submit(function() { - - var sUrl = jQuery(wym._options.hrefSelector).val(); - if(sUrl.length > 0) { - var link; - - if (selected[0] && selected[0].tagName.toLowerCase() == WYMeditor.A) { - link = selected; - } else { - wym._exec(WYMeditor.CREATE_LINK, sStamp); - link = jQuery("a[href=" + sStamp + "]", wym._doc.body); - } - - link.attr(WYMeditor.HREF, sUrl) - .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val()) - .attr(WYMeditor.REL, jQuery(wym._options.relSelector).val()); - - } - window.close(); - }); - - jQuery(wym._options.dialogImageSelector + " " - + wym._options.submitSelector).submit(function() { - - var sUrl = jQuery(wym._options.srcSelector).val(); - if(sUrl.length > 0) { - - wym._exec(WYMeditor.INSERT_IMAGE, sStamp); - - jQuery("img[src$=" + sStamp + "]", wym._doc.body) - .attr(WYMeditor.SRC, sUrl) - .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val()) - .attr(WYMeditor.ALT, jQuery(wym._options.altSelector).val()); - } - window.close(); - }); - - jQuery(wym._options.dialogTableSelector + " " - + wym._options.submitSelector).submit(function() { - - var iRows = jQuery(wym._options.rowsSelector).val(); - var iCols = jQuery(wym._options.colsSelector).val(); - - if(iRows > 0 && iCols > 0) { - - var table = wym._doc.createElement(WYMeditor.TABLE); - var newRow = null; - var newCol = null; - - var sCaption = jQuery(wym._options.captionSelector).val(); - - //we create the caption - var newCaption = table.createCaption(); - newCaption.innerHTML = sCaption; - - //we create the rows and cells - for(x=0; x
    -* this.tag ('br', false, true) -* # =>
    -* this.tag ('input', jQuery({type:'text',disabled:true }) ) -* # => -*/ -WYMeditor.XmlHelper.prototype.tag = function(name, options, open) -{ - options = options || false; - open = open || false; - return '<'+name+(options ? this.tagOptions(options) : '')+(open ? '>' : ' />'); -}; - -/* -* @name contentTag -* @description -* Returns a XML block tag of type *name* surrounding the *content*. Add -* XML attributes by passing an attributes array to *options*. For attributes -* with no value like (disabled and readonly), give it a value of true in -* the *options* array. You can use symbols or strings for the attribute names. -* -* this.contentTag ('p', 'Hello world!' ) -* # =>

    Hello world!

    -* this.contentTag('div', this.contentTag('p', "Hello world!"), jQuery({class : "strong"})) -* # =>

    Hello world!

    -* this.contentTag("select", options, jQuery({multiple : true})) -* # => -*/ -WYMeditor.XmlHelper.prototype.contentTag = function(name, content, options) -{ - options = options || false; - return '<'+name+(options ? this.tagOptions(options) : '')+'>'+content+''; -}; - -/* -* @name cdataSection -* @description -* Returns a CDATA section for the given +content+. CDATA sections -* are used to escape blocks of text containing characters which would -* otherwise be recognized as markup. CDATA sections begin with the string -* <![CDATA[ and } with (and may not contain) the string -* ]]>. -*/ -WYMeditor.XmlHelper.prototype.cdataSection = function(content) -{ - return ''; -}; - - -/* -* @name escapeOnce -* @description -* Returns the escaped +xml+ without affecting existing escaped entities. -* -* this.escapeOnce( "1 > 2 & 3") -* # => "1 > 2 & 3" -*/ -WYMeditor.XmlHelper.prototype.escapeOnce = function(xml) -{ - return this._fixDoubleEscape(this.escapeEntities(xml)); -}; - -/* -* @name _fixDoubleEscape -* @description -* Fix double-escaped entities, such as &amp;, &#123;, etc. -*/ -WYMeditor.XmlHelper.prototype._fixDoubleEscape = function(escaped) -{ - return escaped.replace(/&([a-z]+|(#\d+));/ig, "&$1;"); -}; - -/* -* @name tagOptions -* @description -* Takes an array like the one generated by Tag.parseAttributes -* [["src", "http://www.editam.com/?a=b&c=d&f=g"], ["title", "Editam, CMS"]] -* or an object like {src:"http://www.editam.com/?a=b&c=d&f=g", title:"Editam, CMS"} -* and returns a string properly escaped like -* ' src = "http://www.editam.com/?a=b&c=d&f=g" title = "Editam, <Simplified> CMS"' -* which is valid for strict XHTML -*/ -WYMeditor.XmlHelper.prototype.tagOptions = function(options) -{ - var xml = this; - xml._formated_options = ''; - - for (var key in options) { - var formated_options = ''; - var value = options[key]; - if(typeof value != 'function' && value.length > 0) { - - if(parseInt(key) == key && typeof value == 'object'){ - key = value.shift(); - value = value.pop(); - } - if(key != '' && value != ''){ - xml._formated_options += ' '+key+'="'+xml.escapeOnce(value)+'"'; - } - } - } - return xml._formated_options; -}; - -/* -* @name escapeEntities -* @description -* Escapes XML/HTML entities <, >, & and ". If seccond parameter is set to false it -* will not escape ". If set to true it will also escape ' -*/ -WYMeditor.XmlHelper.prototype.escapeEntities = function(string, escape_quotes) -{ - this._entitiesDiv.innerHTML = string; - this._entitiesDiv.textContent = string; - var result = this._entitiesDiv.innerHTML; - if(typeof escape_quotes == 'undefined'){ - if(escape_quotes != false) result = result.replace('"', '"'); - if(escape_quotes == true) result = result.replace('"', '''); - } - return result; -}; - -/* -* Parses a string conatining tag attributes and values an returns an array formated like -* [["src", "http://www.editam.com"], ["title", "Editam, Simplified CMS"]] -*/ -WYMeditor.XmlHelper.prototype.parseAttributes = function(tag_attributes) -{ - // Use a compounded regex to match single quoted, double quoted and unquoted attribute pairs - var result = []; - var matches = tag_attributes.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g); - if(matches.toString() != tag_attributes){ - for (var k in matches) { - var v = matches[k]; - if(typeof v != 'function' && v.length != 0){ - var re = new RegExp('(\\w+)\\s*'+v); - if(match = tag_attributes.match(re) ){ - var value = v.replace(/^[\s=]+/, ""); - var delimiter = value.charAt(0); - delimiter = delimiter == '"' ? '"' : (delimiter=="'"?"'":''); - if(delimiter != ''){ - value = delimiter == '"' ? value.replace(/^"|"+$/g, '') : value.replace(/^'|'+$/g, ''); - } - tag_attributes = tag_attributes.replace(match[0],''); - result.push([match[1] , value]); - } - } - } - } - return result; -}; - -/** -* XhtmlValidator for validating tag attributes -* -* @author Bermi Ferrer - http://bermi.org -*/ -WYMeditor.XhtmlValidator = { - "_attributes": - { - "core": - { - "except":[ - "base", - "head", - "html", - "meta", - "param", - "script", - "style", - "title" - ], - "attributes":[ - "class", - "id", - "style", - "title", - "accesskey", - "tabindex" - ] - }, - "language": - { - "except":[ - "base", - "br", - "hr", - "iframe", - "param", - "script" - ], - "attributes": - { - "dir":[ - "ltr", - "rtl" - ], - "0":"lang", - "1":"xml:lang" - } - }, - "keyboard": - { - "attributes": - { - "accesskey":/^(\w){1}$/, - "tabindex":/^(\d)+$/ - } - } - }, - "_events": - { - "window": - { - "only":[ - "body" - ], - "attributes":[ - "onload", - "onunload" - ] - }, - "form": - { - "only":[ - "form", - "input", - "textarea", - "select", - "a", - "label", - "button" - ], - "attributes":[ - "onchange", - "onsubmit", - "onreset", - "onselect", - "onblur", - "onfocus" - ] - }, - "keyboard": - { - "except":[ - "base", - "bdo", - "br", - "frame", - "frameset", - "head", - "html", - "iframe", - "meta", - "param", - "script", - "style", - "title" - ], - "attributes":[ - "onkeydown", - "onkeypress", - "onkeyup" - ] - }, - "mouse": - { - "except":[ - "base", - "bdo", - "br", - "head", - "html", - "meta", - "param", - "script", - "style", - "title" - ], - "attributes":[ - "onclick", - "ondblclick", - "onmousedown", - "onmousemove", - "onmouseover", - "onmouseout", - "onmouseup" - ] - } - }, - "_tags": - { - "a": - { - "attributes": - { - "0":"charset", - "1":"coords", - "2":"href", - "3":"hreflang", - "4":"name", - "5":"rel", - "6":"rev", - "shape":/^(rect|rectangle|circ|circle|poly|polygon)$/, - "7":"type" - } - }, - "0":"abbr", - "1":"acronym", - "2":"address", - "area": - { - "attributes": - { - "0":"alt", - "1":"coords", - "2":"href", - "nohref":/^(true|false)$/, - "shape":/^(rect|rectangle|circ|circle|poly|polygon)$/ - }, - "required":[ - "alt" - ] - }, - "3":"b", - "base": - { - "attributes":[ - "href" - ], - "required":[ - "href" - ] - }, - "bdo": - { - "attributes": - { - "dir":/^(ltr|rtl)$/ - }, - "required":[ - "dir" - ] - }, - "4":"big", - "blockquote": - { - "attributes":[ - "cite" - ] - }, - "5":"body", - "6":"br", - "button": - { - "attributes": - { - "disabled":/^(disabled)$/, - "type":/^(button|reset|submit)$/, - "0":"value" - }, - "inside":"form" - }, - "7":"caption", - "8":"cite", - "9":"code", - "col": - { - "attributes": - { - "align":/^(right|left|center|justify)$/, - "0":"char", - "1":"charoff", - "span":/^(\d)+$/, - "valign":/^(top|middle|bottom|baseline)$/, - "2":"width" - }, - "inside":"colgroup" - }, - "colgroup": - { - "attributes": - { - "align":/^(right|left|center|justify)$/, - "0":"char", - "1":"charoff", - "span":/^(\d)+$/, - "valign":/^(top|middle|bottom|baseline)$/, - "2":"width" - } - }, - "10":"dd", - "del": - { - "attributes": - { - "0":"cite", - "datetime":/^([0-9]){8}/ - } - }, - "11":"div", - "12":"dfn", - "13":"dl", - "14":"dt", - "15":"em", - "fieldset": - { - "inside":"form" - }, - "form": - { - "attributes": - { - "0":"action", - "1":"accept", - "2":"accept-charset", - "3":"enctype", - "method":/^(get|post)$/ - }, - "required":[ - "action" - ] - }, - "head": - { - "attributes":[ - "profile" - ] - }, - "16":"h1", - "17":"h2", - "18":"h3", - "19":"h4", - "20":"h5", - "21":"h6", - "22":"hr", - "html": - { - "attributes":[ - "xmlns" - ] - }, - "23":"i", - "img": - { - "attributes":[ - "alt", - "src", - "height", - "ismap", - "longdesc", - "usemap", - "width" - ], - "required":[ - "alt", - "src" - ] - }, - "input": - { - "attributes": - { - "0":"accept", - "1":"alt", - "checked":/^(checked)$/, - "disabled":/^(disabled)$/, - "maxlength":/^(\d)+$/, - "2":"name", - "readonly":/^(readonly)$/, - "size":/^(\d)+$/, - "3":"src", - "type":/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/, - "4":"value" - }, - "inside":"form" - }, - "ins": - { - "attributes": - { - "0":"cite", - "datetime":/^([0-9]){8}/ - } - }, - "24":"kbd", - "label": - { - "attributes":[ - "for" - ], - "inside":"form" - }, - "25":"legend", - "26":"li", - "link": - { - "attributes": - { - "0":"charset", - "1":"href", - "2":"hreflang", - "media":/^(all|braille|print|projection|screen|speech|,|;| )+$/i, - //next comment line required by Opera! - /*"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,*/ - "rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i, - "rev":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i, - "3":"type" - }, - "inside":"head" - }, - "map": - { - "attributes":[ - "id", - "name" - ], - "required":[ - "id" - ] - }, - "meta": - { - "attributes": - { - "0":"content", - "http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i, - "1":"name", - "2":"scheme" - }, - "required":[ - "content" - ] - }, - "27":"noscript", - "object": - { - "attributes":[ - "archive", - "classid", - "codebase", - "codetype", - "data", - "declare", - "height", - "name", - "standby", - "type", - "usemap", - "width" - ] - }, - "28":"ol", - "optgroup": - { - "attributes": - { - "0":"label", - "disabled": /^(disabled)$/ - }, - "required":[ - "label" - ] - }, - "option": - { - "attributes": - { - "0":"label", - "disabled":/^(disabled)$/, - "selected":/^(selected)$/, - "1":"value" - }, - "inside":"select" - }, - "29":"p", - "param": - { - "attributes": - { - "0":"type", - "valuetype":/^(data|ref|object)$/, - "1":"valuetype", - "2":"value" - }, - "required":[ - "name" - ] - }, - "30":"pre", - "q": - { - "attributes":[ - "cite" - ] - }, - "31":"samp", - "script": - { - "attributes": - { - "type":/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/, - "0":"charset", - "defer":/^(defer)$/, - "1":"src" - }, - "required":[ - "type" - ] - }, - "select": - { - "attributes": - { - "disabled":/^(disabled)$/, - "multiple":/^(multiple)$/, - "0":"name", - "1":"size" - }, - "inside":"form" - }, - "32":"small", - "33":"span", - "34":"strong", - "style": - { - "attributes": - { - "0":"type", - "media":/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/ - }, - "required":[ - "type" - ] - }, - "35":"sub", - "36":"sup", - "table": - { - "attributes": - { - "0":"border", - "1":"cellpadding", - "2":"cellspacing", - "frame":/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/, - "rules":/^(none|groups|rows|cols|all)$/, - "3":"summary", - "4":"width" - } - }, - "tbody": - { - "attributes": - { - "align":/^(right|left|center|justify)$/, - "0":"char", - "1":"charoff", - "valign":/^(top|middle|bottom|baseline)$/ - } - }, - "td": - { - "attributes": - { - "0":"abbr", - "align":/^(left|right|center|justify|char)$/, - "1":"axis", - "2":"char", - "3":"charoff", - "colspan":/^(\d)+$/, - "4":"headers", - "rowspan":/^(\d)+$/, - "scope":/^(col|colgroup|row|rowgroup)$/, - "valign":/^(top|middle|bottom|baseline)$/ - } - }, - "textarea": - { - "attributes":[ - "cols", - "rows", - "disabled", - "name", - "readonly" - ], - "required":[ - "cols", - "rows" - ], - "inside":"form" - }, - "tfoot": - { - "attributes": - { - "align":/^(right|left|center|justify)$/, - "0":"char", - "1":"charoff", - "valign":/^(top|middle|bottom)$/, - "2":"baseline" - } - }, - "th": - { - "attributes": - { - "0":"abbr", - "align":/^(left|right|center|justify|char)$/, - "1":"axis", - "2":"char", - "3":"charoff", - "colspan":/^(\d)+$/, - "4":"headers", - "rowspan":/^(\d)+$/, - "scope":/^(col|colgroup|row|rowgroup)$/, - "valign":/^(top|middle|bottom|baseline)$/ - } - }, - "thead": - { - "attributes": - { - "align":/^(right|left|center|justify)$/, - "0":"char", - "1":"charoff", - "valign":/^(top|middle|bottom|baseline)$/ - } - }, - "37":"title", - "tr": - { - "attributes": - { - "align":/^(right|left|center|justify|char)$/, - "0":"char", - "1":"charoff", - "valign":/^(top|middle|bottom|baseline)$/ - } - }, - "38":"tt", - "39":"ul", - "40":"var" - }, - - // Temporary skiped attributes - skiped_attributes : [], - skiped_attribute_values : [], - - getValidTagAttributes: function(tag, attributes) - { - var valid_attributes = {}; - var possible_attributes = this.getPossibleTagAttributes(tag); - for(var attribute in attributes) { - var value = attributes[attribute]; - var h = WYMeditor.Helper; - if(!h.contains(this.skiped_attributes, attribute) && !h.contains(this.skiped_attribute_values, value)){ - if (typeof value != 'function' && h.contains(possible_attributes, attribute)) { - if (this.doesAttributeNeedsValidation(tag, attribute)) { - if(this.validateAttribute(tag, attribute, value)){ - valid_attributes[attribute] = value; - } - }else{ - valid_attributes[attribute] = value; - } - } - } - } - return valid_attributes; - }, - getUniqueAttributesAndEventsForTag : function(tag) - { - var result = []; - - if (this._tags[tag] && this._tags[tag]['attributes']) { - for (k in this._tags[tag]['attributes']) { - result.push(parseInt(k) == k ? this._tags[tag]['attributes'][k] : k); - } - } - return result; - }, - getDefaultAttributesAndEventsForTags : function() - { - var result = []; - for (var key in this._events){ - result.push(this._events[key]); - } - for (var key in this._attributes){ - result.push(this._attributes[key]); - } - return result; - }, - isValidTag : function(tag) - { - if(this._tags[tag]){ - return true; - } - for(var key in this._tags){ - if(this._tags[key] == tag){ - return true; - } - } - return false; - }, - getDefaultAttributesAndEventsForTag : function(tag) - { - var default_attributes = []; - if (this.isValidTag(tag)) { - var default_attributes_and_events = this.getDefaultAttributesAndEventsForTags(); - - for(var key in default_attributes_and_events) { - var defaults = default_attributes_and_events[key]; - if(typeof defaults == 'object'){ - var h = WYMeditor.Helper; - if ((defaults['except'] && h.contains(defaults['except'], tag)) || (defaults['only'] && !h.contains(defaults['only'], tag))) { - continue; - } - - var tag_defaults = defaults['attributes'] ? defaults['attributes'] : defaults['events']; - for(var k in tag_defaults) { - default_attributes.push(typeof tag_defaults[k] != 'string' ? k : tag_defaults[k]); - } - } - } - } - return default_attributes; - }, - doesAttributeNeedsValidation: function(tag, attribute) - { - return this._tags[tag] && ((this._tags[tag]['attributes'] && this._tags[tag]['attributes'][attribute]) || (this._tags[tag]['required'] && - WYMeditor.Helper.contains(this._tags[tag]['required'], attribute))); - }, - validateAttribute : function(tag, attribute, value) - { - if ( this._tags[tag] && - (this._tags[tag]['attributes'] && this._tags[tag]['attributes'][attribute] && value.length > 0 && !value.match(this._tags[tag]['attributes'][attribute])) || // invalid format - (this._tags[tag] && this._tags[tag]['required'] && WYMeditor.Helper.contains(this._tags[tag]['required'], attribute) && value.length == 0) // required attribute - ) { - return false; - } - return typeof this._tags[tag] != 'undefined'; - }, - getPossibleTagAttributes : function(tag) - { - if (!this._possible_tag_attributes) { - this._possible_tag_attributes = {}; - } - if (!this._possible_tag_attributes[tag]) { - this._possible_tag_attributes[tag] = this.getUniqueAttributesAndEventsForTag(tag).concat(this.getDefaultAttributesAndEventsForTag(tag)); - } - return this._possible_tag_attributes[tag]; - } -}; - - -/** -* Compounded regular expression. Any of -* the contained patterns could match and -* when one does, it's label is returned. -* -* Constructor. Starts with no patterns. -* @param boolean case True for case sensitive, false -* for insensitive. -* @access public -* @author Marcus Baker (http://lastcraft.com) -* @author Bermi Ferrer (http://bermi.org) -*/ -WYMeditor.ParallelRegex = function(case_sensitive) -{ - this._case = case_sensitive; - this._patterns = []; - this._labels = []; - this._regex = null; - return this; -}; - - -/** -* Adds a pattern with an optional label. -* @param string pattern Perl style regex, but ( and ) -* lose the usual meaning. -* @param string label Label of regex to be returned -* on a match. -* @access public -*/ -WYMeditor.ParallelRegex.prototype.addPattern = function(pattern, label) -{ - label = label || true; - var count = this._patterns.length; - this._patterns[count] = pattern; - this._labels[count] = label; - this._regex = null; -}; - -/** -* Attempts to match all patterns at once against -* a string. -* @param string subject String to match against. -* -* @return boolean True on success. -* @return string match First matched portion of -* subject. -* @access public -*/ -WYMeditor.ParallelRegex.prototype.match = function(subject) -{ - if (this._patterns.length == 0) { - return [false, '']; - } - var matches = subject.match(this._getCompoundedRegex()); - - if(!matches){ - return [false, '']; - } - var match = matches[0]; - for (var i = 1; i < matches.length; i++) { - if (matches[i]) { - return [this._labels[i-1], match]; - } - } - return [true, matches[0]]; -}; - -/** -* Compounds the patterns into a single -* regular expression separated with the -* "or" operator. Caches the regex. -* Will automatically escape (, ) and / tokens. -* @param array patterns List of patterns in order. -* @access private -*/ -WYMeditor.ParallelRegex.prototype._getCompoundedRegex = function() -{ - if (this._regex == null) { - for (var i = 0, count = this._patterns.length; i < count; i++) { - this._patterns[i] = '(' + this._untokenizeRegex(this._tokenizeRegex(this._patterns[i]).replace(/([\/\(\)])/g,'\\$1')) + ')'; - } - this._regex = new RegExp(this._patterns.join("|") ,this._getPerlMatchingFlags()); - } - return this._regex; -}; - -/** -* Escape lookahead/lookbehind blocks -*/ -WYMeditor.ParallelRegex.prototype._tokenizeRegex = function(regex) -{ - return regex. - replace(/\(\?(i|m|s|x|U)\)/, '~~~~~~Tk1\$1~~~~~~'). - replace(/\(\?(\-[i|m|s|x|U])\)/, '~~~~~~Tk2\$1~~~~~~'). - replace(/\(\?\=(.*)\)/, '~~~~~~Tk3\$1~~~~~~'). - replace(/\(\?\!(.*)\)/, '~~~~~~Tk4\$1~~~~~~'). - replace(/\(\?\<\=(.*)\)/, '~~~~~~Tk5\$1~~~~~~'). - replace(/\(\?\<\!(.*)\)/, '~~~~~~Tk6\$1~~~~~~'). - replace(/\(\?\:(.*)\)/, '~~~~~~Tk7\$1~~~~~~'); -}; - -/** -* Unscape lookahead/lookbehind blocks -*/ -WYMeditor.ParallelRegex.prototype._untokenizeRegex = function(regex) -{ - return regex. - replace(/~~~~~~Tk1(.{1})~~~~~~/, "(?\$1)"). - replace(/~~~~~~Tk2(.{2})~~~~~~/, "(?\$1)"). - replace(/~~~~~~Tk3(.*)~~~~~~/, "(?=\$1)"). - replace(/~~~~~~Tk4(.*)~~~~~~/, "(?!\$1)"). - replace(/~~~~~~Tk5(.*)~~~~~~/, "(?<=\$1)"). - replace(/~~~~~~Tk6(.*)~~~~~~/, "(?", 'Comment'); -}; - -WYMeditor.XhtmlLexer.prototype.addScriptTokens = function(scope) -{ - this.addEntryPattern("", 'Script'); -}; - -WYMeditor.XhtmlLexer.prototype.addCssTokens = function(scope) -{ - this.addEntryPattern("", 'Css'); -}; - -WYMeditor.XhtmlLexer.prototype.addTagTokens = function(scope) -{ - this.addSpecialPattern("<\\s*[a-z0-9:\-]+\\s*>", scope, 'OpeningTag'); - this.addEntryPattern("<[a-z0-9:\-]+"+'[\\\/ \\\>]+', scope, 'OpeningTag'); - this.addInTagDeclarationTokens('OpeningTag'); - - this.addSpecialPattern("", scope, 'ClosingTag'); - -}; - -WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens = function(scope) -{ - this.addSpecialPattern('\\s+', scope, 'Ignore'); - - this.addAttributeTokens(scope); - - this.addExitPattern('/>', scope); - this.addExitPattern('>', scope); - -}; - -WYMeditor.XhtmlLexer.prototype.addAttributeTokens = function(scope) -{ - this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?=\=)\\s*", scope, 'TagAttributes'); - - this.addEntryPattern('=\\s*"', scope, 'DoubleQuotedAttribute'); - this.addPattern("\\\\\"", 'DoubleQuotedAttribute'); - this.addExitPattern('"', 'DoubleQuotedAttribute'); - - this.addEntryPattern("=\\s*'", scope, 'SingleQuotedAttribute'); - this.addPattern("\\\\'", 'SingleQuotedAttribute'); - this.addExitPattern("'", 'SingleQuotedAttribute'); - - this.addSpecialPattern('=\\s*[^>\\s]*', scope, 'UnquotedAttribute'); -}; - - - -/** -* XHTML Parser. -* -* This XHTML parser will trigger the events available on on -* current SaxListener -* -* @author Bermi Ferrer (http://bermi.org) -*/ -WYMeditor.XhtmlParser = function(Listener, mode) -{ - var mode = mode || 'Text'; - this._Lexer = new WYMeditor.XhtmlLexer(this); - this._Listener = Listener; - this._mode = mode; - this._matches = []; - this._last_match = ''; - this._current_match = ''; - - return this; -}; - -WYMeditor.XhtmlParser.prototype.parse = function(raw) -{ - this._Lexer.parse(this.beforeParsing(raw)); - return this.afterParsing(this._Listener.getResult()); -}; - -WYMeditor.XhtmlParser.prototype.beforeParsing = function(raw) -{ - if(raw.match(/class="MsoNormal"/) || raw.match(/ns = "urn:schemas-microsoft-com/)){ - // Usefull for cleaning up content pasted from other sources (MSWord) - this._Listener.avoidStylingTagsAndAttributes(); - } - return this._Listener.beforeParsing(raw); -}; - -WYMeditor.XhtmlParser.prototype.afterParsing = function(parsed) -{ - if(this._Listener._avoiding_tags_implicitly){ - this._Listener.allowStylingTagsAndAttributes(); - } - return this._Listener.afterParsing(parsed); -}; - - -WYMeditor.XhtmlParser.prototype.Ignore = function(match, state) -{ - return true; -}; - -WYMeditor.XhtmlParser.prototype.Text = function(text) -{ - this._Listener.addContent(text); - return true; -}; - -WYMeditor.XhtmlParser.prototype.Comment = function(match, status) -{ - return this._addNonTagBlock(match, status, 'addComment'); -}; - -WYMeditor.XhtmlParser.prototype.Script = function(match, status) -{ - return this._addNonTagBlock(match, status, 'addScript'); -}; - -WYMeditor.XhtmlParser.prototype.Css = function(match, status) -{ - return this._addNonTagBlock(match, status, 'addCss'); -}; - -WYMeditor.XhtmlParser.prototype._addNonTagBlock = function(match, state, type) -{ - switch (state){ - case WYMeditor.LEXER_ENTER: - this._non_tag = match; - break; - case WYMeditor.LEXER_UNMATCHED: - this._non_tag += match; - break; - case WYMeditor.LEXER_EXIT: - switch(type) { - case 'addComment': - this._Listener.addComment(this._non_tag+match); - break; - case 'addScript': - this._Listener.addScript(this._non_tag+match); - break; - case 'addCss': - this._Listener.addCss(this._non_tag+match); - break; - } - } - return true; -}; - -WYMeditor.XhtmlParser.prototype.OpeningTag = function(match, state) -{ - switch (state){ - case WYMeditor.LEXER_ENTER: - this._tag = this.normalizeTag(match); - this._tag_attributes = {}; - break; - case WYMeditor.LEXER_SPECIAL: - this._callOpenTagListener(this.normalizeTag(match)); - break; - case WYMeditor.LEXER_EXIT: - this._callOpenTagListener(this._tag, this._tag_attributes); - } - return true; -}; - -WYMeditor.XhtmlParser.prototype.ClosingTag = function(match, state) -{ - this._callCloseTagListener(this.normalizeTag(match)); - return true; -}; - -WYMeditor.XhtmlParser.prototype._callOpenTagListener = function(tag, attributes) -{ - var attributes = attributes || {}; - this.autoCloseUnclosedBeforeNewOpening(tag); - - if(this._Listener.isBlockTag(tag)){ - this._Listener._tag_stack.push(tag); - this._Listener.fixNestingBeforeOpeningBlockTag(tag, attributes); - this._Listener.openBlockTag(tag, attributes); - this._increaseOpenTagCounter(tag); - }else if(this._Listener.isInlineTag(tag)){ - this._Listener.inlineTag(tag, attributes); - }else{ - this._Listener.openUnknownTag(tag, attributes); - this._increaseOpenTagCounter(tag); - } - this._Listener.last_tag = tag; - this._Listener.last_tag_opened = true; - this._Listener.last_tag_attributes = attributes; -}; - -WYMeditor.XhtmlParser.prototype._callCloseTagListener = function(tag) -{ - if(this._decreaseOpenTagCounter(tag)){ - this.autoCloseUnclosedBeforeTagClosing(tag); - - if(this._Listener.isBlockTag(tag)){ - var expected_tag = this._Listener._tag_stack.pop(); - if(expected_tag == false){ - return; - }else if(expected_tag != tag){ - tag = expected_tag; - } - this._Listener.closeBlockTag(tag); - }else{ - this._Listener.closeUnknownTag(tag); - } - }else{ - this._Listener.closeUnopenedTag(tag); - } - this._Listener.last_tag = tag; - this._Listener.last_tag_opened = false; -}; - -WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter = function(tag) -{ - this._Listener._open_tags[tag] = this._Listener._open_tags[tag] || 0; - this._Listener._open_tags[tag]++; -}; - -WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter = function(tag) -{ - if(this._Listener._open_tags[tag]){ - this._Listener._open_tags[tag]--; - if(this._Listener._open_tags[tag] == 0){ - this._Listener._open_tags[tag] = undefined; - } - return true; - } - return false; -}; - -WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening = function(new_tag) -{ - this._autoCloseUnclosed(new_tag, false); -}; - -WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing = function(tag) -{ - this._autoCloseUnclosed(tag, true); -}; - -WYMeditor.XhtmlParser.prototype._autoCloseUnclosed = function(new_tag, closing) -{ - var closing = closing || false; - if(this._Listener._open_tags){ - for (var tag in this._Listener._open_tags) { - var counter = this._Listener._open_tags[tag]; - if(counter > 0 && this._Listener.shouldCloseTagAutomatically(tag, new_tag, closing)){ - this._callCloseTagListener(tag, true); - } - } - } -}; - -WYMeditor.XhtmlParser.prototype.getTagReplacements = function() -{ - return this._Listener.getTagReplacements(); -}; - -WYMeditor.XhtmlParser.prototype.normalizeTag = function(tag) -{ - tag = tag.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,'').toLowerCase(); - var tags = this._Listener.getTagReplacements(); - if(tags[tag]){ - return tags[tag]; - } - return tag; -}; - -WYMeditor.XhtmlParser.prototype.TagAttributes = function(match, state) -{ - if(WYMeditor.LEXER_SPECIAL == state){ - this._current_attribute = match; - } - return true; -}; - -WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute = function(match, state) -{ - if(WYMeditor.LEXER_UNMATCHED == state){ - this._tag_attributes[this._current_attribute] = match; - } - return true; -}; - -WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute = function(match, state) -{ - if(WYMeditor.LEXER_UNMATCHED == state){ - this._tag_attributes[this._current_attribute] = match; - } - return true; -}; - -WYMeditor.XhtmlParser.prototype.UnquotedAttribute = function(match, state) -{ - this._tag_attributes[this._current_attribute] = match.replace(/^=/,''); - return true; -}; - - - -/** -* XHTML Sax parser. -* -* @author Bermi Ferrer (http://bermi.org) -*/ -WYMeditor.XhtmlSaxListener = function() -{ - this.output = ''; - this.helper = new WYMeditor.XmlHelper(); - this._open_tags = {}; - this.validator = WYMeditor.XhtmlValidator; - this._tag_stack = []; - this.avoided_tags = []; - - this.entities = { - ' ':' ','¡':'¡','¢':'¢', - '£':'£','¤':'¤','¥':'¥', - '¦':'¦','§':'§','¨':'¨', - '©':'©','ª':'ª','«':'«', - '¬':'¬','­':'­','®':'®', - '¯':'¯','°':'°','±':'±', - '²':'²','³':'³','´':'´', - 'µ':'µ','¶':'¶','·':'·', - '¸':'¸','¹':'¹','º':'º', - '»':'»','¼':'¼','½':'½', - '¾':'¾','¿':'¿','À':'À', - 'Á':'Á','Â':'Â','Ã':'Ã', - 'Ä':'Ä','Å':'Å','Æ':'Æ', - 'Ç':'Ç','È':'È','É':'É', - 'Ê':'Ê','Ë':'Ë','Ì':'Ì', - 'Í':'Í','Î':'Î','Ï':'Ï', - 'Ð':'Ð','Ñ':'Ñ','Ò':'Ò', - 'Ó':'Ó','Ô':'Ô','Õ':'Õ', - 'Ö':'Ö','×':'×','Ø':'Ø', - 'Ù':'Ù','Ú':'Ú','Û':'Û', - 'Ü':'Ü','Ý':'Ý','Þ':'Þ', - 'ß':'ß','à':'à','á':'á', - 'â':'â','ã':'ã','ä':'ä', - 'å':'å','æ':'æ','ç':'ç', - 'è':'è','é':'é','ê':'ê', - 'ë':'ë','ì':'ì','í':'í', - 'î':'î','ï':'ï','ð':'ð', - 'ñ':'ñ','ò':'ò','ó':'ó', - 'ô':'ô','õ':'õ','ö':'ö', - '÷':'÷','ø':'ø','ù':'ù', - 'ú':'ú','û':'û','ü':'ü', - 'ý':'ý','þ':'þ','ÿ':'ÿ', - 'Œ':'Œ','œ':'œ','Š':'Š', - 'š':'š','Ÿ':'Ÿ','ƒ':'ƒ', - 'ˆ':'ˆ','˜':'˜','Α':'Α', - 'Β':'Β','Γ':'Γ','Δ':'Δ', - 'Ε':'Ε','Ζ':'Ζ','Η':'Η', - 'Θ':'Θ','Ι':'Ι','Κ':'Κ', - 'Λ':'Λ','Μ':'Μ','Ν':'Ν', - 'Ξ':'Ξ','Ο':'Ο','Π':'Π', - 'Ρ':'Ρ','Σ':'Σ','Τ':'Τ', - 'Υ':'Υ','Φ':'Φ','Χ':'Χ', - 'Ψ':'Ψ','Ω':'Ω','α':'α', - 'β':'β','γ':'γ','δ':'δ', - 'ε':'ε','ζ':'ζ','η':'η', - 'θ':'θ','ι':'ι','κ':'κ', - 'λ':'λ','μ':'μ','ν':'ν', - 'ξ':'ξ','ο':'ο','π':'π', - 'ρ':'ρ','ς':'ς','σ':'σ', - 'τ':'τ','υ':'υ','φ':'φ', - 'χ':'χ','ψ':'ψ','ω':'ω', - 'ϑ':'ϑ','ϒ':'ϒ','ϖ':'ϖ', - ' ':' ',' ':' ',' ':' ', - '‌':'‌','‍':'‍','‎':'‎', - '‏':'‏','–':'–','—':'—', - '‘':'‘','’':'’','‚':'‚', - '“':'“','”':'”','„':'„', - '†':'†','‡':'‡','•':'•', - '…':'…','‰':'‰','′':'′', - '″':'″','‹':'‹','›':'›', - '‾':'‾','⁄':'⁄','€':'€', - 'ℑ':'ℑ','℘':'℘','ℜ':'ℜ', - '™':'™','ℵ':'ℵ','←':'←', - '↑':'↑','→':'→','↓':'↓', - '↔':'↔','↵':'↵','⇐':'⇐', - '⇑':'⇑','⇒':'⇒','⇓':'⇓', - '⇔':'⇔','∀':'∀','∂':'∂', - '∃':'∃','∅':'∅','∇':'∇', - '∈':'∈','∉':'∉','∋':'∋', - '∏':'∏','∑':'∑','−':'−', - '∗':'∗','√':'√','∝':'∝', - '∞':'∞','∠':'∠','∧':'∧', - '∨':'∨','∩':'∩','∪':'∪', - '∫':'∫','∴':'∴','∼':'∼', - '≅':'≅','≈':'≈','≠':'≠', - '≡':'≡','≤':'≤','≥':'≥', - '⊂':'⊂','⊃':'⊃','⊄':'⊄', - '⊆':'⊆','⊇':'⊇','⊕':'⊕', - '⊗':'⊗','⊥':'⊥','⋅':'⋅', - '⌈':'⌈','⌉':'⌉','⌊':'⌊', - '⌋':'⌋','⟨':'〈','⟩':'〉', - '◊':'◊','♠':'♠','♣':'♣', - '♥':'♥','♦':'♦'}; - - this.block_tags = ["a", "abbr", "acronym", "address", "area", "b", - "base", "bdo", "big", "blockquote", "body", "button", - "caption", "cite", "code", "col", "colgroup", "dd", "del", "div", - "dfn", "dl", "dt", "em", "fieldset", "form", "head", "h1", "h2", - "h3", "h4", "h5", "h6", "html", "i", "ins", - "kbd", "label", "legend", "li", "map", "noscript", - "object", "ol", "optgroup", "option", "p", "param", "pre", "q", - "samp", "script", "select", "small", "span", "strong", "style", - "sub", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", - "thead", "title", "tr", "tt", "ul", "var", "extends"]; - - - this.inline_tags = ["br", "hr", "img", "input"]; - - return this; -}; - -WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically = function(tag, now_on_tag, closing) -{ - var closing = closing || false; - if(tag == 'td'){ - if((closing && now_on_tag == 'tr') || (!closing && now_on_tag == 'td')){ - return true; - } - } - if(tag == 'option'){ - if((closing && now_on_tag == 'select') || (!closing && now_on_tag == 'option')){ - return true; - } - } - return false; -}; - -WYMeditor.XhtmlSaxListener.prototype.beforeParsing = function(raw) -{ - this.output = ''; - return raw; -}; - -WYMeditor.XhtmlSaxListener.prototype.afterParsing = function(xhtml) -{ - xhtml = this.replaceNamedEntities(xhtml); - xhtml = this.joinRepeatedEntities(xhtml); - xhtml = this.removeEmptyTags(xhtml); - xhtml = this.removeBrInPre(xhtml); - return xhtml; -}; - -WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities = function(xhtml) -{ - for (var entity in this.entities) { - xhtml = xhtml.replace(new RegExp(entity, 'g'), this.entities[entity]); - } - return xhtml; -}; - -WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities = function(xhtml) -{ - var tags = 'em|strong|sub|sup|acronym|pre|del|address'; - return xhtml.replace(new RegExp('<\/('+tags+')><\\1>' ,''),''). - replace(new RegExp('(\s*<('+tags+')>\s*){2}(.*)(\s*<\/\\2>\s*){2}' ,''),'<\$2>\$3<\$2>'); -}; - -WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags = function(xhtml) -{ - return xhtml.replace(new RegExp('<('+this.block_tags.join("|").replace(/\|td/,'').replace(/\|th/, '')+')>(
    | | |\\s)*<\/\\1>' ,'g'),''); -}; - -WYMeditor.XhtmlSaxListener.prototype.removeBrInPre = function(xhtml) -{ - var matches = xhtml.match(new RegExp(']*>(.*?)<\/pre>','gmi')); - if(matches) { - for(var i=0; i', 'g'), String.fromCharCode(13,10))); - } - } - return xhtml; -}; - -WYMeditor.XhtmlSaxListener.prototype.getResult = function() -{ - return this.output; -}; - -WYMeditor.XhtmlSaxListener.prototype.getTagReplacements = function() -{ - return {'b':'strong', 'i':'em'}; -}; - -WYMeditor.XhtmlSaxListener.prototype.addContent = function(text) -{ - this.output += text; -}; - -WYMeditor.XhtmlSaxListener.prototype.addComment = function(text) -{ - if(this.remove_comments){ - this.output += text; - } -}; - -WYMeditor.XhtmlSaxListener.prototype.addScript = function(text) -{ - if(!this.remove_scripts){ - this.output += text; - } -}; - -WYMeditor.XhtmlSaxListener.prototype.addCss = function(text) -{ - if(!this.remove_embeded_styles){ - this.output += text; - } -}; - -WYMeditor.XhtmlSaxListener.prototype.openBlockTag = function(tag, attributes) -{ - this.output += this.helper.tag(tag, this.validator.getValidTagAttributes(tag, attributes), true); -}; - -WYMeditor.XhtmlSaxListener.prototype.inlineTag = function(tag, attributes) -{ - this.output += this.helper.tag(tag, this.validator.getValidTagAttributes(tag, attributes)); -}; - -WYMeditor.XhtmlSaxListener.prototype.openUnknownTag = function(tag, attributes) -{ - //this.output += this.helper.tag(tag, attributes, true); -}; - -WYMeditor.XhtmlSaxListener.prototype.closeBlockTag = function(tag) -{ - this.output = this.output.replace(/
    $/, '')+this._getClosingTagContent('before', tag)+""+this._getClosingTagContent('after', tag); -}; - -WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag = function(tag) -{ - //this.output += ""; -}; - -WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag = function(tag) -{ - this.output += ""; -}; - -WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes = function() -{ - this.avoided_tags = ['div','span']; - this.validator.skiped_attributes = ['style']; - this.validator.skiped_attribute_values = ['MsoNormal','main1']; // MS Word attributes for class - this._avoiding_tags_implicitly = true; -}; - -WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes = function() -{ - this.avoided_tags = []; - this.validator.skiped_attributes = []; - this.validator.skiped_attribute_values = []; - this._avoiding_tags_implicitly = false; -}; - -WYMeditor.XhtmlSaxListener.prototype.isBlockTag = function(tag) -{ - return !WYMeditor.Helper.contains(this.avoided_tags, tag) && WYMeditor.Helper.contains(this.block_tags, tag); -}; - -WYMeditor.XhtmlSaxListener.prototype.isInlineTag = function(tag) -{ - return !WYMeditor.Helper.contains(this.avoided_tags, tag) && WYMeditor.Helper.contains(this.inline_tags, tag); -}; - -WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag = function(tag, content) -{ - this._insertContentWhenClosingTag('after', tag, content); -}; - -WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag = function(tag, content) -{ - this._insertContentWhenClosingTag('before', tag, content); -}; - -WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag = function(tag, attributes) -{ - if(tag != 'li' && (tag == 'ul' || tag == 'ol') && this.last_tag && !this.last_tag_opened && this.last_tag == 'li'){ - this.output = this.output.replace(/<\/li>$/, ''); - this.insertContentAfterClosingTag(tag, '
  • '); - } -}; - -WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag = function(position, tag, content) -{ - if(!this['_insert_'+position+'_closing']){ - this['_insert_'+position+'_closing'] = []; - } - if(!this['_insert_'+position+'_closing'][tag]){ - this['_insert_'+position+'_closing'][tag] = []; - } - this['_insert_'+position+'_closing'][tag].push(content); -}; - -WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent = function(position, tag) -{ - if( this['_insert_'+position+'_closing'] && - this['_insert_'+position+'_closing'][tag] && - this['_insert_'+position+'_closing'][tag].length > 0){ - return this['_insert_'+position+'_closing'][tag].pop(); - } - return ''; -}; - - -/********** CSS PARSER **********/ - - -WYMeditor.WymCssLexer = function(parser, only_wym_blocks) -{ - var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? true : only_wym_blocks); - - jQuery.extend(this, new WYMeditor.Lexer(parser, (only_wym_blocks?'Ignore':'WymCss'))); - - this.mapHandler('WymCss', 'Ignore'); - - if(only_wym_blocks == true){ - this.addEntryPattern("/\\\x2a[<\\s]*WYMeditor[>\\s]*\\\x2a/", 'Ignore', 'WymCss'); - this.addExitPattern("/\\\x2a[<\/\\s]*WYMeditor[>\\s]*\\\x2a/", 'WymCss'); - } - - this.addSpecialPattern("[\\sa-z1-6]*\\\x2e[a-z-_0-9]+", 'WymCss', 'WymCssStyleDeclaration'); - - this.addEntryPattern("/\\\x2a", 'WymCss', 'WymCssComment'); - this.addExitPattern("\\\x2a/", 'WymCssComment'); - - this.addEntryPattern("\x7b", 'WymCss', 'WymCssStyle'); - this.addExitPattern("\x7d", 'WymCssStyle'); - - this.addEntryPattern("/\\\x2a", 'WymCssStyle', 'WymCssFeedbackStyle'); - this.addExitPattern("\\\x2a/", 'WymCssFeedbackStyle'); - - return this; -}; - -WYMeditor.WymCssParser = function() -{ - this._in_style = false; - this._has_title = false; - this.only_wym_blocks = true; - this.css_settings = {'classesItems':[], 'editorStyles':[], 'dialogStyles':[]}; - return this; -}; - -WYMeditor.WymCssParser.prototype.parse = function(raw, only_wym_blocks) -{ - var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? this.only_wym_blocks : only_wym_blocks); - this._Lexer = new WYMeditor.WymCssLexer(this, only_wym_blocks); - this._Lexer.parse(raw); -}; - -WYMeditor.WymCssParser.prototype.Ignore = function(match, state) -{ - return true; -}; - -WYMeditor.WymCssParser.prototype.WymCssComment = function(text, status) -{ - if(text.match(/end[a-z0-9\s]*wym[a-z0-9\s]*/mi)){ - return false; - } - if(status == WYMeditor.LEXER_UNMATCHED){ - if(!this._in_style){ - this._has_title = true; - this._current_item = {'title':WYMeditor.Helper.trim(text)}; - }else{ - if(this._current_item[this._current_element]){ - if(!this._current_item[this._current_element].expressions){ - this._current_item[this._current_element].expressions = [text]; - }else{ - this._current_item[this._current_element].expressions.push(text); - } - } - } - this._in_style = true; - } - return true; -}; - -WYMeditor.WymCssParser.prototype.WymCssStyle = function(match, status) -{ - if(status == WYMeditor.LEXER_UNMATCHED){ - match = WYMeditor.Helper.trim(match); - if(match != ''){ - this._current_item[this._current_element].style = match; - } - }else if (status == WYMeditor.LEXER_EXIT){ - this._in_style = false; - this._has_title = false; - this.addStyleSetting(this._current_item); - } - return true; -}; - -WYMeditor.WymCssParser.prototype.WymCssFeedbackStyle = function(match, status) -{ - if(status == WYMeditor.LEXER_UNMATCHED){ - this._current_item[this._current_element].feedback_style = match.replace(/^([\s\/\*]*)|([\s\/\*]*)$/gm,''); - } - return true; -}; - -WYMeditor.WymCssParser.prototype.WymCssStyleDeclaration = function(match) -{ - match = match.replace(/^([\s\.]*)|([\s\.*]*)$/gm, ''); - - var tag = ''; - if(match.indexOf('.') > 0){ - var parts = match.split('.'); - this._current_element = parts[1]; - var tag = parts[0]; - }else{ - this._current_element = match; - } - - if(!this._has_title){ - this._current_item = {'title':(!tag?'':tag.toUpperCase()+': ')+this._current_element}; - this._has_title = true; - } - - if(!this._current_item[this._current_element]){ - this._current_item[this._current_element] = {'name':this._current_element}; - } - if(tag){ - if(!this._current_item[this._current_element].tags){ - this._current_item[this._current_element].tags = [tag]; - }else{ - this._current_item[this._current_element].tags.push(tag); - } - } - return true; -}; - -WYMeditor.WymCssParser.prototype.addStyleSetting = function(style_details) -{ - for (var name in style_details){ - var details = style_details[name]; - if(typeof details == 'object' && name != 'title'){ - - this.css_settings.classesItems.push({ - 'name': WYMeditor.Helper.trim(details.name), - 'title': style_details.title, - 'expr' : WYMeditor.Helper.trim((details.expressions||details.tags).join(', ')) - }); - if(details.feedback_style){ - this.css_settings.editorStyles.push({ - 'name': '.'+ WYMeditor.Helper.trim(details.name), - 'css': details.feedback_style - }); - } - if(details.style){ - this.css_settings.dialogStyles.push({ - 'name': '.'+ WYMeditor.Helper.trim(details.name), - 'css': details.style - }); - } - } - } -}; - -/********** HELPERS **********/ - -// Returns true if it is a text node with whitespaces only -jQuery.fn.isPhantomNode = function() { - if (this[0].nodeType == 3) - return !(/[^\t\n\r ]/.test(this[0].data)); - - return false; -}; - -WYMeditor.isPhantomNode = function(n) { - if (n.nodeType == 3) - return !(/[^\t\n\r ]/.test(n.data)); - - return false; -}; - -WYMeditor.isPhantomString = function(str) { - return !(/[^\t\n\r ]/.test(str)); -}; - -// Returns the Parents or the node itself -// jqexpr = a jQuery expression -jQuery.fn.parentsOrSelf = function(jqexpr) { - var n = this; - - if (n[0].nodeType == 3) - n = n.parents().slice(0,1); - -// if (n.is(jqexpr)) // XXX should work, but doesn't (probably a jQuery bug) - if (n.filter(jqexpr).size() == 1) - return n; - else - return n.parents(jqexpr).slice(0,1); -}; - -// String & array helpers - -WYMeditor.Helper = { - - //replace all instances of 'old' by 'rep' in 'str' string - replaceAll: function(str, old, rep) { - var rExp = new RegExp(old, "g"); - return(str.replace(rExp, rep)); - }, - - //insert 'inserted' at position 'pos' in 'str' string - insertAt: function(str, inserted, pos) { - return(str.substr(0,pos) + inserted + str.substring(pos)); - }, - - //trim 'str' string - trim: function(str) { - return str.replace(/^(\s*)|(\s*)$/gm,''); - }, - - //return true if 'arr' array contains 'elem', or false - contains: function(arr, elem) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] === elem) return true; - } - return false; - }, - - //return 'item' position in 'arr' array, or -1 - indexOf: function(arr, item) { - var ret=-1; - for(var i = 0; i < arr.length; i++) { - if (arr[i] == item) { - ret = i; - break; - } - } - return(ret); - }, - - //return 'item' object in 'arr' array, checking its 'name' property, or null - findByName: function(arr, name) { - for(var i = 0; i < arr.length; i++) { - var item = arr[i]; - if(item.name == name) return(item); - } - return(null); - } -}; - - diff --git a/websdk/static/js/wymeditor/jquery.wymeditor.min.js b/websdk/static/js/wymeditor/jquery.wymeditor.min.js deleted file mode 100644 index b57a18e..0000000 --- a/websdk/static/js/wymeditor/jquery.wymeditor.min.js +++ /dev/null @@ -1 +0,0 @@ -if(!WYMeditor){var WYMeditor={}}(function(){if(!window.console||!console.firebug){var b=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var a=0;a
    "+WYMeditor.TOOLS+"
    "+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
    "+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
    "+WYMeditor.LOGO+"
    ",logoHtml:"WYMeditor",iframeHtml:"
    ",editorStyles:[],toolsHtml:"

    {Tools}

      "+WYMeditor.TOOLS_ITEMS+"
    ",toolsItemHtml:"
  • "+WYMeditor.TOOL_TITLE+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"

    {Containers}

      "+WYMeditor.CONTAINERS_ITEMS+"
    ",containersItemHtml:"
  • "+WYMeditor.CONTAINER_TITLE+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"

    {Classes}

      "+WYMeditor.CLASSES_ITEMS+"
    ",classesItemHtml:"
  • "+WYMeditor.CLASS_TITLE+"
  • ",classesItems:[],statusHtml:"

    {Status}

    ",htmlHtml:"

    {Source_Code}

    ",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",relSelector:".wym_rel",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:"form",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:""+WYMeditor.DIALOG_TITLE+" - -Make sure to adjust the ``src`` attribute to your needs, then initialize the -plugin in WYMeditor's ``postInit`` function:: - - wymeditor({postInit: function(wym) { - wym.hovertools(); // other plugins... - wym.resizable({handles: "s,e", - maxHeight: 600}); - } - }) - -The ``resizable`` plugin takes exactly one parameter, which is an object literal -containing the options of the plugin. The WYMeditor ``resizable`` plugin -supports all options of the jQuery UI ``resizable`` plugin. These are the -default values used by the plugin:: - - handles: "s,e,se", - minHeight: 250, - maxHeight: 600 - -See the `jQuery UI resizable plugin docs`_ for a list of all options. - -That's it! You are now able to resize the WYMeditor vertically, horizontally or -both, depending on your options. - -.. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables - -Internals -========= -The plugin takes care of loading the necessary jQuery UI files (``base`` and -``resizable``) from the same path the jQuery library was loaded. Here's how -it's done:: - - // Get the jQuery path from the editor, stripping away the jQuery file. - // see http://www.oreilly.com/catalog/regex/chapter/ch04.html - // The match result array contains the path and the filename. - var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; - - // Make an array of the external JavaScript files required by the plugin. - var jQueryPlugins = [jQueryPath + '/ui.base.js', - jQueryPath + '/ui.resizable.js']; - - // First get the jQuery UI base file - $.getScript(jQueryPlugins[0]); - - // Get the jQuery UI resizeable plugin and then init the wymeditor resizable - // plugin. It is import to do the initialisation after loading the - // necessary jQuery UI files has finished, otherwise the "resizable" method - // would not be available. - $.getScript(jQueryPlugins[1], function() { - jQuery(wym._box).resizable(final_options); - }); - -An alternative approach would be to use an AJAX queue when getting the script -files to ensure that all jQuery files are loaded before the initialisation code -of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does -that. - -.. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue - -Changelog -========= - -0.2 ---- -- Added full support for all jQuery UI resizable plugin options. -- Refactored and documented code. -- Now contains a packed version (775 bytes). - -0.1 ---- -- Initial release. - -.. _WYMeditor: http://www.wymeditor.org/ -.. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins diff --git a/websdk/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js b/websdk/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js deleted file mode 100644 index 1ba2d2e..0000000 --- a/websdk/static/js/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.resizable.js - * resize plugin for WYMeditor - * - * File Authors: - * Peter Eschler (peschler _at_ gmail.com) - * Jean-Francois Hovinne - http://www.hovinne.com/ - * - * Version: - * 0.4 - * - * Changelog: - * - * 0.4 - * - Removed UI and UI.resizable scripts loading - see #167 (jfh). - * - * 0.3 - * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh). - * - * 0.2 - * - Added full support for all jQueryUI resizable plugin options. - * - Refactored and documented code. - * 0.1 - * - Initial release. - */ - -/** - * The resizable plugin makes the wymeditor box vertically resizable. - * It it based on the ui.resizable.js plugin of the jQuery UI library. - * - * The WYMeditor resizable plugin supports all parameters of the jQueryUI - * resizable plugin. The parameters are passed like this: - * - * wym.resizable({ handles: "s,e", - * maxHeight: 600 }); - * - * DEPENDENCIES: jQuery UI, jQuery UI resizable - * - * @param options options for the plugin - */ -WYMeditor.editor.prototype.resizable = function(options) { - - var wym = this; - var iframe = jQuery(wym._box).find('iframe'); - var iframeOriginalSize = {}; - - // Define some default options - var default_options = { - start: function(e, ui) { - iframeOriginalSize = { - width: jQuery(iframe).width(), - height: jQuery(iframe).height() - } - }, - - // resize is called by the jQuery resizable plugin whenever the - // client area was resized. - resize: function(e, ui) { - var diff = ui.size.height - ui.originalSize.height; - jQuery(iframe).height( iframeOriginalSize.height + diff ); - - // If the plugin has horizontal resizing disabled we need to - // adjust the "width" attribute of the area css, because the - // resizing will set a fixed width (which breaks liquid layout - // of the wymeditor area). - if( !ui.options.handles['w'] && !ui.options.handles['e'] ) { - ui.size.width = "inherit"; - } - }, - handles: "s,e,se", - minHeight: 250, - maxHeight: 600 - }; - - // Merge given options with default options. Given options override - // default ones. - var final_options = jQuery.extend(default_options, options); - - if(jQuery.isFunction( jQuery.fn.resizable )) jQuery(wym._box).resizable(final_options); - else WYMeditor.console.error('Oops, jQuery UI.resizable unavailable.'); - -}; diff --git a/websdk/static/js/wymeditor/plugins/resizable/readme.txt b/websdk/static/js/wymeditor/plugins/resizable/readme.txt deleted file mode 100644 index 2a0444e..0000000 --- a/websdk/static/js/wymeditor/plugins/resizable/readme.txt +++ /dev/null @@ -1,124 +0,0 @@ - - -resizable plugin for WYMeditor -############################## - -The ``resizable`` plugin for WYMeditor_ enables vertical resizing of the -editor area. The plugin is based on the jQuery UI library. - -Requirements -============ -The following packages are required for using the WYMeditor ``resizable`` -plugin: - -* jQuery (tested with jQuery ``jquery-1.2.4a.js`` from ``jquery.ui`` package) -* WYMeditor SVN trunk (Revision: 482) -* jQuery-UI (tested with ``jquery.ui-1.5b2``) - -It should be possible to use this plugin with ``WYMeditor-0.4`` but I have not -tried. - -Download -======== -You can download the WYMeditor ``resizable`` plugin here: - -* wymeditor-resizable-plugin-0.2.tgz_ -* wymeditor-resizable-plugin-0.1.tgz_ - -See the Changelog_ for more infos about the releases. - -.. _wymeditor-resizable-plugin-0.2.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.2.tgz -.. _wymeditor-resizable-plugin-0.1.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.1.tgz - -Installation -============ -Just extract the downloaded archive into your WYMeditor's ``plugin`` -directory. - -Usage -===== -For general instructions on WYMeditor plugins please refer to the `WYMeditor -plugin page`_. - -To use the ``resizable`` plugin simply include the plugin's JavaScript file in -your code. You **do not** need to include the jQuery UI files - this is done -automatically by the plugin (see `Internals`_):: - - - -Make sure to adjust the ``src`` attribute to your needs, then initialize the -plugin in WYMeditor's ``postInit`` function:: - - wymeditor({postInit: function(wym) { - wym.hovertools(); // other plugins... - wym.resizable({handles: "s,e", - maxHeight: 600}); - } - }) - -The ``resizable`` plugin takes exactly one parameter, which is an object literal -containing the options of the plugin. The WYMeditor ``resizable`` plugin -supports all options of the jQuery UI ``resizable`` plugin. These are the -default values used by the plugin:: - - handles: "s,e,se", - minHeight: 250, - maxHeight: 600 - -See the `jQuery UI resizable plugin docs`_ for a list of all options. - -That's it! You are now able to resize the WYMeditor vertically, horizontally or -both, depending on your options. - -.. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables - -Internals -========= -The plugin takes care of loading the necessary jQuery UI files (``base`` and -``resizable``) from the same path the jQuery library was loaded. Here's how -it's done:: - - // Get the jQuery path from the editor, stripping away the jQuery file. - // see http://www.oreilly.com/catalog/regex/chapter/ch04.html - // The match result array contains the path and the filename. - var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; - - // Make an array of the external JavaScript files required by the plugin. - var jQueryPlugins = [jQueryPath + '/ui.base.js', - jQueryPath + '/ui.resizable.js']; - - // First get the jQuery UI base file - $.getScript(jQueryPlugins[0]); - - // Get the jQuery UI resizeable plugin and then init the wymeditor resizable - // plugin. It is import to do the initialisation after loading the - // necessary jQuery UI files has finished, otherwise the "resizable" method - // would not be available. - $.getScript(jQueryPlugins[1], function() { - jQuery(wym._box).resizable(final_options); - }); - -An alternative approach would be to use an AJAX queue when getting the script -files to ensure that all jQuery files are loaded before the initialisation code -of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does -that. - -.. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue - -Changelog -========= - -0.2 ---- -- Added full support for all jQuery UI resizable plugin options. -- Refactored and documented code. -- Now contains a packed version (775 bytes). - -0.1 ---- -- Initial release. - -.. _WYMeditor: http://www.wymeditor.org/ -.. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins diff --git a/websdk/static/js/wymeditor/plugins/tidy/.svn/entries b/websdk/static/js/wymeditor/plugins/tidy/.svn/entries deleted file mode 100644 index 3acea50..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/.svn/entries +++ /dev/null @@ -1,164 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/plugins/tidy -svn://svn.wymeditor.org/wymeditor - - - -2010-04-11T19:34:57.530630Z -658 -mr_lundis - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -tidy.php -file - - - - -2011-07-13T16:45:39.000000Z -3355fbc23378052db8213dbdcd4fe31f -2007-04-26T12:45:23.848206Z -245 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -1052 - -jquery.wymeditor.tidy.js -file - - - - -2011-07-13T16:45:39.000000Z -3a2dee9a16df26d6d1b36886f77880c8 -2010-04-11T19:34:57.530630Z -658 -mr_lundis - - - - - - - - - - - - - - - - - - - - - -2157 - -wand.png -file - - - - -2011-07-13T16:45:39.000000Z -22d8038ebf5ac63b0062ebf361e8261c -2007-04-23T11:42:06.279227Z -233 -d.reszka -has-props - - - - - - - - - - - - - - - - - - - - -715 - -README -file - - - - -2011-07-13T16:45:39.000000Z -b31aaf6b3928608a98b2028c2d9f523e -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -607 - diff --git a/websdk/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base b/websdk/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/.svn/prop-base/wand.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base b/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base deleted file mode 100644 index acc7ffd..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/README.svn-base +++ /dev/null @@ -1,19 +0,0 @@ -WYMeditor : what you see is What You Mean web-based editor -Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ -Dual licensed under the MIT (MIT-license.txt) -and GPL (GPL-license.txt) licenses. - -For further information visit: - http://www.wymeditor.org/ - -File Name: - README - HTML Tidy plugin for WYMeditor - -File Authors: - Jean-François Hovinne (jf.hovinne a-t wymeditor dotorg) - -Credits: - 'HTML Tidy' by Dave Ragget - http://tidy.sourceforge.net/ - Icon 'wand' by Mark James - http://famfamfam.com/ - -WYMeditor documentation is available online at http://www.wymeditor.org/ diff --git a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base b/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base deleted file mode 100644 index bf30c4c..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/jquery.wymeditor.tidy.js.svn-base +++ /dev/null @@ -1,82 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.tidy.js - * HTML Tidy plugin for WYMeditor - * - * File Authors: - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) - */ - -//Extend WYMeditor -WYMeditor.editor.prototype.tidy = function(options) { - var tidy = new WymTidy(options, this); - return(tidy); -}; - -//WymTidy constructor -function WymTidy(options, wym) { - - options = jQuery.extend({ - - sUrl: wym._options.basePath + "plugins/tidy/tidy.php", - sButtonHtml: "
  • " - + "" - + "Clean up HTML" - + "
  • ", - - sButtonSelector: "li.wym_tools_tidy a" - - }, options); - - this._options = options; - this._wym = wym; - -}; - -//WymTidy initialization -WymTidy.prototype.init = function() { - - var tidy = this; - - jQuery(this._wym._box).find( - this._wym._options.toolsSelector + this._wym._options.toolsListSelector) - .append(this._options.sButtonHtml); - - //handle click event - jQuery(this._wym._box).find(this._options.sButtonSelector).click(function() { - tidy.cleanup(); - return(false); - }); - -}; - -//WymTidy cleanup -WymTidy.prototype.cleanup = function() { - - var wym = this._wym; - var html = "" + wym.xhtml() + ""; - - jQuery.post(this._options.sUrl, { html: html}, function(data) { - - if(data.length > 0 && data != '0') { - if(data.indexOf(" 0) { - - // Specify configuration - $config = array( - 'bare' => true, - 'clean' => true, - 'doctype' => 'strict', - 'drop-empty-paras' => true, - 'drop-font-tags' => true, - 'drop-proprietary-attributes' => true, - 'enclose-block-text' => true, - 'indent' => false, - 'join-classes' => true, - 'join-styles' => true, - 'logical-emphasis' => true, - 'output-xhtml' => true, - 'show-body-only' => true, - 'wrap' => 0); - - // Tidy - $tidy = new tidy; - $tidy->parseString($html, $config, 'utf8'); - $tidy->cleanRepair(); - - // Output - echo $tidy; -} else { - -echo ('0'); -} -?> diff --git a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base b/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base deleted file mode 100644 index bb55eea..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/.svn/text-base/wand.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/plugins/tidy/README b/websdk/static/js/wymeditor/plugins/tidy/README deleted file mode 100644 index acc7ffd..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/README +++ /dev/null @@ -1,19 +0,0 @@ -WYMeditor : what you see is What You Mean web-based editor -Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ -Dual licensed under the MIT (MIT-license.txt) -and GPL (GPL-license.txt) licenses. - -For further information visit: - http://www.wymeditor.org/ - -File Name: - README - HTML Tidy plugin for WYMeditor - -File Authors: - Jean-François Hovinne (jf.hovinne a-t wymeditor dotorg) - -Credits: - 'HTML Tidy' by Dave Ragget - http://tidy.sourceforge.net/ - Icon 'wand' by Mark James - http://famfamfam.com/ - -WYMeditor documentation is available online at http://www.wymeditor.org/ diff --git a/websdk/static/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js b/websdk/static/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js deleted file mode 100644 index bf30c4c..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.tidy.js - * HTML Tidy plugin for WYMeditor - * - * File Authors: - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) - */ - -//Extend WYMeditor -WYMeditor.editor.prototype.tidy = function(options) { - var tidy = new WymTidy(options, this); - return(tidy); -}; - -//WymTidy constructor -function WymTidy(options, wym) { - - options = jQuery.extend({ - - sUrl: wym._options.basePath + "plugins/tidy/tidy.php", - sButtonHtml: "
  • " - + "" - + "Clean up HTML" - + "
  • ", - - sButtonSelector: "li.wym_tools_tidy a" - - }, options); - - this._options = options; - this._wym = wym; - -}; - -//WymTidy initialization -WymTidy.prototype.init = function() { - - var tidy = this; - - jQuery(this._wym._box).find( - this._wym._options.toolsSelector + this._wym._options.toolsListSelector) - .append(this._options.sButtonHtml); - - //handle click event - jQuery(this._wym._box).find(this._options.sButtonSelector).click(function() { - tidy.cleanup(); - return(false); - }); - -}; - -//WymTidy cleanup -WymTidy.prototype.cleanup = function() { - - var wym = this._wym; - var html = "" + wym.xhtml() + ""; - - jQuery.post(this._options.sUrl, { html: html}, function(data) { - - if(data.length > 0 && data != '0') { - if(data.indexOf(" 0) { - - // Specify configuration - $config = array( - 'bare' => true, - 'clean' => true, - 'doctype' => 'strict', - 'drop-empty-paras' => true, - 'drop-font-tags' => true, - 'drop-proprietary-attributes' => true, - 'enclose-block-text' => true, - 'indent' => false, - 'join-classes' => true, - 'join-styles' => true, - 'logical-emphasis' => true, - 'output-xhtml' => true, - 'show-body-only' => true, - 'wrap' => 0); - - // Tidy - $tidy = new tidy; - $tidy->parseString($html, $config, 'utf8'); - $tidy->cleanRepair(); - - // Output - echo $tidy; -} else { - -echo ('0'); -} -?> diff --git a/websdk/static/js/wymeditor/plugins/tidy/wand.png b/websdk/static/js/wymeditor/plugins/tidy/wand.png deleted file mode 100644 index bb55eea..0000000 --- a/websdk/static/js/wymeditor/plugins/tidy/wand.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/.svn/entries b/websdk/static/js/wymeditor/skins/.svn/entries deleted file mode 100644 index 81655ae..0000000 --- a/websdk/static/js/wymeditor/skins/.svn/entries +++ /dev/null @@ -1,77 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins -svn://svn.wymeditor.org/wymeditor - - - -2010-06-20T14:29:05.352766Z -675 -mr_lundis - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -default -dir - -silver -dir - -compact -dir - -minimal -dir - -twopanels -dir - -wymeditor_icon.png -file - - - - -2011-07-13T16:45:40.000000Z -d43650efc0228099352fc9998573dbb6 -2007-08-22T15:06:37.289602Z -413 -d.reszka -has-props - - - - - - - - - - - - - - - - - - - - -1028 - diff --git a/websdk/static/js/wymeditor/skins/.svn/prop-base/wymeditor_icon.png.svn-base b/websdk/static/js/wymeditor/skins/.svn/prop-base/wymeditor_icon.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/.svn/prop-base/wymeditor_icon.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/.svn/text-base/wymeditor_icon.png.svn-base b/websdk/static/js/wymeditor/skins/.svn/text-base/wymeditor_icon.png.svn-base deleted file mode 100644 index d4fc155..0000000 --- a/websdk/static/js/wymeditor/skins/.svn/text-base/wymeditor_icon.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/compact/.svn/entries b/websdk/static/js/wymeditor/skins/compact/.svn/entries deleted file mode 100644 index 4218693..0000000 --- a/websdk/static/js/wymeditor/skins/compact/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/compact -svn://svn.wymeditor.org/wymeditor - - - -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -skin.js -file - - - - -2011-07-13T16:45:40.000000Z -eb8726f426d41a0cb87a3a6831cf2848 -2009-04-20T15:16:38.336253Z -595 -totoro - - - - - - - - - - - - - - - - - - - - - -1155 - -skin.css -file - - - - -2011-07-13T16:45:40.000000Z -85d1cb084ccc301c9306974311a86df7 -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -7937 - -icons.png -file - - - - -2011-07-13T16:45:40.000000Z -45a781288dc799f892fa517355ff80b6 -2009-04-18T11:14:41.598474Z -592 -totoro -has-props - - - - - - - - - - - - - - - - - - - - -3651 - diff --git a/websdk/static/js/wymeditor/skins/compact/.svn/prop-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/compact/.svn/prop-base/icons.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/compact/.svn/prop-base/icons.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/compact/.svn/text-base/icons.png.svn-base deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/icons.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.css.svn-base b/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.css.svn-base deleted file mode 100644 index 4a6a0c6..0000000 --- a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.css.svn-base +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_compact p, .wym_skin_compact h2, .wym_skin_compact h3, - .wym_skin_compact ul, .wym_skin_compact li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_compact .wym_area_left { display: none; } - .wym_skin_compact .wym_area_right { display: none; } - - -/*TYPO*/ - .wym_skin_compact { font-size: 10px; font-family: Verdana, Arial, sans-serif; } - .wym_skin_compact h2 { font-size: 110%; /* = 11px */} - .wym_skin_compact h3 { font-size: 100%; /* = 10px */} - .wym_skin_compact li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_compact { border: 1px solid gray; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_compact:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_compact .wym_html { width: 98%;} - .wym_skin_compact .wym_html textarea { font-size: 120%; width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_compact .wym_iframe { width: 98%;} - .wym_skin_compact .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_compact .wym_area_left { width: 100px; float: left;} - .wym_skin_compact .wym_area_right { width: 150px; float: right;} - .wym_skin_compact .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_compact .wym_area_main { height: 1%;} - * html .wym_skin_compact .wym_area_top { height: 1%;} - *+html .wym_skin_compact .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_compact .wym_section { margin-bottom: 5px; } - .wym_skin_compact .wym_section h2, - .wym_skin_compact .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_compact .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_compact .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_compact .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_compact .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_compact .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_compact .wym_panel { } - .wym_skin_compact .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_compact .wym_dropdown h2 { display: block; } - .wym_skin_compact .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_compact .wym_dropdown:hover ul, - .wym_skin_compact .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_compact .wym_buttons li { float:left;} - .wym_skin_compact .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_compact .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_compact .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_compact .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_compact .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_compact .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_compact .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_compact .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_compact .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_compact .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_compact .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_compact .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_compact .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_compact .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_compact .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_compact .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_compact .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_compact .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_compact .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_compact .wym_section h2 { background: #f0f0f0; border: solid gray; border-width: 0 0 1px;} - .wym_skin_compact .wym_section h2 span { color: gray;} - .wym_skin_compact .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_compact .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_compact .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_compact .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.js.svn-base b/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.js.svn-base deleted file mode 100644 index cfb7cc1..0000000 --- a/websdk/static/js/wymeditor/skins/compact/.svn/text-base/skin.js.svn-base +++ /dev/null @@ -1,35 +0,0 @@ -WYMeditor.SKINS['compact'] = { - - init: function(wym) { - - //move the containers panel to the top area - jQuery(wym._options.containersSelector + ', ' - + wym._options.classesSelector, wym._box) - .appendTo( jQuery("div.wym_area_top", wym._box) ) - .addClass("wym_dropdown") - .css({"margin-right": "10px", "width": "120px", "float": "left"}); - - //render following sections as buttons - jQuery(wym._options.toolsSelector, wym._box) - .addClass("wym_buttons") - .css({"margin-right": "10px", "float": "left"}); - - //make hover work under IE < 7 - jQuery(".wym_section", wym._box).hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - - var postInit = wym._options.postInit; - wym._options.postInit = function(wym) { - - if(postInit) postInit.call(wym, wym); - var rule = { - name: 'body', - css: 'background-color: #f0f0f0;' - }; - wym.addCssRule( wym._doc.styleSheets[0], rule); - }; - } -}; diff --git a/websdk/static/js/wymeditor/skins/compact/icons.png b/websdk/static/js/wymeditor/skins/compact/icons.png deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/compact/icons.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/compact/skin.css b/websdk/static/js/wymeditor/skins/compact/skin.css deleted file mode 100644 index 4a6a0c6..0000000 --- a/websdk/static/js/wymeditor/skins/compact/skin.css +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_compact p, .wym_skin_compact h2, .wym_skin_compact h3, - .wym_skin_compact ul, .wym_skin_compact li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_compact .wym_area_left { display: none; } - .wym_skin_compact .wym_area_right { display: none; } - - -/*TYPO*/ - .wym_skin_compact { font-size: 10px; font-family: Verdana, Arial, sans-serif; } - .wym_skin_compact h2 { font-size: 110%; /* = 11px */} - .wym_skin_compact h3 { font-size: 100%; /* = 10px */} - .wym_skin_compact li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_compact { border: 1px solid gray; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_compact:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_compact .wym_html { width: 98%;} - .wym_skin_compact .wym_html textarea { font-size: 120%; width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_compact .wym_iframe { width: 98%;} - .wym_skin_compact .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_compact .wym_area_left { width: 100px; float: left;} - .wym_skin_compact .wym_area_right { width: 150px; float: right;} - .wym_skin_compact .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_compact .wym_area_main { height: 1%;} - * html .wym_skin_compact .wym_area_top { height: 1%;} - *+html .wym_skin_compact .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_compact .wym_section { margin-bottom: 5px; } - .wym_skin_compact .wym_section h2, - .wym_skin_compact .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_compact .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_compact .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_compact .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_compact .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_compact .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_compact .wym_panel { } - .wym_skin_compact .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_compact .wym_dropdown h2 { display: block; } - .wym_skin_compact .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_compact .wym_dropdown:hover ul, - .wym_skin_compact .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_compact .wym_buttons li { float:left;} - .wym_skin_compact .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_compact .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_compact .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_compact .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_compact .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_compact .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_compact .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_compact .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_compact .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_compact .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_compact .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_compact .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_compact .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_compact .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_compact .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_compact .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_compact .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_compact .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_compact .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_compact .wym_section h2 { background: #f0f0f0; border: solid gray; border-width: 0 0 1px;} - .wym_skin_compact .wym_section h2 span { color: gray;} - .wym_skin_compact .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_compact .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_compact .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_compact .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/compact/skin.js b/websdk/static/js/wymeditor/skins/compact/skin.js deleted file mode 100644 index cfb7cc1..0000000 --- a/websdk/static/js/wymeditor/skins/compact/skin.js +++ /dev/null @@ -1,35 +0,0 @@ -WYMeditor.SKINS['compact'] = { - - init: function(wym) { - - //move the containers panel to the top area - jQuery(wym._options.containersSelector + ', ' - + wym._options.classesSelector, wym._box) - .appendTo( jQuery("div.wym_area_top", wym._box) ) - .addClass("wym_dropdown") - .css({"margin-right": "10px", "width": "120px", "float": "left"}); - - //render following sections as buttons - jQuery(wym._options.toolsSelector, wym._box) - .addClass("wym_buttons") - .css({"margin-right": "10px", "float": "left"}); - - //make hover work under IE < 7 - jQuery(".wym_section", wym._box).hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - - var postInit = wym._options.postInit; - wym._options.postInit = function(wym) { - - if(postInit) postInit.call(wym, wym); - var rule = { - name: 'body', - css: 'background-color: #f0f0f0;' - }; - wym.addCssRule( wym._doc.styleSheets[0], rule); - }; - } -}; diff --git a/websdk/static/js/wymeditor/skins/default/.svn/entries b/websdk/static/js/wymeditor/skins/default/.svn/entries deleted file mode 100644 index 3893f6d..0000000 --- a/websdk/static/js/wymeditor/skins/default/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/default -svn://svn.wymeditor.org/wymeditor - - - -2010-06-20T14:29:05.352766Z -675 -mr_lundis - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -skin.js -file - - - - -2011-07-13T16:45:39.000000Z -cbb79789e5a95dc8cbdcff294dd67ea0 -2010-06-20T14:29:05.352766Z -675 -mr_lundis - - - - - - - - - - - - - - - - - - - - - -1386 - -skin.css -file - - - - -2011-07-13T16:45:39.000000Z -c8b6d612f048cbf5c1b8a54f816dc5db -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -7890 - -icons.png -file - - - - -2011-07-13T16:45:39.000000Z -45a781288dc799f892fa517355ff80b6 -2007-03-06T13:53:36.153298Z -149 -d.reszka -has-props - - - - - - - - - - - - - - - - - - - - -3651 - diff --git a/websdk/static/js/wymeditor/skins/default/.svn/prop-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/default/.svn/prop-base/icons.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/default/.svn/prop-base/icons.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/default/.svn/text-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/default/.svn/text-base/icons.png.svn-base deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/default/.svn/text-base/icons.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.css.svn-base b/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.css.svn-base deleted file mode 100644 index eb4680f..0000000 --- a/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.css.svn-base +++ /dev/null @@ -1,133 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_default p, .wym_skin_default h2, .wym_skin_default h3, - .wym_skin_default ul, .wym_skin_default li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_default .wym_area_left { display: none; } - .wym_skin_default .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_default { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_default h2 { font-size: 110%; /* = 11px */} - .wym_skin_default h3 { font-size: 100%; /* = 10px */} - .wym_skin_default li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_default { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_default:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_default .wym_html { width: 98%;} - .wym_skin_default .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_default .wym_iframe { width: 98%;} - .wym_skin_default .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_default .wym_area_left { width: 150px; float: left;} - .wym_skin_default .wym_area_right { width: 150px; float: right;} - .wym_skin_default .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_default .wym_area_main { height: 1%;} - * html .wym_skin_default .wym_area_top { height: 1%;} - *+html .wym_skin_default .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_default .wym_section { margin-bottom: 5px; } - .wym_skin_default .wym_section h2, - .wym_skin_default .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_default .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_default .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_default .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_default .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_default .wym_panel { } - .wym_skin_default .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_default .wym_dropdown h2 { display: block; } - .wym_skin_default .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_default .wym_dropdown:hover ul, - .wym_skin_default .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_default .wym_buttons li { float:left;} - .wym_skin_default .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_default .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_default .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_default .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_default .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_default .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_default .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_default .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_default .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_default .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_default .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_default .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_default .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_default .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_default .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_default .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_default .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_default .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_default .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_default .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_default .wym_section h2 span { color: gray;} - .wym_skin_default .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_default .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_default .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_default .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.js.svn-base b/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.js.svn-base deleted file mode 100644 index 5f6d97e..0000000 --- a/websdk/static/js/wymeditor/skins/default/.svn/text-base/skin.js.svn-base +++ /dev/null @@ -1,40 +0,0 @@ -WYMeditor.SKINS['default'] = { - - init: function(wym) { - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .find(WYMeditor.H2) - .append(" >"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/default/icons.png b/websdk/static/js/wymeditor/skins/default/icons.png deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/default/icons.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/default/skin.css b/websdk/static/js/wymeditor/skins/default/skin.css deleted file mode 100644 index eb4680f..0000000 --- a/websdk/static/js/wymeditor/skins/default/skin.css +++ /dev/null @@ -1,133 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_default p, .wym_skin_default h2, .wym_skin_default h3, - .wym_skin_default ul, .wym_skin_default li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_default .wym_area_left { display: none; } - .wym_skin_default .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_default { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_default h2 { font-size: 110%; /* = 11px */} - .wym_skin_default h3 { font-size: 100%; /* = 10px */} - .wym_skin_default li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_default { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_default:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_default .wym_html { width: 98%;} - .wym_skin_default .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_default .wym_iframe { width: 98%;} - .wym_skin_default .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_default .wym_area_left { width: 150px; float: left;} - .wym_skin_default .wym_area_right { width: 150px; float: right;} - .wym_skin_default .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_default .wym_area_main { height: 1%;} - * html .wym_skin_default .wym_area_top { height: 1%;} - *+html .wym_skin_default .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_default .wym_section { margin-bottom: 5px; } - .wym_skin_default .wym_section h2, - .wym_skin_default .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_default .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_default .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_default .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_default .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_default .wym_panel { } - .wym_skin_default .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_default .wym_dropdown h2 { display: block; } - .wym_skin_default .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_default .wym_dropdown:hover ul, - .wym_skin_default .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_default .wym_buttons li { float:left;} - .wym_skin_default .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_default .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_default .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_default .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_default .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_default .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_default .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_default .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_default .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_default .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_default .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_default .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_default .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_default .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_default .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_default .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_default .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_default .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_default .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_default .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_default .wym_section h2 span { color: gray;} - .wym_skin_default .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_default .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_default .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_default .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/default/skin.js b/websdk/static/js/wymeditor/skins/default/skin.js deleted file mode 100644 index 5f6d97e..0000000 --- a/websdk/static/js/wymeditor/skins/default/skin.js +++ /dev/null @@ -1,40 +0,0 @@ -WYMeditor.SKINS['default'] = { - - init: function(wym) { - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .find(WYMeditor.H2) - .append(" >"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/minimal/.svn/entries b/websdk/static/js/wymeditor/skins/minimal/.svn/entries deleted file mode 100644 index fb50d46..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/.svn/entries +++ /dev/null @@ -1,99 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/minimal -svn://svn.wymeditor.org/wymeditor - - - -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -skin.js -file - - - - -2011-07-13T16:45:40.000000Z -4f493f73bfb815d0dfff9c39d15a14e8 -2008-06-02T20:02:11.870601Z -505 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -868 - -images -dir - -skin.css -file - - - - -2011-07-13T16:45:40.000000Z -b24eafed148e80826464943a977ba2ad -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -2743 - diff --git a/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.css.svn-base b/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.css.svn-base deleted file mode 100644 index cea8d84..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.css.svn-base +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the minimal WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Jean-Francois Hovinne - * Scott Lewis (see Silver skin) -*/ - -/* Set iframe */ -.wym_skin_minimal div.wym_iframe iframe { - width: 90%; - height: 200px; -} - -/* Hide h2 by default */ -.wym_skin_minimal h2 { - display: none; -} - -/* Show specific h2 */ -.wym_skin_minimal div.wym_tools h2, -.wym_skin_minimal div.wym_containers h2, -.wym_skin_minimal div.wym_classes h2 { - display: block; -} - -.wym_skin_minimal div.wym_section ul { - margin: 0; -} - -.wym_skin_minimal div.wym_section ul li { - float: left; - list-style-type: none; - margin-right: 5px; -} - -.wym_skin_minimal div.wym_area_top, -.wym_skin_minimal div.wym_area_right, -.wym_skin_minimal div.wym_containers, -.wym_skin_minimal div.wym_classes { - float: left; -} - -.wym_skin_minimal div.wym_area_main { - clear: both; -} - -.wym_skin_minimal div.wym_html { - width: 90%; -} - -.wym_skin_minimal textarea.wym_html_val { - width: 100%; - height: 100px; -} - -/* DROPDOWNS (see Silver skin) */ -.wym_skin_minimal div.wym_dropdown { - cursor: pointer; - margin: 0px 4px 10px 0px; - padding: 0px; - z-index: 1001; - display: block; -} - -.wym_skin_minimal div.wym_dropdown ul { - display: none; - width: 124px; - padding: 0px; - margin: 0px; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -.wym_skin_minimal div.wym_dropdown ul li { - width: 146px; - height: 20px; - padding: 0px; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #EEE; - list-style-image: none; -} - -.wym_skin_minimal div.wym_dropdown h2 { - width: 138px; - height: 16px; - color: #000; - background-image: url(images/bg.selector.silver.gif); - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - font-weight: bold; - padding: 2px 0px 0px 10px; - margin: 0px; -} - -.wym_skin_minimal div.wym_dropdown a { - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left; - margin-left: 0px; -} - -.wym_skin_minimal div.wym_dropdown a:hover { - background: #BBB; - border-bottom: none; -} diff --git a/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.js.svn-base b/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.js.svn-base deleted file mode 100644 index af29ed4..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/.svn/text-base/skin.js.svn-base +++ /dev/null @@ -1,30 +0,0 @@ -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS['minimal'] = { - //placeholder for the skin JS, if needed - - //init the skin - //wym is the WYMeditor.editor instance - init: function(wym) { - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.toolsSelector + ', ' + wym._options.containersSelector + ', ' + wym._options.classesSelector) - .addClass("wym_dropdown") - .selectify(); - - - } -}; diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/entries b/websdk/static/js/wymeditor/skins/minimal/images/.svn/entries deleted file mode 100644 index ff30362..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/entries +++ /dev/null @@ -1,164 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/minimal/images -svn://svn.wymeditor.org/wymeditor - - - -2008-06-02T20:02:11.870601Z -505 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -icons.silver.gif -file - - - - -2011-07-13T16:45:40.000000Z -3d55143203f242061d02ed4387e3c498 -2008-06-02T20:02:11.870601Z -505 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -15382 - -bg.header.gif -file - - - - -2011-07-13T16:45:40.000000Z -4871b677b0af34f02d3a51046dd51f20 -2008-06-02T20:02:11.870601Z -505 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -781 - -bg.wymeditor.png -file - - - - -2011-07-13T16:45:40.000000Z -dae577218f4bdd6f59197e3d8c8c9ea6 -2008-06-02T20:02:11.870601Z -505 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -498 - -bg.selector.silver.gif -file - - - - -2011-07-13T16:45:40.000000Z -1101554f412121db5ad6157f366515e3 -2008-06-02T20:02:11.870601Z -505 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -1621 - diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.header.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.header.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.header.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.selector.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.selector.silver.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.selector.silver.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.wymeditor.png.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.wymeditor.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/bg.wymeditor.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/icons.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/icons.silver.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/prop-base/icons.silver.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.header.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.header.gif.svn-base deleted file mode 100644 index b2d2907..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.header.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.selector.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.selector.silver.gif.svn-base deleted file mode 100644 index e65976b..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.selector.silver.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.wymeditor.png.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.wymeditor.png.svn-base deleted file mode 100644 index 1e84813..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/bg.wymeditor.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/icons.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/icons.silver.gif.svn-base deleted file mode 100644 index 8c6a4fb..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/.svn/text-base/icons.silver.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/bg.header.gif b/websdk/static/js/wymeditor/skins/minimal/images/bg.header.gif deleted file mode 100644 index b2d2907..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/bg.header.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/bg.selector.silver.gif b/websdk/static/js/wymeditor/skins/minimal/images/bg.selector.silver.gif deleted file mode 100644 index e65976b..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/bg.selector.silver.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/bg.wymeditor.png b/websdk/static/js/wymeditor/skins/minimal/images/bg.wymeditor.png deleted file mode 100644 index 1e84813..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/bg.wymeditor.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/images/icons.silver.gif b/websdk/static/js/wymeditor/skins/minimal/images/icons.silver.gif deleted file mode 100644 index 8c6a4fb..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/images/icons.silver.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/minimal/skin.css b/websdk/static/js/wymeditor/skins/minimal/skin.css deleted file mode 100644 index cea8d84..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/skin.css +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the minimal WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Jean-Francois Hovinne - * Scott Lewis (see Silver skin) -*/ - -/* Set iframe */ -.wym_skin_minimal div.wym_iframe iframe { - width: 90%; - height: 200px; -} - -/* Hide h2 by default */ -.wym_skin_minimal h2 { - display: none; -} - -/* Show specific h2 */ -.wym_skin_minimal div.wym_tools h2, -.wym_skin_minimal div.wym_containers h2, -.wym_skin_minimal div.wym_classes h2 { - display: block; -} - -.wym_skin_minimal div.wym_section ul { - margin: 0; -} - -.wym_skin_minimal div.wym_section ul li { - float: left; - list-style-type: none; - margin-right: 5px; -} - -.wym_skin_minimal div.wym_area_top, -.wym_skin_minimal div.wym_area_right, -.wym_skin_minimal div.wym_containers, -.wym_skin_minimal div.wym_classes { - float: left; -} - -.wym_skin_minimal div.wym_area_main { - clear: both; -} - -.wym_skin_minimal div.wym_html { - width: 90%; -} - -.wym_skin_minimal textarea.wym_html_val { - width: 100%; - height: 100px; -} - -/* DROPDOWNS (see Silver skin) */ -.wym_skin_minimal div.wym_dropdown { - cursor: pointer; - margin: 0px 4px 10px 0px; - padding: 0px; - z-index: 1001; - display: block; -} - -.wym_skin_minimal div.wym_dropdown ul { - display: none; - width: 124px; - padding: 0px; - margin: 0px; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -.wym_skin_minimal div.wym_dropdown ul li { - width: 146px; - height: 20px; - padding: 0px; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #EEE; - list-style-image: none; -} - -.wym_skin_minimal div.wym_dropdown h2 { - width: 138px; - height: 16px; - color: #000; - background-image: url(images/bg.selector.silver.gif); - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - font-weight: bold; - padding: 2px 0px 0px 10px; - margin: 0px; -} - -.wym_skin_minimal div.wym_dropdown a { - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left; - margin-left: 0px; -} - -.wym_skin_minimal div.wym_dropdown a:hover { - background: #BBB; - border-bottom: none; -} diff --git a/websdk/static/js/wymeditor/skins/minimal/skin.js b/websdk/static/js/wymeditor/skins/minimal/skin.js deleted file mode 100644 index af29ed4..0000000 --- a/websdk/static/js/wymeditor/skins/minimal/skin.js +++ /dev/null @@ -1,30 +0,0 @@ -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS['minimal'] = { - //placeholder for the skin JS, if needed - - //init the skin - //wym is the WYMeditor.editor instance - init: function(wym) { - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.toolsSelector + ', ' + wym._options.containersSelector + ', ' + wym._options.classesSelector) - .addClass("wym_dropdown") - .selectify(); - - - } -}; diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/entries b/websdk/static/js/wymeditor/skins/silver/.svn/entries deleted file mode 100644 index 2969c6b..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/entries +++ /dev/null @@ -1,167 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/silver -svn://svn.wymeditor.org/wymeditor - - - -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -skin.js -file - - - - -2011-07-13T16:45:39.000000Z -7f55ea883250c072ce72cf60c2d77064 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -2024 - -images -dir - -COPYING -file - - - - -2011-07-13T16:45:39.000000Z -d32239bcb673463ab874e80d47fae504 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -35147 - -skin.css -file - - - - -2011-07-13T16:45:39.000000Z -4af1f9844350d87d34bfeeca2702ea0c -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -13023 - -README -file - - - - -2011-07-13T16:45:39.000000Z -649465d1c305caedb34adc02b8cc0ea8 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -725 - diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/COPYING.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/COPYING.svn-base deleted file mode 100644 index 869ac71..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/COPYING.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 14 -svn:executable -V 1 -* -END diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/README.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/README.svn-base deleted file mode 100644 index 869ac71..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/prop-base/README.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 14 -svn:executable -V 1 -* -END diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/COPYING.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/text-base/COPYING.svn-base deleted file mode 100644 index 94a9ed0..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/COPYING.svn-base +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/README.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/text-base/README.svn-base deleted file mode 100644 index 130dc46..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/README.svn-base +++ /dev/null @@ -1,27 +0,0 @@ -/** -* @version Alpha 0.1 2008-05-10 23:28:43 $ -* @package Silver skin for WYMeditor -* @copyright Copyright (C) 2008 Scott Edwin Lewis. All rights reserved. -* @license GNU/GPL, see COPYING -* Silver skin for WYMeditor is free software and is licensed under the -* GNU General Public License. See COPYING for copyright notices and details. -*/ - -Adds custom buttons and color palette to the WYMeditor XHTML Editor. - -INSTALLATION: - -1. Copy the entire /silver/ directory to /wymeditor/skins/ -2. Initialize the WYMeditor 'skin' option as below: - - - -That's it. You're done. diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.css.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.css.svn-base deleted file mode 100644 index 8284d81..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.css.svn-base +++ /dev/null @@ -1,297 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Scott Edwin Lewis -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_silver p, .wym_skin_silver h2, .wym_skin_silver h3, - .wym_skin_silver ul, .wym_skin_silver li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_silver .wym_area_left { display: none; } - .wym_skin_silver .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_silver { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_silver h2 { font-size: 110%; /* = 11px */} - .wym_skin_silver h3 { font-size: 100%; /* = 10px */} - .wym_skin_silver li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_silver { border: 1px solid gray; background: #f2f2f2; padding: 0px; margin: 0px;} - - /*auto-clear the wym_box*/ - .wym_skin_silver:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_silver { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_silver .wym_html { width: 98%;} - .wym_skin_silver .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_silver .wym_iframe { width: 98%;} - .wym_skin_silver .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_silver .wym_area_left { width: 150px; float: left;} - .wym_skin_silver .wym_area_right { width: 150px; float: right;} - .wym_skin_silver .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_silver .wym_area_main { height: 1%;} - * html .wym_skin_silver .wym_area_top { height: 1%;} - *+html .wym_skin_silver .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_silver .wym_section { margin-bottom: 5px; } - .wym_skin_silver .wym_section h2, - .wym_skin_silver .wym_section h3 { padding: 1px 3px; margin: 0; cursor: pointer; } - .wym_skin_silver .wym_section a { padding: 5px 0px 0px 10px; display: block; text-decoration: none; color: black; } - .wym_skin_silver .wym_section a:hover { /*background-color: #DDD;*/} - /*hide section titles by default*/ - .wym_skin_silver .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_silver .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_silver .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; padding: 0px; } - * html .wym_skin_silver .wym_section ul { height: 1%;} - .wym_skin_silver .wym_section li {} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_silver .wym_panel { } - .wym_skin_silver .wym_panel h2 { display: block; font-size: 11px; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_silver .wym_dropdown h2 { display: block; font-size: 11px;} - .wym_skin_silver .wym_dropdown ul { position: absolute; background: white; padding: 0px;} - .wym_skin_silver .wym_dropdown:hover ul, - .wym_skin_silver .wym_dropdown.hover ul { cursor: pointer;} - .wym_skin_silver .wym_dropdown ul li a {/*border-bottom: 1px solid #AAA;*/} - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_silver .wym_buttons li { float:left;} - .wym_skin_silver .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px; text-decoration: none !important; border: 1px solid #666; } - .wym_skin_silver .wym_buttons a:hover { text-decoration: none !important; border: 1px solid #000;} - /*image replacements*/ - .wym_skin_silver .wym_buttons li a { background: url(images/icons.silver.gif) no-repeat; text-indent: -9999px;} - .wym_skin_silver .wym_buttons li.wym_tools_strong a { background-position: 0 -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a { background-position: 0 -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a { background-position: 0 -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a { background-position: 0 -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a { background-position: 0 -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a { background-position: 0 -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a { background-position: 0 -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a { background-position: 0 -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a { background-position: 0 -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a { background-position: 0 -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a { background-position: 0 -576px;} - - .wym_skin_silver .wym_buttons li.wym_tools_strong a:hover { background-position: -24px -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a:hover { background-position: -24px -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a:hover { background-position: -24px -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a:hover { background-position: -24px -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a:hover { background-position: -24px -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a:hover{ background-position: -24px -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a:hover { background-position: -24px -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a:hover { background-position: -24px -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a:hover { background-position: -24px -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a:hover { background-position: -24px -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a:hover { background-position: -24px -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a:hover { background-position: -24px -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a:hover { background-position: -24px -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a:hover { background-position: -24px -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a:hover { background-position: -24px -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a:hover { background-position: -24px -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a:hover { background-position: -24px -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a:hover { background-position: -24px -576px;} - -/*DECORATION*/ - .wym_skin_silver .wym_section h2 { background: #ddd; border: none;} - .wym_skin_silver .wym_section h2 span { color: gray;} - .wym_skin_silver .wym_panel { padding: 0; border: solid gray; border-width: 0px;} - .wym_skin_silver .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_silver .wym_dropdown { padding: 0; border: none; } - .wym_skin_silver .wym_dropdown ul { border: none; margin-left: -1px; padding: 0px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link - { - text-indent: -9999px; - float: right; - display: block; - width: 50px; - height: 15px; - background: url(../wymeditor_icon.png); - background-position: 1px 1px; - background-repeat: no-repeat; - overflow: hidden; - text-decoration: none; - padding: 1px !important; - border: 1px solid #333 !important; - background-color: #FFF !important; - } - -.wym_box -{ - padding: 0px !important; - margin: 0px; -} -.wym_inner -{ - border-left: 1px solid #FFF; - border-top: 1px solid #FFF; - border-right: 1px solid #FFF; - border-bottom: 1px solid #FFF; - padding: 5px; - background-color: #B8C1C4; - height: auto; -} - -.clear {clear: both;} - -div.wym_dropdown -{ - cursor: pointer; - width: 138px !important; - margin: 0px 4px 10px 0px !important; - padding: 0px; - z-index: 1001; - display: block; - border: 1px solid red; -} - -div.wym_dropdown ul -{ - display: none; - width: 124px; - padding: 0px !important; - margin: 0px !important; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -div.wym_dropdown ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -div.wym_dropdown h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.selector.silver.gif) !important; - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.header.gif) !important; - background-position: 0px 0px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel ul -{ - margin-top: 0px !important; -} - -.wym_skin_silver .wym_panel ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -.wym_skin_silver .wym_panel a, -div.wym_dropdown a -{ - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px !important; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left !important; - margin-left: 0px !important; -} - -div.wym_dropdown a:hover, -.wym_skin_silver .wym_panel a:hover -{ - background: #BBB; - border-bottom: none !important; -} diff --git a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.js.svn-base b/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.js.svn-base deleted file mode 100644 index 948ed91..0000000 --- a/websdk/static/js/wymeditor/skins/silver/.svn/text-base/skin.js.svn-base +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the Silver skin for WYMeditor by Scott Edwin Lewis */ - -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS['silver'] = { - - init: function(wym) { - - //add some elements to improve the rendering - jQuery(wym._box) - .append('
    ') - .wrapInner('
    '); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .selectify(); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/silver/COPYING b/websdk/static/js/wymeditor/skins/silver/COPYING deleted file mode 100755 index 94a9ed0..0000000 --- a/websdk/static/js/wymeditor/skins/silver/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/websdk/static/js/wymeditor/skins/silver/README b/websdk/static/js/wymeditor/skins/silver/README deleted file mode 100755 index 130dc46..0000000 --- a/websdk/static/js/wymeditor/skins/silver/README +++ /dev/null @@ -1,27 +0,0 @@ -/** -* @version Alpha 0.1 2008-05-10 23:28:43 $ -* @package Silver skin for WYMeditor -* @copyright Copyright (C) 2008 Scott Edwin Lewis. All rights reserved. -* @license GNU/GPL, see COPYING -* Silver skin for WYMeditor is free software and is licensed under the -* GNU General Public License. See COPYING for copyright notices and details. -*/ - -Adds custom buttons and color palette to the WYMeditor XHTML Editor. - -INSTALLATION: - -1. Copy the entire /silver/ directory to /wymeditor/skins/ -2. Initialize the WYMeditor 'skin' option as below: - - - -That's it. You're done. diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/entries b/websdk/static/js/wymeditor/skins/silver/images/.svn/entries deleted file mode 100644 index d70fd13..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/entries +++ /dev/null @@ -1,164 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/silver/images -svn://svn.wymeditor.org/wymeditor - - - -2008-05-12T20:05:54.287558Z -494 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -icons.silver.gif -file - - - - -2011-07-13T16:45:39.000000Z -3d55143203f242061d02ed4387e3c498 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -15382 - -bg.header.gif -file - - - - -2011-07-13T16:45:39.000000Z -4871b677b0af34f02d3a51046dd51f20 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -781 - -bg.wymeditor.png -file - - - - -2011-07-13T16:45:39.000000Z -dae577218f4bdd6f59197e3d8c8c9ea6 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -498 - -bg.selector.silver.gif -file - - - - -2011-07-13T16:45:39.000000Z -1101554f412121db5ad6157f366515e3 -2008-05-12T20:05:54.287558Z -494 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -1621 - diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.header.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.header.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.header.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.selector.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.selector.silver.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.selector.silver.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.wymeditor.png.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.wymeditor.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/bg.wymeditor.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/icons.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/icons.silver.gif.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/prop-base/icons.silver.gif.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.header.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.header.gif.svn-base deleted file mode 100644 index b2d2907..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.header.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.selector.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.selector.silver.gif.svn-base deleted file mode 100644 index e65976b..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.selector.silver.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.wymeditor.png.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.wymeditor.png.svn-base deleted file mode 100644 index 1e84813..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/bg.wymeditor.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/icons.silver.gif.svn-base b/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/icons.silver.gif.svn-base deleted file mode 100644 index 8c6a4fb..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/.svn/text-base/icons.silver.gif.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/bg.header.gif b/websdk/static/js/wymeditor/skins/silver/images/bg.header.gif deleted file mode 100644 index b2d2907..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/bg.header.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/bg.selector.silver.gif b/websdk/static/js/wymeditor/skins/silver/images/bg.selector.silver.gif deleted file mode 100644 index e65976b..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/bg.selector.silver.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/bg.wymeditor.png b/websdk/static/js/wymeditor/skins/silver/images/bg.wymeditor.png deleted file mode 100644 index 1e84813..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/bg.wymeditor.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/images/icons.silver.gif b/websdk/static/js/wymeditor/skins/silver/images/icons.silver.gif deleted file mode 100644 index 8c6a4fb..0000000 --- a/websdk/static/js/wymeditor/skins/silver/images/icons.silver.gif +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/silver/skin.css b/websdk/static/js/wymeditor/skins/silver/skin.css deleted file mode 100644 index 56e3248..0000000 --- a/websdk/static/js/wymeditor/skins/silver/skin.css +++ /dev/null @@ -1,297 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Scott Edwin Lewis -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_silver p, .wym_skin_silver h2, .wym_skin_silver h3, - .wym_skin_silver ul, .wym_skin_silver li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_silver .wym_area_left { display: none; } - .wym_skin_silver .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_silver { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_silver h2 { font-size: 110%; /* = 11px */} - .wym_skin_silver h3 { font-size: 100%; /* = 10px */} - .wym_skin_silver li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_silver { border: 1px solid gray; background: #E8E8E8; padding: 0px; margin: 0px;} - - /*auto-clear the wym_box*/ - .wym_skin_silver:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_silver { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_silver .wym_html { width: 98%;} - .wym_skin_silver .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_silver .wym_iframe { width: 98%;} - .wym_skin_silver .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_silver .wym_area_left { width: 150px; float: left;} - .wym_skin_silver .wym_area_right { width: 150px; float: right;} - .wym_skin_silver .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_silver .wym_area_main { height: 1%;} - * html .wym_skin_silver .wym_area_top { height: 1%;} - *+html .wym_skin_silver .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_silver .wym_section { margin-bottom: 5px; } - .wym_skin_silver .wym_section h2, - .wym_skin_silver .wym_section h3 { padding: 1px 3px; margin: 0; cursor: pointer; } - .wym_skin_silver .wym_section a { padding: 5px 0px 0px 10px; display: block; text-decoration: none; color: black; } - .wym_skin_silver .wym_section a:hover { /*background-color: #DDD;*/} - /*hide section titles by default*/ - .wym_skin_silver .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_silver .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_silver .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; padding: 0px; } - * html .wym_skin_silver .wym_section ul { height: 1%;} - .wym_skin_silver .wym_section li {} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_silver .wym_panel { } - .wym_skin_silver .wym_panel h2 { display: block; font-size: 11px; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_silver .wym_dropdown h2 { display: block; font-size: 11px;} - .wym_skin_silver .wym_dropdown ul { position: absolute; background: white; padding: 0px;} - .wym_skin_silver .wym_dropdown:hover ul, - .wym_skin_silver .wym_dropdown.hover ul { cursor: pointer;} - .wym_skin_silver .wym_dropdown ul li a {/*border-bottom: 1px solid #AAA;*/} - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_silver .wym_buttons li { float:left;} - .wym_skin_silver .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px; text-decoration: none !important; border: 1px solid #666; } - .wym_skin_silver .wym_buttons a:hover { text-decoration: none !important; border: 1px solid #000;} - /*image replacements*/ - .wym_skin_silver .wym_buttons li a { background: url(images/icons.silver.gif) no-repeat; text-indent: -9999px;} - .wym_skin_silver .wym_buttons li.wym_tools_strong a { background-position: 0 -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a { background-position: 0 -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a { background-position: 0 -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a { background-position: 0 -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a { background-position: 0 -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a { background-position: 0 -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a { background-position: 0 -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a { background-position: 0 -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a { background-position: 0 -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a { background-position: 0 -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a { background-position: 0 -576px;} - - .wym_skin_silver .wym_buttons li.wym_tools_strong a:hover { background-position: -24px -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a:hover { background-position: -24px -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a:hover { background-position: -24px -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a:hover { background-position: -24px -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a:hover { background-position: -24px -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a:hover{ background-position: -24px -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a:hover { background-position: -24px -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a:hover { background-position: -24px -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a:hover { background-position: -24px -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a:hover { background-position: -24px -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a:hover { background-position: -24px -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a:hover { background-position: -24px -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a:hover { background-position: -24px -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a:hover { background-position: -24px -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a:hover { background-position: -24px -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a:hover { background-position: -24px -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a:hover { background-position: -24px -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a:hover { background-position: -24px -576px;} - -/*DECORATION*/ - .wym_skin_silver .wym_section h2 { background: #ddd; border: none;} - .wym_skin_silver .wym_section h2 span { color: gray;} - .wym_skin_silver .wym_panel { padding: 0; border: solid gray; border-width: 0px;} - .wym_skin_silver .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_silver .wym_dropdown { padding: 0; border: none; } - .wym_skin_silver .wym_dropdown ul { border: none; margin-left: -1px; padding: 0px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link - { - text-indent: -9999px; - float: right; - display: block; - width: 50px; - height: 15px; - background: url(../wymeditor_icon.png); - background-position: 1px 1px; - background-repeat: no-repeat; - overflow: hidden; - text-decoration: none; - padding: 1px !important; - border: 1px solid #333 !important; - background-color: #FFF !important; - } - -.wym_box -{ - padding: 0px !important; - margin: 0px; -} -.wym_inner -{ - border-left: 1px solid #FFF; - border-top: 1px solid #FFF; - border-right: 1px solid #FFF; - border-bottom: 1px solid #FFF; - padding: 5px; - background-color: #E8E8E8; - height: auto; -} - -.clear {clear: both;} - -div.wym_dropdown -{ - cursor: pointer; - width: 138px !important; - margin: 0px 4px 10px 0px !important; - padding: 0px; - z-index: 1001; - display: block; - border: 1px solid red; -} - -div.wym_dropdown ul -{ - display: none; - width: 124px; - padding: 0px !important; - margin: 0px !important; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -div.wym_dropdown ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -div.wym_dropdown h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.selector.silver.gif) !important; - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.header.gif) !important; - background-position: 0px 0px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel ul -{ - margin-top: 0px !important; -} - -.wym_skin_silver .wym_panel ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -.wym_skin_silver .wym_panel a, -div.wym_dropdown a -{ - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px !important; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left !important; - margin-left: 0px !important; -} - -div.wym_dropdown a:hover, -.wym_skin_silver .wym_panel a:hover -{ - background: #BBB; - border-bottom: none !important; -} diff --git a/websdk/static/js/wymeditor/skins/silver/skin.js b/websdk/static/js/wymeditor/skins/silver/skin.js deleted file mode 100644 index 948ed91..0000000 --- a/websdk/static/js/wymeditor/skins/silver/skin.js +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the Silver skin for WYMeditor by Scott Edwin Lewis */ - -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS['silver'] = { - - init: function(wym) { - - //add some elements to improve the rendering - jQuery(wym._box) - .append('
    ') - .wrapInner('
    '); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .selectify(); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/twopanels/.svn/entries b/websdk/static/js/wymeditor/skins/twopanels/.svn/entries deleted file mode 100644 index a477f85..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -10 - -dir -677 -svn://svn.wymeditor.org/wymeditor/trunk/src/wymeditor/skins/twopanels -svn://svn.wymeditor.org/wymeditor - - - -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - -89e89e35-0a13-0410-8f61-920bba073fa9 - -skin.js -file - - - - -2011-07-13T16:45:40.000000Z -d47d82f6cda558d258263f3949d815f1 -2008-05-30T19:59:08.978756Z -502 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -1380 - -skin.css -file - - - - -2011-07-13T16:45:40.000000Z -5da884f153705d38e473d5cf4bdc7deb -2009-05-27T19:20:55.910061Z -632 -jf.hovinne - - - - - - - - - - - - - - - - - - - - - -8045 - -icons.png -file - - - - -2011-07-13T16:45:40.000000Z -45a781288dc799f892fa517355ff80b6 -2008-05-30T19:59:08.978756Z -502 -jf.hovinne -has-props - - - - - - - - - - - - - - - - - - - - -3651 - diff --git a/websdk/static/js/wymeditor/skins/twopanels/.svn/prop-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/twopanels/.svn/prop-base/icons.png.svn-base deleted file mode 100644 index 5e9587e..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/.svn/prop-base/icons.png.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 24 -application/octet-stream -END diff --git a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/icons.png.svn-base b/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/icons.png.svn-base deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/icons.png.svn-base +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.css.svn-base b/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.css.svn-base deleted file mode 100644 index 7e6b8fd..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.css.svn-base +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_twopanels p, .wym_skin_twopanels h2, .wym_skin_twopanels h3, - .wym_skin_twopanels ul, .wym_skin_twopanels li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_twopanels .wym_area_left { display: block; } - .wym_skin_twopanels .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_twopanels { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_twopanels h2 { font-size: 110%; /* = 11px */} - .wym_skin_twopanels h3 { font-size: 100%; /* = 10px */} - .wym_skin_twopanels li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_twopanels { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_twopanels:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_twopanels .wym_html { width: 98%;} - .wym_skin_twopanels .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_twopanels .wym_iframe { width: 98%;} - .wym_skin_twopanels .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_twopanels .wym_area_left { width: 100px; float: left;} - .wym_skin_twopanels .wym_area_right { width: 150px; float: right;} - .wym_skin_twopanels .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_twopanels .wym_area_main { height: 1%;} - * html .wym_skin_twopanels .wym_area_top { height: 1%;} - *+html .wym_skin_twopanels .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_twopanels .wym_section { margin-bottom: 5px; } - .wym_skin_twopanels .wym_section h2, - .wym_skin_twopanels .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_twopanels .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_twopanels .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_twopanels .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_twopanels .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_twopanels .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_twopanels .wym_panel { } - .wym_skin_twopanels .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_twopanels .wym_dropdown h2 { display: block; } - .wym_skin_twopanels .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_twopanels .wym_dropdown:hover ul, - .wym_skin_twopanels .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_twopanels .wym_buttons li { float:left;} - .wym_skin_twopanels .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_twopanels .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_twopanels .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_twopanels .wym_section h2 span { color: gray;} - .wym_skin_twopanels .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_twopanels .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_twopanels .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_twopanels .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.js.svn-base b/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.js.svn-base deleted file mode 100644 index e82efc5..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/.svn/text-base/skin.js.svn-base +++ /dev/null @@ -1,39 +0,0 @@ -WYMeditor.SKINS['twopanels'] = { - - init: function(wym) { - - //move the containers panel to the left area - jQuery(wym._box).find(wym._options.containersSelector) - .appendTo("div.wym_area_left"); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector + ', ' - + wym._options.containersSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "115px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/twopanels/icons.png b/websdk/static/js/wymeditor/skins/twopanels/icons.png deleted file mode 100644 index c6eb463..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/icons.png +++ /dev/null Binary files differ diff --git a/websdk/static/js/wymeditor/skins/twopanels/skin.css b/websdk/static/js/wymeditor/skins/twopanels/skin.css deleted file mode 100644 index 7e6b8fd..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/skin.css +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_twopanels p, .wym_skin_twopanels h2, .wym_skin_twopanels h3, - .wym_skin_twopanels ul, .wym_skin_twopanels li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_twopanels .wym_area_left { display: block; } - .wym_skin_twopanels .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_twopanels { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_twopanels h2 { font-size: 110%; /* = 11px */} - .wym_skin_twopanels h3 { font-size: 100%; /* = 10px */} - .wym_skin_twopanels li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_twopanels { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_twopanels:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_twopanels .wym_html { width: 98%;} - .wym_skin_twopanels .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_twopanels .wym_iframe { width: 98%;} - .wym_skin_twopanels .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_twopanels .wym_area_left { width: 100px; float: left;} - .wym_skin_twopanels .wym_area_right { width: 150px; float: right;} - .wym_skin_twopanels .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_twopanels .wym_area_main { height: 1%;} - * html .wym_skin_twopanels .wym_area_top { height: 1%;} - *+html .wym_skin_twopanels .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_twopanels .wym_section { margin-bottom: 5px; } - .wym_skin_twopanels .wym_section h2, - .wym_skin_twopanels .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_twopanels .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_twopanels .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_twopanels .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_twopanels .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_twopanels .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_twopanels .wym_panel { } - .wym_skin_twopanels .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_twopanels .wym_dropdown h2 { display: block; } - .wym_skin_twopanels .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_twopanels .wym_dropdown:hover ul, - .wym_skin_twopanels .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_twopanels .wym_buttons li { float:left;} - .wym_skin_twopanels .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_twopanels .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_twopanels .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_twopanels .wym_section h2 span { color: gray;} - .wym_skin_twopanels .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_twopanels .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_twopanels .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_twopanels .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/websdk/static/js/wymeditor/skins/twopanels/skin.js b/websdk/static/js/wymeditor/skins/twopanels/skin.js deleted file mode 100644 index e82efc5..0000000 --- a/websdk/static/js/wymeditor/skins/twopanels/skin.js +++ /dev/null @@ -1,39 +0,0 @@ -WYMeditor.SKINS['twopanels'] = { - - init: function(wym) { - - //move the containers panel to the left area - jQuery(wym._box).find(wym._options.containersSelector) - .appendTo("div.wym_area_left"); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector + ', ' - + wym._options.containersSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "115px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/websdk/static/js/wymeditor/skins/wymeditor_icon.png b/websdk/static/js/wymeditor/skins/wymeditor_icon.png deleted file mode 100644 index d4fc155..0000000 --- a/websdk/static/js/wymeditor/skins/wymeditor_icon.png +++ /dev/null Binary files differ diff --git a/websdk/static/static b/websdk/static/static deleted file mode 120000 index 945c9b4..0000000 --- a/websdk/static/static +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/websdk/studio.py b/websdk/studio.py deleted file mode 100644 index d7b5879..0000000 --- a/websdk/studio.py +++ /dev/null @@ -1,105 +0,0 @@ -import os -import sys -from flask import Flask -from flaskext.genshi import Genshi, render_response -from werkzeug.utils import redirect -from flask import request,url_for - -app = Flask(__name__) -app.debug = True -genshi = Genshi(app) - -def shutdown_server(): - func = request.environ.get('werkzeug.server.shutdown') - if func is None: - raise RuntimeError('Not running with the Werkzeug Server') - func() - -def list_files(directory): - files=os.listdir(directory) - print "showing %s" % directory - return files - -@app.route('/') -def index(): - return render_response('index.html') - -@app.route('/edit/') -@app.route('/edit/') -def edit(filename="activity.py"): - icon = 'document-generic.svg' - mode = '' - if filename.endswith('.py'): - icon = 'text-x-python.svg' - mode = 'python' - if filename.endswith('.html'): - icon = 'text-uri-list.svg' - mode = 'html' - if filename.endswith('.css'): - icon = 'text-uri-list.svg' - mode = 'css' - if filename.endswith('.js'): - icon = 'text-uri-list.svg' - mode = 'javascript' - content = open(filename).read().decode('utf-8') - tmpl = 'editor.html' - directory=os.path.dirname(filename) - return render_response(tmpl, dict(content=content, icon=icon,basename=os.path.basename(filename), - filename=filename, absdir=os.path.normpath(directory), mode=mode, directory=directory)) - -@app.route('/save', methods=['POST']) -def save(): - filename = request.form['filename'] - f=open(filename,"wb") - content = request.form['content'] - content = content.replace('\r\n', '\n').replace('\r', '\n') # HACK - Ace seems to be confused about newlines - f.write(content.encode('utf-8')) - print "saving content: %s" % filename - f.close() - directory = os.path.dirname(filename) - return redirect(url_for('browse', directory=directory)) - -@app.route('/files/') -@app.route('/files/') -def browse(directory="."): - filelist = list_files(directory) - files = [] - if not os.path.abspath(directory)==os.path.abspath("."): - files.append( { 'name': '..', - 'icon': 'folder.svg', - 'href': '/files/%s' % os.path.join(directory,"..") }) - for filename in sorted(filelist): - fullname = os.path.join(directory,filename) - icon = 'document-generic.svg' - href = '/edit/%s/%s' % (directory,filename) - if filename.endswith('.py'): - icon = 'text-x-python.svg' - if filename.endswith('.html'): - icon = 'text-uri-list.svg' - if filename.endswith('.css'): - icon = 'text-uri-list.svg' - if filename.endswith('.js'): - icon = 'text-uri-list.svg' - if os.path.isdir(fullname): - icon = 'folder.svg' - href = '/files/%s' % fullname - if filename.endswith('.xo'): - href = '#' - if filename.startswith('.'): - continue - if filename.endswith('.pyc'): - continue - files.append( { 'name': filename, - 'icon': icon, - 'href': href } ) - return render_response('filer.html', dict(files=files, absdir=os.path.normpath(directory))) - -@app.route('/shutdown') -def shutdown(): - shutdown_server() - return 'Server shutting down...' - -if __name__=="__main__": - port=int(sys.argv[1]) - app.run(port=port) - #or app.run(host='0.0.0.0') diff --git a/websdk/templates/editor.html b/websdk/templates/editor.html deleted file mode 100644 index 7fb4737..0000000 --- a/websdk/templates/editor.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - Editor - - - - - - - - - - - -
    $content
    -
    -
    -
    - ${absdir}/
    - ${basename}
    -
    -
    -
    - - - - -
    -
    - - - - -
    -
    - - - diff --git a/websdk/templates/filer.html b/websdk/templates/filer.html deleted file mode 100644 index eb2a003..0000000 --- a/websdk/templates/filer.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - Filer - - - - - - -
    - ${absdir}/ -
    - - - - diff --git a/websdk/templates/index.html b/websdk/templates/index.html deleted file mode 100644 index 3b655dc..0000000 --- a/websdk/templates/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - -
    -

    Sugar WebSDK beta

    -
    -

    Technology Preview

    -

    The following are examples of things that can be achieved with WebSDK.

    -
      -
    • - - -

      Featuring Ace Editor and some tricks.

      -
    • -
    • -

      "Write less, do more". Jquery is a bag of candy.

      -
    • -
    • -
    • -
    • - -

      Not yet implemented.

      -
    • -
    • -

      Begin with right click, inspect element.

      -
    • -
    -
    -
    - - - diff --git a/websdk/templates/skel.html b/websdk/templates/skel.html deleted file mode 100644 index 65d351e..0000000 --- a/websdk/templates/skel.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - Filer - - - - - - - - diff --git a/websdk/templates/split-view.html b/websdk/templates/split-view.html deleted file mode 100644 index e23b696..0000000 --- a/websdk/templates/split-view.html +++ /dev/null @@ -1,10 +0,0 @@ - - -basic frameset - - - - - - - diff --git a/websdk/templates/wysiwyg-editor.html b/websdk/templates/wysiwyg-editor.html deleted file mode 100644 index 3f162c9..0000000 --- a/websdk/templates/wysiwyg-editor.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Editor - - - - - - - -
    -
    - -
    -
    -
    -
    - ${absdir}/
    - ${basename}
    -
    -
    - - - -
    -
    - - - -
    -
    - - - diff --git a/websdk/webpy.py b/websdk/webpy.py deleted file mode 100644 index 428df6f..0000000 --- a/websdk/webpy.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/bin/env python -# -*- coding: UTF-8 -*- -# this file is deprecated in favor of studio.py -# left to implement couple of details to remove - -import os -import os.path -import sys -try: - import cherrypy -except ImportError: - import cherrypy_local as cherrypy -from genshi.template import TemplateLoader - -class Root(object): - - def __init__(self, data): - self.data = data - try: - self.bundle_dir = data['bundle_dir'] - except KeyError: - self.bundle_dir = os.curdir - self.loader = TemplateLoader( - os.path.join(self.bundle_dir, 'templates'), - auto_reload=True) - - @cherrypy.expose - def index(self): - port = cherrypy.config['server.socket_port'] - return '''Server is running on port %s.
    - Try pointing a browser at - http://localhost:%s/www/index.html''' % (port, port, port) - - @cherrypy.expose - def debug(self): - port = cherrypy.config['server.socket_port'] - return '''Try right clicking on any element on the main canvas and choosing "Inspect Element". -
    Return to main''' % (port) - - @cherrypy.expose - def candy(self): - return '''Not yet implemented. -
    Return to main''' % (port) - - @cherrypy.expose - def journal(self): - port = cherrypy.config['server.socket_port'] - return '''Not yet implemented. -
    Return to main''' % (port) - - @cherrypy.expose - def collaboration(self): - port = cherrypy.config['server.socket_port'] - return '''Not yet implemented. -
    Return to main''' % (port) - - def list_files(self, directory): - files=os.listdir(directory) - print "showing %s" % directory - return files - - @cherrypy.expose - def browse(self, directory="."): - filelist = self.list_files(directory) - files = [] - if not os.path.abspath(directory)==os.path.abspath("."): - files.append( { 'name': '..', - 'icon': 'folder.svg', - 'href': 'browse?directory=%s' % os.path.join(directory,"..") }) - for filename in sorted(filelist): - fullname = os.path.join(directory,filename) - icon = 'document-generic.svg' - href = 'edit?filename=%s&directory=%s' % (fullname,directory) - if filename.endswith('.py'): - icon = 'text-x-python.svg' - if filename.endswith('.html'): - icon = 'text-uri-list.svg' - if filename.endswith('.css'): - icon = 'text-uri-list.svg' - if filename.endswith('.js'): - icon = 'text-uri-list.svg' - if os.path.isdir(fullname): - icon = 'folder.svg' - href = 'browse?directory=%s' % fullname - if filename.endswith('.xo'): - href = '#' - if filename.startswith('.'): - continue - if filename.endswith('.pyc'): - continue - files.append( { 'name': filename, - 'icon': icon, - 'href': href } ) - - tmpl = self.loader.load('filer.html') - return tmpl.generate(files=files, absdir=os.path.normpath(directory) - ).render('html', doctype='html') - @cherrypy.expose - def vsplit(self, frame1="/browse", frame2="/browse"): - tmpl = self.loader.load('split-view.html') - return tmpl.generate(frame1=frame1, frame2=frame2 - ).render('html', doctype='html') - - - @cherrypy.expose - def edit(self, directory=".", filename="activity.py", editor="ace"): - icon = 'document-generic.svg' - mode = '' - if filename.endswith('.py'): - icon = 'text-x-python.svg' - mode = 'python' - if filename.endswith('.html'): - icon = 'text-uri-list.svg' - mode = 'html' - if filename.endswith('.css'): - icon = 'text-uri-list.svg' - mode = 'css' - if filename.endswith('.js'): - icon = 'text-uri-list.svg' - mode = 'javascript' - content = open(filename).read().decode('utf-8') - if editor=="wysiwyg": - tmpl = self.loader.load('wysiwyg-editor.html') - else: - tmpl = self.loader.load('editor.html') - return tmpl.generate(content=content, icon=icon,basename=os.path.basename(filename), - filename=filename, directory=directory, absdir=os.path.normpath(directory), - mode=mode).render('html', doctype='html', encoding='utf-8') - - @cherrypy.expose - def save(self, filename, content, directory): - f=open(filename,"wb") - content = content.replace('\r\n', '\n').replace('\r', '\n') # HACK - f.write(content) - print "saving content: %s" % filename - f.close() - href = "/browse?directory=%s" % directory - cherrypy.tools.redirect.callable(url=href, internal=False) - return "content saved: %s" % content - - @cherrypy.expose - def delete(self, filename): - os.unlink(filename) - cherrypy.tools.redirect.callable(url='/browse', internal=True) - -def start(root, port): - root = os.path.abspath(root) - print "root is %s" % root - data = {} - # Some global configuration; note that this could be moved into a - # configuration file - cherrypy.config.update({ - 'server.socket_port': port, - 'tools.encode.on': True, 'tools.encode.encoding': 'utf-8', - 'tools.decode.on': True, - 'tools.trailing_slash.on': True, - 'tools.staticdir.root': root, - }) - - cherrypy.quickstart(Root(data), '/', { - '/www': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': 'www' - } - }) - #cherrypy.tree.mount(Root({}), '/', { - # '/www': { - # 'tools.staticdir.on': True, - # 'tools.staticdir.dir': 'www' - #}) - #cherrypy.engine.start() - -if __name__ == '__main__': - start(os.path.abspath(os.curdir), int(sys.argv[1])) -- cgit v0.9.1