Merge branch 'release/v8.0.0.M25'
This commit is contained in:
commit
d8d32c60cb
3
.gitignore
vendored
3
.gitignore
vendored
@ -50,4 +50,5 @@ webgoat-lessons/vulnerable-components/dependency-reduced-pom.xml
|
||||
webgoat.lck
|
||||
webgoat.log
|
||||
webgoat.properties
|
||||
webgoat.script
|
||||
webgoat.script
|
||||
TestClass.class
|
||||
|
@ -27,7 +27,7 @@ you are caught engaging in unauthorized hacking, most companies will fire you.
|
||||
Claiming that you were doing security research will not work as that is the
|
||||
first thing that all hackers claim.*
|
||||
|
||||
# Run Instructions:
|
||||
# Installation Instructions:
|
||||
|
||||
## 1. Standalone
|
||||
|
||||
@ -152,3 +152,7 @@ docker tag webgoat/webgoat-8.0 webgoat/webgoat-8.0:8.0
|
||||
docker login
|
||||
docker push webgoat/webgoat-8.0
|
||||
```
|
||||
|
||||
# Run Instructions:
|
||||
|
||||
Once installed connect to http://localhost:8080/WebGoat and http://localhost:9090/WebWolf
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
<groupId>org.owasp.webgoat</groupId>
|
||||
<artifactId>webgoat-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>v8.0.0.M24</version>
|
||||
<version>v8.0.0.M25</version>
|
||||
|
||||
<name>WebGoat Parent Pom</name>
|
||||
<description>Parent Pom for the WebGoat Project. A deliberately insecure Web Application</description>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.owasp.webgoat</groupId>
|
||||
<artifactId>webgoat-parent</artifactId>
|
||||
<version>v8.0.0.M24</version>
|
||||
<version>v8.0.0.M25</version>
|
||||
</parent>
|
||||
|
||||
<profiles>
|
||||
|
@ -34,7 +34,6 @@ import com.google.common.collect.Sets;
|
||||
import org.owasp.webgoat.i18n.Language;
|
||||
import org.owasp.webgoat.i18n.Messages;
|
||||
import org.owasp.webgoat.i18n.PluginMessages;
|
||||
import org.owasp.webgoat.session.Course;
|
||||
import org.owasp.webgoat.session.LabelDebugger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@ -132,6 +131,7 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
PluginMessages pluginMessages = new PluginMessages(messages, language);
|
||||
pluginMessages.setDefaultEncoding("UTF-8");
|
||||
pluginMessages.setBasenames("i18n/WebGoatLabels");
|
||||
pluginMessages.setFallbackToSystemLocale(false);
|
||||
return pluginMessages;
|
||||
}
|
||||
|
||||
@ -145,6 +145,7 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
Messages messages = new Messages(language);
|
||||
messages.setDefaultEncoding("UTF-8");
|
||||
messages.setBasename("classpath:i18n/messages");
|
||||
messages.setFallbackToSystemLocale(false);
|
||||
return messages;
|
||||
}
|
||||
|
||||
@ -153,7 +154,7 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
SessionLocaleResolver slr = new SessionLocaleResolver();
|
||||
return slr;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public LabelDebugger labelDebugger() {
|
||||
return new LabelDebugger();
|
||||
|
@ -45,6 +45,7 @@ public class LessonMenuItem {
|
||||
private List<LessonMenuItem> children = new ArrayList<LessonMenuItem>();
|
||||
private boolean complete;
|
||||
private String link;
|
||||
private int ranking;
|
||||
// private boolean showSource = true;
|
||||
// private boolean showHints = true;
|
||||
|
||||
@ -156,6 +157,13 @@ public class LessonMenuItem {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public void setRanking(int ranking) {
|
||||
this.ranking = ranking;
|
||||
}
|
||||
|
||||
public int getRanking() {
|
||||
return this.ranking;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -86,11 +87,13 @@ public class LessonMenuService {
|
||||
LessonMenuItem lessonItem = new LessonMenuItem();
|
||||
lessonItem.setName(lesson.getTitle());
|
||||
lessonItem.setLink(lesson.getLink());
|
||||
lessonItem.setRanking(lesson.getRanking());
|
||||
lessonItem.setType(LessonMenuItemType.LESSON);
|
||||
LessonTracker lessonTracker = userTracker.getLessonTracker(lesson);
|
||||
lessonItem.setComplete(lessonTracker.isLessonSolved());
|
||||
categoryItem.addChild(lessonItem);
|
||||
}
|
||||
categoryItem.getChildren().sort((o1, o2) -> o1.getRanking() - o2.getRanking());
|
||||
menu.add(categoryItem);
|
||||
}
|
||||
return menu;
|
||||
|
@ -982,6 +982,64 @@ public class CreateDB {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the table used in SQL-Injections (introduction)
|
||||
*/
|
||||
private void createEmployeesTable(Connection connection) throws SQLException {
|
||||
Statement statement = connection.createStatement();
|
||||
|
||||
// Drop employees and access_log tables
|
||||
try {
|
||||
statement.executeUpdate("DROP TABLE employees");
|
||||
} catch (SQLException e) {
|
||||
System.out.println("Info - Could not drop employees table");
|
||||
}
|
||||
try {
|
||||
statement.executeUpdate("DROP TABLE access_log");
|
||||
} catch (SQLException e) {
|
||||
System.out.println("Info - Could not drop access_log table");
|
||||
}
|
||||
|
||||
// Create the employees table
|
||||
try {
|
||||
String createTableStatement = "CREATE TABLE employees ("
|
||||
+ "userid varchar(6) not null primary key,"
|
||||
+ "first_name varchar(20),"
|
||||
+ "last_name varchar(20),"
|
||||
+ "department varchar(20),"
|
||||
+ "salary int,"
|
||||
+ "auth_tan varchar(6)"
|
||||
+ ")";
|
||||
statement.executeUpdate(createTableStatement);
|
||||
} catch (SQLException e) {
|
||||
System.out.println("Error creating employees table " + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
// Populate
|
||||
String insertData1 = "INSERT INTO employees VALUES ('32147','Paulina', 'Travers', 'Accounting', 46000, 'P45JSI')";
|
||||
String insertData2 = "INSERT INTO employees VALUES ('89762','Tobi', 'Barnett', 'Development', 77000, 'TA9LL1')";
|
||||
String insertData3 = "INSERT INTO employees VALUES ('96134','Bob', 'Franco', 'Marketing', 83700, 'LO9S2V')";
|
||||
String insertData4 = "INSERT INTO employees VALUES ('34477','Abraham ', 'Holman', 'Development', 50000, 'UU2ALK')";
|
||||
String insertData5 = "INSERT INTO employees VALUES ('37648','John', 'Smith', 'Marketing', 64350, '3SL99A')";
|
||||
statement.executeUpdate(insertData1);
|
||||
statement.executeUpdate(insertData2);
|
||||
statement.executeUpdate(insertData3);
|
||||
statement.executeUpdate(insertData4);
|
||||
statement.executeUpdate(insertData5);
|
||||
|
||||
// Create the logging table
|
||||
try {
|
||||
String createTableStatement = "CREATE TABLE access_log ("
|
||||
+ "id int not null primary key identity,"
|
||||
+ "time varchar(50),"
|
||||
+ "action varchar(200)"
|
||||
+ ")";
|
||||
statement.executeUpdate(createTableStatement);
|
||||
} catch (SQLException e) {
|
||||
System.out.println("Error creating access_log table " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
@ -1009,6 +1067,7 @@ public class CreateDB {
|
||||
createMFEImagesTable(connection);
|
||||
createModifyWithSQLLessonTable(connection);
|
||||
createJWTKeys(connection);
|
||||
createEmployeesTable(connection);
|
||||
System.out.println("Success: creating tables.");
|
||||
}
|
||||
}
|
||||
|
67
webgoat-container/src/main/resources/static/css/quiz.css
Normal file
67
webgoat-container/src/main/resources/static/css/quiz.css
Normal file
@ -0,0 +1,67 @@
|
||||
.attack-container.quiz {
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#q_container p {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#q_container .quiz_question {
|
||||
border: solid 2px white;
|
||||
padding: 4px;
|
||||
margin: 5px 2px 20px 2px;
|
||||
box-shadow: 0px 1px 3px 1px #e4e4e4;
|
||||
}
|
||||
|
||||
#q_container .quiz_question label {
|
||||
font-weight: normal;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
#q_container .quiz_question input {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
border: 2px solid #dadada;
|
||||
background: white;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
#q_container .quiz_question input:checked {
|
||||
background: #51b7ff;
|
||||
}
|
||||
|
||||
#q_container .quiz_question input:hover,
|
||||
#q_container .quiz_question label:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#q_container .quiz_question.correct {
|
||||
border: solid 2px #ddf7dd;
|
||||
background: #ddf7dd;
|
||||
transition: all 300ms ease-in-out;
|
||||
}
|
||||
|
||||
#q_container .quiz_question.incorrect {
|
||||
border: solid 2px #f5d3d3;
|
||||
background: #f5d3d3;
|
||||
transition: all 300ms ease-in-out;
|
||||
}
|
||||
|
||||
input[name='Quiz_solutions'] {
|
||||
background: white;
|
||||
border: 1px solid gray;
|
||||
padding: 7px 10px;
|
||||
transition: 300ms all ease-in-out;
|
||||
}
|
||||
|
||||
input[name='Quiz_solutions']:hover {
|
||||
background: #51b7ff;
|
||||
color: white;
|
||||
border-color: white;
|
||||
transition: 300ms all ease-in-out;
|
||||
}
|
6
webgoat-container/src/main/resources/static/js/libs/ace/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
6
webgoat-container/src/main/resources/static/js/libs/ace/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
*Issue #, if available:*
|
||||
|
||||
*Description of changes:*
|
||||
|
||||
|
||||
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
|
@ -0,0 +1,4 @@
|
||||
## Code of Conduct
|
||||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
||||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
||||
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
@ -0,0 +1,61 @@
|
||||
# Contributing Guidelines
|
||||
|
||||
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
|
||||
documentation, we greatly value feedback and contributions from our community.
|
||||
|
||||
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
|
||||
information to effectively respond to your bug report or contribution.
|
||||
|
||||
|
||||
## Reporting Bugs/Feature Requests
|
||||
|
||||
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
|
||||
|
||||
When filing an issue, please check [existing open](https://github.com/ajaxorg/ace-builds/issues), or [recently closed](https://github.com/ajaxorg/ace-builds/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
|
||||
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
|
||||
|
||||
* A reproducible test case or series of steps
|
||||
* The version of our code being used
|
||||
* Any modifications you've made relevant to the bug
|
||||
* Anything unusual about your environment or deployment
|
||||
|
||||
|
||||
## Contributing via Pull Requests
|
||||
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
|
||||
|
||||
1. You are working against the latest source on the *master* branch.
|
||||
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
|
||||
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
|
||||
|
||||
To send us a pull request, please:
|
||||
|
||||
1. Fork the repository.
|
||||
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
|
||||
3. Ensure local tests pass.
|
||||
4. Commit to your fork using clear commit messages.
|
||||
5. Send us a pull request, answering any default questions in the pull request interface.
|
||||
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
|
||||
|
||||
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
|
||||
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
|
||||
|
||||
|
||||
## Finding contributions to work on
|
||||
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/ajaxorg/ace-builds/labels/help%20wanted) issues is a great place to start.
|
||||
|
||||
|
||||
## Code of Conduct
|
||||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
||||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
||||
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
||||
|
||||
|
||||
## Security issue notifications
|
||||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
|
||||
|
||||
|
||||
## Licensing
|
||||
|
||||
See the [LICENSE](https://github.com/ajaxorg/ace-builds/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
|
||||
|
||||
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
|
@ -0,0 +1,426 @@
|
||||
2018.08.07 Version 1.4.1
|
||||
* fix regression in autocomplete
|
||||
|
||||
2018.08.06 Version 1.4.0
|
||||
|
||||
* remove usage of innerHTML
|
||||
* improved handling of textinput for IME and mobile
|
||||
* add support for relative line numbers
|
||||
* improve autocompletion popup
|
||||
|
||||
2018.03.26 Version 1.3.3
|
||||
* fix regession in static-highlight extension
|
||||
* use css animation for cursor blinking
|
||||
|
||||
2018.03.21 Version 1.3.2
|
||||
* add experimental support for using ace-builds with webpack
|
||||
|
||||
2018.02.11 Version 1.3.1
|
||||
|
||||
* fixed regression with selectionChange event not firing some times
|
||||
* improved handling of non-ascii characters in vim normal mode
|
||||
|
||||
2018.01.31 Version 1.3.0
|
||||
|
||||
* added copy copyWithEmptySelection option
|
||||
* improved undoManager
|
||||
* improved settings_menu plugin
|
||||
* improved handling of files with very long lines
|
||||
* fixed bug with scrolling editor out of view in transformed elements
|
||||
|
||||
2017.10.17 Version 1.2.9
|
||||
|
||||
* added support for bidirectional text, with monospace font (Alex Shensis)
|
||||
* added support for emoji 😊
|
||||
|
||||
* new language modes
|
||||
- Red (Toomas Vooglaid)
|
||||
- CSound (Nathan Whetsell)
|
||||
- JSSM (John Haugeland)
|
||||
|
||||
* New Themes
|
||||
- Dracula (Austin Schwartz)
|
||||
|
||||
2017.07.02 Version 1.2.8
|
||||
* Fixed small bugs in searchbox and autocompleter
|
||||
|
||||
2017.06.18 Version 1.2.7
|
||||
|
||||
* Added Support for arrow keys on external IPad keyboard (Emanuele Tamponi)
|
||||
* added match counter to searchbox extension
|
||||
|
||||
- implemented higlighting of multiline strings in yaml mode (Maxim Trushin)
|
||||
- improved haml syntax highlighter (Andrés Álvarez)
|
||||
|
||||
2016.12.03 Version 1.2.6
|
||||
|
||||
* Fixed IME handling on new Chrome
|
||||
* Support for php 7 in the syntax checker
|
||||
|
||||
2016.08.16 Version 1.2.5
|
||||
|
||||
* Fixed regression in noconflict mode
|
||||
|
||||
2016.07.27 Version 1.2.4
|
||||
|
||||
* Maintenance release with several new modes and small bugfixes
|
||||
|
||||
2016.01.17 Version 1.2.3
|
||||
|
||||
* Bugfixes
|
||||
- fix memory leak in setSession (Tyler Stalder)
|
||||
- double click not working on linux/mac
|
||||
|
||||
* new language modes
|
||||
- reStructuredText (Robin Jarry)
|
||||
- NSIS (Jan T. Sott)
|
||||
|
||||
|
||||
2015.10.28 Version 1.2.1
|
||||
|
||||
* new language modes
|
||||
- Swift
|
||||
- JSX
|
||||
|
||||
2015.07.11 Version 1.2.0
|
||||
|
||||
* New Features
|
||||
- Indented soft wrap (danyaPostfactum)
|
||||
- Rounded borders on selections
|
||||
|
||||
* API Changes
|
||||
- unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745)
|
||||
- "change" event listeners on session and editor get delta objects directly
|
||||
|
||||
* new language modes
|
||||
- SQLServer (Morgan Yarbrough)
|
||||
|
||||
2015.04.03 Version 1.1.9
|
||||
|
||||
- Small Enhancements and Bugfixes
|
||||
|
||||
2014.11.08 Version 1.1.8
|
||||
|
||||
* API Changes
|
||||
- `editor.commands.commandKeyBinding` now contains direct map from keys to commands instead of grouping them by hashid
|
||||
|
||||
* New Features
|
||||
- Improved autoindent for html and php modes (Adam Jimenez)
|
||||
- Find All from searchbox (Colton Voege)
|
||||
|
||||
* new language modes
|
||||
- Elixir, Elm
|
||||
|
||||
2014.09.21 Version 1.1.7
|
||||
|
||||
* Bugfixes
|
||||
- fix several bugs in autocompletion
|
||||
- workaround for inaccurate getBoundingClientRect on chrome 37
|
||||
|
||||
2014.08.17 Version 1.1.6
|
||||
|
||||
* Bugfixes
|
||||
- fix regression in double tap to highlight
|
||||
- Improved Latex Mode (Daniel Felder)
|
||||
|
||||
* API Changes
|
||||
- editor.destroy destroys editor.session too (call editor.setSession(null) to prevent that)
|
||||
|
||||
* new language modes
|
||||
- Praat (José Joaquín Atria)
|
||||
- Eiffel (Victorien Elvinger)
|
||||
- G-code (Adam Joseph Cook)
|
||||
|
||||
2014.07.09 Version 1.1.5
|
||||
|
||||
* Bugfixes
|
||||
- fix regression in autocomplete popup
|
||||
|
||||
* new language modes
|
||||
- gitignore (Devon Carew)
|
||||
|
||||
2014.07.01 Version 1.1.4
|
||||
|
||||
* New Features
|
||||
- Highlight matching tags (Adam Jimenez)
|
||||
- Improved jump to matching command (Adam Jimenez)
|
||||
|
||||
* new language modes
|
||||
- AppleScript (Yaogang Lian)
|
||||
- Vala
|
||||
|
||||
2014.03.08 Version 1.1.3
|
||||
|
||||
* New Features
|
||||
- Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman)
|
||||
- Add ColdFusion behavior (Abram Adams)
|
||||
- add showLineNumbers option
|
||||
- Add html syntax checker (danyaPostfactum)
|
||||
|
||||
* new language modes
|
||||
- Gherkin (Patrick Nevels)
|
||||
- Smarty
|
||||
|
||||
2013.12.02 Version 1.1.2
|
||||
|
||||
* New Features
|
||||
- Accessibility Theme for Ace (Peter Xiao)
|
||||
- use snipetManager for expanding emmet snippets
|
||||
- update jshint to 2.1.4
|
||||
- improve php syntax checker (jdalegonzalez)
|
||||
- add option for autoresizing
|
||||
- add option for autohiding vertical scrollbar
|
||||
- improvements to highlighting of xml like languages (danyaPostfactum)
|
||||
- add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
|
||||
- add option to merge similar changes in undo history
|
||||
- add scrollPastEnd option
|
||||
- use html5 dragndrop for text dragging (danyaPostfactum)
|
||||
|
||||
* API Changes
|
||||
- fixed typo in HashHandler commmandManager
|
||||
|
||||
* new language modes
|
||||
- Nix (Zef Hemel)
|
||||
- Protobuf (Zef Hemel)
|
||||
- Soy
|
||||
- Handlebars
|
||||
|
||||
2013.06.04 Version 1.1.1
|
||||
|
||||
- Improved emacs keybindings (Robert Krahn)
|
||||
- Added markClean, isClean methods to UndoManager (Joonsoo Jeon)
|
||||
- Do not allow `Toggle comments` command to remove spaces from indentation
|
||||
- Softer colors for indent guides in dark themes
|
||||
|
||||
* new language modes
|
||||
- Ada
|
||||
- Assembly_x86
|
||||
- Cobol
|
||||
- D
|
||||
- ejs
|
||||
- MATLAB
|
||||
- MySQL
|
||||
- Twig
|
||||
- Verilog
|
||||
|
||||
2013.05.01, Version 1.1.0
|
||||
|
||||
* API Changes
|
||||
- Default position of the editor container is changed to relative. Add `.ace_editor {position: absolute}` css rule to restore old behavior
|
||||
- Changed default line-height to `normal` to not conflict with bootstrap. Use `line-height: inherit` for old behavior.
|
||||
- Changed marker types accepted by session.addMarker. It now accepts "text"|"line"|"fullLine"|"screenLine"
|
||||
- Internal classnames used by editor were made more consistent
|
||||
- Introduced `editor.setOption/getOption/setOptions/getOptions` methods
|
||||
- Introduced positionToIndex, indexToPosition methods
|
||||
|
||||
* New Features
|
||||
- Improved emacs mode (chetstone)
|
||||
with Incremental search and Occur modes (Robert Krahn)
|
||||
|
||||
- Improved ime handling
|
||||
- Searchbox (Vlad Zinculescu)
|
||||
|
||||
- Added elastic tabstops lite extension (Garen Torikian)
|
||||
- Added extension for whitespace manipulation
|
||||
- Added extension for enabling spellchecking from contextmenu
|
||||
- Added extension for displaying available keyboard shortcuts (Matthew Christopher Kastor-Inare III)
|
||||
- Added extension for displaying options panel (Matthew Christopher Kastor-Inare III)
|
||||
- Added modelist extension (Matthew Christopher Kastor-Inare III)
|
||||
|
||||
- Improved toggleCommentLines and added ToggleCommentBlock command
|
||||
- `:;` pairing in CSS mode (danyaPostfactum)
|
||||
|
||||
- Added suppoert for Delete and SelectAll from context menu (danyaPostfactum)
|
||||
|
||||
- Make wrapping behavior optional
|
||||
- Selective bracket insertion/skipping
|
||||
|
||||
- Added commands for increase/decrease numbers, sort lines (Vlad Zinculescu)
|
||||
- Folding for Markdown, Lua, LaTeX
|
||||
- Selective bracket insertion/skipping for C-like languages
|
||||
|
||||
* Many new languages
|
||||
- Scheme (Mu Lei)
|
||||
- Dot (edwardsp)
|
||||
- FreeMarker (nguillaumin)
|
||||
- Tiny Mushcode (h3rb)
|
||||
- Velocity (Ryan Griffith)
|
||||
- TOML (Garen Torikian)
|
||||
- LSL (Nemurimasu Neiro, Builders Brewery)
|
||||
- Curly (Libo Cannici)
|
||||
- vbScript (Jan Jongboom)
|
||||
- R (RStudio)
|
||||
- ABAP
|
||||
- Lucene (Graham Scott)
|
||||
- Haml (Garen Torikian)
|
||||
- Objective-C (Garen Torikian)
|
||||
- Makefile (Garen Torikian)
|
||||
- TypeScript (Garen Torikian)
|
||||
- Lisp (Garen Torikian)
|
||||
- Stylus (Garen Torikian)
|
||||
- Dart (Garen Torikian)
|
||||
|
||||
* Live syntax checks
|
||||
- PHP (danyaPostfactum)
|
||||
- Lua
|
||||
|
||||
* New Themes
|
||||
- Chaos
|
||||
- Terminal
|
||||
|
||||
2012.09.17, Version 1.0.0
|
||||
|
||||
* New Features
|
||||
- Multiple cursors and selections (https://c9.io/site/blog/2012/08/be-an-armenian-warrior-with-block-selection-on-steroids/)
|
||||
- Fold buttons displayed in the gutter
|
||||
- Indent Guides
|
||||
- Completely reworked vim mode (Sergi Mansilla)
|
||||
- Improved emacs keybindings
|
||||
- Autoclosing of html tags (danyaPostfactum)
|
||||
|
||||
* 20 New language modes
|
||||
- Coldfusion (Russ)
|
||||
- Diff
|
||||
- GLSL (Ed Mackey)
|
||||
- Go (Davide Saurino)
|
||||
- Haxe (Jason O'Neil)
|
||||
- Jade (Garen Torikian)
|
||||
- jsx (Syu Kato)
|
||||
- LaTeX (James Allen)
|
||||
- Less (John Roepke)
|
||||
- Liquid (Bernie Telles)
|
||||
- Lua (Lee Gao)
|
||||
- LuaPage (Choonster)
|
||||
- Markdown (Chris Spencer)
|
||||
- PostgreSQL (John DeSoi)
|
||||
- Powershell (John Kane)
|
||||
- Sh (Richo Healey)
|
||||
- SQL (Jonathan Camile)
|
||||
- Tcl (Cristoph Hochreiner)
|
||||
- XQuery (William Candillion)
|
||||
- Yaml (Meg Sharkey)
|
||||
|
||||
* Live syntax checks
|
||||
- for XQuery and JSON
|
||||
|
||||
* New Themes
|
||||
- Ambiance (Irakli Gozalishvili)
|
||||
- Dreamweaver (Adam Jimenez)
|
||||
- Github (bootstraponline)
|
||||
- Tommorrow themes (https://github.com/chriskempson/tomorrow-theme)
|
||||
- XCode
|
||||
|
||||
* Many Small Enhancements and Bugfixes
|
||||
|
||||
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
|
@ -0,0 +1,24 @@
|
||||
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.
|
@ -0,0 +1,23 @@
|
||||
Ace (Ajax.org Cloud9 Editor)
|
||||
============================
|
||||
[](https://cdnjs.com/libraries/ace)
|
||||
[](https://www.npmjs.com/package/ace-builds)
|
||||
|
||||
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) concatenated, minified with uglify.js, and uses ace.require instead of require
|
||||
|
||||
|
||||
For a simple way of embedding ace into webpage see [editor.html](https://github.com/ajaxorg/ace-builds/blob/master/editor.html) or list of other [simple examples](https://github.com/ajaxorg/ace-builds/tree/master/demo)
|
||||
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/demo/scrollable-page.html) or [minimal demo](http://ajaxorg.github.com/ace-builds/editor.html),
|
||||
|
||||
|
215
webgoat-container/src/main/resources/static/js/libs/ace/ace-modules.d.ts
vendored
Normal file
215
webgoat-container/src/main/resources/static/js/libs/ace/ace-modules.d.ts
vendored
Normal file
@ -0,0 +1,215 @@
|
||||
declare module 'ace-builds/src-noconflict/ext-beautify';
|
||||
declare module 'ace-builds/src-noconflict/ext-elastic_tabstops_lite';
|
||||
declare module 'ace-builds/src-noconflict/ext-emmet';
|
||||
declare module 'ace-builds/src-noconflict/ext-error_marker';
|
||||
declare module 'ace-builds/src-noconflict/ext-keybinding_menu';
|
||||
declare module 'ace-builds/src-noconflict/ext-language_tools';
|
||||
declare module 'ace-builds/src-noconflict/ext-linking';
|
||||
declare module 'ace-builds/src-noconflict/ext-modelist';
|
||||
declare module 'ace-builds/src-noconflict/ext-options';
|
||||
declare module 'ace-builds/src-noconflict/ext-rtl';
|
||||
declare module 'ace-builds/src-noconflict/ext-searchbox';
|
||||
declare module 'ace-builds/src-noconflict/ext-settings_menu';
|
||||
declare module 'ace-builds/src-noconflict/ext-spellcheck';
|
||||
declare module 'ace-builds/src-noconflict/ext-split';
|
||||
declare module 'ace-builds/src-noconflict/ext-static_highlight';
|
||||
declare module 'ace-builds/src-noconflict/ext-statusbar';
|
||||
declare module 'ace-builds/src-noconflict/ext-textarea';
|
||||
declare module 'ace-builds/src-noconflict/ext-themelist';
|
||||
declare module 'ace-builds/src-noconflict/ext-whitespace';
|
||||
declare module 'ace-builds/src-noconflict/keybinding-emacs';
|
||||
declare module 'ace-builds/src-noconflict/keybinding-vim';
|
||||
declare module 'ace-builds/src-noconflict/mode-abap';
|
||||
declare module 'ace-builds/src-noconflict/mode-abc';
|
||||
declare module 'ace-builds/src-noconflict/mode-actionscript';
|
||||
declare module 'ace-builds/src-noconflict/mode-ada';
|
||||
declare module 'ace-builds/src-noconflict/mode-apache_conf';
|
||||
declare module 'ace-builds/src-noconflict/mode-applescript';
|
||||
declare module 'ace-builds/src-noconflict/mode-asciidoc';
|
||||
declare module 'ace-builds/src-noconflict/mode-asl';
|
||||
declare module 'ace-builds/src-noconflict/mode-assembly_x86';
|
||||
declare module 'ace-builds/src-noconflict/mode-autohotkey';
|
||||
declare module 'ace-builds/src-noconflict/mode-batchfile';
|
||||
declare module 'ace-builds/src-noconflict/mode-bro';
|
||||
declare module 'ace-builds/src-noconflict/mode-c9search';
|
||||
declare module 'ace-builds/src-noconflict/mode-cirru';
|
||||
declare module 'ace-builds/src-noconflict/mode-clojure';
|
||||
declare module 'ace-builds/src-noconflict/mode-cobol';
|
||||
declare module 'ace-builds/src-noconflict/mode-coffee';
|
||||
declare module 'ace-builds/src-noconflict/mode-coldfusion';
|
||||
declare module 'ace-builds/src-noconflict/mode-csharp';
|
||||
declare module 'ace-builds/src-noconflict/mode-csound_document';
|
||||
declare module 'ace-builds/src-noconflict/mode-csound_orchestra';
|
||||
declare module 'ace-builds/src-noconflict/mode-csound_score';
|
||||
declare module 'ace-builds/src-noconflict/mode-csp';
|
||||
declare module 'ace-builds/src-noconflict/mode-css';
|
||||
declare module 'ace-builds/src-noconflict/mode-curly';
|
||||
declare module 'ace-builds/src-noconflict/mode-c_cpp';
|
||||
declare module 'ace-builds/src-noconflict/mode-d';
|
||||
declare module 'ace-builds/src-noconflict/mode-dart';
|
||||
declare module 'ace-builds/src-noconflict/mode-diff';
|
||||
declare module 'ace-builds/src-noconflict/mode-django';
|
||||
declare module 'ace-builds/src-noconflict/mode-dockerfile';
|
||||
declare module 'ace-builds/src-noconflict/mode-dot';
|
||||
declare module 'ace-builds/src-noconflict/mode-drools';
|
||||
declare module 'ace-builds/src-noconflict/mode-edifact';
|
||||
declare module 'ace-builds/src-noconflict/mode-eiffel';
|
||||
declare module 'ace-builds/src-noconflict/mode-ejs';
|
||||
declare module 'ace-builds/src-noconflict/mode-elixir';
|
||||
declare module 'ace-builds/src-noconflict/mode-elm';
|
||||
declare module 'ace-builds/src-noconflict/mode-erlang';
|
||||
declare module 'ace-builds/src-noconflict/mode-forth';
|
||||
declare module 'ace-builds/src-noconflict/mode-fortran';
|
||||
declare module 'ace-builds/src-noconflict/mode-fsharp';
|
||||
declare module 'ace-builds/src-noconflict/mode-ftl';
|
||||
declare module 'ace-builds/src-noconflict/mode-gcode';
|
||||
declare module 'ace-builds/src-noconflict/mode-gherkin';
|
||||
declare module 'ace-builds/src-noconflict/mode-gitignore';
|
||||
declare module 'ace-builds/src-noconflict/mode-glsl';
|
||||
declare module 'ace-builds/src-noconflict/mode-gobstones';
|
||||
declare module 'ace-builds/src-noconflict/mode-golang';
|
||||
declare module 'ace-builds/src-noconflict/mode-graphqlschema';
|
||||
declare module 'ace-builds/src-noconflict/mode-groovy';
|
||||
declare module 'ace-builds/src-noconflict/mode-haml';
|
||||
declare module 'ace-builds/src-noconflict/mode-handlebars';
|
||||
declare module 'ace-builds/src-noconflict/mode-haskell';
|
||||
declare module 'ace-builds/src-noconflict/mode-haskell_cabal';
|
||||
declare module 'ace-builds/src-noconflict/mode-haxe';
|
||||
declare module 'ace-builds/src-noconflict/mode-hjson';
|
||||
declare module 'ace-builds/src-noconflict/mode-html';
|
||||
declare module 'ace-builds/src-noconflict/mode-html_elixir';
|
||||
declare module 'ace-builds/src-noconflict/mode-html_ruby';
|
||||
declare module 'ace-builds/src-noconflict/mode-ini';
|
||||
declare module 'ace-builds/src-noconflict/mode-io';
|
||||
declare module 'ace-builds/src-noconflict/mode-jack';
|
||||
declare module 'ace-builds/src-noconflict/mode-jade';
|
||||
declare module 'ace-builds/src-noconflict/mode-java';
|
||||
declare module 'ace-builds/src-noconflict/mode-javascript';
|
||||
declare module 'ace-builds/src-noconflict/mode-json';
|
||||
declare module 'ace-builds/src-noconflict/mode-jsoniq';
|
||||
declare module 'ace-builds/src-noconflict/mode-jsp';
|
||||
declare module 'ace-builds/src-noconflict/mode-jssm';
|
||||
declare module 'ace-builds/src-noconflict/mode-jsx';
|
||||
declare module 'ace-builds/src-noconflict/mode-julia';
|
||||
declare module 'ace-builds/src-noconflict/mode-kotlin';
|
||||
declare module 'ace-builds/src-noconflict/mode-latex';
|
||||
declare module 'ace-builds/src-noconflict/mode-less';
|
||||
declare module 'ace-builds/src-noconflict/mode-liquid';
|
||||
declare module 'ace-builds/src-noconflict/mode-lisp';
|
||||
declare module 'ace-builds/src-noconflict/mode-livescript';
|
||||
declare module 'ace-builds/src-noconflict/mode-logiql';
|
||||
declare module 'ace-builds/src-noconflict/mode-lsl';
|
||||
declare module 'ace-builds/src-noconflict/mode-lua';
|
||||
declare module 'ace-builds/src-noconflict/mode-luapage';
|
||||
declare module 'ace-builds/src-noconflict/mode-lucene';
|
||||
declare module 'ace-builds/src-noconflict/mode-makefile';
|
||||
declare module 'ace-builds/src-noconflict/mode-markdown';
|
||||
declare module 'ace-builds/src-noconflict/mode-mask';
|
||||
declare module 'ace-builds/src-noconflict/mode-matlab';
|
||||
declare module 'ace-builds/src-noconflict/mode-maze';
|
||||
declare module 'ace-builds/src-noconflict/mode-mel';
|
||||
declare module 'ace-builds/src-noconflict/mode-mixal';
|
||||
declare module 'ace-builds/src-noconflict/mode-mushcode';
|
||||
declare module 'ace-builds/src-noconflict/mode-mysql';
|
||||
declare module 'ace-builds/src-noconflict/mode-nix';
|
||||
declare module 'ace-builds/src-noconflict/mode-nsis';
|
||||
declare module 'ace-builds/src-noconflict/mode-objectivec';
|
||||
declare module 'ace-builds/src-noconflict/mode-ocaml';
|
||||
declare module 'ace-builds/src-noconflict/mode-pascal';
|
||||
declare module 'ace-builds/src-noconflict/mode-perl';
|
||||
declare module 'ace-builds/src-noconflict/mode-pgsql';
|
||||
declare module 'ace-builds/src-noconflict/mode-php';
|
||||
declare module 'ace-builds/src-noconflict/mode-php_laravel_blade';
|
||||
declare module 'ace-builds/src-noconflict/mode-pig';
|
||||
declare module 'ace-builds/src-noconflict/mode-plain_text';
|
||||
declare module 'ace-builds/src-noconflict/mode-powershell';
|
||||
declare module 'ace-builds/src-noconflict/mode-praat';
|
||||
declare module 'ace-builds/src-noconflict/mode-prolog';
|
||||
declare module 'ace-builds/src-noconflict/mode-properties';
|
||||
declare module 'ace-builds/src-noconflict/mode-protobuf';
|
||||
declare module 'ace-builds/src-noconflict/mode-puppet';
|
||||
declare module 'ace-builds/src-noconflict/mode-python';
|
||||
declare module 'ace-builds/src-noconflict/mode-r';
|
||||
declare module 'ace-builds/src-noconflict/mode-razor';
|
||||
declare module 'ace-builds/src-noconflict/mode-rdoc';
|
||||
declare module 'ace-builds/src-noconflict/mode-red';
|
||||
declare module 'ace-builds/src-noconflict/mode-redshift';
|
||||
declare module 'ace-builds/src-noconflict/mode-rhtml';
|
||||
declare module 'ace-builds/src-noconflict/mode-rst';
|
||||
declare module 'ace-builds/src-noconflict/mode-ruby';
|
||||
declare module 'ace-builds/src-noconflict/mode-rust';
|
||||
declare module 'ace-builds/src-noconflict/mode-sass';
|
||||
declare module 'ace-builds/src-noconflict/mode-scad';
|
||||
declare module 'ace-builds/src-noconflict/mode-scala';
|
||||
declare module 'ace-builds/src-noconflict/mode-scheme';
|
||||
declare module 'ace-builds/src-noconflict/mode-scss';
|
||||
declare module 'ace-builds/src-noconflict/mode-sh';
|
||||
declare module 'ace-builds/src-noconflict/mode-sjs';
|
||||
declare module 'ace-builds/src-noconflict/mode-slim';
|
||||
declare module 'ace-builds/src-noconflict/mode-smarty';
|
||||
declare module 'ace-builds/src-noconflict/mode-snippets';
|
||||
declare module 'ace-builds/src-noconflict/mode-soy_template';
|
||||
declare module 'ace-builds/src-noconflict/mode-space';
|
||||
declare module 'ace-builds/src-noconflict/mode-sparql';
|
||||
declare module 'ace-builds/src-noconflict/mode-sql';
|
||||
declare module 'ace-builds/src-noconflict/mode-sqlserver';
|
||||
declare module 'ace-builds/src-noconflict/mode-stylus';
|
||||
declare module 'ace-builds/src-noconflict/mode-svg';
|
||||
declare module 'ace-builds/src-noconflict/mode-swift';
|
||||
declare module 'ace-builds/src-noconflict/mode-tcl';
|
||||
declare module 'ace-builds/src-noconflict/mode-terraform';
|
||||
declare module 'ace-builds/src-noconflict/mode-tex';
|
||||
declare module 'ace-builds/src-noconflict/mode-text';
|
||||
declare module 'ace-builds/src-noconflict/mode-textile';
|
||||
declare module 'ace-builds/src-noconflict/mode-toml';
|
||||
declare module 'ace-builds/src-noconflict/mode-tsx';
|
||||
declare module 'ace-builds/src-noconflict/mode-turtle';
|
||||
declare module 'ace-builds/src-noconflict/mode-twig';
|
||||
declare module 'ace-builds/src-noconflict/mode-typescript';
|
||||
declare module 'ace-builds/src-noconflict/mode-vala';
|
||||
declare module 'ace-builds/src-noconflict/mode-vbscript';
|
||||
declare module 'ace-builds/src-noconflict/mode-velocity';
|
||||
declare module 'ace-builds/src-noconflict/mode-verilog';
|
||||
declare module 'ace-builds/src-noconflict/mode-vhdl';
|
||||
declare module 'ace-builds/src-noconflict/mode-wollok';
|
||||
declare module 'ace-builds/src-noconflict/mode-xml';
|
||||
declare module 'ace-builds/src-noconflict/mode-xquery';
|
||||
declare module 'ace-builds/src-noconflict/mode-yaml';
|
||||
declare module 'ace-builds/src-noconflict/theme-ambiance';
|
||||
declare module 'ace-builds/src-noconflict/theme-chaos';
|
||||
declare module 'ace-builds/src-noconflict/theme-chrome';
|
||||
declare module 'ace-builds/src-noconflict/theme-clouds';
|
||||
declare module 'ace-builds/src-noconflict/theme-clouds_midnight';
|
||||
declare module 'ace-builds/src-noconflict/theme-cobalt';
|
||||
declare module 'ace-builds/src-noconflict/theme-crimson_editor';
|
||||
declare module 'ace-builds/src-noconflict/theme-dawn';
|
||||
declare module 'ace-builds/src-noconflict/theme-dracula';
|
||||
declare module 'ace-builds/src-noconflict/theme-dreamweaver';
|
||||
declare module 'ace-builds/src-noconflict/theme-eclipse';
|
||||
declare module 'ace-builds/src-noconflict/theme-github';
|
||||
declare module 'ace-builds/src-noconflict/theme-gob';
|
||||
declare module 'ace-builds/src-noconflict/theme-gruvbox';
|
||||
declare module 'ace-builds/src-noconflict/theme-idle_fingers';
|
||||
declare module 'ace-builds/src-noconflict/theme-iplastic';
|
||||
declare module 'ace-builds/src-noconflict/theme-katzenmilch';
|
||||
declare module 'ace-builds/src-noconflict/theme-kr_theme';
|
||||
declare module 'ace-builds/src-noconflict/theme-kuroir';
|
||||
declare module 'ace-builds/src-noconflict/theme-merbivore';
|
||||
declare module 'ace-builds/src-noconflict/theme-merbivore_soft';
|
||||
declare module 'ace-builds/src-noconflict/theme-monokai';
|
||||
declare module 'ace-builds/src-noconflict/theme-mono_industrial';
|
||||
declare module 'ace-builds/src-noconflict/theme-pastel_on_dark';
|
||||
declare module 'ace-builds/src-noconflict/theme-solarized_dark';
|
||||
declare module 'ace-builds/src-noconflict/theme-solarized_light';
|
||||
declare module 'ace-builds/src-noconflict/theme-sqlserver';
|
||||
declare module 'ace-builds/src-noconflict/theme-terminal';
|
||||
declare module 'ace-builds/src-noconflict/theme-textmate';
|
||||
declare module 'ace-builds/src-noconflict/theme-tomorrow';
|
||||
declare module 'ace-builds/src-noconflict/theme-tomorrow_night';
|
||||
declare module 'ace-builds/src-noconflict/theme-tomorrow_night_blue';
|
||||
declare module 'ace-builds/src-noconflict/theme-tomorrow_night_bright';
|
||||
declare module 'ace-builds/src-noconflict/theme-tomorrow_night_eighties';
|
||||
declare module 'ace-builds/src-noconflict/theme-twilight';
|
||||
declare module 'ace-builds/src-noconflict/theme-vibrant_ink';
|
||||
declare module 'ace-builds/src-noconflict/theme-xcode';
|
||||
declare module 'ace-builds/webpack-resolver';
|
798
webgoat-container/src/main/resources/static/js/libs/ace/ace.d.ts
vendored
Normal file
798
webgoat-container/src/main/resources/static/js/libs/ace/ace.d.ts
vendored
Normal file
@ -0,0 +1,798 @@
|
||||
/// <reference path="./ace-modules.d.ts" />
|
||||
export namespace Ace {
|
||||
export type NewLineMode = 'auto' | 'unix' | 'windows';
|
||||
|
||||
export interface Anchor extends EventEmitter {
|
||||
getPosition(): Position;
|
||||
getDocument(): Document;
|
||||
setPosition(row: number, column: number, noClip?: boolean): void;
|
||||
detach(): void;
|
||||
attach(doc: Document): void;
|
||||
}
|
||||
|
||||
export interface Document extends EventEmitter {
|
||||
setValue(text: string): void;
|
||||
getValue(): string;
|
||||
createAnchor(row: number, column: number): Anchor;
|
||||
getNewLineCharacter(): string;
|
||||
setNewLineMode(newLineMode: NewLineMode): void;
|
||||
getNewLineMode(): NewLineMode;
|
||||
isNewLine(text: string): boolean;
|
||||
getLine(row: number): string;
|
||||
getLines(firstRow: number, lastRow: number): string[];
|
||||
getAllLines(): string[];
|
||||
getTextRange(range: Range): string;
|
||||
getLinesForRange(range: Range): string[];
|
||||
insert(position: Position, text: string): Position;
|
||||
insertInLine(position: Position, text: string): Position;
|
||||
clippedPos(row: number, column: number): Point;
|
||||
clonePos(pos: Point): Point;
|
||||
pos(row: number, column: number): Point;
|
||||
insertFullLines(row: number, lines: string[]): void;
|
||||
insertMergedLines(position: Position, lines: string[]): Point;
|
||||
remove(range: Range): Position;
|
||||
removeInLine(row: number, startColumn: number, endColumn: number): Position;
|
||||
removeFullLines(firstRow: number, lastRow: number): string[];
|
||||
removeNewLine(row: number): void;
|
||||
replace(range: Range, text: string): Position;
|
||||
applyDeltas(deltas: Delta[]): void;
|
||||
revertDeltas(deltas: Delta[]): void;
|
||||
applyDelta(delta: Delta, doNotValidate?: boolean): void;
|
||||
revertDelta(delta: Delta): void;
|
||||
indexToPosition(index: number, startRow: number): Position;
|
||||
positionToIndex(pos: Position, startRow?: number): number;
|
||||
}
|
||||
|
||||
export interface FoldLine {
|
||||
folds: Fold[];
|
||||
range: Range;
|
||||
start: Point;
|
||||
end: Point;
|
||||
|
||||
shiftRow(shift: number): void;
|
||||
addFold(fold: Fold): void;
|
||||
containsRow(row: number): boolean;
|
||||
walk(callback: Function, endRow?: number, endColumn?: number): void;
|
||||
getNextFoldTo(row: number, column: number): null | { fold: Fold, kind: string };
|
||||
addRemoveChars(row: number, column: number, len: number): void;
|
||||
split(row: number, column: number): FoldLine;
|
||||
merge(foldLineNext: FoldLine): void;
|
||||
idxToPosition(idx: number): Point;
|
||||
}
|
||||
|
||||
export interface Fold {
|
||||
range: Range;
|
||||
start: Point;
|
||||
end: Point;
|
||||
foldLine?: FoldLine;
|
||||
sameRow: boolean;
|
||||
subFolds: Fold[];
|
||||
|
||||
setFoldLine(foldLine: FoldLine): void;
|
||||
clone(): Fold;
|
||||
addSubFold(fold: Fold): Fold;
|
||||
restoreRange(range: Range): void;
|
||||
}
|
||||
|
||||
export interface Range {
|
||||
start: Point;
|
||||
end: Point;
|
||||
|
||||
isEqual(range: Range): boolean;
|
||||
toString(): string;
|
||||
contains(row: number, column: number): boolean;
|
||||
compareRange(range: Range): number;
|
||||
comparePoint(p: Point): number;
|
||||
containsRange(range: Range): boolean;
|
||||
intersects(range: Range): boolean;
|
||||
isEnd(row: number, column: number): boolean;
|
||||
isStart(row: number, column: number): boolean;
|
||||
setStart(row: number, column: number): void;
|
||||
setEnd(row: number, column: number): void;
|
||||
inside(row: number, column: number): boolean;
|
||||
insideStart(row: number, column: number): boolean;
|
||||
insideEnd(row: number, column: number): boolean;
|
||||
compare(row: number, column: number): number;
|
||||
compareStart(row: number, column: number): number;
|
||||
compareEnd(row: number, column: number): number;
|
||||
compareInside(row: number, column: number): number;
|
||||
clipRows(firstRow: number, lastRow: number): Range;
|
||||
extend(row: number, column: number): Range;
|
||||
isEmpty(): boolean;
|
||||
isMultiLine(): boolean;
|
||||
clone(): Range;
|
||||
collapseRows(): Range;
|
||||
toScreenRange(session: EditSession): Range;
|
||||
moveBy(row: number, column: number): void;
|
||||
}
|
||||
|
||||
export interface EditSessionOptions {
|
||||
wrap: string | number;
|
||||
wrapMethod: 'code' | 'text' | 'auto';
|
||||
indentedSoftWrap: boolean;
|
||||
firstLineNumber: number;
|
||||
useWorker: boolean;
|
||||
useSoftTabs: boolean;
|
||||
tabSize: number;
|
||||
navigateWithinSoftTabs: boolean;
|
||||
foldStyle: 'markbegin' | 'markbeginend' | 'manual';
|
||||
overwrite: boolean;
|
||||
newLineMode: NewLineMode;
|
||||
mode: string;
|
||||
}
|
||||
|
||||
export interface VirtualRendererOptions {
|
||||
animatedScroll: boolean;
|
||||
showInvisibles: boolean;
|
||||
showPrintMargin: boolean;
|
||||
printMarginColumn: number;
|
||||
printMargin: boolean | number;
|
||||
showGutter: boolean;
|
||||
fadeFoldWidgets: boolean;
|
||||
showFoldWidgets: boolean;
|
||||
showLineNumbers: boolean;
|
||||
displayIndentGuides: boolean;
|
||||
highlightGutterLine: boolean;
|
||||
hScrollBarAlwaysVisible: boolean;
|
||||
vScrollBarAlwaysVisible: boolean;
|
||||
fontSize: number;
|
||||
fontFamily: string;
|
||||
maxLines: number;
|
||||
minLines: number;
|
||||
scrollPastEnd: boolean;
|
||||
fixedWidthGutter: boolean;
|
||||
theme: string;
|
||||
hasCssTransforms: boolean;
|
||||
maxPixelHeight: number;
|
||||
}
|
||||
|
||||
export interface MouseHandlerOptions {
|
||||
scrollSpeed: number;
|
||||
dragDelay: number;
|
||||
dragEnabled: boolean;
|
||||
focusTimeout: number;
|
||||
tooltipFollowsMouse: boolean;
|
||||
}
|
||||
|
||||
export interface EditorOptions extends EditSessionOptions,
|
||||
MouseHandlerOptions,
|
||||
VirtualRendererOptions {
|
||||
selectionStyle: string;
|
||||
highlightActiveLine: boolean;
|
||||
highlightSelectedWord: boolean;
|
||||
readOnly: boolean;
|
||||
copyWithEmptySelection: boolean;
|
||||
cursorStyle: 'ace' | 'slim' | 'smooth' | 'wide';
|
||||
mergeUndoDeltas: true | false | 'always';
|
||||
behavioursEnabled: boolean;
|
||||
wrapBehavioursEnabled: boolean;
|
||||
autoScrollEditorIntoView: boolean;
|
||||
keyboardHandler: string;
|
||||
value: string;
|
||||
session: EditSession;
|
||||
}
|
||||
|
||||
export interface SearchOptions {
|
||||
needle: string | RegExp;
|
||||
preventScroll: boolean;
|
||||
backwards: boolean;
|
||||
start: Range;
|
||||
skipCurrent: boolean;
|
||||
range: Range;
|
||||
preserveCase: boolean;
|
||||
regExp: RegExp;
|
||||
wholeWord: string;
|
||||
caseSensitive: boolean;
|
||||
wrap: boolean;
|
||||
}
|
||||
|
||||
export interface EventEmitter {
|
||||
once(name: string, callback: Function): void;
|
||||
setDefaultHandler(name: string, callback: Function): void;
|
||||
removeDefaultHandler(name: string, callback: Function): void;
|
||||
on(name: string, callback: Function, capturing?: boolean): void;
|
||||
addEventListener(name: string, callback: Function, capturing?: boolean): void;
|
||||
off(name: string, callback: Function): void;
|
||||
removeListener(name: string, callback: Function): void;
|
||||
removeEventListener(name: string, callback: Function): void;
|
||||
}
|
||||
|
||||
export interface Point {
|
||||
row: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface Delta {
|
||||
action: 'insert' | 'remove';
|
||||
start: Point;
|
||||
end: Point;
|
||||
lines: string[];
|
||||
}
|
||||
|
||||
export interface Annotation {
|
||||
row?: number;
|
||||
column?: number;
|
||||
text: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface Command {
|
||||
name?: string;
|
||||
bindKey?: string | { mac?: string, win?: string };
|
||||
readOnly?: boolean;
|
||||
exec: (editor: Editor, args?: any) => void;
|
||||
}
|
||||
|
||||
export type CommandLike = Command | ((editor: Editor) => void);
|
||||
|
||||
export interface KeyboardHandler {
|
||||
handleKeyboard: Function;
|
||||
}
|
||||
|
||||
export interface MarkerLike {
|
||||
range: Range;
|
||||
type: string;
|
||||
renderer?: MarkerRenderer;
|
||||
clazz: string;
|
||||
inFront: boolean;
|
||||
id: number;
|
||||
update?: (html: string[],
|
||||
// TODO maybe define Marker class
|
||||
marker: any,
|
||||
session: EditSession,
|
||||
config: any) => void;
|
||||
}
|
||||
|
||||
export type MarkerRenderer = (html: string[],
|
||||
range: Range,
|
||||
left: number,
|
||||
top: number,
|
||||
config: any) => void;
|
||||
|
||||
export interface Token {
|
||||
type: string;
|
||||
value: string;
|
||||
index?: number;
|
||||
start?: number;
|
||||
}
|
||||
|
||||
export interface Completion {
|
||||
value: string;
|
||||
score: number;
|
||||
meta?: string;
|
||||
name?: string;
|
||||
caption?: string;
|
||||
}
|
||||
|
||||
export interface Tokenizer {
|
||||
removeCapturingGroups(src: string): string;
|
||||
createSplitterRegexp(src: string, flag?: string): RegExp;
|
||||
getLineTokens(line: string, startState: string | string[]): Token[];
|
||||
}
|
||||
|
||||
export interface SyntaxMode {
|
||||
getTokenizer(): Tokenizer;
|
||||
toggleCommentLines(state: any,
|
||||
session: EditSession,
|
||||
startRow: number,
|
||||
endRow: number): void;
|
||||
toggleBlockComment(state: any,
|
||||
session: EditSession,
|
||||
range: Range,
|
||||
cursor: Position): void;
|
||||
getNextLineIndent(state: any, line: string, tab: string): string;
|
||||
checkOutdent(state: any, line: string, input: string): boolean;
|
||||
autoOutdent(state: any, doc: Document, row: number): void;
|
||||
// TODO implement WorkerClient types
|
||||
createWorker(session: EditSession): any;
|
||||
createModeDelegates(mapping: {[key: string]: string}): void;
|
||||
transformAction(state: string,
|
||||
action: string,
|
||||
editor: Editor,
|
||||
session: EditSession,
|
||||
text: string): any;
|
||||
getKeywords(append?: boolean): Array<string | RegExp>;
|
||||
getCompletions(state: string,
|
||||
session: EditSession,
|
||||
pos: Position,
|
||||
prefix: string): Completion[];
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
get(key: string): any;
|
||||
set(key: string, value: any): void;
|
||||
all(): {[key: string]: any};
|
||||
moduleUrl(name: string, component?: string): string;
|
||||
setModuleUrl(name: string, subst: string): string;
|
||||
loadModule(moduleName: string | [string, string],
|
||||
onLoad: (module: any) => void): void;
|
||||
init(packaged: any): any;
|
||||
defineOptions(obj: any, path: string, options: {[key: string]: any}): Config;
|
||||
resetOptions(obj: any): void;
|
||||
setDefaultValue(path: string, name: string, value: any): void;
|
||||
setDefaultValues(path: string, optionHash: {[key: string]: any}): void;
|
||||
}
|
||||
|
||||
export interface OptionsProvider {
|
||||
setOptions(optList: {[key: string]: any}): void;
|
||||
getOptions(optionNames?: string[] | {[key: string]: any}): {[key: string]: any};
|
||||
setOption(name: string, value: any): void;
|
||||
getOption(name: string): any;
|
||||
}
|
||||
|
||||
export interface UndoManager {
|
||||
addSession(session: EditSession): void;
|
||||
add(delta: Delta, allowMerge: boolean, session: EditSession): void;
|
||||
addSelection(selection: string, rev?: number): void;
|
||||
startNewGroup(): void;
|
||||
markIgnored(from: number, to?: number): void;
|
||||
getSelection(rev: number, after?: boolean): { value: string, rev: number };
|
||||
getRevision(): number;
|
||||
getDeltas(from: number, to?: number): Delta[];
|
||||
undo(session: EditSession, dontSelect?: boolean): void;
|
||||
redo(session: EditSession, dontSelect?: boolean): void;
|
||||
reset(): void;
|
||||
canUndo(): boolean;
|
||||
canRedo(): boolean;
|
||||
bookmark(rev?: number): void;
|
||||
isAtBookmark(): boolean;
|
||||
}
|
||||
|
||||
export interface EditSession extends EventEmitter, OptionsProvider {
|
||||
selection: Selection;
|
||||
|
||||
on(name: 'changeFold',
|
||||
callback: (obj: { data: Fold, action: string }) => void): void;
|
||||
on(name: 'changeScrollLeft', callback: (scrollLeft: number) => void): void;
|
||||
on(name: 'changeScrollTop', callback: (scrollTop: number) => void): void;
|
||||
on(name: 'tokenizerUpdate',
|
||||
callback: (obj: { data: { first: number, last: number } }) => void): void;
|
||||
|
||||
|
||||
setOption<T extends keyof EditSessionOptions>(name: T, value: EditSessionOptions[T]): void;
|
||||
getOption<T extends keyof EditSessionOptions>(name: T): EditSessionOptions[T];
|
||||
|
||||
setDocument(doc: Document): void;
|
||||
getDocument(): Document;
|
||||
resetCaches(): void;
|
||||
setValue(text: string): void;
|
||||
getValue(): string;
|
||||
getSelection(): Selection;
|
||||
getState(row: number): string;
|
||||
getTokens(row: number): Token[];
|
||||
getTokenAt(row: number, column: number): Token | null;
|
||||
setUndoManager(undoManager: UndoManager): void;
|
||||
markUndoGroup(): void;
|
||||
getUndoManager(): UndoManager;
|
||||
getTabString(): string;
|
||||
setUseSoftTabs(val: boolean): void;
|
||||
getUseSoftTabs(): boolean;
|
||||
setTabSize(tabSize: number): void;
|
||||
getTabSize(): number;
|
||||
isTabStop(position: Position): boolean;
|
||||
setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void;
|
||||
getNavigateWithinSoftTabs(): boolean;
|
||||
setOverwrite(overwrite: boolean): void;
|
||||
getOverwrite(): boolean;
|
||||
toggleOverwrite(): void;
|
||||
addGutterDecoration(row: number, className: string): void;
|
||||
removeGutterDecoration(row: number, className: string): void;
|
||||
getBreakpoints(): string[];
|
||||
setBreakpoints(rows: number[]): void;
|
||||
clearBreakpoints(): void;
|
||||
setBreakpoint(row: number, className: string): void;
|
||||
clearBreakpoint(row: number): void;
|
||||
addMarker(range: Range,
|
||||
clazz: string,
|
||||
type: MarkerRenderer,
|
||||
inFront: boolean): number;
|
||||
addDynamicMarker(marker: MarkerLike, inFront: boolean): MarkerLike;
|
||||
removeMarker(markerId: number): void;
|
||||
getMarkers(inFront?: boolean): MarkerLike[];
|
||||
highlight(re: RegExp): void;
|
||||
highlightLines(startRow: number,
|
||||
endRow: number,
|
||||
clazz: string,
|
||||
inFront?: boolean): Range;
|
||||
setAnnotations(annotations: Annotation[]): void;
|
||||
getAnnotations(): Annotation[];
|
||||
clearAnnotations(): void;
|
||||
getWordRange(row: number, column: number): Range;
|
||||
getAWordRange(row: number, column: number): Range;
|
||||
setNewLineMode(newLineMode: NewLineMode): void;
|
||||
getNewLineMode(): NewLineMode;
|
||||
setUseWorker(useWorker: boolean): void;
|
||||
getUseWorker(): boolean;
|
||||
setMode(mode: string | SyntaxMode, callback?: () => void): void;
|
||||
getMode(): SyntaxMode;
|
||||
setScrollTop(scrollTop: number): void;
|
||||
getScrollTop(): number;
|
||||
setScrollLeft(scrollLeft: number): void;
|
||||
getScrollLeft(): number;
|
||||
getScreenWidth(): number;
|
||||
getLineWidgetMaxWidth(): number;
|
||||
getLine(row: number): string;
|
||||
getLines(firstRow: number, lastRow: number): string[];
|
||||
getLength(): number;
|
||||
getTextRange(range: Range): string;
|
||||
insert(position: Position, text: string): void;
|
||||
remove(range: Range): void;
|
||||
removeFullLines(firstRow: number, lastRow: number): void;
|
||||
undoChanges(deltas: Delta[], dontSelect?: boolean): void;
|
||||
redoChanges(deltas: Delta[], dontSelect?: boolean): void;
|
||||
setUndoSelect(enable: boolean): void;
|
||||
replace(range: Range, text: string): void;
|
||||
moveText(fromRange: Range, toPosition: Position, copy?: boolean): void;
|
||||
indentRows(startRow: number, endRow: number, indentString: string): void;
|
||||
outdentRows(range: Range): void;
|
||||
moveLinesUp(firstRow: number, lastRow: number): void;
|
||||
moveLinesDown(firstRow: number, lastRow: number): void;
|
||||
duplicateLines(firstRow: number, lastRow: number): void;
|
||||
setUseWrapMode(useWrapMode: boolean): void;
|
||||
getUseWrapMode(): boolean;
|
||||
setWrapLimitRange(min: number, max: number): void;
|
||||
adjustWrapLimit(desiredLimit: number): boolean;
|
||||
getWrapLimit(): number;
|
||||
setWrapLimit(limit: number): void;
|
||||
getWrapLimitRange(): { min: number, max: number };
|
||||
getRowLineCount(row: number): number;
|
||||
getRowWrapIndent(screenRow: number): number;
|
||||
getScreenLastRowColumn(screenRow: number): number;
|
||||
getDocumentLastRowColumn(docRow: number, docColumn: number): number;
|
||||
getdocumentLastRowColumnPosition(docRow: number, docColumn: number): Position;
|
||||
getRowSplitData(row: number): string | undefined;
|
||||
getScreenTabSize(screenColumn: number): number;
|
||||
screenToDocumentRow(screenRow: number, screenColumn: number): number;
|
||||
screenToDocumentColumn(screenRow: number, screenColumn: number): number;
|
||||
screenToDocumentPosition(screenRow: number,
|
||||
screenColumn: number,
|
||||
offsetX?: number): Position;
|
||||
documentToScreenPosition(docRow: number, docColumn: number): Position;
|
||||
documentToScreenPosition(position: Position): Position;
|
||||
documentToScreenColumn(row: number, docColumn: number): number;
|
||||
documentToScreenRow(docRow: number, docColumn: number): number;
|
||||
getScreenLength(): number;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface KeyBinding {
|
||||
setDefaultHandler(handler: KeyboardHandler): void;
|
||||
setKeyboardHandler(handler: KeyboardHandler): void;
|
||||
addKeyboardHandler(handler: KeyboardHandler, pos: number): void;
|
||||
removeKeyboardHandler(handler: KeyboardHandler): boolean;
|
||||
getKeyboardHandler(): KeyboardHandler;
|
||||
getStatusText(): string;
|
||||
}
|
||||
|
||||
export interface CommandManager extends EventEmitter {
|
||||
on(name: 'exec', callback: (obj: {
|
||||
editor: Editor,
|
||||
command: Command,
|
||||
args: any[]
|
||||
}) => void): void;
|
||||
once(name: string, callback: Function): void;
|
||||
setDefaultHandler(name: string, callback: Function): void;
|
||||
removeDefaultHandler(name: string, callback: Function): void;
|
||||
on(name: string, callback: Function, capturing?: boolean): void;
|
||||
addEventListener(name: string, callback: Function, capturing?: boolean): void;
|
||||
off(name: string, callback: Function): void;
|
||||
removeListener(name: string, callback: Function): void;
|
||||
removeEventListener(name: string, callback: Function): void;
|
||||
|
||||
exec(command: string, editor: Editor, args: any): boolean;
|
||||
toggleRecording(editor: Editor): void;
|
||||
replay(editor: Editor): void;
|
||||
addCommand(command: Command): void;
|
||||
removeCommand(command: Command, keepCommand?: boolean): void;
|
||||
bindKey(key: string | { mac?: string, win?: string},
|
||||
command: CommandLike,
|
||||
position?: number): void;
|
||||
}
|
||||
|
||||
export interface VirtualRenderer extends OptionsProvider, EventEmitter {
|
||||
container: HTMLElement;
|
||||
|
||||
setOption<T extends keyof VirtualRendererOptions>(name: T, value: VirtualRendererOptions[T]): void;
|
||||
getOption<T extends keyof VirtualRendererOptions>(name: T): VirtualRendererOptions[T];
|
||||
|
||||
setSession(session: EditSession): void;
|
||||
updateLines(firstRow: number, lastRow: number, force?: boolean): void;
|
||||
updateText(): void;
|
||||
updateFull(force?: boolean): void;
|
||||
updateFontSize(): void;
|
||||
adjustWrapLimit(): boolean;
|
||||
setAnimatedScroll(shouldAnimate: boolean): void;
|
||||
getAnimatedScroll(): boolean;
|
||||
setShowInvisibles(showInvisibles: boolean): void;
|
||||
getShowInvisibles(): boolean;
|
||||
setDisplayIndentGuides(display: boolean): void;
|
||||
getDisplayIndentGuides(): boolean;
|
||||
setShowPrintMargin(showPrintMargin: boolean): void;
|
||||
getShowPrintMargin(): boolean;
|
||||
setPrintMarginColumn(showPrintMargin: boolean): void;
|
||||
getPrintMarginColumn(): boolean;
|
||||
setShowGutter(show: boolean): void;
|
||||
getShowGutter(): boolean;
|
||||
setFadeFoldWidgets(show: boolean): void;
|
||||
getFadeFoldWidgets(): boolean;
|
||||
setHighlightGutterLine(shouldHighlight: boolean): void;
|
||||
getHighlightGutterLine(): boolean;
|
||||
getContainerElement(): HTMLElement;
|
||||
getMouseEventTarget(): HTMLElement;
|
||||
getTextAreaContainer(): HTMLElement;
|
||||
getFirstVisibleRow(): number;
|
||||
getFirstFullyVisibleRow(): number;
|
||||
getLastFullyVisibleRow(): number;
|
||||
getLastVisibleRow(): number;
|
||||
setPadding(padding: number): void;
|
||||
setScrollMargin(top: number,
|
||||
bottom: number,
|
||||
left: number,
|
||||
right: number): void;
|
||||
setHScrollBarAlwaysVisible(alwaysVisible: boolean): void;
|
||||
getHScrollBarAlwaysVisible(): boolean;
|
||||
setVScrollBarAlwaysVisible(alwaysVisible: boolean): void;
|
||||
getVScrollBarAlwaysVisible(): boolean;
|
||||
freeze(): void;
|
||||
unfreeze(): void;
|
||||
updateFrontMarkers(): void;
|
||||
updateBackMarkers(): void;
|
||||
updateBreakpoints(): void;
|
||||
setAnnotations(annotations: Annotation[]): void;
|
||||
updateCursor(): void;
|
||||
hideCursor(): void;
|
||||
showCursor(): void;
|
||||
scrollSelectionIntoView(anchor: Position,
|
||||
lead: Position,
|
||||
offset?: number): void;
|
||||
scrollCursorIntoView(cursor: Position, offset?: number): void;
|
||||
getScrollTop(): number;
|
||||
getScrollLeft(): number;
|
||||
getScrollTopRow(): number;
|
||||
getScrollBottomRow(): number;
|
||||
scrollToRow(row: number): void;
|
||||
alignCursor(cursor: Position | number, alignment: number): number;
|
||||
scrollToLine(line: number,
|
||||
center: boolean,
|
||||
animate: boolean,
|
||||
callback: () => void): void;
|
||||
animateScrolling(fromValue: number, callback: () => void): void;
|
||||
scrollToY(scrollTop: number): void;
|
||||
scrollToX(scrollLeft: number): void;
|
||||
scrollTo(x: number, y: number): void;
|
||||
scrollBy(deltaX: number, deltaY: number): void;
|
||||
isScrollableBy(deltaX: number, deltaY: number): boolean;
|
||||
textToScreenCoordinates(row: number, column: number): { pageX: number, pageY: number};
|
||||
visualizeFocus(): void;
|
||||
visualizeBlur(): void;
|
||||
showComposition(position: number): void;
|
||||
setCompositionText(text: string): void;
|
||||
hideComposition(): void;
|
||||
setTheme(theme: string, callback?: () => void): void;
|
||||
getTheme(): string;
|
||||
setStyle(style: string, include?: boolean): void;
|
||||
unsetStyle(style: string): void;
|
||||
setCursorStyle(style: string): void;
|
||||
setMouseCursor(cursorStyle: string): void;
|
||||
attachToShadowRoot(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
|
||||
export interface Selection extends EventEmitter {
|
||||
moveCursorWordLeft(): void;
|
||||
moveCursorWordRight(): void;
|
||||
fromOrientedRange(range: Range): void;
|
||||
setSelectionRange(match: any): void;
|
||||
getAllRanges(): Range[];
|
||||
addRange(range: Range): void;
|
||||
isEmpty(): boolean;
|
||||
isMultiLine(): boolean;
|
||||
setCursor(row: number, column: number): void;
|
||||
setAnchor(row: number, column: number): void;
|
||||
getAnchor(): Position;
|
||||
getCursor(): Position;
|
||||
isBackwards(): boolean;
|
||||
getRange(): Range;
|
||||
clearSelection(): void;
|
||||
selectAll(): void;
|
||||
setRange(range: Range, reverse?: boolean): void;
|
||||
selectTo(row: number, column: number): void;
|
||||
selectToPosition(pos: any): void;
|
||||
selectUp(): void;
|
||||
selectDown(): void;
|
||||
selectRight(): void;
|
||||
selectLeft(): void;
|
||||
selectLineStart(): void;
|
||||
selectLineEnd(): void;
|
||||
selectFileEnd(): void;
|
||||
selectFileStart(): void;
|
||||
selectWordRight(): void;
|
||||
selectWordLeft(): void;
|
||||
getWordRange(): void;
|
||||
selectWord(): void;
|
||||
selectAWord(): void;
|
||||
selectLine(): void;
|
||||
moveCursorUp(): void;
|
||||
moveCursorDown(): void;
|
||||
moveCursorLeft(): void;
|
||||
moveCursorRight(): void;
|
||||
moveCursorLineStart(): void;
|
||||
moveCursorLineEnd(): void;
|
||||
moveCursorFileEnd(): void;
|
||||
moveCursorFileStart(): void;
|
||||
moveCursorLongWordRight(): void;
|
||||
moveCursorLongWordLeft(): void;
|
||||
moveCursorBy(rows: number, chars: number): void;
|
||||
moveCursorToPosition(position: any): void;
|
||||
moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void;
|
||||
moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void;
|
||||
}
|
||||
var Selection: {
|
||||
new(session: EditSession): Selection;
|
||||
}
|
||||
|
||||
export interface Editor extends OptionsProvider, EventEmitter {
|
||||
container: HTMLElement;
|
||||
renderer: VirtualRenderer;
|
||||
id: string;
|
||||
commands: CommandManager;
|
||||
keyBinding: KeyBinding;
|
||||
session: EditSession;
|
||||
selection: Selection;
|
||||
|
||||
on(name: 'blur', callback: (e: Event) => void): void;
|
||||
on(name: 'change', callback: (delta: Delta) => void): void;
|
||||
on(name: 'changeSelectionStyle', callback: (obj: { data: string }) => void): void;
|
||||
on(name: 'changeSession',
|
||||
callback: (obj: { session: EditSession, oldSession: EditSession }) => void): void;
|
||||
on(name: 'copy', callback: (obj: { text: string }) => void): void;
|
||||
on(name: 'focus', callback: (e: Event) => void): void;
|
||||
on(name: 'paste', callback: (obj: { text: string }) => void): void;
|
||||
|
||||
setOption<T extends keyof EditorOptions>(name: T, value: EditorOptions[T]): void;
|
||||
getOption<T extends keyof EditorOptions>(name: T): EditorOptions[T];
|
||||
|
||||
setKeyboardHandler(keyboardHandler: string, callback?: () => void): void;
|
||||
getKeyboardHandler(): string;
|
||||
setSession(session: EditSession): void;
|
||||
getSession(): EditSession;
|
||||
setValue(val: string, cursorPos?: number): string;
|
||||
getValue(): string;
|
||||
getSelection(): Selection;
|
||||
resize(force?: boolean): void;
|
||||
setTheme(theme: string, callback?: () => void): void;
|
||||
getTheme(): string;
|
||||
setStyle(style: string): void;
|
||||
unsetStyle(style: string): void;
|
||||
getFontSize(): string;
|
||||
setFontSize(size: string): void;
|
||||
focus(): void;
|
||||
isFocused(): boolean;
|
||||
flur(): void;
|
||||
getSelectedText(): string;
|
||||
getCopyText(): string;
|
||||
execCommand(command: string | string[], args: any): boolean;
|
||||
insert(text: string, pasted?: boolean): void;
|
||||
setOverwrite(overwrite: boolean): void;
|
||||
getOverwrite(): boolean;
|
||||
toggleOverwrite(): void;
|
||||
setScrollSpeed(speed: number): void;
|
||||
getScrollSpeed(): number;
|
||||
setDragDelay(dragDelay: number): void;
|
||||
getDragDelay(): number;
|
||||
setSelectionStyle(val: string): void;
|
||||
getSelectionStyle(): string;
|
||||
setHighlightActiveLine(shouldHighlight: boolean): void;
|
||||
getHighlightActiveLine(): boolean;
|
||||
setHighlightGutterLine(shouldHighlight: boolean): void;
|
||||
getHighlightGutterLine(): boolean;
|
||||
setHighlightSelectedWord(shouldHighlight: boolean): void;
|
||||
getHighlightSelectedWord(): boolean;
|
||||
setAnimatedScroll(shouldAnimate: boolean): void;
|
||||
getAnimatedScroll(): boolean;
|
||||
setShowInvisibles(showInvisibles: boolean): void;
|
||||
getShowInvisibles(): boolean;
|
||||
setDisplayIndentGuides(display: boolean): void;
|
||||
getDisplayIndentGuides(): boolean;
|
||||
setShowPrintMargin(showPrintMargin: boolean): void;
|
||||
getShowPrintMargin(): boolean;
|
||||
setPrintMarginColumn(showPrintMargin: number): void;
|
||||
getPrintMarginColumn(): number;
|
||||
setReadOnly(readOnly: boolean): void;
|
||||
getReadOnly(): boolean;
|
||||
setBehavioursEnabled(enabled: boolean): void;
|
||||
getBehavioursEnabled(): boolean;
|
||||
setWrapBehavioursEnabled(enabled: boolean): void;
|
||||
getWrapBehavioursEnabled(): boolean;
|
||||
setShowFoldWidgets(show: boolean): void;
|
||||
getShowFoldWidgets(): boolean;
|
||||
setFadeFoldWidgets(fade: boolean): void;
|
||||
getFadeFoldWidgets(): boolean;
|
||||
remove(dir?: 'left' | 'right'): void;
|
||||
removeWordRight(): void;
|
||||
removeWordLeft(): void;
|
||||
removeLineToEnd(): void;
|
||||
splitLine(): void;
|
||||
transposeLetters(): void;
|
||||
toLowerCase(): void;
|
||||
toUpperCase(): void;
|
||||
indent(): void;
|
||||
blockIndent(): void;
|
||||
blockOutdent(): void;
|
||||
sortLines(): void;
|
||||
toggleCommentLines(): void;
|
||||
toggleBlockComment(): void;
|
||||
modifyNumber(amount: number): void;
|
||||
removeLines(): void;
|
||||
duplicateSelection(): void;
|
||||
moveLinesDown(): void;
|
||||
moveLinesUp(): void;
|
||||
moveText(range: Range, toPosition: Point, copy?: boolean): Range;
|
||||
copyLinesUp(): void;
|
||||
copyLinesDown(): void;
|
||||
getFirstVisibleRow(): number;
|
||||
getLastVisibleRow(): number;
|
||||
isRowVisible(row: number): boolean;
|
||||
isRowFullyVisible(row: number): boolean;
|
||||
selectPageDown(): void;
|
||||
selectPageUp(): void;
|
||||
gotoPageDown(): void;
|
||||
gotoPageUp(): void;
|
||||
scrollPageDown(): void;
|
||||
scrollPageUp(): void;
|
||||
scrollToRow(row: number): void;
|
||||
scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void;
|
||||
centerSelection(): void;
|
||||
getCursorPosition(): Point;
|
||||
getCursorPositionScreen(): Point;
|
||||
getSelectionRange(): Range;
|
||||
selectAll(): void;
|
||||
clearSelection(): void;
|
||||
moveCursorTo(row: number, column: number): void;
|
||||
moveCursorToPosition(pos: Point): void;
|
||||
jumpToMatching(select: boolean, expand: boolean): void;
|
||||
gotoLine(lineNumber: number, column: number, animate: boolean): void;
|
||||
navigateTo(row: number, column: number): void;
|
||||
navigateUp(): void;
|
||||
navigateDown(): void;
|
||||
navigateLeft(): void;
|
||||
navigateRight(): void;
|
||||
navigateLineStart(): void;
|
||||
navigateLineEnd(): void;
|
||||
navigateFileEnd(): void;
|
||||
navigateFileStart(): void;
|
||||
navigateWordRight(): void;
|
||||
navigateWordLeft(): void;
|
||||
replace(replacement: string, options?: Partial<SearchOptions>): number;
|
||||
replaceAll(replacement: string, options?: Partial<SearchOptions>): number;
|
||||
getLastSearchOptions(): Partial<SearchOptions>;
|
||||
find(needle: string, options?: Partial<SearchOptions>, animate?: boolean): void;
|
||||
findNext(options?: Partial<SearchOptions>, animate?: boolean): void;
|
||||
findPrevious(options?: Partial<SearchOptions>, animate?: boolean): void;
|
||||
undo(): void;
|
||||
redo(): void;
|
||||
destroy(): void;
|
||||
setAutoScrollEditorIntoView(enable: boolean): void;
|
||||
}
|
||||
}
|
||||
|
||||
export const version: string;
|
||||
export const config: Ace.Config;
|
||||
export function require(name: string): any;
|
||||
export function edit(el: Element | string, options?: Partial<Ace.EditorOptions>): Ace.Editor;
|
||||
export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession;
|
||||
export const VirtualRenderer: {
|
||||
new(container: HTMLElement, theme?: string): Ace.VirtualRenderer;
|
||||
};
|
||||
export const EditSession: {
|
||||
new(text: string | Document, mode?: Ace.SyntaxMode): Ace.EditSession;
|
||||
};
|
||||
export const UndoManager: {
|
||||
new(): Ace.UndoManager;
|
||||
};
|
||||
export const Range: {
|
||||
new(startRow: number, startColumn: number, endRow: number, endColumn: number): Ace.Range;
|
||||
fromPoints(start: Ace.Point, end: Ace.Point): Ace.Range;
|
||||
comparePoints(p1: Ace.Point, p2: Ace.Point): number;
|
||||
};
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "ace-builds",
|
||||
"description": "Ace (Ajax.org Cloud9 Editor)",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"ignore": [
|
||||
"demo"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ajaxorg/ace-builds.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "BSD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ajaxorg/ace-builds/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ajaxorg/ace-builds"
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Editor</title>
|
||||
<style type="text/css" media="screen">
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#editor {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<pre id="editor">function foo(items) {
|
||||
var i;
|
||||
for (i = 0; i < items.length; i++) {
|
||||
alert("Ace Rocks " + items[i]);
|
||||
}
|
||||
}</pre>
|
||||
|
||||
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Ace Kitchen Sink</title>
|
||||
<meta name="author" content="Fabian Jakobs">
|
||||
<!--
|
||||
Ace
|
||||
version 1.4.1
|
||||
commit
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
|
||||
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
|
||||
|
||||
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
<div style="position:absolute;height:100%;width:260px">
|
||||
<a href="https://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
|
||||
<img id="c9-logo" src="demo/kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
|
||||
</a>
|
||||
<div style="position: absolute; overflow: hidden; top:100px; bottom:0">
|
||||
<div id="optionsPanel" style="width: 120%; height:100%; overflow-y: scroll">
|
||||
|
||||
|
||||
<a href="https://ace.c9.io">
|
||||
<img id="ace-logo" src="demo/kitchen-sink/ace-logo.png" style="width: 134px;margin: 46px 0px 4px 66px;">
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editor-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="src/keybinding-vim.js"></script>
|
||||
<script src="src/keybinding-emacs.js"></script>
|
||||
<script src="demo/kitchen-sink/demo.js"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
require("kitchen-sink/demo");
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "ace-builds",
|
||||
"main": "./src-noconflict/ace.js",
|
||||
"typings": "ace.d.ts",
|
||||
"version": "1.4.1",
|
||||
"description": "Ace (Ajax.org Cloud9 Editor)",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ajaxorg/ace-builds.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "BSD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ajaxorg/ace-builds/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ajaxorg/ace-builds"
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=!1,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P={},H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.trim())},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="</"&&(_&&!l&&N<1&&N++,M&&(N=1),w=1,_=!1)):i(s,"tag-close")?O=!1:i(s,"comment.start")?_=!0:i(s,"comment.end")&&(_=!1),!O&&!N&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&N++,T!==x&&(N=T,x&&(N-=x));if(N){j();for(;N>0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),h=!0,l=!1):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m<g&&(b=D[m]);g=m,y=b,w&&(b-=w),A&&!E&&(b++,A=!1);for(L=0;L<b;L++)p+=o}s.type==="keyword"&&d.match(/^(case|default)$/)&&(P[m]=d,m++),s.type==="keyword"&&d.match(/^(break)$/)&&P[m-1]&&P[m-1].match(/^(case|default)$/)&&m--,s.type==="paren.lparen"&&(E+=(d.match(/\(/g)||[]).length,m+=d.length),s.type==="keyword"&&d.match(/^(if|else|elseif|for|while)$/)?(A=!0,E=0):!E&&d.trim()&&s.type!=="comment"&&(A=!1);if(s.type==="paren.rparen"){E-=(d.match(/\)/g)||[]).length;for(L=0;L<d.length;L++)m--,d.substr(L,1)==="}"&&P[m]==="case"&&m--}c&&!l&&(B(),p.substr(-1)!=="\n"&&(p+=" ")),p+=d,h&&(p+=" "),l=!1,c=!1,h=!1;if(i(s,"tag-close")&&(_||a.indexOf(v)!==-1)||i(s,"doctype")&&d===">")_&&f&&f.value==="</"?N=-1:N=1;i(s,"tag-open")&&d==="</"?m--:i(s,"tag-open")&&d==="<"&&u.indexOf(f.value)===-1?m++:i(s,"tag-name")?v=d:i(s,"tag-close")&&d==="/>"&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]});
|
||||
(function() {
|
||||
ace.require(["ace/ext/beautify"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})});
|
||||
(function() {
|
||||
ace.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
;
|
||||
(function() {
|
||||
ace.require(["ace/ext/error_marker"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}});
|
||||
(function() {
|
||||
ace.require(["ace/ext/keybinding_menu"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1});
|
||||
(function() {
|
||||
ace.require(["ace/ext/linking"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],Bro:["bro"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nix:["nix"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Puppet:["epp|pp"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}});
|
||||
(function() {
|
||||
ace.require(["ace/ext/modelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/rtl",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function a(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function f(e,t){t.$bidiHandler.currentRow=null;if(t.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var n=e.start.row;n<e.end.row;n++)t.getLine(n+1).charAt(0)!==t.$bidiHandler.RLE&&(t.getDocument().$lines[n+1]=t.$bidiHandler.RLE+t.getLine(n+1))}function l(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function c(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{rtlText:{set:function(e){e?(this.on("session",f),this.on("changeSelection",u),this.renderer.on("afterRender",l),this.commands.on("exec",a),this.commands.addCommands(s)):(this.off("session",f),this.off("changeSelection",u),this.renderer.off("afterRender",l),this.commands.off("exec",a),this.commands.removeCommands(s),c(this.renderer)),this.renderer.updateFull()}}})});
|
||||
(function() {
|
||||
ace.require(["ace/ext/rtl"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})});
|
||||
(function() {
|
||||
ace.require(["ace/ext/spellcheck"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),t.Split=f}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")});
|
||||
(function() {
|
||||
ace.require(["ace/ext/split"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){"use strict";function a(e){this.type=e,this.style={},this.textContent=""}var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom");a.prototype.cloneNode=function(){return this},a.prototype.appendChild=function(e){this.textContent+=e.toString()},a.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")};var f={createTextNode:function(e,t){return e},createElement:function(e){return new a(e)},createFragment:function(){return new a("fragment")}},l=function(){this.config={},this.dom=f};l.prototype=i.prototype;var c=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var h=e.childNodes[l];h.nodeType==3?(f+=h.data.length,o+=h.data):a.push(f,h)}}else o=e.textContent,t.trim&&(o=o.trim());c.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};c.render=function(e,t,n,i,s,u){function h(){var r=c.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||h()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||h()})),--a||h()},c.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new l;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=f.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var c=u.getLength(),h=f.createElement("div");h.className=n.cssClass;var p=f.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<c;d++){var v=f.createElement("div");v.className="ace_line";if(!o){var m=f.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=c,n.exports.highlight=c});
|
||||
(function() {
|
||||
ace.require(["ace/ext/static_highlight"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s});
|
||||
(function() {
|
||||
ace.require(["ace/ext/statusbar"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){"use strict";e("ace/lib/fixoldbrowsers");var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})});
|
||||
(function() {
|
||||
ace.require(["ace/ext/themelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]});
|
||||
(function() {
|
||||
ace.require(["ace/ext/whitespace"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
ace.define("ace/snippets/java",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='## Access Modifiers\nsnippet po\n protected\nsnippet pu\n public\nsnippet pr\n private\n##\n## Annotations\nsnippet before\n @Before\n static void ${1:intercept}(${2:args}) { ${3} }\nsnippet mm\n @ManyToMany\n ${1}\nsnippet mo\n @ManyToOne\n ${1}\nsnippet om\n @OneToMany${1:(cascade=CascadeType.ALL)}\n ${2}\nsnippet oo\n @OneToOne\n ${1}\n##\n## Basic Java packages and import\nsnippet im\n import\nsnippet j.b\n java.beans.\nsnippet j.i\n java.io.\nsnippet j.m\n java.math.\nsnippet j.n\n java.net.\nsnippet j.u\n java.util.\n##\n## Class\nsnippet cl\n class ${1:`Filename("", "untitled")`} ${2}\nsnippet in\n interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}\nsnippet tc\n public class ${1:`Filename()`} extends ${2:TestCase}\n##\n## Class Enhancements\nsnippet ext\n extends \nsnippet imp\n implements\n##\n## Comments\nsnippet /*\n /*\n * ${1}\n */\n##\n## Constants\nsnippet co\n static public final ${1:String} ${2:var} = ${3};${4}\nsnippet cos\n static public final String ${1:var} = "${2}";${3}\n##\n## Control Statements\nsnippet case\n case ${1}:\n ${2}\nsnippet def\n default:\n ${2}\nsnippet el\n else\nsnippet elif\n else if (${1}) ${2}\nsnippet if\n if (${1}) ${2}\nsnippet sw\n switch (${1}) {\n ${2}\n }\n##\n## Create a Method\nsnippet m\n ${1:void} ${2:method}(${3}) ${4:throws }${5}\n##\n## Create a Variable\nsnippet v\n ${1:String} ${2:var}${3: = null}${4};${5}\n##\n## Enhancements to Methods, variables, classes, etc.\nsnippet ab\n abstract\nsnippet fi\n final\nsnippet st\n static\nsnippet sy\n synchronized\n##\n## Error Methods\nsnippet err\n System.err.print("${1:Message}");\nsnippet errf\n System.err.printf("${1:Message}", ${2:exception});\nsnippet errln\n System.err.println("${1:Message}");\n##\n## Exception Handling\nsnippet as\n assert ${1:test} : "${2:Failure message}";${3}\nsnippet ca\n catch(${1:Exception} ${2:e}) ${3}\nsnippet thr\n throw\nsnippet ths\n throws\nsnippet try\n try {\n ${3}\n } catch(${1:Exception} ${2:e}) {\n }\nsnippet tryf\n try {\n ${3}\n } catch(${1:Exception} ${2:e}) {\n } finally {\n }\n##\n## Find Methods\nsnippet findall\n List<${1:listName}> ${2:items} = ${1}.findAll();${3}\nsnippet findbyid\n ${1:var} ${2:item} = ${1}.findById(${3});${4}\n##\n## Javadocs\nsnippet /**\n /**\n * ${1}\n */\nsnippet @au\n @author `system("grep \\`id -un\\` /etc/passwd | cut -d \\":\\" -f5 | cut -d \\",\\" -f1")`\nsnippet @br\n @brief ${1:Description}\nsnippet @fi\n @file ${1:`Filename()`}.java\nsnippet @pa\n @param ${1:param}\nsnippet @re\n @return ${1:param}\n##\n## Logger Methods\nsnippet debug\n Logger.debug(${1:param});${2}\nsnippet error\n Logger.error(${1:param});${2}\nsnippet info\n Logger.info(${1:param});${2}\nsnippet warn\n Logger.warn(${1:param});${2}\n##\n## Loops\nsnippet enfor\n for (${1} : ${2}) ${3}\nsnippet for\n for (${1}; ${2}; ${3}) ${4}\nsnippet wh\n while (${1}) ${2}\n##\n## Main method\nsnippet main\n public static void main (String[] args) {\n ${1:/* code */}\n }\n##\n## Print Methods\nsnippet print\n System.out.print("${1:Message}");\nsnippet printf\n System.out.printf("${1:Message}", ${2:args});\nsnippet println\n System.out.println(${1});\n##\n## Render Methods\nsnippet ren\n render(${1:param});${2}\nsnippet rena\n renderArgs.put("${1}", ${2});${3}\nsnippet renb\n renderBinary(${1:param});${2}\nsnippet renj\n renderJSON(${1:param});${2}\nsnippet renx\n renderXml(${1:param});${2}\n##\n## Setter and Getter Methods\nsnippet set\n ${1:public} void set${3:}(${2:String} ${4:}){\n this.$4 = $4;\n }\nsnippet get\n ${1:public} ${2:String} get${3:}(){\n return this.${4:};\n }\n##\n## Terminate Methods or Loops\nsnippet re\n return\nsnippet br\n break;\n##\n## Test Methods\nsnippet t\n public void test${1:Name}() throws Exception {\n ${2}\n }\nsnippet test\n @Test\n public void test${1:Name}() throws Exception {\n ${2}\n }\n##\n## Utils\nsnippet Sc\n Scanner\n##\n## Miscellaneous\nsnippet action\n public static void ${1:index}(${2:args}) { ${3} }\nsnippet rnf\n notFound(${1:param});${2}\nsnippet rnfin\n notFoundIfNull(${1:param});${2}\nsnippet rr\n redirect(${1:param});${2}\nsnippet ru\n unauthorized(${1:param});${2}\nsnippet unless\n (unless=${1:param});${2}\n',t.scope="java"});
|
||||
(function() {
|
||||
ace.require(["ace/snippets/java"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.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: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.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,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.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_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)});
|
||||
(function() {
|
||||
ace.require(["ace/theme/monokai"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=!1,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P={},H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.trim())},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="</"&&(_&&!l&&N<1&&N++,M&&(N=1),w=1,_=!1)):i(s,"tag-close")?O=!1:i(s,"comment.start")?_=!0:i(s,"comment.end")&&(_=!1),!O&&!N&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&N++,T!==x&&(N=T,x&&(N-=x));if(N){j();for(;N>0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),h=!0,l=!1):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m<g&&(b=D[m]);g=m,y=b,w&&(b-=w),A&&!E&&(b++,A=!1);for(L=0;L<b;L++)p+=o}s.type==="keyword"&&d.match(/^(case|default)$/)&&(P[m]=d,m++),s.type==="keyword"&&d.match(/^(break)$/)&&P[m-1]&&P[m-1].match(/^(case|default)$/)&&m--,s.type==="paren.lparen"&&(E+=(d.match(/\(/g)||[]).length,m+=d.length),s.type==="keyword"&&d.match(/^(if|else|elseif|for|while)$/)?(A=!0,E=0):!E&&d.trim()&&s.type!=="comment"&&(A=!1);if(s.type==="paren.rparen"){E-=(d.match(/\)/g)||[]).length;for(L=0;L<d.length;L++)m--,d.substr(L,1)==="}"&&P[m]==="case"&&m--}c&&!l&&(B(),p.substr(-1)!=="\n"&&(p+=" ")),p+=d,h&&(p+=" "),l=!1,c=!1,h=!1;if(i(s,"tag-close")&&(_||a.indexOf(v)!==-1)||i(s,"doctype")&&d===">")_&&f&&f.value==="</"?N=-1:N=1;i(s,"tag-open")&&d==="</"?m--:i(s,"tag-open")&&d==="<"&&u.indexOf(f.value)===-1?m++:i(s,"tag-name")?v=d:i(s,"tag-close")&&d==="/>"&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]});
|
||||
(function() {
|
||||
window.require(["ace/ext/beautify"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})});
|
||||
(function() {
|
||||
window.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
;
|
||||
(function() {
|
||||
window.require(["ace/ext/error_marker"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}});
|
||||
(function() {
|
||||
window.require(["ace/ext/keybinding_menu"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1});
|
||||
(function() {
|
||||
window.require(["ace/ext/linking"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],Bro:["bro"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nix:["nix"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Puppet:["epp|pp"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}});
|
||||
(function() {
|
||||
window.require(["ace/ext/modelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/ext/rtl",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function a(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function f(e,t){t.$bidiHandler.currentRow=null;if(t.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var n=e.start.row;n<e.end.row;n++)t.getLine(n+1).charAt(0)!==t.$bidiHandler.RLE&&(t.getDocument().$lines[n+1]=t.$bidiHandler.RLE+t.getLine(n+1))}function l(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function c(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{rtlText:{set:function(e){e?(this.on("session",f),this.on("changeSelection",u),this.renderer.on("afterRender",l),this.commands.on("exec",a),this.commands.addCommands(s)):(this.off("session",f),this.off("changeSelection",u),this.renderer.off("afterRender",l),this.commands.off("exec",a),this.commands.removeCommands(s),c(this.renderer)),this.renderer.updateFull()}}})});
|
||||
(function() {
|
||||
window.require(["ace/ext/rtl"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})});
|
||||
(function() {
|
||||
window.require(["ace/ext/spellcheck"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),t.Split=f}),define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")});
|
||||
(function() {
|
||||
window.require(["ace/ext/split"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){"use strict";function a(e){this.type=e,this.style={},this.textContent=""}var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom");a.prototype.cloneNode=function(){return this},a.prototype.appendChild=function(e){this.textContent+=e.toString()},a.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")};var f={createTextNode:function(e,t){return e},createElement:function(e){return new a(e)},createFragment:function(){return new a("fragment")}},l=function(){this.config={},this.dom=f};l.prototype=i.prototype;var c=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var h=e.childNodes[l];h.nodeType==3?(f+=h.data.length,o+=h.data):a.push(f,h)}}else o=e.textContent,t.trim&&(o=o.trim());c.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};c.render=function(e,t,n,i,s,u){function h(){var r=c.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||h()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||h()})),--a||h()},c.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new l;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=f.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var c=u.getLength(),h=f.createElement("div");h.className=n.cssClass;var p=f.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<c;d++){var v=f.createElement("div");v.className="ace_line";if(!o){var m=f.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=c,n.exports.highlight=c});
|
||||
(function() {
|
||||
window.require(["ace/ext/static_highlight"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s});
|
||||
(function() {
|
||||
window.require(["ace/ext/statusbar"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){"use strict";e("ace/lib/fixoldbrowsers");var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})});
|
||||
(function() {
|
||||
window.require(["ace/ext/themelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]});
|
||||
(function() {
|
||||
window.require(["ace/ext/whitespace"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
define("ace/snippets/java",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='## Access Modifiers\nsnippet po\n protected\nsnippet pu\n public\nsnippet pr\n private\n##\n## Annotations\nsnippet before\n @Before\n static void ${1:intercept}(${2:args}) { ${3} }\nsnippet mm\n @ManyToMany\n ${1}\nsnippet mo\n @ManyToOne\n ${1}\nsnippet om\n @OneToMany${1:(cascade=CascadeType.ALL)}\n ${2}\nsnippet oo\n @OneToOne\n ${1}\n##\n## Basic Java packages and import\nsnippet im\n import\nsnippet j.b\n java.beans.\nsnippet j.i\n java.io.\nsnippet j.m\n java.math.\nsnippet j.n\n java.net.\nsnippet j.u\n java.util.\n##\n## Class\nsnippet cl\n class ${1:`Filename("", "untitled")`} ${2}\nsnippet in\n interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}\nsnippet tc\n public class ${1:`Filename()`} extends ${2:TestCase}\n##\n## Class Enhancements\nsnippet ext\n extends \nsnippet imp\n implements\n##\n## Comments\nsnippet /*\n /*\n * ${1}\n */\n##\n## Constants\nsnippet co\n static public final ${1:String} ${2:var} = ${3};${4}\nsnippet cos\n static public final String ${1:var} = "${2}";${3}\n##\n## Control Statements\nsnippet case\n case ${1}:\n ${2}\nsnippet def\n default:\n ${2}\nsnippet el\n else\nsnippet elif\n else if (${1}) ${2}\nsnippet if\n if (${1}) ${2}\nsnippet sw\n switch (${1}) {\n ${2}\n }\n##\n## Create a Method\nsnippet m\n ${1:void} ${2:method}(${3}) ${4:throws }${5}\n##\n## Create a Variable\nsnippet v\n ${1:String} ${2:var}${3: = null}${4};${5}\n##\n## Enhancements to Methods, variables, classes, etc.\nsnippet ab\n abstract\nsnippet fi\n final\nsnippet st\n static\nsnippet sy\n synchronized\n##\n## Error Methods\nsnippet err\n System.err.print("${1:Message}");\nsnippet errf\n System.err.printf("${1:Message}", ${2:exception});\nsnippet errln\n System.err.println("${1:Message}");\n##\n## Exception Handling\nsnippet as\n assert ${1:test} : "${2:Failure message}";${3}\nsnippet ca\n catch(${1:Exception} ${2:e}) ${3}\nsnippet thr\n throw\nsnippet ths\n throws\nsnippet try\n try {\n ${3}\n } catch(${1:Exception} ${2:e}) {\n }\nsnippet tryf\n try {\n ${3}\n } catch(${1:Exception} ${2:e}) {\n } finally {\n }\n##\n## Find Methods\nsnippet findall\n List<${1:listName}> ${2:items} = ${1}.findAll();${3}\nsnippet findbyid\n ${1:var} ${2:item} = ${1}.findById(${3});${4}\n##\n## Javadocs\nsnippet /**\n /**\n * ${1}\n */\nsnippet @au\n @author `system("grep \\`id -un\\` /etc/passwd | cut -d \\":\\" -f5 | cut -d \\",\\" -f1")`\nsnippet @br\n @brief ${1:Description}\nsnippet @fi\n @file ${1:`Filename()`}.java\nsnippet @pa\n @param ${1:param}\nsnippet @re\n @return ${1:param}\n##\n## Logger Methods\nsnippet debug\n Logger.debug(${1:param});${2}\nsnippet error\n Logger.error(${1:param});${2}\nsnippet info\n Logger.info(${1:param});${2}\nsnippet warn\n Logger.warn(${1:param});${2}\n##\n## Loops\nsnippet enfor\n for (${1} : ${2}) ${3}\nsnippet for\n for (${1}; ${2}; ${3}) ${4}\nsnippet wh\n while (${1}) ${2}\n##\n## Main method\nsnippet main\n public static void main (String[] args) {\n ${1:/* code */}\n }\n##\n## Print Methods\nsnippet print\n System.out.print("${1:Message}");\nsnippet printf\n System.out.printf("${1:Message}", ${2:args});\nsnippet println\n System.out.println(${1});\n##\n## Render Methods\nsnippet ren\n render(${1:param});${2}\nsnippet rena\n renderArgs.put("${1}", ${2});${3}\nsnippet renb\n renderBinary(${1:param});${2}\nsnippet renj\n renderJSON(${1:param});${2}\nsnippet renx\n renderXml(${1:param});${2}\n##\n## Setter and Getter Methods\nsnippet set\n ${1:public} void set${3:}(${2:String} ${4:}){\n this.$4 = $4;\n }\nsnippet get\n ${1:public} ${2:String} get${3:}(){\n return this.${4:};\n }\n##\n## Terminate Methods or Loops\nsnippet re\n return\nsnippet br\n break;\n##\n## Test Methods\nsnippet t\n public void test${1:Name}() throws Exception {\n ${2}\n }\nsnippet test\n @Test\n public void test${1:Name}() throws Exception {\n ${2}\n }\n##\n## Utils\nsnippet Sc\n Scanner\n##\n## Miscellaneous\nsnippet action\n public static void ${1:index}(${2:args}) { ${3} }\nsnippet rnf\n notFound(${1:param});${2}\nsnippet rnfin\n notFoundIfNull(${1:param});${2}\nsnippet rr\n redirect(${1:param});${2}\nsnippet ru\n unauthorized(${1:param});${2}\nsnippet unless\n (unless=${1:param});${2}\n',t.scope="java"});
|
||||
(function() {
|
||||
window.require(["ace/snippets/java"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,9 @@
|
||||
define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.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: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.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,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.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_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)});
|
||||
(function() {
|
||||
window.require(["ace/theme/monokai"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,318 @@
|
||||
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var TokenIterator = require("../token_iterator").TokenIterator;
|
||||
|
||||
function is(token, type) {
|
||||
return token.type.lastIndexOf(type + ".xml") > -1;
|
||||
}
|
||||
exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
|
||||
exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
|
||||
|
||||
exports.beautify = function(session) {
|
||||
var iterator = new TokenIterator(session, 0, 0);
|
||||
var token = iterator.getCurrentToken();
|
||||
var tabString = session.getTabString();
|
||||
var singletonTags = exports.singletonTags;
|
||||
var blockTags = exports.blockTags;
|
||||
var nextToken;
|
||||
var breakBefore = false;
|
||||
var spaceBefore = false;
|
||||
var spaceAfter = false;
|
||||
var code = "";
|
||||
var value = "";
|
||||
var tagName = "";
|
||||
var depth = 0;
|
||||
var lastDepth = 0;
|
||||
var lastIndent = 0;
|
||||
var indent = 0;
|
||||
var unindent = 0;
|
||||
var roundDepth = 0;
|
||||
var onCaseLine = false;
|
||||
var row;
|
||||
var curRow = 0;
|
||||
var rowsToAdd = 0;
|
||||
var rowTokens = [];
|
||||
var abort = false;
|
||||
var i;
|
||||
var indentNextLine = false;
|
||||
var inTag = false;
|
||||
var inCSS = false;
|
||||
var inBlock = false;
|
||||
var levels = {0: 0};
|
||||
var parents = {};
|
||||
|
||||
var trimNext = function() {
|
||||
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
|
||||
nextToken.value = nextToken.value.trim();
|
||||
};
|
||||
|
||||
var trimLine = function() {
|
||||
code = code.replace(/ +$/, "");
|
||||
};
|
||||
|
||||
var trimCode = function() {
|
||||
code = code.trimRight();
|
||||
breakBefore = false;
|
||||
};
|
||||
|
||||
while (token !== null) {
|
||||
curRow = iterator.getCurrentTokenRow();
|
||||
rowTokens = iterator.$rowTokens;
|
||||
nextToken = iterator.stepForward();
|
||||
|
||||
if (typeof token !== "undefined") {
|
||||
value = token.value;
|
||||
unindent = 0;
|
||||
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
|
||||
if (is(token, "tag-open")) {
|
||||
inTag = true;
|
||||
if (nextToken)
|
||||
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
|
||||
if (value === "</") {
|
||||
if (inBlock && !breakBefore && rowsToAdd < 1)
|
||||
rowsToAdd++;
|
||||
|
||||
if (inCSS)
|
||||
rowsToAdd = 1;
|
||||
|
||||
unindent = 1;
|
||||
inBlock = false;
|
||||
}
|
||||
} else if (is(token, "tag-close")) {
|
||||
inTag = false;
|
||||
} else if (is(token, "comment.start")) {
|
||||
inBlock = true;
|
||||
} else if (is(token, "comment.end")) {
|
||||
inBlock = false;
|
||||
}
|
||||
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
|
||||
rowsToAdd++;
|
||||
}
|
||||
if (curRow !== row) {
|
||||
rowsToAdd = curRow;
|
||||
|
||||
if (row)
|
||||
rowsToAdd -= row;
|
||||
}
|
||||
|
||||
if (rowsToAdd) {
|
||||
trimCode();
|
||||
for (; rowsToAdd > 0; rowsToAdd--)
|
||||
code += "\n";
|
||||
|
||||
breakBefore = true;
|
||||
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
|
||||
value = value.trimLeft();
|
||||
}
|
||||
|
||||
if (value) {
|
||||
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
|
||||
parents[depth] = value;
|
||||
|
||||
trimNext();
|
||||
spaceAfter = true;
|
||||
if (value.match(/^(else|elseif)$/)) {
|
||||
if (code.match(/\}[\s]*$/)) {
|
||||
trimCode();
|
||||
spaceBefore = true;
|
||||
}
|
||||
}
|
||||
} else if (token.type === "paren.lparen") {
|
||||
trimNext();
|
||||
if (value.substr(-1) === "{") {
|
||||
spaceAfter = true;
|
||||
indentNextLine = false;
|
||||
|
||||
if(!inTag)
|
||||
rowsToAdd = 1;
|
||||
}
|
||||
if (value.substr(0, 1) === "{") {
|
||||
spaceBefore = true;
|
||||
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
|
||||
trimCode();
|
||||
spaceBefore = false;
|
||||
} else if (code.trimRight().substr(-1) === ')') {
|
||||
trimCode();
|
||||
} else {
|
||||
trimLine();
|
||||
}
|
||||
}
|
||||
} else if (token.type === "paren.rparen") {
|
||||
unindent = 1;
|
||||
if (value.substr(0, 1) === "}") {
|
||||
if (parents[depth-1] === 'case')
|
||||
unindent++;
|
||||
|
||||
if (code.trimRight().substr(-1) === '{') {
|
||||
trimCode();
|
||||
} else {
|
||||
spaceBefore = true;
|
||||
|
||||
if (inCSS)
|
||||
rowsToAdd+=2;
|
||||
}
|
||||
}
|
||||
if (value.substr(0, 1) === "]") {
|
||||
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
|
||||
spaceBefore = false;
|
||||
indent++;
|
||||
trimCode();
|
||||
}
|
||||
}
|
||||
if (value.substr(0, 1) === ")") {
|
||||
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
|
||||
spaceBefore = false;
|
||||
indent++;
|
||||
trimCode();
|
||||
}
|
||||
}
|
||||
|
||||
trimLine();
|
||||
} else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
|
||||
trimCode();
|
||||
trimNext();
|
||||
spaceBefore = true;
|
||||
spaceAfter = true;
|
||||
} else if (token.type === "punctuation.operator" && value === ';') {
|
||||
trimCode();
|
||||
trimNext();
|
||||
spaceAfter = true;
|
||||
|
||||
if (inCSS)
|
||||
rowsToAdd++;
|
||||
} else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
|
||||
trimCode();
|
||||
trimNext();
|
||||
spaceAfter = true;
|
||||
breakBefore = false;
|
||||
} else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
|
||||
trimCode();
|
||||
spaceBefore = true;
|
||||
} else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
|
||||
spaceBefore = true;
|
||||
} else if (is(token, "attribute-equals")) {
|
||||
trimLine();
|
||||
trimNext();
|
||||
} else if (is(token, "tag-close")) {
|
||||
trimLine();
|
||||
if(value === "/>")
|
||||
spaceBefore = true;
|
||||
}
|
||||
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"]$/))) {
|
||||
|
||||
indent = lastIndent;
|
||||
|
||||
if(depth > lastDepth) {
|
||||
indent++;
|
||||
|
||||
for (i=depth; i > lastDepth; i--)
|
||||
levels[i] = indent;
|
||||
} else if(depth < lastDepth)
|
||||
indent = levels[depth];
|
||||
|
||||
lastDepth = depth;
|
||||
lastIndent = indent;
|
||||
|
||||
if(unindent)
|
||||
indent -= unindent;
|
||||
|
||||
if (indentNextLine && !roundDepth) {
|
||||
indent++;
|
||||
indentNextLine = false;
|
||||
}
|
||||
|
||||
for (i = 0; i < indent; i++)
|
||||
code += tabString;
|
||||
}
|
||||
|
||||
|
||||
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
||||
parents[depth] = value;
|
||||
depth++;
|
||||
}
|
||||
|
||||
|
||||
if (token.type === "keyword" && value.match(/^(break)$/)) {
|
||||
if(parents[depth-1] && parents[depth-1].match(/^(case|default)$/)) {
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
if (token.type === "paren.lparen") {
|
||||
roundDepth += (value.match(/\(/g) || []).length;
|
||||
depth += value.length;
|
||||
}
|
||||
|
||||
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
|
||||
indentNextLine = true;
|
||||
roundDepth = 0;
|
||||
} else if (!roundDepth && value.trim() && token.type !== "comment")
|
||||
indentNextLine = false;
|
||||
|
||||
if (token.type === "paren.rparen") {
|
||||
roundDepth -= (value.match(/\)/g) || []).length;
|
||||
|
||||
for (i = 0; i < value.length; i++) {
|
||||
depth--;
|
||||
if(value.substr(i, 1)==='}' && parents[depth]==='case') {
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spaceBefore && !breakBefore) {
|
||||
trimLine();
|
||||
if (code.substr(-1) !== "\n")
|
||||
code += " ";
|
||||
}
|
||||
|
||||
code += value;
|
||||
|
||||
if (spaceAfter)
|
||||
code += " ";
|
||||
|
||||
breakBefore = false;
|
||||
spaceBefore = false;
|
||||
spaceAfter = false;
|
||||
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
|
||||
if (inBlock && nextToken && nextToken.value === "</")
|
||||
rowsToAdd = -1;
|
||||
else
|
||||
rowsToAdd = 1;
|
||||
}
|
||||
if (is(token, "tag-open") && value === "</") {
|
||||
depth--;
|
||||
} else if (is(token, "tag-open") && value === "<" && singletonTags.indexOf(nextToken.value) === -1) {
|
||||
depth++;
|
||||
} else if (is(token, "tag-name")) {
|
||||
tagName = value;
|
||||
} else if (is(token, "tag-close") && value === "/>" && singletonTags.indexOf(tagName) === -1){
|
||||
depth--;
|
||||
}
|
||||
|
||||
row = curRow;
|
||||
}
|
||||
}
|
||||
|
||||
token = nextToken;
|
||||
}
|
||||
|
||||
code = code.trim();
|
||||
session.doc.setValue(code);
|
||||
};
|
||||
|
||||
exports.commands = [{
|
||||
name: "beautify",
|
||||
exec: function(editor) {
|
||||
exports.beautify(editor.session);
|
||||
},
|
||||
bindKey: "Ctrl-Shift-B"
|
||||
}];
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/beautify"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,277 @@
|
||||
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var ElasticTabstopsLite = function(editor) {
|
||||
this.$editor = editor;
|
||||
var self = this;
|
||||
var changedRows = [];
|
||||
var recordChanges = false;
|
||||
this.onAfterExec = function() {
|
||||
recordChanges = false;
|
||||
self.processRows(changedRows);
|
||||
changedRows = [];
|
||||
};
|
||||
this.onExec = function() {
|
||||
recordChanges = true;
|
||||
};
|
||||
this.onChange = function(delta) {
|
||||
if (recordChanges) {
|
||||
if (changedRows.indexOf(delta.start.row) == -1)
|
||||
changedRows.push(delta.start.row);
|
||||
if (delta.end.row != delta.start.row)
|
||||
changedRows.push(delta.end.row);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
(function() {
|
||||
this.processRows = function(rows) {
|
||||
this.$inChange = true;
|
||||
var checkedRows = [];
|
||||
|
||||
for (var r = 0, rowCount = rows.length; r < rowCount; r++) {
|
||||
var row = rows[r];
|
||||
|
||||
if (checkedRows.indexOf(row) > -1)
|
||||
continue;
|
||||
|
||||
var cellWidthObj = this.$findCellWidthsForBlock(row);
|
||||
var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths);
|
||||
var rowIndex = cellWidthObj.firstRow;
|
||||
|
||||
for (var w = 0, l = cellWidths.length; w < l; w++) {
|
||||
var widths = cellWidths[w];
|
||||
checkedRows.push(rowIndex);
|
||||
this.$adjustRow(rowIndex, widths);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
this.$inChange = false;
|
||||
};
|
||||
|
||||
this.$findCellWidthsForBlock = function(row) {
|
||||
var cellWidths = [], widths;
|
||||
var rowIter = row;
|
||||
while (rowIter >= 0) {
|
||||
widths = this.$cellWidthsForRow(rowIter);
|
||||
if (widths.length == 0)
|
||||
break;
|
||||
|
||||
cellWidths.unshift(widths);
|
||||
rowIter--;
|
||||
}
|
||||
var firstRow = rowIter + 1;
|
||||
rowIter = row;
|
||||
var numRows = this.$editor.session.getLength();
|
||||
|
||||
while (rowIter < numRows - 1) {
|
||||
rowIter++;
|
||||
|
||||
widths = this.$cellWidthsForRow(rowIter);
|
||||
if (widths.length == 0)
|
||||
break;
|
||||
|
||||
cellWidths.push(widths);
|
||||
}
|
||||
|
||||
return { cellWidths: cellWidths, firstRow: firstRow };
|
||||
};
|
||||
|
||||
this.$cellWidthsForRow = function(row) {
|
||||
var selectionColumns = this.$selectionColumnsForRow(row);
|
||||
var tabs = [-1].concat(this.$tabsForRow(row));
|
||||
var widths = tabs.map(function(el) { return 0; } ).slice(1);
|
||||
var line = this.$editor.session.getLine(row);
|
||||
|
||||
for (var i = 0, len = tabs.length - 1; i < len; i++) {
|
||||
var leftEdge = tabs[i]+1;
|
||||
var rightEdge = tabs[i+1];
|
||||
|
||||
var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge);
|
||||
var cell = line.substring(leftEdge, rightEdge);
|
||||
widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge);
|
||||
}
|
||||
|
||||
return widths;
|
||||
};
|
||||
|
||||
this.$selectionColumnsForRow = function(row) {
|
||||
var selections = [], cursor = this.$editor.getCursorPosition();
|
||||
if (this.$editor.session.getSelection().isEmpty()) {
|
||||
if (row == cursor.row)
|
||||
selections.push(cursor.column);
|
||||
}
|
||||
|
||||
return selections;
|
||||
};
|
||||
|
||||
this.$setBlockCellWidthsToMax = function(cellWidths) {
|
||||
var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth;
|
||||
var columnInfo = this.$izip_longest(cellWidths);
|
||||
|
||||
for (var c = 0, l = columnInfo.length; c < l; c++) {
|
||||
var column = columnInfo[c];
|
||||
if (!column.push) {
|
||||
console.error(column);
|
||||
continue;
|
||||
}
|
||||
column.push(NaN);
|
||||
|
||||
for (var r = 0, s = column.length; r < s; r++) {
|
||||
var width = column[r];
|
||||
if (startingNewBlock) {
|
||||
blockStartRow = r;
|
||||
maxWidth = 0;
|
||||
startingNewBlock = false;
|
||||
}
|
||||
if (isNaN(width)) {
|
||||
blockEndRow = r;
|
||||
|
||||
for (var j = blockStartRow; j < blockEndRow; j++) {
|
||||
cellWidths[j][c] = maxWidth;
|
||||
}
|
||||
startingNewBlock = true;
|
||||
}
|
||||
|
||||
maxWidth = Math.max(maxWidth, width);
|
||||
}
|
||||
}
|
||||
|
||||
return cellWidths;
|
||||
};
|
||||
|
||||
this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) {
|
||||
var rightmost = 0;
|
||||
|
||||
if (selectionColumns.length) {
|
||||
var lengths = [];
|
||||
for (var s = 0, length = selectionColumns.length; s < length; s++) {
|
||||
if (selectionColumns[s] <= cellRightEdge)
|
||||
lengths.push(s);
|
||||
else
|
||||
lengths.push(0);
|
||||
}
|
||||
rightmost = Math.max.apply(Math, lengths);
|
||||
}
|
||||
|
||||
return rightmost;
|
||||
};
|
||||
|
||||
this.$tabsForRow = function(row) {
|
||||
var rowTabs = [], line = this.$editor.session.getLine(row),
|
||||
re = /\t/g, match;
|
||||
|
||||
while ((match = re.exec(line)) != null) {
|
||||
rowTabs.push(match.index);
|
||||
}
|
||||
|
||||
return rowTabs;
|
||||
};
|
||||
|
||||
this.$adjustRow = function(row, widths) {
|
||||
var rowTabs = this.$tabsForRow(row);
|
||||
|
||||
if (rowTabs.length == 0)
|
||||
return;
|
||||
|
||||
var bias = 0, location = -1;
|
||||
var expandedSet = this.$izip(widths, rowTabs);
|
||||
|
||||
for (var i = 0, l = expandedSet.length; i < l; i++) {
|
||||
var w = expandedSet[i][0], it = expandedSet[i][1];
|
||||
location += 1 + w;
|
||||
it += bias;
|
||||
var difference = location - it;
|
||||
|
||||
if (difference == 0)
|
||||
continue;
|
||||
|
||||
var partialLine = this.$editor.session.getLine(row).substr(0, it );
|
||||
var strippedPartialLine = partialLine.replace(/\s*$/g, "");
|
||||
var ispaces = partialLine.length - strippedPartialLine.length;
|
||||
|
||||
if (difference > 0) {
|
||||
this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t");
|
||||
this.$editor.session.getDocument().removeInLine(row, it, it + 1);
|
||||
|
||||
bias += difference;
|
||||
}
|
||||
|
||||
if (difference < 0 && ispaces >= -difference) {
|
||||
this.$editor.session.getDocument().removeInLine(row, it + difference, it);
|
||||
bias += difference;
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$izip_longest = function(iterables) {
|
||||
if (!iterables[0])
|
||||
return [];
|
||||
var longest = iterables[0].length;
|
||||
var iterablesLength = iterables.length;
|
||||
|
||||
for (var i = 1; i < iterablesLength; i++) {
|
||||
var iLength = iterables[i].length;
|
||||
if (iLength > longest)
|
||||
longest = iLength;
|
||||
}
|
||||
|
||||
var expandedSet = [];
|
||||
|
||||
for (var l = 0; l < longest; l++) {
|
||||
var set = [];
|
||||
for (var i = 0; i < iterablesLength; i++) {
|
||||
if (iterables[i][l] === "")
|
||||
set.push(NaN);
|
||||
else
|
||||
set.push(iterables[i][l]);
|
||||
}
|
||||
|
||||
expandedSet.push(set);
|
||||
}
|
||||
|
||||
|
||||
return expandedSet;
|
||||
};
|
||||
this.$izip = function(widths, tabs) {
|
||||
var size = widths.length >= tabs.length ? tabs.length : widths.length;
|
||||
|
||||
var expandedSet = [];
|
||||
for (var i = 0; i < size; i++) {
|
||||
var set = [ widths[i], tabs[i] ];
|
||||
expandedSet.push(set);
|
||||
}
|
||||
return expandedSet;
|
||||
};
|
||||
|
||||
}).call(ElasticTabstopsLite.prototype);
|
||||
|
||||
exports.ElasticTabstopsLite = ElasticTabstopsLite;
|
||||
|
||||
var Editor = require("../editor").Editor;
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
useElasticTabstops: {
|
||||
set: function(val) {
|
||||
if (val) {
|
||||
if (!this.elasticTabstops)
|
||||
this.elasticTabstops = new ElasticTabstopsLite(this);
|
||||
this.commands.on("afterExec", this.elasticTabstops.onAfterExec);
|
||||
this.commands.on("exec", this.elasticTabstops.onExec);
|
||||
this.on("change", this.elasticTabstops.onChange);
|
||||
} else if (this.elasticTabstops) {
|
||||
this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec);
|
||||
this.commands.removeListener("exec", this.elasticTabstops.onExec);
|
||||
this.removeListener("change", this.elasticTabstops.onChange);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@
|
||||
|
||||
;
|
||||
(function() {
|
||||
ace.require(["ace/ext/error_marker"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,189 @@
|
||||
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
||||
'use strict';
|
||||
var dom = require("../../lib/dom");
|
||||
var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
|
||||
background-color: #F7F7F7;\
|
||||
color: black;\
|
||||
box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
|
||||
padding: 1em 0.5em 2em 1em;\
|
||||
overflow: auto;\
|
||||
position: absolute;\
|
||||
margin: 0;\
|
||||
bottom: 0;\
|
||||
right: 0;\
|
||||
top: 0;\
|
||||
z-index: 9991;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
|
||||
box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
|
||||
background-color: rgba(255, 255, 255, 0.6);\
|
||||
color: black;\
|
||||
}\
|
||||
.ace_optionsMenuEntry:hover {\
|
||||
background-color: rgba(100, 100, 100, 0.1);\
|
||||
transition: all 0.3s\
|
||||
}\
|
||||
.ace_closeButton {\
|
||||
background: rgba(245, 146, 146, 0.5);\
|
||||
border: 1px solid #F48A8A;\
|
||||
border-radius: 50%;\
|
||||
padding: 7px;\
|
||||
position: absolute;\
|
||||
right: -8px;\
|
||||
top: -8px;\
|
||||
z-index: 100000;\
|
||||
}\
|
||||
.ace_closeButton{\
|
||||
background: rgba(245, 146, 146, 0.9);\
|
||||
}\
|
||||
.ace_optionsMenuKey {\
|
||||
color: darkslateblue;\
|
||||
font-weight: bold;\
|
||||
}\
|
||||
.ace_optionsMenuCommand {\
|
||||
color: darkcyan;\
|
||||
font-weight: normal;\
|
||||
}\
|
||||
.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\
|
||||
vertical-align: middle;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button[ace_selected_button=true] {\
|
||||
background: #e7e7e7;\
|
||||
box-shadow: 1px 0px 2px 0px #adadad inset;\
|
||||
border-color: #adadad;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button {\
|
||||
background: white;\
|
||||
border: 1px solid lightgray;\
|
||||
margin: 0px;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button:hover{\
|
||||
background: #f0f0f0;\
|
||||
}";
|
||||
dom.importCssString(cssText);
|
||||
module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
|
||||
top = top ? 'top: ' + top + ';' : '';
|
||||
bottom = bottom ? 'bottom: ' + bottom + ';' : '';
|
||||
right = right ? 'right: ' + right + ';' : '';
|
||||
left = left ? 'left: ' + left + ';' : '';
|
||||
|
||||
var closer = document.createElement('div');
|
||||
var contentContainer = document.createElement('div');
|
||||
|
||||
function documentEscListener(e) {
|
||||
if (e.keyCode === 27) {
|
||||
closer.click();
|
||||
}
|
||||
}
|
||||
|
||||
closer.style.cssText = 'margin: 0; padding: 0; ' +
|
||||
'position: fixed; top:0; bottom:0; left:0; right:0;' +
|
||||
'z-index: 9990; ' +
|
||||
'background-color: rgba(0, 0, 0, 0.3);';
|
||||
closer.addEventListener('click', function() {
|
||||
document.removeEventListener('keydown', documentEscListener);
|
||||
closer.parentNode.removeChild(closer);
|
||||
editor.focus();
|
||||
closer = null;
|
||||
});
|
||||
document.addEventListener('keydown', documentEscListener);
|
||||
|
||||
contentContainer.style.cssText = top + right + bottom + left;
|
||||
contentContainer.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
var wrapper = dom.createElement("div");
|
||||
wrapper.style.position = "relative";
|
||||
|
||||
var closeButton = dom.createElement("div");
|
||||
closeButton.className = "ace_closeButton";
|
||||
closeButton.addEventListener('click', function() {
|
||||
closer.click();
|
||||
});
|
||||
|
||||
wrapper.appendChild(closeButton);
|
||||
contentContainer.appendChild(wrapper);
|
||||
|
||||
contentContainer.appendChild(contentElement);
|
||||
closer.appendChild(contentContainer);
|
||||
document.body.appendChild(closer);
|
||||
editor.blur();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var keys = require("../../lib/keys");
|
||||
module.exports.getEditorKeybordShortcuts = function(editor) {
|
||||
var KEY_MODS = keys.KEY_MODS;
|
||||
var keybindings = [];
|
||||
var commandMap = {};
|
||||
editor.keyBinding.$handlers.forEach(function(handler) {
|
||||
var ckb = handler.commandKeyBinding;
|
||||
for (var i in ckb) {
|
||||
var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); });
|
||||
var commands = ckb[i];
|
||||
if (!Array.isArray(commands))
|
||||
commands = [commands];
|
||||
commands.forEach(function(command) {
|
||||
if (typeof command != "string")
|
||||
command = command.name;
|
||||
if (commandMap[command]) {
|
||||
commandMap[command].key += "|" + key;
|
||||
} else {
|
||||
commandMap[command] = {key: key, command: command};
|
||||
keybindings.push(commandMap[command]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return keybindings;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var Editor = require("ace/editor").Editor;
|
||||
function showKeyboardShortcuts (editor) {
|
||||
if(!document.getElementById('kbshortcutmenu')) {
|
||||
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
|
||||
var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts;
|
||||
var kb = getEditorKeybordShortcuts(editor);
|
||||
var el = document.createElement('div');
|
||||
var commands = kb.reduce(function(previous, current) {
|
||||
return previous + '<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'
|
||||
+ current.command + '</span> : '
|
||||
+ '<span class="ace_optionsMenuKey">' + current.key + '</span></div>';
|
||||
}, '');
|
||||
|
||||
el.id = 'kbshortcutmenu';
|
||||
el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands + '</div>';
|
||||
overlayPage(editor, el, '0', '0', '0', null);
|
||||
}
|
||||
}
|
||||
module.exports.init = function(editor) {
|
||||
Editor.prototype.showKeyboardShortcuts = function() {
|
||||
showKeyboardShortcuts(this);
|
||||
};
|
||||
editor.commands.addCommands([{
|
||||
name: "showKeyboardShortcuts",
|
||||
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
|
||||
exec: function(editor, line) {
|
||||
editor.showKeyboardShortcuts();
|
||||
}
|
||||
}]);
|
||||
};
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/keybinding_menu"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
|
||||
|
||||
var Editor = require("ace/editor").Editor;
|
||||
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
enableLinking: {
|
||||
set: function(val) {
|
||||
if (val) {
|
||||
this.on("click", onClick);
|
||||
this.on("mousemove", onMouseMove);
|
||||
} else {
|
||||
this.off("click", onClick);
|
||||
this.off("mousemove", onMouseMove);
|
||||
}
|
||||
},
|
||||
value: false
|
||||
}
|
||||
});
|
||||
|
||||
exports.previousLinkingHover = false;
|
||||
|
||||
function onMouseMove(e) {
|
||||
var editor = e.editor;
|
||||
var ctrl = e.getAccelKey();
|
||||
|
||||
if (ctrl) {
|
||||
var editor = e.editor;
|
||||
var docPos = e.getDocumentPosition();
|
||||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
if (exports.previousLinkingHover && exports.previousLinkingHover != token) {
|
||||
editor._emit("linkHoverOut");
|
||||
}
|
||||
editor._emit("linkHover", {position: docPos, token: token});
|
||||
exports.previousLinkingHover = token;
|
||||
} else if (exports.previousLinkingHover) {
|
||||
editor._emit("linkHoverOut");
|
||||
exports.previousLinkingHover = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
var ctrl = e.getAccelKey();
|
||||
var button = e.getButton();
|
||||
|
||||
if (button == 0 && ctrl) {
|
||||
var editor = e.editor;
|
||||
var docPos = e.getDocumentPosition();
|
||||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
editor._emit("linkClick", {position: docPos, token: token});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/linking"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,228 @@
|
||||
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var modes = [];
|
||||
function getModeForPath(path) {
|
||||
var mode = modesByName.text;
|
||||
var fileName = path.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < modes.length; i++) {
|
||||
if (modes[i].supportsFile(fileName)) {
|
||||
mode = modes[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
var Mode = function(name, caption, extensions) {
|
||||
this.name = name;
|
||||
this.caption = caption;
|
||||
this.mode = "ace/mode/" + name;
|
||||
this.extensions = extensions;
|
||||
var re;
|
||||
if (/\^/.test(extensions)) {
|
||||
re = extensions.replace(/\|(\^)?/g, function(a, b){
|
||||
return "$|" + (b ? "^" : "^.*\\.");
|
||||
}) + "$";
|
||||
} else {
|
||||
re = "^.*\\.(" + extensions + ")$";
|
||||
}
|
||||
|
||||
this.extRe = new RegExp(re, "gi");
|
||||
};
|
||||
|
||||
Mode.prototype.supportsFile = function(filename) {
|
||||
return filename.match(this.extRe);
|
||||
};
|
||||
var supportedModes = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript:["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl"],
|
||||
Assembly_x86:["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
Bro: ["bro"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx"],
|
||||
JSON: ["json"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
LogiQL: ["logic|lql"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MEL: ["mel"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Puppet: ["epp|pp"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Python: ["py"],
|
||||
R: ["r"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template:["soy"],
|
||||
Space: ["space"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Django: ["html"]
|
||||
};
|
||||
|
||||
var nameOverrides = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)"
|
||||
};
|
||||
var modesByName = {};
|
||||
for (var name in supportedModes) {
|
||||
var data = supportedModes[name];
|
||||
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
|
||||
var filename = name.toLowerCase();
|
||||
var mode = new Mode(filename, displayName, data[0]);
|
||||
modesByName[filename] = mode;
|
||||
modes.push(mode);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getModeForPath: getModeForPath,
|
||||
modes: modes,
|
||||
modesByName: modesByName
|
||||
};
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/modelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,750 @@
|
||||
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
||||
'use strict';
|
||||
var dom = require("../../lib/dom");
|
||||
var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
|
||||
background-color: #F7F7F7;\
|
||||
color: black;\
|
||||
box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
|
||||
padding: 1em 0.5em 2em 1em;\
|
||||
overflow: auto;\
|
||||
position: absolute;\
|
||||
margin: 0;\
|
||||
bottom: 0;\
|
||||
right: 0;\
|
||||
top: 0;\
|
||||
z-index: 9991;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
|
||||
box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
|
||||
background-color: rgba(255, 255, 255, 0.6);\
|
||||
color: black;\
|
||||
}\
|
||||
.ace_optionsMenuEntry:hover {\
|
||||
background-color: rgba(100, 100, 100, 0.1);\
|
||||
transition: all 0.3s\
|
||||
}\
|
||||
.ace_closeButton {\
|
||||
background: rgba(245, 146, 146, 0.5);\
|
||||
border: 1px solid #F48A8A;\
|
||||
border-radius: 50%;\
|
||||
padding: 7px;\
|
||||
position: absolute;\
|
||||
right: -8px;\
|
||||
top: -8px;\
|
||||
z-index: 100000;\
|
||||
}\
|
||||
.ace_closeButton{\
|
||||
background: rgba(245, 146, 146, 0.9);\
|
||||
}\
|
||||
.ace_optionsMenuKey {\
|
||||
color: darkslateblue;\
|
||||
font-weight: bold;\
|
||||
}\
|
||||
.ace_optionsMenuCommand {\
|
||||
color: darkcyan;\
|
||||
font-weight: normal;\
|
||||
}\
|
||||
.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\
|
||||
vertical-align: middle;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button[ace_selected_button=true] {\
|
||||
background: #e7e7e7;\
|
||||
box-shadow: 1px 0px 2px 0px #adadad inset;\
|
||||
border-color: #adadad;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button {\
|
||||
background: white;\
|
||||
border: 1px solid lightgray;\
|
||||
margin: 0px;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button:hover{\
|
||||
background: #f0f0f0;\
|
||||
}";
|
||||
dom.importCssString(cssText);
|
||||
module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
|
||||
top = top ? 'top: ' + top + ';' : '';
|
||||
bottom = bottom ? 'bottom: ' + bottom + ';' : '';
|
||||
right = right ? 'right: ' + right + ';' : '';
|
||||
left = left ? 'left: ' + left + ';' : '';
|
||||
|
||||
var closer = document.createElement('div');
|
||||
var contentContainer = document.createElement('div');
|
||||
|
||||
function documentEscListener(e) {
|
||||
if (e.keyCode === 27) {
|
||||
closer.click();
|
||||
}
|
||||
}
|
||||
|
||||
closer.style.cssText = 'margin: 0; padding: 0; ' +
|
||||
'position: fixed; top:0; bottom:0; left:0; right:0;' +
|
||||
'z-index: 9990; ' +
|
||||
'background-color: rgba(0, 0, 0, 0.3);';
|
||||
closer.addEventListener('click', function() {
|
||||
document.removeEventListener('keydown', documentEscListener);
|
||||
closer.parentNode.removeChild(closer);
|
||||
editor.focus();
|
||||
closer = null;
|
||||
});
|
||||
document.addEventListener('keydown', documentEscListener);
|
||||
|
||||
contentContainer.style.cssText = top + right + bottom + left;
|
||||
contentContainer.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
var wrapper = dom.createElement("div");
|
||||
wrapper.style.position = "relative";
|
||||
|
||||
var closeButton = dom.createElement("div");
|
||||
closeButton.className = "ace_closeButton";
|
||||
closeButton.addEventListener('click', function() {
|
||||
closer.click();
|
||||
});
|
||||
|
||||
wrapper.appendChild(closeButton);
|
||||
contentContainer.appendChild(wrapper);
|
||||
|
||||
contentContainer.appendChild(contentElement);
|
||||
closer.appendChild(contentContainer);
|
||||
document.body.appendChild(closer);
|
||||
editor.blur();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var modes = [];
|
||||
function getModeForPath(path) {
|
||||
var mode = modesByName.text;
|
||||
var fileName = path.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < modes.length; i++) {
|
||||
if (modes[i].supportsFile(fileName)) {
|
||||
mode = modes[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
var Mode = function(name, caption, extensions) {
|
||||
this.name = name;
|
||||
this.caption = caption;
|
||||
this.mode = "ace/mode/" + name;
|
||||
this.extensions = extensions;
|
||||
var re;
|
||||
if (/\^/.test(extensions)) {
|
||||
re = extensions.replace(/\|(\^)?/g, function(a, b){
|
||||
return "$|" + (b ? "^" : "^.*\\.");
|
||||
}) + "$";
|
||||
} else {
|
||||
re = "^.*\\.(" + extensions + ")$";
|
||||
}
|
||||
|
||||
this.extRe = new RegExp(re, "gi");
|
||||
};
|
||||
|
||||
Mode.prototype.supportsFile = function(filename) {
|
||||
return filename.match(this.extRe);
|
||||
};
|
||||
var supportedModes = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript:["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl"],
|
||||
Assembly_x86:["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
Bro: ["bro"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx"],
|
||||
JSON: ["json"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
LogiQL: ["logic|lql"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MEL: ["mel"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Puppet: ["epp|pp"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Python: ["py"],
|
||||
R: ["r"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template:["soy"],
|
||||
Space: ["space"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Django: ["html"]
|
||||
};
|
||||
|
||||
var nameOverrides = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)"
|
||||
};
|
||||
var modesByName = {};
|
||||
for (var name in supportedModes) {
|
||||
var data = supportedModes[name];
|
||||
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
|
||||
var filename = name.toLowerCase();
|
||||
var mode = new Mode(filename, displayName, data[0]);
|
||||
modesByName[filename] = mode;
|
||||
modes.push(mode);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getModeForPath: getModeForPath,
|
||||
modes: modes,
|
||||
modesByName: modesByName
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
|
||||
"use strict";
|
||||
require("ace/lib/fixoldbrowsers");
|
||||
|
||||
var themeData = [
|
||||
["Chrome" ],
|
||||
["Clouds" ],
|
||||
["Crimson Editor" ],
|
||||
["Dawn" ],
|
||||
["Dreamweaver" ],
|
||||
["Eclipse" ],
|
||||
["GitHub" ],
|
||||
["IPlastic" ],
|
||||
["Solarized Light"],
|
||||
["TextMate" ],
|
||||
["Tomorrow" ],
|
||||
["XCode" ],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server" ,"sqlserver" , "light"],
|
||||
["Ambiance" ,"ambiance" , "dark"],
|
||||
["Chaos" ,"chaos" , "dark"],
|
||||
["Clouds Midnight" ,"clouds_midnight" , "dark"],
|
||||
["Dracula" ,"" , "dark"],
|
||||
["Cobalt" ,"cobalt" , "dark"],
|
||||
["Gruvbox" ,"gruvbox" , "dark"],
|
||||
["Green on Black" ,"gob" , "dark"],
|
||||
["idle Fingers" ,"idle_fingers" , "dark"],
|
||||
["krTheme" ,"kr_theme" , "dark"],
|
||||
["Merbivore" ,"merbivore" , "dark"],
|
||||
["Merbivore Soft" ,"merbivore_soft" , "dark"],
|
||||
["Mono Industrial" ,"mono_industrial" , "dark"],
|
||||
["Monokai" ,"monokai" , "dark"],
|
||||
["Pastel on dark" ,"pastel_on_dark" , "dark"],
|
||||
["Solarized Dark" ,"solarized_dark" , "dark"],
|
||||
["Terminal" ,"terminal" , "dark"],
|
||||
["Tomorrow Night" ,"tomorrow_night" , "dark"],
|
||||
["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"],
|
||||
["Tomorrow Night Bright","tomorrow_night_bright" , "dark"],
|
||||
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
|
||||
["Twilight" ,"twilight" , "dark"],
|
||||
["Vibrant Ink" ,"vibrant_ink" , "dark"]
|
||||
];
|
||||
|
||||
|
||||
exports.themesByName = {};
|
||||
exports.themes = themeData.map(function(data) {
|
||||
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
|
||||
var theme = {
|
||||
caption: data[0],
|
||||
theme: "ace/theme/" + name,
|
||||
isDark: data[2] == "dark",
|
||||
name: name
|
||||
};
|
||||
exports.themesByName[name] = theme;
|
||||
return theme;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
|
||||
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
var oop = require("../lib/oop");
|
||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||
var buildDom = dom.buildDom;
|
||||
|
||||
var modelist = require("./modelist");
|
||||
var themelist = require("./themelist");
|
||||
|
||||
var themes = { Bright: [], Dark: [] };
|
||||
themelist.themes.forEach(function(x) {
|
||||
themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
|
||||
});
|
||||
|
||||
var modes = modelist.modes.map(function(x){
|
||||
return { caption: x.caption, value: x.mode };
|
||||
});
|
||||
|
||||
|
||||
var optionGroups = {
|
||||
Main: {
|
||||
Mode: {
|
||||
path: "mode",
|
||||
type: "select",
|
||||
items: modes
|
||||
},
|
||||
Theme: {
|
||||
path: "theme",
|
||||
type: "select",
|
||||
items: themes
|
||||
},
|
||||
"Keybinding": {
|
||||
type: "buttonBar",
|
||||
path: "keyboardHandler",
|
||||
items: [
|
||||
{ caption : "Ace", value : null },
|
||||
{ caption : "Vim", value : "ace/keyboard/vim" },
|
||||
{ caption : "Emacs", value : "ace/keyboard/emacs" }
|
||||
]
|
||||
},
|
||||
"Font Size": {
|
||||
path: "fontSize",
|
||||
type: "number",
|
||||
defaultValue: 12,
|
||||
defaults: [
|
||||
{caption: "12px", value: 12},
|
||||
{caption: "24px", value: 24}
|
||||
]
|
||||
},
|
||||
"Soft Wrap": {
|
||||
type: "buttonBar",
|
||||
path: "wrap",
|
||||
items: [
|
||||
{ caption : "Off", value : "off" },
|
||||
{ caption : "View", value : "free" },
|
||||
{ caption : "margin", value : "printMargin" },
|
||||
{ caption : "40", value : "40" }
|
||||
]
|
||||
},
|
||||
"Cursor Style": {
|
||||
path: "cursorStyle",
|
||||
items: [
|
||||
{ caption : "Ace", value : "ace" },
|
||||
{ caption : "Slim", value : "slim" },
|
||||
{ caption : "Smooth", value : "smooth" },
|
||||
{ caption : "Smooth And Slim", value : "smooth slim" },
|
||||
{ caption : "Wide", value : "wide" }
|
||||
]
|
||||
},
|
||||
"Folding": {
|
||||
path: "foldStyle",
|
||||
items: [
|
||||
{ caption : "Manual", value : "manual" },
|
||||
{ caption : "Mark begin", value : "markbegin" },
|
||||
{ caption : "Mark begin and end", value : "markbeginend" }
|
||||
]
|
||||
},
|
||||
"Soft Tabs": [{
|
||||
path: "useSoftTabs"
|
||||
}, {
|
||||
path: "tabSize",
|
||||
type: "number",
|
||||
values: [2, 3, 4, 8, 16]
|
||||
}],
|
||||
"Overscroll": {
|
||||
type: "buttonBar",
|
||||
path: "scrollPastEnd",
|
||||
items: [
|
||||
{ caption : "None", value : 0 },
|
||||
{ caption : "Half", value : 0.5 },
|
||||
{ caption : "Full", value : 1 }
|
||||
]
|
||||
}
|
||||
},
|
||||
More: {
|
||||
"Atomic soft tabs": {
|
||||
path: "navigateWithinSoftTabs"
|
||||
},
|
||||
"Enable Behaviours": {
|
||||
path: "behavioursEnabled"
|
||||
},
|
||||
"Full Line Selection": {
|
||||
type: "checkbox",
|
||||
values: "text|line",
|
||||
path: "selectionStyle"
|
||||
},
|
||||
"Highlight Active Line": {
|
||||
path: "highlightActiveLine"
|
||||
},
|
||||
"Show Invisibles": {
|
||||
path: "showInvisibles"
|
||||
},
|
||||
"Show Indent Guides": {
|
||||
path: "displayIndentGuides"
|
||||
},
|
||||
"Persistent Scrollbar": [{
|
||||
path: "hScrollBarAlwaysVisible"
|
||||
}, {
|
||||
path: "vScrollBarAlwaysVisible"
|
||||
}],
|
||||
"Animate scrolling": {
|
||||
path: "animatedScroll"
|
||||
},
|
||||
"Show Gutter": {
|
||||
path: "showGutter"
|
||||
},
|
||||
"Show Line Numbers": {
|
||||
path: "showLineNumbers"
|
||||
},
|
||||
"Relative Line Numbers": {
|
||||
path: "relativeLineNumbers"
|
||||
},
|
||||
"Fixed Gutter Width": {
|
||||
path: "fixedWidthGutter"
|
||||
},
|
||||
"Show Print Margin": [{
|
||||
path: "showPrintMargin"
|
||||
}, {
|
||||
type: "number",
|
||||
path: "printMarginColumn"
|
||||
}],
|
||||
"Indented Soft Wrap": {
|
||||
path: "indentedSoftWrap"
|
||||
},
|
||||
"Highlight selected word": {
|
||||
path: "highlightSelectedWord"
|
||||
},
|
||||
"Fade Fold Widgets": {
|
||||
path: "fadeFoldWidgets"
|
||||
},
|
||||
"Use textarea for IME": {
|
||||
path: "useTextareaForIME"
|
||||
},
|
||||
"Merge Undo Deltas": {
|
||||
path: "mergeUndoDeltas",
|
||||
items: [
|
||||
{ caption : "Always", value : "always" },
|
||||
{ caption : "Never", value : "false" },
|
||||
{ caption : "Timed", value : "true" }
|
||||
]
|
||||
},
|
||||
"Elastic Tabstops": {
|
||||
path: "useElasticTabstops"
|
||||
},
|
||||
"Incremental Search": {
|
||||
path: "useIncrementalSearch"
|
||||
},
|
||||
"Read-only": {
|
||||
path: "readOnly"
|
||||
},
|
||||
"Copy without selection": {
|
||||
path: "copyWithEmptySelection"
|
||||
},
|
||||
"Live Autocompletion": {
|
||||
path: "enableLiveAutocompletion"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var OptionPanel = function(editor, element) {
|
||||
this.editor = editor;
|
||||
this.container = element || document.createElement("div");
|
||||
this.groups = [];
|
||||
this.options = {};
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.add = function(config) {
|
||||
if (config.Main)
|
||||
oop.mixin(optionGroups.Main, config.Main);
|
||||
if (config.More)
|
||||
oop.mixin(optionGroups.More, config.More);
|
||||
};
|
||||
|
||||
this.render = function() {
|
||||
this.container.innerHTML = "";
|
||||
buildDom(["table", {id: "controls"},
|
||||
this.renderOptionGroup(optionGroups.Main),
|
||||
["tr", null, ["td", {colspan: 2},
|
||||
["table", {id: "more-controls"},
|
||||
this.renderOptionGroup(optionGroups.More)
|
||||
]
|
||||
]]
|
||||
], this.container);
|
||||
};
|
||||
|
||||
this.renderOptionGroup = function(group) {
|
||||
return Object.keys(group).map(function(key, i) {
|
||||
var item = group[key];
|
||||
if (!item.position)
|
||||
item.position = i / 10000;
|
||||
if (!item.label)
|
||||
item.label = key;
|
||||
return item;
|
||||
}).sort(function(a, b) {
|
||||
return a.position - b.position;
|
||||
}).map(function(item) {
|
||||
return this.renderOption(item.label, item);
|
||||
}, this);
|
||||
};
|
||||
|
||||
this.renderOptionControl = function(key, option) {
|
||||
var self = this;
|
||||
if (Array.isArray(option)) {
|
||||
return option.map(function(x) {
|
||||
return self.renderOptionControl(key, x);
|
||||
});
|
||||
}
|
||||
var control;
|
||||
|
||||
var value = self.getOption(option);
|
||||
|
||||
if (option.values && option.type != "checkbox") {
|
||||
if (typeof option.values == "string")
|
||||
option.values = option.values.split("|");
|
||||
option.items = option.values.map(function(v) {
|
||||
return { value: v, name: v };
|
||||
});
|
||||
}
|
||||
|
||||
if (option.type == "buttonBar") {
|
||||
control = ["div", option.items.map(function(item) {
|
||||
return ["button", {
|
||||
value: item.value,
|
||||
ace_selected_button: value == item.value,
|
||||
onclick: function() {
|
||||
self.setOption(option, item.value);
|
||||
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
nodes[i].removeAttribute("ace_selected_button");
|
||||
}
|
||||
this.setAttribute("ace_selected_button", true);
|
||||
}
|
||||
}, item.desc || item.caption || item.name];
|
||||
})];
|
||||
} else if (option.type == "number") {
|
||||
control = ["input", {type: "number", value: value || option.defaultValue, style:"width:3em", oninput: function() {
|
||||
self.setOption(option, parseInt(this.value));
|
||||
}}];
|
||||
if (option.defaults) {
|
||||
control = [control, option.defaults.map(function(item) {
|
||||
return ["button", {onclick: function() {
|
||||
var input = this.parentNode.firstChild;
|
||||
input.value = item.value;
|
||||
input.oninput();
|
||||
}}, item.caption];
|
||||
})];
|
||||
}
|
||||
} else if (option.items) {
|
||||
var buildItems = function(items) {
|
||||
return items.map(function(item) {
|
||||
return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
|
||||
});
|
||||
};
|
||||
|
||||
var items = Array.isArray(option.items)
|
||||
? buildItems(option.items)
|
||||
: Object.keys(option.items).map(function(key) {
|
||||
return ["optgroup", {"label": key}, buildItems(option.items[key])];
|
||||
});
|
||||
control = ["select", { id: key, value: value, onchange: function() {
|
||||
self.setOption(option, this.value);
|
||||
} }, items];
|
||||
} else {
|
||||
if (typeof option.values == "string")
|
||||
option.values = option.values.split("|");
|
||||
if (option.values) value = value == option.values[1];
|
||||
control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function() {
|
||||
var value = this.checked;
|
||||
if (option.values) value = option.values[value ? 1 : 0];
|
||||
self.setOption(option, value);
|
||||
}}];
|
||||
if (option.type == "checkedNumber") {
|
||||
control = [control, []];
|
||||
}
|
||||
}
|
||||
return control;
|
||||
};
|
||||
|
||||
this.renderOption = function(key, option) {
|
||||
if (option.path && !option.onchange && !this.editor.$options[option.path])
|
||||
return;
|
||||
this.options[option.path] = option;
|
||||
var safeKey = "-" + option.path;
|
||||
var control = this.renderOptionControl(safeKey, option);
|
||||
return ["tr", {class: "ace_optionsMenuEntry"}, ["td",
|
||||
["label", {for: safeKey}, key]
|
||||
], ["td", control]];
|
||||
};
|
||||
|
||||
this.setOption = function(option, value) {
|
||||
if (typeof option == "string")
|
||||
option = this.options[option];
|
||||
if (value == "false") value = false;
|
||||
if (value == "true") value = true;
|
||||
if (value == "null") value = null;
|
||||
if (value == "undefined") value = undefined;
|
||||
if (typeof value == "string" && parseFloat(value).toString() == value)
|
||||
value = parseFloat(value);
|
||||
if (option.onchange)
|
||||
option.onchange(value);
|
||||
else if (option.path)
|
||||
this.editor.setOption(option.path, value);
|
||||
this._signal("setOption", {name: option.path, value: value});
|
||||
};
|
||||
|
||||
this.getOption = function(option) {
|
||||
if (option.getValue)
|
||||
return option.getValue();
|
||||
return this.editor.getOption(option.path);
|
||||
};
|
||||
|
||||
}).call(OptionPanel.prototype);
|
||||
|
||||
exports.OptionPanel = OptionPanel;
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/options"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,110 @@
|
||||
ace.define("ace/ext/rtl",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/editor","ace/config"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var dom = require("ace/lib/dom");
|
||||
var lang = require("ace/lib/lang");
|
||||
|
||||
var commands = [{
|
||||
name: "leftToRight",
|
||||
bindKey: { win: "Ctrl-Alt-Shift-L", mac: "Command-Alt-Shift-L" },
|
||||
exec: function(editor) {
|
||||
editor.session.$bidiHandler.setRtlDirection(editor, false);
|
||||
},
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "rightToLeft",
|
||||
bindKey: { win: "Ctrl-Alt-Shift-R", mac: "Command-Alt-Shift-R" },
|
||||
exec: function(editor) {
|
||||
editor.session.$bidiHandler.setRtlDirection(editor, true);
|
||||
},
|
||||
readOnly: true
|
||||
}];
|
||||
|
||||
var Editor = require("../editor").Editor;
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
rtlText: {
|
||||
set: function(val) {
|
||||
if (val) {
|
||||
this.on("session", onChange);
|
||||
this.on("changeSelection", onChangeSelection);
|
||||
this.renderer.on("afterRender", updateLineDirection);
|
||||
this.commands.on("exec", onCommandEmitted);
|
||||
this.commands.addCommands(commands);
|
||||
} else {
|
||||
this.off("session", onChange);
|
||||
this.off("changeSelection", onChangeSelection);
|
||||
this.renderer.off("afterRender", updateLineDirection);
|
||||
this.commands.off("exec", onCommandEmitted);
|
||||
this.commands.removeCommands(commands);
|
||||
clearTextLayer(this.renderer);
|
||||
}
|
||||
this.renderer.updateFull();
|
||||
}
|
||||
}
|
||||
});
|
||||
function onChangeSelection(e, editor) {
|
||||
var lead = editor.getSelection().lead;
|
||||
if (editor.session.$bidiHandler.isRtlLine(lead.row)) {
|
||||
if (lead.column === 0) {
|
||||
if (editor.session.$bidiHandler.isMoveLeftOperation && lead.row > 0) {
|
||||
editor.getSelection().moveCursorTo(lead.row - 1, editor.session.getLine(lead.row - 1).length);
|
||||
} else {
|
||||
if (editor.getSelection().isEmpty())
|
||||
lead.column += 1;
|
||||
else
|
||||
lead.setPosition(lead.row, lead.column + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onCommandEmitted(commadEvent) {
|
||||
commadEvent.editor.session.$bidiHandler.isMoveLeftOperation = /gotoleft|selectleft|backspace|removewordleft/.test(commadEvent.command.name);
|
||||
}
|
||||
function onChange(delta, session) {
|
||||
session.$bidiHandler.currentRow = null;
|
||||
if (session.$bidiHandler.isRtlLine(delta.start.row) && delta.action === 'insert' && delta.lines.length > 1) {
|
||||
for (var row = delta.start.row; row < delta.end.row; row++) {
|
||||
if (session.getLine(row + 1).charAt(0) !== session.$bidiHandler.RLE)
|
||||
session.getDocument().$lines[row + 1] = session.$bidiHandler.RLE + session.getLine(row + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateLineDirection(e, renderer) {
|
||||
var session = renderer.session;
|
||||
var $bidiHandler = session.$bidiHandler;
|
||||
var cells = renderer.$textLayer.$lines.cells;
|
||||
var width = renderer.layerConfig.width - renderer.layerConfig.padding + "px";
|
||||
cells.forEach(function(cell) {
|
||||
var style = cell.element.style;
|
||||
if ($bidiHandler && $bidiHandler.isRtlLine(cell.row)) {
|
||||
style.direction = "rtl";
|
||||
style.textAlign = "right";
|
||||
style.width = width;
|
||||
} else {
|
||||
style.direction = "";
|
||||
style.textAlign = "";
|
||||
style.width = "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clearTextLayer(renderer) {
|
||||
var lines = renderer.$textLayer.$lines;
|
||||
lines.cells.forEach(clear);
|
||||
lines.cellCache.forEach(clear);
|
||||
function clear(cell) {
|
||||
var style = cell.element.style;
|
||||
style.direction = style.textAlign = style.width = "";
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/rtl"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,512 @@
|
||||
ace.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) {
|
||||
"use strict";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
var lang = require("../lib/lang");
|
||||
var event = require("../lib/event");
|
||||
var searchboxCss = ".ace_search {\
|
||||
background-color: #ddd;\
|
||||
color: #666;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
border-top: 0 none;\
|
||||
overflow: hidden;\
|
||||
margin: 0;\
|
||||
padding: 4px 6px 0 4px;\
|
||||
position: absolute;\
|
||||
top: 0;\
|
||||
z-index: 99;\
|
||||
white-space: normal;\
|
||||
}\
|
||||
.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 {\
|
||||
margin: 0 20px 4px 0;\
|
||||
overflow: hidden;\
|
||||
line-height: 1.9;\
|
||||
}\
|
||||
.ace_replace_form {\
|
||||
margin-right: 0;\
|
||||
}\
|
||||
.ace_search_form.ace_nomatch {\
|
||||
outline: 1px solid red;\
|
||||
}\
|
||||
.ace_search_field {\
|
||||
border-radius: 3px 0 0 3px;\
|
||||
background-color: white;\
|
||||
color: black;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
border-right: 0 none;\
|
||||
outline: 0;\
|
||||
padding: 0;\
|
||||
font-size: inherit;\
|
||||
margin: 0;\
|
||||
line-height: inherit;\
|
||||
padding: 0 6px;\
|
||||
min-width: 17em;\
|
||||
vertical-align: top;\
|
||||
min-height: 1.8em;\
|
||||
box-sizing: content-box;\
|
||||
}\
|
||||
.ace_searchbtn {\
|
||||
border: 1px solid #cbcbcb;\
|
||||
line-height: inherit;\
|
||||
display: inline-block;\
|
||||
padding: 0 6px;\
|
||||
background: #fff;\
|
||||
border-right: 0 none;\
|
||||
border-left: 1px solid #dcdcdc;\
|
||||
cursor: pointer;\
|
||||
margin: 0;\
|
||||
position: relative;\
|
||||
color: #666;\
|
||||
}\
|
||||
.ace_searchbtn:last-child {\
|
||||
border-radius: 0 3px 3px 0;\
|
||||
border-right: 1px solid #cbcbcb;\
|
||||
}\
|
||||
.ace_searchbtn:disabled {\
|
||||
background: none;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_searchbtn:hover {\
|
||||
background-color: #eef1f6;\
|
||||
}\
|
||||
.ace_searchbtn.prev, .ace_searchbtn.next {\
|
||||
padding: 0px 0.7em\
|
||||
}\
|
||||
.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\
|
||||
content: \"\";\
|
||||
border: solid 2px #888;\
|
||||
width: 0.5em;\
|
||||
height: 0.5em;\
|
||||
border-width: 2px 0 0 2px;\
|
||||
display:inline-block;\
|
||||
transform: rotate(-45deg);\
|
||||
}\
|
||||
.ace_searchbtn.next:after {\
|
||||
border-width: 0 2px 2px 0 ;\
|
||||
}\
|
||||
.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;\
|
||||
font: 16px/16px Arial;\
|
||||
padding: 0;\
|
||||
height: 14px;\
|
||||
width: 14px;\
|
||||
top: 9px;\
|
||||
right: 7px;\
|
||||
position: absolute;\
|
||||
}\
|
||||
.ace_searchbtn_close:hover {\
|
||||
background-color: #656565;\
|
||||
background-position: 50% 100%;\
|
||||
color: white;\
|
||||
}\
|
||||
.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;\
|
||||
box-sizing: border-box!important;\
|
||||
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;\
|
||||
clear: both;\
|
||||
}\
|
||||
.ace_search_counter {\
|
||||
float: left;\
|
||||
font-family: arial;\
|
||||
padding: 0 8px;\
|
||||
}";
|
||||
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
||||
var keyUtil = require("../lib/keys");
|
||||
|
||||
var MAX_COUNT = 999;
|
||||
|
||||
dom.importCssString(searchboxCss, "ace_searchbox");
|
||||
|
||||
var html = '<div class="ace_search right">\
|
||||
<span action="hide" class="ace_searchbtn_close"></span>\
|
||||
<div class="ace_search_form">\
|
||||
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
|
||||
<span action="findPrev" class="ace_searchbtn prev"></span>\
|
||||
<span action="findNext" class="ace_searchbtn next"></span>\
|
||||
<span action="findAll" class="ace_searchbtn" title="Alt-Enter">All</span>\
|
||||
</div>\
|
||||
<div class="ace_replace_form">\
|
||||
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
|
||||
<span action="replaceAndFindNext" class="ace_searchbtn">Replace</span>\
|
||||
<span action="replaceAll" class="ace_searchbtn">All</span>\
|
||||
</div>\
|
||||
<div class="ace_search_options">\
|
||||
<span action="toggleReplace" class="ace_button" title="Toggle Replace mode"\
|
||||
style="float:left;margin-top:-2px;padding:0 5px;">+</span>\
|
||||
<span class="ace_search_counter"></span>\
|
||||
<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>\
|
||||
<span action="searchInSelection" class="ace_button" title="Search In Selection">S</span>\
|
||||
</div>\
|
||||
</div>'.replace(/> +/g, ">");
|
||||
|
||||
var SearchBox = function(editor, range, showReplaceForm) {
|
||||
var div = dom.createElement("div");
|
||||
div.innerHTML = html;
|
||||
this.element = div.firstChild;
|
||||
|
||||
this.setSession = this.setSession.bind(this);
|
||||
|
||||
this.$init();
|
||||
this.setEditor(editor);
|
||||
dom.importCssString(searchboxCss, "ace_searchbox", editor.container);
|
||||
};
|
||||
|
||||
(function() {
|
||||
this.setEditor = function(editor) {
|
||||
editor.searchBox = this;
|
||||
editor.renderer.scroller.appendChild(this.element);
|
||||
this.editor = editor;
|
||||
};
|
||||
|
||||
this.setSession = function(e) {
|
||||
this.searchRange = null;
|
||||
this.$syncOptions(true);
|
||||
};
|
||||
|
||||
this.$initElements = function(sb) {
|
||||
this.searchBox = sb.querySelector(".ace_search_form");
|
||||
this.replaceBox = sb.querySelector(".ace_replace_form");
|
||||
this.searchOption = sb.querySelector("[action=searchInSelection]");
|
||||
this.replaceOption = sb.querySelector("[action=toggleReplace]");
|
||||
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");
|
||||
this.searchCounter = sb.querySelector(".ace_search_counter");
|
||||
};
|
||||
|
||||
this.$init = function() {
|
||||
var sb = this.element;
|
||||
|
||||
this.$initElements(sb);
|
||||
|
||||
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 || e.srcElement;
|
||||
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": function(sb) {
|
||||
var isReplace = sb.isReplace = !sb.isReplace;
|
||||
sb.replaceBox.style.display = isReplace ? "" : "none";
|
||||
sb.replaceOption.checked = false;
|
||||
sb.$syncOptions();
|
||||
sb.searchInput.focus();
|
||||
},
|
||||
"Ctrl-H|Command-Option-F": function(sb) {
|
||||
sb.replaceOption.checked = true;
|
||||
sb.$syncOptions();
|
||||
sb.replaceInput.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();
|
||||
},
|
||||
"Alt-Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replaceAll();
|
||||
sb.findAll();
|
||||
},
|
||||
"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();
|
||||
}
|
||||
}, {
|
||||
name: "toggleReplace",
|
||||
exec: function(sb) {
|
||||
sb.replaceOption.checked = !sb.replaceOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}, {
|
||||
name: "searchInSelection",
|
||||
exec: function(sb) {
|
||||
sb.searchOption.checked = !sb.searchRange;
|
||||
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}]);
|
||||
|
||||
this.setSearchRange = function(range) {
|
||||
this.searchRange = range;
|
||||
if (range) {
|
||||
this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line");
|
||||
} else if (this.searchRangeMarker) {
|
||||
this.editor.session.removeMarker(this.searchRangeMarker);
|
||||
this.searchRangeMarker = null;
|
||||
}
|
||||
};
|
||||
|
||||
this.$syncOptions = function(preventScroll) {
|
||||
dom.setCssClass(this.replaceOption, "checked", this.searchRange);
|
||||
dom.setCssClass(this.searchOption, "checked", this.searchOption.checked);
|
||||
this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+";
|
||||
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.replaceBox.style.display = this.replaceOption.checked ? "" : "none";
|
||||
this.find(false, false, preventScroll);
|
||||
};
|
||||
|
||||
this.highlight = function(re) {
|
||||
this.editor.session.highlight(re || this.editor.$search.$options.re);
|
||||
this.editor.renderer.updateBackMarkers();
|
||||
};
|
||||
this.find = function(skipCurrent, backwards, preventScroll) {
|
||||
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,
|
||||
preventScroll: preventScroll,
|
||||
range: this.searchRange
|
||||
});
|
||||
var noMatch = !range && this.searchInput.value;
|
||||
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
|
||||
this.editor._emit("findSearchBox", { match: !noMatch });
|
||||
this.highlight();
|
||||
this.updateCounter();
|
||||
};
|
||||
this.updateCounter = function() {
|
||||
var editor = this.editor;
|
||||
var regex = editor.$search.$options.re;
|
||||
var all = 0;
|
||||
var before = 0;
|
||||
if (regex) {
|
||||
var value = this.searchRange
|
||||
? editor.session.getTextRange(this.searchRange)
|
||||
: editor.getValue();
|
||||
|
||||
var offset = editor.session.doc.positionToIndex(editor.selection.anchor);
|
||||
if (this.searchRange)
|
||||
offset -= editor.session.doc.positionToIndex(this.searchRange.start);
|
||||
|
||||
var last = regex.lastIndex = 0;
|
||||
var m;
|
||||
while ((m = regex.exec(value))) {
|
||||
all++;
|
||||
last = m.index;
|
||||
if (last <= offset)
|
||||
before++;
|
||||
if (all > MAX_COUNT)
|
||||
break;
|
||||
if (!m[0]) {
|
||||
regex.lastIndex = last += 1;
|
||||
if (last >= value.length)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.searchCounter.textContent = before + " of " + (all > MAX_COUNT ? MAX_COUNT + "+" : all);
|
||||
};
|
||||
this.findNext = function() {
|
||||
this.find(true, false);
|
||||
};
|
||||
this.findPrev = function() {
|
||||
this.find(true, true);
|
||||
};
|
||||
this.findAll = function(){
|
||||
var range = this.editor.findAll(this.searchInput.value, {
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked
|
||||
});
|
||||
var noMatch = !range && this.searchInput.value;
|
||||
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
|
||||
this.editor._emit("findSearchBox", { match: !noMatch });
|
||||
this.highlight();
|
||||
this.hide();
|
||||
};
|
||||
this.replace = function() {
|
||||
if (!this.editor.getReadOnly())
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
};
|
||||
this.replaceAndFindNext = function() {
|
||||
if (!this.editor.getReadOnly()) {
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
this.findNext();
|
||||
}
|
||||
};
|
||||
this.replaceAll = function() {
|
||||
if (!this.editor.getReadOnly())
|
||||
this.editor.replaceAll(this.replaceInput.value);
|
||||
};
|
||||
|
||||
this.hide = function() {
|
||||
this.active = false;
|
||||
this.setSearchRange(null);
|
||||
this.editor.off("changeSession", this.setSession);
|
||||
|
||||
this.element.style.display = "none";
|
||||
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
|
||||
this.editor.focus();
|
||||
};
|
||||
this.show = function(value, isReplace) {
|
||||
this.active = true;
|
||||
this.editor.on("changeSession", this.setSession);
|
||||
this.element.style.display = "";
|
||||
this.replaceOption.checked = isReplace;
|
||||
|
||||
if (value)
|
||||
this.searchInput.value = value;
|
||||
|
||||
this.searchInput.focus();
|
||||
this.searchInput.select();
|
||||
|
||||
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
|
||||
|
||||
this.$syncOptions(true);
|
||||
};
|
||||
|
||||
this.isFocused = function() {
|
||||
var el = document.activeElement;
|
||||
return el == this.searchInput || el == this.replaceInput;
|
||||
};
|
||||
}).call(SearchBox.prototype);
|
||||
|
||||
exports.SearchBox = SearchBox;
|
||||
|
||||
exports.Search = function(editor, isReplace) {
|
||||
var sb = editor.searchBox || new SearchBox(editor);
|
||||
sb.show(editor.session.getTextRange(), isReplace);
|
||||
};
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/searchbox"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,771 @@
|
||||
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
||||
'use strict';
|
||||
var dom = require("../../lib/dom");
|
||||
var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
|
||||
background-color: #F7F7F7;\
|
||||
color: black;\
|
||||
box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
|
||||
padding: 1em 0.5em 2em 1em;\
|
||||
overflow: auto;\
|
||||
position: absolute;\
|
||||
margin: 0;\
|
||||
bottom: 0;\
|
||||
right: 0;\
|
||||
top: 0;\
|
||||
z-index: 9991;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
|
||||
box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
|
||||
background-color: rgba(255, 255, 255, 0.6);\
|
||||
color: black;\
|
||||
}\
|
||||
.ace_optionsMenuEntry:hover {\
|
||||
background-color: rgba(100, 100, 100, 0.1);\
|
||||
transition: all 0.3s\
|
||||
}\
|
||||
.ace_closeButton {\
|
||||
background: rgba(245, 146, 146, 0.5);\
|
||||
border: 1px solid #F48A8A;\
|
||||
border-radius: 50%;\
|
||||
padding: 7px;\
|
||||
position: absolute;\
|
||||
right: -8px;\
|
||||
top: -8px;\
|
||||
z-index: 100000;\
|
||||
}\
|
||||
.ace_closeButton{\
|
||||
background: rgba(245, 146, 146, 0.9);\
|
||||
}\
|
||||
.ace_optionsMenuKey {\
|
||||
color: darkslateblue;\
|
||||
font-weight: bold;\
|
||||
}\
|
||||
.ace_optionsMenuCommand {\
|
||||
color: darkcyan;\
|
||||
font-weight: normal;\
|
||||
}\
|
||||
.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\
|
||||
vertical-align: middle;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button[ace_selected_button=true] {\
|
||||
background: #e7e7e7;\
|
||||
box-shadow: 1px 0px 2px 0px #adadad inset;\
|
||||
border-color: #adadad;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button {\
|
||||
background: white;\
|
||||
border: 1px solid lightgray;\
|
||||
margin: 0px;\
|
||||
}\
|
||||
.ace_optionsMenuEntry button:hover{\
|
||||
background: #f0f0f0;\
|
||||
}";
|
||||
dom.importCssString(cssText);
|
||||
module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
|
||||
top = top ? 'top: ' + top + ';' : '';
|
||||
bottom = bottom ? 'bottom: ' + bottom + ';' : '';
|
||||
right = right ? 'right: ' + right + ';' : '';
|
||||
left = left ? 'left: ' + left + ';' : '';
|
||||
|
||||
var closer = document.createElement('div');
|
||||
var contentContainer = document.createElement('div');
|
||||
|
||||
function documentEscListener(e) {
|
||||
if (e.keyCode === 27) {
|
||||
closer.click();
|
||||
}
|
||||
}
|
||||
|
||||
closer.style.cssText = 'margin: 0; padding: 0; ' +
|
||||
'position: fixed; top:0; bottom:0; left:0; right:0;' +
|
||||
'z-index: 9990; ' +
|
||||
'background-color: rgba(0, 0, 0, 0.3);';
|
||||
closer.addEventListener('click', function() {
|
||||
document.removeEventListener('keydown', documentEscListener);
|
||||
closer.parentNode.removeChild(closer);
|
||||
editor.focus();
|
||||
closer = null;
|
||||
});
|
||||
document.addEventListener('keydown', documentEscListener);
|
||||
|
||||
contentContainer.style.cssText = top + right + bottom + left;
|
||||
contentContainer.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
var wrapper = dom.createElement("div");
|
||||
wrapper.style.position = "relative";
|
||||
|
||||
var closeButton = dom.createElement("div");
|
||||
closeButton.className = "ace_closeButton";
|
||||
closeButton.addEventListener('click', function() {
|
||||
closer.click();
|
||||
});
|
||||
|
||||
wrapper.appendChild(closeButton);
|
||||
contentContainer.appendChild(wrapper);
|
||||
|
||||
contentContainer.appendChild(contentElement);
|
||||
closer.appendChild(contentContainer);
|
||||
document.body.appendChild(closer);
|
||||
editor.blur();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var modes = [];
|
||||
function getModeForPath(path) {
|
||||
var mode = modesByName.text;
|
||||
var fileName = path.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < modes.length; i++) {
|
||||
if (modes[i].supportsFile(fileName)) {
|
||||
mode = modes[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
var Mode = function(name, caption, extensions) {
|
||||
this.name = name;
|
||||
this.caption = caption;
|
||||
this.mode = "ace/mode/" + name;
|
||||
this.extensions = extensions;
|
||||
var re;
|
||||
if (/\^/.test(extensions)) {
|
||||
re = extensions.replace(/\|(\^)?/g, function(a, b){
|
||||
return "$|" + (b ? "^" : "^.*\\.");
|
||||
}) + "$";
|
||||
} else {
|
||||
re = "^.*\\.(" + extensions + ")$";
|
||||
}
|
||||
|
||||
this.extRe = new RegExp(re, "gi");
|
||||
};
|
||||
|
||||
Mode.prototype.supportsFile = function(filename) {
|
||||
return filename.match(this.extRe);
|
||||
};
|
||||
var supportedModes = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript:["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl"],
|
||||
Assembly_x86:["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
Bro: ["bro"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx"],
|
||||
JSON: ["json"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
LogiQL: ["logic|lql"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MEL: ["mel"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Puppet: ["epp|pp"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Python: ["py"],
|
||||
R: ["r"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template:["soy"],
|
||||
Space: ["space"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Django: ["html"]
|
||||
};
|
||||
|
||||
var nameOverrides = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)"
|
||||
};
|
||||
var modesByName = {};
|
||||
for (var name in supportedModes) {
|
||||
var data = supportedModes[name];
|
||||
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
|
||||
var filename = name.toLowerCase();
|
||||
var mode = new Mode(filename, displayName, data[0]);
|
||||
modesByName[filename] = mode;
|
||||
modes.push(mode);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getModeForPath: getModeForPath,
|
||||
modes: modes,
|
||||
modesByName: modesByName
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
|
||||
"use strict";
|
||||
require("ace/lib/fixoldbrowsers");
|
||||
|
||||
var themeData = [
|
||||
["Chrome" ],
|
||||
["Clouds" ],
|
||||
["Crimson Editor" ],
|
||||
["Dawn" ],
|
||||
["Dreamweaver" ],
|
||||
["Eclipse" ],
|
||||
["GitHub" ],
|
||||
["IPlastic" ],
|
||||
["Solarized Light"],
|
||||
["TextMate" ],
|
||||
["Tomorrow" ],
|
||||
["XCode" ],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server" ,"sqlserver" , "light"],
|
||||
["Ambiance" ,"ambiance" , "dark"],
|
||||
["Chaos" ,"chaos" , "dark"],
|
||||
["Clouds Midnight" ,"clouds_midnight" , "dark"],
|
||||
["Dracula" ,"" , "dark"],
|
||||
["Cobalt" ,"cobalt" , "dark"],
|
||||
["Gruvbox" ,"gruvbox" , "dark"],
|
||||
["Green on Black" ,"gob" , "dark"],
|
||||
["idle Fingers" ,"idle_fingers" , "dark"],
|
||||
["krTheme" ,"kr_theme" , "dark"],
|
||||
["Merbivore" ,"merbivore" , "dark"],
|
||||
["Merbivore Soft" ,"merbivore_soft" , "dark"],
|
||||
["Mono Industrial" ,"mono_industrial" , "dark"],
|
||||
["Monokai" ,"monokai" , "dark"],
|
||||
["Pastel on dark" ,"pastel_on_dark" , "dark"],
|
||||
["Solarized Dark" ,"solarized_dark" , "dark"],
|
||||
["Terminal" ,"terminal" , "dark"],
|
||||
["Tomorrow Night" ,"tomorrow_night" , "dark"],
|
||||
["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"],
|
||||
["Tomorrow Night Bright","tomorrow_night_bright" , "dark"],
|
||||
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
|
||||
["Twilight" ,"twilight" , "dark"],
|
||||
["Vibrant Ink" ,"vibrant_ink" , "dark"]
|
||||
];
|
||||
|
||||
|
||||
exports.themesByName = {};
|
||||
exports.themes = themeData.map(function(data) {
|
||||
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
|
||||
var theme = {
|
||||
caption: data[0],
|
||||
theme: "ace/theme/" + name,
|
||||
isDark: data[2] == "dark",
|
||||
name: name
|
||||
};
|
||||
exports.themesByName[name] = theme;
|
||||
return theme;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
|
||||
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
var oop = require("../lib/oop");
|
||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||
var buildDom = dom.buildDom;
|
||||
|
||||
var modelist = require("./modelist");
|
||||
var themelist = require("./themelist");
|
||||
|
||||
var themes = { Bright: [], Dark: [] };
|
||||
themelist.themes.forEach(function(x) {
|
||||
themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
|
||||
});
|
||||
|
||||
var modes = modelist.modes.map(function(x){
|
||||
return { caption: x.caption, value: x.mode };
|
||||
});
|
||||
|
||||
|
||||
var optionGroups = {
|
||||
Main: {
|
||||
Mode: {
|
||||
path: "mode",
|
||||
type: "select",
|
||||
items: modes
|
||||
},
|
||||
Theme: {
|
||||
path: "theme",
|
||||
type: "select",
|
||||
items: themes
|
||||
},
|
||||
"Keybinding": {
|
||||
type: "buttonBar",
|
||||
path: "keyboardHandler",
|
||||
items: [
|
||||
{ caption : "Ace", value : null },
|
||||
{ caption : "Vim", value : "ace/keyboard/vim" },
|
||||
{ caption : "Emacs", value : "ace/keyboard/emacs" }
|
||||
]
|
||||
},
|
||||
"Font Size": {
|
||||
path: "fontSize",
|
||||
type: "number",
|
||||
defaultValue: 12,
|
||||
defaults: [
|
||||
{caption: "12px", value: 12},
|
||||
{caption: "24px", value: 24}
|
||||
]
|
||||
},
|
||||
"Soft Wrap": {
|
||||
type: "buttonBar",
|
||||
path: "wrap",
|
||||
items: [
|
||||
{ caption : "Off", value : "off" },
|
||||
{ caption : "View", value : "free" },
|
||||
{ caption : "margin", value : "printMargin" },
|
||||
{ caption : "40", value : "40" }
|
||||
]
|
||||
},
|
||||
"Cursor Style": {
|
||||
path: "cursorStyle",
|
||||
items: [
|
||||
{ caption : "Ace", value : "ace" },
|
||||
{ caption : "Slim", value : "slim" },
|
||||
{ caption : "Smooth", value : "smooth" },
|
||||
{ caption : "Smooth And Slim", value : "smooth slim" },
|
||||
{ caption : "Wide", value : "wide" }
|
||||
]
|
||||
},
|
||||
"Folding": {
|
||||
path: "foldStyle",
|
||||
items: [
|
||||
{ caption : "Manual", value : "manual" },
|
||||
{ caption : "Mark begin", value : "markbegin" },
|
||||
{ caption : "Mark begin and end", value : "markbeginend" }
|
||||
]
|
||||
},
|
||||
"Soft Tabs": [{
|
||||
path: "useSoftTabs"
|
||||
}, {
|
||||
path: "tabSize",
|
||||
type: "number",
|
||||
values: [2, 3, 4, 8, 16]
|
||||
}],
|
||||
"Overscroll": {
|
||||
type: "buttonBar",
|
||||
path: "scrollPastEnd",
|
||||
items: [
|
||||
{ caption : "None", value : 0 },
|
||||
{ caption : "Half", value : 0.5 },
|
||||
{ caption : "Full", value : 1 }
|
||||
]
|
||||
}
|
||||
},
|
||||
More: {
|
||||
"Atomic soft tabs": {
|
||||
path: "navigateWithinSoftTabs"
|
||||
},
|
||||
"Enable Behaviours": {
|
||||
path: "behavioursEnabled"
|
||||
},
|
||||
"Full Line Selection": {
|
||||
type: "checkbox",
|
||||
values: "text|line",
|
||||
path: "selectionStyle"
|
||||
},
|
||||
"Highlight Active Line": {
|
||||
path: "highlightActiveLine"
|
||||
},
|
||||
"Show Invisibles": {
|
||||
path: "showInvisibles"
|
||||
},
|
||||
"Show Indent Guides": {
|
||||
path: "displayIndentGuides"
|
||||
},
|
||||
"Persistent Scrollbar": [{
|
||||
path: "hScrollBarAlwaysVisible"
|
||||
}, {
|
||||
path: "vScrollBarAlwaysVisible"
|
||||
}],
|
||||
"Animate scrolling": {
|
||||
path: "animatedScroll"
|
||||
},
|
||||
"Show Gutter": {
|
||||
path: "showGutter"
|
||||
},
|
||||
"Show Line Numbers": {
|
||||
path: "showLineNumbers"
|
||||
},
|
||||
"Relative Line Numbers": {
|
||||
path: "relativeLineNumbers"
|
||||
},
|
||||
"Fixed Gutter Width": {
|
||||
path: "fixedWidthGutter"
|
||||
},
|
||||
"Show Print Margin": [{
|
||||
path: "showPrintMargin"
|
||||
}, {
|
||||
type: "number",
|
||||
path: "printMarginColumn"
|
||||
}],
|
||||
"Indented Soft Wrap": {
|
||||
path: "indentedSoftWrap"
|
||||
},
|
||||
"Highlight selected word": {
|
||||
path: "highlightSelectedWord"
|
||||
},
|
||||
"Fade Fold Widgets": {
|
||||
path: "fadeFoldWidgets"
|
||||
},
|
||||
"Use textarea for IME": {
|
||||
path: "useTextareaForIME"
|
||||
},
|
||||
"Merge Undo Deltas": {
|
||||
path: "mergeUndoDeltas",
|
||||
items: [
|
||||
{ caption : "Always", value : "always" },
|
||||
{ caption : "Never", value : "false" },
|
||||
{ caption : "Timed", value : "true" }
|
||||
]
|
||||
},
|
||||
"Elastic Tabstops": {
|
||||
path: "useElasticTabstops"
|
||||
},
|
||||
"Incremental Search": {
|
||||
path: "useIncrementalSearch"
|
||||
},
|
||||
"Read-only": {
|
||||
path: "readOnly"
|
||||
},
|
||||
"Copy without selection": {
|
||||
path: "copyWithEmptySelection"
|
||||
},
|
||||
"Live Autocompletion": {
|
||||
path: "enableLiveAutocompletion"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var OptionPanel = function(editor, element) {
|
||||
this.editor = editor;
|
||||
this.container = element || document.createElement("div");
|
||||
this.groups = [];
|
||||
this.options = {};
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.add = function(config) {
|
||||
if (config.Main)
|
||||
oop.mixin(optionGroups.Main, config.Main);
|
||||
if (config.More)
|
||||
oop.mixin(optionGroups.More, config.More);
|
||||
};
|
||||
|
||||
this.render = function() {
|
||||
this.container.innerHTML = "";
|
||||
buildDom(["table", {id: "controls"},
|
||||
this.renderOptionGroup(optionGroups.Main),
|
||||
["tr", null, ["td", {colspan: 2},
|
||||
["table", {id: "more-controls"},
|
||||
this.renderOptionGroup(optionGroups.More)
|
||||
]
|
||||
]]
|
||||
], this.container);
|
||||
};
|
||||
|
||||
this.renderOptionGroup = function(group) {
|
||||
return Object.keys(group).map(function(key, i) {
|
||||
var item = group[key];
|
||||
if (!item.position)
|
||||
item.position = i / 10000;
|
||||
if (!item.label)
|
||||
item.label = key;
|
||||
return item;
|
||||
}).sort(function(a, b) {
|
||||
return a.position - b.position;
|
||||
}).map(function(item) {
|
||||
return this.renderOption(item.label, item);
|
||||
}, this);
|
||||
};
|
||||
|
||||
this.renderOptionControl = function(key, option) {
|
||||
var self = this;
|
||||
if (Array.isArray(option)) {
|
||||
return option.map(function(x) {
|
||||
return self.renderOptionControl(key, x);
|
||||
});
|
||||
}
|
||||
var control;
|
||||
|
||||
var value = self.getOption(option);
|
||||
|
||||
if (option.values && option.type != "checkbox") {
|
||||
if (typeof option.values == "string")
|
||||
option.values = option.values.split("|");
|
||||
option.items = option.values.map(function(v) {
|
||||
return { value: v, name: v };
|
||||
});
|
||||
}
|
||||
|
||||
if (option.type == "buttonBar") {
|
||||
control = ["div", option.items.map(function(item) {
|
||||
return ["button", {
|
||||
value: item.value,
|
||||
ace_selected_button: value == item.value,
|
||||
onclick: function() {
|
||||
self.setOption(option, item.value);
|
||||
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
nodes[i].removeAttribute("ace_selected_button");
|
||||
}
|
||||
this.setAttribute("ace_selected_button", true);
|
||||
}
|
||||
}, item.desc || item.caption || item.name];
|
||||
})];
|
||||
} else if (option.type == "number") {
|
||||
control = ["input", {type: "number", value: value || option.defaultValue, style:"width:3em", oninput: function() {
|
||||
self.setOption(option, parseInt(this.value));
|
||||
}}];
|
||||
if (option.defaults) {
|
||||
control = [control, option.defaults.map(function(item) {
|
||||
return ["button", {onclick: function() {
|
||||
var input = this.parentNode.firstChild;
|
||||
input.value = item.value;
|
||||
input.oninput();
|
||||
}}, item.caption];
|
||||
})];
|
||||
}
|
||||
} else if (option.items) {
|
||||
var buildItems = function(items) {
|
||||
return items.map(function(item) {
|
||||
return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
|
||||
});
|
||||
};
|
||||
|
||||
var items = Array.isArray(option.items)
|
||||
? buildItems(option.items)
|
||||
: Object.keys(option.items).map(function(key) {
|
||||
return ["optgroup", {"label": key}, buildItems(option.items[key])];
|
||||
});
|
||||
control = ["select", { id: key, value: value, onchange: function() {
|
||||
self.setOption(option, this.value);
|
||||
} }, items];
|
||||
} else {
|
||||
if (typeof option.values == "string")
|
||||
option.values = option.values.split("|");
|
||||
if (option.values) value = value == option.values[1];
|
||||
control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function() {
|
||||
var value = this.checked;
|
||||
if (option.values) value = option.values[value ? 1 : 0];
|
||||
self.setOption(option, value);
|
||||
}}];
|
||||
if (option.type == "checkedNumber") {
|
||||
control = [control, []];
|
||||
}
|
||||
}
|
||||
return control;
|
||||
};
|
||||
|
||||
this.renderOption = function(key, option) {
|
||||
if (option.path && !option.onchange && !this.editor.$options[option.path])
|
||||
return;
|
||||
this.options[option.path] = option;
|
||||
var safeKey = "-" + option.path;
|
||||
var control = this.renderOptionControl(safeKey, option);
|
||||
return ["tr", {class: "ace_optionsMenuEntry"}, ["td",
|
||||
["label", {for: safeKey}, key]
|
||||
], ["td", control]];
|
||||
};
|
||||
|
||||
this.setOption = function(option, value) {
|
||||
if (typeof option == "string")
|
||||
option = this.options[option];
|
||||
if (value == "false") value = false;
|
||||
if (value == "true") value = true;
|
||||
if (value == "null") value = null;
|
||||
if (value == "undefined") value = undefined;
|
||||
if (typeof value == "string" && parseFloat(value).toString() == value)
|
||||
value = parseFloat(value);
|
||||
if (option.onchange)
|
||||
option.onchange(value);
|
||||
else if (option.path)
|
||||
this.editor.setOption(option.path, value);
|
||||
this._signal("setOption", {name: option.path, value: value});
|
||||
};
|
||||
|
||||
this.getOption = function(option) {
|
||||
if (option.getValue)
|
||||
return option.getValue();
|
||||
return this.editor.getOption(option.path);
|
||||
};
|
||||
|
||||
}).call(OptionPanel.prototype);
|
||||
|
||||
exports.OptionPanel = OptionPanel;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/options","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var OptionPanel = require("ace/ext/options").OptionPanel;
|
||||
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
|
||||
function showSettingsMenu(editor) {
|
||||
if (!document.getElementById('ace_settingsmenu')) {
|
||||
var options = new OptionPanel(editor);
|
||||
options.render();
|
||||
options.container.id = "ace_settingsmenu";
|
||||
overlayPage(editor, options.container, '0', '0', '0');
|
||||
options.container.querySelector("select,input,button,checkbox").focus();
|
||||
}
|
||||
}
|
||||
module.exports.init = function(editor) {
|
||||
var Editor = require("ace/editor").Editor;
|
||||
Editor.prototype.showSettingsMenu = function() {
|
||||
showSettingsMenu(this);
|
||||
};
|
||||
};
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/settings_menu"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,75 @@
|
||||
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var event = require("../lib/event");
|
||||
|
||||
exports.contextMenuHandler = function(e){
|
||||
var host = e.target;
|
||||
var text = host.textInput.getElement();
|
||||
if (!host.selection.isEmpty())
|
||||
return;
|
||||
var c = host.getCursorPosition();
|
||||
var r = host.session.getWordRange(c.row, c.column);
|
||||
var w = host.session.getTextRange(r);
|
||||
|
||||
host.session.tokenRe.lastIndex = 0;
|
||||
if (!host.session.tokenRe.test(w))
|
||||
return;
|
||||
var PLACEHOLDER = "\x01\x01";
|
||||
var value = w + " " + PLACEHOLDER;
|
||||
text.value = value;
|
||||
text.setSelectionRange(w.length, w.length + 1);
|
||||
text.setSelectionRange(0, 0);
|
||||
text.setSelectionRange(0, w.length);
|
||||
|
||||
var afterKeydown = false;
|
||||
event.addListener(text, "keydown", function onKeydown() {
|
||||
event.removeListener(text, "keydown", onKeydown);
|
||||
afterKeydown = true;
|
||||
});
|
||||
|
||||
host.textInput.setInputHandler(function(newVal) {
|
||||
console.log(newVal , value, text.selectionStart, text.selectionEnd);
|
||||
if (newVal == value)
|
||||
return '';
|
||||
if (newVal.lastIndexOf(value, 0) === 0)
|
||||
return newVal.slice(value.length);
|
||||
if (newVal.substr(text.selectionEnd) == value)
|
||||
return newVal.slice(0, -value.length);
|
||||
if (newVal.slice(-2) == PLACEHOLDER) {
|
||||
var val = newVal.slice(0, -2);
|
||||
if (val.slice(-1) == " ") {
|
||||
if (afterKeydown)
|
||||
return val.substring(0, text.selectionEnd);
|
||||
val = val.slice(0, -1);
|
||||
host.session.replace(r, val);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return newVal;
|
||||
});
|
||||
};
|
||||
var Editor = require("../editor").Editor;
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
spellcheck: {
|
||||
set: function(val) {
|
||||
var text = this.textInput.getElement();
|
||||
text.spellcheck = !!val;
|
||||
if (!val)
|
||||
this.removeListener("nativecontextmenu", exports.contextMenuHandler);
|
||||
else
|
||||
this.on("nativecontextmenu", exports.contextMenuHandler);
|
||||
},
|
||||
value: true
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/spellcheck"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,208 @@
|
||||
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("./lib/oop");
|
||||
var lang = require("./lib/lang");
|
||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||
|
||||
var Editor = require("./editor").Editor;
|
||||
var Renderer = require("./virtual_renderer").VirtualRenderer;
|
||||
var EditSession = require("./edit_session").EditSession;
|
||||
|
||||
|
||||
var Split = function(container, theme, splits) {
|
||||
this.BELOW = 1;
|
||||
this.BESIDE = 0;
|
||||
|
||||
this.$container = container;
|
||||
this.$theme = theme;
|
||||
this.$splits = 0;
|
||||
this.$editorCSS = "";
|
||||
this.$editors = [];
|
||||
this.$orientation = this.BESIDE;
|
||||
|
||||
this.setSplits(splits || 1);
|
||||
this.$cEditor = this.$editors[0];
|
||||
|
||||
|
||||
this.on("focus", function(editor) {
|
||||
this.$cEditor = editor;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
(function(){
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.$createEditor = function() {
|
||||
var el = document.createElement("div");
|
||||
el.className = this.$editorCSS;
|
||||
el.style.cssText = "position: absolute; top:0px; bottom:0px";
|
||||
this.$container.appendChild(el);
|
||||
var editor = new Editor(new Renderer(el, this.$theme));
|
||||
|
||||
editor.on("focus", function() {
|
||||
this._emit("focus", editor);
|
||||
}.bind(this));
|
||||
|
||||
this.$editors.push(editor);
|
||||
editor.setFontSize(this.$fontSize);
|
||||
return editor;
|
||||
};
|
||||
|
||||
this.setSplits = function(splits) {
|
||||
var editor;
|
||||
if (splits < 1) {
|
||||
throw "The number of splits have to be > 0!";
|
||||
}
|
||||
|
||||
if (splits == this.$splits) {
|
||||
return;
|
||||
} else if (splits > this.$splits) {
|
||||
while (this.$splits < this.$editors.length && this.$splits < splits) {
|
||||
editor = this.$editors[this.$splits];
|
||||
this.$container.appendChild(editor.container);
|
||||
editor.setFontSize(this.$fontSize);
|
||||
this.$splits ++;
|
||||
}
|
||||
while (this.$splits < splits) {
|
||||
this.$createEditor();
|
||||
this.$splits ++;
|
||||
}
|
||||
} else {
|
||||
while (this.$splits > splits) {
|
||||
editor = this.$editors[this.$splits - 1];
|
||||
this.$container.removeChild(editor.container);
|
||||
this.$splits --;
|
||||
}
|
||||
}
|
||||
this.resize();
|
||||
};
|
||||
this.getSplits = function() {
|
||||
return this.$splits;
|
||||
};
|
||||
this.getEditor = function(idx) {
|
||||
return this.$editors[idx];
|
||||
};
|
||||
this.getCurrentEditor = function() {
|
||||
return this.$cEditor;
|
||||
};
|
||||
this.focus = function() {
|
||||
this.$cEditor.focus();
|
||||
};
|
||||
this.blur = function() {
|
||||
this.$cEditor.blur();
|
||||
};
|
||||
this.setTheme = function(theme) {
|
||||
this.$editors.forEach(function(editor) {
|
||||
editor.setTheme(theme);
|
||||
});
|
||||
};
|
||||
this.setKeyboardHandler = function(keybinding) {
|
||||
this.$editors.forEach(function(editor) {
|
||||
editor.setKeyboardHandler(keybinding);
|
||||
});
|
||||
};
|
||||
this.forEach = function(callback, scope) {
|
||||
this.$editors.forEach(callback, scope);
|
||||
};
|
||||
|
||||
|
||||
this.$fontSize = "";
|
||||
this.setFontSize = function(size) {
|
||||
this.$fontSize = size;
|
||||
this.forEach(function(editor) {
|
||||
editor.setFontSize(size);
|
||||
});
|
||||
};
|
||||
|
||||
this.$cloneSession = function(session) {
|
||||
var s = new EditSession(session.getDocument(), session.getMode());
|
||||
|
||||
var undoManager = session.getUndoManager();
|
||||
s.setUndoManager(undoManager);
|
||||
s.setTabSize(session.getTabSize());
|
||||
s.setUseSoftTabs(session.getUseSoftTabs());
|
||||
s.setOverwrite(session.getOverwrite());
|
||||
s.setBreakpoints(session.getBreakpoints());
|
||||
s.setUseWrapMode(session.getUseWrapMode());
|
||||
s.setUseWorker(session.getUseWorker());
|
||||
s.setWrapLimitRange(session.$wrapLimitRange.min,
|
||||
session.$wrapLimitRange.max);
|
||||
s.$foldData = session.$cloneFoldData();
|
||||
|
||||
return s;
|
||||
};
|
||||
this.setSession = function(session, idx) {
|
||||
var editor;
|
||||
if (idx == null) {
|
||||
editor = this.$cEditor;
|
||||
} else {
|
||||
editor = this.$editors[idx];
|
||||
}
|
||||
var isUsed = this.$editors.some(function(editor) {
|
||||
return editor.session === session;
|
||||
});
|
||||
|
||||
if (isUsed) {
|
||||
session = this.$cloneSession(session);
|
||||
}
|
||||
editor.setSession(session);
|
||||
return session;
|
||||
};
|
||||
this.getOrientation = function() {
|
||||
return this.$orientation;
|
||||
};
|
||||
this.setOrientation = function(orientation) {
|
||||
if (this.$orientation == orientation) {
|
||||
return;
|
||||
}
|
||||
this.$orientation = orientation;
|
||||
this.resize();
|
||||
};
|
||||
this.resize = function() {
|
||||
var width = this.$container.clientWidth;
|
||||
var height = this.$container.clientHeight;
|
||||
var editor;
|
||||
|
||||
if (this.$orientation == this.BESIDE) {
|
||||
var editorWidth = width / this.$splits;
|
||||
for (var i = 0; i < this.$splits; i++) {
|
||||
editor = this.$editors[i];
|
||||
editor.container.style.width = editorWidth + "px";
|
||||
editor.container.style.top = "0px";
|
||||
editor.container.style.left = i * editorWidth + "px";
|
||||
editor.container.style.height = height + "px";
|
||||
editor.resize();
|
||||
}
|
||||
} else {
|
||||
var editorHeight = height / this.$splits;
|
||||
for (var i = 0; i < this.$splits; i++) {
|
||||
editor = this.$editors[i];
|
||||
editor.container.style.width = width + "px";
|
||||
editor.container.style.top = i * editorHeight + "px";
|
||||
editor.container.style.left = "0px";
|
||||
editor.container.style.height = editorHeight + "px";
|
||||
editor.resize();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}).call(Split.prototype);
|
||||
|
||||
exports.Split = Split;
|
||||
});
|
||||
|
||||
ace.define("ace/ext/split",["require","exports","module","ace/split"], function(require, exports, module) {
|
||||
"use strict";
|
||||
module.exports = require("../split");
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/split"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,226 @@
|
||||
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var EditSession = require("../edit_session").EditSession;
|
||||
var TextLayer = require("../layer/text").Text;
|
||||
var baseStyles = ".ace_static_highlight {\
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\
|
||||
font-size: 12px;\
|
||||
white-space: pre-wrap\
|
||||
}\
|
||||
.ace_static_highlight .ace_gutter {\
|
||||
width: 2em;\
|
||||
text-align: right;\
|
||||
padding: 0 3px 0 0;\
|
||||
margin-right: 3px;\
|
||||
}\
|
||||
.ace_static_highlight.ace_show_gutter .ace_line {\
|
||||
padding-left: 2.6em;\
|
||||
}\
|
||||
.ace_static_highlight .ace_line { position: relative; }\
|
||||
.ace_static_highlight .ace_gutter-cell {\
|
||||
-moz-user-select: -moz-none;\
|
||||
-khtml-user-select: none;\
|
||||
-webkit-user-select: none;\
|
||||
user-select: none;\
|
||||
top: 0;\
|
||||
bottom: 0;\
|
||||
left: 0;\
|
||||
position: absolute;\
|
||||
}\
|
||||
.ace_static_highlight .ace_gutter-cell:before {\
|
||||
content: counter(ace_line, decimal);\
|
||||
counter-increment: ace_line;\
|
||||
}\
|
||||
.ace_static_highlight {\
|
||||
counter-reset: ace_line;\
|
||||
}\
|
||||
";
|
||||
var config = require("../config");
|
||||
var dom = require("../lib/dom");
|
||||
|
||||
function Element(type) {
|
||||
this.type = type;
|
||||
this.style = {};
|
||||
this.textContent = "";
|
||||
}
|
||||
Element.prototype.cloneNode = function() {
|
||||
return this;
|
||||
};
|
||||
Element.prototype.appendChild = function(child) {
|
||||
this.textContent += child.toString();
|
||||
};
|
||||
Element.prototype.toString = function() {
|
||||
var stringBuilder = [];
|
||||
if (this.type != "fragment") {
|
||||
stringBuilder.push("<", this.type);
|
||||
if (this.className)
|
||||
stringBuilder.push(" class='", this.className, "'");
|
||||
var styleStr = [];
|
||||
for (var key in this.style) {
|
||||
styleStr.push(key, ":", this.style[key]);
|
||||
}
|
||||
if (styleStr.length)
|
||||
stringBuilder.push(" style='", styleStr.join(""), "'");
|
||||
stringBuilder.push(">");
|
||||
}
|
||||
|
||||
if (this.textContent)
|
||||
stringBuilder.push(this.textContent);
|
||||
|
||||
if (this.type != "fragment") {
|
||||
stringBuilder.push("</", this.type, ">");
|
||||
}
|
||||
|
||||
return stringBuilder.join("");
|
||||
};
|
||||
|
||||
|
||||
var simpleDom = {
|
||||
createTextNode: function(textContent, element) {
|
||||
return textContent;
|
||||
},
|
||||
createElement: function(type) {
|
||||
return new Element(type);
|
||||
},
|
||||
createFragment: function() {
|
||||
return new Element("fragment");
|
||||
}
|
||||
};
|
||||
|
||||
var SimpleTextLayer = function() {
|
||||
this.config = {};
|
||||
this.dom = simpleDom;
|
||||
};
|
||||
SimpleTextLayer.prototype = TextLayer.prototype;
|
||||
|
||||
var highlight = function(el, opts, callback) {
|
||||
var m = el.className.match(/lang-(\w+)/);
|
||||
var mode = opts.mode || m && ("ace/mode/" + m[1]);
|
||||
if (!mode)
|
||||
return false;
|
||||
var theme = opts.theme || "ace/theme/textmate";
|
||||
|
||||
var data = "";
|
||||
var nodes = [];
|
||||
|
||||
if (el.firstElementChild) {
|
||||
var textLen = 0;
|
||||
for (var i = 0; i < el.childNodes.length; i++) {
|
||||
var ch = el.childNodes[i];
|
||||
if (ch.nodeType == 3) {
|
||||
textLen += ch.data.length;
|
||||
data += ch.data;
|
||||
} else {
|
||||
nodes.push(textLen, ch);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = el.textContent;
|
||||
if (opts.trim)
|
||||
data = data.trim();
|
||||
}
|
||||
|
||||
highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) {
|
||||
dom.importCssString(highlighted.css, "ace_highlight");
|
||||
el.innerHTML = highlighted.html;
|
||||
var container = el.firstChild.firstChild;
|
||||
for (var i = 0; i < nodes.length; i += 2) {
|
||||
var pos = highlighted.session.doc.indexToPosition(nodes[i]);
|
||||
var node = nodes[i + 1];
|
||||
var lineEl = container.children[pos.row];
|
||||
lineEl && lineEl.appendChild(node);
|
||||
}
|
||||
callback && callback();
|
||||
});
|
||||
};
|
||||
highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) {
|
||||
var waiting = 1;
|
||||
var modeCache = EditSession.prototype.$modes;
|
||||
if (typeof theme == "string") {
|
||||
waiting++;
|
||||
config.loadModule(['theme', theme], function(m) {
|
||||
theme = m;
|
||||
--waiting || done();
|
||||
});
|
||||
}
|
||||
var modeOptions;
|
||||
if (mode && typeof mode === "object" && !mode.getTokenizer) {
|
||||
modeOptions = mode;
|
||||
mode = modeOptions.path;
|
||||
}
|
||||
if (typeof mode == "string") {
|
||||
waiting++;
|
||||
config.loadModule(['mode', mode], function(m) {
|
||||
if (!modeCache[mode] || modeOptions)
|
||||
modeCache[mode] = new m.Mode(modeOptions);
|
||||
mode = modeCache[mode];
|
||||
--waiting || done();
|
||||
});
|
||||
}
|
||||
function done() {
|
||||
var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);
|
||||
return callback ? callback(result) : result;
|
||||
}
|
||||
return --waiting || done();
|
||||
};
|
||||
highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) {
|
||||
lineStart = parseInt(lineStart || 1, 10);
|
||||
|
||||
var session = new EditSession("");
|
||||
session.setUseWorker(false);
|
||||
session.setMode(mode);
|
||||
|
||||
var textLayer = new SimpleTextLayer();
|
||||
textLayer.setSession(session);
|
||||
Object.keys(textLayer.$tabStrings).forEach(function(k) {
|
||||
if (typeof textLayer.$tabStrings[k] == "string") {
|
||||
var el = simpleDom.createFragment();
|
||||
el.textContent = textLayer.$tabStrings[k];
|
||||
textLayer.$tabStrings[k] = el;
|
||||
}
|
||||
});
|
||||
|
||||
session.setValue(input);
|
||||
var length = session.getLength();
|
||||
|
||||
var outerEl = simpleDom.createElement("div");
|
||||
outerEl.className = theme.cssClass;
|
||||
|
||||
var innerEl = simpleDom.createElement("div");
|
||||
innerEl.className = "ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter");
|
||||
innerEl.style["counter-reset"] = "ace_line " + (lineStart - 1);
|
||||
|
||||
for (var ix = 0; ix < length; ix++) {
|
||||
var lineEl = simpleDom.createElement("div");
|
||||
lineEl.className = "ace_line";
|
||||
|
||||
if (!disableGutter) {
|
||||
var gutterEl = simpleDom.createElement("span");
|
||||
gutterEl.className ="ace_gutter ace_gutter-cell";
|
||||
gutterEl.textContent = ""; /*(ix + lineStart) + */
|
||||
lineEl.appendChild(gutterEl);
|
||||
}
|
||||
textLayer.$renderLine(lineEl, ix, false);
|
||||
innerEl.appendChild(lineEl);
|
||||
}
|
||||
outerEl.appendChild(innerEl);
|
||||
|
||||
return {
|
||||
css: baseStyles + theme.cssText,
|
||||
html: outerEl.toString(),
|
||||
session: session
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = highlight;
|
||||
module.exports.highlight = highlight;
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/static_highlight"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,57 @@
|
||||
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var dom = require("ace/lib/dom");
|
||||
var lang = require("ace/lib/lang");
|
||||
|
||||
var StatusBar = function(editor, parentNode) {
|
||||
this.element = dom.createElement("div");
|
||||
this.element.className = "ace_status-indicator";
|
||||
this.element.style.cssText = "display: inline-block;";
|
||||
parentNode.appendChild(this.element);
|
||||
|
||||
var statusUpdate = lang.delayedCall(function(){
|
||||
this.updateStatus(editor);
|
||||
}.bind(this)).schedule.bind(null, 100);
|
||||
|
||||
editor.on("changeStatus", statusUpdate);
|
||||
editor.on("changeSelection", statusUpdate);
|
||||
editor.on("keyboardActivity", statusUpdate);
|
||||
};
|
||||
|
||||
(function(){
|
||||
this.updateStatus = function(editor) {
|
||||
var status = [];
|
||||
function add(str, separator) {
|
||||
str && status.push(str, separator || "|");
|
||||
}
|
||||
|
||||
add(editor.keyBinding.getStatusText(editor));
|
||||
if (editor.commands.recording)
|
||||
add("REC");
|
||||
|
||||
var sel = editor.selection;
|
||||
var c = sel.lead;
|
||||
|
||||
if (!sel.isEmpty()) {
|
||||
var r = editor.getSelectionRange();
|
||||
add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")", " ");
|
||||
}
|
||||
add(c.row + ":" + c.column, " ");
|
||||
if (sel.rangeCount)
|
||||
add("[" + sel.rangeCount + "]", " ");
|
||||
status.pop();
|
||||
this.element.textContent = status.join("");
|
||||
};
|
||||
}).call(StatusBar.prototype);
|
||||
|
||||
exports.StatusBar = StatusBar;
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/statusbar"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,567 @@
|
||||
ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-tm";
|
||||
exports.cssText = ".ace-tm .ace_gutter {\
|
||||
background: #f0f0f0;\
|
||||
color: #333;\
|
||||
}\
|
||||
.ace-tm .ace_print-margin {\
|
||||
width: 1px;\
|
||||
background: #e8e8e8;\
|
||||
}\
|
||||
.ace-tm .ace_fold {\
|
||||
background-color: #6B72E6;\
|
||||
}\
|
||||
.ace-tm {\
|
||||
background-color: #FFFFFF;\
|
||||
color: black;\
|
||||
}\
|
||||
.ace-tm .ace_cursor {\
|
||||
color: black;\
|
||||
}\
|
||||
.ace-tm .ace_invisible {\
|
||||
color: rgb(191, 191, 191);\
|
||||
}\
|
||||
.ace-tm .ace_storage,\
|
||||
.ace-tm .ace_keyword {\
|
||||
color: blue;\
|
||||
}\
|
||||
.ace-tm .ace_constant {\
|
||||
color: rgb(197, 6, 11);\
|
||||
}\
|
||||
.ace-tm .ace_constant.ace_buildin {\
|
||||
color: rgb(88, 72, 246);\
|
||||
}\
|
||||
.ace-tm .ace_constant.ace_language {\
|
||||
color: rgb(88, 92, 246);\
|
||||
}\
|
||||
.ace-tm .ace_constant.ace_library {\
|
||||
color: rgb(6, 150, 14);\
|
||||
}\
|
||||
.ace-tm .ace_invalid {\
|
||||
background-color: rgba(255, 0, 0, 0.1);\
|
||||
color: red;\
|
||||
}\
|
||||
.ace-tm .ace_support.ace_function {\
|
||||
color: rgb(60, 76, 114);\
|
||||
}\
|
||||
.ace-tm .ace_support.ace_constant {\
|
||||
color: rgb(6, 150, 14);\
|
||||
}\
|
||||
.ace-tm .ace_support.ace_type,\
|
||||
.ace-tm .ace_support.ace_class {\
|
||||
color: rgb(109, 121, 222);\
|
||||
}\
|
||||
.ace-tm .ace_keyword.ace_operator {\
|
||||
color: rgb(104, 118, 135);\
|
||||
}\
|
||||
.ace-tm .ace_string {\
|
||||
color: rgb(3, 106, 7);\
|
||||
}\
|
||||
.ace-tm .ace_comment {\
|
||||
color: rgb(76, 136, 107);\
|
||||
}\
|
||||
.ace-tm .ace_comment.ace_doc {\
|
||||
color: rgb(0, 102, 255);\
|
||||
}\
|
||||
.ace-tm .ace_comment.ace_doc.ace_tag {\
|
||||
color: rgb(128, 159, 191);\
|
||||
}\
|
||||
.ace-tm .ace_constant.ace_numeric {\
|
||||
color: rgb(0, 0, 205);\
|
||||
}\
|
||||
.ace-tm .ace_variable {\
|
||||
color: rgb(49, 132, 149);\
|
||||
}\
|
||||
.ace-tm .ace_xml-pe {\
|
||||
color: rgb(104, 104, 91);\
|
||||
}\
|
||||
.ace-tm .ace_entity.ace_name.ace_function {\
|
||||
color: #0000A2;\
|
||||
}\
|
||||
.ace-tm .ace_heading {\
|
||||
color: rgb(12, 7, 255);\
|
||||
}\
|
||||
.ace-tm .ace_list {\
|
||||
color:rgb(185, 6, 144);\
|
||||
}\
|
||||
.ace-tm .ace_meta.ace_tag {\
|
||||
color:rgb(0, 22, 142);\
|
||||
}\
|
||||
.ace-tm .ace_string.ace_regex {\
|
||||
color: rgb(255, 0, 0)\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_selection {\
|
||||
background: rgb(181, 213, 255);\
|
||||
}\
|
||||
.ace-tm.ace_multiselect .ace_selection.ace_start {\
|
||||
box-shadow: 0 0 3px 0px white;\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_step {\
|
||||
background: rgb(252, 255, 0);\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_stack {\
|
||||
background: rgb(164, 229, 101);\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_bracket {\
|
||||
margin: -1px 0 0 -1px;\
|
||||
border: 1px solid rgb(192, 192, 192);\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_active-line {\
|
||||
background: rgba(0, 0, 0, 0.07);\
|
||||
}\
|
||||
.ace-tm .ace_gutter-active-line {\
|
||||
background-color : #dcdcdc;\
|
||||
}\
|
||||
.ace-tm .ace_marker-layer .ace_selected-word {\
|
||||
background: rgb(250, 250, 255);\
|
||||
border: 1px solid rgb(200, 200, 250);\
|
||||
}\
|
||||
.ace-tm .ace_indent-guide {\
|
||||
background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
|
||||
}\
|
||||
";
|
||||
exports.$id = "ace/theme/textmate";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
|
||||
ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var event = require("../lib/event");
|
||||
var UA = require("../lib/useragent");
|
||||
var net = require("../lib/net");
|
||||
var ace = require("../ace");
|
||||
|
||||
require("../theme/textmate");
|
||||
|
||||
module.exports = exports = ace;
|
||||
var getCSSProperty = function(element, container, property) {
|
||||
var ret = element.style[property];
|
||||
|
||||
if (!ret) {
|
||||
if (window.getComputedStyle) {
|
||||
ret = window.getComputedStyle(element, '').getPropertyValue(property);
|
||||
} else {
|
||||
ret = element.currentStyle[property];
|
||||
}
|
||||
}
|
||||
|
||||
if (!ret || ret == 'auto' || ret == 'intrinsic') {
|
||||
ret = container.style[property];
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
function applyStyles(elm, styles) {
|
||||
for (var style in styles) {
|
||||
elm.style[style] = styles[style];
|
||||
}
|
||||
}
|
||||
|
||||
function setupContainer(element, getValue) {
|
||||
if (element.type != 'textarea') {
|
||||
throw new Error("Textarea required!");
|
||||
}
|
||||
|
||||
var parentNode = element.parentNode;
|
||||
var container = document.createElement('div');
|
||||
//
|
||||
var resizeEvent = function() {
|
||||
var style = 'position:relative;';
|
||||
[
|
||||
'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
|
||||
].forEach(function(item) {
|
||||
style += item + ':' +
|
||||
getCSSProperty(element, container, item) + ';';
|
||||
});
|
||||
var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
|
||||
var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
|
||||
style += 'height:' + height + ';width:' + width + ';';
|
||||
style += 'display:inline-block;';
|
||||
container.setAttribute('style', style);
|
||||
};
|
||||
event.addListener(window, 'resize', resizeEvent);
|
||||
resizeEvent();
|
||||
parentNode.insertBefore(container, element.nextSibling);
|
||||
while (parentNode !== document) {
|
||||
if (parentNode.tagName.toUpperCase() === 'FORM') {
|
||||
var oldSumit = parentNode.onsubmit;
|
||||
parentNode.onsubmit = function(evt) {
|
||||
element.value = getValue();
|
||||
if (oldSumit) {
|
||||
oldSumit.call(this, evt);
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
parentNode = parentNode.parentNode;
|
||||
}
|
||||
return container;
|
||||
}
|
||||
|
||||
exports.transformTextarea = function(element, options) {
|
||||
var isFocused = element.autofocus || document.activeElement == element;
|
||||
var session;
|
||||
var container = setupContainer(element, function() {
|
||||
return session.getValue();
|
||||
});
|
||||
element.style.display = 'none';
|
||||
container.style.background = 'white';
|
||||
|
||||
//
|
||||
var editorDiv = document.createElement("div");
|
||||
applyStyles(editorDiv, {
|
||||
top: "0px",
|
||||
left: "0px",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
border: "1px solid gray",
|
||||
position: "absolute"
|
||||
});
|
||||
container.appendChild(editorDiv);
|
||||
|
||||
var settingOpener = document.createElement("div");
|
||||
applyStyles(settingOpener, {
|
||||
position: "absolute",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
cursor: "nw-resize",
|
||||
border: "solid 9px",
|
||||
borderColor: "lightblue gray gray #ceade6",
|
||||
zIndex: 101
|
||||
});
|
||||
|
||||
var settingDiv = document.createElement("div");
|
||||
var settingDivStyles = {
|
||||
top: "0px",
|
||||
left: "20%",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
position: "absolute",
|
||||
padding: "5px",
|
||||
zIndex: 100,
|
||||
color: "white",
|
||||
display: "none",
|
||||
overflow: "auto",
|
||||
fontSize: "14px",
|
||||
boxShadow: "-5px 2px 3px gray"
|
||||
};
|
||||
if (!UA.isOldIE) {
|
||||
settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
||||
} else {
|
||||
settingDivStyles.backgroundColor = "#333";
|
||||
}
|
||||
|
||||
applyStyles(settingDiv, settingDivStyles);
|
||||
container.appendChild(settingDiv);
|
||||
|
||||
options = options || exports.defaultOptions;
|
||||
var editor = ace.edit(editorDiv);
|
||||
session = editor.getSession();
|
||||
|
||||
session.setValue(element.value || element.innerHTML);
|
||||
if (isFocused)
|
||||
editor.focus();
|
||||
container.appendChild(settingOpener);
|
||||
setupApi(editor, editorDiv, settingDiv, ace, options);
|
||||
setupSettingPanel(settingDiv, settingOpener, editor);
|
||||
|
||||
var state = "";
|
||||
event.addListener(settingOpener, "mousemove", function(e) {
|
||||
var rect = this.getBoundingClientRect();
|
||||
var x = e.clientX - rect.left, y = e.clientY - rect.top;
|
||||
if (x + y < (rect.width + rect.height)/2) {
|
||||
this.style.cursor = "pointer";
|
||||
state = "toggle";
|
||||
} else {
|
||||
state = "resize";
|
||||
this.style.cursor = "nw-resize";
|
||||
}
|
||||
});
|
||||
|
||||
event.addListener(settingOpener, "mousedown", function(e) {
|
||||
e.preventDefault();
|
||||
if (state == "toggle") {
|
||||
editor.setDisplaySettings();
|
||||
return;
|
||||
}
|
||||
container.style.zIndex = 100000;
|
||||
var rect = container.getBoundingClientRect();
|
||||
var startX = rect.width + rect.left - e.clientX;
|
||||
var startY = rect.height + rect.top - e.clientY;
|
||||
event.capture(settingOpener, function(e) {
|
||||
container.style.width = e.clientX - rect.left + startX + "px";
|
||||
container.style.height = e.clientY - rect.top + startY + "px";
|
||||
editor.resize();
|
||||
}, function() {});
|
||||
});
|
||||
|
||||
return editor;
|
||||
};
|
||||
|
||||
function load(url, module, callback) {
|
||||
net.loadScript(url, function() {
|
||||
require([module], callback);
|
||||
});
|
||||
}
|
||||
|
||||
function setupApi(editor, editorDiv, settingDiv, ace, options) {
|
||||
var session = editor.getSession();
|
||||
var renderer = editor.renderer;
|
||||
|
||||
function toBool(value) {
|
||||
return value === "true" || value == true;
|
||||
}
|
||||
|
||||
editor.setDisplaySettings = function(display) {
|
||||
if (display == null)
|
||||
display = settingDiv.style.display == "none";
|
||||
if (display) {
|
||||
settingDiv.style.display = "block";
|
||||
settingDiv.hideButton.focus();
|
||||
editor.on("focus", function onFocus() {
|
||||
editor.removeListener("focus", onFocus);
|
||||
settingDiv.style.display = "none";
|
||||
});
|
||||
} else {
|
||||
editor.focus();
|
||||
}
|
||||
};
|
||||
|
||||
editor.$setOption = editor.setOption;
|
||||
editor.$getOption = editor.getOption;
|
||||
editor.setOption = function(key, value) {
|
||||
switch (key) {
|
||||
case "mode":
|
||||
editor.$setOption("mode", "ace/mode/" + value);
|
||||
break;
|
||||
case "theme":
|
||||
editor.$setOption("theme", "ace/theme/" + value);
|
||||
break;
|
||||
case "keybindings":
|
||||
switch (value) {
|
||||
case "vim":
|
||||
editor.setKeyboardHandler("ace/keyboard/vim");
|
||||
break;
|
||||
case "emacs":
|
||||
editor.setKeyboardHandler("ace/keyboard/emacs");
|
||||
break;
|
||||
default:
|
||||
editor.setKeyboardHandler(null);
|
||||
}
|
||||
break;
|
||||
|
||||
case "wrap":
|
||||
case "fontSize":
|
||||
editor.$setOption(key, value);
|
||||
break;
|
||||
|
||||
default:
|
||||
editor.$setOption(key, toBool(value));
|
||||
}
|
||||
};
|
||||
|
||||
editor.getOption = function(key) {
|
||||
switch (key) {
|
||||
case "mode":
|
||||
return editor.$getOption("mode").substr("ace/mode/".length);
|
||||
break;
|
||||
|
||||
case "theme":
|
||||
return editor.$getOption("theme").substr("ace/theme/".length);
|
||||
break;
|
||||
|
||||
case "keybindings":
|
||||
var value = editor.getKeyboardHandler();
|
||||
switch (value && value.$id) {
|
||||
case "ace/keyboard/vim":
|
||||
return "vim";
|
||||
case "ace/keyboard/emacs":
|
||||
return "emacs";
|
||||
default:
|
||||
return "ace";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return editor.$getOption(key);
|
||||
}
|
||||
};
|
||||
|
||||
editor.setOptions(options);
|
||||
return editor;
|
||||
}
|
||||
|
||||
function setupSettingPanel(settingDiv, settingOpener, editor) {
|
||||
var BOOL = null;
|
||||
|
||||
var desc = {
|
||||
mode: "Mode:",
|
||||
wrap: "Soft Wrap:",
|
||||
theme: "Theme:",
|
||||
fontSize: "Font Size:",
|
||||
showGutter: "Display Gutter:",
|
||||
keybindings: "Keyboard",
|
||||
showPrintMargin: "Show Print Margin:",
|
||||
useSoftTabs: "Use Soft Tabs:",
|
||||
showInvisibles: "Show Invisibles"
|
||||
};
|
||||
|
||||
var optionValues = {
|
||||
mode: {
|
||||
text: "Plain",
|
||||
javascript: "JavaScript",
|
||||
xml: "XML",
|
||||
html: "HTML",
|
||||
css: "CSS",
|
||||
scss: "SCSS",
|
||||
python: "Python",
|
||||
php: "PHP",
|
||||
java: "Java",
|
||||
ruby: "Ruby",
|
||||
c_cpp: "C/C++",
|
||||
coffee: "CoffeeScript",
|
||||
json: "json",
|
||||
perl: "Perl",
|
||||
clojure: "Clojure",
|
||||
ocaml: "OCaml",
|
||||
csharp: "C#",
|
||||
haxe: "haXe",
|
||||
svg: "SVG",
|
||||
textile: "Textile",
|
||||
groovy: "Groovy",
|
||||
liquid: "Liquid",
|
||||
Scala: "Scala"
|
||||
},
|
||||
theme: {
|
||||
clouds: "Clouds",
|
||||
clouds_midnight: "Clouds Midnight",
|
||||
cobalt: "Cobalt",
|
||||
crimson_editor: "Crimson Editor",
|
||||
dawn: "Dawn",
|
||||
gob: "Green on Black",
|
||||
eclipse: "Eclipse",
|
||||
idle_fingers: "Idle Fingers",
|
||||
kr_theme: "Kr Theme",
|
||||
merbivore: "Merbivore",
|
||||
merbivore_soft: "Merbivore Soft",
|
||||
mono_industrial: "Mono Industrial",
|
||||
monokai: "Monokai",
|
||||
pastel_on_dark: "Pastel On Dark",
|
||||
solarized_dark: "Solarized Dark",
|
||||
solarized_light: "Solarized Light",
|
||||
textmate: "Textmate",
|
||||
twilight: "Twilight",
|
||||
vibrant_ink: "Vibrant Ink"
|
||||
},
|
||||
showGutter: BOOL,
|
||||
fontSize: {
|
||||
"10px": "10px",
|
||||
"11px": "11px",
|
||||
"12px": "12px",
|
||||
"14px": "14px",
|
||||
"16px": "16px"
|
||||
},
|
||||
wrap: {
|
||||
off: "Off",
|
||||
40: "40",
|
||||
80: "80",
|
||||
free: "Free"
|
||||
},
|
||||
keybindings: {
|
||||
ace: "ace",
|
||||
vim: "vim",
|
||||
emacs: "emacs"
|
||||
},
|
||||
showPrintMargin: BOOL,
|
||||
useSoftTabs: BOOL,
|
||||
showInvisibles: BOOL
|
||||
};
|
||||
|
||||
var table = [];
|
||||
table.push("<table><tr><th>Setting</th><th>Value</th></tr>");
|
||||
|
||||
function renderOption(builder, option, obj, cValue) {
|
||||
if (!obj) {
|
||||
builder.push(
|
||||
"<input type='checkbox' title='", option, "' ",
|
||||
cValue + "" == "true" ? "checked='true'" : "",
|
||||
"'></input>"
|
||||
);
|
||||
return;
|
||||
}
|
||||
builder.push("<select title='" + option + "'>");
|
||||
for (var value in obj) {
|
||||
builder.push("<option value='" + value + "' ");
|
||||
|
||||
if (cValue == value) {
|
||||
builder.push(" selected ");
|
||||
}
|
||||
|
||||
builder.push(">",
|
||||
obj[value],
|
||||
"</option>");
|
||||
}
|
||||
builder.push("</select>");
|
||||
}
|
||||
|
||||
for (var option in exports.defaultOptions) {
|
||||
table.push("<tr><td>", desc[option], "</td>");
|
||||
table.push("<td>");
|
||||
renderOption(table, option, optionValues[option], editor.getOption(option));
|
||||
table.push("</td></tr>");
|
||||
}
|
||||
table.push("</table>");
|
||||
settingDiv.innerHTML = table.join("");
|
||||
|
||||
var onChange = function(e) {
|
||||
var select = e.currentTarget;
|
||||
editor.setOption(select.title, select.value);
|
||||
};
|
||||
var onClick = function(e) {
|
||||
var cb = e.currentTarget;
|
||||
editor.setOption(cb.title, cb.checked);
|
||||
};
|
||||
var selects = settingDiv.getElementsByTagName("select");
|
||||
for (var i = 0; i < selects.length; i++)
|
||||
selects[i].onchange = onChange;
|
||||
var cbs = settingDiv.getElementsByTagName("input");
|
||||
for (var i = 0; i < cbs.length; i++)
|
||||
cbs[i].onclick = onClick;
|
||||
|
||||
|
||||
var button = document.createElement("input");
|
||||
button.type = "button";
|
||||
button.value = "Hide";
|
||||
event.addListener(button, "click", function() {
|
||||
editor.setDisplaySettings(false);
|
||||
});
|
||||
settingDiv.appendChild(button);
|
||||
settingDiv.hideButton = button;
|
||||
}
|
||||
exports.defaultOptions = {
|
||||
mode: "javascript",
|
||||
theme: "textmate",
|
||||
wrap: "off",
|
||||
fontSize: "12px",
|
||||
showGutter: "false",
|
||||
keybindings: "ace",
|
||||
showPrintMargin: "false",
|
||||
useSoftTabs: "true",
|
||||
showInvisibles: "false"
|
||||
};
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/textarea"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,67 @@
|
||||
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
|
||||
"use strict";
|
||||
require("ace/lib/fixoldbrowsers");
|
||||
|
||||
var themeData = [
|
||||
["Chrome" ],
|
||||
["Clouds" ],
|
||||
["Crimson Editor" ],
|
||||
["Dawn" ],
|
||||
["Dreamweaver" ],
|
||||
["Eclipse" ],
|
||||
["GitHub" ],
|
||||
["IPlastic" ],
|
||||
["Solarized Light"],
|
||||
["TextMate" ],
|
||||
["Tomorrow" ],
|
||||
["XCode" ],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server" ,"sqlserver" , "light"],
|
||||
["Ambiance" ,"ambiance" , "dark"],
|
||||
["Chaos" ,"chaos" , "dark"],
|
||||
["Clouds Midnight" ,"clouds_midnight" , "dark"],
|
||||
["Dracula" ,"" , "dark"],
|
||||
["Cobalt" ,"cobalt" , "dark"],
|
||||
["Gruvbox" ,"gruvbox" , "dark"],
|
||||
["Green on Black" ,"gob" , "dark"],
|
||||
["idle Fingers" ,"idle_fingers" , "dark"],
|
||||
["krTheme" ,"kr_theme" , "dark"],
|
||||
["Merbivore" ,"merbivore" , "dark"],
|
||||
["Merbivore Soft" ,"merbivore_soft" , "dark"],
|
||||
["Mono Industrial" ,"mono_industrial" , "dark"],
|
||||
["Monokai" ,"monokai" , "dark"],
|
||||
["Pastel on dark" ,"pastel_on_dark" , "dark"],
|
||||
["Solarized Dark" ,"solarized_dark" , "dark"],
|
||||
["Terminal" ,"terminal" , "dark"],
|
||||
["Tomorrow Night" ,"tomorrow_night" , "dark"],
|
||||
["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"],
|
||||
["Tomorrow Night Bright","tomorrow_night_bright" , "dark"],
|
||||
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
|
||||
["Twilight" ,"twilight" , "dark"],
|
||||
["Vibrant Ink" ,"vibrant_ink" , "dark"]
|
||||
];
|
||||
|
||||
|
||||
exports.themesByName = {};
|
||||
exports.themes = themeData.map(function(data) {
|
||||
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
|
||||
var theme = {
|
||||
caption: data[0],
|
||||
theme: "ace/theme/" + name,
|
||||
isDark: data[2] == "dark",
|
||||
name: name
|
||||
};
|
||||
exports.themesByName[name] = theme;
|
||||
return theme;
|
||||
});
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/themelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,210 @@
|
||||
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var lang = require("../lib/lang");
|
||||
exports.$detectIndentation = function(lines, fallback) {
|
||||
var stats = [];
|
||||
var changes = [];
|
||||
var tabIndents = 0;
|
||||
var prevSpaces = 0;
|
||||
var max = Math.min(lines.length, 1000);
|
||||
for (var i = 0; i < max; i++) {
|
||||
var line = lines[i];
|
||||
if (!/^\s*[^*+\-\s]/.test(line))
|
||||
continue;
|
||||
|
||||
if (line[0] == "\t") {
|
||||
tabIndents++;
|
||||
prevSpaces = -Number.MAX_VALUE;
|
||||
} else {
|
||||
var spaces = line.match(/^ */)[0].length;
|
||||
if (spaces && line[spaces] != "\t") {
|
||||
var diff = spaces - prevSpaces;
|
||||
if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff))
|
||||
changes[diff] = (changes[diff] || 0) + 1;
|
||||
|
||||
stats[spaces] = (stats[spaces] || 0) + 1;
|
||||
}
|
||||
prevSpaces = spaces;
|
||||
}
|
||||
while (i < max && line[line.length - 1] == "\\")
|
||||
line = lines[i++];
|
||||
}
|
||||
|
||||
function getScore(indent) {
|
||||
var score = 0;
|
||||
for (var i = indent; i < stats.length; i += indent)
|
||||
score += stats[i] || 0;
|
||||
return score;
|
||||
}
|
||||
|
||||
var changesTotal = changes.reduce(function(a,b){return a+b;}, 0);
|
||||
|
||||
var first = {score: 0, length: 0};
|
||||
var spaceIndents = 0;
|
||||
for (var i = 1; i < 12; i++) {
|
||||
var score = getScore(i);
|
||||
if (i == 1) {
|
||||
spaceIndents = score;
|
||||
score = stats[1] ? 0.9 : 0.8;
|
||||
if (!stats.length)
|
||||
score = 0;
|
||||
} else
|
||||
score /= spaceIndents;
|
||||
|
||||
if (changes[i])
|
||||
score += changes[i] / changesTotal;
|
||||
|
||||
if (score > first.score)
|
||||
first = {score: score, length: i};
|
||||
}
|
||||
|
||||
if (first.score && first.score > 1.4)
|
||||
var tabLength = first.length;
|
||||
|
||||
if (tabIndents > spaceIndents + 1) {
|
||||
if (tabLength == 1 || spaceIndents < tabIndents / 4 || first.score < 1.8)
|
||||
tabLength = undefined;
|
||||
return {ch: "\t", length: tabLength};
|
||||
}
|
||||
if (spaceIndents > tabIndents + 1)
|
||||
return {ch: " ", length: tabLength};
|
||||
};
|
||||
|
||||
exports.detectIndentation = function(session) {
|
||||
var lines = session.getLines(0, 1000);
|
||||
var indent = exports.$detectIndentation(lines) || {};
|
||||
|
||||
if (indent.ch)
|
||||
session.setUseSoftTabs(indent.ch == " ");
|
||||
|
||||
if (indent.length)
|
||||
session.setTabSize(indent.length);
|
||||
return indent;
|
||||
};
|
||||
exports.trimTrailingSpace = function(session, options) {
|
||||
var doc = session.getDocument();
|
||||
var lines = doc.getAllLines();
|
||||
|
||||
var min = options && options.trimEmpty ? -1 : 0;
|
||||
var cursors = [], ci = -1;
|
||||
if (options && options.keepCursorPosition) {
|
||||
if (session.selection.rangeCount) {
|
||||
session.selection.rangeList.ranges.forEach(function(x, i, ranges) {
|
||||
var next = ranges[i + 1];
|
||||
if (next && next.cursor.row == x.cursor.row)
|
||||
return;
|
||||
cursors.push(x.cursor);
|
||||
});
|
||||
} else {
|
||||
cursors.push(session.selection.getCursor());
|
||||
}
|
||||
ci = 0;
|
||||
}
|
||||
var cursorRow = cursors[ci] && cursors[ci].row;
|
||||
|
||||
for (var i = 0, l=lines.length; i < l; i++) {
|
||||
var line = lines[i];
|
||||
var index = line.search(/\s+$/);
|
||||
|
||||
if (i == cursorRow) {
|
||||
if (index < cursors[ci].column && index > min)
|
||||
index = cursors[ci].column;
|
||||
ci++;
|
||||
cursorRow = cursors[ci] ? cursors[ci].row : -1;
|
||||
}
|
||||
|
||||
if (index > min)
|
||||
doc.removeInLine(i, index, line.length);
|
||||
}
|
||||
};
|
||||
|
||||
exports.convertIndentation = function(session, ch, len) {
|
||||
var oldCh = session.getTabString()[0];
|
||||
var oldLen = session.getTabSize();
|
||||
if (!len) len = oldLen;
|
||||
if (!ch) ch = oldCh;
|
||||
|
||||
var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len);
|
||||
|
||||
var doc = session.doc;
|
||||
var lines = doc.getAllLines();
|
||||
|
||||
var cache = {};
|
||||
var spaceCache = {};
|
||||
for (var i = 0, l=lines.length; i < l; i++) {
|
||||
var line = lines[i];
|
||||
var match = line.match(/^\s*/)[0];
|
||||
if (match) {
|
||||
var w = session.$getStringScreenWidth(match)[0];
|
||||
var tabCount = Math.floor(w/oldLen);
|
||||
var reminder = w%oldLen;
|
||||
var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount));
|
||||
toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder));
|
||||
|
||||
if (toInsert != match) {
|
||||
doc.removeInLine(i, 0, match.length);
|
||||
doc.insertInLine({row: i, column: 0}, toInsert);
|
||||
}
|
||||
}
|
||||
}
|
||||
session.setTabSize(len);
|
||||
session.setUseSoftTabs(ch == " ");
|
||||
};
|
||||
|
||||
exports.$parseStringArg = function(text) {
|
||||
var indent = {};
|
||||
if (/t/.test(text))
|
||||
indent.ch = "\t";
|
||||
else if (/s/.test(text))
|
||||
indent.ch = " ";
|
||||
var m = text.match(/\d+/);
|
||||
if (m)
|
||||
indent.length = parseInt(m[0], 10);
|
||||
return indent;
|
||||
};
|
||||
|
||||
exports.$parseArg = function(arg) {
|
||||
if (!arg)
|
||||
return {};
|
||||
if (typeof arg == "string")
|
||||
return exports.$parseStringArg(arg);
|
||||
if (typeof arg.text == "string")
|
||||
return exports.$parseStringArg(arg.text);
|
||||
return arg;
|
||||
};
|
||||
|
||||
exports.commands = [{
|
||||
name: "detectIndentation",
|
||||
exec: function(editor) {
|
||||
exports.detectIndentation(editor.session);
|
||||
}
|
||||
}, {
|
||||
name: "trimTrailingSpace",
|
||||
exec: function(editor, args) {
|
||||
exports.trimTrailingSpace(editor.session, args);
|
||||
}
|
||||
}, {
|
||||
name: "convertIndentation",
|
||||
exec: function(editor, arg) {
|
||||
var indent = exports.$parseArg(arg);
|
||||
exports.convertIndentation(editor.session, indent.ch, indent.length);
|
||||
}
|
||||
}, {
|
||||
name: "setIndentation",
|
||||
exec: function(editor, arg) {
|
||||
var indent = exports.$parseArg(arg);
|
||||
indent.length && editor.session.setTabSize(indent.length);
|
||||
indent.ch && editor.session.setUseSoftTabs(indent.ch == " ");
|
||||
}
|
||||
}];
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/whitespace"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,975 @@
|
||||
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var DocCommentHighlightRules = function() {
|
||||
this.$rules = {
|
||||
"start" : [ {
|
||||
token : "comment.doc.tag",
|
||||
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
||||
},
|
||||
DocCommentHighlightRules.getTagRule(),
|
||||
{
|
||||
defaultToken : "comment.doc",
|
||||
caseInsensitive: true
|
||||
}]
|
||||
};
|
||||
};
|
||||
|
||||
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
||||
|
||||
DocCommentHighlightRules.getTagRule = function(start) {
|
||||
return {
|
||||
token : "comment.doc.tag.storage.type",
|
||||
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
||||
};
|
||||
};
|
||||
|
||||
DocCommentHighlightRules.getStartRule = function(start) {
|
||||
return {
|
||||
token : "comment.doc", // doc comment
|
||||
regex : "\\/\\*(?=\\*)",
|
||||
next : start
|
||||
};
|
||||
};
|
||||
|
||||
DocCommentHighlightRules.getEndRule = function (start) {
|
||||
return {
|
||||
token : "comment.doc", // closing comment
|
||||
regex : "\\*\\/",
|
||||
next : start
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
|
||||
|
||||
var JavaScriptHighlightRules = function(options) {
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"variable.language":
|
||||
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
|
||||
"Namespace|QName|XML|XMLList|" + // E4X
|
||||
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
||||
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
|
||||
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
|
||||
"SyntaxError|TypeError|URIError|" +
|
||||
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
|
||||
"isNaN|parseFloat|parseInt|" +
|
||||
"JSON|Math|" + // Other
|
||||
"this|arguments|prototype|window|document" , // Pseudo
|
||||
"keyword":
|
||||
"const|yield|import|get|set|async|await|" +
|
||||
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
|
||||
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
|
||||
"__parent__|__count__|escape|unescape|with|__proto__|" +
|
||||
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
|
||||
"storage.type":
|
||||
"const|let|var|function",
|
||||
"constant.language":
|
||||
"null|Infinity|NaN|undefined",
|
||||
"support.function":
|
||||
"alert",
|
||||
"constant.language.boolean": "true|false"
|
||||
}, "identifier");
|
||||
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
|
||||
|
||||
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
||||
"u[0-9a-fA-F]{4}|" + // unicode
|
||||
"u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
|
||||
"[0-2][0-7]{0,2}|" + // oct
|
||||
"3[0-7][0-7]?|" + // oct
|
||||
"[4-7][0-7]?|" + //oct
|
||||
".)";
|
||||
this.$rules = {
|
||||
"no_regex" : [
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
comments("no_regex"),
|
||||
{
|
||||
token : "string",
|
||||
regex : "'(?=.)",
|
||||
next : "qstring"
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"(?=.)',
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "constant.numeric", // hexadecimal, octal and binary
|
||||
regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
|
||||
}, {
|
||||
token : "constant.numeric", // decimal integers and floats
|
||||
regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
|
||||
}, {
|
||||
token : [
|
||||
"storage.type", "punctuation.operator", "support.function",
|
||||
"punctuation.operator", "entity.name.function", "text","keyword.operator"
|
||||
],
|
||||
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
||||
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
|
||||
"text", "paren.lparen"
|
||||
],
|
||||
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
||||
"keyword.operator", "text",
|
||||
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"entity.name.function", "text", "punctuation.operator",
|
||||
"text", "storage.type", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : [
|
||||
"text", "text", "storage.type", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(:)(\\s*)(function)(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : "keyword",
|
||||
regex : "from(?=\\s*('|\"))"
|
||||
}, {
|
||||
token : "keyword",
|
||||
regex : "(?:" + kwBeforeRe + ")\\b",
|
||||
next : "start"
|
||||
}, {
|
||||
token : ["support.constant"],
|
||||
regex : /that\b/
|
||||
}, {
|
||||
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
||||
regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : identifierRe
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : /[.](?![.])/,
|
||||
next : "property"
|
||||
}, {
|
||||
token : "storage.type",
|
||||
regex : /=>/,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : /[?:,;.]/,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : /[\[({]/,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : /[\])}]/
|
||||
}, {
|
||||
token: "comment",
|
||||
regex: /^#!.*$/
|
||||
}
|
||||
],
|
||||
property: [{
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : [
|
||||
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
||||
"keyword.operator", "text",
|
||||
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
|
||||
next: "function_arguments"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : /[.](?![.])/
|
||||
}, {
|
||||
token : "support.function",
|
||||
regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
|
||||
}, {
|
||||
token : "support.function.dom",
|
||||
regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
|
||||
}, {
|
||||
token : "support.constant",
|
||||
regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
|
||||
}, {
|
||||
token : "identifier",
|
||||
regex : identifierRe
|
||||
}, {
|
||||
regex: "",
|
||||
token: "empty",
|
||||
next: "no_regex"
|
||||
}
|
||||
],
|
||||
"start": [
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
comments("start"),
|
||||
{
|
||||
token: "string.regexp",
|
||||
regex: "\\/",
|
||||
next: "regex"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+|^$",
|
||||
next : "start"
|
||||
}, {
|
||||
token: "empty",
|
||||
regex: "",
|
||||
next: "no_regex"
|
||||
}
|
||||
],
|
||||
"regex": [
|
||||
{
|
||||
token: "regexp.keyword.operator",
|
||||
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
||||
}, {
|
||||
token: "string.regexp",
|
||||
regex: "/[sxngimy]*",
|
||||
next: "no_regex"
|
||||
}, {
|
||||
token : "invalid",
|
||||
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
|
||||
}, {
|
||||
token : "constant.language.escape",
|
||||
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
|
||||
}, {
|
||||
token : "constant.language.delimiter",
|
||||
regex: /\|/
|
||||
}, {
|
||||
token: "constant.language.escape",
|
||||
regex: /\[\^?/,
|
||||
next: "regex_character_class"
|
||||
}, {
|
||||
token: "empty",
|
||||
regex: "$",
|
||||
next: "no_regex"
|
||||
}, {
|
||||
defaultToken: "string.regexp"
|
||||
}
|
||||
],
|
||||
"regex_character_class": [
|
||||
{
|
||||
token: "regexp.charclass.keyword.operator",
|
||||
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
||||
}, {
|
||||
token: "constant.language.escape",
|
||||
regex: "]",
|
||||
next: "regex"
|
||||
}, {
|
||||
token: "constant.language.escape",
|
||||
regex: "-"
|
||||
}, {
|
||||
token: "empty",
|
||||
regex: "$",
|
||||
next: "no_regex"
|
||||
}, {
|
||||
defaultToken: "string.regexp.charachterclass"
|
||||
}
|
||||
],
|
||||
"function_arguments": [
|
||||
{
|
||||
token: "variable.parameter",
|
||||
regex: identifierRe
|
||||
}, {
|
||||
token: "punctuation.operator",
|
||||
regex: "[, ]+"
|
||||
}, {
|
||||
token: "punctuation.operator",
|
||||
regex: "$"
|
||||
}, {
|
||||
token: "empty",
|
||||
regex: "",
|
||||
next: "no_regex"
|
||||
}
|
||||
],
|
||||
"qqstring" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
consumeLineEnd : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"|$',
|
||||
next : "no_regex"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}
|
||||
],
|
||||
"qstring" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
consumeLineEnd : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "'|$",
|
||||
next : "no_regex"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
if (!options || !options.noES6) {
|
||||
this.$rules.no_regex.unshift({
|
||||
regex: "[{}]", onMatch: function(val, state, stack) {
|
||||
this.next = val == "{" ? this.nextState : "";
|
||||
if (val == "{" && stack.length) {
|
||||
stack.unshift("start", state);
|
||||
}
|
||||
else if (val == "}" && stack.length) {
|
||||
stack.shift();
|
||||
this.next = stack.shift();
|
||||
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
|
||||
return "paren.quasi.end";
|
||||
}
|
||||
return val == "{" ? "paren.lparen" : "paren.rparen";
|
||||
},
|
||||
nextState: "start"
|
||||
}, {
|
||||
token : "string.quasi.start",
|
||||
regex : /`/,
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "paren.quasi.start",
|
||||
regex : /\${/,
|
||||
push : "start"
|
||||
}, {
|
||||
token : "string.quasi.end",
|
||||
regex : /`/,
|
||||
next : "pop"
|
||||
}, {
|
||||
defaultToken: "string.quasi"
|
||||
}]
|
||||
});
|
||||
|
||||
if (!options || options.jsx != false)
|
||||
JSX.call(this);
|
||||
}
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
||||
|
||||
function JSX() {
|
||||
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
|
||||
var jsxTag = {
|
||||
onMatch : function(val, state, stack) {
|
||||
var offset = val.charAt(1) == "/" ? 2 : 1;
|
||||
if (offset == 1) {
|
||||
if (state != this.nextState)
|
||||
stack.unshift(this.next, this.nextState, 0);
|
||||
else
|
||||
stack.unshift(this.next);
|
||||
stack[2]++;
|
||||
} else if (offset == 2) {
|
||||
if (state == this.nextState) {
|
||||
stack[1]--;
|
||||
if (!stack[1] || stack[1] < 0) {
|
||||
stack.shift();
|
||||
stack.shift();
|
||||
}
|
||||
}
|
||||
}
|
||||
return [{
|
||||
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
|
||||
value: val.slice(0, offset)
|
||||
}, {
|
||||
type: "meta.tag.tag-name.xml",
|
||||
value: val.substr(offset)
|
||||
}];
|
||||
},
|
||||
regex : "</?" + tagRegex + "",
|
||||
next: "jsxAttributes",
|
||||
nextState: "jsx"
|
||||
};
|
||||
this.$rules.start.unshift(jsxTag);
|
||||
var jsxJsRule = {
|
||||
regex: "{",
|
||||
token: "paren.quasi.start",
|
||||
push: "start"
|
||||
};
|
||||
this.$rules.jsx = [
|
||||
jsxJsRule,
|
||||
jsxTag,
|
||||
{include : "reference"},
|
||||
{defaultToken: "string"}
|
||||
];
|
||||
this.$rules.jsxAttributes = [{
|
||||
token : "meta.tag.punctuation.tag-close.xml",
|
||||
regex : "/?>",
|
||||
onMatch : function(value, currentState, stack) {
|
||||
if (currentState == stack[0])
|
||||
stack.shift();
|
||||
if (value.length == 2) {
|
||||
if (stack[0] == this.nextState)
|
||||
stack[1]--;
|
||||
if (!stack[1] || stack[1] < 0) {
|
||||
stack.splice(0, 2);
|
||||
}
|
||||
}
|
||||
this.next = stack[0] || "start";
|
||||
return [{type: this.token, value: value}];
|
||||
},
|
||||
nextState: "jsx"
|
||||
},
|
||||
jsxJsRule,
|
||||
comments("jsxAttributes"),
|
||||
{
|
||||
token : "entity.other.attribute-name.xml",
|
||||
regex : tagRegex
|
||||
}, {
|
||||
token : "keyword.operator.attribute-equals.xml",
|
||||
regex : "="
|
||||
}, {
|
||||
token : "text.tag-whitespace.xml",
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : "string.attribute-value.xml",
|
||||
regex : "'",
|
||||
stateName : "jsx_attr_q",
|
||||
push : [
|
||||
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
|
||||
{include : "reference"},
|
||||
{defaultToken : "string.attribute-value.xml"}
|
||||
]
|
||||
}, {
|
||||
token : "string.attribute-value.xml",
|
||||
regex : '"',
|
||||
stateName : "jsx_attr_qq",
|
||||
push : [
|
||||
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
|
||||
{include : "reference"},
|
||||
{defaultToken : "string.attribute-value.xml"}
|
||||
]
|
||||
},
|
||||
jsxTag
|
||||
];
|
||||
this.$rules.reference = [{
|
||||
token : "constant.language.escape.reference.xml",
|
||||
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
||||
}];
|
||||
}
|
||||
|
||||
function comments(next) {
|
||||
return [
|
||||
{
|
||||
token : "comment", // multi line comment
|
||||
regex : /\/\*/,
|
||||
next: [
|
||||
DocCommentHighlightRules.getTagRule(),
|
||||
{token : "comment", regex : "\\*\\/", next : next || "pop"},
|
||||
{defaultToken : "comment", caseInsensitive: true}
|
||||
]
|
||||
}, {
|
||||
token : "comment",
|
||||
regex : "\\/\\/",
|
||||
next: [
|
||||
DocCommentHighlightRules.getTagRule(),
|
||||
{token : "comment", regex : "$|^", next : next || "pop"},
|
||||
{defaultToken : "comment", caseInsensitive: true}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
||||
});
|
||||
|
||||
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
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) {
|
||||
return line.match(/^\s*/)[0];
|
||||
};
|
||||
|
||||
}).call(MatchingBraceOutdent.prototype);
|
||||
|
||||
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
||||
});
|
||||
|
||||
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Range = require("../../range").Range;
|
||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||
|
||||
var FoldMode = exports.FoldMode = function(commentRegex) {
|
||||
if (commentRegex) {
|
||||
this.foldingStartMarker = new RegExp(
|
||||
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
||||
);
|
||||
this.foldingStopMarker = new RegExp(
|
||||
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
||||
);
|
||||
}
|
||||
};
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
||||
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
||||
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
||||
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
|
||||
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
|
||||
this._getFoldWidgetBase = this.getFoldWidget;
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
|
||||
if (this.singleLineBlockCommentRe.test(line)) {
|
||||
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
||||
return "";
|
||||
}
|
||||
|
||||
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
||||
|
||||
if (!fw && this.startRegionRe.test(line))
|
||||
return "start"; // lineCommentRegionStart
|
||||
|
||||
return fw;
|
||||
};
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
||||
var line = session.getLine(row);
|
||||
|
||||
if (this.startRegionRe.test(line))
|
||||
return this.getCommentRegionBlock(session, line, 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, 1);
|
||||
|
||||
if (range && !range.isMultiLine()) {
|
||||
if (forceMultiline) {
|
||||
range = this.getSectionRange(session, row);
|
||||
} else if (foldStyle != "all")
|
||||
range = null;
|
||||
}
|
||||
|
||||
return range;
|
||||
}
|
||||
|
||||
if (foldStyle === "markbegin")
|
||||
return;
|
||||
|
||||
var match = line.match(this.foldingStopMarker);
|
||||
if (match) {
|
||||
var i = match.index + match[0].length;
|
||||
|
||||
if (match[1])
|
||||
return this.closingBracketBlock(session, match[1], row, i);
|
||||
|
||||
return session.getCommentFoldRange(row, i, -1);
|
||||
}
|
||||
};
|
||||
|
||||
this.getSectionRange = function(session, row) {
|
||||
var line = session.getLine(row);
|
||||
var startIndent = line.search(/\S/);
|
||||
var startRow = row;
|
||||
var startColumn = line.length;
|
||||
row = row + 1;
|
||||
var endRow = row;
|
||||
var maxRow = session.getLength();
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var indent = line.search(/\S/);
|
||||
if (indent === -1)
|
||||
continue;
|
||||
if (startIndent > indent)
|
||||
break;
|
||||
var subRange = this.getFoldWidgetRange(session, "all", row);
|
||||
|
||||
if (subRange) {
|
||||
if (subRange.start.row <= startRow) {
|
||||
break;
|
||||
} else if (subRange.isMultiLine()) {
|
||||
row = subRange.end.row;
|
||||
} else if (startIndent == indent) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
endRow = row;
|
||||
}
|
||||
|
||||
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
||||
};
|
||||
this.getCommentRegionBlock = function(session, line, row) {
|
||||
var startColumn = line.search(/\s*$/);
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
|
||||
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
||||
var depth = 1;
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var m = re.exec(line);
|
||||
if (!m) continue;
|
||||
if (m[1]) depth--;
|
||||
else depth++;
|
||||
|
||||
if (!depth) break;
|
||||
}
|
||||
|
||||
var endRow = row;
|
||||
if (endRow > startRow) {
|
||||
return new Range(startRow, startColumn, endRow, line.length);
|
||||
}
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.HighlightRules = JavaScriptHighlightRules;
|
||||
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
this.$quotes = {'"': '"', "'": "'", "`": "`"};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
var endState = tokenizedLine.state;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start" || state == "no_regex") {
|
||||
var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
} else if (state == "doc-start") {
|
||||
if (endState == "start" || endState == "no_regex") {
|
||||
return "";
|
||||
}
|
||||
var match = line.match(/^\s*(\/?)\*/);
|
||||
if (match) {
|
||||
if (match[1]) {
|
||||
indent += " ";
|
||||
}
|
||||
indent += "* ";
|
||||
}
|
||||
}
|
||||
|
||||
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/javascript_worker", "JavaScriptWorker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
worker.on("annotate", function(results) {
|
||||
session.setAnnotations(results.data);
|
||||
});
|
||||
|
||||
worker.on("terminate", function() {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/javascript";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
|
||||
ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var JavaHighlightRules = function() {
|
||||
var keywords = (
|
||||
"abstract|continue|for|new|switch|" +
|
||||
"assert|default|goto|package|synchronized|" +
|
||||
"boolean|do|if|private|this|" +
|
||||
"break|double|implements|protected|throw|" +
|
||||
"byte|else|import|public|throws|" +
|
||||
"case|enum|instanceof|return|transient|" +
|
||||
"catch|extends|int|short|try|" +
|
||||
"char|final|interface|static|void|" +
|
||||
"class|finally|long|strictfp|volatile|" +
|
||||
"const|float|native|super|while|" +
|
||||
"var"
|
||||
);
|
||||
|
||||
var buildinConstants = ("null|Infinity|NaN|undefined");
|
||||
|
||||
|
||||
var langClasses = (
|
||||
"AbstractMethodError|AssertionError|ClassCircularityError|"+
|
||||
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
|
||||
"ExceptionInInitializerError|IllegalAccessError|"+
|
||||
"IllegalThreadStateException|InstantiationError|InternalError|"+
|
||||
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
|
||||
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
|
||||
"SuppressWarnings|TypeNotPresentException|UnknownError|"+
|
||||
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
|
||||
"InstantiationException|IndexOutOfBoundsException|"+
|
||||
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
|
||||
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
|
||||
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
|
||||
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+
|
||||
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
|
||||
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
|
||||
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
|
||||
"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
|
||||
"Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
|
||||
"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
|
||||
"StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
|
||||
"ArrayStoreException|ClassCastException|LinkageError|"+
|
||||
"NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
|
||||
"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
|
||||
"Cloneable|Class|CharSequence|Comparable|String|Object"
|
||||
);
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"variable.language": "this",
|
||||
"keyword": keywords,
|
||||
"constant.language": buildinConstants,
|
||||
"support.function": langClasses
|
||||
}, "identifier");
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "comment",
|
||||
regex : "\\/\\/.*$"
|
||||
},
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
{
|
||||
token : "comment", // multi line comment
|
||||
regex : "\\/\\*",
|
||||
next : "comment"
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||
}, {
|
||||
token : "constant.numeric", // hex
|
||||
regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
|
||||
}, {
|
||||
token : "constant.language.boolean",
|
||||
regex : "(?:true|false)\\b"
|
||||
}, {
|
||||
regex: "(open(?:\\s+))?module(?=\\s*\\w)",
|
||||
token: "keyword",
|
||||
next: [{
|
||||
regex: "{",
|
||||
token: "paren.lparen",
|
||||
next: [{
|
||||
regex: "}",
|
||||
token: "paren.rparen",
|
||||
next: "start"
|
||||
}, {
|
||||
regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
|
||||
token: "keyword"
|
||||
}]
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : "identifier",
|
||||
regex : "\\w+"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "."
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
regex: "", // exit if there is anything else
|
||||
next: "start"
|
||||
}]
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
||||
}, {
|
||||
token : "lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
token : "rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : "\\*\\/",
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken : "comment"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
oop.inherits(JavaHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.JavaHighlightRules = JavaHighlightRules;
|
||||
});
|
||||
|
||||
ace.define("ace/mode/java",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/java_highlight_rules"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var JavaScriptMode = require("./javascript").Mode;
|
||||
var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
JavaScriptMode.call(this);
|
||||
this.HighlightRules = JavaHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, JavaScriptMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.createWorker = function(session) {
|
||||
return null;
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/java";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/mode/java"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -0,0 +1,870 @@
|
||||
ace.define("ace/snippets/html",["require","exports","module"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = "# Some useful Unicode entities\n\
|
||||
# Non-Breaking Space\n\
|
||||
snippet nbs\n\
|
||||
\n\
|
||||
# ←\n\
|
||||
snippet left\n\
|
||||
←\n\
|
||||
# →\n\
|
||||
snippet right\n\
|
||||
→\n\
|
||||
# ↑\n\
|
||||
snippet up\n\
|
||||
↑\n\
|
||||
# ↓\n\
|
||||
snippet down\n\
|
||||
↓\n\
|
||||
# ↩\n\
|
||||
snippet return\n\
|
||||
↩\n\
|
||||
# ⇤\n\
|
||||
snippet backtab\n\
|
||||
⇤\n\
|
||||
# ⇥\n\
|
||||
snippet tab\n\
|
||||
⇥\n\
|
||||
# ⇧\n\
|
||||
snippet shift\n\
|
||||
⇧\n\
|
||||
# ⌃\n\
|
||||
snippet ctrl\n\
|
||||
⌃\n\
|
||||
# ⌅\n\
|
||||
snippet enter\n\
|
||||
⌅\n\
|
||||
# ⌘\n\
|
||||
snippet cmd\n\
|
||||
⌘\n\
|
||||
# ⌥\n\
|
||||
snippet option\n\
|
||||
⌥\n\
|
||||
# ⌦\n\
|
||||
snippet delete\n\
|
||||
⌦\n\
|
||||
# ⌫\n\
|
||||
snippet backspace\n\
|
||||
⌫\n\
|
||||
# ⎋\n\
|
||||
snippet esc\n\
|
||||
⎋\n\
|
||||
# Generic Doctype\n\
|
||||
snippet doctype HTML 4.01 Strict\n\
|
||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\
|
||||
\"http://www.w3.org/TR/html4/strict.dtd\">\n\
|
||||
snippet doctype HTML 4.01 Transitional\n\
|
||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\
|
||||
\"http://www.w3.org/TR/html4/loose.dtd\">\n\
|
||||
snippet doctype HTML 5\n\
|
||||
<!DOCTYPE HTML>\n\
|
||||
snippet doctype XHTML 1.0 Frameset\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
|
||||
snippet doctype XHTML 1.0 Strict\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
|
||||
snippet doctype XHTML 1.0 Transitional\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\
|
||||
snippet doctype XHTML 1.1\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\
|
||||
# HTML Doctype 4.01 Strict\n\
|
||||
snippet docts\n\
|
||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\
|
||||
\"http://www.w3.org/TR/html4/strict.dtd\">\n\
|
||||
# HTML Doctype 4.01 Transitional\n\
|
||||
snippet doct\n\
|
||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\
|
||||
\"http://www.w3.org/TR/html4/loose.dtd\">\n\
|
||||
# HTML Doctype 5\n\
|
||||
snippet doct5\n\
|
||||
<!DOCTYPE html>\n\
|
||||
# XHTML Doctype 1.0 Frameset\n\
|
||||
snippet docxf\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n\
|
||||
# XHTML Doctype 1.0 Strict\n\
|
||||
snippet docxs\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
|
||||
# XHTML Doctype 1.0 Transitional\n\
|
||||
snippet docxt\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\
|
||||
# XHTML Doctype 1.1\n\
|
||||
snippet docx\n\
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n\
|
||||
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\
|
||||
# html5shiv\n\
|
||||
snippet html5shiv\n\
|
||||
<!--[if lte IE 8]>\n\
|
||||
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js\"></script>\n\
|
||||
<![endif]-->\n\
|
||||
snippet html5printshiv\n\
|
||||
<!--[if lte IE 8]>\n\
|
||||
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js\"></script>\n\
|
||||
<![endif]-->\n\
|
||||
# Attributes\n\
|
||||
snippet attr\n\
|
||||
${1:attribute}=\"${2:property}\"\n\
|
||||
snippet attr+\n\
|
||||
${1:attribute}=\"${2:property}\" attr+${3}\n\
|
||||
snippet .\n\
|
||||
class=\"${1}\"${2}\n\
|
||||
snippet #\n\
|
||||
id=\"${1}\"${2}\n\
|
||||
snippet alt\n\
|
||||
alt=\"${1}\"${2}\n\
|
||||
snippet charset\n\
|
||||
charset=\"${1:utf-8}\"${2}\n\
|
||||
snippet data\n\
|
||||
data-${1}=\"${2:$1}\"${3}\n\
|
||||
snippet for\n\
|
||||
for=\"${1}\"${2}\n\
|
||||
snippet height\n\
|
||||
height=\"${1}\"${2}\n\
|
||||
snippet href\n\
|
||||
href=\"${1:#}\"${2}\n\
|
||||
snippet lang\n\
|
||||
lang=\"${1:en}\"${2}\n\
|
||||
snippet media\n\
|
||||
media=\"${1}\"${2}\n\
|
||||
snippet name\n\
|
||||
name=\"${1}\"${2}\n\
|
||||
snippet rel\n\
|
||||
rel=\"${1}\"${2}\n\
|
||||
snippet scope\n\
|
||||
scope=\"${1:row}\"${2}\n\
|
||||
snippet src\n\
|
||||
src=\"${1}\"${2}\n\
|
||||
snippet title=\n\
|
||||
title=\"${1}\"${2}\n\
|
||||
snippet type\n\
|
||||
type=\"${1}\"${2}\n\
|
||||
snippet value\n\
|
||||
value=\"${1}\"${2}\n\
|
||||
snippet width\n\
|
||||
width=\"${1}\"${2}\n\
|
||||
# Elements\n\
|
||||
snippet a\n\
|
||||
<a href=\"${1:#}\">${2:$1}</a>\n\
|
||||
snippet a.\n\
|
||||
<a class=\"${1}\" href=\"${2:#}\">${3:$1}</a>\n\
|
||||
snippet a#\n\
|
||||
<a id=\"${1}\" href=\"${2:#}\">${3:$1}</a>\n\
|
||||
snippet a:ext\n\
|
||||
<a href=\"http://${1:example.com}\">${2:$1}</a>\n\
|
||||
snippet a:mail\n\
|
||||
<a href=\"mailto:${1:joe@example.com}?subject=${2:feedback}\">${3:email me}</a>\n\
|
||||
snippet abbr\n\
|
||||
<abbr title=\"${1}\">${2}</abbr>\n\
|
||||
snippet address\n\
|
||||
<address>\n\
|
||||
${1}\n\
|
||||
</address>\n\
|
||||
snippet area\n\
|
||||
<area shape=\"${1:rect}\" coords=\"${2}\" href=\"${3}\" alt=\"${4}\" />\n\
|
||||
snippet area+\n\
|
||||
<area shape=\"${1:rect}\" coords=\"${2}\" href=\"${3}\" alt=\"${4}\" />\n\
|
||||
area+${5}\n\
|
||||
snippet area:c\n\
|
||||
<area shape=\"circle\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
|
||||
snippet area:d\n\
|
||||
<area shape=\"default\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
|
||||
snippet area:p\n\
|
||||
<area shape=\"poly\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
|
||||
snippet area:r\n\
|
||||
<area shape=\"rect\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
|
||||
snippet article\n\
|
||||
<article>\n\
|
||||
${1}\n\
|
||||
</article>\n\
|
||||
snippet article.\n\
|
||||
<article class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</article>\n\
|
||||
snippet article#\n\
|
||||
<article id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</article>\n\
|
||||
snippet aside\n\
|
||||
<aside>\n\
|
||||
${1}\n\
|
||||
</aside>\n\
|
||||
snippet aside.\n\
|
||||
<aside class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</aside>\n\
|
||||
snippet aside#\n\
|
||||
<aside id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</aside>\n\
|
||||
snippet audio\n\
|
||||
<audio src=\"${1}>${2}</audio>\n\
|
||||
snippet b\n\
|
||||
<b>${1}</b>\n\
|
||||
snippet base\n\
|
||||
<base href=\"${1}\" target=\"${2}\" />\n\
|
||||
snippet bdi\n\
|
||||
<bdi>${1}</bdo>\n\
|
||||
snippet bdo\n\
|
||||
<bdo dir=\"${1}\">${2}</bdo>\n\
|
||||
snippet bdo:l\n\
|
||||
<bdo dir=\"ltr\">${1}</bdo>\n\
|
||||
snippet bdo:r\n\
|
||||
<bdo dir=\"rtl\">${1}</bdo>\n\
|
||||
snippet blockquote\n\
|
||||
<blockquote>\n\
|
||||
${1}\n\
|
||||
</blockquote>\n\
|
||||
snippet body\n\
|
||||
<body>\n\
|
||||
${1}\n\
|
||||
</body>\n\
|
||||
snippet br\n\
|
||||
<br />${1}\n\
|
||||
snippet button\n\
|
||||
<button type=\"${1:submit}\">${2}</button>\n\
|
||||
snippet button.\n\
|
||||
<button class=\"${1:button}\" type=\"${2:submit}\">${3}</button>\n\
|
||||
snippet button#\n\
|
||||
<button id=\"${1}\" type=\"${2:submit}\">${3}</button>\n\
|
||||
snippet button:s\n\
|
||||
<button type=\"submit\">${1}</button>\n\
|
||||
snippet button:r\n\
|
||||
<button type=\"reset\">${1}</button>\n\
|
||||
snippet canvas\n\
|
||||
<canvas>\n\
|
||||
${1}\n\
|
||||
</canvas>\n\
|
||||
snippet caption\n\
|
||||
<caption>${1}</caption>\n\
|
||||
snippet cite\n\
|
||||
<cite>${1}</cite>\n\
|
||||
snippet code\n\
|
||||
<code>${1}</code>\n\
|
||||
snippet col\n\
|
||||
<col />${1}\n\
|
||||
snippet col+\n\
|
||||
<col />\n\
|
||||
col+${1}\n\
|
||||
snippet colgroup\n\
|
||||
<colgroup>\n\
|
||||
${1}\n\
|
||||
</colgroup>\n\
|
||||
snippet colgroup+\n\
|
||||
<colgroup>\n\
|
||||
<col />\n\
|
||||
col+${1}\n\
|
||||
</colgroup>\n\
|
||||
snippet command\n\
|
||||
<command type=\"command\" label=\"${1}\" icon=\"${2}\" />\n\
|
||||
snippet command:c\n\
|
||||
<command type=\"checkbox\" label=\"${1}\" icon=\"${2}\" />\n\
|
||||
snippet command:r\n\
|
||||
<command type=\"radio\" radiogroup=\"${1}\" label=\"${2}\" icon=\"${3}\" />\n\
|
||||
snippet datagrid\n\
|
||||
<datagrid>\n\
|
||||
${1}\n\
|
||||
</datagrid>\n\
|
||||
snippet datalist\n\
|
||||
<datalist>\n\
|
||||
${1}\n\
|
||||
</datalist>\n\
|
||||
snippet datatemplate\n\
|
||||
<datatemplate>\n\
|
||||
${1}\n\
|
||||
</datatemplate>\n\
|
||||
snippet dd\n\
|
||||
<dd>${1}</dd>\n\
|
||||
snippet dd.\n\
|
||||
<dd class=\"${1}\">${2}</dd>\n\
|
||||
snippet dd#\n\
|
||||
<dd id=\"${1}\">${2}</dd>\n\
|
||||
snippet del\n\
|
||||
<del>${1}</del>\n\
|
||||
snippet details\n\
|
||||
<details>${1}</details>\n\
|
||||
snippet dfn\n\
|
||||
<dfn>${1}</dfn>\n\
|
||||
snippet dialog\n\
|
||||
<dialog>\n\
|
||||
${1}\n\
|
||||
</dialog>\n\
|
||||
snippet div\n\
|
||||
<div>\n\
|
||||
${1}\n\
|
||||
</div>\n\
|
||||
snippet div.\n\
|
||||
<div class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</div>\n\
|
||||
snippet div#\n\
|
||||
<div id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</div>\n\
|
||||
snippet dl\n\
|
||||
<dl>\n\
|
||||
${1}\n\
|
||||
</dl>\n\
|
||||
snippet dl.\n\
|
||||
<dl class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</dl>\n\
|
||||
snippet dl#\n\
|
||||
<dl id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</dl>\n\
|
||||
snippet dl+\n\
|
||||
<dl>\n\
|
||||
<dt>${1}</dt>\n\
|
||||
<dd>${2}</dd>\n\
|
||||
dt+${3}\n\
|
||||
</dl>\n\
|
||||
snippet dt\n\
|
||||
<dt>${1}</dt>\n\
|
||||
snippet dt.\n\
|
||||
<dt class=\"${1}\">${2}</dt>\n\
|
||||
snippet dt#\n\
|
||||
<dt id=\"${1}\">${2}</dt>\n\
|
||||
snippet dt+\n\
|
||||
<dt>${1}</dt>\n\
|
||||
<dd>${2}</dd>\n\
|
||||
dt+${3}\n\
|
||||
snippet em\n\
|
||||
<em>${1}</em>\n\
|
||||
snippet embed\n\
|
||||
<embed src=${1} type=\"${2} />\n\
|
||||
snippet fieldset\n\
|
||||
<fieldset>\n\
|
||||
${1}\n\
|
||||
</fieldset>\n\
|
||||
snippet fieldset.\n\
|
||||
<fieldset class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</fieldset>\n\
|
||||
snippet fieldset#\n\
|
||||
<fieldset id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</fieldset>\n\
|
||||
snippet fieldset+\n\
|
||||
<fieldset>\n\
|
||||
<legend><span>${1}</span></legend>\n\
|
||||
${2}\n\
|
||||
</fieldset>\n\
|
||||
fieldset+${3}\n\
|
||||
snippet figcaption\n\
|
||||
<figcaption>${1}</figcaption>\n\
|
||||
snippet figure\n\
|
||||
<figure>${1}</figure>\n\
|
||||
snippet footer\n\
|
||||
<footer>\n\
|
||||
${1}\n\
|
||||
</footer>\n\
|
||||
snippet footer.\n\
|
||||
<footer class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</footer>\n\
|
||||
snippet footer#\n\
|
||||
<footer id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</footer>\n\
|
||||
snippet form\n\
|
||||
<form action=\"${1}\" method=\"${2:get}\" accept-charset=\"utf-8\">\n\
|
||||
${3}\n\
|
||||
</form>\n\
|
||||
snippet form.\n\
|
||||
<form class=\"${1}\" action=\"${2}\" method=\"${3:get}\" accept-charset=\"utf-8\">\n\
|
||||
${4}\n\
|
||||
</form>\n\
|
||||
snippet form#\n\
|
||||
<form id=\"${1}\" action=\"${2}\" method=\"${3:get}\" accept-charset=\"utf-8\">\n\
|
||||
${4}\n\
|
||||
</form>\n\
|
||||
snippet h1\n\
|
||||
<h1>${1}</h1>\n\
|
||||
snippet h1.\n\
|
||||
<h1 class=\"${1}\">${2}</h1>\n\
|
||||
snippet h1#\n\
|
||||
<h1 id=\"${1}\">${2}</h1>\n\
|
||||
snippet h2\n\
|
||||
<h2>${1}</h2>\n\
|
||||
snippet h2.\n\
|
||||
<h2 class=\"${1}\">${2}</h2>\n\
|
||||
snippet h2#\n\
|
||||
<h2 id=\"${1}\">${2}</h2>\n\
|
||||
snippet h3\n\
|
||||
<h3>${1}</h3>\n\
|
||||
snippet h3.\n\
|
||||
<h3 class=\"${1}\">${2}</h3>\n\
|
||||
snippet h3#\n\
|
||||
<h3 id=\"${1}\">${2}</h3>\n\
|
||||
snippet h4\n\
|
||||
<h4>${1}</h4>\n\
|
||||
snippet h4.\n\
|
||||
<h4 class=\"${1}\">${2}</h4>\n\
|
||||
snippet h4#\n\
|
||||
<h4 id=\"${1}\">${2}</h4>\n\
|
||||
snippet h5\n\
|
||||
<h5>${1}</h5>\n\
|
||||
snippet h5.\n\
|
||||
<h5 class=\"${1}\">${2}</h5>\n\
|
||||
snippet h5#\n\
|
||||
<h5 id=\"${1}\">${2}</h5>\n\
|
||||
snippet h6\n\
|
||||
<h6>${1}</h6>\n\
|
||||
snippet h6.\n\
|
||||
<h6 class=\"${1}\">${2}</h6>\n\
|
||||
snippet h6#\n\
|
||||
<h6 id=\"${1}\">${2}</h6>\n\
|
||||
snippet head\n\
|
||||
<head>\n\
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
|
||||
\n\
|
||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
|
||||
${2}\n\
|
||||
</head>\n\
|
||||
snippet header\n\
|
||||
<header>\n\
|
||||
${1}\n\
|
||||
</header>\n\
|
||||
snippet header.\n\
|
||||
<header class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</header>\n\
|
||||
snippet header#\n\
|
||||
<header id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</header>\n\
|
||||
snippet hgroup\n\
|
||||
<hgroup>\n\
|
||||
${1}\n\
|
||||
</hgroup>\n\
|
||||
snippet hgroup.\n\
|
||||
<hgroup class=\"${1}>\n\
|
||||
${2}\n\
|
||||
</hgroup>\n\
|
||||
snippet hr\n\
|
||||
<hr />${1}\n\
|
||||
snippet html\n\
|
||||
<html>\n\
|
||||
${1}\n\
|
||||
</html>\n\
|
||||
snippet xhtml\n\
|
||||
<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\
|
||||
${1}\n\
|
||||
</html>\n\
|
||||
snippet html5\n\
|
||||
<!DOCTYPE html>\n\
|
||||
<html>\n\
|
||||
<head>\n\
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
|
||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
|
||||
${2:meta}\n\
|
||||
</head>\n\
|
||||
<body>\n\
|
||||
${3:body}\n\
|
||||
</body>\n\
|
||||
</html>\n\
|
||||
snippet xhtml5\n\
|
||||
<!DOCTYPE html>\n\
|
||||
<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\
|
||||
<head>\n\
|
||||
<meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=utf-8\" />\n\
|
||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
|
||||
${2:meta}\n\
|
||||
</head>\n\
|
||||
<body>\n\
|
||||
${3:body}\n\
|
||||
</body>\n\
|
||||
</html>\n\
|
||||
snippet i\n\
|
||||
<i>${1}</i>\n\
|
||||
snippet iframe\n\
|
||||
<iframe src=\"${1}\" frameborder=\"0\"></iframe>${2}\n\
|
||||
snippet iframe.\n\
|
||||
<iframe class=\"${1}\" src=\"${2}\" frameborder=\"0\"></iframe>${3}\n\
|
||||
snippet iframe#\n\
|
||||
<iframe id=\"${1}\" src=\"${2}\" frameborder=\"0\"></iframe>${3}\n\
|
||||
snippet img\n\
|
||||
<img src=\"${1}\" alt=\"${2}\" />${3}\n\
|
||||
snippet img.\n\
|
||||
<img class=\"${1}\" src=\"${2}\" alt=\"${3}\" />${4}\n\
|
||||
snippet img#\n\
|
||||
<img id=\"${1}\" src=\"${2}\" alt=\"${3}\" />${4}\n\
|
||||
snippet input\n\
|
||||
<input type=\"${1:text/submit/hidden/button/image}\" name=\"${2}\" id=\"${3:$2}\" value=\"${4}\" />${5}\n\
|
||||
snippet input.\n\
|
||||
<input class=\"${1}\" type=\"${2:text/submit/hidden/button/image}\" name=\"${3}\" id=\"${4:$3}\" value=\"${5}\" />${6}\n\
|
||||
snippet input:text\n\
|
||||
<input type=\"text\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:submit\n\
|
||||
<input type=\"submit\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:hidden\n\
|
||||
<input type=\"hidden\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:button\n\
|
||||
<input type=\"button\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:image\n\
|
||||
<input type=\"image\" name=\"${1}\" id=\"${2:$1}\" src=\"${3}\" alt=\"${4}\" />${5}\n\
|
||||
snippet input:checkbox\n\
|
||||
<input type=\"checkbox\" name=\"${1}\" id=\"${2:$1}\" />${3}\n\
|
||||
snippet input:radio\n\
|
||||
<input type=\"radio\" name=\"${1}\" id=\"${2:$1}\" />${3}\n\
|
||||
snippet input:color\n\
|
||||
<input type=\"color\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:date\n\
|
||||
<input type=\"date\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:datetime\n\
|
||||
<input type=\"datetime\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:datetime-local\n\
|
||||
<input type=\"datetime-local\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:email\n\
|
||||
<input type=\"email\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:file\n\
|
||||
<input type=\"file\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:month\n\
|
||||
<input type=\"month\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:number\n\
|
||||
<input type=\"number\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:password\n\
|
||||
<input type=\"password\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:range\n\
|
||||
<input type=\"range\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:reset\n\
|
||||
<input type=\"reset\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:search\n\
|
||||
<input type=\"search\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:time\n\
|
||||
<input type=\"time\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:url\n\
|
||||
<input type=\"url\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet input:week\n\
|
||||
<input type=\"week\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
|
||||
snippet ins\n\
|
||||
<ins>${1}</ins>\n\
|
||||
snippet kbd\n\
|
||||
<kbd>${1}</kbd>\n\
|
||||
snippet keygen\n\
|
||||
<keygen>${1}</keygen>\n\
|
||||
snippet label\n\
|
||||
<label for=\"${2:$1}\">${1}</label>\n\
|
||||
snippet label:i\n\
|
||||
<label for=\"${2:$1}\">${1}</label>\n\
|
||||
<input type=\"${3:text/submit/hidden/button}\" name=\"${4:$2}\" id=\"${5:$2}\" value=\"${6}\" />${7}\n\
|
||||
snippet label:s\n\
|
||||
<label for=\"${2:$1}\">${1}</label>\n\
|
||||
<select name=\"${3:$2}\" id=\"${4:$2}\">\n\
|
||||
<option value=\"${5}\">${6:$5}</option>\n\
|
||||
</select>\n\
|
||||
snippet legend\n\
|
||||
<legend>${1}</legend>\n\
|
||||
snippet legend+\n\
|
||||
<legend><span>${1}</span></legend>\n\
|
||||
snippet li\n\
|
||||
<li>${1}</li>\n\
|
||||
snippet li.\n\
|
||||
<li class=\"${1}\">${2}</li>\n\
|
||||
snippet li+\n\
|
||||
<li>${1}</li>\n\
|
||||
li+${2}\n\
|
||||
snippet lia\n\
|
||||
<li><a href=\"${2:#}\">${1}</a></li>\n\
|
||||
snippet lia+\n\
|
||||
<li><a href=\"${2:#}\">${1}</a></li>\n\
|
||||
lia+${3}\n\
|
||||
snippet link\n\
|
||||
<link rel=\"${1}\" href=\"${2}\" title=\"${3}\" type=\"${4}\" />${5}\n\
|
||||
snippet link:atom\n\
|
||||
<link rel=\"alternate\" href=\"${1:atom.xml}\" title=\"Atom\" type=\"application/atom+xml\" />${2}\n\
|
||||
snippet link:css\n\
|
||||
<link rel=\"stylesheet\" href=\"${2:style.css}\" type=\"text/css\" media=\"${3:all}\" />${4}\n\
|
||||
snippet link:favicon\n\
|
||||
<link rel=\"shortcut icon\" href=\"${1:favicon.ico}\" type=\"image/x-icon\" />${2}\n\
|
||||
snippet link:rss\n\
|
||||
<link rel=\"alternate\" href=\"${1:rss.xml}\" title=\"RSS\" type=\"application/atom+xml\" />${2}\n\
|
||||
snippet link:touch\n\
|
||||
<link rel=\"apple-touch-icon\" href=\"${1:favicon.png}\" />${2}\n\
|
||||
snippet map\n\
|
||||
<map name=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</map>\n\
|
||||
snippet map.\n\
|
||||
<map class=\"${1}\" name=\"${2}\">\n\
|
||||
${3}\n\
|
||||
</map>\n\
|
||||
snippet map#\n\
|
||||
<map name=\"${1}\" id=\"${2:$1}>\n\
|
||||
${3}\n\
|
||||
</map>\n\
|
||||
snippet map+\n\
|
||||
<map name=\"${1}\">\n\
|
||||
<area shape=\"${2}\" coords=\"${3}\" href=\"${4}\" alt=\"${5}\" />${6}\n\
|
||||
</map>${7}\n\
|
||||
snippet mark\n\
|
||||
<mark>${1}</mark>\n\
|
||||
snippet menu\n\
|
||||
<menu>\n\
|
||||
${1}\n\
|
||||
</menu>\n\
|
||||
snippet menu:c\n\
|
||||
<menu type=\"context\">\n\
|
||||
${1}\n\
|
||||
</menu>\n\
|
||||
snippet menu:t\n\
|
||||
<menu type=\"toolbar\">\n\
|
||||
${1}\n\
|
||||
</menu>\n\
|
||||
snippet meta\n\
|
||||
<meta http-equiv=\"${1}\" content=\"${2}\" />${3}\n\
|
||||
snippet meta:compat\n\
|
||||
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=${1:7,8,edge}\" />${3}\n\
|
||||
snippet meta:refresh\n\
|
||||
<meta http-equiv=\"refresh\" content=\"text/html;charset=UTF-8\" />${3}\n\
|
||||
snippet meta:utf\n\
|
||||
<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />${3}\n\
|
||||
snippet meter\n\
|
||||
<meter>${1}</meter>\n\
|
||||
snippet nav\n\
|
||||
<nav>\n\
|
||||
${1}\n\
|
||||
</nav>\n\
|
||||
snippet nav.\n\
|
||||
<nav class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</nav>\n\
|
||||
snippet nav#\n\
|
||||
<nav id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</nav>\n\
|
||||
snippet noscript\n\
|
||||
<noscript>\n\
|
||||
${1}\n\
|
||||
</noscript>\n\
|
||||
snippet object\n\
|
||||
<object data=\"${1}\" type=\"${2}\">\n\
|
||||
${3}\n\
|
||||
</object>${4}\n\
|
||||
# Embed QT Movie\n\
|
||||
snippet movie\n\
|
||||
<object width=\"$2\" height=\"$3\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"\n\
|
||||
codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">\n\
|
||||
<param name=\"src\" value=\"$1\" />\n\
|
||||
<param name=\"controller\" value=\"$4\" />\n\
|
||||
<param name=\"autoplay\" value=\"$5\" />\n\
|
||||
<embed src=\"${1:movie.mov}\"\n\
|
||||
width=\"${2:320}\" height=\"${3:240}\"\n\
|
||||
controller=\"${4:true}\" autoplay=\"${5:true}\"\n\
|
||||
scale=\"tofit\" cache=\"true\"\n\
|
||||
pluginspage=\"http://www.apple.com/quicktime/download/\" />\n\
|
||||
</object>${6}\n\
|
||||
snippet ol\n\
|
||||
<ol>\n\
|
||||
${1}\n\
|
||||
</ol>\n\
|
||||
snippet ol.\n\
|
||||
<ol class=\"${1}>\n\
|
||||
${2}\n\
|
||||
</ol>\n\
|
||||
snippet ol#\n\
|
||||
<ol id=\"${1}>\n\
|
||||
${2}\n\
|
||||
</ol>\n\
|
||||
snippet ol+\n\
|
||||
<ol>\n\
|
||||
<li>${1}</li>\n\
|
||||
li+${2}\n\
|
||||
</ol>\n\
|
||||
snippet opt\n\
|
||||
<option value=\"${1}\">${2:$1}</option>\n\
|
||||
snippet opt+\n\
|
||||
<option value=\"${1}\">${2:$1}</option>\n\
|
||||
opt+${3}\n\
|
||||
snippet optt\n\
|
||||
<option>${1}</option>\n\
|
||||
snippet optgroup\n\
|
||||
<optgroup>\n\
|
||||
<option value=\"${1}\">${2:$1}</option>\n\
|
||||
opt+${3}\n\
|
||||
</optgroup>\n\
|
||||
snippet output\n\
|
||||
<output>${1}</output>\n\
|
||||
snippet p\n\
|
||||
<p>${1}</p>\n\
|
||||
snippet param\n\
|
||||
<param name=\"${1}\" value=\"${2}\" />${3}\n\
|
||||
snippet pre\n\
|
||||
<pre>\n\
|
||||
${1}\n\
|
||||
</pre>\n\
|
||||
snippet progress\n\
|
||||
<progress>${1}</progress>\n\
|
||||
snippet q\n\
|
||||
<q>${1}</q>\n\
|
||||
snippet rp\n\
|
||||
<rp>${1}</rp>\n\
|
||||
snippet rt\n\
|
||||
<rt>${1}</rt>\n\
|
||||
snippet ruby\n\
|
||||
<ruby>\n\
|
||||
<rp><rt>${1}</rt></rp>\n\
|
||||
</ruby>\n\
|
||||
snippet s\n\
|
||||
<s>${1}</s>\n\
|
||||
snippet samp\n\
|
||||
<samp>\n\
|
||||
${1}\n\
|
||||
</samp>\n\
|
||||
snippet script\n\
|
||||
<script type=\"text/javascript\" charset=\"utf-8\">\n\
|
||||
${1}\n\
|
||||
</script>\n\
|
||||
snippet scriptsrc\n\
|
||||
<script src=\"${1}.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\
|
||||
snippet newscript\n\
|
||||
<script type=\"application/javascript\" charset=\"utf-8\">\n\
|
||||
${1}\n\
|
||||
</script>\n\
|
||||
snippet newscriptsrc\n\
|
||||
<script src=\"${1}.js\" type=\"application/javascript\" charset=\"utf-8\"></script>\n\
|
||||
snippet section\n\
|
||||
<section>\n\
|
||||
${1}\n\
|
||||
</section>\n\
|
||||
snippet section.\n\
|
||||
<section class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</section>\n\
|
||||
snippet section#\n\
|
||||
<section id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</section>\n\
|
||||
snippet select\n\
|
||||
<select name=\"${1}\" id=\"${2:$1}\">\n\
|
||||
${3}\n\
|
||||
</select>\n\
|
||||
snippet select.\n\
|
||||
<select name=\"${1}\" id=\"${2:$1}\" class=\"${3}>\n\
|
||||
${4}\n\
|
||||
</select>\n\
|
||||
snippet select+\n\
|
||||
<select name=\"${1}\" id=\"${2:$1}\">\n\
|
||||
<option value=\"${3}\">${4:$3}</option>\n\
|
||||
opt+${5}\n\
|
||||
</select>\n\
|
||||
snippet small\n\
|
||||
<small>${1}</small>\n\
|
||||
snippet source\n\
|
||||
<source src=\"${1}\" type=\"${2}\" media=\"${3}\" />\n\
|
||||
snippet span\n\
|
||||
<span>${1}</span>\n\
|
||||
snippet strong\n\
|
||||
<strong>${1}</strong>\n\
|
||||
snippet style\n\
|
||||
<style type=\"text/css\" media=\"${1:all}\">\n\
|
||||
${2}\n\
|
||||
</style>\n\
|
||||
snippet sub\n\
|
||||
<sub>${1}</sub>\n\
|
||||
snippet summary\n\
|
||||
<summary>\n\
|
||||
${1}\n\
|
||||
</summary>\n\
|
||||
snippet sup\n\
|
||||
<sup>${1}</sup>\n\
|
||||
snippet table\n\
|
||||
<table border=\"${1:0}\">\n\
|
||||
${2}\n\
|
||||
</table>\n\
|
||||
snippet table.\n\
|
||||
<table class=\"${1}\" border=\"${2:0}\">\n\
|
||||
${3}\n\
|
||||
</table>\n\
|
||||
snippet table#\n\
|
||||
<table id=\"${1}\" border=\"${2:0}\">\n\
|
||||
${3}\n\
|
||||
</table>\n\
|
||||
snippet tbody\n\
|
||||
<tbody>\n\
|
||||
${1}\n\
|
||||
</tbody>\n\
|
||||
snippet td\n\
|
||||
<td>${1}</td>\n\
|
||||
snippet td.\n\
|
||||
<td class=\"${1}\">${2}</td>\n\
|
||||
snippet td#\n\
|
||||
<td id=\"${1}\">${2}</td>\n\
|
||||
snippet td+\n\
|
||||
<td>${1}</td>\n\
|
||||
td+${2}\n\
|
||||
snippet textarea\n\
|
||||
<textarea name=\"${1}\" id=${2:$1} rows=\"${3:8}\" cols=\"${4:40}\">${5}</textarea>${6}\n\
|
||||
snippet tfoot\n\
|
||||
<tfoot>\n\
|
||||
${1}\n\
|
||||
</tfoot>\n\
|
||||
snippet th\n\
|
||||
<th>${1}</th>\n\
|
||||
snippet th.\n\
|
||||
<th class=\"${1}\">${2}</th>\n\
|
||||
snippet th#\n\
|
||||
<th id=\"${1}\">${2}</th>\n\
|
||||
snippet th+\n\
|
||||
<th>${1}</th>\n\
|
||||
th+${2}\n\
|
||||
snippet thead\n\
|
||||
<thead>\n\
|
||||
${1}\n\
|
||||
</thead>\n\
|
||||
snippet time\n\
|
||||
<time datetime=\"${1}\" pubdate=\"${2:$1}>${3:$1}</time>\n\
|
||||
snippet title\n\
|
||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
|
||||
snippet tr\n\
|
||||
<tr>\n\
|
||||
${1}\n\
|
||||
</tr>\n\
|
||||
snippet tr+\n\
|
||||
<tr>\n\
|
||||
<td>${1}</td>\n\
|
||||
td+${2}\n\
|
||||
</tr>\n\
|
||||
snippet track\n\
|
||||
<track src=\"${1}\" srclang=\"${2}\" label=\"${3}\" default=\"${4:default}>${5}</track>${6}\n\
|
||||
snippet ul\n\
|
||||
<ul>\n\
|
||||
${1}\n\
|
||||
</ul>\n\
|
||||
snippet ul.\n\
|
||||
<ul class=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</ul>\n\
|
||||
snippet ul#\n\
|
||||
<ul id=\"${1}\">\n\
|
||||
${2}\n\
|
||||
</ul>\n\
|
||||
snippet ul+\n\
|
||||
<ul>\n\
|
||||
<li>${1}</li>\n\
|
||||
li+${2}\n\
|
||||
</ul>\n\
|
||||
snippet var\n\
|
||||
<var>${1}</var>\n\
|
||||
snippet video\n\
|
||||
<video src=\"${1} height=\"${2}\" width=\"${3}\" preload=\"${5:none}\" autoplay=\"${6:autoplay}>${7}</video>${8}\n\
|
||||
snippet wbr\n\
|
||||
<wbr />${1}\n\
|
||||
";
|
||||
exports.scope = "html";
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/snippets/html"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user