|
|
@ -1,16 +1,49 @@
|
|||
If you would like to contribute - send pull request to dev branch.
|
||||
Getting dev version of **Cloud Commander**:
|
||||
|
||||
git clone git://github.com/coderaiser/cloudcmd.git
|
||||
git checkout dev
|
||||
|
||||
or by [link](https://github.com/coderaiser/cloudcmd/tree/dev "Dev version").
|
||||
|
||||
It is possible thet dev version Cloud Commander will needed dev version of Minify,
|
||||
so to get it you should type a couple more commands:
|
||||
|
||||
cd node_modules
|
||||
rm -rf minify
|
||||
git clone git://github.com/coderaiser/minify
|
||||
cd minify
|
||||
Brunch
|
||||
---------------
|
||||
If you would like to contribute - send pull request to dev branch.
|
||||
Getting dev version of **Cloud Commander**:
|
||||
|
||||
git clone git://github.com/coderaiser/cloudcmd.git
|
||||
git checkout dev
|
||||
|
||||
or by [link](https://github.com/coderaiser/cloudcmd/tree/dev "Dev version").
|
||||
|
||||
It is possible thet dev version Cloud Commander will needed dev version of Minify,
|
||||
so to get it you should type a couple more commands:
|
||||
|
||||
cd node_modules
|
||||
rm -rf minify
|
||||
git clone git://github.com/coderaiser/minify
|
||||
cd minify
|
||||
git checkout dev
|
||||
|
||||
Commit
|
||||
---------------
|
||||
Format of the commit message: **type(scope): subject**
|
||||
|
||||
**Type**:
|
||||
- feature
|
||||
- fix (bug fix)
|
||||
- docs (documentation)
|
||||
- style (formatting, missing semi colons, …)
|
||||
- refactor
|
||||
- test (when adding missing tests)
|
||||
- chore (maintain)
|
||||
|
||||
**Scope**:
|
||||
Scope could be anything specifying place of the commit change.
|
||||
For example util, console, view, edit, style etc...
|
||||
|
||||
**Subject text**:
|
||||
- use imperative, present tense: “change” not “changed” nor “changes”
|
||||
- don't capitalize first letter
|
||||
- no dot (.) at the end
|
||||
**Message body**:
|
||||
- just as in <subject> use imperative, present tense: “change” not “changed” nor “changes”
|
||||
- includes motivation for the change and contrasts with previous behavior
|
||||
|
||||
**Examples**:
|
||||
- [fix(style) .name{width}: 37% -> 35%](https://github.com/coderaiser/cloudcmd/commit/94b0642e3990c17b3a0ee3efeb75f343e1e7c050)
|
||||
- [fix(console) dispatch: focus -> mouseup](https://github.com/coderaiser/cloudcmd/commit/f41ec5058d1411e86a881f8e8077e0572e0409ec)
|
||||
|
||||
**Big change should be writed in ChangeLog like [this](https://github.com/coderaiser/cloudcmd/commit/e1893f77be09585decf8a260d45a42efc11c98e5).**
|
||||
153
ChangeLog
|
|
@ -1,3 +1,154 @@
|
|||
2012.07.01, v0.3.0
|
||||
|
||||
* Changed jquery cdn to one with https suport jquery.com -> google cdn.
|
||||
|
||||
* Added Access-Control-Allow-Origin header.
|
||||
|
||||
* Added functions in DOM module: createEvent
|
||||
(createKeyEvent, createClickEvent, createDblClickEvent),
|
||||
dispatch
|
||||
(dispatchKeyEvent, dispatchClickEvent, dispatchDblClickEvent)
|
||||
|
||||
* Changed object name CloudCommander -> CloudCmd
|
||||
|
||||
* Moved loading functions to Loader object in DOM module.
|
||||
|
||||
* Added addtables script'
|
||||
|
||||
* Fixed typo in README.
|
||||
|
||||
* Fixed same background declartion a couple times.
|
||||
|
||||
* Changed the way of work with listeners (DOM.addListener to DOM.Events.add).
|
||||
|
||||
* Added ability to add a couple events in Events.add.
|
||||
|
||||
* Moved jqeuryLoader and socketLoader to CMD object in DOM.
|
||||
|
||||
* Fixed bug with deletting in menu js.
|
||||
|
||||
* Removed function _editFileName from client.js.
|
||||
|
||||
* Removed linuxWatch function from main.js.
|
||||
|
||||
* Added tryCatch to fs.watch in cloudcmd.js.
|
||||
|
||||
* Set F3 to veiw.
|
||||
|
||||
* Renamed KeyBinding -> Key.
|
||||
|
||||
* Renamed: set -> setBinded, unSet -> unsetBinded, get -> isBinded.
|
||||
|
||||
* Functions maked private: ajaxload, changeLinks, createFileTable,
|
||||
getJSONfromFileTable.
|
||||
|
||||
* Moved CloudCmd.KEY object data to prototype of CloudCmd.Key.
|
||||
|
||||
* Simpified plugins id's.
|
||||
|
||||
* Rewrited _codemirror and view modules with prototypes.
|
||||
|
||||
* Added hide method to view module.
|
||||
|
||||
* Updated socket.io to v0.9.16.
|
||||
|
||||
* Removed init property from view and edit.
|
||||
|
||||
* FilePicker gets key from modules.json.
|
||||
|
||||
* Added ability to put callback to view.
|
||||
|
||||
* Added help module.
|
||||
|
||||
* Added ability to show help on F1.
|
||||
|
||||
* Added ability to set attributes in Loader.anyload.
|
||||
|
||||
* Fixed upload function of filepicker.
|
||||
|
||||
* fix(DOM) this promptNewFile -> Cmd.promptNewFile
|
||||
|
||||
* feature(console) add jq-console
|
||||
|
||||
* fix(style) .name{width}: 37% -> 35%
|
||||
|
||||
* feature(view) show(pData) -> show(pData, pCallBack)
|
||||
|
||||
* doc(license) add
|
||||
|
||||
* doc(contribute) add commit message conventions
|
||||
|
||||
* fix(socket) log level: debug -> info
|
||||
|
||||
* feature(console) jquery-terminal -> jq-console
|
||||
|
||||
* fix(help) remove pre
|
||||
|
||||
* feature(socket) add disconect
|
||||
|
||||
* feature(socket) add minification and gzip
|
||||
|
||||
* feature(socket) if id in use - reconnect
|
||||
|
||||
* chore(console) remove jquery-terminal
|
||||
|
||||
* feature(favicon) add
|
||||
|
||||
* fix(style) .mode width: 25% -> 23%
|
||||
|
||||
* feature(edit) codemirror -> ace
|
||||
|
||||
* feature(edit) add diff
|
||||
|
||||
* chore(dom) jquery: v2.0.0 -> v2.0.3
|
||||
|
||||
* feature(util) call log with any count of params
|
||||
|
||||
* feature(util) add logArray
|
||||
|
||||
* feature(socket) add chdir on cd
|
||||
|
||||
* feature(dom) add events.add array
|
||||
|
||||
* feauture(client) add unload event
|
||||
|
||||
* feature(update) exec -> exec(cwd)
|
||||
|
||||
* feature(cloudcmd) add bin
|
||||
|
||||
* feature(rest) add put patch
|
||||
|
||||
* feature(edit) save file only if it was changed
|
||||
|
||||
* fix(dom) rm array param from jsload
|
||||
|
||||
* feature(main) add to exports checkCallBackParams
|
||||
|
||||
* feature(win) diskpart -> wmic
|
||||
|
||||
* fix(diff) rm, work bad with win line ending
|
||||
|
||||
* fix(dom) this -> Cmd
|
||||
|
||||
* fix(css) .cmd-button: "outline:0"
|
||||
|
||||
* feature(index) add "~ - console" button
|
||||
|
||||
* chore(css) .cmd-button {width: 10% -> 8%}
|
||||
|
||||
* feature(index) add "f9 - menu" button
|
||||
|
||||
* feature(Events) dispatch: event -> event || eventName
|
||||
|
||||
* feature(css) add media-query for .cmd-button
|
||||
|
||||
* fix(view) open on f3 cmd button click
|
||||
|
||||
* fix(rest) save and create new file
|
||||
|
||||
* chore(minify) v0.2.0 -> v0.2.1
|
||||
|
||||
|
||||
2012.04.22, v0.2.0
|
||||
|
||||
* Added alerting about errors.
|
||||
|
|
@ -152,7 +303,7 @@ keyStop: function(e, opt) {
|
|||
* Removed loading spinner by commenting jquery.fancybox.css block
|
||||
#fancybox-loading div {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
height: 44px;
|
||||
background: url('fancybox_loading.gif') center center no-repeat;
|
||||
}
|
||||
|
||||
|
|
|
|||
135
ChangeLog.rus.md
|
|
@ -1,3 +1,78 @@
|
|||
2012.07.01, v0.3.0
|
||||
===============
|
||||
Уже прошла середина лета и, благодаря легкому похолоданию, мы, кажется, начали больше ценить эту волшебную пору года. Через месяц детишки пойдут в школу, в город нахлынут толпы жаждущих новых знаний студентов, и город плавно войдет в привычный ритм.
|
||||
С момента прошлого релиза прошло уже больше трёх месяцев, а это значит пора выкатывать новый релиз. В нём будет очень много нового и интересного. У командира наконецто появилась новая иконка, терминал и редактор были полностью заменены и привязаны к вьеру. Код значительно упрощен и оптимизирован. Далее подробнее.
|
||||
|
||||
**Добавлена внешняя возможность:**
|
||||
- Назначено f3 - просмотр.
|
||||
- FilePicker получает ключ из modules.json.
|
||||
- Добавлена возможность показывать помощь по F1.
|
||||
- Jquery-terminal заменён на JQ-Console.
|
||||
- Добавлена лицензия.
|
||||
- Добавлено соглашение по именованию коммитов.
|
||||
- Добавлен favicon.
|
||||
- CodeMirror заменён на Ace.
|
||||
- Обновление теперь возможно, при запуске с любого каталога.
|
||||
- Добавлен исполняемый файл для npm -g.
|
||||
- Файл сохраняется только если он был изменён в Editor.
|
||||
- Для определения разделов на Windows, утилита diskpart заменена на wmic.
|
||||
- Добавлена кнопка "~ - console" для вызова Консоли.
|
||||
- Добавлена кнопка "f9 - menu" для вызова Меню.
|
||||
|
||||
**Исправленные ошибки:**
|
||||
- Функция загрузки в Filepicker.
|
||||
- this.promptNewFile -> Cmd.promptNewFile.
|
||||
- Стили: .name{width}: 37% -> 35%.
|
||||
- socket: log level: debug -> info.
|
||||
- help: удален стиль "pre".
|
||||
- Стили: .mode width: 25% -> 23%.
|
||||
- DOM: убрана возможность принимать массив в jsload.
|
||||
- Стили: .cmd-button: "outline:0".
|
||||
- Сохранение и создание нового файла.
|
||||
|
||||
**Обновлены:**
|
||||
- socket.io до v0.9.16.
|
||||
- jquery до v2.0.3.
|
||||
- minify до v0.2.1.
|
||||
|
||||
**Внутренние изминения:**
|
||||
- Изменена jquery cdn в пользу той, что поддерживает https (jquery.com -> google cdn).
|
||||
- Добавлен заголовок Access-Control-Allow-Origin для под возможности ajax запросов с других адресов.
|
||||
- Добавлены функции в DOM: createEvent(createKeyEvent, createClickEvent, createDblClickEvent), dispatch(dispatchKeyEvent, dispatchClickEvent, dispatchDblClickEvent).
|
||||
- Переименован обьект CloudCommander -> CloudCmd.
|
||||
- Функции загрузки перемещены в обьект Loader модуля DOM.
|
||||
- Добавлен скрипт addtables.sh, добавляющий правила в фаервол.
|
||||
- Исправлены повторяющиеся правила, связанные с фоном, в css.
|
||||
- Переименована функция DOM.addListener - DOM.Events.add.
|
||||
- Добавлена возможность повесить несколько обработчиков через Events.add.
|
||||
- jqeuryLoader и socketLoader перемещены в обьект CMD в модуле DOM.
|
||||
- Исправлена ошибка с удалением файла в Menu.
|
||||
- Удалена функция _editFileName из Client.
|
||||
- Удалена функция linuxWatch из Main.
|
||||
- Добавлен tryCatch в fs.watch в cloudcmd.js.
|
||||
- Переименовано KeyBinding в Key.
|
||||
- Переименовано set - setBinded, unSet -> unsetBinded, get -> isBinded.
|
||||
- Следующие функции теперь приватные: ajaxload, changeLinks, createFileTable, getJSONfromFileTable.
|
||||
- Данные обйъекта CloudCmd.KEY перемещены в прототип CloudCmd.Key.
|
||||
- Упрощены id плагинов.
|
||||
- Переписаны модули _codemirror и View с прототипами.
|
||||
- Добавлен метод hide в модуль View.
|
||||
- Удалено свойство init из модулей View и Edit.
|
||||
- Добавлена возможность передавать колбек во View: show(pData) -> show(pData, pCallBack).
|
||||
- Добавлен модуль Help.
|
||||
- Добавлена возможность устанавливать атрибуты в Loader.anyload.
|
||||
- Добавлен обработчик disconect в Socket.
|
||||
- Добавлена минификация и gzip в Socket.
|
||||
- Если id уже используется происходит повторное соединение в Socket.
|
||||
- Util.log теперь может вызываться с любым количеством параметров.
|
||||
- Добавлена функция logArray в Util.
|
||||
- Добавлена возможность смены каталога по cd в Socket.
|
||||
- Добавлена возможность передавать функции Events.add массив.
|
||||
- Добавлено событие unload.
|
||||
- Добавлена в экспорт функция checkCallBackParams.
|
||||
- Функция dispatch принимает на вход event или его название.
|
||||
- Добавлены media-query для .cmd-button.
|
||||
|
||||
2012.04.22, v0.2.0
|
||||
===============
|
||||
Весна в разгаре, на деревьях появляются почки, наконец-то начинает теплеть.
|
||||
|
|
@ -38,8 +113,8 @@
|
|||
- Возвращение в папку, из которой был удален файл.
|
||||
|
||||
**Обновлены:**
|
||||
- jquery до версии v2.0.0
|
||||
- dropbox до версии v0.9.2
|
||||
- jquery до версии v2.0.0.
|
||||
- dropbox до версии v0.9.2.
|
||||
- socket.io до версии v0.9.14.
|
||||
|
||||
**Внутренние изминения:**
|
||||
|
|
@ -108,7 +183,7 @@
|
|||
- первый и последующие показы меню, а так же выделение даблкликом в Firefox
|
||||
|
||||
**Обновлены:**
|
||||
- jquery до версии v1.9.0
|
||||
- jquery до версии v1.9.0.
|
||||
- jquery-terminal до версии v0.4.22.
|
||||
- jQuery-contextMenu до версии v1.6.5.
|
||||
- socket.io до версии 0.9.13.
|
||||
|
|
@ -120,34 +195,34 @@
|
|||
- Изменен способ получения github id (теперь это делается через config.json, rest api были удалены).
|
||||
- Добавлены функции DOM.getCurrentFileContent(pCallBack [, pCurrentFile]) для получения содержимого файла в ФС, а так же обёртка Util.setTimeout(pFunction [, pCallBack, pTime]).
|
||||
- Добавлена функция в win.js для парсинга вывода команды diskpart (которая используется для опредиления локальных дисков).
|
||||
- Добавлена функция DOM.getCurrentDir()
|
||||
- API url на клиенте читается с файла config.json
|
||||
- Если выбрана загрузка на Gist (GitHub) и у файла в формате json нет расширения — оно добавляется
|
||||
- Добавлена возможность авторизовыватся на Гитхабе через новое окно. Изминен редирект на /auth и добавлена фнукция rout в cloudcmd.js
|
||||
- DropBox, GDrive и GitHub модули теперь выглядят одинаково
|
||||
- Рефакторинг в модуле Viewer
|
||||
- Улучшена оптимизация файла menu.js с 2539 до 2444 байт
|
||||
- Добавлена возможность читать GDrive key из конфига
|
||||
- Добавлена возможность авторизовыватся на дропбоксе через popup
|
||||
- Добавлена функция DOM.getCurrentDir().
|
||||
- API url на клиенте читается с файла config.json.
|
||||
- Если выбрана загрузка на Gist (GitHub) и у файла в формате json нет расширения — оно добавляется.
|
||||
- Добавлена возможность авторизовыватся на Гитхабе через новое окно. Изминен редирект на /auth и добавлена фнукция rout в cloudcmd.js.
|
||||
- DropBox, GDrive и GitHub модули теперь выглядят одинаково.
|
||||
- Рефакторинг в модуле Viewer.
|
||||
- Улучшена оптимизация файла menu.js с 2539 до 2444 байт.
|
||||
- Добавлена возможность читать GDrive key из конфига.
|
||||
- Добавлена возможность авторизовыватся на дропбоксе через popup.
|
||||
- Добавлена возможность авторизовыватся на vk.com.
|
||||
- Улучшен формат и парсинг файла modules.json
|
||||
- Добавлена возможность читать информацию о модулях сохранения из модуля меню
|
||||
- Добавлена простая система рендеринга шаблонов Util.render
|
||||
- Добавлены функции DOM.parseJSON и DOM.stringifyJSON, как обёртки над системными функциями
|
||||
- Добавлен плагин для миграции к новой версии jquery
|
||||
- Убрано получения данных из кеша Minify
|
||||
- JSON-файлы перемещены в папки json
|
||||
- Изминен шрифт с Octicons на Fonteollo
|
||||
- Улучшен формат и парсинг файла modules.json.
|
||||
- Добавлена возможность читать информацию о модулях сохранения из модуля меню.
|
||||
- Добавлена простая система рендеринга шаблонов Util.render.
|
||||
- Добавлены функции DOM.parseJSON и DOM.stringifyJSON, как обёртки над системными функциями.
|
||||
- Добавлен плагин для миграции к новой версии jquery.
|
||||
- Убрано получения данных из кеша Minify.
|
||||
- JSON-файлы перемещены в папки json.
|
||||
- Изминен шрифт с Octicons на Fonteollo.
|
||||
- Полностью удален шрифт Octicons.
|
||||
- Удалено свойство allowed из свойства cache в конфиге.
|
||||
- С этого момента оптимизироватся будут лишь те файлы, дата последнего изминения которых была изменена
|
||||
- Убрана возможность кешировать файлы в памяти
|
||||
- Перемещены расширения из main.js в json/ext.json
|
||||
- Основная функциональность CloudCmd перемещена в commander.js из server.js
|
||||
- Добавлена возможность удалять приставку к URL /fs когда мы в корневом каталоге
|
||||
- Убраны перересовки создаваемые js
|
||||
- Добавлена возможность добавлять флаг ?json только если мы работаем с папкой
|
||||
- Изминен принцип работы функции clickProcessing в меню, теперь он гораздо проще
|
||||
- Произведен тотальный рефакторинг в файле commander.js, теперь там только генерация
|
||||
структуры каталогов в формате json
|
||||
- С этого момента оптимизироватся будут лишь те файлы, дата последнего изминения которых была изменена.
|
||||
- Убрана возможность кешировать файлы в памяти.
|
||||
- Перемещены расширения из main.js в json/ext.json.
|
||||
- Основная функциональность CloudCmd перемещена в commander.js из server.js.
|
||||
- Добавлена возможность удалять приставку к URL /fs когда мы в корневом каталоге.
|
||||
- Убраны перересовки создаваемые js.
|
||||
- Добавлена возможность добавлять флаг ?json только если мы работаем с папкой.
|
||||
- Изминен принцип работы функции clickProcessing в меню, теперь он гораздо проще.
|
||||
- Произведен тотальный рефакторинг в файле commander.js, теперь там только генерация.
|
||||
структуры каталогов в формате json.
|
||||
- добавлен обьект RESTfull в DOM модуль для упрощения работы с CloudCmd REST API.
|
||||
|
|
|
|||
22
LICENSE
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2013 Coderaiser <mnemonic.enemy@gmail.com>
|
||||
|
||||
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.
|
||||
109
README.md
|
|
@ -1,4 +1,4 @@
|
|||
Cloud Commander v0.2.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]
|
||||
Cloud Commander v0.3.0 [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]
|
||||
===============
|
||||
[![Flattr][FlattrIMGURL]][FlattrURL]
|
||||
[NPMIMGURL]: https://badge.fury.io/js/cloudcmd.png
|
||||
|
|
@ -19,7 +19,7 @@ DEMO:
|
|||
Google PageSpeed Score : [100](//developers.google.com/speed/pagespeed/insights#url=http_3A_2F_2Fcloudcmd.aws.af.cm_2F&mobile=false "score") (out of 100)
|
||||
(or 96 if js or css minification disabled in config.json).
|
||||
|
||||

|
||||

|
||||
|
||||
Benefits
|
||||
---------------
|
||||
|
|
@ -47,6 +47,15 @@ Hot keys
|
|||
---------------
|
||||
In all modern web browsers (but not in IE, becouse he special) hot keys works.
|
||||
There is a short list:
|
||||
- **F1** - help
|
||||
- **F2** - rename current file
|
||||
- **F3** - view
|
||||
- **F4** - edit
|
||||
- **F5** - copy
|
||||
- **F6** - rename/move
|
||||
- **F7** - new dir
|
||||
- **F8, Delete** - remove current file
|
||||
- **F9** = menu
|
||||
- **Ctrl + r** - reload dir content
|
||||
- **Ctrl + d** - clear local cache (wich contains dir contents)
|
||||
- **Alt + q** - disable key bindings
|
||||
|
|
@ -58,23 +67,21 @@ There is a short list:
|
|||
- **Page Down** - down on one page
|
||||
- **Home** - to begin of list
|
||||
- **End** - to end of list
|
||||
- **F8, Delete** - remove current file
|
||||
- **Shift + Delete** - remove without prompt
|
||||
- **Insert** - select current file
|
||||
- **F2** - rename current file
|
||||
- **Shift + F10** - show context menu
|
||||
- **Shift + F10** - context menu
|
||||
- **~** - console
|
||||
|
||||
Viewer's hot keys
|
||||
---------------
|
||||
- **Shift + F3** - open viewer window
|
||||
- **Esc** - close viewer window
|
||||
- **F3** - open
|
||||
- **Esc** - close
|
||||
|
||||
Editor's hot keys
|
||||
---------------
|
||||
- **F3** - open CodeMirror editor in read only mode
|
||||
- **F4** - open CodeMirror editor
|
||||
- **Ctrl + s** - save file
|
||||
- **Esc** - close CodeMirror editor
|
||||
- **F4** - open
|
||||
- **Ctrl + s** - save
|
||||
- **Esc** - close
|
||||
|
||||
Menu
|
||||
---------------
|
||||
|
|
@ -87,17 +94,24 @@ Right mouse click button show context menu with items:
|
|||
- Download
|
||||
- New (File, Dir, from cloud)
|
||||
|
||||
Installing
|
||||
Install
|
||||
---------------
|
||||
**Cloud Commander** installing is very easy. All you need it's just clone
|
||||
repository from github. Just 2 commands:
|
||||
**Cloud Commander** install is very easy.
|
||||
All you need is
|
||||
- install [node.js](//nodejs.org/ "node.js")
|
||||
- [download](https://github.com/coderaiser/cloudcmd/archive/master.zip)
|
||||
and unpack or just clone repository from github:
|
||||
|
||||
```
|
||||
git clone git://github.com/coderaiser/cloudcmd.git
|
||||
cd cloudcmd
|
||||
or
|
||||
|
||||
npm i cloudcmd
|
||||
mv node_modules/cloudcmd ./
|
||||
node cloudcmd
|
||||
```
|
||||
or install in npm:
|
||||
```
|
||||
npm i cloudcmd -g
|
||||
cloudcmd
|
||||
```
|
||||
|
||||
Configuration
|
||||
---------------
|
||||
|
|
@ -117,9 +131,9 @@ All main configuration could be done thrue config.json.
|
|||
"server" : true, /* server mode or testing mode */
|
||||
"logs" : false, /* logs or console ouput */
|
||||
"socket" : true /* enable web sockets */
|
||||
"port" : 80, /* http port */
|
||||
"sslPort" : 443, /* https port */
|
||||
"ip" : "127.0.0.1", /* Cloud Commander IP */
|
||||
"port" : 80, /* http port or null(default) */
|
||||
"sslPort" : 443, /* https port or null(default) */
|
||||
"ip" : "127.0.0.1", /* ip or null(default) */
|
||||
"ssl" : true /* should use https? */
|
||||
"rest" : true /* enable rest interface */
|
||||
}
|
||||
|
|
@ -131,12 +145,13 @@ Standard practices say no non-root process gets to talk to
|
|||
the Internet on a port less than 1024. Anyway I suggest you
|
||||
to start Cloud Commander as non-root. How it could be solved?
|
||||
There is a couple easy and fast ways. One of them is port forwarding by iptables.
|
||||
Just run [shell/addtables.sh](shell/addtables.sh) for default options.
|
||||
|
||||
```sh
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -L # look rules before
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -L # look reles after
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look rules before
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4430
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -L # look reles after
|
||||
```
|
||||
You should see somethins like this ( **8000** and **4430** should be in config as **port** and **sslPort** )
|
||||
|
||||
|
|
@ -148,8 +163,8 @@ If you would want to get things back just clear rules ( **1** and **2** it's rul
|
|||
in your list they could differ).
|
||||
|
||||
```sh
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -D PREROUTING 1
|
||||
@:/tmp/cloudcmd (dev) $ su iptables -t nat -D PREROUTING 2
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 1
|
||||
@:/tmp/cloudcmd (dev) $ sudo iptables -t nat -D PREROUTING 2
|
||||
```
|
||||
|
||||
To run Cloud Commander as daemon in linux you could set **log** to true in config and
|
||||
|
|
@ -167,7 +182,7 @@ For more information see **config.json** and **shell/seret.bat** *(on win32)*
|
|||
or **shell/secret.sh** *(on nix)*.
|
||||
|
||||
|
||||
Starting
|
||||
Start
|
||||
---------------
|
||||
To start **Cloud Commander** only one command neaded:
|
||||
|
||||
|
|
@ -184,9 +199,9 @@ Then type in browser
|
|||
or
|
||||
|
||||
http://localhost
|
||||
Updating
|
||||
Update
|
||||
---------------
|
||||
**Cloud Commander** is very alfa and it's very often updatings.
|
||||
**Cloud Commander** is very often updates.
|
||||
Update is doing automagically but it could be done also manualy
|
||||
by typing a few commands in cloudcmd directory:
|
||||
|
||||
|
|
@ -207,37 +222,29 @@ But for minification and optimization tricks optional can be
|
|||
assingned (and installed) modules: [Minify] (https://github.com/coderaiser/minify "Minify")
|
||||
and [socket.io] (https://github.com/LearnBoost/socket.io "Socket.IO").
|
||||
|
||||
Install addtitional modules:
|
||||
Install addtitional modules (type in **Cloud Commander** directory):
|
||||
|
||||
npm i
|
||||
|
||||
**Cloud Commander's Client Side** use module jquery for ajaxing. But only for old browsers.
|
||||
We could not use this module, but this way is fast:
|
||||
- google cdn
|
||||
- gzip
|
||||
- cache
|
||||
|
||||
Perhaps in the future, it will not be used, but so far it has no effect on
|
||||
start loading of Cloud Commander Client Side and do things fast and stable
|
||||
it is using now.
|
||||
|
||||
Extensions
|
||||
---------------
|
||||
**Cloud Commander** desinged to easily porting extensions.
|
||||
For extend main functionality Cloud Commander use next modules:
|
||||
- [CodeMirror] [CodeMirrorURL]
|
||||
- [Ace] [AceURL]
|
||||
- [FancyBox] [FancyBoxURL]
|
||||
- [jQuery-contextMenu] [jQuery-contextMenuURL]
|
||||
- [jquery.terminal] [jquery.terminalURL]
|
||||
- [jq-console] [jq-consoleURL]
|
||||
- [github] [githubURL]
|
||||
- [dropbox-js] [dropbox-jsURL]
|
||||
- [jquery] [jqueryURL]
|
||||
|
||||
[CodeMirrorURL]: //github.com/marijnh/CodeMirror "CodeMirror"
|
||||
[AceURL]: //ace.ajax.org/ "Ace"
|
||||
[FancyBoxURL]: //github.com/fancyapps/fancyBox "FancyBox"
|
||||
[jQuery-contextMenuURL]: //github.com/medialize/jQuery-contextMenu "jQuery-contextMenu"
|
||||
[jquery.terminalURL]: //github.com/jcubic/jquery.terminal "jquery.terminal"
|
||||
[githubURL]: //github.com/michael/github
|
||||
[dropbox-jsURL]: //github.com/dropbox/dropbox-js
|
||||
[jq-consoleURL]: //github.com/replit/jq-console "jq-console"
|
||||
[githubURL]: //github.com/michael/github "github"
|
||||
[dropbox-jsURL]: //github.com/dropbox/dropbox-js "dropbox-js"
|
||||
[jqueryURL]: //jquery.com
|
||||
|
||||
Contributing
|
||||
---------------
|
||||
|
|
@ -257,6 +264,7 @@ so to get it you should type a couple more commands:
|
|||
|
||||
Version history
|
||||
---------------
|
||||
- *2012.07.01*, **[v0.3.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.3.0.zip)**
|
||||
- *2012.04.22*, **[v0.2.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.2.0.zip)**
|
||||
- *2012.03.01*, **[v0.1.9](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.9.zip)**
|
||||
- *2012.12.12*, **[v0.1.8](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.8.zip)**
|
||||
|
|
@ -269,6 +277,11 @@ Version history
|
|||
- *2012.07.11*, **[v0.1.1](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.1.zip)**
|
||||
- *2012.00.00*, **[v0.1.0](//github.com/coderaiser/cloudcmd-archive/raw/master/cloudcmd-v0.1.0.zip)**
|
||||
|
||||
License
|
||||
---------------
|
||||
MIT [license](LICENSE "license").
|
||||
|
||||
Special Thanks
|
||||
---------------
|
||||
[Elena Zalitok](http://vk.com/politilena "Elena Zalitok") for logo.
|
||||
[Elena Zalitok](http://vk.com/politilena "Elena Zalitok") for
|
||||
[logo](img/logo/cloudcmd.png "logo") and [favicon](img/favicon/favicon.png "favicon").
|
||||
|
|
|
|||
12
bin/cloudcmd
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/* cloudcmd binary
|
||||
* usage: node cloudcmd
|
||||
*/
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
require('../cloudcmd');
|
||||
|
||||
})();
|
||||
|
||||
108
cloudcmd.js
|
|
@ -45,7 +45,8 @@
|
|||
* additional processing of index file
|
||||
*/
|
||||
function indexProcessing(pData){
|
||||
var lData = pData.data,
|
||||
var lPath, lReplace, lKeysPanel,
|
||||
lData = pData.data,
|
||||
lAdditional = pData.additional;
|
||||
|
||||
/*
|
||||
|
|
@ -53,10 +54,10 @@
|
|||
* меняем в index.html обычные css на
|
||||
* минифицированый
|
||||
*/
|
||||
if(Minify.allowed.css){
|
||||
var lPath = '/' + Util.removeStr(Minify.MinFolder, DIR),
|
||||
lReplace = '<link rel=stylesheet href="/css/reset.css">';
|
||||
lData = Util.removeStr(lData, lReplace)
|
||||
if (Minify.allowed.css){
|
||||
lPath = '/' + Util.removeStr(Minify.MinFolder, DIR);
|
||||
lReplace = '<link rel=stylesheet href="/css/reset.css">';
|
||||
lData = Util.removeStr(lData, lReplace)
|
||||
.replace('/css/style.css', lPath + 'all.min.css');
|
||||
}
|
||||
|
||||
|
|
@ -65,12 +66,12 @@
|
|||
fm : lAdditional
|
||||
});
|
||||
|
||||
if(!Config.appcache)
|
||||
if (!Config.appcache)
|
||||
lData = Util.removeStr(lData, ' manifest="/cloudcmd.appcache"');
|
||||
|
||||
if(!Config.show_keys_panel){
|
||||
var lKeysPanel = '<div id=keyspanel';
|
||||
lData = lData.replace(lKeysPanel, lKeysPanel +' class=hidden');
|
||||
if (!Config.show_keys_panel){
|
||||
lKeysPanel = '<div id=keyspanel';
|
||||
lData = lData.replace(lKeysPanel, lKeysPanel +' class=hidden');
|
||||
}
|
||||
|
||||
return lData;
|
||||
|
|
@ -83,14 +84,14 @@
|
|||
function appCacheProcessing(){
|
||||
var lFONT_REMOTE = '//themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff',
|
||||
lFONT_LOCAL = './font/DroidSansMono.woff',
|
||||
lJQUERY_REMOTE = 'http://code.jquery.com/jquery-2.0.0.min.js',
|
||||
lJQUERY_REMOTE = '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js',
|
||||
lJQUERY_LOCAL = './lib/client/jquery.js',
|
||||
lFiles = [{}, {}];
|
||||
|
||||
lFiles[0][lFONT_REMOTE] = lFONT_LOCAL;
|
||||
lFiles[1][lJQUERY_REMOTE] = lJQUERY_LOCAL;
|
||||
|
||||
if(Config.minification.css)
|
||||
if (Config.minification.css)
|
||||
lFiles.push('node_modules/minify/min/all.min.css');
|
||||
|
||||
AppCache.addFiles(lFiles);
|
||||
|
|
@ -141,7 +142,9 @@
|
|||
}
|
||||
|
||||
function init(){
|
||||
if(update)
|
||||
var lServerDir, lArg, lParams, lFiles;
|
||||
|
||||
if (update)
|
||||
update.get();
|
||||
|
||||
/* Determining server.js directory
|
||||
|
|
@ -149,24 +152,26 @@
|
|||
* (usually /) to it.
|
||||
* argv[1] - is always script name
|
||||
*/
|
||||
var lServerDir = path.dirname(process.argv[1]) + '/';
|
||||
lServerDir = path.dirname(process.argv[1]) + '/';
|
||||
|
||||
if( DIR !== lServerDir ){
|
||||
if (DIR !== lServerDir) {
|
||||
Util.log('current dir: ' + DIR);
|
||||
process.chdir(lServerDir);
|
||||
}
|
||||
|
||||
Util.log('server dir: ' + lServerDir);
|
||||
Util.log('reading configuration file config.json...');
|
||||
|
||||
if(Config){
|
||||
if (Config) {
|
||||
Util.log('config.json readed');
|
||||
|
||||
/* if command line parameter testing resolved
|
||||
* setting config to testing, so server
|
||||
* not created, just init and
|
||||
* all logs writed to screen */
|
||||
var lArg = process.argv;
|
||||
lArg = lArg[lArg.length - 1];
|
||||
lArg = process.argv;
|
||||
lArg = lArg[lArg.length - 1];
|
||||
|
||||
if ( lArg === 'test' || lArg === 'test\r') {
|
||||
Util.log(process.argv);
|
||||
Config.server = false;
|
||||
|
|
@ -177,34 +182,37 @@
|
|||
'from now all logs will be writed to log.txt');
|
||||
writeLogsToFile();
|
||||
}
|
||||
|
||||
if(Config.server)
|
||||
fs.watch(CONFIG_PATH, function(){
|
||||
/* every catch up - calling twice */
|
||||
setTimeout(function() {
|
||||
readConfig();
|
||||
}, 1000);
|
||||
|
||||
if (Config.server)
|
||||
Util.tryCatchLog(function(){
|
||||
fs.watch(CONFIG_PATH, function(){
|
||||
/* every catch up - calling twice */
|
||||
setTimeout(function() {
|
||||
readConfig();
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
var lParams = {
|
||||
|
||||
lParams = {
|
||||
appcache : appCacheProcessing,
|
||||
minimize : minimize,
|
||||
rest : rest,
|
||||
route : route
|
||||
},
|
||||
lFiles = [FILE_TMPL, PATH_TMPL];
|
||||
|
||||
if(Config.ssl)
|
||||
lFiles = [FILE_TMPL, PATH_TMPL];
|
||||
|
||||
if (Config.ssl)
|
||||
lFiles.push(CA, KEY, CERT);
|
||||
|
||||
main.readFiles(lFiles, function(pErrors, pFiles){
|
||||
if(pErrors)
|
||||
if (pErrors)
|
||||
Util.log(pErrors);
|
||||
else{
|
||||
else {
|
||||
FileTemplate = pFiles[FILE_TMPL].toString();
|
||||
PathTemplate = pFiles[PATH_TMPL].toString();
|
||||
|
||||
if(Config.ssl)
|
||||
if (Config.ssl)
|
||||
lParams.ssl = {
|
||||
ca : pFiles[CA],
|
||||
key : pFiles[KEY],
|
||||
|
|
@ -221,13 +229,13 @@
|
|||
|
||||
function readConfig(pCallBack){
|
||||
fs.readFile(CONFIG_PATH, function(pError, pData){
|
||||
if(!pError){
|
||||
if (!pError){
|
||||
Util.log('config: readed');
|
||||
|
||||
var lStr = pData.toString(),
|
||||
lReadedConf = Util.parseJSON(lStr);
|
||||
|
||||
if(!Config.minification)
|
||||
if (!Config.minification)
|
||||
main.config = Config = lReadedConf;
|
||||
|
||||
Util.tryCatchLog(function(){
|
||||
|
|
@ -250,24 +258,24 @@
|
|||
function route(pParams){
|
||||
var lRet = main.checkParams(pParams);
|
||||
|
||||
if(lRet){
|
||||
if (lRet){
|
||||
var p = pParams;
|
||||
|
||||
if( Util.strCmp(p.name, ['/auth', '/auth/github']) ){
|
||||
if ( Util.strCmp(p.name, ['/auth', '/auth/github']) ){
|
||||
Util.log('* Routing' +
|
||||
'-> ' + p.name);
|
||||
|
||||
pParams.name = main.HTMLDIR + p.name + '.html';
|
||||
lRet = main.sendFile( pParams );
|
||||
}
|
||||
else if( Util.isContainStrAtBegin(p.name, FS) || Util.strCmp( p.name, '/') ){
|
||||
else if ( Util.isContainStrAtBegin(p.name, FS) || Util.strCmp( p.name, '/') ){
|
||||
|
||||
if( Util.isContainStrAtBegin(p.name, FS + 'no-js/') ){
|
||||
if ( Util.isContainStrAtBegin(p.name, FS + 'no-js/') ){
|
||||
var lURL = Util.removeStr(pParams.name, 'no-js/');
|
||||
return main.redirect(pParams, lURL);
|
||||
}
|
||||
|
||||
lRet = sendCommanderContent(p);
|
||||
lRet = sendCommanderContent( pParams );
|
||||
}
|
||||
/* termporary redirect for old urls */
|
||||
else
|
||||
|
|
@ -278,20 +286,20 @@
|
|||
}
|
||||
|
||||
function sendCommanderContent(pParams){
|
||||
var lRet = main.checkParams(pParams);
|
||||
if(lRet){
|
||||
var p = pParams;
|
||||
p.name = Util.removeStrOneTime(p.name, CloudFunc.FS) || main.SLASH;
|
||||
var p, lRet = main.checkParams(pParams);
|
||||
|
||||
if (lRet){
|
||||
p = pParams;
|
||||
p.name = Util.removeStrOneTime(p.name, CloudFunc.FS) || main.SLASH;
|
||||
|
||||
fs.stat(p.name, function(pError, pStat){
|
||||
if(!pError)
|
||||
if( pStat.isDirectory() )
|
||||
if (!pError)
|
||||
if ( pStat.isDirectory() )
|
||||
processCommanderContent(pParams);
|
||||
else
|
||||
main.sendFile(p);
|
||||
main.sendFile( pParams );
|
||||
else
|
||||
main.sendError(pParams, pError);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -301,12 +309,12 @@
|
|||
function processCommanderContent(pParams){
|
||||
var lRet = main.checkParams(pParams);
|
||||
|
||||
if(lRet){
|
||||
if (lRet){
|
||||
var p = pParams;
|
||||
main.commander.getDirContent(p.name, function(pError, pJSON){
|
||||
if(!pError){
|
||||
if (!pError){
|
||||
var lQuery = main.getQuery(p.request);
|
||||
if( Util.isContainStr(lQuery, 'json') ){
|
||||
if ( Util.isContainStr(lQuery, 'json') ){
|
||||
p.data = Util.stringifyJSON(pJSON);
|
||||
p.name +='.json';
|
||||
main.sendResponse(p);
|
||||
|
|
@ -314,7 +322,7 @@
|
|||
else{ /* get back html*/
|
||||
p.name = Minify.allowed.html ? Minify.getName(INDEX) : INDEX;
|
||||
fs.readFile(p.name, function(pError, pData){
|
||||
if(!pError){
|
||||
if (!pError){
|
||||
var lPanel = CloudFunc.buildFromJSON(pJSON, FileTemplate, PathTemplate),
|
||||
lList = '<ul id=left class=panel>' + lPanel + '</ul>' +
|
||||
'<ul id=right class=panel>' + lPanel + '</ul>';
|
||||
|
|
|
|||
|
|
@ -8,11 +8,7 @@
|
|||
*/
|
||||
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
color: #222;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
body { margin: 0; font-size: 1em; line-height: 1.4; }
|
||||
|
||||
|
|
@ -22,15 +18,8 @@ body { margin: 0; font-size: 1em; line-height: 1.4; }
|
|||
* Also: hot pink! (or customize the background color to match your design)
|
||||
*/
|
||||
/*
|
||||
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
|
||||
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
|
||||
*/
|
||||
::-moz-selection{ text-shadow: none; opacity: 0;}
|
||||
::selection {
|
||||
text-shadow: none;
|
||||
opacity: 0;
|
||||
background-color:white; /* opera */
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
|
|
@ -86,4 +75,4 @@ a:hover, a:active { outline: 0; }
|
|||
a[href]:after { content: " (" attr(href) ")"; }
|
||||
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
|
||||
@page { margin: 0.5cm; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
121
css/style.css
|
|
@ -26,12 +26,24 @@
|
|||
src: local('Droid Sans Mono'), local('DroidSansMono'), url('//themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff') format('woff');
|
||||
}
|
||||
|
||||
body{
|
||||
body {
|
||||
font:16px "Droid Sans Mono";
|
||||
background-color:white;
|
||||
}
|
||||
|
||||
.path-icon{
|
||||
#fm::-moz-selection, #left>li::-moz-selection, #right>li::-moz-selection, .path::-moz-selection, .fm-header::-moz-selection,
|
||||
.mini-icon::-moz-selection, .name::-moz-selection, .size::-moz-selection, .owner::-moz-selection, .mode::-moz-selection {
|
||||
text-shadow: none; opacity: 0;
|
||||
}
|
||||
|
||||
#fm::selection, #left>li::selection, #right>li::selection, .path::selection, .fm-header::selection,
|
||||
.mini-icon::selection, .name::selection, .size::selection, .owner::selection, .mode::selection {
|
||||
text-shadow: none;
|
||||
opacity: 0;
|
||||
background-color:white; /* opera */
|
||||
}
|
||||
|
||||
.path-icon {
|
||||
position: relative;
|
||||
top: 3px;
|
||||
left: -4px;
|
||||
|
|
@ -44,15 +56,15 @@ body{
|
|||
color: #46A4C3;/*#55BF3F; green*/
|
||||
text-shadow:black 0 2px 1px;
|
||||
}
|
||||
.path-icon:hover{
|
||||
.path-icon:hover {
|
||||
cursor:pointer;
|
||||
}
|
||||
.path-icon:active{
|
||||
.path-icon:active {
|
||||
position: relative;
|
||||
top: 4px;
|
||||
text-shadow:black 0 0 1px;
|
||||
}
|
||||
.icon{
|
||||
.icon {
|
||||
display:inline-block;
|
||||
width:16px;
|
||||
height:16px;
|
||||
|
|
@ -60,60 +72,63 @@ body{
|
|||
/* font-family: 'GeneralFoundicons'; */
|
||||
font-family: 'Fontello';
|
||||
}
|
||||
.error::before{
|
||||
.error::before {
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
color: rgb(222, 41, 41);
|
||||
cursor :default;
|
||||
content: '\2757';
|
||||
}
|
||||
.loading{
|
||||
.loading {
|
||||
position:relative;
|
||||
top:1px;
|
||||
background:url(/img/spinner.gif);
|
||||
}
|
||||
.error:hover{
|
||||
|
||||
.error:hover {
|
||||
color:rgb(222, 41, 41);
|
||||
color:rgba(222, 41, 41, 0.81);
|
||||
}
|
||||
.refresh-icon{
|
||||
|
||||
.refresh-icon {
|
||||
background:url(/img/panel_refresh.png) no-repeat;
|
||||
}
|
||||
.refresh-icon:active{
|
||||
/*background-position-y: -15px;*/
|
||||
background:url(/img/panel_refresh.png) 0 -15px no-repeat;
|
||||
|
||||
.refresh-icon:active {
|
||||
background-position: 0 -15px;
|
||||
}
|
||||
|
||||
.cmd-button{
|
||||
width: 10%;
|
||||
margin: 20px 2px 0 2px;
|
||||
overflow: hidden;
|
||||
color: rgb(49,123,249);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
.cmd-button {
|
||||
background-color: white;
|
||||
border: 1.5px solid rgba(49,123,249,.40);
|
||||
color: rgb(49,123,249);
|
||||
margin: 20px 2px 0 2px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
outline: 0;
|
||||
white-space: nowrap;
|
||||
width: 8%;
|
||||
}
|
||||
|
||||
.cmd-button:hover{
|
||||
.cmd-button:hover {
|
||||
border: 1.5px solid rgb(0,0,0);
|
||||
}
|
||||
|
||||
.cmd-button:active{
|
||||
.cmd-button:active {
|
||||
color: white;
|
||||
background-color: rgb(49,123,249);
|
||||
}
|
||||
|
||||
.clear-cache{
|
||||
.clear-cache {
|
||||
margin-right: 6px;
|
||||
margin-left: 7px;
|
||||
background:url(/img/console_clear.png) -4px -4px no-repeat;
|
||||
}
|
||||
.clear-cache:active{
|
||||
.clear-cache:active {
|
||||
top:5px;
|
||||
}
|
||||
|
||||
.links{
|
||||
.links {
|
||||
color:red;
|
||||
}
|
||||
|
||||
|
|
@ -135,17 +150,17 @@ body{
|
|||
* именем файла во время
|
||||
* установления курсора
|
||||
*/
|
||||
.current-file > .mini-icon{
|
||||
.current-file > .mini-icon {
|
||||
left: -6px;
|
||||
}
|
||||
/* freeupex */
|
||||
.directory{
|
||||
.directory {
|
||||
/*list-style-image*/
|
||||
background-image:url('/img/dir.png');
|
||||
background-position: 0 0;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.text-file{
|
||||
.text-file {
|
||||
/*list-style-image*/
|
||||
background-image:url('/img/txt.png');
|
||||
background-position: 0 0;
|
||||
|
|
@ -155,7 +170,7 @@ body{
|
|||
height: 90%;
|
||||
margin: 26px 26px 0 26px;
|
||||
}
|
||||
.fm-header{
|
||||
.fm-header {
|
||||
font-weight: bold;
|
||||
}
|
||||
#path{
|
||||
|
|
@ -166,7 +181,7 @@ body{
|
|||
}
|
||||
|
||||
/* фон файла, на котором курсор*/
|
||||
.current-file{
|
||||
.current-file {
|
||||
border: 1.5px solid rgba(49, 123, 249, .40);
|
||||
}
|
||||
|
||||
|
|
@ -187,9 +202,9 @@ body{
|
|||
}
|
||||
|
||||
/* информация о файлах и папках*/
|
||||
.name{
|
||||
.name {
|
||||
float: left;
|
||||
width: 37%;
|
||||
width: 35%;
|
||||
/* если длина имени файла больше 16 символов
|
||||
* отрезаем лишнее, оставляя лишь 16,
|
||||
* и добавляем две точки и тайтл
|
||||
|
|
@ -198,7 +213,7 @@ body{
|
|||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.size{
|
||||
.size {
|
||||
float:left;
|
||||
width:16%;
|
||||
/* Ставим отступ, что бы
|
||||
|
|
@ -212,9 +227,9 @@ body{
|
|||
*/
|
||||
text-align: right;
|
||||
}
|
||||
.mode{
|
||||
.mode {
|
||||
float: right;
|
||||
width: 25%;
|
||||
width: 23%;
|
||||
}
|
||||
|
||||
/* changin ul to panel for high speed parsing*/
|
||||
|
|
@ -250,7 +265,7 @@ a:hover, a:active {
|
|||
display:none;
|
||||
}
|
||||
/* текущий файл под курсором */
|
||||
.current-file{
|
||||
.current-file {
|
||||
background-color: rgb(49, 123, 249);
|
||||
background-color: rgba(49, 123, 249, .40);
|
||||
color:white;
|
||||
|
|
@ -259,11 +274,11 @@ a:hover, a:active {
|
|||
.current-file > .mini-icon{
|
||||
color:white;
|
||||
}
|
||||
.current-file > .text-file::before{
|
||||
.current-file > .text-file::before {
|
||||
color:white;
|
||||
}
|
||||
|
||||
.fm-header{
|
||||
.fm-header {
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
|
@ -279,23 +294,23 @@ a:hover, a:active {
|
|||
position: relative;
|
||||
top: 10px
|
||||
}
|
||||
.directory::before{
|
||||
.directory::before {
|
||||
content: '\1f4c1';
|
||||
}
|
||||
.text-file::before{
|
||||
.text-file::before {
|
||||
color: rgb(26, 224, 124);
|
||||
color: rgba(26, 224, 124, 0.56);
|
||||
content: '\1f4c4';
|
||||
}
|
||||
.text-file{
|
||||
.text-file {
|
||||
background-image:none;
|
||||
}
|
||||
|
||||
/* убираем заголовок*/
|
||||
.fm_header{
|
||||
.fm_header {
|
||||
display:none;
|
||||
}
|
||||
.mode,.size,.owner{
|
||||
.mode,.size,.owner {
|
||||
/* располагаем элементы
|
||||
* один под другим
|
||||
*/
|
||||
|
|
@ -306,32 +321,36 @@ a:hover, a:active {
|
|||
text-align: left;
|
||||
}
|
||||
/* выводим заголовки рядом с полями */
|
||||
.name::before{
|
||||
.name::before {
|
||||
content: 'name:';
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
}
|
||||
.mode::before{
|
||||
.mode::before {
|
||||
content: 'mode:';
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
}
|
||||
.size::before{
|
||||
.size::before {
|
||||
content: 'size:';
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
}
|
||||
.owner::before{
|
||||
.owner::before {
|
||||
content: 'owner:';
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.name{
|
||||
.name {
|
||||
float: none;
|
||||
width:100%;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.cmd-button {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 601px) and (max-width: 785px){
|
||||
.panel{
|
||||
|
|
@ -340,6 +359,10 @@ a:hover, a:active {
|
|||
#right{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.cmd-button {
|
||||
width: 15%;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width:786px) and (max-width: 1155px){
|
||||
|
|
@ -350,4 +373,8 @@ a:hover, a:active {
|
|||
#right{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.cmd-button {
|
||||
width: 10%;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html manifest="/cloudcmd.appcache">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<!-- mobile first design -->
|
||||
<meta content="width=device-width,initial-scale=1" name="viewport" />
|
||||
<!-- chrome frame -->
|
||||
<meta http-equiv="X-UA-Compatible" content=" chrome=1" />
|
||||
<title>{title}</title>
|
||||
|
||||
<link rel=stylesheet href="/css/reset.css">
|
||||
<link rel=stylesheet href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id=fm class=no-js>{fm}</div>
|
||||
<div id=keyspanel>
|
||||
<button id=f1 class=cmd-button>F1 - help</button>
|
||||
<button id=f2 class=cmd-button>F2 - rename</button>
|
||||
<button id=f3 class=cmd-button>F3 - view</button>
|
||||
<button id=f4 class=cmd-button>F4 - edit</button>
|
||||
<button id=f5 class=cmd-button>F5 - copy</button>
|
||||
<button id=f6 class=cmd-button>F6 - move</button>
|
||||
<button id=f7 class=cmd-button>F7 - make dir</button>
|
||||
<button id=f8 class=cmd-button>F8 - delete</button>
|
||||
</div>
|
||||
<script src=/lib/util.js></script>
|
||||
<script src=/lib/client/dom.js></script>
|
||||
<!--[if lt IE]>
|
||||
<script src=//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js></script>
|
||||
<script src=//code.jquery.com/jquery-1.9.0.min.js id=jquery-1_9_0_min_js ></script>
|
||||
<script src=/lib/client/ie.js id=ie_js ></script>
|
||||
<script src=//getfirebug.com/firebug-lite-debug.js></script>
|
||||
<![endif]-->
|
||||
<script src=/lib/client.js></script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html manifest="/cloudcmd.appcache">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<!-- mobile first design -->
|
||||
<meta content="width=device-width,initial-scale=1" name="viewport" />
|
||||
<!-- chrome frame -->
|
||||
<meta http-equiv="X-UA-Compatible" content=" chrome=1" />
|
||||
<link href=/img/favicon/favicon.png rel=icon type=image/png />
|
||||
<title>{title}</title>
|
||||
|
||||
<link rel=stylesheet href="/css/reset.css">
|
||||
<link rel=stylesheet href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id=fm class=no-js>{fm}</div>
|
||||
<div id=keyspanel>
|
||||
<button id=f1 class=cmd-button>F1 - help</button>
|
||||
<button id=f2 class=cmd-button>F2 - rename</button>
|
||||
<button id=f3 class=cmd-button>F3 - view</button>
|
||||
<button id=f4 class=cmd-button>F4 - edit</button>
|
||||
<button id=f5 class=cmd-button>F5 - copy</button>
|
||||
<button id=f6 class=cmd-button>F6 - move</button>
|
||||
<button id=f7 class=cmd-button>F7 - make dir</button>
|
||||
<button id=f8 class=cmd-button>F8 - delete</button>
|
||||
<button id=f9 class=cmd-button>F9 - menu</button>
|
||||
<button id=~ class=cmd-button>~ - console</button>
|
||||
</div>
|
||||
<script src=/lib/util.js></script>
|
||||
<script src=/lib/client/dom.js></script>
|
||||
<!--[if lt IE]>
|
||||
<script src=//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js></script>
|
||||
<script src=//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js id=jquery_min_js ></script>
|
||||
<script src=/lib/client/ie.js id=ie_js ></script>
|
||||
<![endif]-->
|
||||
<script src=/lib/client.js></script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
img/favicon/favicon-big.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
737
img/favicon/favicon.ai
Normal file
|
|
@ -0,0 +1,737 @@
|
|||
%PDF-1.5
|
||||
4 0 obj
|
||||
<<
|
||||
/Type /Page
|
||||
/Parent 2 0 R
|
||||
/Contents 5 0 R
|
||||
/PieceInfo <<
|
||||
/Illustrator 6 0 R>>
|
||||
/MediaBox [-0.0000 -0.0000 595.2756 841.8898]
|
||||
/TrimBox [0.0000 0.0000 595.2756 841.8898]
|
||||
/CropBox [-0.0000 -0.0000 595.2756 841.8898]
|
||||
/Resources <<
|
||||
/ProcSet [/PDF]
|
||||
>>
|
||||
>>
|
||||
endobj
|
||||
6 0 obj
|
||||
<<
|
||||
/Private 7 0 R>>
|
||||
endobj
|
||||
7 0 obj
|
||||
<<
|
||||
/AIPrivateData1 8 0 R /CreatorVersion 11
|
||||
/ContainerVersion 9
|
||||
/RoundtripVersion 11
|
||||
/NumBlock 1 >>
|
||||
endobj
|
||||
8 0 obj
|
||||
<<
|
||||
/Filter [/ASCIIHexDecode /FlateDecode ]
|
||||
/Length 53205
|
||||
>>
|
||||
stream
|
||||
78daecdd5bafe3f6b91fe0fb01fc1dd48b00098aa8e299f49dd6a9cd6eb2bb11a7d8298a8d6062af
|
||||
6d4f3b9ef19e1927713f7d499112252d9d2851c7f5c8805f89e2234aef9fa224fed690bffa4ffff2
|
||||
cd6fc7df7dfcebf36fa3e1e8ab37bffad5fda7e7b75f3e7efa7a3271f0bbf7ef7ffefce5533565f0
|
||||
eb3ffde1378320188e2697c1e33f7efaf8e9cbf377837ffff4f1c7c1fdc74fcfef1ffe38fed7f221
|
||||
fef4eecbfbe7affffdeddfde7dfbf1c3f0edbbd9c3befbf8e1e1ed97e7af07dfbcfd32f8a79fdf0f
|
||||
46e92048bf0ee3afa368108e82e84d39e7ddc79f3f7cf7eec3f7771ffff175180cc2ac1824593048
|
||||
a3bc7a9c878fdffefce3f3872ffff2e9e3b7cf9f3fdf7f7cfff1d3e7af07f7bfbcfd30f8c3dbefcb
|
||||
7bde0efed7f3fbf71fff3eb87bfff6dbff3b6fbef9f9a79fdebf7bfeee8fcf9f3ffefca9e45f0f7e
|
||||
2a1fe6f3f397c1e4d5fee5fdf3df9edf877f19ff2e1904c37030e9c77f5e9ae7cb2f3f7dfcfed3db
|
||||
9f7ef8a5996f340856cd377966bffbb17c4ae57ce5cb1c06ab1f6faec39b17fcede71fca171596cb
|
||||
cb57ddfdf987b755d7cac7c8274faa7a8cf1efa2fa79fccfcfe5f328bb545d6fa6ffe9f9c79fde97
|
||||
83316973910de2aad7756de6685bfdfcb777cf7fff7af0cf1f3f3c4fee4bfe32fef4e59b77ffaf7c
|
||||
c8a44806791c0e9ae9fffcf38fbf7ffbcb733524a366d2d3bbf7cf4f1f3ffd580e7938ac27667ff9
|
||||
d30f3ffff8d70f6fdfbdff7a108479f908f58bba7bfefe5db58abcfd7a1045a378f0df9eff31b8fb
|
||||
e5cbf3e7f2cee029b80bb23029d79387300fe3300cefc22c4cc3a7f03e1c4741f8183e94ff7f2aff
|
||||
1f57b5fc7f188da2b4fc7ff58aca2b5114c4e3388b936414dfc7e3344a47c953364aefd3221b6769
|
||||
16e7591ee5a3bbe46e347eaa2ff5ba5ef2d101171cc771fc4278395b12961f01c9d34314961f150f
|
||||
a3fbd1e8e9210b26d7a3eafae87e723daeaea7774158b1a78720aaae4d96524ece669327d7ca29f1
|
||||
6cca787a2d0deafb82c7ba268fd567597367f959564fbcaf6b184def498a664ad2cc9137b7b38697
|
||||
93d26652336bd2cc1a8e9bdb5173bb79f024689e7c39a97932cdab9cbcfaa87911e153735fde76a0
|
||||
992f6a7814d7b344cdd31f258b0d9adcd7bcee691dcdb72e98b56ebab4661c26bd0fee9a67f2d0dc
|
||||
174d5b38dfba66a6245eeac2b42b4dc392e9cb2a6bb3f4592fa7bd6d1a16c66b6e378b2a79182d0d
|
||||
58f3ea9287a5db4d836703fc345bfae869f24ab3c9f5e649070f4daff3c9ffd3c9ab2e16c6289af2
|
||||
6c7233995c6f9e60309d352abfb84c066e743fb9954f1e289d8d7bbdbcb96751f6bb79887a44c6a3
|
||||
c7b9fbc6ed50574b6fda16b46b79f5c8c5e8a999369e80a643a3746eedcb264b0faa0728eab16e57
|
||||
9b6696a479d364c1fc8ad52e7d32535cce54d5876af6d94cd3f5bc1aa6a89ce3a99eb35eb58270d6
|
||||
f9c94384cd0c7741307d1f04e1dc0304cd2086ed034cf974b50c9bd91a5c4d8b9fe657d9fa7af6b0
|
||||
c0b3c769db76b9d63ec4842f3ee2fcf5e6d6fdcb5b7567a64bbf5b6cd6ec76d3e16cbc382659d18e
|
||||
7b339259d66e1826b7d335b7672b5916cd3656a3e62965d3b16fde30d974109b06a64d0d46b39536
|
||||
6d66ad5f5dbb419eae89e5ede9db289dcdd1aef3c1ece9a4d3b74bc3d3b07df7355bdda7f9b7ed74
|
||||
73b17ee39cb61badf9adefdca63219cd3658b3118e1f5e6ef3e27cb6e14c17deef71bb45bd6b37c8
|
||||
d1ec29c7731f5a51d65e2f799cce81d1dcb2eaad4d3af712e2e9a673ba65aa066edc6e69d2c95282
|
||||
f174b358fd587bfcf05df553adb97afff1c7eac7e2e7d9cfb8f217fafb8fdf57377ff7e1dbf73f7f
|
||||
f73cfdd9bdcbafee2d64dd8ff02d6cdd6ff22d6ced4ff42d6ee9177bd9a4b62793167df3fce5e79f
|
||||
be7af3a20dffe5dd87775fdebd7d5ffec21e7c5f3edcf33f9ebf9dce563fe8a639969eee5ffef6f6
|
||||
d3e735af646537373df652073b3c8d35f34edad2f461b2bb60d298c93e84afde0c82e6bf51f9df6f
|
||||
8341140cc274104683dffff5ab37bf9ecc34087e33f8fd87afde04833ffff1ab37a3c1ff28af4ef6
|
||||
500d16cb9fdf56f756b3d4b7174b33d37fafe6a997568a5faa5bff54fdefff7cf5260c874598a483
|
||||
3f548f1f075934f8fb576ffef7bf8d06df7df526caa2e12828ef4c926258147132f8f1ab37c9281e
|
||||
e6699c0ecaadce30ce8b7890e4f9b0188dc2419c25c3a4884783244d8759912783a88886591a2583
|
||||
b22349120fd328cb07519c0fb378940c92201a8693fd3379f5506517a2341e164134aaf68e0dcbaf
|
||||
ad131806e930c9a3a29c980d8ba8c80761308cc262348892701895d76613e27219595aa4356ba615
|
||||
a5cae362503ea93849a341f915791897730d822829975f2e242e9f661206d9e0beec429857b32583
|
||||
34c886691e4783b0bab76cd2201be5c32848a2c1cbc694f0afed60f5321ca361d9c6627e3846e1b0
|
||||
6c593048e2aacf795c0dc7f2c46cf0fb557396133f1f6f4529bf580ccba12bd780b45c5e968caa67
|
||||
f672621814c3720cb3b2df65db826a4a79573c2ae74946e9b0daf25703577eb31e26d1282bd78f72
|
||||
78cb2fb3e53847c320c8a3419ca7c33429df28d58a52ae8479f9e0a372654a836a04bef9eacd7f94
|
||||
3c2e1f2a2ac7bb5aabc2b45c3baa3645e13018956b64b56215515eae85a37278e3b85af9ca579694
|
||||
2b74752518257179251b961f7ba3ea31c3f2d1c26a0d0e8bb8ec5150ae7ce55a10a6934728d78b72
|
||||
0d1904d55d79513eabf2ae7454ae7ed57a54ad35e56a3399983563504d2c3f9dd37262318c92f285
|
||||
4f27a6513e9998951f8b9345c4650b06713c1ae6619ecf4d2957f9f2232f9a3cb7f9894196a5cd6c
|
||||
693c9912475587ab2969334f56bef229cccae75576af7aa549b9c4ea3d9624558783eacd514e09cb
|
||||
2753948f1917c1302d92a2ee46d9abbcec76f9f13fccb3aa696950bdccbc9c52be39f2f2ed15e651
|
||||
7565349d32e9c6d2c462d28d6a6251beefda89615e0e6bf9c5a6991256539261548ce27a4a9a27f5
|
||||
a395ab4d3c8a9a89e5baf8fb6662568e543db15cfbab774250aee0e5332e2726c351b9791894dfe3
|
||||
87e56babdef4e5f6208cb341b5c284615c76a35c7a946561b588f2dbca30884741b9512b57c2222a
|
||||
674babf77a5ef536abdefde5946c54c2209e0cd3288be209ac2616e51b378eca472b7fec94b395bd
|
||||
4ac2f2f1c36aeb54aee4d5f6238baa872ab780415caf30e59287595e3dc3727b1a86d5d6b36a5af9
|
||||
9226eb7f91976b7254aebdc1641b1a66d53a934c619004e5bd41b53d2b9f7ff5f879b54a47e5c63a
|
||||
a87665979d2b1b1b54bbc293f27d9c15f56b2c1f7f54d42b7c3a8aab05a5c3f29b7452bf17aa57f1
|
||||
f2dd54c21f06ff3af830b71bfcebf9cfb83fbefdfca5fa90fbf56faa6dc87f2d37126543aaadf6f2
|
||||
86a79c980d9ab7c96c6d29fe6d90e5a341512eb1d43f74d7d5966bfa08d35ab6bed9a68d96f6c697
|
||||
6fc6acfc6cf8eacd9f7f67ff128ee3388ee3388ef7c2efb37dea84df17cda4ceb55dfa5e0fd16de9
|
||||
e3e5da2e7dbc4fad973edeef21ac75388ee3388ee3388ee3388ee3388ee3387e91fc3edd54eb7420
|
||||
dd65d655b5cd26f67a887ae97b453a55ed2515da959c3715eab0f4ad918eb70c8ee3388ee3388ee3
|
||||
388ee3388ee3388e4f2ef751d7daee9f5f374bbca9d6e9c09a59a6075d5d5f674bdf3eebaa5a1f58
|
||||
e969df87b8b0a51f3315ea90491d2f15f286c5711cc7711cc7711cc7711cc7711cc72f90df075d6a
|
||||
bd87bc9974f5d984a55fcad2cf940a653617388ee3388ee3388ee3388ee3388ee378077ef7b8b94a
|
||||
072cfdb52ffd90e3d7ad4f856cac701cc7711cc7711cc7711cc7711cc76f86db3f6fe9967ea14bef
|
||||
1aedd8d6e1388ee3388ee3388ee3388ee3388e9f86db436ee9072e3d5aa8131eadbc6b457d5caeb3
|
||||
a5bfbc6b975a2ffdd1b81fb0f4cde74eb2a5c5711cc7711cc7711cc7711cc7711c970edcd4d2e370
|
||||
b6f438dca74e78dc9c5ba77b6d97bed743745afacbbca6cd659ef6a9dd52a1f54bb7ceefb5f4fba8
|
||||
9e34ad36d4388ee3388ee3388ee3388ee3388e5f03974d5cf0d2e3a4a9f1a65a6713f12eb3aeaa6d
|
||||
32b2d743d44bdf2bd2e92d15da959c3515eab0f46d918e77dc5e4b6ff31b1f13388ee3388ee3388e
|
||||
e3388ee3388ef7cfeda73dd7d2e3ac6b6df7cfaf9b25d954adf3c7e77da4421d32a9e3a542deef9d
|
||||
96ee2d83e3388ee3388ee3388ee3388ee3af9ddb537aeca5c7f93ed54a8b1f939f38155aaab6363b
|
||||
2ddd4a8be3388ee3388ee3388ee3388ee3d7c32523bdff8b95bbcdd55a87e3fb1fbf6e7d2a2405de
|
||||
e59fe058eb701cc7711cc7711cc7711cc771fcd8dcbecac3ceb1f260adc3f18be65da31ddbba9d66
|
||||
b5d6e1388ee3388ee3388ee3388ee3f8fcc5bf58d96be97781b50ec7f1177cdd39946c69372edd5a
|
||||
87e3388ee3388ee3388ee3388edf10f757dcebebf87155b5dae0387e421e67f58d699580eff24f6f
|
||||
ac75388ee3388ee3388ee3388ee3f879b9fd75a3d1f87e5a674b6f27596d701cbf11dee637f2f7d1
|
||||
ae474db3dae0388ee3388ee3388ee3388ee31df96b3ebecdf86e73b5dae0388eafbcdc6557b29d3f
|
||||
e1d2ad36388ee3388ee3388ee3388ee3787b794d7bccc67953c7abea844f27596d701cc78fcdef92
|
||||
1bfb94d963e9561b1cc7711cc7711cc7711cc7f19be3b77f24b16c5adb2389659babd506c771fc0a
|
||||
f85dbc589dddc66a83e3388ee3388ee3388ee3387e29fc96ff96789cec5aad36388ee3af8c2f4737
|
||||
6d8473259f71ce6e83e3388ee3388ee3388ee3387ed9fce68ef1328ee76b7d24b178d55d6db5dae0
|
||||
388ee33b5eeec2f93ae1d349377f761bab0d8ee3388ee3388ee3388ee378077e337fcd3b0ebbd43a
|
||||
9709ad36388ee3f8a9f85db0ba3abb8dd506c7711cc7711cc7711cc7f19be3577f9495e2456dcff0
|
||||
126cae561b1cc771fc2af878fa8706739f71b77e761be38ee3388ee3388ee3388ee3f895f3abdd6f
|
||||
533c76adb3a5174fc61dc7711cbf6d3e7edc5c6ff1ec36c61dc7711cc7711cc7711cc7f18be1577b
|
||||
9c93e27ebe4ef8e2a4edd56a83e3388ee32f2e8b394d7dacce8dd1cd159fddc6b8e3388ee3388ee3
|
||||
388ee3387e747e757b4e8abb5d6a9dcbac99c5b8e3388ee3781f7c7cbf5bbdfab3db18771cc7711c
|
||||
c7711cc7711cc73bf3eb3ad24851b447122bf6a9c61dc7711cc7cfcec777cbb53dbbcdddc9bf5d1c
|
||||
e7bb8d71c7711cc7711cc7711cc7717c740547802ff26db5cd65b6cc6adc711cc771fcfaf878bc5b
|
||||
bddab3db18771cc7711cc7711cc7711cbf497e357f535a244b35dd56db5c2635ee388ee338fe5af8
|
||||
38df54ebb3dbe497f0dde680a51b771cc7711cc7711cc7711cbf1e7ed9c7fa28a2f95a9fe1255a75
|
||||
d78a9c2631ee388ee3388eafbd8cb319afafced5a508e7eace9db7db21d1ac36388ee3388ee3388e
|
||||
e3387e347ef17b0f8a70975ae7326b6631ee388ee3388ef7cb5fe4354bf5e27399cd398d71c7711c
|
||||
c7711cc7711cc7f1def865fe5567d13ef962b44fad7319e38ee3388ee3f859f93899d6f6ec36c962
|
||||
bdcc5c66c3d28d3b8ee3388ee3388ee3388e77e1977914f4fc459d2d3d7fdaad1a771cc7711cc7af
|
||||
898fe3ddeac5e532dd0f8566dc711cc7711cc7711cc7f1d7c42febf77bfeb06b6d739935b318771c
|
||||
c7711cc76f918fc355b53ebb4d7849dfeb76cf698c3b8ee3388ee3388ee3387eb3fce28e7791dfd7
|
||||
93ba57e38ee3388ee3385e5ec6c18cd757d7d7cb3c3eed8aa51b771cc7711cc7711cc771fc5af965
|
||||
1c873c2f96ea78b6f4faeaeed5b8e3388ee3388eefca8ba7ddeac5e532bb1f02cdb8e3388ee3388e
|
||||
e3388ee3e7e197f50b3acfb6d462b6f417914d61dc711cc7711cc78fcb8bc7a5da7eaf7b19d99cf3
|
||||
5be56e874233ee388ee3388ee3388ee3f891f9651c71224fdb33bca41d6b365bfa34aa31ee388ee3
|
||||
388ee317c05f44366beac51d1d77bf43a019771cc7711cc7711cc7717cd3e5bc4702cfe3e5dae632
|
||||
71b76adc711cc7711cc7af8317f7bbd40bca65ba1d02cdb8e3388ee3388ee3388ee3f397f3fe86cd
|
||||
a36db5cd65b6cc6adc711cc7711cc76f8b1777f375c21727b5f5bcdf69b7e735c61dc7711cc7711c
|
||||
c771fcf5f2f3fe6d611e74ad6d2eb3749771c7711cc7711c7fb5bc2836d7cbc865562cddb8e3388e
|
||||
e3388ee3388edf363fefb1b8f3f6c9e7a3f949bb57e38ee3388ee3388e6fe745bead5e482ed3fd10
|
||||
68c61dc7711cc7711cc771fc92f9697f452ed76c659df06ce32c6d35ee388ee3388ee3787fbc48a7
|
||||
75c6db495dbe169ffa2f9d8c3b8ee3388ee3388ee3f865f2f3fe8acc1e77a9752eb36616e38ee338
|
||||
8ee3388e9f9417c99aba31af39d7bf409f5bba71c7711cc7711cc7711c3f033fef5117b287a63e76
|
||||
a90bb98c71c7711cc7711cc72f92afcd6b923ebf51f7f87ddec0e1388ee3388ee3388e1f8b9fe72c
|
||||
a5d9fdb4b6b9cc74d2c36ed5b8e3388ee3388ee3d7ca8b68be4ef8e2a473e732bbe734c61dc7711c
|
||||
c7711cc7717cf3e53cbfe3b2bb75b5cd65a693ee5757e38ee3388ee3388ebf025e849beb79becfaf
|
||||
cf690c1c8ee3388ee3388ee3f8e2e53c7f5f978d77ad6d2e339d7467e0701cc7711cc771bcb9145b
|
||||
ea79729915bf260c1c8ee3388ee3388ee3af9c9ff6b807bbe730cbd5c0e1388ee3388ee3f8ee33e7
|
||||
4fcb75c6f3b3e632fb9da2c6b8e3388ee3388ee3387eb5fc84e709cd8af95ae732c5aabbb6570387
|
||||
e3388ee3388ee33df1fc61733d6d2eb35b4e63e0701cc7711cc7711cbf0e7e9e5f5259beaad6b94c
|
||||
be6996b61a771cc7711cc7711c3f11cfef37d7d3fe9a589dd318381cc7711cc7711cc72f9b9ff62f
|
||||
dcb26c975ae7326b663170388ee3388ee3387e213c1fafaa133e9d74c25c66c56f190387e3388ee3
|
||||
388ee3f8d9f9698f089da5fbd43a97490d1c8ee3388ee3388e5f15cfdbe312e7cd718697a39bd3e6
|
||||
32dd4f5163dc711cc7711cc7711cef899fe04c9d6db8d2472e63e0701cc7711cc771fcfaf92c9f59
|
||||
534f9bcb6ccf690c1c8ee3388ee3388ee3fb5c4efb5b264b966b9bcb24bb550387e3388ee3388ee3
|
||||
af82e7d9e67adadf322f731a0387e3388ee3388ee37897cb69fec62c8b9a1aafab6d2eb366160387
|
||||
e3388ee3388ee3f8dc254fa775c6a7934e98cbacf82565e0701cc7711cc7711c9fbb9cf698cc59b8
|
||||
54a375b5cd65220387e3388ee3388ee3f83e3c8f57d7d3e632dd4e5163e0701cc7711cc771fc46f9
|
||||
69ce95f92287d9b91a381cc7711cc7711cc77be679b4ba9e3697d99cd318381cc7711cc7711cbf31
|
||||
7ec45f13b37f1413cc965e5fdd5097f2180387e3388ee3388ee3f8c9781eacaaa7ce6556a442060e
|
||||
c7711cc7711cc7af979fe0d7447376cda55ae732a34db3b4f98c81c3711cc7711cc771fcec3c6f79
|
||||
be30e9d4b9cc7ea7a631ee388ee3388ee3387e367e9a7f7d9f6eac13be6e160387e3388ee3388ee3
|
||||
f835f0ec69753ded993a9ffc92c2711cc7711cc7f1cbe4c73d2a72fad8a5d6b9cca381c3711cc771
|
||||
1cc771fc7678f6b8ba9e2697d99ed318381cc7711cc7711c3f2aeff1fbfc865ca65b1eb390cb1838
|
||||
1cc7711cc7711cc76f99bfcc694e99cbbccc690c1c8ee3388ee3388e1f851ff1fb7cfa30ad6d2ef3
|
||||
b05b3570388ee3388ee3388ebf723e97cbacff2735bdff8e5bf1f775060ec7711cc7711cc7fbe047
|
||||
fc3babf47eb9b6b9ccfde66ae0701cc7711cc7711cc79779f6b0ba9e2697e97e6a1a0387e3388ee3
|
||||
388ebf7a7edce312a777db6a9bcb2cdd65e0701cc7711cc7711cc7bbf2ec7e753d4d2eb35b4e63e0
|
||||
701cc7711cc7f157c98f7bbec874bc6b6d7399b181c3711cc7711cc7711cef976777abeaa97299d5
|
||||
f98c81c3711cc7711cc75f15efe11bf5865c66f73c665a0d1c8ee3388ee3388ee3f8c978369ef16c
|
||||
3c3fe9a8b9cc8a5f91060ec7711cc7711cbf757e846fd4693e5b7a5a349376ac060ec7711cc7711c
|
||||
c771fc3278f77ce618475d3070388ee3388ee3f8b5f323fea5539acdd73a97c99b495baa81c3711c
|
||||
c7711cc7711cbf6c9e158bf534b9cceef98c81c3711cc7711cc72f8b1ff1c8c069baaad6b9cc4254
|
||||
d3560387e3388ee3388ee3387e9d3ccb57d7e3e632db731a0387e3388ee3388e5f063fe2191b57e7
|
||||
318bb9ccd25d060ec7711cc7711cc771fcb678964deb8c4f271d31977999cf18381cc7711cc771fc
|
||||
8cfc80efb41b729934e9521772190387e3388ee3388ee338fe6a78962ed623e6322b7ec31a381cc7
|
||||
711cc771fc74fc38df69d3b85b3570388ee3388ee3388ee3787bd92da739d6311f0c1c8ee3388ee3
|
||||
38de3f3fc277da346a739968b76ae0701cc7711cc7711cc7f1f597e57c6631a739f6b1b80d1c8ee3
|
||||
388ee338be3f3fe2bf014fc3696d739970733570388ee3388ee3388ee378779e25f3f5d8b9cce69c
|
||||
c6c0e1388ee3388ee3abf811ce99b83e74d99acb18381cc7711cc7711cc771bc579e3507c89ed623
|
||||
e6328bf98c81c3711cc7711cc7e7f97e7f30b4319749836db5cd65020387e3388ee3388ee3388e9f
|
||||
9067d1623d622eb3e217b481c3711cc7711c7f9dbcdf6f95b33c66b46b3570388ee3388ee3388ee3
|
||||
f865f02c5cacc7cd65bae733060ec7711cc771fc9af971be55261dab81c3711cc7711cc7711cc72f
|
||||
8dafcf678e79c489ed398d81c3711cc7711cbf467e9cbff6491eeb49bb560387e3388ee3388ee338
|
||||
8e5f0bcf82693d452eb33e9f3170388ee3388ee3d7c48f7074dc3a64d929973170388ee3388ee338
|
||||
8ee3f80df16ceb8fed55b5532ef3329fd1791cc7711cc7f16be047386b61f2305feb5ce661d55d06
|
||||
0ec7711cc7711cc7711cbf699e3e2dd623e4322b7ebfeb3c8ee3388ee3f805f23dbed7adcd61ee37
|
||||
d53a9759bacbc0e1388ee3388ee3388ee3af90a78f8bf538b9ccf653d118381cc7711cc7f193f11e
|
||||
bed7cdf298bb5d6a9dcbdce93c8ee3388ee3388ee3388e3797d5f94cdfb9ccf653d218381cc7711c
|
||||
c7f1a3f11ebfd725e32ed5c0e1388ee3388ee3388ee3f8e64bfa708cdfefddf2190387e3388ee338
|
||||
7e38eff7ef6d9262a96ec9650c1c8ee3388ee3388ee3388e77e4697346d6693d422eb33a9f317038
|
||||
8ee3388ee3fbf31e8f4f9be46d2e932fd5a59c46e7711cc7711cc7711cc771bc679edeeffa3bbe73
|
||||
2eb362ef81cee3388ee3388e77e21bbe5975ce63b2696d73996ca9e63a8fe3388ee3388ee3388ee3
|
||||
27e1e9dd623d4e2eb3dba9680c1c8ee3388ee3af9e77f866b5358f49976b9bcb2cdda5f3388ee338
|
||||
8ee3388ee3387e269e8e977fd7f799cbec764a1a0387e3388ee3f8abe33d7cb39ae531c9badae632
|
||||
89cee3388ee3388ee3388ee3f845f1693e938e8f99cb6ccf670c1c8ee3388ee337cd7bfc66b53e8f
|
||||
99569dc7711cc7711cc7711cc7f12be269d1fbde83edf98ccee3388ee3387e93bcc7bf7849e2ddaa
|
||||
cee3388ee3388ee3388ee3f855f2343f78efc1eef98ccee3388ee3387e3bbcdf23c426d16e55e771
|
||||
1cc7711cc7711cc771fc26789a2dd61e73991567b7d1791cc7711cc7af96f77be6be24ac276dab3a
|
||||
8fe3388ee3388ee3388ee337cdd374edde831e7299eda7a23170388ee3388e5f18dfe1bbcdae3509
|
||||
664bafafaeaf3a8fe3388ee3388ee3388ee3af8a2fe6337de732ddf2190387e3388ee3f819f96973
|
||||
199dc7711cc7711cc7711cc7f157cdd364c6ebabbde632bbe534060ec7711cc7f133f01ebedbccf2
|
||||
98d17cad7399d1e25d3a8fe3388ee3388ee3388ee3f86a9ec6dd7644ecb1ef42e7711cc7711c3f1b
|
||||
eff1bb4dbcb24e78fca4f3388ee3388ee3388ee3388e77e169d4fbbe8bd5f98ccee3388ee3387e02
|
||||
dee3df9cc48f9baacee3388ee3388ee3388ee3387e004fc3a6467befbbd85c751ec7711cc7f123f2
|
||||
1e8fd11a3f6cae3a8fe3388ee3388ee3388ee378ef7c9ad3f49bcb3c39d6078ee3388ee3bdf2fdbe
|
||||
98acfc6eb35b1ea3f3388ee3388ee3388ee3388e1f91b7f94c9fb9cce653d1e83c8ee3388ee31b2f
|
||||
3b7cbbe890cbc4f79babcee3388ee3388ee3388ee3387e729e06c7cc65b6e733060ec7711cc7f1d9
|
||||
a5875c26be6b7399bbd555e7711cc7711cc7711cc7711cbf249e8ebaecfee8b4e744e7711cc7711c
|
||||
5f7139e0dbc58b5c66dce632e3c5aaf3388ee3388ee3388ee3388e5f324ffacf655ee6333a8fe338
|
||||
8ee3af98f7f8ed222ea6b5cd650a9dc7711cc7711cc7711cc771fcfa78f2d8fb9e93369fd1791cc7
|
||||
711c7f85bcc7bffa88f3a6ca65701cc7711cc7711cc7711cbf2dbe3a9fe9ebccbcdb4f4563e0701c
|
||||
c771fc56780fb94c9c2dd5693e93eb3c8ee3388ee3388ee3388ee337c98f93cb74cb670c1c8ee338
|
||||
8e5f13efe1ec7571baa6663a8fe3388ee3388ee3388ee3f86be1c97d979d2d3be532bbe533060ec7
|
||||
711cc7af8177fb8ab032978993cd55e7711cc7711cc7711cc7711c7f7d3cb9ebbaf3656b2eb3399f
|
||||
d1791cc7711cbf64bedf3fa9ed94cbe83c8ee3388ee3388ee3388ee37832de75e74be7fd363a8fe3
|
||||
388ee317cef7f87cdf90cbc4f1eaaaf3388ee3388ee3388ee3388ee3cb97edf9ccdefb6d741ec771
|
||||
1cc72f94f793cbc4513d69b9ea3c8ee3388ee3388ee3388ee3f8b64b52acdbf9d2c77e1b9dc7711c
|
||||
c7f14be03d7cbec7e16ce9f5d59755e7711cc7711cc7711cc7711cc7bb5efacd65369f8246e7711c
|
||||
c771fcb8bcc7bfbb8883d9d2ebab6dd5791cc7711cc7711cc7711cc7f14379921de3bcc03a8fe338
|
||||
8ee35796cb2c86300bb98ccee3388ee3388ee3388ee3388e1f8127695d7bc86576cf69741ec7711c
|
||||
c7f7e73d9c3f2e1eadaa3a8fe3388ee3388ee3388ee3387e2ade2d9fd92997599fcfe83c8ee3388e
|
||||
77e7db3f79b7e632d19aaaf3388ee3388ee3388ee3388ee3e7e14952d71e739997f98ccee3388ee3
|
||||
f8ee7cf74fdcedb9cce3eaaaf3388ee3388ee3388ee3388ee3e7e59bf399bd7299369fd1791cc771
|
||||
1cdf9df790cb440fababcee3388ee3388ee3388ee3388e5f164f9a03cff798cbcced35d2791cc771
|
||||
1c5fcb0ff884ed96c7e83c8ee3388ee3388ee3388ee3f8a5f124aa6bbfb9ccfa53d0e83c8ee338fe
|
||||
6a798f9fb0d1fd62d5791cc7711cc7711cc7711cc7f1abe53dee35ea96cf18381cc771dc27ece64f
|
||||
d8e86eb1ea3c8ee3388ee3388ee3388ee3b8a3ac6c3a058dcee3388ee3af8bf7f02f52a3719bcb8c
|
||||
17abcee3388ee3388ee3388ee3388e3b2bf1f659751ec7711cbf75dee319dca2a2cd650a9dc7711c
|
||||
c7711cc7711cc7711c7f25bcc75c66753ea3f3388ee3f8edf01e729969083397cbe83c8ee3388ee3
|
||||
388ee3388ee3f8abe33de6328bf98ccee3388ee3d7cf577fd675ca65a27cb9ea3c8ee3388ee3388e
|
||||
e3388ee338de632e33b7cf4ae7711cc7f1abe67de432d962d5791cc7711cc7711cc7711cc771bcbd
|
||||
f49bcb6c3e058dcee3388ee317ca3b7cc6adcd63d2c5aaf3388ee3388ee3388ee3388ee3f8fa4bbf
|
||||
b94cf77cc6c0e1388ee367e0077cc6cdf2986475d5791cc7711cc7711cc7711cc7717c27de632eb3
|
||||
7b3ea3f3388ee3f819f81172199dc7711cc7711cc7711cc7711cc7f7e23de632dbf3199dc7711cc7
|
||||
afeb332e8a17abcee3388ee3388ee3388ee3388ee3bd70b90c8ee3382e9769f39868b1ea3c8ee338
|
||||
8ee3388ee3388ee3387e14de432eb33e9fd1791cc771fc04bc87637546e162d5791cc7711cc7711c
|
||||
c7711cc771fca8bc875ce6653ea3f3388ee3f8b1f8d3531fb94c14d493a655e7711cc7711cc7711c
|
||||
c7711cc7f193f21e7299369fd1791cc771fc58bca75ca67934b90c8ee3388ee3388ee3388ee3387e
|
||||
56de432e33b7c74ce7711cc7f19ef88a4f99ae1f5061fb19173ee93c8ee3388ee3388ee3388ee338
|
||||
7e013cce66bc875ce6e949e7711cc7f15e781fb9cca3cee3388ee3388ee3388ee3388ee317cbe3b4
|
||||
bed1432ed32d9f3170388ee3f8ecd2e153666d1ef3305f751ec7711cc7711cc7711cc7711cbf681e
|
||||
2775ed2197d92d9fd1791cc7717c7639209759cc63741ec7711cc7711cc7711cc7711cbf2abe7b3e
|
||||
b3f31e339dc7711cc7d75c7af89409ef751ec7711cc7711cc7711cc7711cbf7a1ec775ed618fd9ea
|
||||
7c46e7711cc7f1433e65c2bbc5aaf3388ee3388ee3388ee3388ee3f80df038aaab5c06c7711cef8f
|
||||
f7f0af32c3b1cee3388ee3388ee3388ee3388ee337cb7bc86516f3199dc7711c7fc5fc805c262c16
|
||||
abcee3388ee3388ee3388ee3388ee337cc7bc865eaaaf3388ee3af90effe51b13597d1791cc7711c
|
||||
c7711cc7711cc771fc15f17e7299d58738d3791cc7f15be507e43261be58751ec7711cc7711cc771
|
||||
1cc7711c7f453c1ef599cb74cf670c1c8ee3f835f1ee1f152f73994ce7711cc7711cc7711cc7711c
|
||||
c7717c348afacb6576cf67741ec771fc9af801b94c98ea3c8ee3388ee3388ee3388ee3388ebfe4d1
|
||||
635de532388ee3f896ed7c975c26d1791cc7711cc7711cc7711cc7711c5fcfa387ba1e90cb6ccf67
|
||||
741ec771fc1af8beb94c98e83c8ee3388ee3388ee3388ee3388e77e23de432ebf3199dc7711cbf58
|
||||
bec776fe452e13eb3c8ee3388ee3388ee3388ee3388eefc57bc8655ee6333a8fe3387eb1fc80ed7c
|
||||
18e93c8ee3388ee3388ee3388ee3388e1fc4a3bbbaf690cbb4f98ccee3388e5f1cef613b1f863a8f
|
||||
e3388ee3388ee3388ee3388ee3bdf0685c57b90c8ee3f86df203729930d0791cc7711cc7711cc771
|
||||
1cc7711c3f0a8f8a19df3797797ad2791cc7f18be13d1caf522e83e3388ee3388ee3388ee3388ee3
|
||||
c7e73de4322f4f3da3f3388ee3a7e507e432a1cee3388ee3388ee3388ee3388ee3f8c9790fb94cb7
|
||||
7c46e7711cc70fe79b37d63be532c193cee3388ee3388ee3388ee3388ee3f8a97994d5552e83e338
|
||||
7e45fc805c2678d4791cc7711cc7711cc7711cc7711c3f378fd2ba1e90cbec96cfe83c8ee3f8e1fc
|
||||
905ce641e7711cc7711cc7711cc7711cc771fc52780fb9cce67c46e7711cc7f7e7bbfde3c68db98c
|
||||
cee3388ee3388ee3388ee3388ee3f8e571b90c8ee3f805f2037299e05ee7711cc7711cc7711cc771
|
||||
1cc771fc527994d4f5805c66753ea3f3388ee3ddf9ee27019bf117b9cc9dcee3388ee3388ee3388e
|
||||
e3388ee3f8a5f328aeeb01b9cc623ea3f3388ee3ddf901b94c30d6791cc7711cc7711cc7711cc771
|
||||
1cbf36de432e33b7b750e7711cc73bf143729942e7711cc7711cc7711cc7711cc771fc5ab95c06c7
|
||||
71fc84fc802dede6937de93c8ee3388ee3388ee3388ee3388e5f038f027b0b711cc74fc60fd8d206
|
||||
b9cee3388ee3388ee3388ee3388ee3f80df11e7299eef98ccee3387efbdcbf4cc4711cc7711cc771
|
||||
1cc7711cc7717c2d97cbe0388ef7ca0fc8658254e7711cc7711cc7711cc7711cc771fcb67978782e
|
||||
b37b3ea3f3388edf3e3f249749741ec7711cc7711cc7711cc7711cc75f070f1feb7a402eb33d9fd1
|
||||
791cc76f97b7dbc2bd73199dc7711cc7711cc7711cc7711cc7f1d7c6e532388ee3a7ce658258e771
|
||||
1cc7711cc7711cc7711cc771fc75f2f0a1ae07e432ebf3199dc771fc76f901b98ccee3388ee3388e
|
||||
e3388ee3388ee3f86be7e17d5d0fc8655eee70d4791cc76f8fbfdcf6c965701cc7711cc7711cc771
|
||||
1cc7711cdf93cb65701cc73b6c263be53241a0f3388ee3388ee3388ee3388ee3388ecf5fc2715d0f
|
||||
c865da7c46e7711cbf3d7e402ea3f3388ee3388ee3388ee3388ee3388eafbec865701cc7376c1ee5
|
||||
32388ee3388ee3388ee3388ee3388e1f87ef9bcbccedabd4791cc7af9eefb0ad5b9bc73cea3c8ee3
|
||||
388ee3388ee3388ee3388ee33bf230af6f1c90cb6cfe5b719dc771fcc673199dc7711cc7711cc771
|
||||
1cc7711cc771bc2b97cbe038fe9ab95c06c7711cc7711cc7711cc7711cc7f153f230adeb01b94cb7
|
||||
7c46e7711cbf047ebfadb6fc7e9f6d9ecee3388ee3388ee3388ee3388ee338be81cb65701c7f55fc
|
||||
6e5b6df9f25d3a8fe3388ee3388ee3388ee3388ee3785ffc805cc6df90e3387e3d7cbcadb67cf92e
|
||||
9dc7711cc7711cc7711cc7711cc771bc2f1ec67595cbe0387ed3bcd8565bbe7c97cee3388ee3388e
|
||||
e3388ee3388ee338de373f2097d99ccfe83c8ee3e7e4c5aef5652ea3f3388ee3388ee3388ee3388e
|
||||
e3388e1f8b87615d0fc86556e7333a8fe3f83979be6b6d79ae75388ee3388ee3388ee3388ee3388e
|
||||
9f88cb65701cbf299eed5a5b9e691d8ee3388ee3388ee3388ee3388ee327e607e4328bf98ccee338
|
||||
7e0e9e76ad5a87e3388ee3388ee3388ee3388ee3f8f9b85c06c7f1abe649d7aa75388ee3388ee338
|
||||
8ee3388ee3388e9f9f1f90cbd455e7711c3f0797cbe0388ee3388ee3388ee3388ee3387e853c90cb
|
||||
e0387e8d3cee5ab50ec7711cc7711cc7711cc7711cc7f18be207e4328b8736d3791cc78fc6a3e656
|
||||
d7aa75388ee3388ee3388ee3388ee3388e5f160f1eea2a97c171fc7279d8dcea5ab50ec7711cc771
|
||||
1cc7711cc7711cc7f1cbe407e432ddf3199dc771bc130f9a5b5dabd6e1388ee3388ee3388ee3388e
|
||||
e3387e993cb8afab5c06c7711cc7711cc7711cc7711cc7711cc771fc34fc805c66f77c46e7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc747c1b8ae72191cc7711cc7711cc7711cc7711cc7711cc7f1d3
|
||||
f0037299edf98ccee3388ee3388ee3388ee3388ee3388ee3388ecf2e415157b90c8ee3388ee3388e
|
||||
e3388ee3388ee3388ee3f869f801b9ccfa7c46e7711cc7711cc7711cc7711cc7711cc7711cc75f5c
|
||||
f6c865826cb1ea3c8ee3388ee3388ee3388ee3388ee3388ee37887cb865c264837579dc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cef700992f93ae18b93b6579dc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cef7091cbe0388ee3388ee3388ee3388ee3388ee3388e9f8607f18cd757bb579dc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cefc683a8bed1b56a1d8ee3388ee3388ee3388ee3388ee3388ee378
|
||||
371e84f58dee55e7711cc7711cc7711cc7711cc7711cc7711cc7f7e141d0b56a1d8ee3388ee3388e
|
||||
e3388ee3388ee3388ee3f83e5c2e83e3388ee3388ee3388ee3388ee3388ee3387e1a1e74ae331ee8
|
||||
3c8ee3388ee3388ee3388ee3388ee3388ee3f81efc69d7daf227adc3711cc7711cc7711cc7711cc7
|
||||
711cc7711cefce1f77ad2d5fbe4be7711cc7711cc7711cc7711cc7711cc7711cc73bf0876db5e5cb
|
||||
77e93c8ee3388ee3388ee3388ee3388ee3388ee378072e97c1711cc7711cc7711cc7711cc7711cc7
|
||||
711c3f2dbf5f575bbe6e169dc7711cc7711cc7711cc7711cc7711cc7711cefc0efd6d596af9b45e7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc73bf0f1badaf2f196aaf3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee31de62e966bcb8b2d55e7711cc7711cc7711cc7711cc7711cc7711cc73bcc2d97c171
|
||||
1cc7711cc7711cc7711cc7711cc7711c3f0dcf976bcbf32db5d0791cc7711cc7711cc7711cc7711c
|
||||
c7711cc7f1ee976c5a5b9e6da9b9d6e1388ee3388ee3388ee3388ee3388ee3388e77bfa4d3daf274
|
||||
4bcdb40ec7711cc7711cc7711cc7711cc7711cc7717cff4bd2f2644b5dce69741ec7711cc7711cc7
|
||||
711cc7711cc7711cc771bcc3a5432eb35c751ec7711cc7711cc7711cc7711cc7711cc771bcc3256e
|
||||
79bca5ca65701cc7711cc7711cc7711cc7711cc7711cc7fbe1d196ba32afd13a1cc7711cc7711cc7
|
||||
711cc7711cc7711cc7f1ce3cdc5257e6355a87e3388ee3388ee3388ee3388ee3388ee338de99075b
|
||||
eacabc46eb701cc7711cc7711cc7711cc7711cc7711cc77be72bf39a9a075a87e3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee338
|
||||
8ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388e
|
||||
e3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3388ee3
|
||||
388ee3388ee3388ee3388ee3388ee3388ee3388ee3ffbfbdbb696de38ac200bc17e83f68d3652814
|
||||
da7dfa116208fda28beecc341994806219494deb7fdf51a16ddc48a31979a4b967cee38d88adc727
|
||||
e89e49162fe71e1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc771
|
||||
1cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711c
|
||||
c7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7
|
||||
711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7711cc7f150fcc58bc7af
|
||||
3e3a1cc7711cc7711cc7711cc7711cc7711cc7f1cbf0ffe732c75e7d74388ee3388ee3388ee3388e
|
||||
e3388ee3388ee34fe35d7399c7af7ff37e23363e791cc7711cc7711cc7711cc7711cc7711cc793f3
|
||||
0172997ea3363e791cc7711cc7711cc7711cc7711cc7711cc793f22be4329fbefae4711cc7711cc7
|
||||
711cc7711cc7711cc7711c4fc8c7cd65ba8fd838381cc7711cc7711cc7711cc7711cc7711cc7a3f3
|
||||
327399f6bcc6c1e1388ee3388ee3388ee3388ee3388ee3383e055e762ed3a1ba73c7711cc7711cc7
|
||||
711cc7711cc7711cc7713c380f93cb9cce6b9c3b8ee3388ee3388ee3388ee3388ee3388ee351798c
|
||||
5ca6a5ba73c7711cc7711cc7711cc7711cc7711cc7713c380f93cbf4bb12cdb9e3388ee3388ee338
|
||||
8ee3388ee3388ee3381e8687c9653a5477ee388ee3388ee3388ee3388ee3388ee3388e07e5e17299
|
||||
7ea336ce1dc7711cc7711cc7711cc7711cc7711cc7f1303c4c2e733caf71ee388ee3388ee3388ee3
|
||||
388ee3388ee3388e47e73172990ed59d3b8ee3388ee3388ee3388ee3388ee3388ee34179b85ca63d
|
||||
af71ee388ee3388ee3388ee3388ee3388ee3388e47e4b1729996eace1dc7711cc7711cc7711cc771
|
||||
1cc7711cc7f1e03c4c2ed36dd4c6b9e3388ee3388ee3388ee3388ee3388ee3381e91c7ca655aaa3b
|
||||
771cc7711cc7711cc7711cc7711cc7711cc783f270b94cf7511be78ee3388ee3388ee3388ee3388e
|
||||
e3388ee378281e2e9769a9eedc711cc7711cc7711cc7711cc7711cc7711c0fcac3e532fd466d9c3b
|
||||
8ee3388ee3388ee3388ee3388ee3388ee36178b85ca6a5ba73c7711cc7711cc7711cc7711cc7711c
|
||||
c7713c280f97cbf41fb571ee388ee3388ee3388ee3388ee3388ee3388e17cdc3e6322dd59d3b8ee3
|
||||
388ee3388ee3388ee3388ee3388ee34179b85ce6bc511be78ee3388ee3388ee3388ee3388ee3388e
|
||||
e378b13c6c2e63bb0d8ee3388ee3388ee3388ee3388ee3388ee3d3e3617399fea336ce1dc7711cc7
|
||||
711cc7711cc7711cc7711cc7f12279d85cc6761b1cc7711cc7711cc7711cc7711cc7711cc7a7c7c3
|
||||
e632b6dbe0388ee3388ee3388ee3388ee3388ee3383e111e3e97399ed738771cc7711cc7711cc771
|
||||
1cc7711cc7711cc7a3f198b98ced36388ee3388ee3388ee3388ee3388ee3388e4f8fdb6ea36d701c
|
||||
c7711cc7711cc7711cc7711cc7711c1f974f2197396fd446dbe0388ee3388ee3388ee3388ee3388e
|
||||
e3385e1cb7dd46dbe0388ee3388ee3388ee3388ee3388ee3383e2e0f9fcbd86e83e3388ee3388ee3
|
||||
388ee3388ee3388ee3f87478f85cc6761b1cc7711cc7711cc7711cc7711cc7711cc727c2a7bcdde6
|
||||
f4c88db6c1711cc7711cc7711cc7711cc7711cc771bc283ed9ed361f5577ee388ee3388ee3388ee3
|
||||
388ee3388ee3388e97cc336cb7691fb9d136388ee3388ee3388ee3388ee3388ee3388e17c3336cb7
|
||||
397d5b9ab6c1711cc7711cc7711cc7711cc7711cc7717c7c9e61bbcdf1dc46dbe0388ee3388ee338
|
||||
8ee3388ee3388ee3385e14cfb0dde6bc911b6d83e3388ee3388ee3388ee3388ee3388ee3f8d5f9e4
|
||||
b7db1cce6db40d8ee3388ee3388ee3388ee3388ee3388ee3c5f04cdb6dfa8fdc681b1cc7711cc771
|
||||
1cc7711cc7711cc7711cc7afc7336db7f934b7d136388ee3388ee3388ee3388ee3388ee3388e17c5
|
||||
336db7e93772a36d701cc7711cc7711cc7711cc7711cc7711cbf3a4fb3dde6716ea36d701cc7711c
|
||||
c7711cc7711cc7711cc7711c2f8e67da6ed37de446dbe0388ee3388ee3388ee3388ee3388ee3383e
|
||||
0a4fb3dde640756d83e3388ee3388ee3388ee3388ee3388ee378493cd3769b6ea337da06c7711cc7
|
||||
711cc7711cc7711cc7711cc7f1d1789aed3607aa6b1b1cc7711cc7711cc7711cc7711cc7711cc74b
|
||||
e419b6db9c1ebdd136388ee3388ee3388ee3388ee3388ee3388e17c1336db7e9766b9ab6c1711cc7
|
||||
711cc7711cc7711cc7711cc7717c1c9e69bbcde1dc46dbe0388ee3388ee3388ee3388ee3388ee338
|
||||
5e0ccfb4dde6f4ad69da06c7711cc7711cc7711cc7711cc7711cc7f1f178c6ed3607aa6b1b1cc771
|
||||
1cc7711cc7711cc7711cc7711cc74be299b6db741bbdd136388ee3388ee3388ee3388ee3388ee338
|
||||
8e8fc6d36cb769a9ae6d701cc7711cc7711cc7711cc7711cc7711c2f8167dc6e737cf446dbe0388e
|
||||
e3388ee3388ee3388ee3388ee3385e04cfb4dda6dfed69da06c7711cc7711cc7711cc7711cc7711c
|
||||
c7f1ebf28cdb6d5aaa6b1b1cc7711cc7711cc7711cc7711cc7711cc74be099b6db741fbdd136388e
|
||||
e3388ee3388ee3388ee3388ee3388e8fc2d36db7e9505ddbe0388ee3388ee3388ee3388ee3388ee3
|
||||
383e26cfb8ddc62d6a388ee3388ee3388ee3388ee3388ee3388e17ca33e6326e51c3711cc7711cc7
|
||||
711cc7711cc7711cc771bc649e3197718b1a8ee3388ee3388ee3388ee3388ee3388ee385f2ccb98c
|
||||
5bd4701cc7711cc7711cc7711cc7711cc7711c2f9467ce65dca286e3388ee3388ee3388ee3388ee3
|
||||
388ee378893c732ee316351cc7711cc7711cc7711cc7711cc7711cc70be56e51738b1a8ee3388ee3
|
||||
388ee3388ee3388ee3388ee3c571b7a8b9450dc7711cc7711cc7711cc7711cc7711cc7f1b2b85bd4
|
||||
dca286e3388ee3388ee3388ee3388ee3388ee378315c2e7356755d87e3388ee3388ee3388ee3388e
|
||||
e3388ee3f825b95ce69cdbd4741d8ee3388ee3388ee3388ee3388ee3388ee397e77299b3aaeb3a1c
|
||||
c7711cc7711cc7711cc7711cc7711cc72fc9e5326755d775388ee3388ee3388ee3388ee3388ee338
|
||||
8e5f92cb659e545dd7e1388ee3388ee3388ee3388ee3388ee3383e3897cb0c555dd7e1388ee3388e
|
||||
e3388ee3388ee3388ee3383e1897cb0c5a5dd7e1388ee3388ee3388ee3388ee3388ee3383e2497cb
|
||||
0c525dd7e1388ee3388ee3388ee3388ee3388ee3383e1897cb0c5d5dd7e1388ee3388ee3388ee338
|
||||
8ee3388ee3383e1897cb5caabaaec3711cc7711cc7711cc7711cc7711cc771fc6c2e97b974755d87
|
||||
e3388ee3388ee3388ee3388ee3388ee3f8d95c2e73d1eaba0ec7711cc7711cc7711cc7711cc7711c
|
||||
c7f1a770b9cc55aaeb3a1cc7711cc7711cc7711cc7711cc7711cc77b7fc965ae555dd7e1388ee338
|
||||
8ee3388ee3388ee3388ee338de9bcb65ae5d5dd7e1388ee3388ee3388ee3388ee3388ee338de99cb
|
||||
65ae5d5dd7e1388ee3388ee3388ee3388ee3388ee338de99cb65c6aaae69711cc7711cc7711cc771
|
||||
1cc7711cc7711c3fc9e5326357d7b4388ee3388ee3388ee3388ee3388ee3388e1ffe92cb98d6c171
|
||||
1cc7711cc7711cc7711cc7711cc771bc782e9731ad83e3388ee3388ee3388ee3388ee3388ee378b1
|
||||
5c2e635a07c7711cc7711cc7711cc7711cc7711cc7f1e2b95cc6b40e8ee3388ee3388ee3388ee338
|
||||
8ee3388ee3c573b98c691d1cc7711cc7711cc7711cc7711cc7711cc78be77299c0d5f53c8ee3388e
|
||||
e3388ee3388ee3388ee3388e67e192910954d7f3388ee3388ee3388ee3388ee3388ee3383e752e19
|
||||
9960753d8fe3388ee3388ee3388ee3388ee3388ee353e3929104d5f53c8ee3388ee3388ee3388ee3
|
||||
388ee3388e4f854b467256f7c8e0388ee3388ee3388ee3388ee3388ee378482e19c95ddd2383e338
|
||||
8ee3388ee3388ee3388ee3388ee3a1b86444f543af1e191cc7711cc7711cc7711cc7711cc7711c2f
|
||||
924b4654ef59dd1387e3388ee3388ee3388ee3388ee3388ee3e373c988ea4facee89c3711cc7711c
|
||||
c7711cc7711cc7711cc7f1eb73c988ea36fbe0388ee3388ee3388ee3388ee3388ee378442e9b507d
|
||||
fcea1e581cc7711cc7711cc7711cc7711cc7711cefc96513aa87aaee79c7711cc7711cc7711cc771
|
||||
1cc7711cc7f18fbf6413aa4fbdbae71dc7711cc7711cc7711cc7711cc7711ccfc1a503aaabdefeea
|
||||
9f0b1cc7f144fcb3efeede7c5bedaaf9ecd797cd1f9fdf7c79db7ce7e76abbab37f3d9f7f3d94ff3
|
||||
d9abaffffbc9abeaa1de3c7bb6973f56cbfa974df56eb57fe7725b7da817d5dddd7a57edeafbe647
|
||||
8be5a6deeed69b7ab17dbbfe63ff9d3dfa173c7fb3feadbebd59ad7edfee3655f3bedba6c2e2f3a6
|
||||
ecfb7777cdaf582cebdda2feb37efdcf5bbf59afd69b9bf7cdef69def955db3b770ff7ebe5a6ba7f
|
||||
fb70ea77bedeffd5dadeb0aa3fd4ab2f8eff9ae6f3fba1f9cf7a3efb0b7c5a3962>
|
||||
endstream
|
||||
endobj
|
||||
5 0 obj
|
||||
<<
|
||||
/Filter [/ASCII85Decode /FlateDecode ]
|
||||
/Length 34
|
||||
>>
|
||||
stream
|
||||
GhOt'1B7FZ"#S^CKb'rAF*Y:rk'%+Q~>
|
||||
endstream
|
||||
endobj
|
||||
2 0 obj
|
||||
<<
|
||||
/Type /Pages
|
||||
/Kids [4 0 R]
|
||||
/Count 1
|
||||
>>
|
||||
endobj
|
||||
1 0 obj
|
||||
<<
|
||||
/Type /Catalog
|
||||
/Pages 2 0 R
|
||||
/OCProperties<< /D<< /Order[]/ON[]/OFF[]/RBGroups[]>>/OCGs[]>>
|
||||
>>
|
||||
endobj
|
||||
3 0 obj
|
||||
<<
|
||||
/CreationDate <feff0044003a00320030003100330030003700300036003100330032003400330038005a>
|
||||
/ModDate <feff0044003a00320030003100330030003700300036003100330032003400330038005a>
|
||||
/Producer <feff0043006f00720065006c002000500044004600200045006e00670069006e0065002000560065007200730069006f006e002000310034002e0030002e0030002e003500360037>
|
||||
/Creator <feff0043006f00720065006c0044005200410057>
|
||||
/Title <feff00660061007600690063006f006e002e006300640072>
|
||||
>>
|
||||
endobj
|
||||
xref
|
||||
0 9
|
||||
0000000000 65535 f
|
||||
0000053966 00000 n
|
||||
0000053902 00000 n
|
||||
0000054085 00000 n
|
||||
0000000010 00000 n
|
||||
0000053772 00000 n
|
||||
0000000291 00000 n
|
||||
0000000331 00000 n
|
||||
0000000467 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Size 9
|
||||
/Root 1 0 R
|
||||
/Info 3 0 R
|
||||
/ID [<9d32286e24df501f4a2e9b23eeae29ff><9d32286e24df501f4a2e9b23eeae29ff>]
|
||||
>>
|
||||
startxref
|
||||
54555
|
||||
%%EOF
|
||||
BIN
img/favicon/favicon.cdr
Normal file
BIN
img/favicon/favicon.eps
Normal file
BIN
img/favicon/favicon.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
|
@ -12,9 +12,9 @@
|
|||
"show_keys_panel" : true,
|
||||
"server" : true,
|
||||
"socket" : true,
|
||||
"port" : 80,
|
||||
"sslPort" : 443,
|
||||
"port" : 8000,
|
||||
"sslPort" : 4430,
|
||||
"ip" : null,
|
||||
"ssl" : false,
|
||||
"rest" : true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
[
|
||||
"editor/_codemirror",
|
||||
"edit",
|
||||
"menu",
|
||||
"viewer",
|
||||
"terminal", {
|
||||
"view",
|
||||
"help",
|
||||
"console", {
|
||||
"name": "storage",
|
||||
"data": [{
|
||||
"name": "DropBox",
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
Cloud Commander Libraries
|
||||
===============
|
||||
**Cloud Commander Libraries** - dir thet contains scripts, thet uses
|
||||
on client and server side, and modules, wich is not necessary
|
||||
for CloudCommander work, but they adds some sugor.
|
||||
246
lib/client.js
|
|
@ -1,53 +1,21 @@
|
|||
/* Функция которая возвратит обьект CloudCommander
|
||||
/* Функция которая возвратит обьект CloudCmd
|
||||
* @CloudFunc - обьект содержащий общий функционал
|
||||
* клиентский и серверный
|
||||
*/
|
||||
var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
||||
var Util, DOM, CloudFunc, CloudCmd;
|
||||
|
||||
(function(Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var Config, Modules, FileTemplate, PathTemplate;
|
||||
var Key, Config, Modules, FileTemplate, PathTemplate,
|
||||
Events = DOM.Events,
|
||||
Cache = DOM.Cache;
|
||||
|
||||
/* Клиентский обьект, содержащий функциональную часть*/
|
||||
var CloudCmd = {
|
||||
/* Конструктор CloudClient, который выполняет
|
||||
* весь функционал по инициализации
|
||||
*/
|
||||
init : null, /* start initialization */
|
||||
|
||||
KeyBinding : null, /* обьект обработки нажатий клавишь */
|
||||
KeysPanel : null, /* panel with key buttons f1-f8 */
|
||||
Editor : null, /* function loads and shows editor */
|
||||
Storage : null, /* function loads storage */
|
||||
Viewer : null, /* function loads and shows viewer */
|
||||
Terminal : null, /* function loads and shows terminal*/
|
||||
Menu : null, /* function loads and shows menu */
|
||||
GoogleAnalytics : null,
|
||||
|
||||
loadDir : null, /* Функция привязываеться ко всем ссылкам и
|
||||
* загружает содержимое каталогов */
|
||||
|
||||
/* ОБЬЕКТЫ */
|
||||
|
||||
/* ПРИВАТНЫЕ ФУНКЦИИ */
|
||||
/* функция загружает json-данные о файловой системе */
|
||||
_ajaxLoad : null,
|
||||
|
||||
/* Функция генерирует JSON из html-таблицы файлов */
|
||||
_getJSONfromFileTable : null,
|
||||
|
||||
/* функция меняет ссыки на ajax-овые */
|
||||
_changeLinks : null,
|
||||
|
||||
/* КОНСТАНТЫ*/
|
||||
CloudCmd = {
|
||||
LIBDIR : '/lib/',
|
||||
LIBDIRCLIENT : '/lib/client/',
|
||||
JSONDIR : '/json/',
|
||||
HTMLDIR : '/html/',
|
||||
/* height of Cloud Commander
|
||||
* seting up in init()
|
||||
*/
|
||||
HEIGHT : 0,
|
||||
MIN_ONE_PANEL_WIDTH : 1155,
|
||||
OLD_BROWSER : false,
|
||||
|
|
@ -59,7 +27,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
};
|
||||
|
||||
CloudCmd.GoogleAnalytics = function(){
|
||||
DOM.addOneTimeListener('mousemove', function(){
|
||||
Events.addOneTime('mousemove', function(){
|
||||
var lUrl = CloudCmd.LIBDIRCLIENT + 'google_analytics.js';
|
||||
|
||||
setTimeout(function(){
|
||||
|
|
@ -90,7 +58,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
DOM.Images.showLoad(pNeedRefresh ? {top:true} : null);
|
||||
|
||||
/* загружаем содержимое каталога */
|
||||
CloudCmd._ajaxLoad(lLink, { refresh: pNeedRefresh });
|
||||
ajaxLoad(lLink, { refresh: pNeedRefresh });
|
||||
}
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
|
|
@ -99,38 +67,12 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
|
||||
|
||||
/**
|
||||
* Function edits file name
|
||||
*
|
||||
* @param pParent - parent element
|
||||
* @param pEvent
|
||||
*/
|
||||
CloudCmd._editFileName = function(pParent){
|
||||
var lA = DOM.getCurrentLink(pParent),
|
||||
lName = DOM.getCurrentName();
|
||||
|
||||
if ( lName !== '..' ){
|
||||
|
||||
lA.contentEditable = true;
|
||||
KeyBinding && KeyBinding.unSet();
|
||||
|
||||
/* setting event handler onclick
|
||||
* if user clicks somewhere keyBinded
|
||||
* backs
|
||||
*/
|
||||
DOM.addOneTimeListener('click', function(){
|
||||
//lA.contentEditable = false;
|
||||
//KeyBinding && KeyBinding.set();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** функция устанавливает курсор на каталог
|
||||
* функция устанавливает курсор на каталог
|
||||
* с которого мы пришли, если мы поднялись
|
||||
* в верх по файловой структуре
|
||||
* @param pDirName - имя каталога с которого мы пришли
|
||||
*/
|
||||
CloudCmd._currentToParent = function(pDirName){
|
||||
function currentToParent(pDirName){
|
||||
/* убираем слэш с имени каталога */
|
||||
pDirName = Util.removeStr(pDirName, '/');
|
||||
|
||||
|
|
@ -145,7 +87,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
DOM.setCurrentFile(lRootDir);
|
||||
DOM.scrollIntoViewIfNeeded(lRootDir, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function load modules
|
||||
|
|
@ -186,6 +128,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
/** Конструктор CloudClient, который
|
||||
* выполняет весь функционал по
|
||||
* инициализации
|
||||
|
|
@ -200,44 +143,54 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
},
|
||||
lFunc = function(pCallBack){
|
||||
CloudCmd.OLD_BROWSER = true;
|
||||
var lSrc = CloudCmd.LIBDIRCLIENT + 'ie.js';
|
||||
var lSrc = CloudCmd.LIBDIRCLIENT + 'polyfill.js';
|
||||
|
||||
DOM.jqueryLoad(
|
||||
DOM.retJSLoad(lSrc, pCallBack)
|
||||
);
|
||||
};
|
||||
|
||||
//Util.socketLoad();
|
||||
|
||||
Util.ifExec(document.body.scrollIntoViewIfNeeded, lCallBack, lFunc);
|
||||
|
||||
DOM.Events.add(['unload', 'beforeunload'], function (pEvent) {
|
||||
var lRet, lIsBind = Key.isBind();
|
||||
|
||||
if(!lIsBind) {
|
||||
DOM.preventDefault(pEvent);
|
||||
lRet = 'Please make sure that you saved all work.';
|
||||
}
|
||||
|
||||
return lRet;
|
||||
});
|
||||
};
|
||||
|
||||
function initModules(pCallBack){
|
||||
loadModule({
|
||||
/* привязываем клавиши к функциям */
|
||||
path : 'keyBinding.js',
|
||||
path : 'key.js',
|
||||
func : function(){
|
||||
KeyBinding = CloudCmd.KeyBinding;
|
||||
KeyBinding.init();
|
||||
Key = CloudCmd.Key;
|
||||
Key.bind();
|
||||
}
|
||||
});
|
||||
|
||||
CloudCmd.getModules(function(pModules){
|
||||
CloudCmd.getModules(function(pModules) {
|
||||
pModules = pModules || [];
|
||||
|
||||
DOM.addContextMenuListener(function(pEvent){
|
||||
Events.addContextMenu(function(pEvent){
|
||||
CloudCmd.Menu.ENABLED || DOM.preventDefault(pEvent);
|
||||
}, document);
|
||||
|
||||
var lStorage = 'storage',
|
||||
lShowLoadFunc = Util.retFunc( DOM.Images.showLoad ),
|
||||
var i, n, lStorage = 'storage',
|
||||
lShowLoadFunc = Util.retFunc( DOM.Images.showLoad, {top:true} ),
|
||||
|
||||
lDoBefore = {
|
||||
'editor/_codemirror' : lShowLoadFunc,
|
||||
'viewer' : lShowLoadFunc
|
||||
'edit' : lShowLoadFunc,
|
||||
'view' : lShowLoadFunc,
|
||||
'menu' : lShowLoadFunc
|
||||
},
|
||||
|
||||
lLoad = function(pName, pPath, pDoBefore){
|
||||
lLoad = function(pName, pPath, pDoBefore) {
|
||||
loadModule({
|
||||
path : pPath,
|
||||
name : pName,
|
||||
|
|
@ -245,7 +198,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
});
|
||||
};
|
||||
|
||||
for(var i = 0, n = pModules.length; i < n ; i++){
|
||||
for (i = 0, n = pModules.length; i < n ; i++) {
|
||||
var lModule = pModules[i];
|
||||
|
||||
if( Util.isString(lModule) )
|
||||
|
|
@ -255,7 +208,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
var lStorageObj = Util.findObjByNameInArr( pModules, lStorage ),
|
||||
lMod = Util.getNamesFromObjArray( lStorageObj );
|
||||
|
||||
for(i = 0, n = lMod.length; i < n; i++){
|
||||
for (i = 0, n = lMod.length; i < n; i++){
|
||||
var lName = lMod[i],
|
||||
lPath = lStorage + '/_' + lName.toLowerCase();
|
||||
|
||||
|
|
@ -269,30 +222,38 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
}
|
||||
|
||||
function initKeysPanel(pCallBack){
|
||||
var lKeysPanel = {},
|
||||
var i, lButton, lEl,
|
||||
lKeysPanel = {},
|
||||
|
||||
lFuncs =[
|
||||
null,
|
||||
null, /* f1 */
|
||||
CloudCmd.Help, /* f1 */
|
||||
DOM.renameCurrent, /* f2 */
|
||||
CloudCmd.Viewer, /* f3 */
|
||||
CloudCmd.Editor, /* f4 */
|
||||
CloudCmd.View, /* f3 */
|
||||
CloudCmd.Edit, /* f4 */
|
||||
DOM.copyCurrent, /* f5 */
|
||||
DOM.moveCurrent, /* f6 */
|
||||
DOM.promptNewDir, /* f7 */
|
||||
DOM.promptDeleteSelected, /* f8 */
|
||||
CloudCmd.Menu, /* f9 */
|
||||
];
|
||||
|
||||
for(var i = 1; i <= 8; i++){
|
||||
var lButton = 'f' + i,
|
||||
lEl = DOM.getById('f' + i);
|
||||
if( i === 3 || i === 4)
|
||||
DOM.addOneTimeListener('click', lFuncs[i], lEl);
|
||||
else
|
||||
DOM.addClickListener(lFuncs[i], lEl);
|
||||
for (i = 1; i <= 9; i++) {
|
||||
lButton = 'f' + i,
|
||||
lEl = DOM.getById('f' + i);
|
||||
lKeysPanel[lButton] = lEl;
|
||||
|
||||
if (i === 1 || i === 3 || i === 4 || i === 9)
|
||||
Events.addOneTime('click', lFuncs[i], lEl);
|
||||
else
|
||||
Events.addClick(lFuncs[i], lEl);
|
||||
}
|
||||
|
||||
lButton = '~',
|
||||
lEl = DOM.getById('~');
|
||||
lKeysPanel[lButton] = lEl;
|
||||
Events.addOneTime('click', CloudCmd.Console, lEl);
|
||||
|
||||
CloudCmd.KeysPanel = lKeysPanel;
|
||||
Util.exec(pCallBack);
|
||||
}
|
||||
|
|
@ -311,25 +272,24 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
|
||||
/* загружаем общие функции для клиента и сервера */
|
||||
DOM.jsload(CloudCmd.LIBDIR + 'cloudfunc.js', function(){
|
||||
DOM.addListener("popstate", function(pEvent) {
|
||||
Events.add("popstate", function(pEvent) {
|
||||
var lPath = pEvent.state + '?json';
|
||||
|
||||
if(lPath)
|
||||
CloudCmd._ajaxLoad(lPath, {nohistory: true});
|
||||
ajaxLoad(lPath, {nohistory: true});
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
/* меняем ссылки на ajax'овые */
|
||||
CloudCmd._changeLinks(CloudFunc.LEFTPANEL);
|
||||
CloudCmd._changeLinks(CloudFunc.RIGHTPANEL);
|
||||
changeLinks(CloudFunc.LEFTPANEL);
|
||||
changeLinks(CloudFunc.RIGHTPANEL);
|
||||
|
||||
/* устанавливаем переменную доступности кэша */
|
||||
DOM.Cache.setAllowed(true);
|
||||
Cache.setAllowed(true);
|
||||
/* Устанавливаем кэш корневого каталога */
|
||||
var lDirPath = DOM.getCurrentDirPath();
|
||||
if( !DOM.Cache.get(lDirPath) )
|
||||
DOM.Cache.set(lDirPath, CloudCmd._getJSONfromFileTable());
|
||||
if( !Cache.get(lDirPath) )
|
||||
Cache.set(lDirPath, getJSONfromFileTable());
|
||||
});
|
||||
|
||||
/* выделяем строку с первым файлом */
|
||||
|
|
@ -367,7 +327,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
});
|
||||
|
||||
Util.exec(pCallBack);
|
||||
CloudCmd.KeyBinding();
|
||||
CloudCmd.Key();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -410,11 +370,14 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
};
|
||||
|
||||
|
||||
/* функция меняет ссыки на ajax-овые */
|
||||
CloudCmd._changeLinks = function(pPanelID){
|
||||
/**
|
||||
* функция меняет ссыки на ajax-овые
|
||||
* @param pPanelID
|
||||
*/
|
||||
function changeLinks(pPanelID){
|
||||
/* назначаем кнопку очистить кэш и показываем её */
|
||||
var lClearcache = DOM.getById('clear-cache');
|
||||
DOM.addClickListener(DOM.Cache.clear, lClearcache);
|
||||
Events.addClick(Cache.clear, lClearcache);
|
||||
|
||||
/* меняем ссылки на ajax-запросы */
|
||||
var lPanel = DOM.getById(pPanelID),
|
||||
|
|
@ -424,7 +387,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
lOnContextMenu_f = function(pEvent){
|
||||
var lReturn_b = true;
|
||||
|
||||
KeyBinding && KeyBinding.unSet();
|
||||
Key && Key.unsetBind();
|
||||
|
||||
/* getting html element
|
||||
* currentTarget - DOM event
|
||||
|
|
@ -495,7 +458,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
};
|
||||
|
||||
/* ставим загрузку гифа на клик*/
|
||||
DOM.addClickListener( CloudCmd.refresh, a[0].parentElement );
|
||||
Events.addClick( CloudCmd.refresh, a[0].parentElement );
|
||||
|
||||
/* start from 1 cous 0 is a path and it's setted up */
|
||||
for(var i = 1, n = a.length; i < n ; i++){
|
||||
|
|
@ -509,27 +472,29 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
|
||||
/* if we in path - set click event */
|
||||
if (lLi.className === 'path')
|
||||
DOM.addClickListener( lLoadDir, ai );
|
||||
Events.addClick( lLoadDir, ai );
|
||||
else {
|
||||
DOM.addClickListener( DOM.preventDefault, lLi);
|
||||
DOM.addListener('mousedown', lSetCurrentFile_f, lLi);
|
||||
DOM.addListener('dragstart', lOnDragStart_f, ai);
|
||||
/* if right button clicked menu will
|
||||
* loads and shows
|
||||
*/
|
||||
DOM.addListener('contextmenu', lOnContextMenu_f, lLi);
|
||||
Events.add({
|
||||
'click' : DOM.preventDefault,
|
||||
'mousedown' : lSetCurrentFile_f,
|
||||
'contextmenu' : lOnContextMenu_f
|
||||
}, lLi);
|
||||
|
||||
Events.add('dragstart', lOnDragStart_f, ai);
|
||||
|
||||
/* если ссылка на папку, а не файл */
|
||||
if(ai.target !== '_blank'){
|
||||
DOM.addListener('dblclick', lLoadDirOnce, lLi);
|
||||
DOM.addListener('touchend', lLoadDirOnce, lLi);
|
||||
Events.add({
|
||||
'dblclick' : lLoadDirOnce,
|
||||
'touchend' : lLoadDirOnce
|
||||
}, lLi);
|
||||
}
|
||||
|
||||
lLi.id = (ai.title ? ai.title : ai.textContent) +
|
||||
'(' + pPanelID + ')';
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция загружает json-данные о Файловой Системе
|
||||
|
|
@ -538,7 +503,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
* @param pOptions
|
||||
* { refresh, nohistory } - необходимость обновить данные о каталоге
|
||||
*/
|
||||
CloudCmd._ajaxLoad = function(pPath, pOptions){
|
||||
function ajaxLoad(pPath, pOptions){
|
||||
if(!pOptions)
|
||||
pOptions = {};
|
||||
|
||||
|
|
@ -570,12 +535,11 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
*/
|
||||
var lRet = pOptions.refresh;
|
||||
if(!lRet){
|
||||
var lJSON = DOM.Cache.get(lCleanPath);
|
||||
var lJSON = Cache.get(lCleanPath);
|
||||
|
||||
if (lJSON){
|
||||
/* переводим из текста в JSON */
|
||||
lJSON = Util.parseJSON(lJSON);
|
||||
CloudCmd._createFileTable(lPanel, lJSON);
|
||||
createFileTable(lPanel, lJSON);
|
||||
}
|
||||
else
|
||||
lRet = true;
|
||||
|
|
@ -590,7 +554,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
},
|
||||
|
||||
success : function(pData){
|
||||
CloudCmd._createFileTable(lPanel, pData);
|
||||
createFileTable(lPanel, pData);
|
||||
|
||||
/* переводим таблицу файлов в строку, для *
|
||||
* сохранения в localStorage */
|
||||
|
|
@ -600,27 +564,25 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
/* если размер данных не очень бошьой *
|
||||
* сохраняем их в кэше */
|
||||
if(lJSON_s.length < 50000 )
|
||||
DOM.Cache.set(lCleanPath, lJSON_s);
|
||||
Cache.set(lCleanPath, lJSON_s);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция строит файловую таблицу
|
||||
* @param pEleme - родительский элемент
|
||||
* @param pJSON - данные о файлах
|
||||
*/
|
||||
CloudCmd._createFileTable = function(pElem, pJSON){
|
||||
function createFileTable(pElem, pJSON){
|
||||
var lElem = DOM.getById(pElem),
|
||||
/* getting current element if was refresh */
|
||||
lPath = DOM.getByClass('path', lElem),
|
||||
|
||||
lCurrent = DOM.getCurrentFile(),
|
||||
lCurrentLink = DOM.getCurrentLink(lCurrent),
|
||||
lParent = lCurrentLink.textContent,
|
||||
lDir = DOM.getCurrentDirName(),
|
||||
|
||||
lName = DOM.getCurrentName(lName),
|
||||
lName = DOM.getCurrentName(lCurrent),
|
||||
lWasRefresh_b = lPath[0].textContent === pJSON[0].path;
|
||||
|
||||
CloudCmd.getFileTemplate(function(pTemplate){
|
||||
|
|
@ -655,19 +617,19 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
|
||||
DOM.setCurrentFile(lCurrent);
|
||||
|
||||
CloudCmd._changeLinks(pElem);
|
||||
changeLinks(pElem);
|
||||
|
||||
if(lParent === '..' && lDir !== '/')
|
||||
CloudCmd._currentToParent(lDir);
|
||||
if(lName === '..' && lDir !== '/')
|
||||
currentToParent(lDir);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция генерирует JSON из html-таблицы файлов и
|
||||
* используеться при первом заходе в корень
|
||||
*/
|
||||
CloudCmd._getJSONfromFileTable = function(){
|
||||
function getJSONfromFileTable(){
|
||||
var lLeft = DOM.getById('left'),
|
||||
lPath = DOM.getByClass('path')[0].textContent,
|
||||
|
||||
|
|
@ -676,7 +638,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
size : 'dir'
|
||||
}],
|
||||
|
||||
lLI = lLeft.getElementsByTagName('li'),
|
||||
lLI = DOM.getByTag('li', lLeft),
|
||||
i, n, j = 1; /* счётчик реальных файлов */
|
||||
|
||||
/* счётчик элементов файлов в DOM
|
||||
|
|
@ -690,9 +652,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
var lCurrent = lLI[i],
|
||||
lName = DOM.getCurrentName(lCurrent),
|
||||
lSize = DOM.getCurrentSize(lCurrent),
|
||||
/* переводим права доступа в цыфровой вид
|
||||
* для хранения в localStorage
|
||||
*/
|
||||
|
||||
lMode = DOM.getCurrentMode(lCurrent);
|
||||
lMode = CloudFunc.getNumericPermissions(lMode);
|
||||
|
||||
|
|
@ -704,11 +664,9 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
|
|||
};
|
||||
}
|
||||
return Util.stringifyJSON(lFileTable);
|
||||
};
|
||||
}
|
||||
|
||||
CloudCommander = CloudCmd;
|
||||
|
||||
DOM.addOneTimeListener('load', function(){
|
||||
Events.addOneTime('load', function(){
|
||||
/* базовая инициализация*/
|
||||
CloudCmd.init();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
/* gui module for config.json editing */
|
||||
var CloudCommander;
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var cloudcmd = CloudCommander;
|
||||
|
||||
var Config = {};
|
||||
|
||||
Config.Show = (function(){
|
||||
console.log('config showed');
|
||||
|
||||
var lFancyBox = cloudcmd.Viewer.FancyBox;
|
||||
lFancyBox.loadData({hreef: 'htlm/config.html'},
|
||||
lFancyBox.onDataLoaded);
|
||||
});
|
||||
|
||||
Config.Keys = function(){
|
||||
console.log('config.js loaded');
|
||||
cloudcmd.Viewer(function(){
|
||||
Config.Show();
|
||||
});
|
||||
};
|
||||
|
||||
cloudcmd.Config = Config;
|
||||
|
||||
})();
|
||||
164
lib/client/console.js
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
var CloudCmd, Util, DOM, $;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
CloudCmd.Console = new ConsoleProto(CloudCmd, Util, DOM);
|
||||
|
||||
function ConsoleProto(CloudCmd, Util, DOM){
|
||||
var Name = 'Console',
|
||||
jqconsole,
|
||||
Element,
|
||||
MouseBinded,
|
||||
Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
Console = this;
|
||||
|
||||
this.init = function(pCallBack) {
|
||||
var lFunc, lIsFunc = Util.isFunction(CloudCmd.View);
|
||||
|
||||
if (lIsFunc)
|
||||
lFunc = CloudCmd.View;
|
||||
else
|
||||
lFunc = Util.exec;
|
||||
|
||||
Util.loadOnLoad([
|
||||
Console.show,
|
||||
load,
|
||||
lFunc,
|
||||
DOM.jqueryLoad,
|
||||
DOM.socketLoad
|
||||
]);
|
||||
|
||||
DOM.Events.addKey(listener);
|
||||
DOM.setButtonKey('~', Console.show);
|
||||
|
||||
delete Console.init;
|
||||
};
|
||||
|
||||
this.show = function() {
|
||||
Images.showLoad({top:true});
|
||||
|
||||
if (!Element) {
|
||||
Element = DOM.anyload({
|
||||
name : 'div',
|
||||
className : 'console'
|
||||
});
|
||||
|
||||
jqconsole = $(Element).jqconsole('', '> ');
|
||||
// Abort prompt on Ctrl+Z.
|
||||
jqconsole.RegisterShortcut('Z', function() {
|
||||
jqconsole.AbortPrompt();
|
||||
handler();
|
||||
});
|
||||
|
||||
// Handle a command.
|
||||
var handler = function(command) {
|
||||
var lSocket = CloudCmd.Socket;
|
||||
if (command) {
|
||||
Images.showLoad({ top:true });
|
||||
|
||||
if(lSocket)
|
||||
lSocket.send(command);
|
||||
}
|
||||
|
||||
jqconsole.Prompt(true, handler);
|
||||
};
|
||||
|
||||
// Initiate the first prompt.
|
||||
handler();
|
||||
}
|
||||
|
||||
CloudCmd.View.show(Element, function(){
|
||||
var l$Console = jqconsole.$console,
|
||||
l$Input = jqconsole.$input_source,
|
||||
lFocus = function(){
|
||||
var x = window.scrollX,
|
||||
y = window.scrollY;
|
||||
|
||||
l$Input.focus();
|
||||
window.scrollTo(x,y);
|
||||
};
|
||||
|
||||
lFocus();
|
||||
|
||||
if (!MouseBinded) {
|
||||
MouseBinded = true;
|
||||
|
||||
$(l$Console).unbind('mouseup');
|
||||
$(l$Console).mouseup(function() {
|
||||
if( !window.getSelection().toString() ) {
|
||||
var lTop = l$Console.scrollTop();
|
||||
|
||||
lFocus();
|
||||
l$Console.scrollTop(lTop);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.hide = function(){
|
||||
CloudCmd.View.hide();
|
||||
};
|
||||
|
||||
this.log = function(pText){
|
||||
if (jqconsole)
|
||||
jqconsole.Write( addNewLine(pText), 'log-msg');
|
||||
};
|
||||
|
||||
this.error = function(pText){
|
||||
if (jqconsole)
|
||||
jqconsole.Write( addNewLine(pText), 'error-msg');
|
||||
};
|
||||
|
||||
function addNewLine(pText){
|
||||
var lNewLine = '',
|
||||
n = pText && pText.length;
|
||||
|
||||
if(n && pText[n-1] !== '\n')
|
||||
lNewLine = '\n';
|
||||
|
||||
return pText + lNewLine;
|
||||
}
|
||||
|
||||
|
||||
function load(pCallBack){
|
||||
Util.time(Name + ' load');
|
||||
|
||||
var lDir = CloudCmd.LIBDIRCLIENT + 'console/',
|
||||
lFiles = [
|
||||
lDir + 'jqconsole.js',
|
||||
lDir + 'jqconsole.css',
|
||||
lDir + 'ansi.css',
|
||||
lDir + 'jquery-migrate-1.2.1.js'
|
||||
];
|
||||
|
||||
DOM.anyLoadInParallel(lFiles, function(){
|
||||
console.timeEnd(Name + ' load');
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
function listener(pEvent){
|
||||
var lTRA = Key.TRA,
|
||||
lESC = Key.ESC,
|
||||
lIsBind = Key.isBind(),
|
||||
lKey = pEvent.keyCode;
|
||||
|
||||
switch(lKey){
|
||||
case lTRA:
|
||||
if (lIsBind){
|
||||
Console.show();
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
case lESC:
|
||||
Console.hide();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
16
lib/client/console/Cakefile
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{spawn, exec} = require 'child_process'
|
||||
|
||||
task 'watch', 'Build and watch the CoffeeScript source files', ->
|
||||
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
|
||||
test = spawn 'coffee', ['-cw', 'test']
|
||||
log = (d)-> console.log d.toString()
|
||||
coffee.stdout.on 'data', log
|
||||
test.stdout.on 'data', log
|
||||
|
||||
task 'build', 'Build minified file with uglify', ->
|
||||
console.log 'building...'
|
||||
exec 'uglifyjs -o jqconsole.min.js lib/jqconsole.js', (err, res)->
|
||||
if err
|
||||
console.error 'failed with', err
|
||||
else
|
||||
console.log 'build complete'
|
||||
68
lib/client/console/ChangeLog
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
2011.08.28, Version 2.4.2
|
||||
|
||||
* Fix for issue #13 .
|
||||
* Add optional parameter "escape" to the Write method, see README for more
|
||||
info.
|
||||
|
||||
20011.10.9, Version 2.5
|
||||
|
||||
* Added mobile support.
|
||||
* Follow the cursor's position when the window is scrolled away.
|
||||
* Add async_multiline option in prompt, see README for more info.
|
||||
* Add Dump method that would dump the console's text content.
|
||||
* Add GetState method that gets the current state of the console.
|
||||
* Publicize MoveToStart and MoveToEnd methods.
|
||||
|
||||
2011.11.1, Version 2.5.1
|
||||
|
||||
* Added Disable/Enable functionality and methods.
|
||||
* Added IsDisabled method.
|
||||
|
||||
2011.11.3, Version 2.5.2
|
||||
|
||||
* Added multibyte character input support, issue #19.
|
||||
|
||||
2011.11.4, Version 2.6
|
||||
|
||||
* Fix safari paste. Issue #15.
|
||||
* Created constants and minifier friendliness. Issue #14.
|
||||
|
||||
2011.11.19, Version 2.6.1
|
||||
|
||||
* Fix issues #20, #21
|
||||
* Implement feature #22
|
||||
* Add built-in css for ease of use.
|
||||
|
||||
2011.12.6, Version 2.6.2
|
||||
* Fix issue #23.
|
||||
|
||||
2011.12.16 Version 2.6.3
|
||||
* Fix issue #24.
|
||||
|
||||
2011.12.28 Version 2.7
|
||||
* Implement ANSI graphics, Issue #12
|
||||
* Fix issue #25
|
||||
|
||||
2012.3.7 Version 2.7.1
|
||||
* Fix issue #26
|
||||
* Complete issue #12 by adding stacking graphics support.
|
||||
|
||||
2012.10.28 Version 2.7.2
|
||||
* Add set / get History methods.
|
||||
* Add Append method.
|
||||
|
||||
2012.11.10 Version 2.7.3
|
||||
* Allow empty string in prompt.
|
||||
|
||||
2012.12.13 Version 2.7.4
|
||||
* Fix issue #36
|
||||
* Fix issue #35
|
||||
|
||||
2013.1.21 Version 2.7.5
|
||||
* Add SetPromptLabel method.
|
||||
|
||||
2013.1.22 Version 2.7.6
|
||||
* Continue label argument in SetPromptLabel method.
|
||||
|
||||
2013.1.26 Version 2.7.7
|
||||
* Support for middle click paste on linux. #47.
|
||||
723
lib/client/console/README.md
Normal file
|
|
@ -0,0 +1,723 @@
|
|||
#jq-console
|
||||
|
||||
A jQuery terminal plugin written in CoffeeScript.
|
||||
|
||||
This project was spawned because of our need for a simple web terminal plugin
|
||||
for the <a href="http://repl.it">repl.it</a> project. It tries to simulate a low level terminal by providing (almost)
|
||||
raw input/output streams as well as input and output states.
|
||||
|
||||
Version 2.0 adds baked-in support for rich multi-line prompting and operation
|
||||
queueing.
|
||||
|
||||
|
||||
##Tested Browsers
|
||||
|
||||
The plugin has been tested on the following browsers:
|
||||
|
||||
* IE 9+
|
||||
* Chrome 10+
|
||||
* Firefox 4+
|
||||
* Opera 11+
|
||||
* iOS 4+
|
||||
|
||||
|
||||
##Getting Started
|
||||
|
||||
###Echo example
|
||||
|
||||
```css
|
||||
/* The console container element */
|
||||
#console {
|
||||
position: absolute;
|
||||
width: 400px;
|
||||
height: 500px;
|
||||
background-color:black;
|
||||
}
|
||||
/* The inner console element. */
|
||||
.jqconsole {
|
||||
padding: 10px;
|
||||
}
|
||||
/* The cursor. */
|
||||
.jqconsole-cursor {
|
||||
background-color: gray;
|
||||
}
|
||||
/* The cursor color when the console looses focus. */
|
||||
.jqconsole-blurred .jqconsole-cursor {
|
||||
background-color: #666;
|
||||
}
|
||||
/* The current prompt text color */
|
||||
.jqconsole-prompt {
|
||||
color: #0d0;
|
||||
}
|
||||
/* The command history */
|
||||
.jqconsole-old-prompt {
|
||||
color: #0b0;
|
||||
font-weight: normal;
|
||||
}
|
||||
/* The text color when in input mode. */
|
||||
.jqconsole-input {
|
||||
color: #dd0;
|
||||
}
|
||||
/* Previously entered input. */
|
||||
.jqconsole-old-input {
|
||||
color: #bb0;
|
||||
font-weight: normal;
|
||||
}
|
||||
/* The text color of the output. */
|
||||
.jqconsole-output {
|
||||
color: white;
|
||||
}
|
||||
```
|
||||
|
||||
```html
|
||||
<div id="console"></div>
|
||||
<script src="jquery.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="jqconsole.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
var jqconsole = $('#console').jqconsole('Hi\n', '>>>');
|
||||
var startPrompt = function () {
|
||||
// Start the prompt with history enabled.
|
||||
jqconsole.Prompt(true, function (input) {
|
||||
// Output input with the class jqconsole-output.
|
||||
jqconsole.Write(input + '\n', 'jqconsole-output');
|
||||
// Restart the prompt.
|
||||
startPrompt();
|
||||
});
|
||||
};
|
||||
startPrompt();
|
||||
});
|
||||
</script>
|
||||
```
|
||||
<iframe src="demo/echo.html" style="width:400px;height:500px">
|
||||
</iframe>
|
||||
|
||||
###Instantiating
|
||||
|
||||
```javascript
|
||||
$(div).jqconsole(welcomeString, promptLabel, continueLabel);
|
||||
```
|
||||
|
||||
* `div` is the div element or selector. Note that this element must be
|
||||
explicity sized and positioned `absolute` or `relative`.
|
||||
* `welcomeString` is the string to be shown when the terminal is first rendered.
|
||||
* `promptLabel` is the label to be shown before the input when using Prompt().
|
||||
* `continueLabel` is the label to be shown before the continued lines of the
|
||||
input when using Prompt().
|
||||
|
||||
##Configuration
|
||||
|
||||
There isn't much initial configuration needed, because the user must supply
|
||||
options and callbacks with each state change. There are a few config methods
|
||||
provided to create custom shortcuts and change indentation width:
|
||||
|
||||
###jqconsole.RegisterShortcut
|
||||
Registers a callback for a keyboard shortcut.
|
||||
Takes two arguments:
|
||||
|
||||
* __(int|string)__ *keyCode*: The code of the key pressing which (when Ctrl is
|
||||
held) will trigger this shortcut. If a string is provided, the ASCII code
|
||||
of the first character is taken.
|
||||
|
||||
* __function__ *callback*: A function called when the shortcut is pressed;
|
||||
"this" will point to the JQConsole object.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
// Ctrl+R: resets the console.
|
||||
jqconsole.RegisterShortcut('R', function() {
|
||||
this.Reset();
|
||||
});
|
||||
|
||||
###jqconsole.SetIndentWidth
|
||||
Sets the number of spaces inserted when indenting and removed when unindenting.
|
||||
Takes one argument:
|
||||
|
||||
* __int__ *width*: The code of the key pressing which (when Ctrl is held) will
|
||||
trigger this shortcut.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
// Sets the indent width to 4 spaces.
|
||||
jqconsole.SetIndentWidth(4);
|
||||
|
||||
###jqconsole.RegisterMatching
|
||||
Registers an opening and closing characters to match and wraps each of the
|
||||
opening and closing characters with a span with the specified class.
|
||||
Takes one parameters:
|
||||
|
||||
* __char__ *open*: The opening character of a "block".
|
||||
* __char__ *close*: The closing character of a "block".
|
||||
* __string__ *class*: The css class that is applied to the matched characters.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.RegisterMatching('{', '}', 'brackets');
|
||||
|
||||
##Usage
|
||||
|
||||
Unlike most terminal plugins, jq-console gives you complete low-level control
|
||||
over the execution; you have to call the appropriate methods to start input
|
||||
or output:
|
||||
|
||||
###jqconsole.Input:
|
||||
Asks user for input. If another input or prompt operation is currently underway,
|
||||
the new input operation is enqueued and will be called when the current
|
||||
operation and all previously enqueued operations finish. Takes one argument:
|
||||
|
||||
* __function__ *input_callback*: A function called with the user's input when
|
||||
the user presses Enter and the input operation is complete.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
// Echo the input.
|
||||
jqconsole.Input(function(input) {
|
||||
jqconsole.Write(input);
|
||||
});
|
||||
|
||||
|
||||
###jqconsole.Prompt
|
||||
Asks user for input. If another input or prompt operation is currently underway
|
||||
the new prompt operation is enqueued and will be called when the current
|
||||
peration and all previously enqueued operations finish. Takes three arguments:
|
||||
|
||||
* __bool__ *history_enabled*: Whether this input should use history. If true,
|
||||
the user can select the input from history, and their input will also be
|
||||
added as a new history item.
|
||||
|
||||
* __function__ *result_callback*: A function called with the user's input when
|
||||
the user presses Enter and the prompt operation is complete.
|
||||
|
||||
* __function__ *multiline_callback*: If specified, this function is called when
|
||||
the user presses Enter to check whether the input should continue to the
|
||||
next line. The function must return one of the following values:
|
||||
|
||||
* `false`: the input operation is completed.
|
||||
|
||||
* `0`: the input continues to the next line with the current indent.
|
||||
|
||||
* `N` (int): the input continues to the next line, and the current
|
||||
indent is adjusted by `N`, e.g. `-2` to unindent two levels.
|
||||
|
||||
|
||||
* __bool__ *async_multiline*: Whether the multiline callback function should
|
||||
be treated as an asynchronous operation and be passed a continuation
|
||||
function that should be called with one of the return values mentioned
|
||||
above: `false`/`0`/`N`.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.Prompt(true, function(input) {
|
||||
// Alert the user with the command.
|
||||
alert(input);
|
||||
}, function (input) {
|
||||
// Continue if the last character is a backslash.
|
||||
return /\\$/.test(input);
|
||||
});
|
||||
|
||||
###jqconsole.AbortPrompt
|
||||
Aborts the current prompt operation and returns to output mode or the next
|
||||
queued input/prompt operation. Takes no arguments.
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.Prompt(true, function(input) {
|
||||
alert(input);
|
||||
});
|
||||
// Give the user 2 seconds to enter the command.
|
||||
setTimeout(function() {
|
||||
jqconsole.AbortPrompt();
|
||||
}, 2000);
|
||||
|
||||
###jqconsole.Write
|
||||
Writes the given text to the console in a `<span>`, with an
|
||||
optional class. If a prompt is currently being shown, the text is inserted
|
||||
before it. Takes two arguments:
|
||||
|
||||
* __string__ *text*: The text to write.
|
||||
|
||||
* __string__ *cls*: The class to give the span containing the text. Optional.
|
||||
|
||||
* __bool__ *escape*: Whether the text to write should be html escaped.
|
||||
Optional, defaults to true.
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
jqconsole.Write(output, 'my-output-class')
|
||||
jqconsole.Write(err.message, 'my-error-class')
|
||||
|
||||
###jqconsole.Append
|
||||
Append the given node to the DOM. If a prompt is currently being shown, the
|
||||
text is inserted before it. Takes a single argument:
|
||||
|
||||
* __(string|Element)__ *node*: The DOM Element or html string to append to
|
||||
the console just before the prompt.
|
||||
|
||||
Example:
|
||||
|
||||
// Add a div with the text 'hello' on a red background using jquery
|
||||
jqconsole.Append($('<div>hello</div>').css('background-color', 'red'));
|
||||
|
||||
// We can also use document.createElement
|
||||
node = document.createElement("div");
|
||||
content = document.createTextNode("hello");
|
||||
node.appendChild(content);
|
||||
jqconsole.Append(node);
|
||||
|
||||
|
||||
###jqconsole.SetPromptText
|
||||
Sets the text currently in the input prompt. Takes one parameter:
|
||||
|
||||
* __string__ *text*: The text to put in the prompt.
|
||||
|
||||
Examples:
|
||||
|
||||
jqconsole.SetPromptText('ls')
|
||||
jqconsole.SetPromptText('print [i ** 2 for i in range(10)]')
|
||||
|
||||
|
||||
###jqconsole.SetPromptLabel
|
||||
Replaces the main prompt label. Takes two parameters:
|
||||
|
||||
* __string__ *main_label*: String to replace the main prompt label.
|
||||
* __string__ *continuation_label*: String to replace the continuation prompt label. Optional.
|
||||
|
||||
Examples:
|
||||
|
||||
jqconsole.SetPromptLabel('$')
|
||||
jqconsole.SetPromptLabel(' $','..')
|
||||
|
||||
|
||||
###jqconsole.ClearPromptText
|
||||
Clears all the text currently in the input prompt. Takes one parameter:
|
||||
|
||||
* __bool__ *clear_label*: If specified and true, also clears the main prompt
|
||||
label (e.g. ">>>").
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.ClearPromptText()
|
||||
|
||||
|
||||
###jqconsole.GetPromptText
|
||||
Returns the contents of the prompt. Takes one parameter:
|
||||
|
||||
* __bool__ *full*: If specified and true, also includes the prompt labels
|
||||
(e.g. ">>>").
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
var currentCommand = jqconsole.GetPromptText()
|
||||
var logEntry = jqconsole.GetPromptText(true)
|
||||
|
||||
|
||||
###jqconsole.Reset
|
||||
Resets the console to its initial state, cancelling all current and pending
|
||||
operations. Takes no parameters.
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.Reset()
|
||||
|
||||
|
||||
###jqconsole.GetColumn
|
||||
Returns the 0-based number of the column on which the cursor currently is.
|
||||
Takes no parameters.
|
||||
|
||||
Example:
|
||||
|
||||
// Show the current line and column in a status area.
|
||||
$('#status').text(jqconsole.GetLine() + ', ' + jqconsole.GetColumn())
|
||||
|
||||
|
||||
###jqconsole.GetLine
|
||||
Returns the 0-based number of the line on which the cursor currently is.
|
||||
Takes no parameters.
|
||||
|
||||
Example:
|
||||
|
||||
// Show the current line and column in a status area.
|
||||
$('#status').text(jqconsole.GetLine() + ', ' + jqconsole.GetColumn())
|
||||
|
||||
###jqconsole.Focus
|
||||
Forces the focus onto the console so events can be captured.
|
||||
Takes no parameters.
|
||||
|
||||
Example:
|
||||
|
||||
// Redirect focus to the console whenever the user clicks anywhere.
|
||||
$(window).click(function() {
|
||||
jqconsole.Focus();
|
||||
})
|
||||
|
||||
|
||||
###jqconsole.GetIndentWidth
|
||||
Returns the number of spaces inserted when indenting. Takes no parameters.
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.SetIndentWidth(4);
|
||||
console.assert(jqconsole.GetIndentWidth() == 4);
|
||||
|
||||
|
||||
###jqconsole.UnRegisterMatching
|
||||
Deletes a certain matching settings set by `jqconsole.RegisterMatching`.
|
||||
Takes two paramaters:
|
||||
|
||||
* __char__ *open*: The opening character of a "block".
|
||||
* __char__ *close*: The closing character of a "block".
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.UnRegisterMatching('{', '}');
|
||||
|
||||
|
||||
###jqconsole.Dump
|
||||
Returns the text content of the console.
|
||||
|
||||
###jqconsole.GetState
|
||||
Returns the current state of the console. Could be one of the following:
|
||||
|
||||
* Input: `"input"`
|
||||
* Output: `"output"`
|
||||
* Prompt: `"prompt"`
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.GetState(); //output
|
||||
|
||||
|
||||
###jqconsole.MoveToStart
|
||||
Moves the cursor to the start of the current line.
|
||||
Takes one parameter:
|
||||
|
||||
* __bool__ *all_lines*: If true moves the cursor to the beginning of the first
|
||||
line in the current prompt. Defaults to false.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
// Move to line start Ctrl+A.
|
||||
jqconsole.RegisterShortcut('A', function() {
|
||||
jqconsole.MoveToStart();
|
||||
handler();
|
||||
});
|
||||
|
||||
|
||||
###jqconsole.MoveToEnd
|
||||
Moves the cursor to the end of the current line.
|
||||
Takes one parameter:
|
||||
|
||||
* __bool__ *all_lines*: If true moves the cursor to the end of the first
|
||||
line in the current prompt. Defaults to false.
|
||||
|
||||
Example:
|
||||
|
||||
// Move to line end Ctrl+E.
|
||||
jqconsole.RegisterShortcut('E', function() {
|
||||
jqconsole.MoveToEnd();
|
||||
handler();
|
||||
});
|
||||
|
||||
###jqconsole.Disable
|
||||
Disables input and focus on the console.
|
||||
|
||||
|
||||
###jqconsole.Enable
|
||||
Enables input and focus on the console.
|
||||
|
||||
|
||||
###jqconsole.IsDisabled
|
||||
Returns true if the console is disabled.
|
||||
|
||||
|
||||
###jqconsole.GetHistory
|
||||
Returns the contents of the history buffer.
|
||||
|
||||
|
||||
###jqconsole.SetHistory
|
||||
Set the history buffer to the given array.
|
||||
|
||||
Takes one parameter:
|
||||
|
||||
* __array__ *history*: The history buffer to use.
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.SetHistory(['a = 3', 'a + 3']);
|
||||
|
||||
|
||||
###jqconsole.ResetHistory
|
||||
Resets the console history.
|
||||
|
||||
|
||||
###jqconsole.ResetMatchings
|
||||
Resets the character matching configuration.
|
||||
|
||||
|
||||
###jqconsole.ResetShortcuts
|
||||
Resets the shortcut configuration.
|
||||
|
||||
|
||||
##Default Key Config
|
||||
|
||||
The console responds to the followind keys and key combinations by default:
|
||||
|
||||
* `Delete`: Delete the following character.
|
||||
* `Ctrl+Delete`: Delete the following word.
|
||||
* `Backspace`: Delete the preceding character.
|
||||
* `Ctrl+Backspace`: Delete the preceding word.
|
||||
* `Ctrl+Left`: Move one word to the left.
|
||||
* `Ctrl+Right`: Move one word to the right.
|
||||
* `Home`: Move to the beginning of the current line.
|
||||
* `Ctrl+Home`: Move to the beginnig of the first line.
|
||||
* `End`: Move to the end of the current line.
|
||||
* `Ctrl+End`: Move to the end of the last line.
|
||||
* `Shift+Up`, `Ctrl+Up`: Move cursor to the line above the current one.
|
||||
* `Shift+Down`, `Ctrl+Down`: Move cursor to the line below the current one.
|
||||
* `Tab`: Indent.
|
||||
* `Shift+Tab`: Unindent.
|
||||
* `Up`: Previous history item.
|
||||
* `Down`: Next history item.
|
||||
* `Enter`: Finish input/prompt operation. See Input() and Prompt() for details.
|
||||
* `Shift+Enter`: New line.
|
||||
* `Page Up`: Scroll console one page up.
|
||||
* `Page Down`: Scroll console one page down.
|
||||
|
||||
##ANSI escape code SGR support
|
||||
|
||||
jq-console implements a large subset of the ANSI escape code graphics.
|
||||
Using the `.Write` method you could add style to the console using
|
||||
the following syntax:
|
||||
|
||||
`ASCII 27 (decimal) or 0x1b (hex)` `[` `SGR code` `m`
|
||||
|
||||
Example:
|
||||
|
||||
jqconsole.Write('\033[31mRed Text');
|
||||
|
||||
Note that the third parameter `escape` must be true which defaults to it.
|
||||
|
||||
You'll need to include the `ansi.css` file for default effects or create your
|
||||
own using the css classes from the table below.
|
||||
|
||||
###SGR
|
||||
[Reference](http://en.wikipedia.org/wiki/ANSI_escape_code#graphics).
|
||||
<table>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Effect</th>
|
||||
<th>Class</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>0</td>
|
||||
<td>Reset / Normal</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Bold</td>
|
||||
<td>`jqconsole-ansi-bold`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Faint</td>
|
||||
<td>`jqconsole-ansi-lighter`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Italic</td>
|
||||
<td>`jqconsole-ansi-italic`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>Line below text</td>
|
||||
<td>`jqconsole-ansi-underline`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td>Blink: 1s delay</td>
|
||||
<td>`jqconsole-ansi-blink`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td>Blink: 0.5s delay</td>
|
||||
<td>`jqconsole-ansi-blink-rapid`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td>Hide text</td>
|
||||
<td>`jqconsole-ansi-hidden`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>9</td>
|
||||
<td>Line through text</td>
|
||||
<td>`jqconsole-ansi-line-through`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>10</td>
|
||||
<td>Remove all fonts</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11-19</td>
|
||||
<td>Add custom font</td>
|
||||
<td>`jqconsole-ansi-fonts-{N}` where N is code - 10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>20</td>
|
||||
<td>Add Fraktur font (not implemented in ansi.css)</td>
|
||||
<td>`jqconsole-ansi-fraktur`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>21</td>
|
||||
<td>Remove Bold and Faint effects</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>22</td>
|
||||
<td>Same as 21</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>23</td>
|
||||
<td>Remove italic and fraktur effects</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>24</td>
|
||||
<td>Remove underline effect</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>25</td>
|
||||
<td>Remove blinking effect(s).</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>28</td>
|
||||
<td>Reveal text</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>29</td>
|
||||
<td>Remove line-through effect</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>30-37</td>
|
||||
<td>Set foreground color to color from the color table below</td>
|
||||
<td>jqconsole-ansi-color-{COLOR} where {COLOR} is the color name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>39</td>
|
||||
<td>Restore default foreground color</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>40-47</td>
|
||||
<td>Set background color to color from the color table below</td>
|
||||
<td>`jqconsole-ansi-background-color-{COLOR}` where {COLOR} is the color name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>49</td>
|
||||
<td>Restore default background color</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>51</td>
|
||||
<td>Adds a frame around the text</td>
|
||||
<td>`jqconsole-ansi-framed`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>53</td>
|
||||
<td>Line above text</td>
|
||||
<td>jqconsole-ansi-overline</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>54</td>
|
||||
<td>Remove frame effect</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>55</td>
|
||||
<td>Remove over-line effect</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
###Colors
|
||||
[Reference](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors).
|
||||
<table>
|
||||
<tr>
|
||||
<th>Code offset</th>
|
||||
<th>Color</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>0</td>
|
||||
<td>Black</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Red</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Green</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Yellow</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>Blue</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td>Magenta</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td>Cyan</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7</td>
|
||||
<td>White</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
##CSS Classes
|
||||
|
||||
Several CSS classes are provided to help stylize the console:
|
||||
|
||||
* `jqconsole`: The main console container.
|
||||
* `jqconsole, jqconsole-blurred`: The main console container, when not in focus.
|
||||
* `jqconsole-cursor`: The cursor.
|
||||
* `jqconsole-header`: The welcome message at the top of the console.
|
||||
* `jqconsole-input`: The prompt area during input. May have multiple lines.
|
||||
* `jqconsole-old-input`: Previously-entered inputs.
|
||||
* `jqconsole-prompt`: The prompt area during prompting. May have multiple lines.
|
||||
* `jqconsole-old-prompt`: Previously-entered prompts.
|
||||
* `jqconsole-composition`: The div encapsulating the composition of multi-byte
|
||||
characters.
|
||||
|
||||
|
||||
Of course, custom classes may be specified when using `jqconsole.Write()` for
|
||||
further customization.
|
||||
|
||||
|
||||
##Contributors
|
||||
|
||||
[Max Shawabkeh](http://max99x.com/)
|
||||
[Amjad Masad](http://twitter.com/amjad_masad)
|
||||
173
lib/client/console/ansi.css
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
|
||||
.jqconsole-ansi-bold {
|
||||
/* font-weight: bold; */
|
||||
}
|
||||
|
||||
.jqconsole-ansi-lighter {
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@-webkit-keyframes blinker {
|
||||
from { opacity: 1.0; }
|
||||
to { opacity: 0.0; }
|
||||
}
|
||||
|
||||
@-moz-keyframes blinker {
|
||||
from { opacity: 1.0; }
|
||||
to { opacity: 0.0; }
|
||||
}
|
||||
|
||||
@-ms-keyframes blinker {
|
||||
from { opacity: 1.0; }
|
||||
to { opacity: 0.0; }
|
||||
}
|
||||
|
||||
@-o-keyframes blinker {
|
||||
from { opacity: 1.0; }
|
||||
to { opacity: 0.0; }
|
||||
}
|
||||
|
||||
.jqconsole-ansi-blink {
|
||||
-webkit-animation-name: blinker;
|
||||
-moz-animation-name: blinker;
|
||||
-ms-animation-name: blinker;
|
||||
-o-animation-name: blinker;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
-moz-animation-iteration-count: infinite;
|
||||
-ms-animation-iteration-count: infinite;
|
||||
-o-animation-iteration-count: infinite;
|
||||
-webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-o-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-webkit-animation-duration: 1s;
|
||||
-moz-animation-duration: 1s;
|
||||
-o-animation-duration: 1s;
|
||||
-ms-animation-duration: 1s;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-blink-rapid {
|
||||
-webkit-animation-name: blinker;
|
||||
-moz-animation-name: blinker;
|
||||
-ms-animation-name: blinker;
|
||||
-o-animation-name: blinker;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
-moz-animation-iteration-count: infinite;
|
||||
-ms-animation-iteration-count: infinite;
|
||||
-o-animation-iteration-count: infinite;
|
||||
-webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-o-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
|
||||
-webkit-animation-duration: 0.5s;
|
||||
-moz-animation-duration: 0.5s;
|
||||
-o-animation-duration: 0.5s;
|
||||
-ms-animation-duration: 0.5s;
|
||||
}
|
||||
|
||||
|
||||
.jqconsole-ansi-hidden {
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-line-through {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-fonts-1 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-2 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-3 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-4 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-5 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-6 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-7 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-8 {
|
||||
|
||||
}
|
||||
.jqconsole-ansi-fonts-9 {
|
||||
|
||||
}
|
||||
|
||||
.jqconsole-ansi-fraktur {
|
||||
|
||||
}
|
||||
|
||||
.jqconsole-ansi-color-black {
|
||||
color: black;
|
||||
}
|
||||
.jqconsole-ansi-color-red {
|
||||
color: red;
|
||||
}
|
||||
.jqconsole-ansi-color-green {
|
||||
color: #65b04b;
|
||||
}
|
||||
.jqconsole-ansi-color-yellow {
|
||||
color: #fed563;
|
||||
}
|
||||
.jqconsole-ansi-color-blue {
|
||||
color: rgb(49,123,249);
|
||||
}
|
||||
.jqconsole-ansi-color-magenta {
|
||||
color: magenta;
|
||||
}
|
||||
.jqconsole-ansi-color-cyan {
|
||||
color: cyan;
|
||||
}
|
||||
.jqconsole-ansi-color-white {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-background-color-black {
|
||||
background-color: black;
|
||||
}
|
||||
.jqconsole-ansi-background-color-red {
|
||||
background-color: red;
|
||||
}
|
||||
.jqconsole-ansi-background-color-green {
|
||||
background-color: #65b04b;
|
||||
}
|
||||
.jqconsole-ansi-background-color-yellow {
|
||||
background-color: #fed563;
|
||||
}
|
||||
.jqconsole-ansi-background-color-blue {
|
||||
background-color: blue;
|
||||
}
|
||||
.jqconsole-ansi-background-color-magenta {
|
||||
background-color: magenta;
|
||||
}
|
||||
.jqconsole-ansi-background-color-cyan {
|
||||
background-color: cyan;
|
||||
}
|
||||
.jqconsole-ansi-background-color-white {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.jqconsole-ansi-framed {
|
||||
border: 1px solid;
|
||||
}
|
||||
.jqconsole-ansi-overline {
|
||||
text-decoration: overline;
|
||||
}
|
||||
|
||||
1310
lib/client/console/jqconsole.coffee
Normal file
62
lib/client/console/jqconsole.css
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#console {
|
||||
height: 400px;
|
||||
width: 750px;
|
||||
position:relative;
|
||||
background-color: black;
|
||||
border: 2px solid #CCC;
|
||||
margin: 0 auto;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.error-msg{
|
||||
color: crimson;
|
||||
}
|
||||
|
||||
.log-msg{
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.error-msg, .log-msg{
|
||||
background-color: #f5f5f5;
|
||||
display: block;
|
||||
font: 16px "Droid Sans Mono";
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
background: beige;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.jqconsole {
|
||||
background: #fffdf9;
|
||||
padding: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.jqconsole-cursor {
|
||||
background-color: #999;
|
||||
}
|
||||
.jqconsole-blurred .jqconsole-cursor {
|
||||
background-color: #666;
|
||||
}
|
||||
.jqconsole-prompt {
|
||||
color: #4a473a
|
||||
}
|
||||
.jqconsole-old-prompt {
|
||||
color: #b7b4a8;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.brace {
|
||||
color: #00FFFF;
|
||||
}
|
||||
.paran {
|
||||
color: #FF00FF;
|
||||
}
|
||||
.bracket {
|
||||
color: #FFFF00;
|
||||
}
|
||||
.jqconsole-composition {
|
||||
background-color: red;
|
||||
}
|
||||
22
lib/client/console/jqconsole.jquery.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "jqconsole",
|
||||
"version": "2.7.7",
|
||||
"title": "Feature complete web terminal.",
|
||||
"author": {
|
||||
"name": "Amjad Masad",
|
||||
"email": "amjad.masad@gmail.com",
|
||||
"url": "http://amasad.me"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://opensource.org/licenses/MIT"
|
||||
}
|
||||
],
|
||||
"description": "A jQuery terminal plugin with raw input/output streams as well as input and output states and support for rich multi-line prompting and operation queueing.",
|
||||
"keywords": ["terminal", "console", "emulator", "REPL", "repl.it"],
|
||||
"demo": "http://repl.it/",
|
||||
"dependencies": {
|
||||
"jquery": ">=1.5"
|
||||
}
|
||||
}
|
||||
1512
lib/client/console/jqconsole.js
Normal file
|
|
@ -1,10 +1,11 @@
|
|||
/*!
|
||||
* jQuery Migrate - v1.0.0 - 2013-01-14
|
||||
* jQuery Migrate - v1.2.1 - 2013-05-08
|
||||
* https://github.com/jquery/jquery-migrate
|
||||
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
"use strict";
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
|
@ -15,6 +16,16 @@ jQuery.migrateWarnings = [];
|
|||
// Set to true to prevent console output; migrateWarnings still maintained
|
||||
// jQuery.migrateMute = false;
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
if ( !jQuery.migrateMute && window.console && window.console.log ) {
|
||||
window.console.log("JQMIGRATE: Logging is active");
|
||||
}
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
|
|
@ -22,11 +33,15 @@ jQuery.migrateReset = function() {
|
|||
};
|
||||
|
||||
function migrateWarn( msg) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( window.console && console.warn && !jQuery.migrateMute ) {
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,8 +80,8 @@ if ( document.compatMode === "BackCompat" ) {
|
|||
}
|
||||
|
||||
|
||||
var attrFn = {},
|
||||
attr = jQuery.attr,
|
||||
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
|
||||
oldAttr = jQuery.attr,
|
||||
valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
|
||||
function() { return null; },
|
||||
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
|
||||
|
|
@ -77,21 +92,27 @@ var attrFn = {},
|
|||
ruseDefault = /^(?:checked|selected)$/i;
|
||||
|
||||
// jQuery.attrFn
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
|
||||
|
||||
jQuery.attr = function( elem, name, value, pass ) {
|
||||
var lowerName = name.toLowerCase(),
|
||||
nType = elem && elem.nodeType;
|
||||
|
||||
if ( pass ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
|
||||
// Since pass is used internally, we only warn for new jQuery
|
||||
// versions where there isn't a pass arg in the formal params
|
||||
if ( oldAttr.length < 4 ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
}
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) &&
|
||||
(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
|
||||
return jQuery( elem )[ name ]( value );
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if user tries to set `type` since it breaks on IE 6/7/8
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) {
|
||||
// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
|
||||
// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
|
||||
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
|
||||
}
|
||||
|
||||
|
|
@ -131,11 +152,11 @@ jQuery.attr = function( elem, name, value, pass ) {
|
|||
|
||||
// Warn only for attributes that can remain distinct from their properties post-1.9
|
||||
if ( ruseDefault.test( lowerName ) ) {
|
||||
migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" );
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
return attr.call( jQuery, elem, name, value );
|
||||
return oldAttr.call( jQuery, elem, name, value );
|
||||
};
|
||||
|
||||
// attrHooks: value
|
||||
|
|
@ -146,7 +167,7 @@ jQuery.attrHooks.value = {
|
|||
return valueAttrGet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
|
||||
migrateWarn("jQuery.fn.attr('value') no longer gets properties");
|
||||
}
|
||||
return name in elem ?
|
||||
elem.value :
|
||||
|
|
@ -158,7 +179,7 @@ jQuery.attrHooks.value = {
|
|||
return valueAttrSet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
|
||||
migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
|
||||
}
|
||||
// Does not return so that setAttribute is also used
|
||||
elem.value = value;
|
||||
|
|
@ -168,26 +189,36 @@ jQuery.attrHooks.value = {
|
|||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
// Note this does NOT include the # XSS fix from 1.7!
|
||||
rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( selector )) && match[1] ) {
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( selector.charAt( 0 ) !== "<" ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
if ( context && context.context ) {
|
||||
// jQuery object as context; parseHTML expects a DOM object
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this, jQuery.parseHTML( jQuery.trim(selector), context, true ),
|
||||
return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
|
||||
context, rootjQuery );
|
||||
}
|
||||
}
|
||||
|
|
@ -195,6 +226,15 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
|
|||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json && json !== null ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
return oldParseJSON.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
|
|
@ -211,25 +251,28 @@ jQuery.uaMatch = function( ua ) {
|
|||
};
|
||||
};
|
||||
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", browser, "jQuery.browser is deprecated" );
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
|
|
@ -254,6 +297,14 @@ jQuery.sub = function() {
|
|||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text json": jQuery.parseJSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var oldFnData = jQuery.fn.data;
|
||||
|
||||
jQuery.fn.data = function( name ) {
|
||||
|
|
@ -274,8 +325,7 @@ jQuery.fn.data = function( name ) {
|
|||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i,
|
||||
oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
|
||||
oldFragment = jQuery.buildFragment;
|
||||
oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
|
|
@ -332,35 +382,6 @@ if ( !jQuery.clean ) {
|
|||
};
|
||||
}
|
||||
|
||||
jQuery.buildFragment = function( elems, context, scripts, selection ) {
|
||||
var ret,
|
||||
warning = "jQuery.buildFragment() is deprecated";
|
||||
|
||||
// Set context per 1.8 logic
|
||||
context = context || document;
|
||||
context = !context.nodeType && context[0] || context;
|
||||
context = context.ownerDocument || context;
|
||||
|
||||
try {
|
||||
ret = oldFragment.call( jQuery, elems, context, scripts, selection );
|
||||
|
||||
// jQuery < 1.8 required arrayish context; jQuery 1.9 fails on it
|
||||
} catch( x ) {
|
||||
ret = oldFragment.call( jQuery, elems, context.nodeType ? [ context ] : context[ 0 ], scripts, selection );
|
||||
|
||||
// Success from tweaking context means buildFragment was called by the user
|
||||
migrateWarn( warning );
|
||||
}
|
||||
|
||||
// jQuery < 1.9 returned an object instead of the fragment itself
|
||||
if ( !ret.fragment ) {
|
||||
migrateWarnProp( ret, "fragment", ret, warning );
|
||||
migrateWarnProp( ret, "cacheable", false, warning );
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
var eventAdd = jQuery.event.add,
|
||||
eventRemove = jQuery.event.remove,
|
||||
eventTrigger = jQuery.event.trigger,
|
||||
|
|
@ -371,7 +392,7 @@ var eventAdd = jQuery.event.add,
|
|||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
hoverHack = function( events ) {
|
||||
if ( typeof( events ) != "string" || jQuery.event.special.hover ) {
|
||||
if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
|
||||
return events;
|
||||
}
|
||||
if ( rhoverHack.test( events ) ) {
|
||||
|
|
@ -386,7 +407,9 @@ if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
|
|||
}
|
||||
|
||||
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
if ( jQuery.event.dispatch ) {
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Support for 'hover' pseudo-event and ajax event warnings
|
||||
jQuery.event.add = function( elem, types, handler, data, selector ){
|
||||
|
|
@ -464,7 +487,7 @@ jQuery.fn.die = function( types, fn ) {
|
|||
|
||||
// Turn global events into document-triggered events
|
||||
jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
|
||||
if ( !elem & !rajaxEvent.test( event ) ) {
|
||||
if ( !elem && !rajaxEvent.test( event ) ) {
|
||||
migrateWarn( "Global events are undocumented and deprecated" );
|
||||
}
|
||||
return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
|
||||
3373
lib/client/dom.js
148
lib/client/edit.js
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
var CloudCmd, Util, DOM, JsDiff, ace;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
CloudCmd.Edit = new EditProto(CloudCmd, Util, DOM);
|
||||
|
||||
function EditProto(CloudCmd, Util, DOM){
|
||||
var Name = 'Edit',
|
||||
Value,
|
||||
Edit = this,
|
||||
Ace,
|
||||
Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
|
||||
Element;
|
||||
|
||||
this.init = function(pCallBack) {
|
||||
var lFunc, lIsFunc = Util.isFunction(CloudCmd.View);
|
||||
|
||||
if (lIsFunc)
|
||||
lFunc = CloudCmd.View;
|
||||
else
|
||||
lFunc = Util.exec;
|
||||
|
||||
Util.loadOnLoad([
|
||||
Edit.show,
|
||||
load,
|
||||
lFunc
|
||||
]);
|
||||
|
||||
DOM.Events.addKey(listener);
|
||||
DOM.setButtonKey('f4', Edit.show);
|
||||
|
||||
delete Edit.init;
|
||||
};
|
||||
|
||||
this.show = function(pValue) {
|
||||
var lMode, lSession;
|
||||
|
||||
Images.showLoad();
|
||||
|
||||
if (!Element) {
|
||||
Element = DOM.anyload({
|
||||
name : 'div',
|
||||
className : 'edit',
|
||||
style :
|
||||
'width : 100%;' +
|
||||
'height : 100%;' +
|
||||
'font : 16px "Droid Sans Mono";' +
|
||||
'position: absolute;',
|
||||
not_append : true
|
||||
});
|
||||
|
||||
Ace = ace.edit(Element);
|
||||
lSession = Ace.getSession();
|
||||
|
||||
Ace.setTheme('ace/theme/tomorrow_night_blue');
|
||||
lSession.setMode('ace/mode/javascript');
|
||||
Ace.setShowPrintMargin(false);
|
||||
Ace.setShowInvisibles(true);
|
||||
lSession.setUseSoftTabs(true);
|
||||
|
||||
Ace.commands.addCommand({
|
||||
name : 'hide',
|
||||
bindKey : { win: 'Esc', mac: 'Esc' },
|
||||
exec : function () {
|
||||
Edit.hide();
|
||||
}
|
||||
});
|
||||
|
||||
Ace.commands.addCommand({
|
||||
name : 'save',
|
||||
bindKey : { win: 'Ctrl-S', mac: 'Command-S' },
|
||||
exec : function (pEditor) {
|
||||
var lPath = DOM.getCurrentPath(),
|
||||
lValue = Ace.getValue();
|
||||
|
||||
if ( Util.strCmp(Value, lValue) )
|
||||
Util.log('edit: nothing to save');
|
||||
else
|
||||
DOM.RESTfull.save(lPath, lValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ( Util.isString(pValue) ) {
|
||||
Ace.setValue(pValue);
|
||||
CloudCmd.View.show(Element, focus);
|
||||
Key.unsetBind();
|
||||
}
|
||||
else {
|
||||
DOM.getCurrentData({
|
||||
success : function(pData){
|
||||
var lValue = '';
|
||||
|
||||
if (pData)
|
||||
lValue = pData.data;
|
||||
|
||||
Value = lValue;
|
||||
Ace.setValue(lValue);
|
||||
CloudCmd.View.show(Element, focus);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.hide = function(){
|
||||
CloudCmd.View.hide();
|
||||
};
|
||||
|
||||
function focus() {
|
||||
Ace.focus();
|
||||
Ace.clearSelection();
|
||||
Ace.moveCursorTo(0, 0);
|
||||
}
|
||||
|
||||
function load(pCallBack){
|
||||
Util.time(Name + ' load');
|
||||
|
||||
var lDir = CloudCmd.LIBDIRCLIENT + 'edit/',
|
||||
|
||||
lFiles = [
|
||||
lDir + 'mode-javascript.js',
|
||||
lDir + 'worker-javascript.js',
|
||||
lDir + 'ace.js',
|
||||
];
|
||||
|
||||
DOM.anyLoadOnLoad(lFiles, function(){
|
||||
Util.timeEnd(Name + ' load');
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
function listener(pEvent){
|
||||
var lF4, lKey, lIsBind = Key.isBind();
|
||||
|
||||
if (lIsBind) {
|
||||
lF4 = Key.F4,
|
||||
lKey = pEvent.keyCode;
|
||||
|
||||
if(lKey === lF4)
|
||||
Edit.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
447
lib/client/edit/ext-searchbox.js
Normal file
|
|
@ -0,0 +1,447 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use 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 Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* 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 AJAX.ORG B.V. 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.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define('ace/ext/searchbox', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/event', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) {
|
||||
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
var lang = require("../lib/lang");
|
||||
var event = require("../lib/event");
|
||||
var searchboxCss = "\
|
||||
/* ------------------------------------------------------------------------------------------\
|
||||
* Editor Search Form\
|
||||
* --------------------------------------------------------------------------------------- */\
|
||||
.ace_search {\
|
||||
background-color: #ddd;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
border-top: 0 none;\
|
||||
max-width: 297px;\
|
||||
overflow: hidden;\
|
||||
margin: 0;\
|
||||
padding: 4px;\
|
||||
padding-right: 6px;\
|
||||
padding-bottom: 0;\
|
||||
position: absolute;\
|
||||
top: 0px;\
|
||||
z-index: 99;\
|
||||
}\
|
||||
.ace_search.left {\
|
||||
border-left: 0 none;\
|
||||
border-radius: 0px 0px 5px 0px;\
|
||||
left: 0;\
|
||||
}\
|
||||
.ace_search.right {\
|
||||
border-radius: 0px 0px 0px 5px;\
|
||||
border-right: 0 none;\
|
||||
right: 0;\
|
||||
}\
|
||||
.ace_search_form, .ace_replace_form {\
|
||||
border-radius: 3px;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
float: left;\
|
||||
margin-bottom: 4px;\
|
||||
overflow: hidden;\
|
||||
}\
|
||||
.ace_search_form.ace_nomatch {\
|
||||
outline: 1px solid red;\
|
||||
}\
|
||||
.ace_search_field {\
|
||||
background-color: white;\
|
||||
border-right: 1px solid #cbcbcb;\
|
||||
border: 0 none;\
|
||||
-webkit-box-sizing: border-box;\
|
||||
-moz-box-sizing: border-box;\
|
||||
box-sizing: border-box;\
|
||||
display: block;\
|
||||
float: left;\
|
||||
height: 22px;\
|
||||
outline: 0;\
|
||||
padding: 0 7px;\
|
||||
width: 214px;\
|
||||
margin: 0;\
|
||||
}\
|
||||
.ace_searchbtn,\
|
||||
.ace_replacebtn {\
|
||||
background: #fff;\
|
||||
border: 0 none;\
|
||||
border-left: 1px solid #dcdcdc;\
|
||||
cursor: pointer;\
|
||||
display: block;\
|
||||
float: left;\
|
||||
height: 22px;\
|
||||
margin: 0;\
|
||||
padding: 0;\
|
||||
position: relative;\
|
||||
}\
|
||||
.ace_searchbtn:last-child,\
|
||||
.ace_replacebtn:last-child {\
|
||||
border-top-right-radius: 3px;\
|
||||
border-bottom-right-radius: 3px;\
|
||||
}\
|
||||
.ace_searchbtn:disabled {\
|
||||
background: none;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_searchbtn {\
|
||||
background-position: 50% 50%;\
|
||||
background-repeat: no-repeat;\
|
||||
width: 27px;\
|
||||
}\
|
||||
.ace_searchbtn.prev {\
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \
|
||||
}\
|
||||
.ace_searchbtn.next {\
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \
|
||||
}\
|
||||
.ace_searchbtn_close {\
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\
|
||||
border-radius: 50%;\
|
||||
border: 0 none;\
|
||||
color: #656565;\
|
||||
cursor: pointer;\
|
||||
display: block;\
|
||||
float: right;\
|
||||
font-family: Arial;\
|
||||
font-size: 16px;\
|
||||
height: 14px;\
|
||||
line-height: 16px;\
|
||||
margin: 5px 1px 9px 5px;\
|
||||
padding: 0;\
|
||||
text-align: center;\
|
||||
width: 14px;\
|
||||
}\
|
||||
.ace_searchbtn_close:hover {\
|
||||
background-color: #656565;\
|
||||
background-position: 50% 100%;\
|
||||
color: white;\
|
||||
}\
|
||||
.ace_replacebtn.prev {\
|
||||
width: 54px\
|
||||
}\
|
||||
.ace_replacebtn.next {\
|
||||
width: 27px\
|
||||
}\
|
||||
.ace_button {\
|
||||
margin-left: 2px;\
|
||||
cursor: pointer;\
|
||||
-webkit-user-select: none;\
|
||||
-moz-user-select: none;\
|
||||
-o-user-select: none;\
|
||||
-ms-user-select: none;\
|
||||
user-select: none;\
|
||||
overflow: hidden;\
|
||||
opacity: 0.7;\
|
||||
border: 1px solid rgba(100,100,100,0.23);\
|
||||
padding: 1px;\
|
||||
-moz-box-sizing: border-box;\
|
||||
box-sizing: border-box;\
|
||||
color: black;\
|
||||
}\
|
||||
.ace_button:hover {\
|
||||
background-color: #eee;\
|
||||
opacity:1;\
|
||||
}\
|
||||
.ace_button:active {\
|
||||
background-color: #ddd;\
|
||||
}\
|
||||
.ace_button.checked {\
|
||||
border-color: #3399ff;\
|
||||
opacity:1;\
|
||||
}\
|
||||
.ace_search_options{\
|
||||
margin-bottom: 3px;\
|
||||
text-align: right;\
|
||||
-webkit-user-select: none;\
|
||||
-moz-user-select: none;\
|
||||
-o-user-select: none;\
|
||||
-ms-user-select: none;\
|
||||
user-select: none;\
|
||||
}";
|
||||
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
||||
var keyUtil = require("../lib/keys");
|
||||
|
||||
dom.importCssString(searchboxCss, "ace_searchbox");
|
||||
|
||||
var html = '<div class="ace_search right">\
|
||||
<button type="button" action="hide" class="ace_searchbtn_close"></button>\
|
||||
<div class="ace_search_form">\
|
||||
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
|
||||
<button type="button" action="findNext" class="ace_searchbtn next"></button>\
|
||||
<button type="button" action="findPrev" class="ace_searchbtn prev"></button>\
|
||||
</div>\
|
||||
<div class="ace_replace_form">\
|
||||
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
|
||||
<button type="button" action="replace" class="ace_replacebtn">Replace</button>\
|
||||
<button type="button" action="replaceAll" class="ace_replacebtn">All</button>\
|
||||
</div>\
|
||||
<div class="ace_search_options">\
|
||||
<span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span>\
|
||||
<span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span>\
|
||||
<span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span>\
|
||||
</div>\
|
||||
</div>'.replace(/>\s+/g, ">");
|
||||
|
||||
var SearchBox = function(editor, range, showReplaceForm) {
|
||||
var div = dom.createElement("div");
|
||||
div.innerHTML = html;
|
||||
this.element = div.firstChild;
|
||||
|
||||
this.$init();
|
||||
this.setEditor(editor);
|
||||
};
|
||||
|
||||
(function() {
|
||||
this.setEditor = function(editor) {
|
||||
editor.searchBox = this;
|
||||
editor.container.appendChild(this.element);
|
||||
this.editor = editor;
|
||||
};
|
||||
|
||||
this.$init = function() {
|
||||
var sb = this.element;
|
||||
|
||||
this.searchBox = sb.querySelector(".ace_search_form");
|
||||
this.replaceBox = sb.querySelector(".ace_replace_form");
|
||||
this.searchOptions = sb.querySelector(".ace_search_options");
|
||||
this.regExpOption = sb.querySelector("[action=toggleRegexpMode]");
|
||||
this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]");
|
||||
this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]");
|
||||
this.searchInput = this.searchBox.querySelector(".ace_search_field");
|
||||
this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
|
||||
|
||||
var _this = this;
|
||||
event.addListener(sb, "mousedown", function(e) {
|
||||
setTimeout(function(){
|
||||
_this.activeInput.focus();
|
||||
}, 0);
|
||||
event.stopPropagation(e);
|
||||
});
|
||||
event.addListener(sb, "click", function(e) {
|
||||
var t = e.target;
|
||||
var action = t.getAttribute("action");
|
||||
if (action && _this[action])
|
||||
_this[action]();
|
||||
else if (_this.$searchBarKb.commands[action])
|
||||
_this.$searchBarKb.commands[action].exec(_this);
|
||||
event.stopPropagation(e);
|
||||
});
|
||||
|
||||
event.addCommandKeyListener(sb, function(e, hashId, keyCode) {
|
||||
var keyString = keyUtil.keyCodeToString(keyCode);
|
||||
var command = _this.$searchBarKb.findKeyCommand(hashId, keyString);
|
||||
if (command && command.exec) {
|
||||
command.exec(_this);
|
||||
event.stopEvent(e);
|
||||
}
|
||||
});
|
||||
|
||||
this.$onChange = lang.delayedCall(function() {
|
||||
_this.find(false, false);
|
||||
});
|
||||
|
||||
event.addListener(this.searchInput, "input", function() {
|
||||
_this.$onChange.schedule(20);
|
||||
});
|
||||
event.addListener(this.searchInput, "focus", function() {
|
||||
_this.activeInput = _this.searchInput;
|
||||
_this.searchInput.value && _this.highlight();
|
||||
});
|
||||
event.addListener(this.replaceInput, "focus", function() {
|
||||
_this.activeInput = _this.replaceInput;
|
||||
_this.searchInput.value && _this.highlight();
|
||||
});
|
||||
};
|
||||
this.$closeSearchBarKb = new HashHandler([{
|
||||
bindKey: "Esc",
|
||||
name: "closeSearchBar",
|
||||
exec: function(editor) {
|
||||
editor.searchBox.hide();
|
||||
}
|
||||
}]);
|
||||
this.$searchBarKb = new HashHandler();
|
||||
this.$searchBarKb.bindKeys({
|
||||
"Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) {
|
||||
var isReplace = sb.isReplace = !sb.isReplace;
|
||||
sb.replaceBox.style.display = isReplace ? "" : "none";
|
||||
sb[isReplace ? "replaceInput" : "searchInput"].focus();
|
||||
},
|
||||
"Ctrl-G|Command-G": function(sb) {
|
||||
sb.findNext();
|
||||
},
|
||||
"Ctrl-Shift-G|Command-Shift-G": function(sb) {
|
||||
sb.findPrev();
|
||||
},
|
||||
"esc": function(sb) {
|
||||
setTimeout(function() { sb.hide();});
|
||||
},
|
||||
"Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replace();
|
||||
sb.findNext();
|
||||
},
|
||||
"Shift-Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replace();
|
||||
sb.findPrev();
|
||||
},
|
||||
"Tab": function(sb) {
|
||||
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
|
||||
}
|
||||
});
|
||||
|
||||
this.$searchBarKb.addCommands([{
|
||||
name: "toggleRegexpMode",
|
||||
bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"},
|
||||
exec: function(sb) {
|
||||
sb.regExpOption.checked = !sb.regExpOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}, {
|
||||
name: "toggleCaseSensitive",
|
||||
bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"},
|
||||
exec: function(sb) {
|
||||
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}, {
|
||||
name: "toggleWholeWords",
|
||||
bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"},
|
||||
exec: function(sb) {
|
||||
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}]);
|
||||
|
||||
this.$syncOptions = function() {
|
||||
dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked);
|
||||
dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked);
|
||||
dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
|
||||
this.find(false, false);
|
||||
};
|
||||
|
||||
this.highlight = function(re) {
|
||||
this.editor.session.highlight(re || this.editor.$search.$options.re);
|
||||
this.editor.renderer.updateBackMarkers()
|
||||
};
|
||||
this.find = function(skipCurrent, backwards) {
|
||||
var range = this.editor.find(this.searchInput.value, {
|
||||
skipCurrent: skipCurrent,
|
||||
backwards: backwards,
|
||||
wrap: true,
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked
|
||||
});
|
||||
dom.setCssClass(this.searchBox, "ace_nomatch", !range && this.searchInput.value);
|
||||
this.highlight();
|
||||
};
|
||||
this.findNext = function() {
|
||||
this.find(true, false);
|
||||
};
|
||||
this.findPrev = function() {
|
||||
this.find(true, true);
|
||||
};
|
||||
this.replace = function() {
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
};
|
||||
this.replaceAll = function() {
|
||||
this.editor.replaceAll(this.replaceInput.value);
|
||||
};
|
||||
|
||||
this.hide = function() {
|
||||
this.element.style.display = "none";
|
||||
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
|
||||
this.editor.focus();
|
||||
};
|
||||
this.show = function(value, isReplace) {
|
||||
this.element.style.display = "";
|
||||
this.replaceBox.style.display = isReplace ? "" : "none";
|
||||
|
||||
this.isReplace = isReplace;
|
||||
|
||||
if (value)
|
||||
this.searchInput.value = value;
|
||||
this.searchInput.focus();
|
||||
this.searchInput.select();
|
||||
|
||||
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
|
||||
};
|
||||
|
||||
}).call(SearchBox.prototype);
|
||||
|
||||
exports.SearchBox = SearchBox;
|
||||
|
||||
exports.Search = function(editor, isReplace) {
|
||||
var sb = editor.searchBox || new SearchBox(editor);
|
||||
sb.show(editor.session.getTextRange(), isReplace);
|
||||
};
|
||||
|
||||
|
||||
exports.ISearch = function(session, options) {
|
||||
this.$changeListener = this.$changeListener.bind(this);
|
||||
this.startRange = session.selection.toOrientedRange();
|
||||
this.options = options || {};
|
||||
};
|
||||
|
||||
(function(){
|
||||
this.setSession = function(session) {
|
||||
if (this.session) {
|
||||
this.session.removeListener(this.$changeListener);
|
||||
}
|
||||
this.session = session;
|
||||
this.session.addListener(this.$changeListener);
|
||||
};
|
||||
this.setSearchString = function() {
|
||||
|
||||
};
|
||||
this.getValue = function() {
|
||||
if (this.value == null)
|
||||
this.value = this.session.getValue();
|
||||
return this.value;
|
||||
};
|
||||
this.$changeListener = function() {
|
||||
this.value = null;
|
||||
};
|
||||
this.find = function() {
|
||||
|
||||
};
|
||||
this.$edgeBefore = function() {
|
||||
this.cursor = this.startRange[this.options.backwards ? "start" : "end"];
|
||||
};
|
||||
this.$edgeAfter = function() {
|
||||
|
||||
};
|
||||
this.next = function(dir) {
|
||||
|
||||
};
|
||||
}).call(exports.ISearch.prototype);
|
||||
|
||||
|
||||
});
|
||||
145
lib/client/edit/theme-tomorrow_night_blue.js
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use 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 Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* 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 AJAX.ORG B.V. 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.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define('ace/theme/tomorrow_night_blue', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night-blue";
|
||||
exports.cssText = ".ace-tomorrow-night-blue .ace_gutter {\
|
||||
background: #00204b;\
|
||||
color: #7388b5\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_print-margin {\
|
||||
width: 1px;\
|
||||
background: #00204b\
|
||||
}\
|
||||
.ace-tomorrow-night-blue {\
|
||||
background-color: #002451;\
|
||||
color: #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_other {\
|
||||
color: #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_cursor {\
|
||||
border-left: 2px solid #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_overwrite-cursors .ace_cursor {\
|
||||
border-left: 0px;\
|
||||
border-bottom: 1px solid #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
|
||||
background: #003F8E\
|
||||
}\
|
||||
.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {\
|
||||
box-shadow: 0 0 3px 0px #002451;\
|
||||
border-radius: 2px\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
|
||||
background: rgb(127, 111, 19)\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\
|
||||
margin: -1px 0 0 -1px;\
|
||||
border: 1px solid #404F7D\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {\
|
||||
background: #00346E\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_gutter-active-line {\
|
||||
background-color: #022040\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {\
|
||||
border: 1px solid #003F8E\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_invisible {\
|
||||
color: #404F7D\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_keyword,\
|
||||
.ace-tomorrow-night-blue .ace_meta,\
|
||||
.ace-tomorrow-night-blue .ace_storage,\
|
||||
.ace-tomorrow-night-blue .ace_storage.ace_type,\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_type {\
|
||||
color: #EBBBFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_keyword.ace_operator {\
|
||||
color: #99FFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_character,\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_language,\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_numeric,\
|
||||
.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_constant,\
|
||||
.ace-tomorrow-night-blue .ace_variable.ace_parameter {\
|
||||
color: #FFC58F\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_invalid {\
|
||||
color: #FFFFFF;\
|
||||
background-color: #F99DA5\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\
|
||||
color: #FFFFFF;\
|
||||
background-color: #EBBBFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_fold {\
|
||||
background-color: #BBDAFF;\
|
||||
border-color: #FFFFFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_function,\
|
||||
.ace-tomorrow-night-blue .ace_variable {\
|
||||
color: #BBDAFF\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_class,\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_type {\
|
||||
color: #FFEEAD\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_markup.ace_heading,\
|
||||
.ace-tomorrow-night-blue .ace_string {\
|
||||
color: #D1F1A9\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,\
|
||||
.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,\
|
||||
.ace-tomorrow-night-blue .ace_meta.ace_tag,\
|
||||
.ace-tomorrow-night-blue .ace_string.ace_regexp,\
|
||||
.ace-tomorrow-night-blue .ace_variable {\
|
||||
color: #FF9DA4\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_comment {\
|
||||
color: #7285B7\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_markup.ace_underline {\
|
||||
text-decoration: underline\
|
||||
}\
|
||||
.ace-tomorrow-night-blue .ace_indent-guide {\
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y;\
|
||||
}";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
6447
lib/client/edit/worker-javascript.js
Normal file
|
|
@ -1,207 +0,0 @@
|
|||
var CloudCommander, CloudFunc, ace;
|
||||
/* object contains editors Ace
|
||||
* and later will be Ace
|
||||
*/
|
||||
(function(){
|
||||
"use strict";
|
||||
var cloudcmd = CloudCommander,
|
||||
Util = CloudCommander.Util,
|
||||
KeyBinding = CloudCommander.KeyBinding,
|
||||
AceEditor = {},
|
||||
AceLoaded = false,
|
||||
ReadOnly = false,
|
||||
AceElement,
|
||||
FM;
|
||||
|
||||
CloudCommander.Editor = {
|
||||
get : (function(){
|
||||
return this.Ace;
|
||||
})
|
||||
};
|
||||
|
||||
cloudcmd.Editor.dir = 'lib/client/editor/';
|
||||
AceEditor.dir = cloudcmd.Editor.dir + 'ace/';
|
||||
|
||||
|
||||
/* private functions */
|
||||
function initCodeMirror(pValue){
|
||||
if(!FM)
|
||||
FM = Util.getById('fm');
|
||||
|
||||
AceElement = Util.anyload({
|
||||
name : 'div',
|
||||
id : 'CodeMirrorEditor',
|
||||
className : 'panel',
|
||||
parent : FM
|
||||
});
|
||||
|
||||
var editor = ace.edit("AceEditor");
|
||||
|
||||
editor.setTheme("ace/theme/tomorrow_night_blue");
|
||||
editor.getSession().setMode("ace/mode/javascript");
|
||||
|
||||
/*
|
||||
editor.commands.addCommand({
|
||||
name : 'new_command',
|
||||
//bindKey : {win: 'Esc', mac: 'Esc'},
|
||||
bindKey: {win: 'Ctrl-M', mac: 'Command-M'},
|
||||
exec : function(pEditor){
|
||||
lThis.hide();
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
editor.setReadOnly(ReadOnly);
|
||||
|
||||
editor.setValue(pValue);
|
||||
}
|
||||
|
||||
/* indicator says Ace still loads */
|
||||
AceEditor.loading = false;
|
||||
|
||||
/* function loads Ace js and css files */
|
||||
AceEditor.load = (function(){
|
||||
Util.cssSet({id:'editor',
|
||||
inner : '#AceEditor{' +
|
||||
'font-size : 15px;' +
|
||||
'padding : 0 0 0 0;' +
|
||||
'}'
|
||||
});
|
||||
|
||||
/* load Ace main module */
|
||||
Util.jsload(AceEditor.dir + 'ace.js', function() {
|
||||
Util.jsload(AceEditor.dir + 'mode-javascript.js',
|
||||
function(){
|
||||
AceLoaded = true;
|
||||
AceEditor.show();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/* function shows Ace editor */
|
||||
AceEditor.show = (function(){
|
||||
/* if Ace function show already
|
||||
* called do not call it again
|
||||
* if f4 key pressed couple times
|
||||
*/
|
||||
if(this.loading)
|
||||
return;
|
||||
|
||||
if(!AceLoaded){
|
||||
return AceEditor.load();
|
||||
}
|
||||
|
||||
/* getting link */
|
||||
var lCurrentFile = Util.getCurrentFile(),
|
||||
lA = Util.getCurrentLink(lCurrentFile);
|
||||
lA = lA.href;
|
||||
|
||||
/* убираем адрес хоста*/
|
||||
lA = '/' + lA.replace(document.location.href,'');
|
||||
|
||||
/* checking is this link is to directory */
|
||||
var lSize = Util.getByClass('size', lCurrentFile);
|
||||
if(lSize){
|
||||
lSize = lSize[0].textContent;
|
||||
|
||||
/* if directory - load json
|
||||
* not html data
|
||||
*/
|
||||
if (lSize === '<dir>')
|
||||
/* when folder view
|
||||
* is no need to edit
|
||||
* data
|
||||
*/
|
||||
ReadOnly = true;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
setTimeout(function(){
|
||||
lThis.loading = false;},
|
||||
400);
|
||||
|
||||
/* reading data from current file */
|
||||
Util.ajax({
|
||||
url:lA,
|
||||
error: (function(jqXHR, textStatus, errorThrown){
|
||||
lThis.loading = false;
|
||||
|
||||
return Util.Images.showError(jqXHR);
|
||||
}),
|
||||
|
||||
success:function(data, textStatus, jqXHR){
|
||||
/* if we got json - show it */
|
||||
if(typeof data === 'object')
|
||||
data = JSON.stringify(data, null, 4);
|
||||
|
||||
initAce_f(data);
|
||||
|
||||
/* removing keyBinding if set */
|
||||
KeyBinding.unSet();
|
||||
|
||||
Util.hidePanel();
|
||||
Util.Images.hideLoad();
|
||||
|
||||
lThis.loading = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* function hides Ace editor */
|
||||
AceEditor.hide = (function() {
|
||||
var lElem = AceElement;
|
||||
KeyBinding.set();
|
||||
|
||||
if(lElem && FM)
|
||||
FM.removeChild(lElem);
|
||||
|
||||
Util.showPanel();
|
||||
});
|
||||
|
||||
cloudcmd.Editor.Keys = (function(pCurrentFile, pIsReadOnly){
|
||||
"use strict";
|
||||
|
||||
var lThis = this.Ace;
|
||||
/* loading js and css of Ace */
|
||||
this.Ace.show(pCurrentFile, pIsReadOnly);
|
||||
|
||||
var key_event = function(pEvent){
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if( KeyBinding.get() ){
|
||||
/* if f4 or f3 pressed */
|
||||
var lF3 = cloudcmd.KEY.F3;
|
||||
var lF4 = cloudcmd.KEY.F4;
|
||||
var lShow = Util.bind(lThis.show, lThis);
|
||||
|
||||
if(!pEvent.shiftKey){
|
||||
if(pEvent.keyCode === lF4)
|
||||
lShow();
|
||||
else if(pEvent.keyCode === lF3){
|
||||
lShow(true);
|
||||
}
|
||||
}
|
||||
}else if (pEvent.keyCode === cloudcmd.KEY.ESC)
|
||||
AceEditor.hide();
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
if (document.addEventListener)
|
||||
document.addEventListener('keydown', key_event,false);
|
||||
|
||||
else{
|
||||
var lFunc;
|
||||
if(typeof document.onkeydown === 'function')
|
||||
lFunc = document.onkeydown;
|
||||
|
||||
document.onkeydown = function(){
|
||||
if(lFunc)
|
||||
lFunc();
|
||||
|
||||
key_event();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
cloudcmd.Editor.Ace = AceEditor;
|
||||
})();
|
||||
|
|
@ -1,218 +0,0 @@
|
|||
var CloudCommander, Util, DOM, CodeMirror;
|
||||
/* object contains editors CodeMirror */
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var KeyBinding = CloudCommander.KeyBinding,
|
||||
CodeMirrorEditor = {},
|
||||
FM,
|
||||
CodeMirrorElement,
|
||||
CodeMirrorLoaded = false,
|
||||
/* indicator says CodeMirror still loads */
|
||||
Loading = false,
|
||||
ReadOnly = false,
|
||||
|
||||
CallBacks = [
|
||||
hide,
|
||||
initCodeMirror,
|
||||
show,
|
||||
load
|
||||
];
|
||||
|
||||
CloudCmd.Editor = {
|
||||
get : (function(){
|
||||
return this.CodeMirror;
|
||||
})
|
||||
};
|
||||
|
||||
/* private functions */
|
||||
|
||||
function setCSS(){
|
||||
var lPosition = DOM.getPanel().id,
|
||||
lRet = DOM.cssSet({
|
||||
id : 'editor',
|
||||
inner : '.CodeMirror{' +
|
||||
'font-family' + ': \'Droid Sans Mono\';' +
|
||||
'font-size' + ': 15px;' +
|
||||
'}' +
|
||||
'.CodeMirror-scroll{' +
|
||||
'height' + ':' + CloudCmd.HEIGHT + 'px' +
|
||||
'}' +
|
||||
'#CodeMirrorEditor{' +
|
||||
'float' + ':' + lPosition +
|
||||
'}'
|
||||
});
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* function initialize CodeMirror
|
||||
* @param {value, callback}
|
||||
*/
|
||||
function initCodeMirror(pParams){
|
||||
if(!FM)
|
||||
FM = DOM.getFM();
|
||||
|
||||
var lCSS = setCSS(),
|
||||
lCurrent = DOM.getCurrentFile(),
|
||||
lPath = DOM.getCurrentPath( lCurrent );
|
||||
|
||||
CodeMirrorElement = DOM.anyload({
|
||||
name : 'div',
|
||||
id : 'CodeMirrorEditor',
|
||||
className : 'panel',
|
||||
parent : FM
|
||||
});
|
||||
|
||||
var lEditor = CodeMirrorEditor.CodeMirror = new CodeMirror(CodeMirrorElement,{
|
||||
mode : 'javascript',
|
||||
value : pParams && pParams.data && pParams.data.data,
|
||||
theme : 'night',
|
||||
lineNumbers : true,
|
||||
//переносим длинные строки
|
||||
lineWrapping: false,
|
||||
autofocus : true,
|
||||
extraKeys: {
|
||||
/* Exit */
|
||||
'Esc': function(){
|
||||
Util.exec(pParams);
|
||||
DOM.remove(lCSS, document.head);
|
||||
},
|
||||
|
||||
/* Save */
|
||||
'Ctrl-S': function(){
|
||||
var lValue = lEditor.getValue();
|
||||
|
||||
DOM.setCurrentSize( lValue.length, lCurrent );
|
||||
DOM.RESTfull.save( lPath, lValue );
|
||||
}
|
||||
},
|
||||
readOnly : ReadOnly
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function loads CodeMirror js and css files
|
||||
*/
|
||||
function load(pCallBack){
|
||||
Util.time('codemirror load');
|
||||
var lDir = CloudCmd.LIBDIRCLIENT + 'editor/codemirror/',
|
||||
lFiles =
|
||||
[
|
||||
[
|
||||
lDir + 'codemirror.css',
|
||||
lDir + 'theme/night.css',
|
||||
lDir + 'mode/javascript.js',
|
||||
],
|
||||
|
||||
lDir + 'codemirror.js'
|
||||
];
|
||||
|
||||
DOM.anyLoadOnLoad(lFiles, function(){
|
||||
Util.timeEnd('codemirror load');
|
||||
CodeMirrorLoaded = true;
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function shows CodeMirror editor
|
||||
*/
|
||||
function show(pCallBack){
|
||||
|
||||
/* if CodeMirror function show already
|
||||
* called do not call it again
|
||||
* if f4 key pressed couple times
|
||||
*/
|
||||
if(!Loading){
|
||||
/* checking is this link is to directory
|
||||
* when folder view is no need to edit data */
|
||||
ReadOnly = DOM.isCurrentIsDir();
|
||||
|
||||
Loading = true;
|
||||
|
||||
var lFalseLoading = function(){ Loading = false; };
|
||||
|
||||
setTimeout(lFalseLoading, 400);
|
||||
|
||||
DOM.getCurrentData({
|
||||
error : lFalseLoading,
|
||||
success : function(data){
|
||||
if( DOM.hidePanel() ){
|
||||
Util.exec(pCallBack, data);
|
||||
KeyBinding.unSet();
|
||||
}
|
||||
|
||||
DOM.Images.hideLoad();
|
||||
lFalseLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function hides CodeMirror editor
|
||||
*/
|
||||
function hide() {
|
||||
var lElem = CodeMirrorElement;
|
||||
KeyBinding.set();
|
||||
|
||||
if(lElem && FM)
|
||||
FM.removeChild(lElem);
|
||||
|
||||
DOM.showPanel();
|
||||
}
|
||||
|
||||
/**
|
||||
* function calls all CodeMirror editor functions
|
||||
*/
|
||||
CodeMirrorEditor.show = function(){
|
||||
DOM.Images.showLoad();
|
||||
Util.loadOnLoad( CallBacks );
|
||||
};
|
||||
|
||||
/**
|
||||
* function hides CodeMirror editor
|
||||
*/
|
||||
CodeMirrorEditor.hide = hide;
|
||||
|
||||
/**
|
||||
* function bind keys
|
||||
*/
|
||||
CloudCmd.Editor.init = function(pReadOnly){
|
||||
ReadOnly = pReadOnly;
|
||||
|
||||
CodeMirrorEditor.show();
|
||||
CallBacks.pop();
|
||||
|
||||
var lKeyListener = function(pEvent){
|
||||
/* если клавиши можно обрабатывать */
|
||||
if( KeyBinding.get() ){
|
||||
/* if f4 or f3 pressed */
|
||||
var lF3 = CloudCmd.KEY.F3,
|
||||
lF4 = CloudCmd.KEY.F4;
|
||||
|
||||
if(!pEvent.shiftKey)
|
||||
switch(pEvent.keyCode)
|
||||
{
|
||||
case lF4:
|
||||
ReadOnly = false;
|
||||
CodeMirrorEditor.show();
|
||||
break;
|
||||
case lF3:
|
||||
ReadOnly = true;
|
||||
CodeMirrorEditor.show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
DOM .addKeyListener( lKeyListener )
|
||||
.setButtonKey('f4', CodeMirrorEditor.show);
|
||||
};
|
||||
|
||||
CloudCmd.Editor.CodeMirror = CodeMirrorEditor;
|
||||
|
||||
})(CloudCommander, Util, DOM);
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
2011.08.02, Version 0.2.0
|
||||
|
||||
* Split view (Julian Viereck)
|
||||
- split editor area horizontally or vertivally to show two files at the same
|
||||
time
|
||||
|
||||
* Code Folding (Julian Viereck)
|
||||
- Unstructured code folding
|
||||
- Will be the basis for language aware folding
|
||||
|
||||
* Mode behaviours (Chris Spencer)
|
||||
- Adds mode specific hooks which allow transformations of entered text
|
||||
- Autoclosing of braces, paranthesis and quotation marks in C style modes
|
||||
- Autoclosing of angular brackets in XML style modes
|
||||
|
||||
* New language modes
|
||||
- Clojure (Carin Meier)
|
||||
- C# (Rob Conery)
|
||||
- Groovy (Ben Tilford)
|
||||
- Scala (Ben Tilford)
|
||||
- JSON
|
||||
- OCaml (Sergi Mansilla)
|
||||
- Perl (Panagiotis Astithas)
|
||||
- SCSS/SASS (Andreas Madsen)
|
||||
- SVG
|
||||
- Textile (Kelley van Evert)
|
||||
- SCAD (Jacob Hansson)
|
||||
|
||||
* Live syntax checks
|
||||
- Lint for Css using CSS Lint <http://csslint.net/>
|
||||
- CoffeeScript
|
||||
|
||||
* New Themes
|
||||
- Crimson Editor (iebuggy)
|
||||
- Merbivore (Michael Schwartz)
|
||||
- Merbivore soft (Michael Schwartz)
|
||||
- Solarized dark/light <http://ethanschoonover.com/solarized> (David Alan
|
||||
Hjelle)
|
||||
- Vibrant Ink (Michael Schwartz)
|
||||
|
||||
* Small Features/Enhancements
|
||||
- Lots of render performance optimizations (Harutyun Amirjanyan)
|
||||
- Improved Ruby highlighting (Chris Wanstrath, Trent Ogren)
|
||||
- Improved PHP highlighting (Thomas Hruska)
|
||||
- Improved CSS highlighting (Sean Kellogg)
|
||||
- Clicks which cause the editor to be focused don't reset the selection
|
||||
- Make padding text layer specific so that print margin and active line
|
||||
highlight are not affected (Irakli Gozalishvili)
|
||||
- Added setFontSize method
|
||||
- Improved vi keybindings (Trent Ogren)
|
||||
- When unfocused make cursor transparent instead of removing it (Harutyun
|
||||
Amirjanyan)
|
||||
- Support for matching groups in tokenizer with arrays of tokens (Chris
|
||||
Spencer)
|
||||
|
||||
* Bug fixes
|
||||
- Add support for the new OSX scroll bars
|
||||
- Properly highlight JavaScript regexp literals
|
||||
- Proper handling of unicode characters in JavaScript identifiers
|
||||
- Fix remove lines command on last line (Harutyun Amirjanyan)
|
||||
- Fix scroll wheel sluggishness in Safari
|
||||
- Make keyboard infrastructure route keys like []^$ the right way (Julian
|
||||
Viereck)
|
||||
|
||||
2011.02.14, Version 0.1.6
|
||||
|
||||
* Floating Anchors
|
||||
- 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
|
||||
- Usesd for the cursor and selection
|
||||
- Basis for bookmarks, multiple cursors and snippets in the future
|
||||
* Extensive support for Cocoa style keybindings on the Mac <https://github.com/ajaxorg/ace/issues/closed#issue/116/comment/767803>
|
||||
* New commands:
|
||||
- center selection in viewport
|
||||
- remove to end/start of line
|
||||
- split line
|
||||
- transpose letters
|
||||
* Refator markers
|
||||
- Custom code can be used to render markers
|
||||
- Markers can be in front or behind the text
|
||||
- Markers are now stored in the session (was in the renderer)
|
||||
* Lots of IE8 fixes including copy, cut and selections
|
||||
* Unit tests can also be run in the browser
|
||||
<https://github.com/ajaxorg/ace/blob/master/lib/ace/test/tests.html>
|
||||
* Soft wrap can adapt to the width of the editor (Mike Ratcliffe, Joe Cheng)
|
||||
* Add minimal node server server.js to run the Ace demo in Chrome
|
||||
* The top level editor.html demo has been renamed to index.html
|
||||
* Bug fixes
|
||||
- Fixed gotoLine to consider wrapped lines when calculating where to scroll to (James Allen)
|
||||
- Fixed isues when the editor was scrolled in the web page (Eric Allam)
|
||||
- Highlighting of Python string literals
|
||||
- Syntax rule for PHP comments
|
||||
|
||||
2011.02.08, Version 0.1.5
|
||||
|
||||
* Add Coffeescript Mode (Satoshi Murakami)
|
||||
* Fix word wrap bug (Julian Viereck)
|
||||
* Fix packaged version of the Eclipse mode
|
||||
* Loading of workers is more robust
|
||||
* Fix "click selection"
|
||||
* Allow tokizing empty lines (Daniel Krech)
|
||||
* Make PageUp/Down behavior more consistent with native OS (Joe Cheng)
|
||||
|
||||
2011.02.04, Version 0.1.4
|
||||
|
||||
* Add C/C++ mode contributed by Gastón Kleiman
|
||||
* Fix exception in key input
|
||||
|
||||
2011.02.04, Version 0.1.3
|
||||
|
||||
* Let the packaged version play nice with requireJS
|
||||
* Add Ruby mode contributed by Shlomo Zalman Heigh
|
||||
* Add Java mode contributed by Tom Tasche
|
||||
* Fix annotation bug
|
||||
* Changing a document added a new empty line at the end
|
||||
|
|
@ -1,476 +0,0 @@
|
|||
Licensed under the tri-license MPL/LGPL/GPL.
|
||||
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
---------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.0.1. "Commercial Use" means distribution or otherwise making the
|
||||
Covered Code available to a third party.
|
||||
|
||||
1.1. "Contributor" means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. "Contributor Version" means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. "Covered Code" means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. "Electronic Distribution Mechanism" means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. "Executable" means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. "Initial Developer" means the individual or entity identified
|
||||
as the Initial Developer in the Source Code notice required by Exhibit
|
||||
A.
|
||||
|
||||
1.7. "Larger Work" means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. "License" means this document.
|
||||
|
||||
1.8.1. "Licensable" means having the right to grant, to the maximum
|
||||
extent possible, whether at the time of the initial grant or
|
||||
subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. "Modifications" means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. "Original Code" means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this
|
||||
License is not already Covered Code governed by this License.
|
||||
|
||||
1.10.1. "Patent Claims" means any patent claim(s), now owned or
|
||||
hereafter acquired, including without limitation, method, process,
|
||||
and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.11. "Source Code" means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus
|
||||
any associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. "You" (or "Your") means an individual or a legal entity
|
||||
exercising rights under, and complying with all of the terms of, this
|
||||
License or a future version of this License issued under Section 6.1.
|
||||
For legal entities, "You" includes any entity which controls, is
|
||||
controlled by, or is under common control with You. For purposes of
|
||||
this definition, "control" means (a) the power, direct or indirect,
|
||||
to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (b) ownership of more than fifty percent
|
||||
(50%) of the outstanding shares or beneficial ownership of such
|
||||
entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Initial Developer to use, reproduce,
|
||||
modify, display, perform, sublicense and distribute the Original
|
||||
Code (or portions thereof) with or without Modifications, and/or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patents Claims infringed by the making, using or
|
||||
selling of Original Code, to make, have made, use, practice,
|
||||
sell, and offer for sale, and/or otherwise dispose of the
|
||||
Original Code (or portions thereof).
|
||||
|
||||
(c) the licenses granted in this Section 2.1(a) and (b) are
|
||||
effective on the date Initial Developer first distributes
|
||||
Original Code under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2)
|
||||
separate from the Original Code; or 3) for infringements caused
|
||||
by: i) the modification of the Original Code or ii) the
|
||||
combination of the Original Code with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Subject to third party intellectual property claims, each Contributor
|
||||
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||
display, perform, sublicense and distribute the Modifications
|
||||
created by such Contributor (or portions thereof) either on an
|
||||
unmodified basis, with other Modifications, as Covered Code
|
||||
and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or
|
||||
selling of Modifications made by that Contributor either alone
|
||||
and/or in combination with its Contributor Version (or portions
|
||||
of such combination), to make, use, sell, offer for sale, have
|
||||
made, and/or otherwise dispose of: 1) Modifications made by that
|
||||
Contributor (or portions thereof); and 2) the combination of
|
||||
Modifications made by that Contributor with its Contributor
|
||||
Version (or portions of such combination).
|
||||
|
||||
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
|
||||
effective on the date Contributor first makes Commercial Use of
|
||||
the Covered Code.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is
|
||||
granted: 1) for any code that Contributor has deleted from the
|
||||
Contributor Version; 2) separate from the Contributor Version;
|
||||
3) for infringements caused by: i) third party modifications of
|
||||
Contributor Version or ii) the combination of Modifications made
|
||||
by that Contributor with other software (except as part of the
|
||||
Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by
|
||||
that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be
|
||||
distributed only under the terms of this License or a future version
|
||||
of this License released under Section 6.1, and You must include a
|
||||
copy of this License with every copy of the Source Code You
|
||||
distribute. You may not offer or impose any terms on any Source Code
|
||||
version that alters or restricts the applicable version of this
|
||||
License or the recipients' rights hereunder. However, You may include
|
||||
an additional document offering the additional rights described in
|
||||
Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which You contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that
|
||||
the Modification is derived, directly or indirectly, from Original
|
||||
Code provided by the Initial Developer and including the name of the
|
||||
Initial Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
(a) Third Party Claims.
|
||||
If Contributor has knowledge that a license under a third party's
|
||||
intellectual property rights is required to exercise the rights
|
||||
granted by such Contributor under Sections 2.1 or 2.2,
|
||||
Contributor must include a text file with the Source Code
|
||||
distribution titled "LEGAL" which describes the claim and the
|
||||
party making the claim in sufficient detail that a recipient will
|
||||
know whom to contact. If Contributor obtains such knowledge after
|
||||
the Modification is made available as described in Section 3.2,
|
||||
Contributor shall promptly modify the LEGAL file in all copies
|
||||
Contributor makes available thereafter and shall take other steps
|
||||
(such as notifying appropriate mailing lists or newsgroups)
|
||||
reasonably calculated to inform those who received the Covered
|
||||
Code that new knowledge has been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Contributor's Modifications include an application programming
|
||||
interface and Contributor has knowledge of patent licenses which
|
||||
are reasonably necessary to implement that API, Contributor must
|
||||
also include this information in the LEGAL file.
|
||||
|
||||
(c) Representations.
|
||||
Contributor represents that, except as disclosed pursuant to
|
||||
Section 3.4(a) above, Contributor believes that Contributor's
|
||||
Modifications are Contributor's original creation(s) and/or
|
||||
Contributor has sufficient rights to grant the rights conveyed by
|
||||
this License.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code. If it is not possible to put such notice in a particular Source
|
||||
Code file due to its structure, then You must include such notice in a
|
||||
location (such as a relevant directory) where a user would be likely
|
||||
to look for such a notice. If You created one or more Modification(s)
|
||||
You may add your name as a Contributor to the notice described in
|
||||
Exhibit A. You must also duplicate this License in any documentation
|
||||
for the Source Code where You describe recipients' rights or ownership
|
||||
rights relating to Covered Code. You may choose to offer, and to
|
||||
charge a fee for, warranty, support, indemnity or liability
|
||||
obligations to one or more recipients of Covered Code. However, You
|
||||
may do so only on Your own behalf, and not on behalf of the Initial
|
||||
Developer or any Contributor. You must make it absolutely clear than
|
||||
any such warranty, support, indemnity or liability obligation is
|
||||
offered by You alone, and You hereby agree to indemnify the Initial
|
||||
Developer and every Contributor for any liability incurred by the
|
||||
Initial Developer or such Contributor as a result of warranty,
|
||||
support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of
|
||||
the Covered Code is available under the terms of this License,
|
||||
including a description of how and where You have fulfilled the
|
||||
obligations of Section 3.2. The notice must be conspicuously included
|
||||
in any notice in an Executable version, related documentation or
|
||||
collateral in which You describe recipients' rights relating to the
|
||||
Covered Code. You may distribute the Executable version of Covered
|
||||
Code or ownership rights under a license of Your choice, which may
|
||||
contain terms different from this License, provided that You are in
|
||||
compliance with the terms of this License and that the license for the
|
||||
Executable version does not attempt to limit or alter the recipient's
|
||||
rights in the Source Code version from the rights set forth in this
|
||||
License. If You distribute the Executable version under a different
|
||||
license You must make it absolutely clear that any terms which differ
|
||||
from this License are offered by You alone, not by the Initial
|
||||
Developer or any Contributor. You hereby agree to indemnify the
|
||||
Initial Developer and every Contributor for any liability incurred by
|
||||
the Initial Developer or such Contributor as a result of any such
|
||||
terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description
|
||||
must be included in the LEGAL file described in Section 3.4 and must
|
||||
be included with all distributions of the Source Code. Except to the
|
||||
extent prohibited by statute or regulation, such description must be
|
||||
sufficiently detailed for a recipient of ordinary skill to be able to
|
||||
understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation ("Netscape") may publish revised
|
||||
and/or new versions of the License from time to time. Each version
|
||||
will be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If You create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), You must (a) rename Your license so that
|
||||
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
|
||||
"MPL", "NPL" or any confusingly similar phrase do not appear in your
|
||||
license (except to note that your license differs from this License)
|
||||
and (b) otherwise make it clear that Your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial
|
||||
Developer, Original Code or Contributor in the notice described in
|
||||
Exhibit A shall not of themselves be deemed to be modifications of
|
||||
this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
8.1. This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
8.2. If You initiate litigation by asserting a patent infringement
|
||||
claim (excluding declatory judgment actions) against Initial Developer
|
||||
or a Contributor (the Initial Developer or Contributor against whom
|
||||
You file such action is referred to as "Participant") alleging that:
|
||||
|
||||
(a) such Participant's Contributor Version directly or indirectly
|
||||
infringes any patent, then any and all rights granted by such
|
||||
Participant to You under Sections 2.1 and/or 2.2 of this License
|
||||
shall, upon 60 days notice from Participant terminate prospectively,
|
||||
unless if within 60 days after receipt of notice You either: (i)
|
||||
agree in writing to pay Participant a mutually agreeable reasonable
|
||||
royalty for Your past and future use of Modifications made by such
|
||||
Participant, or (ii) withdraw Your litigation claim with respect to
|
||||
the Contributor Version against such Participant. If within 60 days
|
||||
of notice, a reasonable royalty and payment arrangement are not
|
||||
mutually agreed upon in writing by the parties or the litigation claim
|
||||
is not withdrawn, the rights granted by Participant to You under
|
||||
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
|
||||
the 60 day notice period specified above.
|
||||
|
||||
(b) any software, hardware, or device, other than such Participant's
|
||||
Contributor Version, directly or indirectly infringes any patent, then
|
||||
any rights granted to You by such Participant under Sections 2.1(b)
|
||||
and 2.2(b) are revoked effective as of the date You first made, used,
|
||||
sold, distributed, or had made, Modifications made by that
|
||||
Participant.
|
||||
|
||||
8.3. If You assert a patent infringement claim against Participant
|
||||
alleging that such Participant's Contributor Version directly or
|
||||
indirectly infringes any patent where such claim is resolved (such as
|
||||
by license or settlement) prior to the initiation of patent
|
||||
infringement litigation, then the reasonable value of the licenses
|
||||
granted by such Participant under Sections 2.1 or 2.2 shall be taken
|
||||
into account in determining the amount or value of any payment or
|
||||
license.
|
||||
|
||||
8.4. In the event of termination under Sections 8.1 or 8.2 above,
|
||||
all end user license agreements (excluding distributors and resellers)
|
||||
which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
|
||||
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
|
||||
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
|
||||
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
|
||||
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
|
||||
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a "commercial item," as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
|
||||
software" and "commercial computer software documentation," as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if
|
||||
any, provides otherwise), excluding its conflict-of-law provisions.
|
||||
With respect to disputes in which at least one party is a citizen of,
|
||||
or an entity chartered or registered to do business in the United
|
||||
States of America, any litigation relating to this License shall be
|
||||
subject to the jurisdiction of the Federal Courts of the Northern
|
||||
District of California, with venue lying in Santa Clara County,
|
||||
California, with the losing party responsible for costs, including
|
||||
without limitation, court costs and reasonable attorneys' fees and
|
||||
expenses. The application of the United Nations Convention on
|
||||
Contracts for the International Sale of Goods is expressly excluded.
|
||||
Any law or regulation which provides that the language of a contract
|
||||
shall be construed against the drafter shall not apply to this
|
||||
License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly,
|
||||
out of its utilization of rights under this License and You agree to
|
||||
work with Initial Developer and Contributors to distribute such
|
||||
responsibility on an equitable basis. Nothing herein is intended or
|
||||
shall be deemed to constitute any admission of liability.
|
||||
|
||||
13. MULTIPLE-LICENSED CODE.
|
||||
|
||||
Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under
|
||||
Your choice of the NPL or the alternative licenses, if any, specified
|
||||
by the Initial Developer in the file described in Exhibit A.
|
||||
|
||||
EXHIBIT A -Mozilla Public License.
|
||||
|
||||
``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 ______________________________________.
|
||||
|
||||
The Initial Developer of the Original Code is ________________________.
|
||||
Portions created by ______________________ are Copyright (C) ______
|
||||
_______________________. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the _____ license (the "[___] License"), in which case the
|
||||
provisions of [______] License are applicable instead of those
|
||||
above. If you wish to allow use of your version of this file only
|
||||
under the terms of the [____] License and not to allow others to use
|
||||
your version of this file under the MPL, indicate your decision by
|
||||
deleting the provisions above and replace them with the notice and
|
||||
other provisions required by the [___] License. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file
|
||||
under either the MPL or the [___] License."
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. You should
|
||||
use the text of this Exhibit A rather than the text found in the
|
||||
Original Code Source Code for Your Modifications.]
|
||||
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
Ace (Ajax.org Cloud9 Editor)
|
||||
============================
|
||||
|
||||
Ace is a code editor written in JavaScript.
|
||||
|
||||
This repository has only generated files.
|
||||
If you want to work on ace please go to https://github.com/ajaxorg/ace instead.
|
||||
|
||||
|
||||
here you can find pre-built files for convenience of embedding.
|
||||
it contains 4 versions
|
||||
* [src](https://github.com/ajaxorg/ace-builds/tree/master/src) concatenated but not minified
|
||||
* [src-min](https://github.com/ajaxorg/ace-builds/tree/master/src-min) concatenated and minified with uglify.js
|
||||
* [src-noconflict](https://github.com/ajaxorg/ace-builds/tree/master/src-noconflict) uses ace.require instead of require
|
||||
* [src-min-noconflict](https://github.com/ajaxorg/ace-builds/tree/master/src-min-noconflict) -
|
||||
|
||||
|
||||
For a simple way of embedding ace into webpage see https://github.com/ajaxorg/ace-builds/blob/master/editor.html
|
||||
To see ace in action go to [kitchen-sink-demo](http://ajaxorg.github.com/ace-builds/kitchen-sink.html), [scrollable-page-demo](http://ajaxorg.github.com/ace-builds/scrollable-page.html), or [minimal demo](http://ajaxorg.github.com/ace-builds/editor.html)
|
||||
|
||||
|
||||
|
|
@ -1,527 +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):
|
||||
* Satoshi Murakami <murky.satyr AT gmail DOT 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 ***** */
|
||||
|
||||
ace.define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) {
|
||||
|
||||
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
|
||||
var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
var Range = require("../range").Range;
|
||||
var TextMode = require("./text").Mode;
|
||||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
var oop = require("../lib/oop");
|
||||
|
||||
function Mode() {
|
||||
this.$tokenizer = new Tokenizer(new Rules().getRules());
|
||||
this.$outdent = new Outdent();
|
||||
this.foldingRules = new FoldMode();
|
||||
}
|
||||
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/;
|
||||
var commentLine = /^(\s*)#/;
|
||||
var hereComment = /^\s*###(?!#)/;
|
||||
var indentation = /^\s*/;
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
|
||||
|
||||
if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
|
||||
state === 'start' && indenter.test(line))
|
||||
indent += tab;
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow){
|
||||
console.log("toggle");
|
||||
var range = new Range(0, 0, 0, 0);
|
||||
for (var i = startRow; i <= endRow; ++i) {
|
||||
var line = doc.getLine(i);
|
||||
if (hereComment.test(line))
|
||||
continue;
|
||||
|
||||
if (commentLine.test(line))
|
||||
line = line.replace(commentLine, '$1');
|
||||
else
|
||||
line = line.replace(indentation, '$&#');
|
||||
|
||||
range.end.row = range.start.row = i;
|
||||
range.end.column = line.length + 1;
|
||||
doc.replace(range, line);
|
||||
}
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
worker.on("error", function(e) {
|
||||
session.setAnnotations([e.data]);
|
||||
});
|
||||
|
||||
worker.on("ok", function(e) {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
||||
});
|
||||
|
||||
ace.define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
||||
|
||||
|
||||
var lang = require("../lib/lang");
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
oop.inherits(CoffeeHighlightRules, TextHighlightRules);
|
||||
|
||||
function CoffeeHighlightRules() {
|
||||
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
|
||||
var stringfill = {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
};
|
||||
|
||||
var keywords = lang.arrayToMap((
|
||||
"this|throw|then|try|typeof|super|switch|return|break|by)|continue|" +
|
||||
"catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" +
|
||||
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
|
||||
"or|on|unless|until|and|yes").split("|")
|
||||
);
|
||||
|
||||
var langConstant = lang.arrayToMap((
|
||||
"true|false|null|undefined").split("|")
|
||||
);
|
||||
|
||||
var illegal = lang.arrayToMap((
|
||||
"case|const|default|function|var|void|with|enum|export|implements|" +
|
||||
"interface|let|package|private|protected|public|static|yield|" +
|
||||
"__hasProp|extends|slice|bind|indexOf").split("|")
|
||||
);
|
||||
|
||||
var supportClass = lang.arrayToMap((
|
||||
"Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|" +
|
||||
"RangeError|String|SyntaxError|Error|EvalError|TypeError|URIError").split("|")
|
||||
);
|
||||
|
||||
var supportFunction = lang.arrayToMap((
|
||||
"Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
|
||||
"encodeURIComponent|decodeURI|decodeURIComponent|RangeError|String|" +
|
||||
"SyntaxError|Error|EvalError|TypeError|URIError").split("|")
|
||||
);
|
||||
|
||||
this.$rules = {
|
||||
start : [
|
||||
{
|
||||
token : "identifier",
|
||||
regex : "(?:(?:\\.|::)\\s*)" + identifier
|
||||
}, {
|
||||
token : "variable",
|
||||
regex : "@(?:" + identifier + ")?"
|
||||
}, {
|
||||
token: function(value) {
|
||||
if (keywords.hasOwnProperty(value))
|
||||
return "keyword";
|
||||
else if (langConstant.hasOwnProperty(value))
|
||||
return "constant.language";
|
||||
else if (illegal.hasOwnProperty(value))
|
||||
return "invalid.illegal";
|
||||
else if (supportClass.hasOwnProperty(value))
|
||||
return "language.support.class";
|
||||
else if (supportFunction.hasOwnProperty(value))
|
||||
return "language.support.function";
|
||||
else
|
||||
return "identifier";
|
||||
},
|
||||
regex : identifier
|
||||
}, {
|
||||
token : "constant.numeric",
|
||||
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "'''",
|
||||
next : "qdoc"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '"""',
|
||||
next : "qqdoc"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "'",
|
||||
next : "qstring"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '"',
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "`",
|
||||
next : "js"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
merge : true,
|
||||
regex : "///",
|
||||
next : "heregex"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : "###(?!#)",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "comment",
|
||||
regex : "#.*"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\."
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[({[]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\]})]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}],
|
||||
|
||||
qdoc : [{
|
||||
token : "string",
|
||||
regex : ".*?'''",
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqdoc : [{
|
||||
token : "string",
|
||||
regex : '.*?"""',
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qstring : [{
|
||||
token : "string",
|
||||
regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqstring : [{
|
||||
token : "string",
|
||||
regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
js : [{
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
heregex : [{
|
||||
token : "string.regex",
|
||||
regex : '.*?///[imgy]{0,4}',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment.regex",
|
||||
regex : "\\s+(?:#.*)?"
|
||||
}, {
|
||||
token : "string.regex",
|
||||
merge : true,
|
||||
regex : "\\S+"
|
||||
}],
|
||||
|
||||
comment : [{
|
||||
token : "comment",
|
||||
regex : '.*?###',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
||||
exports.CoffeeHighlightRules = CoffeeHighlightRules;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
||||
|
||||
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var MatchingBraceOutdent = function() {};
|
||||
|
||||
(function() {
|
||||
|
||||
this.checkOutdent = function(line, input) {
|
||||
if (! /^\s+$/.test(line))
|
||||
return false;
|
||||
|
||||
return /^\s*\}/.test(input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(doc, row) {
|
||||
var line = doc.getLine(row);
|
||||
var match = line.match(/^(\s*\})/);
|
||||
|
||||
if (!match) return 0;
|
||||
|
||||
var column = match[1].length;
|
||||
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
||||
|
||||
if (!openBracePos || openBracePos.row == row) return 0;
|
||||
|
||||
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
||||
doc.replace(new Range(row, 0, row, column-1), indent);
|
||||
};
|
||||
|
||||
this.$getIndent = function(line) {
|
||||
var match = line.match(/^(\s+)/);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
}).call(MatchingBraceOutdent.prototype);
|
||||
|
||||
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
|
||||
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||
var Range = require("../../range").Range;
|
||||
|
||||
var FoldMode = exports.FoldMode = function() {};
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
||||
var range = this.indentationBlock(session, row);
|
||||
if (range)
|
||||
return range;
|
||||
|
||||
var re = /\S/;
|
||||
var line = session.getLine(row);
|
||||
var startLevel = line.search(re);
|
||||
if (startLevel == -1 || line[startLevel] != "#")
|
||||
return;
|
||||
|
||||
var startColumn = line.length;
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
var endRow = row;
|
||||
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var level = line.search(re);
|
||||
|
||||
if (level == -1)
|
||||
continue;
|
||||
|
||||
if (line[level] != "#")
|
||||
break;
|
||||
|
||||
endRow = row;
|
||||
}
|
||||
|
||||
if (endRow > startRow) {
|
||||
var endColumn = session.getLine(endRow).length;
|
||||
return new Range(startRow, startColumn, endRow, endColumn);
|
||||
}
|
||||
};
|
||||
|
||||
// must return "" if there's no fold, to enable caching
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
var indent = line.search(/\S/);
|
||||
var next = session.getLine(row + 1);
|
||||
var prev = session.getLine(row - 1);
|
||||
var prevIndent = prev.search(/\S/);
|
||||
var nextIndent = next.search(/\S/);
|
||||
|
||||
if (indent == -1) {
|
||||
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
|
||||
return "";
|
||||
}
|
||||
|
||||
// documentation comments
|
||||
if (prevIndent == -1) {
|
||||
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
|
||||
session.foldWidgets[row - 1] = "";
|
||||
session.foldWidgets[row + 1] = "";
|
||||
return "start";
|
||||
}
|
||||
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
|
||||
if (session.getLine(row - 2).search(/\S/) == -1) {
|
||||
session.foldWidgets[row - 1] = "start";
|
||||
session.foldWidgets[row + 1] = "";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
if (prevIndent!= -1 && prevIndent < indent)
|
||||
session.foldWidgets[row - 1] = "start";
|
||||
else
|
||||
session.foldWidgets[row - 1] = "";
|
||||
|
||||
if (indent < nextIndent)
|
||||
return "start";
|
||||
else
|
||||
return "";
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
||||
ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
||||
|
||||
|
||||
var Range = require("../../range").Range;
|
||||
|
||||
var FoldMode = exports.FoldMode = function() {};
|
||||
|
||||
(function() {
|
||||
|
||||
this.foldingStartMarker = null;
|
||||
this.foldingStopMarker = null;
|
||||
|
||||
// must return "" if there's no fold, to enable caching
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
if (this.foldingStartMarker.test(line))
|
||||
return "start";
|
||||
if (foldStyle == "markbeginend"
|
||||
&& this.foldingStopMarker
|
||||
&& this.foldingStopMarker.test(line))
|
||||
return "end";
|
||||
return "";
|
||||
};
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
||||
return null;
|
||||
};
|
||||
|
||||
this.indentationBlock = function(session, row, column) {
|
||||
var re = /\S/;
|
||||
var line = session.getLine(row);
|
||||
var startLevel = line.search(re);
|
||||
if (startLevel == -1)
|
||||
return;
|
||||
|
||||
var startColumn = column || line.length;
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
var endRow = row;
|
||||
|
||||
while (++row < maxRow) {
|
||||
var level = session.getLine(row).search(re);
|
||||
|
||||
if (level == -1)
|
||||
continue;
|
||||
|
||||
if (level <= startLevel)
|
||||
break;
|
||||
|
||||
endRow = row;
|
||||
}
|
||||
|
||||
if (endRow > startRow) {
|
||||
var endColumn = session.getLine(endRow).length;
|
||||
return new Range(startRow, startColumn, endRow, endColumn);
|
||||
}
|
||||
};
|
||||
|
||||
this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
|
||||
var start = {row: row, column: column + 1};
|
||||
var end = session.$findClosingBracket(bracket, start, typeRe);
|
||||
if (!end)
|
||||
return;
|
||||
|
||||
var fw = session.foldWidgets[end.row];
|
||||
if (fw == null)
|
||||
fw = this.getFoldWidget(session, end.row);
|
||||
|
||||
if (fw == "start" && end.row > start.row) {
|
||||
end.row --;
|
||||
end.column = session.getLine(end.row).length;
|
||||
}
|
||||
return Range.fromPoints(start, end);
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
|
@ -1,588 +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 <fabian AT ajax DOT org>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
ace.define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
|
||||
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
worker.on("error", function(e) {
|
||||
session.setAnnotations([e.data]);
|
||||
});
|
||||
|
||||
worker.on("ok", function() {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
||||
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var JsonHighlightRules = function() {
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "variable", // single line
|
||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : '"',
|
||||
next : "string"
|
||||
}, {
|
||||
token : "constant.numeric", // hex
|
||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
}, {
|
||||
token : "constant.language.boolean",
|
||||
regex : "(?:true|false)\\b"
|
||||
}, {
|
||||
token : "invalid.illegal", // single quoted strings are not allowed
|
||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||
}, {
|
||||
token : "invalid.illegal", // comments are not allowed
|
||||
regex : "\\/\\/.*$"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}
|
||||
],
|
||||
"string" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '[^"\\\\]+',
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"',
|
||||
next : "start",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "",
|
||||
next : "start",
|
||||
merge : true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
oop.inherits(JsonHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.JsonHighlightRules = JsonHighlightRules;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
||||
|
||||
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var MatchingBraceOutdent = function() {};
|
||||
|
||||
(function() {
|
||||
|
||||
this.checkOutdent = function(line, input) {
|
||||
if (! /^\s+$/.test(line))
|
||||
return false;
|
||||
|
||||
return /^\s*\}/.test(input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(doc, row) {
|
||||
var line = doc.getLine(row);
|
||||
var match = line.match(/^(\s*\})/);
|
||||
|
||||
if (!match) return 0;
|
||||
|
||||
var column = match[1].length;
|
||||
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
||||
|
||||
if (!openBracePos || openBracePos.row == row) return 0;
|
||||
|
||||
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
||||
doc.replace(new Range(row, 0, row, column-1), indent);
|
||||
};
|
||||
|
||||
this.$getIndent = function(line) {
|
||||
var match = line.match(/^(\s+)/);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
}).call(MatchingBraceOutdent.prototype);
|
||||
|
||||
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
|
||||
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Behaviour = require("../behaviour").Behaviour;
|
||||
|
||||
var CstyleBehaviour = function () {
|
||||
|
||||
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == '{') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
return {
|
||||
text: '{' + selected + '}',
|
||||
selection: false
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
text: '{}',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
} else if (text == '}') {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar == '}') {
|
||||
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
||||
if (matching !== null) {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
} else if (text == "\n") {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar == '}') {
|
||||
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
|
||||
if (!openBracePos)
|
||||
return null;
|
||||
|
||||
var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
|
||||
var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
|
||||
|
||||
return {
|
||||
text: '\n' + indent + '\n' + next_indent,
|
||||
selection: [1, indent.length, 1, indent.length]
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
||||
var selected = session.doc.getTextRange(range);
|
||||
if (!range.isMultiLine() && selected == '{') {
|
||||
var line = session.doc.getLine(range.start.row);
|
||||
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
||||
if (rightChar == '}') {
|
||||
range.end.column++;
|
||||
return range;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == '(') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
return {
|
||||
text: '(' + selected + ')',
|
||||
selection: false
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
text: '()',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
} else if (text == ')') {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar == ')') {
|
||||
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
||||
if (matching !== null) {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
||||
var selected = session.doc.getTextRange(range);
|
||||
if (!range.isMultiLine() && selected == '(') {
|
||||
var line = session.doc.getLine(range.start.row);
|
||||
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
||||
if (rightChar == ')') {
|
||||
range.end.column++;
|
||||
return range;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == '[') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
return {
|
||||
text: '[' + selected + ']',
|
||||
selection: false
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
text: '[]',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
} else if (text == ']') {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar == ']') {
|
||||
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
||||
if (matching !== null) {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
||||
var selected = session.doc.getTextRange(range);
|
||||
if (!range.isMultiLine() && selected == '[') {
|
||||
var line = session.doc.getLine(range.start.row);
|
||||
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
||||
if (rightChar == ']') {
|
||||
range.end.column++;
|
||||
return range;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == '"' || text == "'") {
|
||||
var quote = text;
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
return {
|
||||
text: quote + selected + quote,
|
||||
selection: false
|
||||
};
|
||||
} else {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var leftChar = line.substring(cursor.column-1, cursor.column);
|
||||
|
||||
// We're escaped.
|
||||
if (leftChar == '\\') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Find what token we're inside.
|
||||
var tokens = session.getTokens(selection.start.row);
|
||||
var col = 0, token;
|
||||
var quotepos = -1; // Track whether we're inside an open quote.
|
||||
|
||||
for (var x = 0; x < tokens.length; x++) {
|
||||
token = tokens[x];
|
||||
if (token.type == "string") {
|
||||
quotepos = -1;
|
||||
} else if (quotepos < 0) {
|
||||
quotepos = token.value.indexOf(quote);
|
||||
}
|
||||
if ((token.value.length + col) > selection.start.column) {
|
||||
break;
|
||||
}
|
||||
col += tokens[x].value.length;
|
||||
}
|
||||
|
||||
// Try and be smart about when we auto insert.
|
||||
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
|
||||
return {
|
||||
text: quote + quote,
|
||||
selection: [1,1]
|
||||
};
|
||||
} else if (token && token.type === "string") {
|
||||
// Ignore input and move right one if we're typing over the closing quote.
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar == quote) {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
||||
var selected = session.doc.getTextRange(range);
|
||||
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
||||
var line = session.doc.getLine(range.start.row);
|
||||
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
||||
if (rightChar == '"') {
|
||||
range.end.column++;
|
||||
return range;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
oop.inherits(CstyleBehaviour, Behaviour);
|
||||
|
||||
exports.CstyleBehaviour = CstyleBehaviour;
|
||||
});
|
||||
|
||||
ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
||||
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Range = require("../../range").Range;
|
||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||
|
||||
var FoldMode = exports.FoldMode = function() {};
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
||||
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
var match = line.match(this.foldingStartMarker);
|
||||
if (match) {
|
||||
var i = match.index;
|
||||
|
||||
if (match[1])
|
||||
return this.openingBracketBlock(session, match[1], row, i);
|
||||
|
||||
var range = session.getCommentFoldRange(row, i + match[0].length);
|
||||
range.end.column -= 2;
|
||||
return range;
|
||||
}
|
||||
|
||||
if (foldStyle !== "markbeginend")
|
||||
return;
|
||||
|
||||
var match = line.match(this.foldingStopMarker);
|
||||
if (match) {
|
||||
var i = match.index + match[0].length;
|
||||
|
||||
if (match[2]) {
|
||||
var range = session.getCommentFoldRange(row, i);
|
||||
range.end.column -= 2;
|
||||
return range;
|
||||
}
|
||||
|
||||
var end = {row: row, column: i};
|
||||
var start = session.$findOpeningBracket(match[1], end);
|
||||
|
||||
if (!start)
|
||||
return;
|
||||
|
||||
start.column++;
|
||||
end.column--;
|
||||
|
||||
return Range.fromPoints(start, end);
|
||||
}
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
||||
ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
||||
|
||||
|
||||
var Range = require("../../range").Range;
|
||||
|
||||
var FoldMode = exports.FoldMode = function() {};
|
||||
|
||||
(function() {
|
||||
|
||||
this.foldingStartMarker = null;
|
||||
this.foldingStopMarker = null;
|
||||
|
||||
// must return "" if there's no fold, to enable caching
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
if (this.foldingStartMarker.test(line))
|
||||
return "start";
|
||||
if (foldStyle == "markbeginend"
|
||||
&& this.foldingStopMarker
|
||||
&& this.foldingStopMarker.test(line))
|
||||
return "end";
|
||||
return "";
|
||||
};
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
||||
return null;
|
||||
};
|
||||
|
||||
this.indentationBlock = function(session, row, column) {
|
||||
var re = /\S/;
|
||||
var line = session.getLine(row);
|
||||
var startLevel = line.search(re);
|
||||
if (startLevel == -1)
|
||||
return;
|
||||
|
||||
var startColumn = column || line.length;
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
var endRow = row;
|
||||
|
||||
while (++row < maxRow) {
|
||||
var level = session.getLine(row).search(re);
|
||||
|
||||
if (level == -1)
|
||||
continue;
|
||||
|
||||
if (level <= startLevel)
|
||||
break;
|
||||
|
||||
endRow = row;
|
||||
}
|
||||
|
||||
if (endRow > startRow) {
|
||||
var endColumn = session.getLine(endRow).length;
|
||||
return new Range(startRow, startColumn, endRow, endColumn);
|
||||
}
|
||||
};
|
||||
|
||||
this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
|
||||
var start = {row: row, column: column + 1};
|
||||
var end = session.$findClosingBracket(bracket, start, typeRe);
|
||||
if (!end)
|
||||
return;
|
||||
|
||||
var fw = session.foldWidgets[end.row];
|
||||
if (fw == null)
|
||||
fw = this.getFoldWidget(session, end.row);
|
||||
|
||||
if (fw == "start" && end.row > start.row) {
|
||||
end.row --;
|
||||
end.column = session.getLine(end.row).length;
|
||||
}
|
||||
return Range.fromPoints(start, end);
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
|
@ -1,194 +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 <fabian AT ajax DOT org>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
ace.define('ace/theme/monokai', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-monokai";
|
||||
exports.cssText = "\
|
||||
.ace-monokai .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_editor.ace_focus {\
|
||||
border: 2px solid #327fbd;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_gutter {\
|
||||
background: #2f3129;\
|
||||
color: #f1f1f1;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_print_margin {\
|
||||
width: 1px;\
|
||||
background: #555651;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_scroller {\
|
||||
background-color: #272822;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_text-layer {\
|
||||
color: #F8F8F2;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_cursor {\
|
||||
border-left: 2px solid #F8F8F0;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_cursor.ace_overwrite {\
|
||||
border-left: 0px;\
|
||||
border-bottom: 1px solid #F8F8F0;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_marker-layer .ace_selection {\
|
||||
background: #49483E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai.multiselect .ace_selection.start {\
|
||||
box-shadow: 0 0 3px 0px #272822;\
|
||||
border-radius: 2px;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_marker-layer .ace_step {\
|
||||
background: rgb(102, 82, 0);\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_marker-layer .ace_bracket {\
|
||||
margin: -1px 0 0 -1px;\
|
||||
border: 1px solid #49483E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_marker-layer .ace_active_line {\
|
||||
background: #49483E;\
|
||||
}\
|
||||
.ace-monokai .ace_gutter_active_line {\
|
||||
background-color: #191916;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_marker-layer .ace_selected_word {\
|
||||
border: 1px solid #49483E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_invisible {\
|
||||
color: #49483E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_keyword, .ace-monokai .ace_meta {\
|
||||
color:#F92672;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_constant.ace_language {\
|
||||
color:#AE81FF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_constant.ace_numeric {\
|
||||
color:#AE81FF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_constant.ace_other {\
|
||||
color:#AE81FF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_invalid {\
|
||||
color:#F8F8F0;\
|
||||
background-color:#F92672;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_invalid.ace_deprecated {\
|
||||
color:#F8F8F0;\
|
||||
background-color:#AE81FF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_support.ace_constant {\
|
||||
color:#66D9EF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_fold {\
|
||||
background-color: #A6E22E;\
|
||||
border-color: #F8F8F2;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_support.ace_function {\
|
||||
color:#66D9EF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_storage {\
|
||||
color:#F92672;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_storage.ace_type, .ace-monokai .ace_support.ace_type{\
|
||||
font-style:italic;\
|
||||
color:#66D9EF;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_variable {\
|
||||
color:#A6E22E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_variable.ace_parameter {\
|
||||
font-style:italic;\
|
||||
color:#FD971F;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_string {\
|
||||
color:#E6DB74;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_comment {\
|
||||
color:#75715E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_entity.ace_other.ace_attribute-name {\
|
||||
color:#A6E22E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_entity.ace_name.ace_function {\
|
||||
color:#A6E22E;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_markup.ace_underline {\
|
||||
text-decoration:underline;\
|
||||
}\
|
||||
\
|
||||
.ace-monokai .ace_indent-guide {\
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ11D6z7Bq1ar/ABCKBG6g04U2AAAAAElFTkSuQmCC) right repeat-y;\
|
||||
}";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
|
|
@ -1,213 +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 <fabian AT ajax DOT org>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
ace.define('ace/theme/tomorrow_night_blue', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night-blue";
|
||||
exports.cssText = "\
|
||||
.ace-tomorrow-night-blue .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_editor.ace_focus {\
|
||||
border: 2px solid #327fbd;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_gutter {\
|
||||
background: #00204b;\
|
||||
color: #7388b5;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_print_margin {\
|
||||
width: 1px;\
|
||||
background: #00204b;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_scroller {\
|
||||
background-color: #002451;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_text-layer {\
|
||||
color: #FFFFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_cursor {\
|
||||
border-left: 2px solid #FFFFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {\
|
||||
border-left: 0px;\
|
||||
border-bottom: 1px solid #FFFFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
|
||||
background: #003F8E;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue.multiselect .ace_selection.start {\
|
||||
box-shadow: 0 0 3px 0px #002451;\
|
||||
border-radius: 2px;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
|
||||
background: rgb(127, 111, 19);\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\
|
||||
margin: -1px 0 0 -1px;\
|
||||
border: 1px solid #404F7D;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {\
|
||||
background: #00346E;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_gutter_active_line {\
|
||||
background-color: #022040;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\
|
||||
border: 1px solid #003F8E;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_invisible {\
|
||||
color: #404F7D;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_keyword, .ace-tomorrow-night-blue .ace_meta {\
|
||||
color:#EBBBFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_keyword.ace_operator {\
|
||||
color:#99FFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_language {\
|
||||
color:#FFC58F;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_numeric {\
|
||||
color:#FFC58F;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_other {\
|
||||
color:#FFFFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_invalid {\
|
||||
color:#FFFFFF;\
|
||||
background-color:#F99DA5;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\
|
||||
color:#FFFFFF;\
|
||||
background-color:#EBBBFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_constant {\
|
||||
color:#FFC58F;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_fold {\
|
||||
background-color: #BBDAFF;\
|
||||
border-color: #FFFFFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_support.ace_function {\
|
||||
color:#BBDAFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_storage {\
|
||||
color:#EBBBFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_storage.ace_type, .ace-tomorrow-night-blue .ace_support.ace_type{\
|
||||
color:#EBBBFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_variable {\
|
||||
color:#BBDAFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_variable.ace_parameter {\
|
||||
color:#FFC58F;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_string {\
|
||||
color:#D1F1A9;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_string.ace_regexp {\
|
||||
color:#FF9DA4;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_comment {\
|
||||
color:#7285B7;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_variable {\
|
||||
color:#FF9DA4;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_meta.ace_tag {\
|
||||
color:#FF9DA4;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name {\
|
||||
color:#FF9DA4;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function {\
|
||||
color:#BBDAFF;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_markup.ace_underline {\
|
||||
text-decoration:underline;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_markup.ace_heading {\
|
||||
color:#D1F1A9;\
|
||||
}\
|
||||
\
|
||||
.ace-tomorrow-night-blue .ace_indent-guide {\
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUAn8z7Bq1ar/ABBUBHJ4/r3JAAAAAElFTkSuQmCC) right repeat-y;\
|
||||
}";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
||||
|
||||
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.
|
||||
|
||||
Please note that some subdirectories of the CodeMirror distribution
|
||||
include their own LICENSE files, and are released under different
|
||||
licences.
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# CodeMirror [](http://travis-ci.org/marijnh/CodeMirror)
|
||||
|
||||
CodeMirror is a JavaScript component that provides a code editor in
|
||||
the browser. When a mode is available for the language you are coding
|
||||
in, it will color your code, and optionally help with indentation.
|
||||
|
||||
The project page is http://codemirror.net
|
||||
The manual is at http://codemirror.net/doc/manual.html
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
.CodeMirror {
|
||||
line-height: 1em;
|
||||
font-family: monospace;
|
||||
|
||||
/* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
|
||||
position: relative;
|
||||
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: auto;
|
||||
height: 300px;
|
||||
/* This is needed to prevent an IE[67] bug where the scrolled content
|
||||
is visible outside of the scrolling box. */
|
||||
position: relative;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Vertical scrollbar */
|
||||
.CodeMirror-scrollbar {
|
||||
position: absolute;
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
z-index: 5;
|
||||
}
|
||||
.CodeMirror-scrollbar-inner {
|
||||
/* This needs to have a nonzero width in order for the scrollbar to appear
|
||||
in Firefox and IE9. */
|
||||
width: 1px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-overlap {
|
||||
/* Ensure that the scrollbar appears in Lion, and that it overlaps the content
|
||||
rather than sitting to the right of it. */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
float: none;
|
||||
right: 0;
|
||||
min-width: 12px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-nonoverlap {
|
||||
min-width: 12px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-ie7 {
|
||||
min-width: 18px;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 10;
|
||||
background-color: #f7f7f7;
|
||||
border-right: 1px solid #eee;
|
||||
min-width: 2em;
|
||||
height: 100%;
|
||||
}
|
||||
.CodeMirror-gutter-text {
|
||||
color: #aaa;
|
||||
text-align: right;
|
||||
padding: .4em .2em .4em .4em;
|
||||
white-space: pre !important;
|
||||
cursor: default;
|
||||
}
|
||||
.CodeMirror-lines {
|
||||
padding: .4em;
|
||||
white-space: pre;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.CodeMirror pre {
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
-o-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0; margin: 0; padding: 0; background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
padding: 0; margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror textarea {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 200, 0, .4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||
}
|
||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
div.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.CodeMirror-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* Default theme */
|
||||
|
||||
.cm-s-default span.cm-keyword {color: #708;}
|
||||
.cm-s-default span.cm-atom {color: #219;}
|
||||
.cm-s-default span.cm-number {color: #164;}
|
||||
.cm-s-default span.cm-def {color: #00f;}
|
||||
.cm-s-default span.cm-variable {color: black;}
|
||||
.cm-s-default span.cm-variable-2 {color: #05a;}
|
||||
.cm-s-default span.cm-variable-3 {color: #085;}
|
||||
.cm-s-default span.cm-property {color: black;}
|
||||
.cm-s-default span.cm-operator {color: black;}
|
||||
.cm-s-default span.cm-comment {color: #a50;}
|
||||
.cm-s-default span.cm-string {color: #a11;}
|
||||
.cm-s-default span.cm-string-2 {color: #f50;}
|
||||
.cm-s-default span.cm-meta {color: #555;}
|
||||
.cm-s-default span.cm-error {color: #f00;}
|
||||
.cm-s-default span.cm-qualifier {color: #555;}
|
||||
.cm-s-default span.cm-builtin {color: #30a;}
|
||||
.cm-s-default span.cm-bracket {color: #997;}
|
||||
.cm-s-default span.cm-tag {color: #170;}
|
||||
.cm-s-default span.cm-attribute {color: #00c;}
|
||||
.cm-s-default span.cm-header {color: blue;}
|
||||
.cm-s-default span.cm-quote {color: #090;}
|
||||
.cm-s-default span.cm-hr {color: #999;}
|
||||
.cm-s-default span.cm-link {color: #00c;}
|
||||
span.cm-negative {color: #d44;}
|
||||
span.cm-positive {color: #292;}
|
||||
|
||||
span.cm-header, span.cm-strong {font-weight: bold;}
|
||||
span.cm-em {font-style: italic;}
|
||||
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
||||
span.cm-link {text-decoration: underline;}
|
||||
|
||||
span.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
@media print {
|
||||
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
}
|
||||
419
lib/client/editor/codemirror/mode/javascript.js
vendored
|
|
@ -1,419 +0,0 @@
|
|||
// TODO actually recognize syntax of TypeScript constructs
|
||||
|
||||
CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var jsonMode = parserConfig.json;
|
||||
var isTS = parserConfig.typescript;
|
||||
|
||||
// Tokenizer
|
||||
|
||||
var keywords = function(){
|
||||
function kw(type) {return {type: type, style: "keyword"};}
|
||||
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
|
||||
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
||||
|
||||
var jsKeywords = {
|
||||
"if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
||||
"return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
|
||||
"var": kw("var"), "const": kw("var"), "let": kw("var"),
|
||||
"function": kw("function"), "catch": kw("catch"),
|
||||
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
||||
"in": operator, "typeof": operator, "instanceof": operator,
|
||||
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
|
||||
};
|
||||
|
||||
// Extend the 'normal' keywords with the TypeScript language extensions
|
||||
if (isTS) {
|
||||
var type = {type: "variable", style: "variable-3"};
|
||||
var tsKeywords = {
|
||||
// object-like things
|
||||
"interface": kw("interface"),
|
||||
"class": kw("class"),
|
||||
"extends": kw("extends"),
|
||||
"constructor": kw("constructor"),
|
||||
|
||||
// scope modifiers
|
||||
"public": kw("public"),
|
||||
"private": kw("private"),
|
||||
"protected": kw("protected"),
|
||||
"static": kw("static"),
|
||||
|
||||
"super": kw("super"),
|
||||
|
||||
// types
|
||||
"string": type, "number": type, "bool": type, "any": type
|
||||
};
|
||||
|
||||
for (var attr in tsKeywords) {
|
||||
jsKeywords[attr] = tsKeywords[attr];
|
||||
}
|
||||
}
|
||||
|
||||
return jsKeywords;
|
||||
}();
|
||||
|
||||
var isOperatorChar = /[+\-*&%=<>!?|]/;
|
||||
|
||||
function chain(stream, state, f) {
|
||||
state.tokenize = f;
|
||||
return f(stream, state);
|
||||
}
|
||||
|
||||
function nextUntilUnescaped(stream, end) {
|
||||
var escaped = false, next;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == end && !escaped)
|
||||
return false;
|
||||
escaped = !escaped && next == "\\";
|
||||
}
|
||||
return escaped;
|
||||
}
|
||||
|
||||
// Used as scratch variables to communicate multiple values without
|
||||
// consing up tons of objects.
|
||||
var type, content;
|
||||
function ret(tp, style, cont) {
|
||||
type = tp; content = cont;
|
||||
return style;
|
||||
}
|
||||
|
||||
function jsTokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == '"' || ch == "'")
|
||||
return chain(stream, state, jsTokenString(ch));
|
||||
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
|
||||
return ret(ch);
|
||||
else if (ch == "0" && stream.eat(/x/i)) {
|
||||
stream.eatWhile(/[\da-f]/i);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
|
||||
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (ch == "/") {
|
||||
if (stream.eat("*")) {
|
||||
return chain(stream, state, jsTokenComment);
|
||||
}
|
||||
else if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
else if (state.lastType == "operator" || state.lastType == "keyword c" ||
|
||||
/^[\[{}\(,;:]$/.test(state.lastType)) {
|
||||
nextUntilUnescaped(stream, "/");
|
||||
stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
|
||||
return ret("regexp", "string-2");
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
}
|
||||
else if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return ret("error", "error");
|
||||
}
|
||||
else if (isOperatorChar.test(ch)) {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
||||
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
|
||||
ret("variable", "variable", word);
|
||||
}
|
||||
}
|
||||
|
||||
function jsTokenString(quote) {
|
||||
return function(stream, state) {
|
||||
if (!nextUntilUnescaped(stream, quote))
|
||||
state.tokenize = jsTokenBase;
|
||||
return ret("string", "string");
|
||||
};
|
||||
}
|
||||
|
||||
function jsTokenComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while (ch = stream.next()) {
|
||||
if (ch == "/" && maybeEnd) {
|
||||
state.tokenize = jsTokenBase;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
// Parser
|
||||
|
||||
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
|
||||
|
||||
function JSLexical(indented, column, type, align, prev, info) {
|
||||
this.indented = indented;
|
||||
this.column = column;
|
||||
this.type = type;
|
||||
this.prev = prev;
|
||||
this.info = info;
|
||||
if (align != null) this.align = align;
|
||||
}
|
||||
|
||||
function inScope(state, varname) {
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return true;
|
||||
}
|
||||
|
||||
function parseJS(state, style, type, content, stream) {
|
||||
var cc = state.cc;
|
||||
// Communicate our context to the combinators.
|
||||
// (Less wasteful than consing up a hundred closures on every call.)
|
||||
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
|
||||
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = true;
|
||||
|
||||
while(true) {
|
||||
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
|
||||
if (combinator(type, content)) {
|
||||
while(cc.length && cc[cc.length - 1].lex)
|
||||
cc.pop()();
|
||||
if (cx.marked) return cx.marked;
|
||||
if (type == "variable" && inScope(state, content)) return "variable-2";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Combinator utils
|
||||
|
||||
var cx = {state: null, column: null, marked: null, cc: null};
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
function register(varname) {
|
||||
function inList(list) {
|
||||
for (var v = list; v; v = v.next)
|
||||
if (v.name == varname) return true;
|
||||
return false;
|
||||
}
|
||||
var state = cx.state;
|
||||
if (state.context) {
|
||||
cx.marked = "def";
|
||||
if (inList(state.localVars)) return;
|
||||
state.localVars = {name: varname, next: state.localVars};
|
||||
} else {
|
||||
if (inList(state.globalVars)) return;
|
||||
state.globalVars = {name: varname, next: state.globalVars};
|
||||
}
|
||||
}
|
||||
|
||||
// Combinators
|
||||
|
||||
var defaultVars = {name: "this", next: {name: "arguments"}};
|
||||
function pushcontext() {
|
||||
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
|
||||
cx.state.localVars = defaultVars;
|
||||
}
|
||||
function popcontext() {
|
||||
cx.state.localVars = cx.state.context.vars;
|
||||
cx.state.context = cx.state.context.prev;
|
||||
}
|
||||
function pushlex(type, info) {
|
||||
var result = function() {
|
||||
var state = cx.state;
|
||||
state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
|
||||
};
|
||||
result.lex = true;
|
||||
return result;
|
||||
}
|
||||
function poplex() {
|
||||
var state = cx.state;
|
||||
if (state.lexical.prev) {
|
||||
if (state.lexical.type == ")")
|
||||
state.indented = state.lexical.indented;
|
||||
state.lexical = state.lexical.prev;
|
||||
}
|
||||
}
|
||||
poplex.lex = true;
|
||||
|
||||
function expect(wanted) {
|
||||
return function expecting(type) {
|
||||
if (type == wanted) return cont();
|
||||
else if (wanted == ";") return pass();
|
||||
else return cont(arguments.callee);
|
||||
};
|
||||
}
|
||||
|
||||
function statement(type) {
|
||||
if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
|
||||
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
|
||||
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
||||
if (type == "{") return cont(pushlex("}"), block, poplex);
|
||||
if (type == ";") return cont();
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
|
||||
poplex, statement, poplex);
|
||||
if (type == "variable") return cont(pushlex("stat"), maybelabel);
|
||||
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
|
||||
block, poplex, poplex);
|
||||
if (type == "case") return cont(expression, expect(":"));
|
||||
if (type == "default") return cont(expect(":"));
|
||||
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
||||
statement, poplex, popcontext);
|
||||
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
||||
}
|
||||
function expression(type) {
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "keyword c") return cont(maybeexpression);
|
||||
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
|
||||
if (type == "operator") return cont(expression);
|
||||
if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
|
||||
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
|
||||
return cont();
|
||||
}
|
||||
function maybeexpression(type) {
|
||||
if (type.match(/[;\}\)\],]/)) return pass();
|
||||
return pass(expression);
|
||||
}
|
||||
|
||||
function maybeoperator(type, value) {
|
||||
if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
|
||||
if (type == "operator" && value == "?") return cont(expression, expect(":"), expression);
|
||||
if (type == ";") return;
|
||||
if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
|
||||
if (type == ".") return cont(property, maybeoperator);
|
||||
if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
|
||||
}
|
||||
function maybelabel(type) {
|
||||
if (type == ":") return cont(poplex, statement);
|
||||
return pass(maybeoperator, expect(";"), poplex);
|
||||
}
|
||||
function property(type) {
|
||||
if (type == "variable") {cx.marked = "property"; return cont();}
|
||||
}
|
||||
function objprop(type) {
|
||||
if (type == "variable") cx.marked = "property";
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
|
||||
}
|
||||
function commasep(what, end) {
|
||||
function proceed(type) {
|
||||
if (type == ",") return cont(what, proceed);
|
||||
if (type == end) return cont();
|
||||
return cont(expect(end));
|
||||
}
|
||||
return function commaSeparated(type) {
|
||||
if (type == end) return cont();
|
||||
else return pass(what, proceed);
|
||||
};
|
||||
}
|
||||
function block(type) {
|
||||
if (type == "}") return cont();
|
||||
return pass(statement, block);
|
||||
}
|
||||
function maybetype(type) {
|
||||
if (type == ":") return cont(typedef);
|
||||
return pass();
|
||||
}
|
||||
function typedef(type) {
|
||||
if (type == "variable"){cx.marked = "variable-3"; return cont();}
|
||||
return pass();
|
||||
}
|
||||
function vardef1(type, value) {
|
||||
if (type == "variable") {
|
||||
register(value);
|
||||
return isTS ? cont(maybetype, vardef2) : cont(vardef2);
|
||||
}
|
||||
return pass();
|
||||
}
|
||||
function vardef2(type, value) {
|
||||
if (value == "=") return cont(expression, vardef2);
|
||||
if (type == ",") return cont(vardef1);
|
||||
}
|
||||
function forspec1(type) {
|
||||
if (type == "var") return cont(vardef1, expect(";"), forspec2);
|
||||
if (type == ";") return cont(forspec2);
|
||||
if (type == "variable") return cont(formaybein);
|
||||
return cont(forspec2);
|
||||
}
|
||||
function formaybein(type, value) {
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(maybeoperator, forspec2);
|
||||
}
|
||||
function forspec2(type, value) {
|
||||
if (type == ";") return cont(forspec3);
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(expression, expect(";"), forspec3);
|
||||
}
|
||||
function forspec3(type) {
|
||||
if (type != ")") cont(expression);
|
||||
}
|
||||
function functiondef(type, value) {
|
||||
if (type == "variable") {register(value); return cont(functiondef);}
|
||||
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
|
||||
}
|
||||
function funarg(type, value) {
|
||||
if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();}
|
||||
}
|
||||
|
||||
// Interface
|
||||
|
||||
return {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: jsTokenBase,
|
||||
lastType: null,
|
||||
cc: [],
|
||||
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
||||
localVars: parserConfig.localVars,
|
||||
globalVars: parserConfig.globalVars,
|
||||
context: parserConfig.localVars && {vars: parserConfig.localVars},
|
||||
indented: 0
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = false;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
var style = state.tokenize(stream, state);
|
||||
if (type == "comment") return style;
|
||||
state.lastType = type;
|
||||
return parseJS(state, style, type, content, stream);
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize == jsTokenComment) return CodeMirror.Pass;
|
||||
if (state.tokenize != jsTokenBase) return 0;
|
||||
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
|
||||
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
|
||||
var type = lexical.type, closing = firstChar == type;
|
||||
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0);
|
||||
else if (type == "form" && firstChar == "{") return lexical.indented;
|
||||
else if (type == "form") return lexical.indented + indentUnit;
|
||||
else if (type == "stat")
|
||||
return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? indentUnit : 0);
|
||||
else if (lexical.info == "switch" && !closing)
|
||||
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
|
||||
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
||||
else return lexical.indented + (closing ? 0 : indentUnit);
|
||||
},
|
||||
|
||||
electricChars: ":{}",
|
||||
|
||||
jsonMode: jsonMode
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/javascript", "javascript");
|
||||
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
||||
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
|
||||
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
|
||||
322
lib/client/editor/codemirror/mode/xml.js
vendored
|
|
@ -1,322 +0,0 @@
|
|||
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var Kludges = parserConfig.htmlMode ? {
|
||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||
'track': true, 'wbr': true},
|
||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||
'th': true, 'tr': true},
|
||||
contextGrabbers: {
|
||||
'dd': {'dd': true, 'dt': true},
|
||||
'dt': {'dd': true, 'dt': true},
|
||||
'li': {'li': true},
|
||||
'option': {'option': true, 'optgroup': true},
|
||||
'optgroup': {'optgroup': true},
|
||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||
'rp': {'rp': true, 'rt': true},
|
||||
'rt': {'rp': true, 'rt': true},
|
||||
'tbody': {'tbody': true, 'tfoot': true},
|
||||
'td': {'td': true, 'th': true},
|
||||
'tfoot': {'tbody': true},
|
||||
'th': {'td': true, 'th': true},
|
||||
'thead': {'tbody': true, 'tfoot': true},
|
||||
'tr': {'tr': true}
|
||||
},
|
||||
doNotIndent: {"pre": true},
|
||||
allowUnquoted: true,
|
||||
allowMissing: true
|
||||
} : {
|
||||
autoSelfClosers: {},
|
||||
implicitlyClosed: {},
|
||||
contextGrabbers: {},
|
||||
doNotIndent: {},
|
||||
allowUnquoted: false,
|
||||
allowMissing: false
|
||||
};
|
||||
var alignCDATA = parserConfig.alignCDATA;
|
||||
|
||||
// Return variables for tokenizers
|
||||
var tagName, type;
|
||||
|
||||
function inText(stream, state) {
|
||||
function chain(parser) {
|
||||
state.tokenize = parser;
|
||||
return parser(stream, state);
|
||||
}
|
||||
|
||||
var ch = stream.next();
|
||||
if (ch == "<") {
|
||||
if (stream.eat("!")) {
|
||||
if (stream.eat("[")) {
|
||||
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
||||
else return null;
|
||||
}
|
||||
else if (stream.match("--")) return chain(inBlock("comment", "-->"));
|
||||
else if (stream.match("DOCTYPE", true, true)) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
return chain(doctype(1));
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
else if (stream.eat("?")) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
state.tokenize = inBlock("meta", "?>");
|
||||
return "meta";
|
||||
}
|
||||
else {
|
||||
var isClose = stream.eat("/");
|
||||
tagName = "";
|
||||
var c;
|
||||
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
||||
if (!tagName) return "error";
|
||||
type = isClose ? "closeTag" : "openTag";
|
||||
state.tokenize = inTag;
|
||||
return "tag";
|
||||
}
|
||||
}
|
||||
else if (ch == "&") {
|
||||
var ok;
|
||||
if (stream.eat("#")) {
|
||||
if (stream.eat("x")) {
|
||||
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
||||
}
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
||||
}
|
||||
return ok ? "atom" : "error";
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^&<]/);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function inTag(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
||||
state.tokenize = inText;
|
||||
type = ch == ">" ? "endTag" : "selfcloseTag";
|
||||
return "tag";
|
||||
}
|
||||
else if (ch == "=") {
|
||||
type = "equals";
|
||||
return null;
|
||||
}
|
||||
else if (/[\'\"]/.test(ch)) {
|
||||
state.tokenize = inAttribute(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^\s\u00a0=<>\"\']/);
|
||||
return "word";
|
||||
}
|
||||
}
|
||||
|
||||
function inAttribute(quote) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.next() == quote) {
|
||||
state.tokenize = inTag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
|
||||
function inBlock(style, terminator) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.match(terminator)) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
}
|
||||
stream.next();
|
||||
}
|
||||
return style;
|
||||
};
|
||||
}
|
||||
function doctype(depth) {
|
||||
return function(stream, state) {
|
||||
var ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == "<") {
|
||||
state.tokenize = doctype(depth + 1);
|
||||
return state.tokenize(stream, state);
|
||||
} else if (ch == ">") {
|
||||
if (depth == 1) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
} else {
|
||||
state.tokenize = doctype(depth - 1);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "meta";
|
||||
};
|
||||
}
|
||||
|
||||
var curState, setStyle;
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
|
||||
function pushContext(tagName, startOfLine) {
|
||||
var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
|
||||
curState.context = {
|
||||
prev: curState.context,
|
||||
tagName: tagName,
|
||||
indent: curState.indented,
|
||||
startOfLine: startOfLine,
|
||||
noIndent: noIndent
|
||||
};
|
||||
}
|
||||
function popContext() {
|
||||
if (curState.context) curState.context = curState.context.prev;
|
||||
}
|
||||
|
||||
function element(type) {
|
||||
if (type == "openTag") {
|
||||
curState.tagName = tagName;
|
||||
return cont(attributes, endtag(curState.startOfLine));
|
||||
} else if (type == "closeTag") {
|
||||
var err = false;
|
||||
if (curState.context) {
|
||||
if (curState.context.tagName != tagName) {
|
||||
if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
|
||||
popContext();
|
||||
}
|
||||
err = !curState.context || curState.context.tagName != tagName;
|
||||
}
|
||||
} else {
|
||||
err = true;
|
||||
}
|
||||
if (err) setStyle = "error";
|
||||
return cont(endclosetag(err));
|
||||
}
|
||||
return cont();
|
||||
}
|
||||
function endtag(startOfLine) {
|
||||
return function(type) {
|
||||
if (type == "selfcloseTag" ||
|
||||
(type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
return cont();
|
||||
}
|
||||
if (type == "endTag") {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
pushContext(curState.tagName, startOfLine);
|
||||
return cont();
|
||||
}
|
||||
return cont();
|
||||
};
|
||||
}
|
||||
function endclosetag(err) {
|
||||
return function(type) {
|
||||
if (err) setStyle = "error";
|
||||
if (type == "endTag") { popContext(); return cont(); }
|
||||
setStyle = "error";
|
||||
return cont(arguments.callee);
|
||||
};
|
||||
}
|
||||
function maybePopContext(nextTagName) {
|
||||
var parentTagName;
|
||||
while (true) {
|
||||
if (!curState.context) {
|
||||
return;
|
||||
}
|
||||
parentTagName = curState.context.tagName.toLowerCase();
|
||||
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||
return;
|
||||
}
|
||||
popContext();
|
||||
}
|
||||
}
|
||||
|
||||
function attributes(type) {
|
||||
if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
|
||||
if (type == "endTag" || type == "selfcloseTag") return pass();
|
||||
setStyle = "error";
|
||||
return cont(attributes);
|
||||
}
|
||||
function attribute(type) {
|
||||
if (type == "equals") return cont(attvalue, attributes);
|
||||
if (!Kludges.allowMissing) setStyle = "error";
|
||||
else if (type == "word") setStyle = "attribute";
|
||||
return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvalue(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
|
||||
setStyle = "error";
|
||||
return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvaluemaybe(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
else return pass();
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
state.startOfLine = true;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
|
||||
setStyle = type = tagName = null;
|
||||
var style = state.tokenize(stream, state);
|
||||
state.type = type;
|
||||
if ((style || type) && style != "comment") {
|
||||
curState = state;
|
||||
while (true) {
|
||||
var comb = state.cc.pop() || element;
|
||||
if (comb(type || style)) break;
|
||||
}
|
||||
}
|
||||
state.startOfLine = false;
|
||||
return setStyle || style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter, fullLine) {
|
||||
var context = state.context;
|
||||
if ((state.tokenize != inTag && state.tokenize != inText) ||
|
||||
context && context.noIndent)
|
||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||
if (context && /^<\//.test(textAfter))
|
||||
context = context.prev;
|
||||
while (context && !context.startOfLine)
|
||||
context = context.prev;
|
||||
if (context) return context.indent + indentUnit;
|
||||
else return 0;
|
||||
},
|
||||
|
||||
electricChars: "/",
|
||||
|
||||
configuration: parserConfig.htmlMode ? "html" : "xml"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/xml", "xml");
|
||||
CodeMirror.defineMIME("application/xml", "xml");
|
||||
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
||||
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"name": "codemirror",
|
||||
"version":"2.37.01",
|
||||
"main": "codemirror.js",
|
||||
"description": "In-browser code editing made bearable",
|
||||
"licenses": [{"type": "MIT",
|
||||
"url": "http://codemirror.net/LICENSE"}],
|
||||
"directories": {"lib": "./lib"},
|
||||
"scripts": {"test": "node ./test/run.js"},
|
||||
"devDependencies": {"node-static": "0.6.0"},
|
||||
"bugs": "http://github.com/marijnh/CodeMirror/issues",
|
||||
"keywords": ["JavaScript", "CodeMirror", "Editor"],
|
||||
"homepage": "http://codemirror.net",
|
||||
"maintainers":[{"name": "Marijn Haverbeke",
|
||||
"email": "marijnh@gmail.com",
|
||||
"web": "http://marijnhaverbeke.nl"}],
|
||||
"repositories": [{"type": "git",
|
||||
"url": "http://marijnhaverbeke.nl/git/codemirror"},
|
||||
{"type": "git",
|
||||
"url": "https://github.com/marijnh/CodeMirror.git"}]
|
||||
}
|
||||
21
lib/client/editor/codemirror/theme/night.css
vendored
|
|
@ -1,21 +0,0 @@
|
|||
/* Loosely based on the Midnight Textmate theme */
|
||||
|
||||
.cm-s-night { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-night div.CodeMirror-selected { background: #447 !important; }
|
||||
.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-atom { color: #845dc4; }
|
||||
.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
|
||||
.cm-s-night span.cm-keyword { color: #599eff; }
|
||||
.cm-s-night span.cm-string { color: #37f14a; }
|
||||
.cm-s-night span.cm-meta { color: #7678e2; }
|
||||
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
||||
.cm-s-night span.cm-error { color: #9d1e15; }
|
||||
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
||||
.cm-s-night span.cm-link { color: #845dc4; }
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
||||
|
||||
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.
|
||||
|
||||
Please note that some subdirectories of the CodeMirror distribution
|
||||
include their own LICENSE files, and are released under different
|
||||
licences.
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# CodeMirror [](http://travis-ci.org/marijnh/CodeMirror)
|
||||
|
||||
CodeMirror is a JavaScript component that provides a code editor in
|
||||
the browser. When a mode is available for the language you are coding
|
||||
in, it will color your code, and optionally help with indentation.
|
||||
|
||||
The project page is http://codemirror.net
|
||||
The manual is at http://codemirror.net/doc/manual.html
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
/* Set scrolling behaviour here */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror pre.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 200, 0, .4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||
}
|
||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||
}
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable {color: black;}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-property {color: black;}
|
||||
.cm-s-default .cm-operator {color: black;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-emstrong {font-style: italic; font-weight: bold;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px; padding-right: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
height: 100%;
|
||||
float: left;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%; height: 0px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.CodeMirror-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,409 +0,0 @@
|
|||
// TODO actually recognize syntax of TypeScript constructs
|
||||
|
||||
CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var jsonMode = parserConfig.json;
|
||||
var isTS = parserConfig.typescript;
|
||||
|
||||
// Tokenizer
|
||||
|
||||
var keywords = function(){
|
||||
function kw(type) {return {type: type, style: "keyword"};}
|
||||
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
|
||||
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
||||
|
||||
var jsKeywords = {
|
||||
"if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
||||
"return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
|
||||
"var": kw("var"), "const": kw("var"), "let": kw("var"),
|
||||
"function": kw("function"), "catch": kw("catch"),
|
||||
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
||||
"in": operator, "typeof": operator, "instanceof": operator,
|
||||
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
|
||||
};
|
||||
|
||||
// Extend the 'normal' keywords with the TypeScript language extensions
|
||||
if (isTS) {
|
||||
var type = {type: "variable", style: "variable-3"};
|
||||
var tsKeywords = {
|
||||
// object-like things
|
||||
"interface": kw("interface"),
|
||||
"class": kw("class"),
|
||||
"extends": kw("extends"),
|
||||
"constructor": kw("constructor"),
|
||||
|
||||
// scope modifiers
|
||||
"public": kw("public"),
|
||||
"private": kw("private"),
|
||||
"protected": kw("protected"),
|
||||
"static": kw("static"),
|
||||
|
||||
"super": kw("super"),
|
||||
|
||||
// types
|
||||
"string": type, "number": type, "bool": type, "any": type
|
||||
};
|
||||
|
||||
for (var attr in tsKeywords) {
|
||||
jsKeywords[attr] = tsKeywords[attr];
|
||||
}
|
||||
}
|
||||
|
||||
return jsKeywords;
|
||||
}();
|
||||
|
||||
var isOperatorChar = /[+\-*&%=<>!?|]/;
|
||||
|
||||
function chain(stream, state, f) {
|
||||
state.tokenize = f;
|
||||
return f(stream, state);
|
||||
}
|
||||
|
||||
function nextUntilUnescaped(stream, end) {
|
||||
var escaped = false, next;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == end && !escaped)
|
||||
return false;
|
||||
escaped = !escaped && next == "\\";
|
||||
}
|
||||
return escaped;
|
||||
}
|
||||
|
||||
// Used as scratch variables to communicate multiple values without
|
||||
// consing up tons of objects.
|
||||
var type, content;
|
||||
function ret(tp, style, cont) {
|
||||
type = tp; content = cont;
|
||||
return style;
|
||||
}
|
||||
|
||||
function jsTokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == '"' || ch == "'")
|
||||
return chain(stream, state, jsTokenString(ch));
|
||||
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
|
||||
return ret(ch);
|
||||
else if (ch == "0" && stream.eat(/x/i)) {
|
||||
stream.eatWhile(/[\da-f]/i);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
|
||||
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (ch == "/") {
|
||||
if (stream.eat("*")) {
|
||||
return chain(stream, state, jsTokenComment);
|
||||
}
|
||||
else if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
else if (state.lastType == "operator" || state.lastType == "keyword c" ||
|
||||
/^[\[{}\(,;:]$/.test(state.lastType)) {
|
||||
nextUntilUnescaped(stream, "/");
|
||||
stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
|
||||
return ret("regexp", "string-2");
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
}
|
||||
else if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return ret("error", "error");
|
||||
}
|
||||
else if (isOperatorChar.test(ch)) {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
||||
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
|
||||
ret("variable", "variable", word);
|
||||
}
|
||||
}
|
||||
|
||||
function jsTokenString(quote) {
|
||||
return function(stream, state) {
|
||||
if (!nextUntilUnescaped(stream, quote))
|
||||
state.tokenize = jsTokenBase;
|
||||
return ret("string", "string");
|
||||
};
|
||||
}
|
||||
|
||||
function jsTokenComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while (ch = stream.next()) {
|
||||
if (ch == "/" && maybeEnd) {
|
||||
state.tokenize = jsTokenBase;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
// Parser
|
||||
|
||||
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
|
||||
|
||||
function JSLexical(indented, column, type, align, prev, info) {
|
||||
this.indented = indented;
|
||||
this.column = column;
|
||||
this.type = type;
|
||||
this.prev = prev;
|
||||
this.info = info;
|
||||
if (align != null) this.align = align;
|
||||
}
|
||||
|
||||
function inScope(state, varname) {
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return true;
|
||||
}
|
||||
|
||||
function parseJS(state, style, type, content, stream) {
|
||||
var cc = state.cc;
|
||||
// Communicate our context to the combinators.
|
||||
// (Less wasteful than consing up a hundred closures on every call.)
|
||||
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
|
||||
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = true;
|
||||
|
||||
while(true) {
|
||||
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
|
||||
if (combinator(type, content)) {
|
||||
while(cc.length && cc[cc.length - 1].lex)
|
||||
cc.pop()();
|
||||
if (cx.marked) return cx.marked;
|
||||
if (type == "variable" && inScope(state, content)) return "variable-2";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Combinator utils
|
||||
|
||||
var cx = {state: null, column: null, marked: null, cc: null};
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
function register(varname) {
|
||||
var state = cx.state;
|
||||
if (state.context) {
|
||||
cx.marked = "def";
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return;
|
||||
state.localVars = {name: varname, next: state.localVars};
|
||||
}
|
||||
}
|
||||
|
||||
// Combinators
|
||||
|
||||
var defaultVars = {name: "this", next: {name: "arguments"}};
|
||||
function pushcontext() {
|
||||
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
|
||||
cx.state.localVars = defaultVars;
|
||||
}
|
||||
function popcontext() {
|
||||
cx.state.localVars = cx.state.context.vars;
|
||||
cx.state.context = cx.state.context.prev;
|
||||
}
|
||||
function pushlex(type, info) {
|
||||
var result = function() {
|
||||
var state = cx.state;
|
||||
state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
|
||||
};
|
||||
result.lex = true;
|
||||
return result;
|
||||
}
|
||||
function poplex() {
|
||||
var state = cx.state;
|
||||
if (state.lexical.prev) {
|
||||
if (state.lexical.type == ")")
|
||||
state.indented = state.lexical.indented;
|
||||
state.lexical = state.lexical.prev;
|
||||
}
|
||||
}
|
||||
poplex.lex = true;
|
||||
|
||||
function expect(wanted) {
|
||||
return function expecting(type) {
|
||||
if (type == wanted) return cont();
|
||||
else if (wanted == ";") return pass();
|
||||
else return cont(arguments.callee);
|
||||
};
|
||||
}
|
||||
|
||||
function statement(type) {
|
||||
if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
|
||||
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
|
||||
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
||||
if (type == "{") return cont(pushlex("}"), block, poplex);
|
||||
if (type == ";") return cont();
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
|
||||
poplex, statement, poplex);
|
||||
if (type == "variable") return cont(pushlex("stat"), maybelabel);
|
||||
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
|
||||
block, poplex, poplex);
|
||||
if (type == "case") return cont(expression, expect(":"));
|
||||
if (type == "default") return cont(expect(":"));
|
||||
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
||||
statement, poplex, popcontext);
|
||||
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
||||
}
|
||||
function expression(type) {
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "keyword c") return cont(maybeexpression);
|
||||
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
|
||||
if (type == "operator") return cont(expression);
|
||||
if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
|
||||
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
|
||||
return cont();
|
||||
}
|
||||
function maybeexpression(type) {
|
||||
if (type.match(/[;\}\)\],]/)) return pass();
|
||||
return pass(expression);
|
||||
}
|
||||
|
||||
function maybeoperator(type, value) {
|
||||
if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
|
||||
if (type == "operator" && value == "?") return cont(expression, expect(":"), expression);
|
||||
if (type == ";") return;
|
||||
if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
|
||||
if (type == ".") return cont(property, maybeoperator);
|
||||
if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
|
||||
}
|
||||
function maybelabel(type) {
|
||||
if (type == ":") return cont(poplex, statement);
|
||||
return pass(maybeoperator, expect(";"), poplex);
|
||||
}
|
||||
function property(type) {
|
||||
if (type == "variable") {cx.marked = "property"; return cont();}
|
||||
}
|
||||
function objprop(type) {
|
||||
if (type == "variable") cx.marked = "property";
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
|
||||
}
|
||||
function commasep(what, end) {
|
||||
function proceed(type) {
|
||||
if (type == ",") return cont(what, proceed);
|
||||
if (type == end) return cont();
|
||||
return cont(expect(end));
|
||||
}
|
||||
return function commaSeparated(type) {
|
||||
if (type == end) return cont();
|
||||
else return pass(what, proceed);
|
||||
};
|
||||
}
|
||||
function block(type) {
|
||||
if (type == "}") return cont();
|
||||
return pass(statement, block);
|
||||
}
|
||||
function maybetype(type) {
|
||||
if (type == ":") return cont(typedef);
|
||||
return pass();
|
||||
}
|
||||
function typedef(type) {
|
||||
if (type == "variable"){cx.marked = "variable-3"; return cont();}
|
||||
return pass();
|
||||
}
|
||||
function vardef1(type, value) {
|
||||
if (type == "variable") {
|
||||
register(value);
|
||||
return isTS ? cont(maybetype, vardef2) : cont(vardef2);
|
||||
}
|
||||
return pass();
|
||||
}
|
||||
function vardef2(type, value) {
|
||||
if (value == "=") return cont(expression, vardef2);
|
||||
if (type == ",") return cont(vardef1);
|
||||
}
|
||||
function forspec1(type) {
|
||||
if (type == "var") return cont(vardef1, expect(";"), forspec2);
|
||||
if (type == ";") return cont(forspec2);
|
||||
if (type == "variable") return cont(formaybein);
|
||||
return cont(forspec2);
|
||||
}
|
||||
function formaybein(type, value) {
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(maybeoperator, forspec2);
|
||||
}
|
||||
function forspec2(type, value) {
|
||||
if (type == ";") return cont(forspec3);
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(expression, expect(";"), forspec3);
|
||||
}
|
||||
function forspec3(type) {
|
||||
if (type != ")") cont(expression);
|
||||
}
|
||||
function functiondef(type, value) {
|
||||
if (type == "variable") {register(value); return cont(functiondef);}
|
||||
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
|
||||
}
|
||||
function funarg(type, value) {
|
||||
if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();}
|
||||
}
|
||||
|
||||
// Interface
|
||||
|
||||
return {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: jsTokenBase,
|
||||
lastType: null,
|
||||
cc: [],
|
||||
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
||||
localVars: parserConfig.localVars,
|
||||
context: parserConfig.localVars && {vars: parserConfig.localVars},
|
||||
indented: 0
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = false;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
var style = state.tokenize(stream, state);
|
||||
if (type == "comment") return style;
|
||||
state.lastType = type;
|
||||
return parseJS(state, style, type, content, stream);
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize == jsTokenComment) return CodeMirror.Pass;
|
||||
if (state.tokenize != jsTokenBase) return 0;
|
||||
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
|
||||
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
|
||||
var type = lexical.type, closing = firstChar == type;
|
||||
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0);
|
||||
else if (type == "form" && firstChar == "{") return lexical.indented;
|
||||
else if (type == "form") return lexical.indented + indentUnit;
|
||||
else if (type == "stat")
|
||||
return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? indentUnit : 0);
|
||||
else if (lexical.info == "switch" && !closing)
|
||||
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
|
||||
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
||||
else return lexical.indented + (closing ? 0 : indentUnit);
|
||||
},
|
||||
|
||||
electricChars: ":{}"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/javascript", "javascript");
|
||||
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
||||
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
|
||||
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var Kludges = parserConfig.htmlMode ? {
|
||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||
'track': true, 'wbr': true},
|
||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||
'th': true, 'tr': true},
|
||||
contextGrabbers: {
|
||||
'dd': {'dd': true, 'dt': true},
|
||||
'dt': {'dd': true, 'dt': true},
|
||||
'li': {'li': true},
|
||||
'option': {'option': true, 'optgroup': true},
|
||||
'optgroup': {'optgroup': true},
|
||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||
'rp': {'rp': true, 'rt': true},
|
||||
'rt': {'rp': true, 'rt': true},
|
||||
'tbody': {'tbody': true, 'tfoot': true},
|
||||
'td': {'td': true, 'th': true},
|
||||
'tfoot': {'tbody': true},
|
||||
'th': {'td': true, 'th': true},
|
||||
'thead': {'tbody': true, 'tfoot': true},
|
||||
'tr': {'tr': true}
|
||||
},
|
||||
doNotIndent: {"pre": true},
|
||||
allowUnquoted: true,
|
||||
allowMissing: true
|
||||
} : {
|
||||
autoSelfClosers: {},
|
||||
implicitlyClosed: {},
|
||||
contextGrabbers: {},
|
||||
doNotIndent: {},
|
||||
allowUnquoted: false,
|
||||
allowMissing: false
|
||||
};
|
||||
var alignCDATA = parserConfig.alignCDATA;
|
||||
|
||||
// Return variables for tokenizers
|
||||
var tagName, type;
|
||||
|
||||
function inText(stream, state) {
|
||||
function chain(parser) {
|
||||
state.tokenize = parser;
|
||||
return parser(stream, state);
|
||||
}
|
||||
|
||||
var ch = stream.next();
|
||||
if (ch == "<") {
|
||||
if (stream.eat("!")) {
|
||||
if (stream.eat("[")) {
|
||||
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
||||
else return null;
|
||||
}
|
||||
else if (stream.match("--")) return chain(inBlock("comment", "-->"));
|
||||
else if (stream.match("DOCTYPE", true, true)) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
return chain(doctype(1));
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
else if (stream.eat("?")) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
state.tokenize = inBlock("meta", "?>");
|
||||
return "meta";
|
||||
}
|
||||
else {
|
||||
type = stream.eat("/") ? "closeTag" : "openTag";
|
||||
stream.eatSpace();
|
||||
tagName = "";
|
||||
var c;
|
||||
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
||||
state.tokenize = inTag;
|
||||
return "tag";
|
||||
}
|
||||
}
|
||||
else if (ch == "&") {
|
||||
var ok;
|
||||
if (stream.eat("#")) {
|
||||
if (stream.eat("x")) {
|
||||
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
||||
}
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
||||
}
|
||||
return ok ? "atom" : "error";
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^&<]/);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function inTag(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
||||
state.tokenize = inText;
|
||||
type = ch == ">" ? "endTag" : "selfcloseTag";
|
||||
return "tag";
|
||||
}
|
||||
else if (ch == "=") {
|
||||
type = "equals";
|
||||
return null;
|
||||
}
|
||||
else if (/[\'\"]/.test(ch)) {
|
||||
state.tokenize = inAttribute(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
|
||||
return "word";
|
||||
}
|
||||
}
|
||||
|
||||
function inAttribute(quote) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.next() == quote) {
|
||||
state.tokenize = inTag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
|
||||
function inBlock(style, terminator) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.match(terminator)) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
}
|
||||
stream.next();
|
||||
}
|
||||
return style;
|
||||
};
|
||||
}
|
||||
function doctype(depth) {
|
||||
return function(stream, state) {
|
||||
var ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == "<") {
|
||||
state.tokenize = doctype(depth + 1);
|
||||
return state.tokenize(stream, state);
|
||||
} else if (ch == ">") {
|
||||
if (depth == 1) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
} else {
|
||||
state.tokenize = doctype(depth - 1);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "meta";
|
||||
};
|
||||
}
|
||||
|
||||
var curState, setStyle;
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
|
||||
function pushContext(tagName, startOfLine) {
|
||||
var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
|
||||
curState.context = {
|
||||
prev: curState.context,
|
||||
tagName: tagName,
|
||||
indent: curState.indented,
|
||||
startOfLine: startOfLine,
|
||||
noIndent: noIndent
|
||||
};
|
||||
}
|
||||
function popContext() {
|
||||
if (curState.context) curState.context = curState.context.prev;
|
||||
}
|
||||
|
||||
function element(type) {
|
||||
if (type == "openTag") {
|
||||
curState.tagName = tagName;
|
||||
return cont(attributes, endtag(curState.startOfLine));
|
||||
} else if (type == "closeTag") {
|
||||
var err = false;
|
||||
if (curState.context) {
|
||||
if (curState.context.tagName != tagName) {
|
||||
if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
|
||||
popContext();
|
||||
}
|
||||
err = !curState.context || curState.context.tagName != tagName;
|
||||
}
|
||||
} else {
|
||||
err = true;
|
||||
}
|
||||
if (err) setStyle = "error";
|
||||
return cont(endclosetag(err));
|
||||
}
|
||||
return cont();
|
||||
}
|
||||
function endtag(startOfLine) {
|
||||
return function(type) {
|
||||
if (type == "selfcloseTag" ||
|
||||
(type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
return cont();
|
||||
}
|
||||
if (type == "endTag") {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
pushContext(curState.tagName, startOfLine);
|
||||
return cont();
|
||||
}
|
||||
return cont();
|
||||
};
|
||||
}
|
||||
function endclosetag(err) {
|
||||
return function(type) {
|
||||
if (err) setStyle = "error";
|
||||
if (type == "endTag") { popContext(); return cont(); }
|
||||
setStyle = "error";
|
||||
return cont(arguments.callee);
|
||||
};
|
||||
}
|
||||
function maybePopContext(nextTagName) {
|
||||
var parentTagName;
|
||||
while (true) {
|
||||
if (!curState.context) {
|
||||
return;
|
||||
}
|
||||
parentTagName = curState.context.tagName.toLowerCase();
|
||||
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||
return;
|
||||
}
|
||||
popContext();
|
||||
}
|
||||
}
|
||||
|
||||
function attributes(type) {
|
||||
if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
|
||||
if (type == "endTag" || type == "selfcloseTag") return pass();
|
||||
setStyle = "error";
|
||||
return cont(attributes);
|
||||
}
|
||||
function attribute(type) {
|
||||
if (type == "equals") return cont(attvalue, attributes);
|
||||
if (!Kludges.allowMissing) setStyle = "error";
|
||||
return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvalue(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
|
||||
setStyle = "error";
|
||||
return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvaluemaybe(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
else return pass();
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
state.startOfLine = true;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
|
||||
setStyle = type = tagName = null;
|
||||
var style = state.tokenize(stream, state);
|
||||
state.type = type;
|
||||
if ((style || type) && style != "comment") {
|
||||
curState = state;
|
||||
while (true) {
|
||||
var comb = state.cc.pop() || element;
|
||||
if (comb(type || style)) break;
|
||||
}
|
||||
}
|
||||
state.startOfLine = false;
|
||||
return setStyle || style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter, fullLine) {
|
||||
var context = state.context;
|
||||
if ((state.tokenize != inTag && state.tokenize != inText) ||
|
||||
context && context.noIndent)
|
||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||
if (context && /^<\//.test(textAfter))
|
||||
context = context.prev;
|
||||
while (context && !context.startOfLine)
|
||||
context = context.prev;
|
||||
if (context) return context.indent + indentUnit;
|
||||
else return 0;
|
||||
},
|
||||
|
||||
electricChars: "/"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/xml", "xml");
|
||||
CodeMirror.defineMIME("application/xml", "xml");
|
||||
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
||||
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"name": "codemirror",
|
||||
"version":"3.0.2",
|
||||
"main": "codemirror.js",
|
||||
"description": "In-browser code editing made bearable",
|
||||
"licenses": [{"type": "MIT",
|
||||
"url": "http://codemirror.net/LICENSE"}],
|
||||
"directories": {"lib": "./lib"},
|
||||
"scripts": {"test": "node ./test/run.js"},
|
||||
"devDependencies": {"node-static": "0.6.0"},
|
||||
"bugs": "http://github.com/marijnh/CodeMirror/issues",
|
||||
"keywords": ["JavaScript", "CodeMirror", "Editor"],
|
||||
"homepage": "http://codemirror.net",
|
||||
"maintainers":[{"name": "Marijn Haverbeke",
|
||||
"email": "marijnh@gmail.com",
|
||||
"web": "http://marijnhaverbeke.nl"}],
|
||||
"repositories": [{"type": "git",
|
||||
"url": "http://marijnhaverbeke.nl/git/codemirror"},
|
||||
{"type": "git",
|
||||
"url": "https://github.com/marijnh/CodeMirror.git"}]
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/* Loosely based on the Midnight Textmate theme */
|
||||
|
||||
.cm-s-night { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-night div.CodeMirror-selected { background: #447 !important; }
|
||||
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-atom { color: #845dc4; }
|
||||
.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
|
||||
.cm-s-night span.cm-keyword { color: #599eff; }
|
||||
.cm-s-night span.cm-string { color: #37f14a; }
|
||||
.cm-s-night span.cm-meta { color: #7678e2; }
|
||||
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
||||
.cm-s-night span.cm-error { color: #9d1e15; }
|
||||
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
||||
.cm-s-night span.cm-link { color: #845dc4; }
|
||||
|
|
@ -5,7 +5,7 @@ var DOM, _gaq;
|
|||
/* setting google analitics tracking code */
|
||||
_gaq = [['_setAccount', 'UA-33536569-2'], ['_trackPageview']];
|
||||
|
||||
DOM.addErrorListener(function(msg, url, line) {
|
||||
DOM.Events.addError(function(msg, url, line) {
|
||||
_gaq.push(['_trackEvent', 'JS Error', msg,
|
||||
navigator.userAgent + ' -> ' + url + " : " + line]);
|
||||
});
|
||||
|
|
|
|||
67
lib/client/help.js
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
var CloudCmd, Util, DOM;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
CloudCmd.Help = new HelpProto(CloudCmd, Util, DOM);
|
||||
|
||||
function HelpProto(CloudCmd, Util, DOM){
|
||||
var Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
Help = this;
|
||||
|
||||
this.init = function(pCallBack){
|
||||
Util.loadOnLoad([
|
||||
Help.show,
|
||||
CloudCmd.View,
|
||||
]);
|
||||
|
||||
DOM.Events.addKey(listener);
|
||||
DOM.setButtonKey('f1', Help.show);
|
||||
|
||||
delete Help.init;
|
||||
};
|
||||
|
||||
this.show = function(){
|
||||
Images.showLoad({top:true});
|
||||
DOM.ajax({
|
||||
url: '/README.md',
|
||||
success: function (pData){
|
||||
var lData = {text: pData};
|
||||
DOM.ajax({
|
||||
method : 'post',
|
||||
url : 'https://api.github.com/markdown',
|
||||
data : Util.stringifyJSON(lData),
|
||||
success:function(pResult){
|
||||
var lDiv = DOM.anyload({
|
||||
name : 'div',
|
||||
style : 'white-space: normal;',
|
||||
inner : pResult.toString()
|
||||
});
|
||||
|
||||
Images.hideLoad();
|
||||
CloudCmd.View.show(lDiv);
|
||||
},
|
||||
|
||||
error: Images.showError
|
||||
});
|
||||
},
|
||||
|
||||
error:Images.showError
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.hide = CloudCmd.View.hide;
|
||||
|
||||
function listener(pEvent){
|
||||
var lF1 = Key.F1,
|
||||
lIsBind = Key.isBind(),
|
||||
lKey = pEvent.keyCode;
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if (lIsBind && lKey === lF1)
|
||||
Help.show();
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
820
lib/client/jquery.js
vendored
347
lib/client/key.js
Normal file
|
|
@ -0,0 +1,347 @@
|
|||
var CloudCmd, Util, DOM;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var KEY = {
|
||||
TAB : 9,
|
||||
ENTER : 13,
|
||||
ESC : 27,
|
||||
|
||||
SPACE : 32,
|
||||
PAGE_UP : 33,
|
||||
PAGE_DOWN : 34,
|
||||
END : 35,
|
||||
HOME : 36,
|
||||
UP : 38,
|
||||
DOWN : 40,
|
||||
|
||||
INSERT : 45,
|
||||
DELETE : 46,
|
||||
|
||||
A : 65,
|
||||
|
||||
D : 68,
|
||||
|
||||
G : 71,
|
||||
|
||||
O : 79,
|
||||
Q : 81,
|
||||
R : 82,
|
||||
S : 83,
|
||||
T : 84,
|
||||
|
||||
F1 : 112,
|
||||
F2 : 113,
|
||||
F3 : 114,
|
||||
F4 : 115,
|
||||
F5 : 116,
|
||||
F6 : 117,
|
||||
F7 : 118,
|
||||
F8 : 119,
|
||||
F9 : 120,
|
||||
|
||||
TRA : 192 /* Typewritten Reverse Apostrophe (`) */
|
||||
};
|
||||
|
||||
KeyProto.prototype = KEY;
|
||||
CloudCmd.Key = new KeyProto(CloudCmd, Util, DOM);
|
||||
|
||||
function KeyProto(CloudCmd, Util, DOM){
|
||||
var Key = this,
|
||||
Binded,
|
||||
lTabPanel = {
|
||||
left : 0,
|
||||
right : 0
|
||||
|
||||
};
|
||||
|
||||
this.isBind = function(){return Binded;};
|
||||
|
||||
this.setBind = function(){Binded = true;};
|
||||
|
||||
this.unsetBind = function(){Binded = false;};
|
||||
|
||||
this.bind = function(){
|
||||
DOM.Events.addKey(listener);
|
||||
|
||||
/* клавиши назначены*/
|
||||
Binded = true;
|
||||
};
|
||||
|
||||
function listener(pEvent){
|
||||
/* получаем выдленный файл*/
|
||||
var i, n, lCurrent = DOM.getCurrentFile(),
|
||||
lKeyCode = pEvent.keyCode,
|
||||
lShift = pEvent.shiftKey,
|
||||
lAlt = pEvent.altKey,
|
||||
lCtrl = pEvent.ctrlKey;
|
||||
/* если клавиши можно обрабатывать*/
|
||||
if(Binded){
|
||||
switch(lKeyCode){
|
||||
case Key.TAB:
|
||||
/* changing parent panel of curent-file */
|
||||
var lPanel = DOM.getPanel(),
|
||||
lId = lPanel.id;
|
||||
|
||||
lTabPanel[lId] = lCurrent;
|
||||
|
||||
lPanel = DOM.getPanel({active:false});
|
||||
lId = lPanel.id;
|
||||
|
||||
if(lTabPanel[lId])
|
||||
DOM.setCurrentFile(lTabPanel[lId]);
|
||||
else{
|
||||
var lFirstFileOnList = DOM.getByTag('li', lPanel)[2];
|
||||
|
||||
DOM.setCurrentFile(lFirstFileOnList);
|
||||
}
|
||||
|
||||
DOM.preventDefault(pEvent);//запрет на дальнейшее действие
|
||||
break;
|
||||
|
||||
case Key.INSERT:
|
||||
DOM.setSelectedFile( lCurrent );
|
||||
DOM.setCurrentFile( lCurrent.nextSibling );
|
||||
break;
|
||||
|
||||
case Key.DELETE:
|
||||
if(lShift){
|
||||
var lUrl = DOM.getCurrentPath(lCurrent);
|
||||
|
||||
if( DOM.isCurrentIsDir(lCurrent) )
|
||||
lUrl += '?dir';
|
||||
|
||||
DOM.RESTfull.delete(lUrl, function(){
|
||||
DOM.deleteCurrent(lCurrent);
|
||||
});
|
||||
}
|
||||
else
|
||||
DOM.promptDeleteSelected(lCurrent);
|
||||
break;
|
||||
|
||||
case Key.F1:
|
||||
Util.exec(CloudCmd.Help);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.F2:
|
||||
DOM.renameCurrent(lCurrent);
|
||||
break;
|
||||
|
||||
case Key.F3:
|
||||
Util.exec(CloudCmd.View);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.F4:
|
||||
Util.exec(CloudCmd.Edit);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.F5:
|
||||
DOM.copyCurrent(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.F6:
|
||||
DOM.moveCurrent(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.F7:
|
||||
DOM.promptNewDir();
|
||||
break;
|
||||
|
||||
case Key.F8:
|
||||
DOM.promptDeleteSelected(lCurrent);
|
||||
break;
|
||||
|
||||
case Key.F:
|
||||
DOM.promptDeleteCurrent(lCurrent);
|
||||
break;
|
||||
|
||||
case Key.F9:
|
||||
Util.exec(CloudCmd.Menu);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case Key.TRA:
|
||||
DOM.Images.showLoad({top: true});
|
||||
Util.exec(CloudCmd.Console);
|
||||
break;
|
||||
|
||||
case Key.SPACE:
|
||||
var lSelected = DOM.isSelected(lCurrent),
|
||||
lDir = DOM.isCurrentIsDir(lCurrent),
|
||||
lName = DOM.getCurrentName(lCurrent);
|
||||
|
||||
if(!lDir || lName === '..')
|
||||
lSelected = true;
|
||||
|
||||
Util.ifExec(lSelected, function(){
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
}, function(pCallBack){
|
||||
DOM.loadCurrentSize(pCallBack, lCurrent);
|
||||
});
|
||||
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* навигация по таблице файлов *
|
||||
* если нажали клавишу вверх *
|
||||
* выделяем предыдущую строку */
|
||||
case Key.UP:
|
||||
if(lShift)
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
|
||||
DOM.setCurrentFile( lCurrent.previousSibling );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу в низ *
|
||||
* выделяем следующую строку */
|
||||
case Key.DOWN:
|
||||
if(lShift)
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
|
||||
DOM.setCurrentFile( lCurrent.nextSibling );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу Home *
|
||||
* переходим к самому верхнему *
|
||||
* элементу */
|
||||
case Key.HOME:
|
||||
DOM.setCurrentFile( lCurrent.parentElement.firstChild );
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* если нажали клавишу End
|
||||
* выделяем последний элемент */
|
||||
case Key.END:
|
||||
DOM.setCurrentFile( lCurrent.parentElement.lastElementChild );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу page down
|
||||
* проматываем экран */
|
||||
case Key.PAGE_DOWN:
|
||||
DOM.scrollByPages( DOM.getPanel(), 1 );
|
||||
|
||||
for(i=0; i<30; i++){
|
||||
if(!lCurrent.nextSibling) break;
|
||||
|
||||
lCurrent = lCurrent.nextSibling;
|
||||
}
|
||||
DOM.setCurrentFile(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* если нажали клавишу page up проматываем экран */
|
||||
case Key.PAGE_UP:
|
||||
DOM.scrollByPages( DOM.getPanel(), -1 );
|
||||
|
||||
var lC = lCurrent,
|
||||
tryCatch = function(pCurrentFile){
|
||||
Util.tryCatch(function(){
|
||||
return pCurrentFile
|
||||
.previousSibling
|
||||
.previousSibling
|
||||
.previousSibling
|
||||
.previousSibling;
|
||||
});
|
||||
};
|
||||
|
||||
for(i = 0; i < 30; i++){
|
||||
if(!lC.previousSibling || tryCatch(lC) ) break;
|
||||
|
||||
lC = lC.previousSibling;
|
||||
}
|
||||
DOM.setCurrentFile(lC);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* открываем папку*/
|
||||
case Key.ENTER:
|
||||
if( DOM.isCurrentIsDir() )
|
||||
Util.exec( CloudCmd.loadDir() );
|
||||
break;
|
||||
|
||||
case Key.A:
|
||||
if(pEvent.ctrlKey){
|
||||
var lParent = lCurrent.parentElement,
|
||||
lNodes = lParent.childNodes;
|
||||
|
||||
/* not path and fm_header */
|
||||
for(i = 2, n = lNodes.length; i < n; i++)
|
||||
DOM.setSelectedFile( lNodes[i] );
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
/*
|
||||
* обновляем страницу,
|
||||
* загружаем содержимое каталога
|
||||
* при этом данные берём всегда с
|
||||
* сервера, а не из кэша
|
||||
* (обновляем кэш)
|
||||
*/
|
||||
case Key.R:
|
||||
if(lCtrl){
|
||||
Util.log('<ctrl>+r pressed\n' +
|
||||
'reloading page...\n' +
|
||||
'press <alt>+q to remove all key-handlers');
|
||||
|
||||
CloudCmd.refresh();
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
|
||||
/* чистим кэш */
|
||||
case Key.D:
|
||||
if(lCtrl){
|
||||
Util.log('<ctrl>+d pressed\n' +
|
||||
'clearing cache...\n' +
|
||||
'press <alt>+q to remove all key-handlers');
|
||||
|
||||
DOM.Cache.clear();
|
||||
DOM.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
/* убираем все обработчики
|
||||
* нажатий клавиш */
|
||||
case Key.Q:
|
||||
if(lAlt){
|
||||
Util.log('<alt>+q pressed\n' +
|
||||
'<ctrl>+r reload key-handerl - removed' +
|
||||
'<ctrl>+s clear cache key-handler - removed'+
|
||||
'press <alt>+s to to set them');
|
||||
|
||||
/* обработчик нажатий клавиш снят*/
|
||||
Binded = false;
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* устанавливаем все обработчики
|
||||
* нажатий клавиш
|
||||
*/
|
||||
else if(lKeyCode === Key.S && lAlt){
|
||||
/* обрабатываем нажатия на клавиши*/
|
||||
Binded = true;
|
||||
Util.log('<alt>+s pressed\n' +
|
||||
'<ctrl>+r reload key-handerl - set\n' +
|
||||
'<ctrl>+s clear cache key-handler - set\n' +
|
||||
'press <alt>+q to remove them');
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
@ -1,354 +0,0 @@
|
|||
var CloudCommander, Util, DOM;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
/* private property set or set key binding */
|
||||
var keyBinded;
|
||||
|
||||
/* Key constants*/
|
||||
CloudCmd.KEY = {
|
||||
TAB : 9,
|
||||
ENTER : 13,
|
||||
ESC : 27,
|
||||
|
||||
SPACE : 32,
|
||||
PAGE_UP : 33,
|
||||
PAGE_DOWN : 34,
|
||||
END : 35,
|
||||
HOME : 36,
|
||||
UP : 38,
|
||||
DOWN : 40,
|
||||
|
||||
INSERT : 45,
|
||||
DELETE : 46,
|
||||
|
||||
A : 65,
|
||||
|
||||
D : 68,
|
||||
|
||||
G : 71,
|
||||
|
||||
O : 79,
|
||||
Q : 81,
|
||||
R : 82,
|
||||
S : 83,
|
||||
T : 84,
|
||||
|
||||
F1 : 112,
|
||||
F2 : 113,
|
||||
F3 : 114,
|
||||
F4 : 115,
|
||||
F5 : 116,
|
||||
F6 : 117,
|
||||
F7 : 118,
|
||||
F8 : 119,
|
||||
F10 : 121,
|
||||
|
||||
TRA : 192 /* Typewritten Reverse Apostrophe (`) */
|
||||
};
|
||||
|
||||
var KEY = CloudCmd.KEY;
|
||||
|
||||
CloudCmd.KeyBinding = {};
|
||||
|
||||
var KeyBinding = CloudCmd.KeyBinding;
|
||||
|
||||
KeyBinding.get = function(){return keyBinded;};
|
||||
|
||||
KeyBinding.set = function(){keyBinded = true;};
|
||||
|
||||
KeyBinding.unSet = function(){keyBinded = false;};
|
||||
|
||||
KeyBinding.init = function(){
|
||||
/* saving state of tabs varibles */
|
||||
var lTabPanel = {
|
||||
left : 0,
|
||||
right : 0
|
||||
|
||||
};
|
||||
|
||||
var key_event = function(pEvent){
|
||||
/* получаем выдленный файл*/
|
||||
var i, n, lCurrent = DOM.getCurrentFile(),
|
||||
lKeyCode = pEvent.keyCode,
|
||||
lShift = pEvent.shiftKey,
|
||||
lAlt = pEvent.altKey,
|
||||
lCtrl = pEvent.ctrlKey;
|
||||
/* если клавиши можно обрабатывать*/
|
||||
if(keyBinded){
|
||||
switch(lKeyCode){
|
||||
case KEY.TAB:
|
||||
/* changing parent panel of curent-file */
|
||||
var lPanel = DOM.getPanel(),
|
||||
lId = lPanel.id;
|
||||
|
||||
lTabPanel[lId] = lCurrent;
|
||||
|
||||
lPanel = DOM.getPanel({active:false});
|
||||
lId = lPanel.id;
|
||||
|
||||
if(lTabPanel[lId])
|
||||
DOM.setCurrentFile(lTabPanel[lId]);
|
||||
else{
|
||||
var lFirstFileOnList = DOM.getByTag('li', lPanel)[2];
|
||||
|
||||
DOM.setCurrentFile(lFirstFileOnList);
|
||||
}
|
||||
|
||||
DOM.preventDefault(pEvent);//запрет на дальнейшее действие
|
||||
break;
|
||||
|
||||
case KEY.INSERT:
|
||||
DOM.setSelectedFile( lCurrent );
|
||||
DOM.setCurrentFile( lCurrent.nextSibling );
|
||||
break;
|
||||
|
||||
case KEY.DELETE:
|
||||
if(lShift){
|
||||
var lUrl = DOM.getCurrentPath(lCurrent);
|
||||
|
||||
if( DOM.isCurrentIsDir(lCurrent) )
|
||||
lUrl += '?dir';
|
||||
|
||||
DOM.RESTfull.delete(lUrl, function(){
|
||||
DOM.deleteCurrent(lCurrent);
|
||||
});
|
||||
}
|
||||
else
|
||||
DOM.promptDeleteSelected(lCurrent);
|
||||
break;
|
||||
|
||||
case KEY.F1:
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case KEY.F2:
|
||||
DOM.renameCurrent(lCurrent);
|
||||
break;
|
||||
|
||||
case KEY.F3:
|
||||
var lEditor = CloudCmd[lShift ? 'Viewer' : 'Editor'];
|
||||
|
||||
Util.exec(lEditor, true);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case KEY.F4:
|
||||
DOM.Images.showLoad();
|
||||
Util.exec(CloudCmd.Editor);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case KEY.F5:
|
||||
DOM.copyCurrent(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case KEY.F6:
|
||||
DOM.moveCurrent(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
case KEY.F7:
|
||||
DOM.promptNewDir();
|
||||
break;
|
||||
|
||||
case KEY.F8:
|
||||
DOM.promptDeleteSelected(lCurrent);
|
||||
break;
|
||||
|
||||
case KEY.F:
|
||||
DOM.promptDeleteCurrent(lCurrent);
|
||||
break;
|
||||
|
||||
case KEY.F10:
|
||||
if(lShift){
|
||||
Util.exec(CloudCmd.Menu);
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY.TRA:
|
||||
DOM.Images.showLoad({top: true});
|
||||
Util.exec(CloudCmd.Terminal);
|
||||
break;
|
||||
|
||||
case KEY.SPACE:
|
||||
var lSelected = DOM.isSelected(lCurrent),
|
||||
lDir = DOM.isCurrentIsDir(lCurrent),
|
||||
lName = DOM.getCurrentName(lCurrent);
|
||||
|
||||
if(!lDir || lName === '..')
|
||||
lSelected = true;
|
||||
|
||||
Util.ifExec(lSelected, function(){
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
}, function(pCallBack){
|
||||
DOM.loadCurrentSize(pCallBack, lCurrent);
|
||||
});
|
||||
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* навигация по таблице файлов *
|
||||
* если нажали клавишу вверх *
|
||||
* выделяем предыдущую строку */
|
||||
case KEY.UP:
|
||||
if(lShift)
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
|
||||
DOM.setCurrentFile( lCurrent.previousSibling );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу в низ *
|
||||
* выделяем следующую строку */
|
||||
case KEY.DOWN:
|
||||
if(lShift)
|
||||
DOM.setSelectedFile(lCurrent);
|
||||
|
||||
DOM.setCurrentFile( lCurrent.nextSibling );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу Home *
|
||||
* переходим к самому верхнему *
|
||||
* элементу */
|
||||
case KEY.HOME:
|
||||
DOM.setCurrentFile( lCurrent.parentElement.firstChild );
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* если нажали клавишу End
|
||||
* выделяем последний элемент */
|
||||
case KEY.END:
|
||||
DOM.setCurrentFile( lCurrent.parentElement.lastElementChild );
|
||||
DOM.preventDefault( pEvent );
|
||||
break;
|
||||
|
||||
/* если нажали клавишу page down
|
||||
* проматываем экран */
|
||||
case KEY.PAGE_DOWN:
|
||||
DOM.scrollByPages( DOM.getPanel(), 1 );
|
||||
|
||||
for(i=0; i<30; i++){
|
||||
if(!lCurrent.nextSibling) break;
|
||||
|
||||
lCurrent = lCurrent.nextSibling;
|
||||
}
|
||||
DOM.setCurrentFile(lCurrent);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* если нажали клавишу page up проматываем экран */
|
||||
case KEY.PAGE_UP:
|
||||
DOM.scrollByPages( DOM.getPanel(), -1 );
|
||||
|
||||
var lC = lCurrent,
|
||||
tryCatch = function(pCurrentFile){
|
||||
Util.tryCatch(function(){
|
||||
return pCurrentFile
|
||||
.previousSibling
|
||||
.previousSibling
|
||||
.previousSibling
|
||||
.previousSibling;
|
||||
});
|
||||
};
|
||||
|
||||
for(i = 0; i < 30; i++){
|
||||
if(!lC.previousSibling || tryCatch(lC) ) break;
|
||||
|
||||
lC = lC.previousSibling;
|
||||
}
|
||||
DOM.setCurrentFile(lC);
|
||||
DOM.preventDefault(pEvent);
|
||||
break;
|
||||
|
||||
/* открываем папку*/
|
||||
case KEY.ENTER:
|
||||
if( DOM.isCurrentIsDir() )
|
||||
Util.exec( CloudCmd.loadDir() );
|
||||
break;
|
||||
|
||||
case KEY.A:
|
||||
if(pEvent.ctrlKey){
|
||||
var lParent = lCurrent.parentElement,
|
||||
lNodes = lParent.childNodes;
|
||||
|
||||
/* not path and fm_header */
|
||||
for(i = 2, n = lNodes.length; i < n; i++)
|
||||
DOM.setSelectedFile( lNodes[i] );
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
/* обновляем страницу,
|
||||
* загружаем содержимое каталога
|
||||
* при этом данные берём всегда с
|
||||
* сервера, а не из кэша
|
||||
* (обновляем кэш)*/
|
||||
case KEY.R:
|
||||
if(lCtrl){
|
||||
Util.log('<ctrl>+r pressed\n' +
|
||||
'reloading page...\n' +
|
||||
'press <alt>+q to remove all key-handlers');
|
||||
|
||||
CloudCmd.refresh();
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
|
||||
/* чистим кэш */
|
||||
case KEY.D:
|
||||
if(lCtrl){
|
||||
Util.log('<ctrl>+d pressed\n' +
|
||||
'clearing cache...\n' +
|
||||
'press <alt>+q to remove all key-handlers');
|
||||
|
||||
DOM.Cache.clear();
|
||||
DOM.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
/* убираем все обработчики
|
||||
* нажатий клавиш */
|
||||
case KEY.Q:
|
||||
if(lAlt){
|
||||
Util.log('<alt>+q pressed\n' +
|
||||
'<ctrl>+r reload key-handerl - removed' +
|
||||
'<ctrl>+s clear cache key-handler - removed'+
|
||||
'press <alt>+s to to set them');
|
||||
|
||||
/* обработчик нажатий клавиш снят*/
|
||||
keyBinded = false;
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* устанавливаем все обработчики
|
||||
* нажатий клавиш
|
||||
*/
|
||||
else if(lKeyCode === KEY.S && lAlt){
|
||||
/* обрабатываем нажатия на клавиши*/
|
||||
keyBinded = true;
|
||||
Util.log('<alt>+s pressed\n' +
|
||||
'<ctrl>+r reload key-handerl - set\n' +
|
||||
'<ctrl>+s clear cache key-handler - set\n' +
|
||||
'press <alt>+q to remove them');
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
DOM.addKeyListener(key_event);
|
||||
|
||||
/* клавиши назначены*/
|
||||
keyBinded = true;
|
||||
};
|
||||
|
||||
})(CloudCommander, Util, DOM);
|
||||
|
|
@ -1,316 +1,315 @@
|
|||
/* object contains jQuery-contextMenu
|
||||
* https://github.com/medialize/jQuery-contextMenu
|
||||
*/
|
||||
var CloudCommander, Util, DOM, CloudFunc, $;
|
||||
var CloudCmd, Util, DOM, CloudFunc, $;
|
||||
|
||||
(function(CloudCmd, Util, DOM, CloudFunc){
|
||||
'use strict';
|
||||
|
||||
var KeyBinding = CloudCmd.KeyBinding,
|
||||
MenuSeted = false,
|
||||
Menu = {},
|
||||
Position,
|
||||
UploadToItemNames;
|
||||
|
||||
Menu.dir = '/lib/client/menu/';
|
||||
|
||||
/* enable and disable menu constant */
|
||||
Menu.ENABLED = false;
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/** function shows editor
|
||||
* @param pReadOnly
|
||||
*/
|
||||
function showEditor(pReadOnly){
|
||||
DOM.Images.showLoad();
|
||||
var lEditor = CloudCmd[pReadOnly ? 'Viewer' : 'Editor'],
|
||||
lResult = Util.exec(lEditor, pReadOnly);
|
||||
CloudCmd.Menu = new MenuProto(CloudCmd, Util, DOM, CloudFunc);
|
||||
|
||||
if(!lResult){
|
||||
lEditor = lEditor.get();
|
||||
if(lEditor)
|
||||
Util.exec(lEditor.show);
|
||||
}
|
||||
}
|
||||
|
||||
/* function read data from modules.json
|
||||
* and build array of menu items of "upload to"
|
||||
* menu
|
||||
*/
|
||||
function setUploadToItemNames(pCallBack){
|
||||
CloudCmd.getModules(function(pModules){
|
||||
var lStorageObj = Util.findObjByNameInArr( pModules, 'storage' );
|
||||
UploadToItemNames = Util.getNamesFromObjArray( lStorageObj ) || [];
|
||||
function MenuProto(CloudCmd, Util, DOM, CloudFunc) {
|
||||
var Key = CloudCmd.Key,
|
||||
Events = DOM.Events,
|
||||
MenuSeted = false,
|
||||
Menu = this,
|
||||
Position,
|
||||
UploadToItemNames;
|
||||
|
||||
this.ENABLED = false;
|
||||
|
||||
this.init = function(pPosition){
|
||||
Position = pPosition;
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* function get menu item object for Upload To
|
||||
*/
|
||||
function getUploadToItems(pObjectName){
|
||||
var lObj = {};
|
||||
if( Util.isArray(pObjectName) ){
|
||||
Util.loadOnLoad([
|
||||
Menu.show,
|
||||
setUploadToItemNames,
|
||||
load,
|
||||
DOM.jqueryLoad
|
||||
]);
|
||||
|
||||
var n = pObjectName.length;
|
||||
for(var i = 0; i < n; i++){
|
||||
var lStr = pObjectName[i];
|
||||
lObj[lStr] = getUploadToItems( lStr );
|
||||
}
|
||||
}
|
||||
else if( Util.isString(pObjectName) ){
|
||||
lObj = function(key, opt){
|
||||
DOM.getCurrentData(function(pParams){
|
||||
CloudCmd.execFromModule(pObjectName, 'uploadFile', pParams);
|
||||
});
|
||||
Events.addKey( lListener );
|
||||
|
||||
Util.log('Uploading to ' + pObjectName+ '...');
|
||||
};
|
||||
}
|
||||
|
||||
return lObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* get menu item
|
||||
*/
|
||||
function getItem(pName, pCallBack){
|
||||
var lRet = {
|
||||
name : pName
|
||||
};
|
||||
|
||||
if( Util.isFunction(pCallBack) )
|
||||
lRet.callback = pCallBack;
|
||||
|
||||
else if ( Util.isObject(pCallBack) ){
|
||||
if(pCallBack.name)
|
||||
lRet.items = pCallBack;
|
||||
else
|
||||
lRet.items = getAllItems(pCallBack);
|
||||
}
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all menu items
|
||||
* pItems = [{pName, pFunc}]
|
||||
*/
|
||||
function getAllItems(pItems){
|
||||
var lRet = {},
|
||||
lName,
|
||||
lFunc;
|
||||
|
||||
if(pItems)
|
||||
for(lName in pItems){
|
||||
lFunc = pItems[lName];
|
||||
lRet[lName] = getItem(lName, lFunc);
|
||||
}
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* download menu item callback
|
||||
*/
|
||||
function downloadFromMenu(key, opt){
|
||||
DOM.Images.showLoad();
|
||||
|
||||
var lPath = DOM.getCurrentPath(),
|
||||
lId = DOM.getIdBySrc(lPath);
|
||||
|
||||
Util.log('downloading file ' + lPath +'...');
|
||||
|
||||
var lDir = DOM.isCurrentIsDir() ? '&&json' : '';
|
||||
|
||||
lPath = CloudFunc.FS + lPath + '?download' + lDir;
|
||||
|
||||
if(!DOM.getById(lId)){
|
||||
var lDownload = DOM.anyload({
|
||||
name : 'iframe',
|
||||
async : false,
|
||||
className : 'hidden',
|
||||
src : lPath,
|
||||
func : Util.retFunc(DOM.Images.hideLoad)
|
||||
});
|
||||
|
||||
DOM.Images.hideLoad();
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(lDownload);
|
||||
}, 10000);
|
||||
}
|
||||
else
|
||||
DOM.Images.showError({
|
||||
responseText: 'Error: You trying to' +
|
||||
'download same file to often'});
|
||||
}
|
||||
|
||||
/**
|
||||
* function return configureation for menu
|
||||
*/
|
||||
function getConfig (){
|
||||
var lRet,
|
||||
lMenuItems = {
|
||||
'View' : Util.retExec(showEditor, true),
|
||||
'Edit' : Util.retExec(showEditor, false),
|
||||
'Rename' : function(){
|
||||
setTimeout( Util.retExec(DOM.renameCurrent), 100);
|
||||
},
|
||||
'Delete' : Util.retExec(DOM.promptDeleteCurrent)
|
||||
};
|
||||
|
||||
if(UploadToItemNames.length)
|
||||
lMenuItems['Upload to'] = getUploadToItems(UploadToItemNames);
|
||||
|
||||
lMenuItems.Download = Util.retExec(downloadFromMenu);
|
||||
|
||||
lMenuItems.New = {
|
||||
'File' : DOM.promptNewFile,
|
||||
'Dir' : DOM.promptNewDir,
|
||||
|
||||
'From cloud...' : function(){
|
||||
CloudCmd.execFromModule('FilePicker', 'saveFile', function(pName, pData){
|
||||
var lPath = DOM.getCurrentDirPath() + pName;
|
||||
|
||||
DOM.RESTfull.save(lPath, pData, CloudCmd.refresh);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
lRet = {
|
||||
// define which elements trigger this menu
|
||||
selector: 'li',
|
||||
|
||||
callback: function(key, options) {
|
||||
var m = "clicked: " + key;
|
||||
Util.log(m, options);
|
||||
DOM.setButtonKey('f9', function() {
|
||||
var lCurrent = DOM.getCurrentFile();
|
||||
|
||||
KeyBinding.set();
|
||||
},
|
||||
Events.dispatch('contextmenu', lCurrent);
|
||||
});
|
||||
|
||||
// define the elements of the menu
|
||||
items : getAllItems(lMenuItems),
|
||||
events :{
|
||||
hide: clickProcessing
|
||||
}
|
||||
delete Menu.init;
|
||||
};
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/** function loads css and js of Menu
|
||||
* @param pCallBack
|
||||
*/
|
||||
function load(pCallBack){
|
||||
console.time('menu load');
|
||||
this.show = function() {
|
||||
set();
|
||||
DOM.Images.hideLoad();
|
||||
|
||||
if(Position && !Position.x )
|
||||
Position = undefined;
|
||||
|
||||
$('li').contextMenu(Position);
|
||||
};
|
||||
|
||||
var lDir = Menu.dir,
|
||||
lFiles = [
|
||||
lDir + 'contextMenu.js',
|
||||
lDir + 'contextMenu.css'
|
||||
];
|
||||
|
||||
DOM.anyLoadInParallel(lFiles, function(){
|
||||
console.timeEnd('menu load');
|
||||
$.contextMenu.handle.keyStop = $.noop;
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Menu works in some crazy way so need a
|
||||
* little hack to get every thing work out.
|
||||
* When menu shows up, it draws invisible
|
||||
* layer wich hides all elements of
|
||||
* Cloud Commander so it could not handle
|
||||
* onclick events. To get every thing work
|
||||
* how expected we remove invisible layer
|
||||
* so for observer it is nothing special
|
||||
* is not going on. All magic happening in
|
||||
* DOM tree.
|
||||
*/
|
||||
function clickProcessing(){
|
||||
var lLayer = DOM.getById('context-menu-layer');
|
||||
if(lLayer){
|
||||
document.body.removeChild(lLayer);
|
||||
|
||||
var lElement = document.elementFromPoint(Position.x, Position.y),
|
||||
lTag = lElement.tagName;
|
||||
|
||||
if(lTag === 'A' || lTag === 'SPAN'){
|
||||
if (lElement.tagName === 'A')
|
||||
lElement = lElement.parentElement.parentElement;
|
||||
else if(lElement.tagName === 'SPAN')
|
||||
lElement = lElement.parentElement;
|
||||
|
||||
if(lElement.className === '')
|
||||
DOM.setCurrentFile(lElement);
|
||||
}
|
||||
|
||||
KeyBinding.set();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function set(){
|
||||
if(!MenuSeted){
|
||||
$.contextMenu(getConfig());
|
||||
MenuSeted = true;
|
||||
//DOM.addListener('mousedown', clickProcessing);
|
||||
DOM.addListener('mousemove', function(pEvent){
|
||||
Position = {
|
||||
x : pEvent.clientX,
|
||||
y : pEvent.clientY
|
||||
};
|
||||
/* function read data from modules.json
|
||||
* and build array of menu items of "upload to"
|
||||
* menu
|
||||
*/
|
||||
function setUploadToItemNames(pCallBack) {
|
||||
CloudCmd.getModules(function(pModules) {
|
||||
var lStorageObj = Util.findObjByNameInArr( pModules, 'storage' );
|
||||
UploadToItemNames = Util.getNamesFromObjArray( lStorageObj ) || [];
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** function shows menu for the first time
|
||||
* right away after loading
|
||||
*/
|
||||
Menu.show = function(){
|
||||
set();
|
||||
DOM.Images.hideLoad();
|
||||
|
||||
if(Position && !Position.x )
|
||||
Position = undefined;
|
||||
|
||||
$('li').contextMenu(Position);
|
||||
};
|
||||
|
||||
/* key binding function */
|
||||
Menu.init = function(pPosition){
|
||||
Position = pPosition;
|
||||
|
||||
Util.loadOnLoad([
|
||||
Menu.show,
|
||||
setUploadToItemNames,
|
||||
load,
|
||||
DOM.jqueryLoad
|
||||
]);
|
||||
|
||||
var key_event = function(pEvent){
|
||||
var lKEY = CloudCmd.KEY,
|
||||
lKeyCode = pEvent.keyCode;
|
||||
/* если клавиши можно обрабатывать */
|
||||
if( KeyBinding.get() ){
|
||||
/* if shift + F10 pressed */
|
||||
if(lKeyCode === lKEY.F10 && pEvent.shiftKey){
|
||||
$( DOM.getCurrentFile() ).contextMenu();
|
||||
DOM.preventDefault(pEvent);
|
||||
/**
|
||||
* function get menu item object for Upload To
|
||||
*/
|
||||
function getUploadToItems(pObjectName){
|
||||
var i, n, lStr, lObj = {};
|
||||
if (Util.isArray(pObjectName)) {
|
||||
|
||||
n = pObjectName.length;
|
||||
for(i = 0; i < n; i++){
|
||||
lStr = pObjectName[i];
|
||||
lObj[lStr] = getUploadToItems( lStr );
|
||||
}
|
||||
}
|
||||
else if (lKeyCode === lKEY.ESC)
|
||||
KeyBinding.set();
|
||||
};
|
||||
else if (Util.isString(pObjectName)) {
|
||||
lObj = function(key, opt){
|
||||
DOM.getCurrentData(function(pParams) {
|
||||
CloudCmd.execFromModule(pObjectName, 'uploadFile', pParams);
|
||||
});
|
||||
|
||||
Util.log('Uploading to ' + pObjectName+ '...');
|
||||
};
|
||||
}
|
||||
|
||||
return lObj;
|
||||
}
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
DOM.addKeyListener( key_event );
|
||||
};
|
||||
|
||||
CloudCmd.Menu = Menu;
|
||||
})(CloudCommander, Util, DOM, CloudFunc);
|
||||
/**
|
||||
* get menu item
|
||||
*/
|
||||
function getItem(pName, pCallBack){
|
||||
var lRet = {
|
||||
name : pName
|
||||
};
|
||||
|
||||
if( Util.isFunction(pCallBack) )
|
||||
lRet.callback = pCallBack;
|
||||
|
||||
else if ( Util.isObject(pCallBack) ){
|
||||
if(pCallBack.name)
|
||||
lRet.items = pCallBack;
|
||||
else
|
||||
lRet.items = getAllItems(pCallBack);
|
||||
}
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all menu items
|
||||
* pItems = [{pName, pFunc}]
|
||||
*/
|
||||
function getAllItems(pItems){
|
||||
var lRet = {},
|
||||
lName,
|
||||
lFunc;
|
||||
|
||||
if(pItems)
|
||||
for(lName in pItems){
|
||||
lFunc = pItems[lName];
|
||||
lRet[lName] = getItem(lName, lFunc);
|
||||
}
|
||||
|
||||
return lRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* download menu item callback
|
||||
*/
|
||||
function downloadFromMenu(key, opt){
|
||||
DOM.Images.showLoad();
|
||||
|
||||
var lPath = DOM.getCurrentPath(),
|
||||
lId = DOM.getIdBySrc(lPath),
|
||||
lDir = DOM.isCurrentIsDir() ? '&&json' : '';
|
||||
|
||||
Util.log('downloading file ' + lPath +'...');
|
||||
|
||||
lPath = CloudFunc.FS + lPath + '?download' + lDir;
|
||||
|
||||
if (!DOM.getById(lId)){
|
||||
var lDownload = DOM.anyload({
|
||||
name : 'iframe',
|
||||
async : false,
|
||||
className : 'hidden',
|
||||
src : lPath,
|
||||
func : Util.retFunc(DOM.Images.hideLoad)
|
||||
});
|
||||
|
||||
DOM.Images.hideLoad();
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(lDownload);
|
||||
}, 10000);
|
||||
}
|
||||
else
|
||||
DOM.Images.showError({
|
||||
responseText: 'Error: You trying to' +
|
||||
'download same file to often'});
|
||||
}
|
||||
|
||||
/**
|
||||
* function return configureation for menu
|
||||
*/
|
||||
function getConfig (){
|
||||
var lRet,
|
||||
lMenuItems = {
|
||||
'View' : Util.retExec(show, 'View'),
|
||||
'Edit' : Util.retExec(show, 'Edit'),
|
||||
'Rename' : function(){
|
||||
setTimeout( Util.retExec(DOM.renameCurrent), 100);
|
||||
},
|
||||
'Delete' : Util.retExec(DOM.promptDeleteSelected)
|
||||
};
|
||||
|
||||
if (UploadToItemNames.length)
|
||||
lMenuItems['Upload to'] = getUploadToItems(UploadToItemNames);
|
||||
|
||||
lMenuItems.Download = Util.retExec(downloadFromMenu);
|
||||
|
||||
lMenuItems.New = {
|
||||
'File' : DOM.promptNewFile,
|
||||
'Dir' : DOM.promptNewDir,
|
||||
|
||||
'From cloud...' : function(){
|
||||
CloudCmd.execFromModule('FilePicker', 'saveFile', function(pName, pData){
|
||||
var lPath = DOM.getCurrentDirPath() + pName;
|
||||
|
||||
DOM.RESTfull.save(lPath, pData, CloudCmd.refresh);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
lRet = {
|
||||
// define which elements trigger this menu
|
||||
selector: 'li',
|
||||
|
||||
callback: function(key, options) {
|
||||
var m = "clicked: " + key;
|
||||
Util.log(m, options);
|
||||
|
||||
Key.setBind();
|
||||
},
|
||||
|
||||
// define the elements of the menu
|
||||
items : getAllItems(lMenuItems),
|
||||
events :{
|
||||
hide: clickProcessing
|
||||
}
|
||||
};
|
||||
|
||||
return lRet;
|
||||
|
||||
function show(pName){
|
||||
var lEditor = CloudCmd[pName],
|
||||
lResult = Util.exec(lEditor);
|
||||
|
||||
if (!lResult)
|
||||
Util.exec(lEditor.show);
|
||||
}
|
||||
}
|
||||
|
||||
/** function loads css and js of Menu
|
||||
* @param pCallBack
|
||||
*/
|
||||
function load(pCallBack){
|
||||
Util.time('menu load');
|
||||
|
||||
var lDir = '/lib/client/menu/',
|
||||
lFiles = [
|
||||
lDir + 'contextMenu.js',
|
||||
lDir + 'contextMenu.css'
|
||||
];
|
||||
|
||||
DOM.anyLoadInParallel(lFiles, function(){
|
||||
Util.timeEnd('menu load');
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Menu works in some crazy way so need a
|
||||
* little hack to get every thing work out.
|
||||
* When menu shows up, it draws invisible
|
||||
* layer wich hides all elements of
|
||||
* Cloud Commander so it could not handle
|
||||
* onclick events. To get every thing work
|
||||
* how expected we hide invisible layer
|
||||
* so for observer it is nothing special
|
||||
* is not going on. All magic happening in
|
||||
* DOM tree.
|
||||
*/
|
||||
function clickProcessing(){
|
||||
var lLayer = DOM.getById('context-menu-layer');
|
||||
if(lLayer){
|
||||
DOM.hide(lLayer);
|
||||
|
||||
var lElement = document.elementFromPoint(Position.x, Position.y),
|
||||
lTag = lElement.tagName;
|
||||
|
||||
if (Util.strCmp(lTag, ['A', 'SPAN'])) {
|
||||
switch (lTag) {
|
||||
case 'A':
|
||||
lElement = lElement.parentElement.parentElement;
|
||||
break;
|
||||
|
||||
case 'SPAN':
|
||||
lElement = lElement.parentElement;
|
||||
break;
|
||||
}
|
||||
|
||||
if (lElement.className === '')
|
||||
DOM.setCurrentFile(lElement);
|
||||
}
|
||||
|
||||
DOM.show(lLayer);
|
||||
Key.setBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function set(){
|
||||
if(!MenuSeted){
|
||||
$.contextMenu(getConfig());
|
||||
MenuSeted = true;
|
||||
DOM.Events.add('mousemove', function(pEvent){
|
||||
Position = {
|
||||
x : pEvent.clientX,
|
||||
y : pEvent.clientY
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function lListener(pEvent){
|
||||
var lCurrent,
|
||||
lF9 = Key.F9,
|
||||
lESC = Key.ESC,
|
||||
lKey = pEvent.keyCode,
|
||||
lIsBind = Key.isBind();
|
||||
|
||||
if (lIsBind && lKey === lF9) {
|
||||
lCurrent = DOM.getCurrentFile();
|
||||
$(lCurrent).contextmenu();
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
else if (lKey === lESC)
|
||||
Key.setBind();
|
||||
}
|
||||
}
|
||||
})(CloudCmd, Util, DOM, CloudFunc);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* script, fixes ie */
|
||||
var Util, DOM, jQuery;
|
||||
|
||||
(function(Util, DOM, $){
|
||||
|
|
@ -1,103 +1,83 @@
|
|||
/* module make possible connectoin thrue socket.io on a client */
|
||||
var CloudCommander, Util, DOM, io;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var Messages = [],
|
||||
socket,
|
||||
Terminal,
|
||||
|
||||
ERROR_MSG = 'could not connect to socket.io\n'+
|
||||
'npm i socket.io';
|
||||
|
||||
function getTerminal(){
|
||||
return CloudCmd.Terminal.JqueryTerminal;
|
||||
}
|
||||
|
||||
DOM.jsload('/socket.io/lib/socket.io.js', {
|
||||
onerror : Util.retExec(Util.log, ERROR_MSG),
|
||||
|
||||
onload : function(){
|
||||
socket = io.connect(CloudCmd.HOST);
|
||||
|
||||
CloudCmd.Socket = socket;
|
||||
|
||||
socket.on('connect', function () {
|
||||
Terminal = getTerminal();
|
||||
|
||||
if(Terminal){
|
||||
outToTerminal({stdout: 'socket connected'});
|
||||
|
||||
Terminal.Term.resume();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('message', function (msg) {
|
||||
var lMsg = Util.parseJSON(msg);
|
||||
|
||||
outToTerminal(lMsg);
|
||||
|
||||
});
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
Terminal = getTerminal();
|
||||
|
||||
if(Terminal){
|
||||
outToTerminal({stderr: 'socket disconected'});
|
||||
|
||||
Terminal.Term.pause();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function outToTerminal(pMsg){
|
||||
var lResult, lTerm;
|
||||
|
||||
Terminal = getTerminal();
|
||||
if(Terminal)
|
||||
lTerm = Terminal.Term;
|
||||
|
||||
if(lTerm){
|
||||
var lStdout,
|
||||
lStderr;
|
||||
|
||||
if(Messages.length){
|
||||
/* show oll msg from buffer */
|
||||
for(var i = 0, n = Messages.length; i < n; i++){
|
||||
lStdout = Messages[i].stdout;
|
||||
lStderr = Messages[i].stderr;
|
||||
|
||||
if(lStdout)
|
||||
lTerm.echo(lStdout);
|
||||
|
||||
if(lStderr){
|
||||
/* if it's object - convert is to string' */
|
||||
if( Util.isObject(lStderr) )
|
||||
lStderr = Util.stringifyJSON(lStderr);
|
||||
|
||||
lTerm.error(lStderr);
|
||||
}
|
||||
}
|
||||
Messages = [];
|
||||
}
|
||||
|
||||
lStdout = pMsg.stdout;
|
||||
lStderr = pMsg.stderr;
|
||||
|
||||
if(lStdout)
|
||||
lResult = lTerm.echo(lStdout);
|
||||
|
||||
if(lStderr && lStderr.code !== 1)
|
||||
lResult = lTerm.error(lStderr.toString());
|
||||
}
|
||||
else
|
||||
/* if term not accesable save msg to buffer */
|
||||
Messages.push(pMsg);
|
||||
|
||||
Util.log(pMsg);
|
||||
|
||||
return lResult;
|
||||
}
|
||||
|
||||
})(CloudCommander, Util, DOM);
|
||||
/* module make possible connectoin thrue socket.io on a client */
|
||||
var CloudCmd, Util, DOM, io;
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var Messages = [],
|
||||
socket,
|
||||
Terminal,
|
||||
|
||||
ERROR_MSG = 'could not connect to socket.io\n'+
|
||||
'npm i socket.io';
|
||||
|
||||
DOM.jsload('/socket.io/lib/socket.io.js', {
|
||||
onerror : Util.retExec(Util.log, ERROR_MSG),
|
||||
onload : connect
|
||||
});
|
||||
|
||||
function connect() {
|
||||
socket = io.connect(CloudCmd.HOST);
|
||||
|
||||
CloudCmd.Socket = socket;
|
||||
|
||||
socket.on('connect', function () {
|
||||
outToTerminal({stdout: 'socket connected'});
|
||||
});
|
||||
|
||||
socket.on('message', function (msg) {
|
||||
var lMsg = Util.parseJSON(msg);
|
||||
|
||||
outToTerminal(lMsg);
|
||||
|
||||
});
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
outToTerminal({stderr: 'socket disconected'});
|
||||
});
|
||||
}
|
||||
|
||||
function outToTerminal(pMsg){
|
||||
var i, n, lResult, lStdout, lStderr,
|
||||
lConsole = CloudCmd.Console;
|
||||
DOM.Images.hideLoad();
|
||||
|
||||
if( Util.isObject(lConsole) ){
|
||||
if(Messages.length){
|
||||
/* show oll msg from buffer */
|
||||
for(i = 0, n = Messages.length; i < n; i++){
|
||||
lStdout = Messages[i].stdout;
|
||||
lStderr = Messages[i].stderr;
|
||||
|
||||
if(lStdout)
|
||||
lConsole.log(lStdout);
|
||||
|
||||
if(lStderr){
|
||||
/* if it's object - convert is to string' */
|
||||
if( Util.isObject(lStderr) )
|
||||
lStderr = Util.stringifyJSON(lStderr);
|
||||
|
||||
lConsole.error(lStderr);
|
||||
}
|
||||
}
|
||||
Messages = [];
|
||||
}
|
||||
|
||||
lStdout = pMsg.stdout;
|
||||
lStderr = pMsg.stderr;
|
||||
|
||||
if(lStdout)
|
||||
lResult = lConsole.log(lStdout);
|
||||
|
||||
if(lStderr && lStderr.code !== 1)
|
||||
lResult = lConsole.error(lStderr.toString());
|
||||
}
|
||||
else
|
||||
/* if term not accesable save msg to buffer */
|
||||
Messages.push(pMsg);
|
||||
|
||||
Util.log(pMsg);
|
||||
|
||||
return lResult;
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, Util, DOM, Dropbox, cb, Client;
|
||||
var CloudCmd, Util, DOM, Dropbox, cb, Client;
|
||||
/* module for work with github */
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
|
|
@ -108,4 +108,4 @@ var CloudCommander, Util, DOM, Dropbox, cb, Client;
|
|||
};
|
||||
|
||||
CloudCmd.DropBox = DropBoxStore;
|
||||
})(CloudCommander, Util, DOM);
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
|
|||
|
|
@ -1,55 +1,54 @@
|
|||
var CloudCommander, DOM, Dropbox;
|
||||
/* module for work with github */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var cloudcmd = CloudCommander,
|
||||
CHOOSER_API = 'https://www.dropbox.com/static/api/1/dropbox.js',
|
||||
CLIENT_ID,
|
||||
DropBoxStore = {},
|
||||
options = {
|
||||
linkType: "direct",
|
||||
success: function(files) {
|
||||
console.log("Here's the file link:" + files[0].link);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log('Chose something');
|
||||
}
|
||||
};
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* function loads dropbox.js
|
||||
*/
|
||||
function load(){
|
||||
console.time('dropbox load');
|
||||
|
||||
cloudcmd.getConfig(function(pConfig){
|
||||
var lElement = DOM.anyload({
|
||||
src : CHOOSER_API,
|
||||
not_append : true,
|
||||
id : 'dropboxjs',
|
||||
func : DropBoxStore.choose
|
||||
|
||||
});
|
||||
|
||||
var lDropBoxId = pConfig.dropbox_chooser_key;
|
||||
lElement.setAttribute('data-app-key', lDropBoxId);
|
||||
document.body.appendChild(lElement);
|
||||
|
||||
console.timeEnd('dropbox load');
|
||||
});
|
||||
}
|
||||
|
||||
DropBoxStore.choose = function(){
|
||||
Dropbox.choose(options);
|
||||
};
|
||||
|
||||
DropBoxStore.init = function(){
|
||||
load();
|
||||
};
|
||||
|
||||
cloudcmd.DropBox = DropBoxStore;
|
||||
})();
|
||||
var CloudCmd, DOM, Dropbox;
|
||||
/* module for work with github */
|
||||
|
||||
(function(CloudCmd, DOM){
|
||||
'use strict';
|
||||
|
||||
var CHOOSER_API = 'https://www.dropbox.com/static/api/1/dropbox.js',
|
||||
CLIENT_ID,
|
||||
DropBoxStore = {},
|
||||
options = {
|
||||
linkType: "direct",
|
||||
success: function(files) {
|
||||
console.log("Here's the file link:" + files[0].link);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log('Chose something');
|
||||
}
|
||||
};
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* function loads dropbox.js
|
||||
*/
|
||||
function load(){
|
||||
console.time('dropbox load');
|
||||
|
||||
CloudCmd.getConfig(function(pConfig){
|
||||
var lElement = DOM.anyload({
|
||||
src : CHOOSER_API,
|
||||
not_append : true,
|
||||
id : 'dropboxjs',
|
||||
func : DropBoxStore.choose
|
||||
|
||||
});
|
||||
|
||||
var lDropBoxId = pConfig.dropbox_chooser_key;
|
||||
lElement.setAttribute('data-app-key', lDropBoxId);
|
||||
document.body.appendChild(lElement);
|
||||
|
||||
console.timeEnd('dropbox load');
|
||||
});
|
||||
}
|
||||
|
||||
DropBoxStore.choose = function(){
|
||||
Dropbox.choose(options);
|
||||
};
|
||||
|
||||
DropBoxStore.init = function(){
|
||||
load();
|
||||
};
|
||||
|
||||
CloudCmd.DropBox = DropBoxStore;
|
||||
})(CloudCmd, DOM);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
var CloudCommander, Util, DOM, $, filepicker;
|
||||
/* module for work with filepicker */
|
||||
var CloudCmd, Util, DOM, $, filepicker;
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
|
@ -17,14 +16,10 @@ var CloudCommander, Util, DOM, $, filepicker;
|
|||
var lContent = pParams.data,
|
||||
lName = pParams.name;
|
||||
|
||||
filepicker.store(lContent, {filename: lName}, function(new_fpfile){
|
||||
console.log(new_fpfile);
|
||||
});
|
||||
|
||||
filepicker.pick(function(FPFile){
|
||||
console.log(FPFile.url);
|
||||
filepicker.store(lContent, {filename: lName}, function(pFPFile){
|
||||
console.log(pFPFile);
|
||||
|
||||
Util.exec(pCallBack);
|
||||
filepicker.exportFile(pFPFile, Util.log, Util.log);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -43,16 +38,22 @@ var CloudCommander, Util, DOM, $, filepicker;
|
|||
|
||||
function load(pCallBack){
|
||||
console.time('filepicker load');
|
||||
var lHTTP = "https:"===document.location.protocol? "https:" : "http:";
|
||||
var lHTTP = document.location.protocol;
|
||||
|
||||
DOM.jsload(lHTTP + '//api.filepicker.io/v1/filepicker.js', function(){
|
||||
filepicker.setKey('AACq5fTfzRY2E_Rw_4kyaz');
|
||||
DOM.Images.hideLoad();
|
||||
console.timeEnd('filepicker loaded');
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
CloudCmd.getModules(function(pModules){
|
||||
var lStorage = Util.findObjByNameInArr(pModules, 'storage'),
|
||||
lFilePicker = Util.findObjByNameInArr(lStorage, 'FilePicker'),
|
||||
lKey = lFilePicker && lFilePicker.key;
|
||||
|
||||
filepicker.setKey(lKey);
|
||||
DOM.Images.hideLoad();
|
||||
console.timeEnd('filepicker loaded');
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
CloudCmd.FilePicker = new FilePicker();
|
||||
})(CloudCommander, Util, DOM);
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, Util, DOM, gapi;
|
||||
var CloudCmd, Util, DOM, gapi;
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
|
@ -40,7 +40,7 @@ var CloudCommander, Util, DOM, gapi;
|
|||
});
|
||||
});
|
||||
|
||||
}, 500);
|
||||
}, 1500);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -106,4 +106,4 @@ var CloudCommander, Util, DOM, gapi;
|
|||
};
|
||||
|
||||
CloudCmd.GDrive = GDrive;
|
||||
})(CloudCommander, Util, DOM);
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, Util, DOM, $, Github, cb;
|
||||
var CloudCmd, Util, DOM, $, Github, cb;
|
||||
/* module for work with github */
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
|
|
@ -115,7 +115,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
|
|||
|
||||
var lGist = GithubLocal.getGist(),
|
||||
lFiles = {},
|
||||
lHost = CloudCommander.HOST,
|
||||
lHost = CloudCmd.HOST,
|
||||
lOptions = {
|
||||
description: 'Uplouded by Cloud Commander from ' + lHost,
|
||||
public: true
|
||||
|
|
@ -156,4 +156,4 @@ var CloudCommander, Util, DOM, $, Github, cb;
|
|||
};
|
||||
|
||||
CloudCmd.GitHub = GitHubStore;
|
||||
})(CloudCommander, Util, DOM);
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//http://isdk.dev.live.com/ISDK.aspx?category=scenarioGroup_skyDrive&index=0
|
||||
var CloudCommander, Util, DOM, WL;
|
||||
var CloudCmd, Util, DOM, WL;
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
|
@ -75,4 +75,4 @@ var CloudCommander, Util, DOM, WL;
|
|||
|
||||
CloudCmd.SkyDrive = SkyDrive;
|
||||
|
||||
})(CloudCommander, Util, DOM);
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
|
|||
|
|
@ -1,97 +1,97 @@
|
|||
var CloudCommander, Util, DOM, VK;
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var VKStorage = {};
|
||||
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* load google api library
|
||||
*/
|
||||
function load(pCallBack){
|
||||
console.time('vk');
|
||||
|
||||
var lUrl = 'http://vkontakte.ru/js/api/openapi.js',
|
||||
lLocal = CloudCmd.LIBDIRCLIENT + 'storage/vk/open.js',
|
||||
|
||||
lOnload = function(){
|
||||
console.timeEnd('vk load');
|
||||
DOM.Images.hideLoad();
|
||||
|
||||
Util.exec(pCallBack);
|
||||
};
|
||||
|
||||
DOM.jsload(lUrl, {
|
||||
onload : lOnload,
|
||||
error : DOM.retJSLoad(lLocal, lOnload)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function auth(pCallBack){
|
||||
CloudCmd.getConfig(function(pConfig){
|
||||
var lDOCUMENTS_ACCESS = 131072;
|
||||
|
||||
VK.init({ apiId: pConfig.vk_id});
|
||||
|
||||
VK.Auth.login(function(){
|
||||
var lNAME = 1281;
|
||||
VK.Api.call('getVariable', {key: lNAME}, function(r) {
|
||||
var lName = r.response;
|
||||
|
||||
if(lName)
|
||||
Util.log ('Hello, ' + lName + ':)');
|
||||
});
|
||||
|
||||
Util.exec(pCallBack);
|
||||
|
||||
}, lDOCUMENTS_ACCESS); /* Доступ к документам пользователя */
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert new file.
|
||||
*
|
||||
* @param {File} fileData {name, data} File object to read data from.
|
||||
* @param {Function} callback Function to call when the request is complete.
|
||||
*/
|
||||
VKStorage.uploadFile = function(pParams, pCallBack) {
|
||||
/* http://vk.com/developers.php?oid=-1&p=docs.getUploadServer */
|
||||
VK.Api.call('docs.getUploadServer', {}, function(pResult){
|
||||
var lURL = pResult.response.upload_url,
|
||||
lData = pParams.data,
|
||||
lName = pParams.name;
|
||||
|
||||
DOM.ajax({
|
||||
type : "POST",
|
||||
url : lURL,
|
||||
data : {
|
||||
file: lData,
|
||||
name: lName
|
||||
},
|
||||
dataType: 'application/x-www-form-urlencoded',
|
||||
success : function(pData){
|
||||
Util.log(pData);
|
||||
VK.Api.call('docs.save', {}, Util.log);
|
||||
},
|
||||
|
||||
error : Util.log
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
VKStorage.init = function(pCallBack){
|
||||
Util.loadOnLoad([
|
||||
Util.retExec(pCallBack),
|
||||
auth,
|
||||
load
|
||||
]);
|
||||
};
|
||||
|
||||
CloudCmd.VK = VKStorage;
|
||||
})(CloudCommander, Util, DOM);
|
||||
var CloudCmd, Util, DOM, VK;
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var VKStorage = {};
|
||||
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* load google api library
|
||||
*/
|
||||
function load(pCallBack){
|
||||
console.time('vk');
|
||||
|
||||
var lUrl = 'http://vkontakte.ru/js/api/openapi.js',
|
||||
lLocal = CloudCmd.LIBDIRCLIENT + 'storage/vk/open.js',
|
||||
|
||||
lOnload = function(){
|
||||
console.timeEnd('vk load');
|
||||
DOM.Images.hideLoad();
|
||||
|
||||
Util.exec(pCallBack);
|
||||
};
|
||||
|
||||
DOM.jsload(lUrl, {
|
||||
onload : lOnload,
|
||||
error : DOM.retJSLoad(lLocal, lOnload)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function auth(pCallBack){
|
||||
CloudCmd.getConfig(function(pConfig){
|
||||
var lDOCUMENTS_ACCESS = 131072;
|
||||
|
||||
VK.init({ apiId: pConfig.vk_id});
|
||||
|
||||
VK.Auth.login(function(){
|
||||
var lNAME = 1281;
|
||||
VK.Api.call('getVariable', {key: lNAME}, function(r) {
|
||||
var lName = r.response;
|
||||
|
||||
if(lName)
|
||||
Util.log ('Hello, ' + lName + ':)');
|
||||
});
|
||||
|
||||
Util.exec(pCallBack);
|
||||
|
||||
}, lDOCUMENTS_ACCESS); /* Доступ к документам пользователя */
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert new file.
|
||||
*
|
||||
* @param {File} fileData {name, data} File object to read data from.
|
||||
* @param {Function} callback Function to call when the request is complete.
|
||||
*/
|
||||
VKStorage.uploadFile = function(pParams, pCallBack) {
|
||||
/* http://vk.com/developers.php?oid=-1&p=docs.getUploadServer */
|
||||
VK.Api.call('docs.getUploadServer', {}, function(pResult){
|
||||
var lURL = pResult.response.upload_url,
|
||||
lData = pParams.data,
|
||||
lName = pParams.name;
|
||||
|
||||
DOM.ajax({
|
||||
type : "POST",
|
||||
url : lURL,
|
||||
data : {
|
||||
file: lData,
|
||||
name: lName
|
||||
},
|
||||
dataType: 'application/x-www-form-urlencoded',
|
||||
success : function(pData){
|
||||
Util.log(pData);
|
||||
VK.Api.call('docs.save', {}, Util.log);
|
||||
},
|
||||
|
||||
error : Util.log
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
VKStorage.init = function(pCallBack){
|
||||
Util.loadOnLoad([
|
||||
Util.retExec(pCallBack),
|
||||
auth,
|
||||
load
|
||||
]);
|
||||
};
|
||||
|
||||
CloudCmd.VK = VKStorage;
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
var CloudCommander, Util, DOM, $;
|
||||
/* object contains terminal jqconsole */
|
||||
|
||||
(function(CloudCmd, Util, DOM){
|
||||
'use strict';
|
||||
|
||||
var KeyBinding = CloudCmd.KeyBinding,
|
||||
TerminalId,
|
||||
Term,
|
||||
Hidden = false,
|
||||
JqueryTerminal = {};
|
||||
|
||||
CloudCmd.Terminal = {};
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* function loads jquery-terminal
|
||||
*/
|
||||
function load(pCallBack){
|
||||
Util.time('terminal load');
|
||||
|
||||
var lDir = '/lib/client/terminal/jquery-terminal/jquery.',
|
||||
lFiles = [
|
||||
lDir + 'terminal.js',
|
||||
lDir + 'mousewheel.js',
|
||||
lDir + 'terminal.css'
|
||||
],
|
||||
lJqueryMigrate = '//code.jquery.com/jquery-migrate-1.0.0.js';
|
||||
/* //github.com/jquery/jquery-migrate/ */
|
||||
|
||||
DOM.anyLoadOnLoad([lFiles, lJqueryMigrate], function(){
|
||||
Util.timeEnd('terminal load');
|
||||
init();
|
||||
$(function($, undefined) {
|
||||
Term = JqueryTerminal.Term = $('#terminal').terminal(function(command, term){
|
||||
term.echo('');
|
||||
CloudCmd.Socket.send(command);
|
||||
}, {
|
||||
greetings : '[[;#729FCF;]Cloud Commander Terminal]',
|
||||
prompt : '[[;#729FCF;]cloudcmd> ]',
|
||||
color : '#729FCF;'
|
||||
});
|
||||
});
|
||||
/* removing resize function, no need for us */
|
||||
Term.resize = function(){};
|
||||
|
||||
$(window).unbind('resize');
|
||||
|
||||
Util.exec(pCallBack);
|
||||
}).cssSet({id:'terminalStyle',
|
||||
inner: '.cloudTerminal{' +
|
||||
'height: 720px;' +
|
||||
'};'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function do basic initialization
|
||||
*/
|
||||
function init(){
|
||||
if(!TerminalId)
|
||||
TerminalId = DOM.anyload({
|
||||
name : 'div',
|
||||
id : 'terminal',
|
||||
className : 'panel cloudTerminal',
|
||||
parent : DOM.getFM()
|
||||
});
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS */
|
||||
|
||||
/**
|
||||
* functin show jquery-terminal
|
||||
*/
|
||||
JqueryTerminal.show = function(){
|
||||
DOM.Images.hideLoad();
|
||||
/* only if panel was hided */
|
||||
if( DOM.hidePanel() ){
|
||||
Hidden = false;
|
||||
DOM.show(TerminalId);
|
||||
KeyBinding.unSet();
|
||||
Term.resume();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* function hide jquery-terminal
|
||||
*/
|
||||
JqueryTerminal.hide = function(){
|
||||
Hidden = true;
|
||||
|
||||
DOM.hide(TerminalId);
|
||||
DOM.showPanel();
|
||||
KeyBinding.set();
|
||||
|
||||
Term.pause();
|
||||
};
|
||||
|
||||
/**
|
||||
* function bind keys
|
||||
*/
|
||||
CloudCmd.Terminal.init = function(){
|
||||
/* loading js and css*/
|
||||
Util.loadOnLoad([
|
||||
JqueryTerminal.show,
|
||||
load,
|
||||
DOM.socketLoad,
|
||||
DOM.jqueryLoad,
|
||||
]);
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
var lKeyHandler = function(pEvent){
|
||||
var lRet = true,
|
||||
lKEY = CloudCmd.KEY,
|
||||
lKeyCode = pEvent.keyCode,
|
||||
lKeyBinded = KeyBinding.get();
|
||||
/* если клавиши можно обрабатывать */
|
||||
if(Hidden && lKeyBinded && lKeyCode === lKEY.TRA){
|
||||
JqueryTerminal.show();
|
||||
DOM.preventDefault(pEvent);
|
||||
lRet = false;
|
||||
}
|
||||
|
||||
else if(!Hidden && lKeyCode === lKEY.ESC)
|
||||
JqueryTerminal.hide();
|
||||
|
||||
return lRet;
|
||||
};
|
||||
|
||||
DOM.addKeyListener(lKeyHandler);
|
||||
};
|
||||
|
||||
CloudCmd.Terminal.JqueryTerminal = JqueryTerminal;
|
||||
|
||||
})(CloudCommander, Util, DOM);
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
0.4.20 Add exec, greetings, onClear, onBlur, onFocus, onTerminalChange
|
||||
0.4.19 add support for ANSI terminal formatting, fix cancelable ajax on
|
||||
CTRL+D, replace emails with link mailto, remove formatting processing
|
||||
from command line, add text glow option to formatting
|
||||
0.4.18 fix scrollbar, better exceptions in chrome, replace urls with links
|
||||
one style for font and color in root .terminal class
|
||||
0.4.17 fix IE formatting issue by adding cross-browser split
|
||||
0.4.16 add reverse history search on CTRL+R
|
||||
|
||||
fix cancel ajax call on CTRL+D
|
||||
0.4.15 only one command from multiply commands is added to history
|
||||
CTRL+D is handled even if exit is false
|
||||
0.4.14 terminal don't add space after prompt (prompt need to add this space)
|
||||
fix historyFilter
|
||||
remove livequery
|
||||
0.4.12 history return history object
|
||||
add historyFilter
|
||||
new event onCommandChange that execute scroll_to_bottom
|
||||
add event onBeforeLogin
|
||||
0.4.11 fix blank lines when echo longer strings
|
||||
0.4.10 fix long line formatting and linebreak in the middle of formatting
|
||||
0.4.9 fix wrap first line when prompt contain formatting
|
||||
0.4.8 fix alt+d and ctrl+u
|
||||
0.4.7 fix inserting special characters in Webkit on Windows
|
||||
0.4.6 remove undocumented pipe operator
|
||||
refreash prompt on resume
|
||||
0.4.5 fix line wrapping when text contains tabulations
|
||||
0.4.4 fix line wrapping with scrollbars
|
||||
0.4.3 fix JSON-RPC when use without login
|
||||
0.4.2 fix formatting when text contain empty lines
|
||||
0.4.1 fix formatting when text contains newline characters
|
||||
0.4 fix text formating when text splited into more then one line
|
||||
you can pass nested objects as first argument
|
||||
add tab completion with object passed as first argument
|
||||
0.3.8 fix cursor manipulation when command contain new line characters
|
||||
0.3.7 fix function terminal.login_name
|
||||
0.3.6 fix switch between terminals - when terminal is not visible scroll to current terminal
|
||||
0.3.5 fix scrolling in jQuery 1.6
|
||||
0.3.3 fixing PAGE UP/DOWN
|
||||
0.3.2 fixing cursor in long lines
|
||||
0.3.1 fixing small bugs, speed up resizing
|
||||
0.3 fix resizing on start and issue with greetings
|
||||
add formating strings to set style of text.
|
||||
add to echo a function which will be called when terminal
|
||||
is resized
|
||||
0.3-RC2 fix manipulation of long line commands
|
||||
0.3-RC1 add callbacks and new functions
|
||||
you can now overwrite keyboard shortcuts
|
||||
resizing recalculates lines lenght and redraw content
|
||||
if you create plugin for elements that are not in the DOM
|
||||
and then append it to DOM it's display corectly
|
||||
put all dependencies in one file
|
||||
Default greetings show terminal signature depending on
|
||||
width of terminal
|
||||
use Local Sorage for command line history if posible
|
||||
remove access to command line (cmd plugin) and add interface
|
||||
to allow interact with it
|
||||
|
||||
0.2.3.9 fix append enter character (0x0D) to the command (thanks to marat
|
||||
for reporting the bug)
|
||||
|
||||
0.2.3.8 update mousewheel plugin which fix scrolling in Opera (Thanks for
|
||||
Alexey Dubovtsev for reporting the bug)
|
||||
|
||||
0.2.3.7 fix cursor in IE in tilda example
|
||||
|
||||
0.2.3.6 fix json serialization in IE
|
||||
|
||||
0.2.3.5 fix demos and clipboard textarea transparency in IE
|
||||
|
||||
0.2.3.4 fix long lines in command line issue
|
||||
|
||||
0.2.3.3 fix Terminal in Internet Exporer
|
||||
|
||||
0.2.3.2 fix blank line issue (thanks to Chris Janicki for finding the
|
||||
bug) and fix CTRL + Arrows scroll on CTRL+V
|
||||
|
||||
0.2.3.1 allow CTRL+W CTRL+T
|
||||
|
||||
0.2.3 fix for "(#$%.{" characters on Opera/Chrome, add cursor move
|
||||
with CTRL+P, CTRL+N, CTRL+F, CTRL+B which also work in Chrome.
|
||||
Fix Arrow Keys on Chrome (for cursor move and command line
|
||||
history). Change License to LGPL3.
|
||||
|
||||
0.2.2 fix down-arrow/open parentises issue in Opera and Chrome
|
||||
|
||||
0.2.1 add support for paste from clipboard with CTRL+V (Copy to
|
||||
clipboard is alway enabled on websites)
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
__ _____ ________ __
|
||||
/ // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
|
||||
__ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
|
||||
/ / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
|
||||
\___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
|
||||
\/ /____/ version 0.4.22
|
||||
|
||||
|
||||
http://terminal.jcubic.pl
|
||||
|
||||
Licensed under GNU LGPL Version 3 license http://www.gnu.org/licenses/lgpl.html
|
||||
Copyright (c) 2011-2012 Jakub Jankiewicz <http://jcubic.pl>
|
||||
|
||||
JQuery Terminal Emulator is a plugin for creating command line interpreters in
|
||||
your applications. It can automatically call JSON-RPC service when user type
|
||||
commands or you can provide you own function in which you can parse user
|
||||
command. It's ideal if you want to provide additional functionality for power
|
||||
users. It can also be used to debug your aplication.
|
||||
|
||||
Features:
|
||||
|
||||
* You can create interpreter for your JSON-RPC service with one line
|
||||
of code.
|
||||
|
||||
* Support for authentication (you can provide function when user enter
|
||||
login and password or if you use JSON-RPC it can automatically call
|
||||
login function on the server and pass token to all functions)
|
||||
|
||||
* Stack of interpreters - you can create commands that trigger additional
|
||||
interpreters (eg. you can use couple of JSON-RPC service and run them
|
||||
when user type command)
|
||||
|
||||
* Command Tree - you can use nested objects. Each command will invoke a
|
||||
function, if the value is an object it will create new interpreter and
|
||||
use function from that object as commands. You can use as much nested
|
||||
object/commands as you like. If the value is a string it will create
|
||||
JSON-RPC service.
|
||||
|
||||
* Support for command line history it use Local Storage if posible
|
||||
|
||||
* Support for tab completion if you create terminal from an object
|
||||
|
||||
* Include keyboard shortcut from bash like CTRL+A, CTRL+D, CTRL+E etc.
|
||||
|
||||
* Multiply terminals on one page (every terminal can have different
|
||||
command, it's own authentication function and it's own command history)
|
||||
|
||||
* It catch all exceptions and display error messages in terminal
|
||||
(you can see errors in your javascript and php code in terminal if they
|
||||
are in interpreter function)
|
||||
|
||||
|
||||
Example of usage (javascript interpreter)
|
||||
|
||||
jQuery(function($, undefined) {
|
||||
$('#term_demo').terminal(function(command, term) {
|
||||
if (command !== '') {
|
||||
var result = window.eval(command);
|
||||
if (result != undefined) {
|
||||
term.echo(String(result));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
greetings: 'Javascript Interpreter',
|
||||
name: 'js_demo',
|
||||
height: 200,
|
||||
width: 450,
|
||||
prompt: 'js> '});
|
||||
});
|
||||
63
lib/client/terminal/jquery-terminal/dterm.js
vendored
|
|
@ -1,63 +0,0 @@
|
|||
/*!
|
||||
* Example plugin using JQuery Terminal Emulator
|
||||
* Copyright (C) 2010 Jakub Jankiewicz <http://jcubic.pl>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
$.extend_if_has = function(desc, source, array) {
|
||||
for (var i=array.length;i--;) {
|
||||
if (typeof source[array[i]] != 'undefined') {
|
||||
desc[array[i]] = source[array[i]];
|
||||
}
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
$.fn.dterm = function(eval, options) {
|
||||
var op = $.extend_if_has({}, options,
|
||||
['greetings', 'prompt', 'onInit',
|
||||
'onExit', 'clear',
|
||||
'login', 'name', 'exit']);
|
||||
op.enabled = false;
|
||||
var terminal = this.terminal(eval, op).css('overflow', 'hidden');
|
||||
if (!options.title) {
|
||||
options.title = 'JQuery Terminal Emulator';
|
||||
}
|
||||
if (options.logoutOnClose) {
|
||||
options.close = function(e, ui) {
|
||||
terminal.logout();
|
||||
terminal.clear();
|
||||
};
|
||||
} else {
|
||||
options.close = function(e, ui) {
|
||||
terminal.disable();
|
||||
};
|
||||
}
|
||||
var self = this;
|
||||
var dialog = this.dialog($.extend(options, {
|
||||
resizeStop: function(e, ui) {
|
||||
var content = self.find('.ui-dialog-content');
|
||||
terminal.resize(content.width(), content.height());
|
||||
},
|
||||
open: function(e, ui) {
|
||||
terminal.focus();
|
||||
terminal.resize();
|
||||
},
|
||||
show: 'fade',
|
||||
closeOnEscape: false
|
||||
}));
|
||||
self.terminal = terminal;
|
||||
return self;
|
||||
};
|
||||
})(jQuery);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<script src="/lib/client/jquery.js"></script>
|
||||
<script src="jquery.mousewheel.js"></script>
|
||||
<script src="http://terminal.jcubic.pl/js/jquery.terminal-0.4.17.js"></script>
|
||||
<link href="jquery.terminal.css" rel="stylesheet">
|
||||
|
||||
<div id='terminal'></div>
|
||||
<script>
|
||||
jQuery(function($, undefined) {
|
||||
$('#terminal').terminal(function(command, term) {
|
||||
term.echo('');
|
||||
}, {
|
||||
greetings: 'Javascript Interpreter',
|
||||
name: 'js_demo',
|
||||
height: 200,
|
||||
prompt: 'js>'});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.6
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var types = ['DOMMouseScroll', 'mousewheel'];
|
||||
|
||||
if ($.event.fixHooks) {
|
||||
for ( var i=types.length; i; ) {
|
||||
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
$.event.special.mousewheel = {
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.addEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.removeEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind("mousewheel", fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = "mousewheel";
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
|
||||
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
|
||||
|
||||
// New school multidimensional scroll (touchpads) deltas
|
||||
deltaY = delta;
|
||||
|
||||
// Gecko
|
||||
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaY = 0;
|
||||
deltaX = -1*delta;
|
||||
}
|
||||
|
||||
// Webkit
|
||||
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
|
||||
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
.terminal .clipboard {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
opacity: 0.01;
|
||||
filter: alpha(opacity = 0.01);
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.01);
|
||||
width: 2px;
|
||||
}
|
||||
.cmd > .clipboard {
|
||||
position: fixed;
|
||||
}
|
||||
.terminal {
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cmd {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 1.3em;
|
||||
}
|
||||
.terminal .terminal-output div div, .terminal .prompt {
|
||||
display: block;
|
||||
/* line-height: 9px; */
|
||||
height: 14px;
|
||||
}
|
||||
.terminal {
|
||||
font-family: FreeMono, monospace;
|
||||
color: #aaa;
|
||||
background-color: #000;
|
||||
/* font-size: 12px; */
|
||||
/* line-height: 14px; */
|
||||
line-height: 16px;
|
||||
/* removing breaking the lines */
|
||||
}
|
||||
.terminal .terminal-output div span {
|
||||
display: inline-block;
|
||||
}
|
||||
.terminal .cmd span {
|
||||
display: inline-block;
|
||||
}
|
||||
.terminal .cmd span.inverted {
|
||||
background-color: #aaa;
|
||||
color: #000;
|
||||
}
|
||||
.terminal .terminal-output div div::-moz-selection, .terminal .terminal-output div span::-moz-selection {
|
||||
background-color: #aaa;
|
||||
color: #000;
|
||||
}
|
||||
.terminal .terminal-output div div::selection, .terminal .terminal-output div span::selection,
|
||||
.terminal .cmd > span::selection, .terminal .prompt span::selection {
|
||||
background-color: #aaa;
|
||||
color: #000;
|
||||
}
|
||||
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
|
||||
color: red;
|
||||
}
|
||||
.tilda {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
}
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
.terminal a {
|
||||
color: #0F60FF;
|
||||
}
|
||||
.terminal a:hover {
|
||||
color: red;
|
||||
}
|
||||
154
lib/client/view.js
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
var CloudCmd, Util, DOM, CloudFunc, $;
|
||||
|
||||
(function(CloudCmd, Util, DOM, CloudFunc){
|
||||
'use strict';
|
||||
|
||||
CloudCmd.View = new ViewProto(CloudCmd, Util, DOM, CloudFunc);
|
||||
|
||||
function ViewProto(CloudCmd, Util, DOM, CloudFunc){
|
||||
var Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
View = this,
|
||||
Element,
|
||||
|
||||
Config = {
|
||||
beforeShow : function(){
|
||||
Images.hideLoad();
|
||||
Key.unsetBind();
|
||||
},
|
||||
afterShow : function(){
|
||||
Element.focus();
|
||||
},
|
||||
|
||||
beforeClose : Key.setBind,
|
||||
|
||||
openEffect : 'none',
|
||||
closeEffect : 'none',
|
||||
autoSize : false,
|
||||
height : window.innerHeight,
|
||||
width : window.innerWidth/0.75,
|
||||
|
||||
helpers : {
|
||||
overlay : {
|
||||
css : {
|
||||
'background' : 'rgba(255, 255, 255, 0.1)'
|
||||
}
|
||||
}
|
||||
},
|
||||
padding : 0
|
||||
};
|
||||
|
||||
this.init = function(pCallBack){
|
||||
var lFunc, lIsFunc, lIsCallBack;
|
||||
|
||||
if (pCallBack){
|
||||
lIsFunc = Util.isFunction(pCallBack);
|
||||
lIsCallBack = Util.isFunction(pCallBack.callback);
|
||||
}
|
||||
|
||||
if (lIsFunc)
|
||||
lFunc = pCallBack;
|
||||
else if (lIsCallBack)
|
||||
lFunc = pCallBack.callback;
|
||||
|
||||
Util.loadOnLoad([
|
||||
lFunc || Util.retExec(View.show, null),
|
||||
load,
|
||||
DOM.jqueryLoad
|
||||
]);
|
||||
|
||||
DOM.Events.addKey(listener);
|
||||
DOM.setButtonKey('f3', view);
|
||||
|
||||
delete View.init;
|
||||
};
|
||||
|
||||
/**
|
||||
* function shows FancyBox
|
||||
*/
|
||||
this.show = function(pData, pCallBack){
|
||||
var lPath, lElement,
|
||||
lAfterFunc, lFunc;
|
||||
|
||||
Element = $('<div id=view tabindex=0>');
|
||||
if (pData) {
|
||||
lElement = $(Element).append(pData);
|
||||
lAfterFunc = Config.afterShow,
|
||||
lFunc = function(){
|
||||
Util.exec(lAfterFunc);
|
||||
Util.exec(pCallBack);
|
||||
};
|
||||
|
||||
Config.afterShow = lFunc;
|
||||
|
||||
$.fancybox(lElement, Config);
|
||||
|
||||
} else {
|
||||
lPath = CloudFunc.FS + DOM.getCurrentPath();
|
||||
if( Util.checkExtension(lPath, ['png','jpg', 'gif','ico']) ) {
|
||||
$.fancybox.open({ href : lPath }, Config);
|
||||
}
|
||||
else
|
||||
DOM.getCurrentData(function(pParams){
|
||||
$.fancybox( Element.append(pParams.data), Config );
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.hide = function(){
|
||||
$.fancybox.close();
|
||||
};
|
||||
|
||||
/**
|
||||
* function loads css and js of FancyBox
|
||||
* @pParent - this
|
||||
* @pCallBack - executes, when everything loaded
|
||||
*/
|
||||
function load(pCallBack){
|
||||
Util.time('fancybox load');
|
||||
var lDir = CloudCmd.LIBDIRCLIENT + 'view/fancyBox/source/',
|
||||
lFiles = [ lDir + 'jquery.fancybox.css',
|
||||
lDir + 'jquery.fancybox.js' ];
|
||||
|
||||
DOM.anyLoadOnLoad([lFiles], function(){
|
||||
Util.timeEnd('fancybox load');
|
||||
Util.exec( pCallBack );
|
||||
Images.hideLoad();
|
||||
})
|
||||
.cssSet({id:'view-css',
|
||||
inner : '#view{' +
|
||||
'font-size: 16px;' +
|
||||
'white-space :pre;' +
|
||||
'outline: 0;' +
|
||||
'}' +
|
||||
'#view::selection{' +
|
||||
/*
|
||||
'background: #fe57a1;'
|
||||
'color: #fff;'
|
||||
*/
|
||||
'background: #b3d4fc;' +
|
||||
'text-shadow: none;' +
|
||||
'}'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function view(){
|
||||
Images.showLoad();
|
||||
View.show();
|
||||
}
|
||||
|
||||
function listener(pEvent){
|
||||
var lF3 = Key.F3,
|
||||
lIsBind = Key.isBind(),
|
||||
lKey = pEvent.keyCode;
|
||||
|
||||
/* если клавиши можно обрабатывать */
|
||||
if (lIsBind && lKey === lF3) {
|
||||
view();
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM, CloudFunc);
|
||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |