Merge remote branch 'upstream/master' into requirejs
Conflicts: demo/boot.js package.json
3
.gitignore
vendored
|
|
@ -11,4 +11,5 @@
|
|||
.*.gz
|
||||
|
||||
# A handy place to put stuff that git should ignore:
|
||||
/ignore/
|
||||
/ignore/
|
||||
/build/
|
||||
|
|
|
|||
6
.gitmodules
vendored
|
|
@ -22,3 +22,9 @@
|
|||
[submodule "support/cockpit"]
|
||||
path = support/cockpit
|
||||
url = git://github.com/ajaxorg/cockpit.git
|
||||
[submodule "support/pilot"]
|
||||
path = support/pilot
|
||||
url = git://github.com/ajaxorg/pilot.git
|
||||
[submodule "support/dryice"]
|
||||
path = support/dryice
|
||||
url = git://github.com/mozilla/dryice.git
|
||||
|
|
|
|||
639
LICENSE
|
|
@ -1,165 +1,476 @@
|
|||
Licensed under the tri-license MPL/LGPL/GPL.
|
||||
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
---------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.0.1. "Commercial Use" means distribution or otherwise making the
|
||||
Covered Code available to a third party.
|
||||
|
||||
1.1. "Contributor" means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. "Contributor Version" means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. "Covered Code" means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. "Electronic Distribution Mechanism" means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. "Executable" means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. "Initial Developer" means the individual or entity identified
|
||||
as the Initial Developer in the Source Code notice required by Exhibit
|
||||
A.
|
||||
|
||||
1.7. "Larger Work" means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. "License" means this document.
|
||||
|
||||
1.8.1. "Licensable" means having the right to grant, to the maximum
|
||||
extent possible, whether at the time of the initial grant or
|
||||
subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. "Modifications" means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. "Original Code" means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this
|
||||
License is not already Covered Code governed by this License.
|
||||
|
||||
1.10.1. "Patent Claims" means any patent claim(s), now owned or
|
||||
hereafter acquired, including without limitation, method, process,
|
||||
and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.11. "Source Code" means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus
|
||||
any associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. "You" (or "Your") means an individual or a legal entity
|
||||
exercising rights under, and complying with all of the terms of, this
|
||||
License or a future version of this License issued under Section 6.1.
|
||||
For legal entities, "You" includes any entity which controls, is
|
||||
controlled by, or is under common control with You. For purposes of
|
||||
this definition, "control" means (a) the power, direct or indirect,
|
||||
to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (b) ownership of more than fifty percent
|
||||
(50%) of the outstanding shares or beneficial ownership of such
|
||||
entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Initial Developer to use, reproduce,
|
||||
modify, display, perform, sublicense and distribute the Original
|
||||
Code (or portions thereof) with or without Modifications, and/or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patents Claims infringed by the making, using or
|
||||
selling of Original Code, to make, have made, use, practice,
|
||||
sell, and offer for sale, and/or otherwise dispose of the
|
||||
Original Code (or portions thereof).
|
||||
|
||||
(c) the licenses granted in this Section 2.1(a) and (b) are
|
||||
effective on the date Initial Developer first distributes
|
||||
Original Code under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2)
|
||||
separate from the Original Code; or 3) for infringements caused
|
||||
by: i) the modification of the Original Code or ii) the
|
||||
combination of the Original Code with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Subject to third party intellectual property claims, each Contributor
|
||||
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||
display, perform, sublicense and distribute the Modifications
|
||||
created by such Contributor (or portions thereof) either on an
|
||||
unmodified basis, with other Modifications, as Covered Code
|
||||
and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or
|
||||
selling of Modifications made by that Contributor either alone
|
||||
and/or in combination with its Contributor Version (or portions
|
||||
of such combination), to make, use, sell, offer for sale, have
|
||||
made, and/or otherwise dispose of: 1) Modifications made by that
|
||||
Contributor (or portions thereof); and 2) the combination of
|
||||
Modifications made by that Contributor with its Contributor
|
||||
Version (or portions of such combination).
|
||||
|
||||
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
|
||||
effective on the date Contributor first makes Commercial Use of
|
||||
the Covered Code.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is
|
||||
granted: 1) for any code that Contributor has deleted from the
|
||||
Contributor Version; 2) separate from the Contributor Version;
|
||||
3) for infringements caused by: i) third party modifications of
|
||||
Contributor Version or ii) the combination of Modifications made
|
||||
by that Contributor with other software (except as part of the
|
||||
Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by
|
||||
that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be
|
||||
distributed only under the terms of this License or a future version
|
||||
of this License released under Section 6.1, and You must include a
|
||||
copy of this License with every copy of the Source Code You
|
||||
distribute. You may not offer or impose any terms on any Source Code
|
||||
version that alters or restricts the applicable version of this
|
||||
License or the recipients' rights hereunder. However, You may include
|
||||
an additional document offering the additional rights described in
|
||||
Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which You contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that
|
||||
the Modification is derived, directly or indirectly, from Original
|
||||
Code provided by the Initial Developer and including the name of the
|
||||
Initial Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
(a) Third Party Claims.
|
||||
If Contributor has knowledge that a license under a third party's
|
||||
intellectual property rights is required to exercise the rights
|
||||
granted by such Contributor under Sections 2.1 or 2.2,
|
||||
Contributor must include a text file with the Source Code
|
||||
distribution titled "LEGAL" which describes the claim and the
|
||||
party making the claim in sufficient detail that a recipient will
|
||||
know whom to contact. If Contributor obtains such knowledge after
|
||||
the Modification is made available as described in Section 3.2,
|
||||
Contributor shall promptly modify the LEGAL file in all copies
|
||||
Contributor makes available thereafter and shall take other steps
|
||||
(such as notifying appropriate mailing lists or newsgroups)
|
||||
reasonably calculated to inform those who received the Covered
|
||||
Code that new knowledge has been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Contributor's Modifications include an application programming
|
||||
interface and Contributor has knowledge of patent licenses which
|
||||
are reasonably necessary to implement that API, Contributor must
|
||||
also include this information in the LEGAL file.
|
||||
|
||||
(c) Representations.
|
||||
Contributor represents that, except as disclosed pursuant to
|
||||
Section 3.4(a) above, Contributor believes that Contributor's
|
||||
Modifications are Contributor's original creation(s) and/or
|
||||
Contributor has sufficient rights to grant the rights conveyed by
|
||||
this License.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code. If it is not possible to put such notice in a particular Source
|
||||
Code file due to its structure, then You must include such notice in a
|
||||
location (such as a relevant directory) where a user would be likely
|
||||
to look for such a notice. If You created one or more Modification(s)
|
||||
You may add your name as a Contributor to the notice described in
|
||||
Exhibit A. You must also duplicate this License in any documentation
|
||||
for the Source Code where You describe recipients' rights or ownership
|
||||
rights relating to Covered Code. You may choose to offer, and to
|
||||
charge a fee for, warranty, support, indemnity or liability
|
||||
obligations to one or more recipients of Covered Code. However, You
|
||||
may do so only on Your own behalf, and not on behalf of the Initial
|
||||
Developer or any Contributor. You must make it absolutely clear than
|
||||
any such warranty, support, indemnity or liability obligation is
|
||||
offered by You alone, and You hereby agree to indemnify the Initial
|
||||
Developer and every Contributor for any liability incurred by the
|
||||
Initial Developer or such Contributor as a result of warranty,
|
||||
support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of
|
||||
the Covered Code is available under the terms of this License,
|
||||
including a description of how and where You have fulfilled the
|
||||
obligations of Section 3.2. The notice must be conspicuously included
|
||||
in any notice in an Executable version, related documentation or
|
||||
collateral in which You describe recipients' rights relating to the
|
||||
Covered Code. You may distribute the Executable version of Covered
|
||||
Code or ownership rights under a license of Your choice, which may
|
||||
contain terms different from this License, provided that You are in
|
||||
compliance with the terms of this License and that the license for the
|
||||
Executable version does not attempt to limit or alter the recipient's
|
||||
rights in the Source Code version from the rights set forth in this
|
||||
License. If You distribute the Executable version under a different
|
||||
license You must make it absolutely clear that any terms which differ
|
||||
from this License are offered by You alone, not by the Initial
|
||||
Developer or any Contributor. You hereby agree to indemnify the
|
||||
Initial Developer and every Contributor for any liability incurred by
|
||||
the Initial Developer or such Contributor as a result of any such
|
||||
terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description
|
||||
must be included in the LEGAL file described in Section 3.4 and must
|
||||
be included with all distributions of the Source Code. Except to the
|
||||
extent prohibited by statute or regulation, such description must be
|
||||
sufficiently detailed for a recipient of ordinary skill to be able to
|
||||
understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation ("Netscape") may publish revised
|
||||
and/or new versions of the License from time to time. Each version
|
||||
will be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If You create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), You must (a) rename Your license so that
|
||||
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
|
||||
"MPL", "NPL" or any confusingly similar phrase do not appear in your
|
||||
license (except to note that your license differs from this License)
|
||||
and (b) otherwise make it clear that Your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial
|
||||
Developer, Original Code or Contributor in the notice described in
|
||||
Exhibit A shall not of themselves be deemed to be modifications of
|
||||
this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
8.1. This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
8.2. If You initiate litigation by asserting a patent infringement
|
||||
claim (excluding declatory judgment actions) against Initial Developer
|
||||
or a Contributor (the Initial Developer or Contributor against whom
|
||||
You file such action is referred to as "Participant") alleging that:
|
||||
|
||||
(a) such Participant's Contributor Version directly or indirectly
|
||||
infringes any patent, then any and all rights granted by such
|
||||
Participant to You under Sections 2.1 and/or 2.2 of this License
|
||||
shall, upon 60 days notice from Participant terminate prospectively,
|
||||
unless if within 60 days after receipt of notice You either: (i)
|
||||
agree in writing to pay Participant a mutually agreeable reasonable
|
||||
royalty for Your past and future use of Modifications made by such
|
||||
Participant, or (ii) withdraw Your litigation claim with respect to
|
||||
the Contributor Version against such Participant. If within 60 days
|
||||
of notice, a reasonable royalty and payment arrangement are not
|
||||
mutually agreed upon in writing by the parties or the litigation claim
|
||||
is not withdrawn, the rights granted by Participant to You under
|
||||
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
|
||||
the 60 day notice period specified above.
|
||||
|
||||
(b) any software, hardware, or device, other than such Participant's
|
||||
Contributor Version, directly or indirectly infringes any patent, then
|
||||
any rights granted to You by such Participant under Sections 2.1(b)
|
||||
and 2.2(b) are revoked effective as of the date You first made, used,
|
||||
sold, distributed, or had made, Modifications made by that
|
||||
Participant.
|
||||
|
||||
8.3. If You assert a patent infringement claim against Participant
|
||||
alleging that such Participant's Contributor Version directly or
|
||||
indirectly infringes any patent where such claim is resolved (such as
|
||||
by license or settlement) prior to the initiation of patent
|
||||
infringement litigation, then the reasonable value of the licenses
|
||||
granted by such Participant under Sections 2.1 or 2.2 shall be taken
|
||||
into account in determining the amount or value of any payment or
|
||||
license.
|
||||
|
||||
8.4. In the event of termination under Sections 8.1 or 8.2 above,
|
||||
all end user license agreements (excluding distributors and resellers)
|
||||
which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
|
||||
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
|
||||
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
|
||||
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
|
||||
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
|
||||
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a "commercial item," as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
|
||||
software" and "commercial computer software documentation," as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if
|
||||
any, provides otherwise), excluding its conflict-of-law provisions.
|
||||
With respect to disputes in which at least one party is a citizen of,
|
||||
or an entity chartered or registered to do business in the United
|
||||
States of America, any litigation relating to this License shall be
|
||||
subject to the jurisdiction of the Federal Courts of the Northern
|
||||
District of California, with venue lying in Santa Clara County,
|
||||
California, with the losing party responsible for costs, including
|
||||
without limitation, court costs and reasonable attorneys' fees and
|
||||
expenses. The application of the United Nations Convention on
|
||||
Contracts for the International Sale of Goods is expressly excluded.
|
||||
Any law or regulation which provides that the language of a contract
|
||||
shall be construed against the drafter shall not apply to this
|
||||
License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly,
|
||||
out of its utilization of rights under this License and You agree to
|
||||
work with Initial Developer and Contributors to distribute such
|
||||
responsibility on an equitable basis. Nothing herein is intended or
|
||||
shall be deemed to constitute any admission of liability.
|
||||
|
||||
13. MULTIPLE-LICENSED CODE.
|
||||
|
||||
Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under
|
||||
Your choice of the NPL or the alternative licenses, if any, specified
|
||||
by the Initial Developer in the file described in Exhibit A.
|
||||
|
||||
EXHIBIT A -Mozilla Public License.
|
||||
|
||||
``The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is ______________________________________.
|
||||
|
||||
The Initial Developer of the Original Code is ________________________.
|
||||
Portions created by ______________________ are Copyright (C) ______
|
||||
_______________________. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the _____ license (the "[___] License"), in which case the
|
||||
provisions of [______] License are applicable instead of those
|
||||
above. If you wish to allow use of your version of this file only
|
||||
under the terms of the [____] License and not to allow others to use
|
||||
your version of this file under the MPL, indicate your decision by
|
||||
deleting the provisions above and replace them with the notice and
|
||||
other provisions required by the [___] License. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file
|
||||
under either the MPL or the [___] License."
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. You should
|
||||
use the text of this Exhibit A rather than the text found in the
|
||||
Original Code Source Code for Your Modifications.]
|
||||
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
Version 3, 29 June 2007
|
||||
3
Makefile
|
|
@ -1,3 +0,0 @@
|
|||
package:
|
||||
rm -rf build
|
||||
support/requirejs/build/build.sh build.js
|
||||
1060
Makefile.dryice.js
Normal file
|
|
@ -1,6 +1,6 @@
|
|||
ACE (Ajax.org Code Editor)
|
||||
ACE (Ajax.org Cloud9 Editor)
|
||||
==========================
|
||||
|
||||
ACE is a standalone code editor written in JavaScript. It can be easily embedded in any web page and JavaScript application. It is currently used as the editor component of the [Cloud9 IDE](http://cloud9ide.com).
|
||||
ACE is a standalone code editor written in JavaScript. It can be easily embedded in any web page and JavaScript application. It is developed as the editor component for the [Cloud9 IDE](http://cloud9ide.com).
|
||||
|
||||
Checkout the [demo](http://ajaxorg.github.com/ace/editor-build.html)!
|
||||
|
|
|
|||
114
build.js
|
|
@ -1,114 +0,0 @@
|
|||
{
|
||||
baseUrl: "lib",
|
||||
dir: "build",
|
||||
|
||||
paths: {
|
||||
"ace": "ace",
|
||||
"demo": "../demo",
|
||||
"cockpit": "../support/cockpit/lib/cockpit",
|
||||
"pilot": "../support/cockpit/support/pilot/lib/pilot"
|
||||
},
|
||||
|
||||
//- "closure": uses Google's Closure Compiler in simple optimization
|
||||
//mode to minify the code.
|
||||
//- "closure.keepLines": Same as closure option, but keeps line returns
|
||||
//in the minified files.
|
||||
//- "none": no minification will be done.
|
||||
optimize: "closure.keepLines",
|
||||
//optimize: "none",
|
||||
inlineText: true,
|
||||
useStrict: false,
|
||||
|
||||
pragmas: {
|
||||
jquery: false,
|
||||
requireExcludeModify: true,
|
||||
requireExcludePlugin: false,
|
||||
requireExcludePageLoad: false
|
||||
},
|
||||
|
||||
skipPragmas: false,
|
||||
execModules: false,
|
||||
skipModuleInsertion: false,
|
||||
|
||||
modules: [
|
||||
{
|
||||
name: "demo/boot",
|
||||
include: [
|
||||
"pilot/fixoldbrowsers",
|
||||
"pilot/plugin_manager",
|
||||
"pilot/settings",
|
||||
"pilot/environment",
|
||||
"pilot/index",
|
||||
"cockpit/index",
|
||||
"demo/startup"
|
||||
]
|
||||
},
|
||||
/*{
|
||||
name: "demo/startup",
|
||||
includeRequire: false,
|
||||
include: [
|
||||
"pilot/fixoldbrowsers"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ace/editor",
|
||||
include: [
|
||||
"ace/document",
|
||||
"ace/undomanager",
|
||||
"ace/virtual_renderer",
|
||||
|
||||
"ace/mode/javascript",
|
||||
"ace/theme/textmate"
|
||||
],
|
||||
includeRequire: false
|
||||
},*/
|
||||
{
|
||||
name: "ace/theme/eclipse",
|
||||
exclude: [
|
||||
"pilot/lang",
|
||||
"pilot/dom",
|
||||
"pilot/oop"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ace/mode/xml",
|
||||
exclude: [
|
||||
"pilot/oop",
|
||||
"ace/tokenizer",
|
||||
"ace/mode/text"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ace/mode/css",
|
||||
exclude: [
|
||||
"pilot/oop",
|
||||
"pilot/lang",
|
||||
"ace/tokenizer",
|
||||
"ace/range",
|
||||
"ace/mode/text"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ace/mode/html",
|
||||
exclude: [
|
||||
"pilot/oop",
|
||||
"pilot/lang",
|
||||
"ace/tokenizer",
|
||||
"ace/range",
|
||||
"ace/mode/text",
|
||||
"ace/mode/javascript",
|
||||
"ace/mode/css",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ace/mode/python",
|
||||
exclude: [
|
||||
"pilot/oop",
|
||||
"pilot/lang",
|
||||
"ace/tokenizer",
|
||||
"ace/range",
|
||||
"ace/mode/text"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
define(function(f, i) {
|
||||
var j = f("pilot/oop"), k = f("pilot/event_emitter").EventEmitter;
|
||||
f = function(a, c) {
|
||||
this.running = false;
|
||||
this.textLines = [];
|
||||
this.lines = [];
|
||||
this.currentLine = 0;
|
||||
this.tokenizer = a;
|
||||
var b = this;
|
||||
this.$worker = function() {
|
||||
if(b.running) {
|
||||
for(var e = new Date, g = b.currentLine, d = b.textLines, h = 0, l = c.getLastVisibleRow();b.currentLine < d.length;) {
|
||||
b.lines[b.currentLine] = b.$tokenizeRows(b.currentLine, b.currentLine)[0];
|
||||
b.currentLine++;
|
||||
h += 1;
|
||||
if(h % 5 == 0 && new Date - e > 20) {
|
||||
b.fireUpdateEvent(g, b.currentLine - 1);
|
||||
b.running = setTimeout(b.$worker, b.currentLine < l ? 20 : 100);
|
||||
return
|
||||
}
|
||||
}b.running = false;
|
||||
b.fireUpdateEvent(g, d.length - 1)
|
||||
}
|
||||
}
|
||||
};
|
||||
(function() {
|
||||
j.implement(this, k);
|
||||
this.setTokenizer = function(a) {
|
||||
this.tokenizer = a;
|
||||
this.lines = [];
|
||||
this.start(0)
|
||||
};
|
||||
this.setLines = function(a) {
|
||||
this.textLines = a;
|
||||
this.lines = [];
|
||||
this.stop()
|
||||
};
|
||||
this.fireUpdateEvent = function(a, c) {
|
||||
this._dispatchEvent("update", {data:{first:a, last:c}})
|
||||
};
|
||||
this.start = function(a) {
|
||||
this.currentLine = Math.min(a || 0, this.currentLine, this.textLines.length);
|
||||
this.lines.splice(this.currentLine, this.lines.length);
|
||||
this.stop();
|
||||
this.running = setTimeout(this.$worker, 700)
|
||||
};
|
||||
this.stop = function() {
|
||||
this.running && clearTimeout(this.running);
|
||||
this.running = false
|
||||
};
|
||||
this.getTokens = function(a, c, b) {
|
||||
b(this.$tokenizeRows(a, c))
|
||||
};
|
||||
this.getState = function(a, c) {
|
||||
c(this.$tokenizeRows(a, a)[0].state)
|
||||
};
|
||||
this.$tokenizeRows = function(a, c) {
|
||||
var b = [], e = "start", g = false;
|
||||
if(a > 0 && this.lines[a - 1]) {
|
||||
e = this.lines[a - 1].state;
|
||||
g = true
|
||||
}for(a = a;a <= c;a++) {
|
||||
if(this.lines[a]) {
|
||||
d = this.lines[a];
|
||||
e = d.state;
|
||||
b.push(d)
|
||||
}else {
|
||||
var d = this.tokenizer.getLineTokens(this.textLines[a] || "", e);
|
||||
e = d.state;
|
||||
b.push(d);
|
||||
if(g) {
|
||||
this.lines[a] = d
|
||||
}
|
||||
}
|
||||
}return b
|
||||
}
|
||||
}).call(f.prototype);
|
||||
i.BackgroundTokenizer = f
|
||||
});
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
define(function(b) {
|
||||
b = b("pilot/canon");
|
||||
b.addCommand({name:"selectall", exec:function(a) {
|
||||
a.editor.getSelection().selectAll()
|
||||
}});
|
||||
b.addCommand({name:"removeline", exec:function(a) {
|
||||
a.editor.removeLines()
|
||||
}});
|
||||
b.addCommand({name:"gotoline", exec:function(a) {
|
||||
var c = parseInt(prompt("Enter line number:"));
|
||||
isNaN(c) || a.editor.gotoLine(c)
|
||||
}});
|
||||
b.addCommand({name:"togglecomment", exec:function(a) {
|
||||
a.editor.toggleCommentLines()
|
||||
}});
|
||||
b.addCommand({name:"findnext", exec:function(a) {
|
||||
a.editor.findNext()
|
||||
}});
|
||||
b.addCommand({name:"findprevious", exec:function(a) {
|
||||
a.editor.findPrevious()
|
||||
}});
|
||||
b.addCommand({name:"find", exec:function(a) {
|
||||
var c = prompt("Find:");
|
||||
a.editor.find(c)
|
||||
}});
|
||||
b.addCommand({name:"undo", exec:function(a) {
|
||||
a.editor.undo()
|
||||
}});
|
||||
b.addCommand({name:"redo", exec:function(a) {
|
||||
a.editor.redo()
|
||||
}});
|
||||
b.addCommand({name:"redo", exec:function(a) {
|
||||
a.editor.redo()
|
||||
}});
|
||||
b.addCommand({name:"overwrite", exec:function(a) {
|
||||
a.editor.toggleOverwrite()
|
||||
}});
|
||||
b.addCommand({name:"copylinesup", exec:function(a) {
|
||||
a.editor.copyLinesUp()
|
||||
}});
|
||||
b.addCommand({name:"movelinesup", exec:function(a) {
|
||||
a.editor.moveLinesUp()
|
||||
}});
|
||||
b.addCommand({name:"selecttostart", exec:function(a) {
|
||||
a.editor.getSelection().selectFileStart()
|
||||
}});
|
||||
b.addCommand({name:"gotostart", exec:function(a) {
|
||||
a.editor.navigateFileStart()
|
||||
}});
|
||||
b.addCommand({name:"selectup", exec:function(a) {
|
||||
a.editor.getSelection().selectUp()
|
||||
}});
|
||||
b.addCommand({name:"golineup", exec:function(a) {
|
||||
a.editor.navigateUp()
|
||||
}});
|
||||
b.addCommand({name:"copylinesdown", exec:function(a) {
|
||||
a.editor.copyLinesDown()
|
||||
}});
|
||||
b.addCommand({name:"movelinesdown", exec:function(a) {
|
||||
a.editor.moveLinesDown()
|
||||
}});
|
||||
b.addCommand({name:"selecttoend", exec:function(a) {
|
||||
a.editor.getSelection().selectFileEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotoend", exec:function(a) {
|
||||
a.editor.navigateFileEnd()
|
||||
}});
|
||||
b.addCommand({name:"selectdown", exec:function(a) {
|
||||
a.editor.getSelection().selectDown()
|
||||
}});
|
||||
b.addCommand({name:"godown", exec:function(a) {
|
||||
a.editor.navigateDown()
|
||||
}});
|
||||
b.addCommand({name:"selectwordleft", exec:function(a) {
|
||||
a.editor.getSelection().selectWordLeft()
|
||||
}});
|
||||
b.addCommand({name:"gotowordleft", exec:function(a) {
|
||||
a.editor.navigateWordLeft()
|
||||
}});
|
||||
b.addCommand({name:"selecttolinestart", exec:function(a) {
|
||||
a.editor.getSelection().selectLineStart()
|
||||
}});
|
||||
b.addCommand({name:"gotolinestart", exec:function(a) {
|
||||
a.editor.navigateLineStart()
|
||||
}});
|
||||
b.addCommand({name:"selectleft", exec:function(a) {
|
||||
a.editor.getSelection().selectLeft()
|
||||
}});
|
||||
b.addCommand({name:"gotoleft", exec:function(a) {
|
||||
a.editor.navigateLeft()
|
||||
}});
|
||||
b.addCommand({name:"selectwordright", exec:function(a) {
|
||||
a.editor.getSelection().selectWordRight()
|
||||
}});
|
||||
b.addCommand({name:"gotowordright", exec:function(a) {
|
||||
a.editor.navigateWordRight()
|
||||
}});
|
||||
b.addCommand({name:"selecttolineend", exec:function(a) {
|
||||
a.editor.getSelection().selectLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotolineend", exec:function(a) {
|
||||
a.editor.navigateLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"selectright", exec:function(a) {
|
||||
a.editor.getSelection().selectRight()
|
||||
}});
|
||||
b.addCommand({name:"gotoright", exec:function(a) {
|
||||
a.editor.navigateRight()
|
||||
}});
|
||||
b.addCommand({name:"selectpagedown", exec:function(a) {
|
||||
a.editor.selectPageDown()
|
||||
}});
|
||||
b.addCommand({name:"pagedown", exec:function(a) {
|
||||
a.editor.scrollPageDown()
|
||||
}});
|
||||
b.addCommand({name:"gotopagedown", exec:function(a) {
|
||||
a.editor.gotoPageDown()
|
||||
}});
|
||||
b.addCommand({name:"selectpageup", exec:function(a) {
|
||||
a.editor.selectPageUp()
|
||||
}});
|
||||
b.addCommand({name:"pageup", exec:function(a) {
|
||||
a.editor.scrollPageUp()
|
||||
}});
|
||||
b.addCommand({name:"gotopageup", exec:function(a) {
|
||||
a.editor.gotoPageUp()
|
||||
}});
|
||||
b.addCommand({name:"selectlinestart", exec:function(a) {
|
||||
a.editor.getSelection().selectLineStart()
|
||||
}});
|
||||
b.addCommand({name:"gotolinestart", exec:function(a) {
|
||||
a.editor.navigateLineStart()
|
||||
}});
|
||||
b.addCommand({name:"selectlineend", exec:function(a) {
|
||||
a.editor.getSelection().selectLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotolineend", exec:function(a) {
|
||||
a.editor.navigateLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"del", exec:function(a) {
|
||||
a.editor.removeRight()
|
||||
}});
|
||||
b.addCommand({name:"backspace", exec:function(a) {
|
||||
a.editor.removeLeft()
|
||||
}});
|
||||
b.addCommand({name:"outdent", exec:function(a) {
|
||||
a.editor.blockOutdent()
|
||||
}});
|
||||
b.addCommand({name:"indent", exec:function(a) {
|
||||
a.editor.indent()
|
||||
}})
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
define(function(b, a) {
|
||||
a.bindings = {selectall:"Command-A", removeline:"Command-D", gotoline:"Command-L", togglecomment:"Command-7", findnext:"Command-K", findprevious:"Command-Shift-K", find:"Command-F", replace:"Command-R", undo:"Command-Z", redo:"Command-Shift-Z|Command-Y", overwrite:"Insert", copylinesup:"Command-Option-Up", movelinesup:"Option-Up", selecttostart:"Command-Shift-Up", gotostart:"Command-Home|Command-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Command-Option-Down", movelinesdown:"Option-Down",
|
||||
selecttoend:"Command-Shift-Down", gotoend:"Command-End|Command-Down", selectdown:"Shift-Down", godown:"Down", selectwordleft:"Option-Shift-Left", gotowordleft:"Option-Left", selecttolinestart:"Command-Shift-Left", gotolinestart:"Command-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Option-Shift-Right", gotowordright:"Option-Right", selecttolineend:"Command-Shift-Right", gotolineend:"Command-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown",
|
||||
pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", del:"Delete", backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace", outdent:"Shift-Tab", indent:"Tab"}
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
define(function(b, a) {
|
||||
a.bindings = {selectall:"Ctrl-A", removeline:"Ctrl-D", gotoline:"Ctrl-L", togglecomment:"Ctrl-7", findnext:"Ctrl-K", findprevious:"Ctrl-Shift-K", find:"Ctrl-F", replace:"Ctrl-R", undo:"Ctrl-Z", redo:"Ctrl-Shift-Z|Ctrl-Y", overwrite:"Insert", copylinesup:"Ctrl-Alt-Up", movelinesup:"Alt-Up", selecttostart:"Alt-Shift-Up", gotostart:"Ctrl-Home|Ctrl-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Ctrl-Alt-Down", movelinesdown:"Alt-Down", selecttoend:"Alt-Shift-Down", gotoend:"Ctrl-End|Ctrl-Down",
|
||||
selectdown:"Shift-Down", godown:"Down", selectwordleft:"Ctrl-Shift-Left", gotowordleft:"Ctrl-Left", selecttolinestart:"Alt-Shift-Left", gotolinestart:"Alt-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Ctrl-Shift-Right", gotowordright:"Ctrl-Right", selecttolineend:"Alt-Shift-Right", gotolineend:"Alt-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home",
|
||||
selectlineend:"Shift-End", del:"Delete", backspace:"Backspace", outdent:"Shift-Tab", indent:"Tab"}
|
||||
});
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
.ace_editor {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
font-family: "Menlo", "Monaco", "Courier New", monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
.ace_scroller {
|
||||
position: absolute;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.ace_gutter {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
.ace_editor .ace_sb {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
right: 0;
|
||||
}
|
||||
.ace_editor .ace_sb div {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
left: 0px;
|
||||
}
|
||||
.ace_editor .ace_printMargin {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
.ace_layer {
|
||||
z-index: 0;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
height: 100%;
|
||||
}
|
||||
.ace_text-layer {
|
||||
font-family: Monaco, "Courier New", monospace;
|
||||
color: black;
|
||||
}
|
||||
.ace_cursor-layer {
|
||||
cursor: text;
|
||||
}
|
||||
.ace_cursor {
|
||||
z-index: 3;
|
||||
position: absolute;
|
||||
}
|
||||
.ace_line {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ace_marker-layer {
|
||||
}
|
||||
.ace_marker-layer .ace_step {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
.ace_marker-layer .ace_selection {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
.ace_marker-layer .ace_bracket {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
}
|
||||
.ace_marker-layer .ace_active_line {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
|
@ -1,494 +0,0 @@
|
|||
define(function(i, l) {
|
||||
var m = i("pilot/oop"), k = i("pilot/lang"), n = i("pilot/event_emitter").EventEmitter, o = i("ace/selection").Selection, p = i("ace/mode/text").Mode, j = i("ace/range").Range;
|
||||
i = function(a, b) {
|
||||
this.modified = true;
|
||||
this.lines = [];
|
||||
this.selection = new o(this);
|
||||
this.$breakpoints = [];
|
||||
this.listeners = [];
|
||||
b && this.setMode(b);
|
||||
Array.isArray(a) ? this.$insertLines(0, a) : this.$insert({row:0, column:0}, a)
|
||||
};
|
||||
(function() {
|
||||
m.implement(this, n);
|
||||
this.$undoManager = null;
|
||||
this.$split = function(a) {
|
||||
return a.split(/\r\n|\r|\n/)
|
||||
};
|
||||
this.setValue = function(a) {
|
||||
var b = [0, this.lines.length];
|
||||
b.push.apply(b, this.$split(a));
|
||||
this.lines.splice.apply(this.lines, b);
|
||||
this.modified = true;
|
||||
this.fireChangeEvent(0)
|
||||
};
|
||||
this.toString = function() {
|
||||
return this.lines.join(this.$getNewLineCharacter())
|
||||
};
|
||||
this.getSelection = function() {
|
||||
return this.selection
|
||||
};
|
||||
this.fireChangeEvent = function(a, b) {
|
||||
this._dispatchEvent("change", {data:{firstRow:a, lastRow:b}})
|
||||
};
|
||||
this.setUndoManager = function(a) {
|
||||
this.$undoManager = a;
|
||||
this.$deltas = [];
|
||||
this.$informUndoManager && this.$informUndoManager.cancel();
|
||||
if(a) {
|
||||
var b = this;
|
||||
this.$informUndoManager = k.deferredCall(function() {
|
||||
b.$deltas.length > 0 && a.execute({action:"aceupdate", args:[b.$deltas, b]});
|
||||
b.$deltas = []
|
||||
})
|
||||
}
|
||||
};
|
||||
this.$defaultUndoManager = {undo:function() {
|
||||
}, redo:function() {
|
||||
}};
|
||||
this.getUndoManager = function() {
|
||||
return this.$undoManager || this.$defaultUndoManager
|
||||
};
|
||||
this.getTabString = function() {
|
||||
return this.getUseSoftTabs() ? k.stringRepeat(" ", this.getTabSize()) : "\t"
|
||||
};
|
||||
this.$useSoftTabs = true;
|
||||
this.setUseSoftTabs = function(a) {
|
||||
if(this.$useSoftTabs !== a) {
|
||||
this.$useSoftTabs = a
|
||||
}
|
||||
};
|
||||
this.getUseSoftTabs = function() {
|
||||
return this.$useSoftTabs
|
||||
};
|
||||
this.$tabSize = 4;
|
||||
this.setTabSize = function(a) {
|
||||
if(!(isNaN(a) || this.$tabSize === a)) {
|
||||
this.modified = true;
|
||||
this.$tabSize = a;
|
||||
this._dispatchEvent("changeTabSize")
|
||||
}
|
||||
};
|
||||
this.getTabSize = function() {
|
||||
return this.$tabSize
|
||||
};
|
||||
this.isTabStop = function(a) {
|
||||
return this.$useSoftTabs && a.column % this.$tabSize == 0
|
||||
};
|
||||
this.getBreakpoints = function() {
|
||||
return this.$breakpoints
|
||||
};
|
||||
this.setBreakpoints = function(a) {
|
||||
this.$breakpoints = [];
|
||||
for(var b = 0;b < a.length;b++) {
|
||||
this.$breakpoints[a[b]] = true
|
||||
}this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.clearBreakpoints = function() {
|
||||
this.$breakpoints = [];
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.setBreakpoint = function(a) {
|
||||
this.$breakpoints[a] = true;
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.clearBreakpoint = function(a) {
|
||||
delete this.$breakpoints[a];
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.$detectNewLine = function(a) {
|
||||
this.$autoNewLine = (a = a.match(/^.*?(\r?\n)/m)) ? a[1] : "\n"
|
||||
};
|
||||
this.tokenRe = /^[\w\d]+/g;
|
||||
this.nonTokenRe = /^[^\w\d]+/g;
|
||||
this.getWordRange = function(a, b) {
|
||||
var c = this.getLine(a), d = false;
|
||||
if(b > 0) {
|
||||
d = !!c.charAt(b - 1).match(this.tokenRe)
|
||||
}d || (d = !!c.charAt(b).match(this.tokenRe));
|
||||
d = d ? this.tokenRe : this.nonTokenRe;
|
||||
var e = b;
|
||||
if(e > 0) {
|
||||
do {
|
||||
e--
|
||||
}while(e >= 0 && c.charAt(e).match(d));
|
||||
e++
|
||||
}for(b = b;b < c.length && c.charAt(b).match(d);) {
|
||||
b++
|
||||
}return new j(a, e, a, b)
|
||||
};
|
||||
this.$getNewLineCharacter = function() {
|
||||
switch(this.$newLineMode) {
|
||||
case "windows":
|
||||
return"\r\n";
|
||||
case "unix":
|
||||
return"\n";
|
||||
case "auto":
|
||||
return this.$autoNewLine
|
||||
}
|
||||
};
|
||||
this.$autoNewLine = "\n";
|
||||
this.$newLineMode = "auto";
|
||||
this.setNewLineMode = function(a) {
|
||||
if(this.$newLineMode !== a) {
|
||||
this.$newLineMode = a
|
||||
}
|
||||
};
|
||||
this.getNewLineMode = function() {
|
||||
return this.$newLineMode
|
||||
};
|
||||
this.$mode = null;
|
||||
this.setMode = function(a) {
|
||||
if(this.$mode !== a) {
|
||||
this.$mode = a;
|
||||
this._dispatchEvent("changeMode")
|
||||
}
|
||||
};
|
||||
this.getMode = function() {
|
||||
if(!this.$mode) {
|
||||
this.$mode = new p
|
||||
}return this.$mode
|
||||
};
|
||||
this.$scrollTop = 0;
|
||||
this.setScrollTopRow = function(a) {
|
||||
if(this.$scrollTop !== a) {
|
||||
this.$scrollTop = a;
|
||||
this._dispatchEvent("changeScrollTop")
|
||||
}
|
||||
};
|
||||
this.getScrollTopRow = function() {
|
||||
return this.$scrollTop
|
||||
};
|
||||
this.getWidth = function() {
|
||||
this.$computeWidth();
|
||||
return this.width
|
||||
};
|
||||
this.getScreenWidth = function() {
|
||||
this.$computeWidth();
|
||||
return this.screenWidth
|
||||
};
|
||||
this.$computeWidth = function() {
|
||||
if(this.modified) {
|
||||
this.modified = false;
|
||||
for(var a = this.lines, b = 0, c = 0, d = this.getTabSize(), e = 0;e < a.length;e++) {
|
||||
var f = a[e].length;
|
||||
b = Math.max(b, f);
|
||||
a[e].replace("\t", function(g) {
|
||||
f += d - 1;
|
||||
return g
|
||||
});
|
||||
c = Math.max(c, f)
|
||||
}this.width = b;
|
||||
this.screenWidth = c
|
||||
}
|
||||
};
|
||||
this.getLine = function(a) {
|
||||
return this.lines[a] || ""
|
||||
};
|
||||
this.getDisplayLine = function(a) {
|
||||
var b = (new Array(this.getTabSize() + 1)).join(" ");
|
||||
return this.lines[a].replace(/\t/g, b)
|
||||
};
|
||||
this.getLines = function(a, b) {
|
||||
return this.lines.slice(a, b + 1)
|
||||
};
|
||||
this.getLength = function() {
|
||||
return this.lines.length
|
||||
};
|
||||
this.getTextRange = function(a) {
|
||||
if(a.start.row == a.end.row) {
|
||||
return this.lines[a.start.row].substring(a.start.column, a.end.column)
|
||||
}else {
|
||||
var b = [];
|
||||
b.push(this.lines[a.start.row].substring(a.start.column));
|
||||
b.push.apply(b, this.getLines(a.start.row + 1, a.end.row - 1));
|
||||
b.push(this.lines[a.end.row].substring(0, a.end.column));
|
||||
return b.join(this.$getNewLineCharacter())
|
||||
}
|
||||
};
|
||||
this.findMatchingBracket = function(a) {
|
||||
if(a.column == 0) {
|
||||
return null
|
||||
}var b = this.getLine(a.row).charAt(a.column - 1);
|
||||
if(b == "") {
|
||||
return null
|
||||
}b = b.match(/([\(\[\{])|([\)\]\}])/);
|
||||
if(!b) {
|
||||
return null
|
||||
}return b[1] ? this.$findClosingBracket(b[1], a) : this.$findOpeningBracket(b[2], a)
|
||||
};
|
||||
this.$brackets = {")":"(", "(":")", "]":"[", "[":"]", "{":"}", "}":"{"};
|
||||
this.$findOpeningBracket = function(a, b) {
|
||||
var c = this.$brackets[a], d = b.column - 2;
|
||||
b = b.row;
|
||||
for(var e = 1, f = this.getLine(b);;) {
|
||||
for(;d >= 0;) {
|
||||
var g = f.charAt(d);
|
||||
if(g == c) {
|
||||
e -= 1;
|
||||
if(e == 0) {
|
||||
return{row:b, column:d}
|
||||
}
|
||||
}else {
|
||||
if(g == a) {
|
||||
e += 1
|
||||
}
|
||||
}d -= 1
|
||||
}b -= 1;
|
||||
if(b < 0) {
|
||||
break
|
||||
}f = this.getLine(b);
|
||||
d = f.length - 1
|
||||
}return null
|
||||
};
|
||||
this.$findClosingBracket = function(a, b) {
|
||||
var c = this.$brackets[a], d = b.column;
|
||||
b = b.row;
|
||||
for(var e = 1, f = this.getLine(b), g = this.getLength();;) {
|
||||
for(;d < f.length;) {
|
||||
var h = f.charAt(d);
|
||||
if(h == c) {
|
||||
e -= 1;
|
||||
if(e == 0) {
|
||||
return{row:b, column:d}
|
||||
}
|
||||
}else {
|
||||
if(h == a) {
|
||||
e += 1
|
||||
}
|
||||
}d += 1
|
||||
}b += 1;
|
||||
if(b >= g) {
|
||||
break
|
||||
}f = this.getLine(b);
|
||||
d = 0
|
||||
}return null
|
||||
};
|
||||
this.insert = function(a, b, c) {
|
||||
b = this.$insert(a, b, c);
|
||||
this.fireChangeEvent(a.row, a.row == b.row ? a.row : undefined);
|
||||
return b
|
||||
};
|
||||
this.multiRowInsert = function(a, b, c) {
|
||||
for(var d = this.lines, e = a.length - 1;e >= 0;e--) {
|
||||
var f = a[e];
|
||||
if(!(f >= d.length)) {
|
||||
var g = b - d[f].length;
|
||||
if(g > 0) {
|
||||
var h = k.stringRepeat(" ", g) + c;
|
||||
g = -g
|
||||
}else {
|
||||
h = c;
|
||||
g = 0
|
||||
}h = this.$insert({row:f, column:b + g}, h, false)
|
||||
}
|
||||
}if(h) {
|
||||
this.fireChangeEvent(a[0], a[a.length - 1] + h.row - a[0]);
|
||||
return{rows:h.row - a[0], columns:h.column - b}
|
||||
}else {
|
||||
return{rows:0, columns:0}
|
||||
}
|
||||
};
|
||||
this.$insertLines = function(a, b, c) {
|
||||
if(b.length != 0) {
|
||||
var d = [a, 0];
|
||||
d.push.apply(d, b);
|
||||
this.lines.splice.apply(this.lines, d);
|
||||
if(!c && this.$undoManager) {
|
||||
c = this.$getNewLineCharacter();
|
||||
this.$deltas.push({action:"insertText", range:new j(a, 0, a + b.length, 0), text:b.join(c) + c});
|
||||
this.$informUndoManager.schedule()
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$insert = function(a, b, c) {
|
||||
if(b.length == 0) {
|
||||
return a
|
||||
}this.modified = true;
|
||||
this.lines.length <= 1 && this.$detectNewLine(b);
|
||||
var d = this.$split(b);
|
||||
if(this.$isNewLine(b)) {
|
||||
var e = this.lines[a.row] || "";
|
||||
this.lines[a.row] = e.substring(0, a.column);
|
||||
this.lines.splice(a.row + 1, 0, e.substring(a.column));
|
||||
d = {row:a.row + 1, column:0}
|
||||
}else {
|
||||
if(d.length == 1) {
|
||||
e = this.lines[a.row] || "";
|
||||
this.lines[a.row] = e.substring(0, a.column) + b + e.substring(a.column);
|
||||
d = {row:a.row, column:a.column + b.length}
|
||||
}else {
|
||||
e = this.lines[a.row] || "";
|
||||
var f = e.substring(0, a.column) + d[0];
|
||||
e = d[d.length - 1] + e.substring(a.column);
|
||||
this.lines[a.row] = f;
|
||||
this.$insertLines(a.row + 1, [e], true);
|
||||
d.length > 2 && this.$insertLines(a.row + 1, d.slice(1, -1), true);
|
||||
d = {row:a.row + d.length - 1, column:d[d.length - 1].length}
|
||||
}
|
||||
}if(!c && this.$undoManager) {
|
||||
this.$deltas.push({action:"insertText", range:j.fromPoints(a, d), text:b});
|
||||
this.$informUndoManager.schedule()
|
||||
}return d
|
||||
};
|
||||
this.$isNewLine = function(a) {
|
||||
return a == "\r\n" || a == "\r" || a == "\n"
|
||||
};
|
||||
this.remove = function(a, b) {
|
||||
if(a.isEmpty()) {
|
||||
return a.start
|
||||
}this.$remove(a, b);
|
||||
this.fireChangeEvent(a.start.row, a.isMultiLine() ? undefined : a.start.row);
|
||||
return a.start
|
||||
};
|
||||
this.multiRowRemove = function(a, b) {
|
||||
if(b.start.row !== a[0]) {
|
||||
throw new TypeError("range must start in the first row!");
|
||||
}for(var c = b.end.row - a[0], d = a.length - 1;d >= 0;d--) {
|
||||
var e = a[d];
|
||||
if(!(e >= this.lines.length)) {
|
||||
var f = this.$remove(new j(e, b.start.column, e + c, b.end.column), false)
|
||||
}
|
||||
}if(f) {
|
||||
c < 0 ? this.fireChangeEvent(a[0] + c, undefined) : this.fireChangeEvent(a[0], c == 0 ? a[a.length - 1] : undefined)
|
||||
}
|
||||
};
|
||||
this.$remove = function(a, b) {
|
||||
if(!a.isEmpty()) {
|
||||
if(!b && this.$undoManager) {
|
||||
this.$getNewLineCharacter();
|
||||
this.$deltas.push({action:"removeText", range:a.clone(), text:this.getTextRange(a)});
|
||||
this.$informUndoManager.schedule()
|
||||
}this.modified = true;
|
||||
b = a.start.row;
|
||||
var c = a.end.row, d = this.getLine(b).substring(0, a.start.column) + this.getLine(c).substring(a.end.column);
|
||||
d != "" ? this.lines.splice(b, c - b + 1, d) : this.lines.splice(b, c - b + 1, "");
|
||||
return a.start
|
||||
}
|
||||
};
|
||||
this.undoChanges = function(a) {
|
||||
this.selection.clearSelection();
|
||||
for(var b = a.length - 1;b >= 0;b--) {
|
||||
var c = a[b];
|
||||
if(c.action == "insertText") {
|
||||
this.remove(c.range, true);
|
||||
this.selection.moveCursorToPosition(c.range.start)
|
||||
}else {
|
||||
this.insert(c.range.start, c.text, true);
|
||||
this.selection.clearSelection()
|
||||
}
|
||||
}
|
||||
};
|
||||
this.redoChanges = function(a) {
|
||||
this.selection.clearSelection();
|
||||
for(var b = 0;b < a.length;b++) {
|
||||
var c = a[b];
|
||||
if(c.action == "insertText") {
|
||||
this.insert(c.range.start, c.text, true);
|
||||
this.selection.setSelectionRange(c.range)
|
||||
}else {
|
||||
this.remove(c.range, true);
|
||||
this.selection.moveCursorToPosition(c.range.start)
|
||||
}
|
||||
}
|
||||
};
|
||||
this.replace = function(a, b) {
|
||||
this.$remove(a);
|
||||
b = b ? this.$insert(a.start, b) : a.start;
|
||||
var c = a.end.column == 0 ? a.end.column - 1 : a.end.column;
|
||||
this.fireChangeEvent(a.start.row, c == b.row ? c : undefined);
|
||||
return b
|
||||
};
|
||||
this.indentRows = function(a, b, c) {
|
||||
c = c.replace("\t", this.getTabString());
|
||||
for(var d = a;d <= b;d++) {
|
||||
this.$insert({row:d, column:0}, c)
|
||||
}this.fireChangeEvent(a, b);
|
||||
return c.length
|
||||
};
|
||||
this.outdentRows = function(a) {
|
||||
for(var b = a.collapseRows(), c = new j(0, 0, 0, 0), d = this.getTabSize(), e = b.start.row;e <= b.end.row;++e) {
|
||||
var f = this.getLine(e);
|
||||
c.start.row = e;
|
||||
c.end.row = e;
|
||||
for(var g = 0;g < d;++g) {
|
||||
if(f.charAt(g) != " ") {
|
||||
break
|
||||
}
|
||||
}if(g < d && f.charAt(g) == "\t") {
|
||||
c.start.column = g;
|
||||
c.end.column = g + 1
|
||||
}else {
|
||||
c.start.column = 0;
|
||||
c.end.column = g
|
||||
}if(e == a.start.row) {
|
||||
a.start.column -= c.end.column - c.start.column
|
||||
}if(e == a.end.row) {
|
||||
a.end.column -= c.end.column - c.start.column
|
||||
}this.$remove(c)
|
||||
}this.fireChangeEvent(a.start.row, a.end.row);
|
||||
return a
|
||||
};
|
||||
this.moveLinesUp = function(a, b) {
|
||||
if(a <= 0) {
|
||||
return 0
|
||||
}var c = this.lines.slice(a, b + 1);
|
||||
this.$remove(new j(a - 1, this.lines[a - 1].length, b, this.lines[b].length));
|
||||
this.$insertLines(a - 1, c);
|
||||
this.fireChangeEvent(a - 1, b);
|
||||
return-1
|
||||
};
|
||||
this.moveLinesDown = function(a, b) {
|
||||
if(b >= this.lines.length - 1) {
|
||||
return 0
|
||||
}var c = this.lines.slice(a, b + 1);
|
||||
this.$remove(new j(a, 0, b + 1, 0));
|
||||
this.$insertLines(a + 1, c);
|
||||
this.fireChangeEvent(a, b + 1);
|
||||
return 1
|
||||
};
|
||||
this.duplicateLines = function(a, b) {
|
||||
a = this.$clipRowToDocument(a);
|
||||
b = this.$clipRowToDocument(b);
|
||||
var c = this.getLines(a, b);
|
||||
this.$insertLines(a, c);
|
||||
b = b - a + 1;
|
||||
this.fireChangeEvent(a);
|
||||
return b
|
||||
};
|
||||
this.$clipRowToDocument = function(a) {
|
||||
return Math.max(0, Math.min(a, this.lines.length - 1))
|
||||
};
|
||||
this.documentToScreenColumn = function(a, b) {
|
||||
var c = this.getTabSize(), d = 0;
|
||||
b = b;
|
||||
a = this.getLine(a).split("\t");
|
||||
for(var e = 0;e < a.length;e++) {
|
||||
var f = a[e].length;
|
||||
if(b > f) {
|
||||
b -= f + 1;
|
||||
d += f + c
|
||||
}else {
|
||||
d += b;
|
||||
break
|
||||
}
|
||||
}return d
|
||||
};
|
||||
this.screenToDocumentColumn = function(a, b) {
|
||||
var c = this.getTabSize(), d = 0;
|
||||
b = b;
|
||||
a = this.getLine(a).split("\t");
|
||||
for(var e = 0;e < a.length;e++) {
|
||||
var f = a[e].length;
|
||||
if(b >= f + c) {
|
||||
b -= f + c;
|
||||
d += f + 1
|
||||
}else {
|
||||
d += b > f ? f : b;
|
||||
break
|
||||
}
|
||||
}return d
|
||||
}
|
||||
}).call(i.prototype);
|
||||
l.Document = i
|
||||
});
|
||||
|
|
@ -1,672 +0,0 @@
|
|||
define(function(g, r) {
|
||||
var s = g("pilot/oop"), e = g("pilot/event"), t = g("pilot/lang"), u = g("ace/textinput").TextInput, v = g("ace/keybinding").KeyBinding, w = g("ace/document").Document, x = g("ace/search").Search, y = g("ace/background_tokenizer").BackgroundTokenizer, o = g("ace/range").Range, z = g("pilot/event_emitter").EventEmitter;
|
||||
g = function(a, b) {
|
||||
var d = a.getContainerElement();
|
||||
this.container = d;
|
||||
this.renderer = a;
|
||||
this.textInput = new u(d, this);
|
||||
this.keyBinding = new v(d, this);
|
||||
var c = this;
|
||||
e.addListener(d, "mousedown", function(i) {
|
||||
setTimeout(function() {
|
||||
c.focus()
|
||||
});
|
||||
return e.preventDefault(i)
|
||||
});
|
||||
e.addListener(d, "selectstart", function(i) {
|
||||
return e.preventDefault(i)
|
||||
});
|
||||
a = a.getMouseEventTarget();
|
||||
e.addListener(a, "mousedown", this.onMouseDown.bind(this));
|
||||
e.addMultiMouseDownListener(a, 0, 2, 500, this.onMouseDoubleClick.bind(this));
|
||||
e.addMultiMouseDownListener(a, 0, 3, 600, this.onMouseTripleClick.bind(this));
|
||||
e.addMouseWheelListener(a, this.onMouseWheel.bind(this));
|
||||
this.$highlightLineMarker = this.$selectionMarker = null;
|
||||
this.$blockScrolling = false;
|
||||
this.$search = (new x).set({wrap:true});
|
||||
this.setDocument(b || new w(""));
|
||||
this.focus()
|
||||
};
|
||||
(function() {
|
||||
s.implement(this, z);
|
||||
this.$forwardEvents = {gutterclick:1, gutterdblclick:1};
|
||||
this.$originalAddEventListener = this.addEventListener;
|
||||
this.$originalRemoveEventListener = this.removeEventListener;
|
||||
this.addEventListener = function(a, b) {
|
||||
return this.$forwardEvents[a] ? this.renderer.addEventListener(a, b) : this.$originalAddEventListener(a, b)
|
||||
};
|
||||
this.removeEventListener = function(a, b) {
|
||||
return this.$forwardEvents[a] ? this.renderer.removeEventListener(a, b) : this.$originalRemoveEventListener(a, b)
|
||||
};
|
||||
this.setDocument = function(a) {
|
||||
if(this.doc != a) {
|
||||
if(this.doc) {
|
||||
this.doc.removeEventListener("change", this.$onDocumentChange);
|
||||
this.doc.removeEventListener("changeMode", this.$onDocumentModeChange);
|
||||
this.doc.removeEventListener("changeTabSize", this.$onDocumentChangeTabSize);
|
||||
this.doc.removeEventListener("changeBreakpoint", this.$onDocumentChangeBreakpoint);
|
||||
var b = this.doc.getSelection();
|
||||
b.removeEventListener("changeCursor", this.$onCursorChange);
|
||||
b.removeEventListener("changeSelection", this.$onSelectionChange);
|
||||
this.doc.setScrollTopRow(this.renderer.getScrollTopRow())
|
||||
}this.doc = a;
|
||||
this.$onDocumentChange = this.onDocumentChange.bind(this);
|
||||
a.addEventListener("change", this.$onDocumentChange);
|
||||
this.renderer.setDocument(a);
|
||||
this.$onDocumentModeChange = this.onDocumentModeChange.bind(this);
|
||||
a.addEventListener("changeMode", this.$onDocumentModeChange);
|
||||
this.$onDocumentChangeTabSize = this.renderer.updateText.bind(this.renderer);
|
||||
a.addEventListener("changeTabSize", this.$onDocumentChangeTabSize);
|
||||
this.$onDocumentChangeBreakpoint = this.onDocumentChangeBreakpoint.bind(this);
|
||||
this.doc.addEventListener("changeBreakpoint", this.$onDocumentChangeBreakpoint);
|
||||
this.selection = a.getSelection();
|
||||
this.$desiredColumn = 0;
|
||||
this.$onCursorChange = this.onCursorChange.bind(this);
|
||||
this.selection.addEventListener("changeCursor", this.$onCursorChange);
|
||||
this.$onSelectionChange = this.onSelectionChange.bind(this);
|
||||
this.selection.addEventListener("changeSelection", this.$onSelectionChange);
|
||||
this.onDocumentModeChange();
|
||||
this.bgTokenizer.setLines(this.doc.lines);
|
||||
this.bgTokenizer.start(0);
|
||||
this.onCursorChange();
|
||||
this.onSelectionChange();
|
||||
this.onDocumentChangeBreakpoint();
|
||||
this.renderer.scrollToRow(a.getScrollTopRow());
|
||||
this.renderer.updateFull()
|
||||
}
|
||||
};
|
||||
this.getDocument = function() {
|
||||
return this.doc
|
||||
};
|
||||
this.getSelection = function() {
|
||||
return this.selection
|
||||
};
|
||||
this.resize = function() {
|
||||
this.renderer.onResize()
|
||||
};
|
||||
this.setTheme = function(a) {
|
||||
this.renderer.setTheme(a)
|
||||
};
|
||||
this.$highlightBrackets = function() {
|
||||
if(this.$bracketHighlight) {
|
||||
this.renderer.removeMarker(this.$bracketHighlight);
|
||||
this.$bracketHighlight = null
|
||||
}if(!this.$highlightPending) {
|
||||
var a = this;
|
||||
this.$highlightPending = true;
|
||||
setTimeout(function() {
|
||||
a.$highlightPending = false;
|
||||
var b = a.doc.findMatchingBracket(a.getCursorPosition());
|
||||
if(b) {
|
||||
b = new o(b.row, b.column, b.row, b.column + 1);
|
||||
a.$bracketHighlight = a.renderer.addMarker(b, "ace_bracket")
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
};
|
||||
this.focus = function() {
|
||||
this.textInput.focus()
|
||||
};
|
||||
this.blur = function() {
|
||||
this.textInput.blur()
|
||||
};
|
||||
this.onFocus = function() {
|
||||
this.renderer.showCursor();
|
||||
this.renderer.visualizeFocus()
|
||||
};
|
||||
this.onBlur = function() {
|
||||
this.renderer.hideCursor();
|
||||
this.renderer.visualizeBlur()
|
||||
};
|
||||
this.onDocumentChange = function(a) {
|
||||
a = a.data;
|
||||
this.bgTokenizer.start(a.firstRow);
|
||||
this.renderer.updateLines(a.firstRow, a.lastRow);
|
||||
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite)
|
||||
};
|
||||
this.onTokenizerUpdate = function(a) {
|
||||
a = a.data;
|
||||
this.renderer.updateLines(a.first, a.last)
|
||||
};
|
||||
this.onCursorChange = function(a) {
|
||||
this.$highlightBrackets();
|
||||
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
|
||||
if(!this.$blockScrolling && (!a || !a.blockScrolling)) {
|
||||
this.renderer.scrollCursorIntoView()
|
||||
}this.$updateHighlightActiveLine()
|
||||
};
|
||||
this.$updateHighlightActiveLine = function() {
|
||||
this.$highlightLineMarker && this.renderer.removeMarker(this.$highlightLineMarker);
|
||||
this.$highlightLineMarker = null;
|
||||
if(this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
|
||||
var a = this.getCursorPosition();
|
||||
this.$highlightLineMarker = this.renderer.addMarker(new o(a.row, 0, a.row + 1, 0), "ace_active_line", "line")
|
||||
}
|
||||
};
|
||||
this.onSelectionChange = function(a) {
|
||||
this.$selectionMarker && this.renderer.removeMarker(this.$selectionMarker);
|
||||
this.$selectionMarker = null;
|
||||
if(!this.selection.isEmpty()) {
|
||||
var b = this.selection.getRange(), d = this.getSelectionStyle();
|
||||
this.$selectionMarker = this.renderer.addMarker(b, "ace_selection", d)
|
||||
}this.onCursorChange(a)
|
||||
};
|
||||
this.onDocumentChangeBreakpoint = function() {
|
||||
this.renderer.setBreakpoints(this.doc.getBreakpoints())
|
||||
};
|
||||
this.onDocumentModeChange = function() {
|
||||
var a = this.doc.getMode();
|
||||
if(this.mode != a) {
|
||||
this.mode = a;
|
||||
a = a.getTokenizer();
|
||||
if(this.bgTokenizer) {
|
||||
this.bgTokenizer.setTokenizer(a)
|
||||
}else {
|
||||
var b = this.onTokenizerUpdate.bind(this);
|
||||
this.bgTokenizer = new y(a, this);
|
||||
this.bgTokenizer.addEventListener("update", b)
|
||||
}this.renderer.setTokenizer(this.bgTokenizer)
|
||||
}
|
||||
};
|
||||
this.onMouseDown = function(a) {
|
||||
var b = e.getDocumentX(a), d = e.getDocumentY(a);
|
||||
b = this.renderer.screenToTextCoordinates(b, d);
|
||||
b.row = Math.max(0, Math.min(b.row, this.doc.getLength() - 1));
|
||||
if(e.getButton(a) != 0) {
|
||||
this.selection.isEmpty() && this.moveCursorToPosition(b)
|
||||
}else {
|
||||
if(a.shiftKey) {
|
||||
this.selection.selectToPosition(b)
|
||||
}else {
|
||||
this.moveCursorToPosition(b);
|
||||
this.$clickSelection || this.selection.clearSelection(b.row, b.column)
|
||||
}this.renderer.scrollCursorIntoView();
|
||||
var c = this, i, n;
|
||||
e.capture(this.container, function(h) {
|
||||
i = e.getDocumentX(h);
|
||||
n = e.getDocumentY(h)
|
||||
}, function() {
|
||||
clearInterval(f);
|
||||
c.$clickSelection = null
|
||||
});
|
||||
var f = setInterval(function() {
|
||||
if(!(i === undefined || n === undefined)) {
|
||||
var h = c.renderer.screenToTextCoordinates(i, n);
|
||||
h.row = Math.max(0, Math.min(h.row, c.doc.getLength() - 1));
|
||||
if(c.$clickSelection) {
|
||||
if(c.$clickSelection.contains(h.row, h.column)) {
|
||||
c.selection.setSelectionRange(c.$clickSelection)
|
||||
}else {
|
||||
var j = c.$clickSelection.compare(h.row, h.column) == -1 ? c.$clickSelection.end : c.$clickSelection.start;
|
||||
c.selection.setSelectionAnchor(j.row, j.column);
|
||||
c.selection.selectToPosition(h)
|
||||
}
|
||||
}else {
|
||||
c.selection.selectToPosition(h)
|
||||
}c.renderer.scrollCursorIntoView()
|
||||
}
|
||||
}, 20);
|
||||
return e.preventDefault(a)
|
||||
}
|
||||
};
|
||||
this.onMouseDoubleClick = function() {
|
||||
this.selection.selectWord();
|
||||
this.$clickSelection = this.getSelectionRange();
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.onMouseTripleClick = function() {
|
||||
this.selection.selectLine();
|
||||
this.$clickSelection = this.getSelectionRange();
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.onMouseWheel = function(a) {
|
||||
var b = this.$scrollSpeed * 2;
|
||||
this.renderer.scrollBy(a.wheelX * b, a.wheelY * b);
|
||||
return e.preventDefault(a)
|
||||
};
|
||||
this.getCopyText = function() {
|
||||
return this.selection.isEmpty() ? "" : this.doc.getTextRange(this.getSelectionRange())
|
||||
};
|
||||
this.onCut = function() {
|
||||
if(!this.$readOnly) {
|
||||
if(!this.selection.isEmpty()) {
|
||||
this.moveCursorToPosition(this.doc.remove(this.getSelectionRange()));
|
||||
this.clearSelection()
|
||||
}
|
||||
}
|
||||
};
|
||||
this.onTextInput = function(a) {
|
||||
if(!this.$readOnly) {
|
||||
var b = this.getCursorPosition();
|
||||
a = a.replace("\t", this.doc.getTabString());
|
||||
if(this.selection.isEmpty()) {
|
||||
if(this.$overwrite) {
|
||||
var d = new o.fromPoints(b, b);
|
||||
d.end.column += a.length;
|
||||
this.doc.remove(d)
|
||||
}
|
||||
}else {
|
||||
b = this.doc.remove(this.getSelectionRange());
|
||||
this.clearSelection()
|
||||
}this.clearSelection();
|
||||
var c = this;
|
||||
this.bgTokenizer.getState(b.row, function(i) {
|
||||
var n = c.mode.checkOutdent(i, c.doc.getLine(b.row), a), f = c.doc.getLine(b.row), h = c.mode.getNextLineIndent(i, f.slice(0, b.column), c.doc.getTabString()), j = c.doc.insert(b, a);
|
||||
c.bgTokenizer.getState(b.row, function(p) {
|
||||
if(b.row !== j.row) {
|
||||
p = c.doc.getTabSize();
|
||||
for(var q = Number.MAX_VALUE, l = b.row + 1;l <= j.row;++l) {
|
||||
var m = 0;
|
||||
f = c.doc.getLine(l);
|
||||
for(var k = 0;k < f.length;++k) {
|
||||
if(f.charAt(k) == "\t") {
|
||||
m += p
|
||||
}else {
|
||||
if(f.charAt(k) == " ") {
|
||||
m += 1
|
||||
}else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}if(/[^\s]/.test(f)) {
|
||||
q = Math.min(m, q)
|
||||
}
|
||||
}for(l = b.row + 1;l <= j.row;++l) {
|
||||
m = q;
|
||||
f = c.doc.getLine(l);
|
||||
for(k = 0;k < f.length && m > 0;++k) {
|
||||
if(f.charAt(k) == "\t") {
|
||||
m -= p
|
||||
}else {
|
||||
if(f.charAt(k) == " ") {
|
||||
m -= 1
|
||||
}
|
||||
}
|
||||
}c.doc.replace(new o(l, 0, l, f.length), f.substr(k))
|
||||
}j.column += c.doc.indentRows(b.row + 1, j.row, h)
|
||||
}else {
|
||||
if(n) {
|
||||
j.column += c.mode.autoOutdent(p, c.doc, b.row)
|
||||
}
|
||||
}c.moveCursorToPosition(j);
|
||||
c.renderer.scrollCursorIntoView()
|
||||
})
|
||||
})
|
||||
}
|
||||
};
|
||||
this.$overwrite = false;
|
||||
this.setOverwrite = function(a) {
|
||||
if(this.$overwrite != a) {
|
||||
this.$overwrite = a;
|
||||
this.$blockScrolling = true;
|
||||
this.onCursorChange();
|
||||
this.$blockScrolling = false;
|
||||
this._dispatchEvent("changeOverwrite", {data:a})
|
||||
}
|
||||
};
|
||||
this.getOverwrite = function() {
|
||||
return this.$overwrite
|
||||
};
|
||||
this.toggleOverwrite = function() {
|
||||
this.setOverwrite(!this.$overwrite)
|
||||
};
|
||||
this.$scrollSpeed = 1;
|
||||
this.setScrollSpeed = function(a) {
|
||||
this.$scrollSpeed = a
|
||||
};
|
||||
this.getScrollSpeed = function() {
|
||||
return this.$scrollSpeed
|
||||
};
|
||||
this.$selectionStyle = "line";
|
||||
this.setSelectionStyle = function(a) {
|
||||
if(this.$selectionStyle != a) {
|
||||
this.$selectionStyle = a;
|
||||
this.onSelectionChange();
|
||||
this._dispatchEvent("changeSelectionStyle", {data:a})
|
||||
}
|
||||
};
|
||||
this.getSelectionStyle = function() {
|
||||
return this.$selectionStyle
|
||||
};
|
||||
this.$highlightActiveLine = true;
|
||||
this.setHighlightActiveLine = function(a) {
|
||||
if(this.$highlightActiveLine != a) {
|
||||
this.$highlightActiveLine = a;
|
||||
this.$updateHighlightActiveLine()
|
||||
}
|
||||
};
|
||||
this.getHighlightActiveLine = function() {
|
||||
return this.$highlightActiveLine
|
||||
};
|
||||
this.setShowInvisibles = function(a) {
|
||||
this.getShowInvisibles() != a && this.renderer.setShowInvisibles(a)
|
||||
};
|
||||
this.getShowInvisibles = function() {
|
||||
return this.renderer.getShowInvisibles()
|
||||
};
|
||||
this.setShowPrintMargin = function(a) {
|
||||
this.renderer.setShowPrintMargin(a)
|
||||
};
|
||||
this.getShowPrintMargin = function() {
|
||||
return this.renderer.getShowPrintMargin()
|
||||
};
|
||||
this.setPrintMarginColumn = function(a) {
|
||||
this.renderer.setPrintMarginColumn(a)
|
||||
};
|
||||
this.getPrintMarginColumn = function() {
|
||||
return this.renderer.getPrintMarginColumn()
|
||||
};
|
||||
this.$readOnly = false;
|
||||
this.setReadOnly = function(a) {
|
||||
this.$readOnly = a
|
||||
};
|
||||
this.getReadOnly = function() {
|
||||
return this.$readOnly
|
||||
};
|
||||
this.removeRight = function() {
|
||||
if(!this.$readOnly) {
|
||||
this.selection.isEmpty() && this.selection.selectRight();
|
||||
this.moveCursorToPosition(this.doc.remove(this.getSelectionRange()));
|
||||
this.clearSelection()
|
||||
}
|
||||
};
|
||||
this.removeLeft = function() {
|
||||
if(!this.$readOnly) {
|
||||
this.selection.isEmpty() && this.selection.selectLeft();
|
||||
this.moveCursorToPosition(this.doc.remove(this.getSelectionRange()));
|
||||
this.clearSelection()
|
||||
}
|
||||
};
|
||||
this.indent = function() {
|
||||
if(!this.$readOnly) {
|
||||
var a = this.doc, b = this.getSelectionRange();
|
||||
if(b.start.row < b.end.row || b.start.column < b.end.column) {
|
||||
b = this.$getSelectedRows();
|
||||
a = a.indentRows(b.first, b.last, "\t");
|
||||
this.selection.shiftSelection(a)
|
||||
}else {
|
||||
if(this.doc.getUseSoftTabs()) {
|
||||
b = a.getTabSize();
|
||||
var d = this.getCursorPosition();
|
||||
a = a.documentToScreenColumn(d.row, d.column);
|
||||
a = b - a % b;
|
||||
a = t.stringRepeat(" ", a)
|
||||
}else {
|
||||
a = "\t"
|
||||
}return this.onTextInput(a)
|
||||
}
|
||||
}
|
||||
};
|
||||
this.blockOutdent = function() {
|
||||
if(!this.$readOnly) {
|
||||
var a = this.doc.getSelection(), b = this.doc.outdentRows(a.getRange());
|
||||
a.setSelectionRange(b, a.isBackwards());
|
||||
this.$updateDesiredColumn()
|
||||
}
|
||||
};
|
||||
this.toggleCommentLines = function() {
|
||||
if(!this.$readOnly) {
|
||||
var a = this;
|
||||
this.bgTokenizer.getState(this.getCursorPosition().row, function(b) {
|
||||
var d = a.$getSelectedRows();
|
||||
b = a.mode.toggleCommentLines(b, a.doc, d.first, d.last);
|
||||
a.selection.shiftSelection(b)
|
||||
})
|
||||
}
|
||||
};
|
||||
this.removeLines = function() {
|
||||
if(!this.$readOnly) {
|
||||
var a = this.$getSelectedRows();
|
||||
this.selection.setSelectionAnchor(a.last + 1, 0);
|
||||
this.selection.selectTo(a.first, 0);
|
||||
this.doc.remove(this.getSelectionRange());
|
||||
this.clearSelection()
|
||||
}
|
||||
};
|
||||
this.moveLinesDown = function() {
|
||||
this.$readOnly || this.$moveLines(function(a, b) {
|
||||
return this.doc.moveLinesDown(a, b)
|
||||
})
|
||||
};
|
||||
this.moveLinesUp = function() {
|
||||
this.$readOnly || this.$moveLines(function(a, b) {
|
||||
return this.doc.moveLinesUp(a, b)
|
||||
})
|
||||
};
|
||||
this.copyLinesUp = function() {
|
||||
this.$readOnly || this.$moveLines(function(a, b) {
|
||||
this.doc.duplicateLines(a, b);
|
||||
return 0
|
||||
})
|
||||
};
|
||||
this.copyLinesDown = function() {
|
||||
this.$readOnly || this.$moveLines(function(a, b) {
|
||||
return this.doc.duplicateLines(a, b)
|
||||
})
|
||||
};
|
||||
this.$moveLines = function(a) {
|
||||
var b = this.$getSelectedRows(), d = a.call(this, b.first, b.last), c = this.selection;
|
||||
c.setSelectionAnchor(b.last + d + 1, 0);
|
||||
c.$moveSelection(function() {
|
||||
c.moveCursorTo(b.first + d, 0)
|
||||
})
|
||||
};
|
||||
this.$getSelectedRows = function() {
|
||||
var a = this.getSelectionRange().collapseRows();
|
||||
return{first:a.start.row, last:a.end.row}
|
||||
};
|
||||
this.onCompositionStart = function() {
|
||||
this.renderer.showComposition(this.getCursorPosition())
|
||||
};
|
||||
this.onCompositionUpdate = function(a) {
|
||||
this.renderer.setCompositionText(a)
|
||||
};
|
||||
this.onCompositionEnd = function() {
|
||||
this.renderer.hideComposition()
|
||||
};
|
||||
this.getFirstVisibleRow = function() {
|
||||
return this.renderer.getFirstVisibleRow()
|
||||
};
|
||||
this.getLastVisibleRow = function() {
|
||||
return this.renderer.getLastVisibleRow()
|
||||
};
|
||||
this.isRowVisible = function(a) {
|
||||
return a >= this.getFirstVisibleRow() && a <= this.getLastVisibleRow()
|
||||
};
|
||||
this.getVisibleRowCount = function() {
|
||||
return this.getLastVisibleRow() - this.getFirstVisibleRow() + 1
|
||||
};
|
||||
this.getPageDownRow = function() {
|
||||
return this.renderer.getLastVisibleRow() - 1
|
||||
};
|
||||
this.getPageUpRow = function() {
|
||||
var a = this.renderer.getFirstVisibleRow(), b = this.renderer.getLastVisibleRow();
|
||||
return a - (b - a) + 1
|
||||
};
|
||||
this.selectPageDown = function() {
|
||||
var a = this.getPageDownRow() + Math.floor(this.getVisibleRowCount() / 2);
|
||||
this.scrollPageDown();
|
||||
var b = this.getSelection();
|
||||
b.$moveSelection(function() {
|
||||
b.moveCursorTo(a, b.getSelectionLead().column)
|
||||
})
|
||||
};
|
||||
this.selectPageUp = function() {
|
||||
var a = this.getLastVisibleRow() - this.getFirstVisibleRow(), b = this.getPageUpRow() + Math.round(a / 2);
|
||||
this.scrollPageUp();
|
||||
var d = this.getSelection();
|
||||
d.$moveSelection(function() {
|
||||
d.moveCursorTo(b, d.getSelectionLead().column)
|
||||
})
|
||||
};
|
||||
this.gotoPageDown = function() {
|
||||
var a = this.getPageDownRow(), b = Math.min(this.getCursorPosition().column, this.doc.getLine(a).length);
|
||||
this.scrollToRow(a);
|
||||
this.getSelection().moveCursorTo(a, b)
|
||||
};
|
||||
this.gotoPageUp = function() {
|
||||
var a = this.getPageUpRow(), b = Math.min(this.getCursorPosition().column, this.doc.getLine(a).length);
|
||||
this.scrollToRow(a);
|
||||
this.getSelection().moveCursorTo(a, b)
|
||||
};
|
||||
this.scrollPageDown = function() {
|
||||
this.scrollToRow(this.getPageDownRow())
|
||||
};
|
||||
this.scrollPageUp = function() {
|
||||
this.renderer.scrollToRow(this.getPageUpRow())
|
||||
};
|
||||
this.scrollToRow = function(a) {
|
||||
this.renderer.scrollToRow(a)
|
||||
};
|
||||
this.getCursorPosition = function() {
|
||||
return this.selection.getCursor()
|
||||
};
|
||||
this.getSelectionRange = function() {
|
||||
return this.selection.getRange()
|
||||
};
|
||||
this.clearSelection = function() {
|
||||
this.selection.clearSelection();
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.moveCursorTo = function(a, b) {
|
||||
this.selection.moveCursorTo(a, b);
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.moveCursorToPosition = function(a) {
|
||||
this.selection.moveCursorToPosition(a);
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.gotoLine = function(a, b) {
|
||||
this.selection.clearSelection();
|
||||
this.$blockScrolling = true;
|
||||
this.moveCursorTo(a - 1, b || 0);
|
||||
this.$blockScrolling = false;
|
||||
this.isRowVisible(this.getCursorPosition().row) || this.scrollToRow(a - 1 - Math.floor(this.getVisibleRowCount() / 2))
|
||||
};
|
||||
this.navigateTo = function(a, b) {
|
||||
this.clearSelection();
|
||||
this.moveCursorTo(a, b);
|
||||
this.$updateDesiredColumn(b)
|
||||
};
|
||||
this.navigateUp = function() {
|
||||
this.selection.clearSelection();
|
||||
this.selection.moveCursorBy(-1, 0);
|
||||
if(this.$desiredColumn) {
|
||||
var a = this.getCursorPosition(), b = this.doc.screenToDocumentColumn(a.row, this.$desiredColumn);
|
||||
this.selection.moveCursorTo(a.row, b)
|
||||
}
|
||||
};
|
||||
this.navigateDown = function() {
|
||||
this.selection.clearSelection();
|
||||
this.selection.moveCursorBy(1, 0);
|
||||
if(this.$desiredColumn) {
|
||||
var a = this.getCursorPosition(), b = this.doc.screenToDocumentColumn(a.row, this.$desiredColumn);
|
||||
this.selection.moveCursorTo(a.row, b)
|
||||
}
|
||||
};
|
||||
this.$updateDesiredColumn = function() {
|
||||
var a = this.getCursorPosition();
|
||||
this.$desiredColumn = this.doc.documentToScreenColumn(a.row, a.column)
|
||||
};
|
||||
this.navigateLeft = function() {
|
||||
this.selection.isEmpty() ? this.selection.moveCursorLeft() : this.moveCursorToPosition(this.getSelectionRange().start);
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateRight = function() {
|
||||
this.selection.isEmpty() ? this.selection.moveCursorRight() : this.moveCursorToPosition(this.getSelectionRange().end);
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateLineStart = function() {
|
||||
this.selection.moveCursorLineStart();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateLineEnd = function() {
|
||||
this.selection.moveCursorLineEnd();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateFileEnd = function() {
|
||||
this.selection.moveCursorFileEnd();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateFileStart = function() {
|
||||
this.selection.moveCursorFileStart();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateWordRight = function() {
|
||||
this.selection.moveCursorWordRight();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.navigateWordLeft = function() {
|
||||
this.selection.moveCursorWordLeft();
|
||||
this.clearSelection()
|
||||
};
|
||||
this.replace = function(a, b) {
|
||||
b && this.$search.set(b);
|
||||
b = this.$search.find(this.doc);
|
||||
this.$tryReplace(b, a);
|
||||
b !== null && this.selection.setSelectionRange(b);
|
||||
this.$updateDesiredColumn()
|
||||
};
|
||||
this.replaceAll = function(a, b) {
|
||||
b && this.$search.set(b);
|
||||
b = this.$search.findAll(this.doc);
|
||||
if(b.length) {
|
||||
this.clearSelection();
|
||||
this.selection.moveCursorTo(0, 0);
|
||||
for(var d = b.length - 1;d >= 0;--d) {
|
||||
this.$tryReplace(b[d], a)
|
||||
}b[0] !== null && this.selection.setSelectionRange(b[0]);
|
||||
this.$updateDesiredColumn()
|
||||
}
|
||||
};
|
||||
this.$tryReplace = function(a, b) {
|
||||
b = this.$search.replace(this.doc.getTextRange(a), b);
|
||||
if(b !== null) {
|
||||
a.end = this.doc.replace(a, b);
|
||||
return a
|
||||
}else {
|
||||
return null
|
||||
}
|
||||
};
|
||||
this.getLastSearchOptions = function() {
|
||||
return this.$search.getOptions()
|
||||
};
|
||||
this.find = function(a, b) {
|
||||
this.clearSelection();
|
||||
b = b || {};
|
||||
b.needle = a;
|
||||
this.$search.set(b);
|
||||
this.$find()
|
||||
};
|
||||
this.findNext = function(a) {
|
||||
a = a || {};
|
||||
if(typeof a.backwards == "undefined") {
|
||||
a.backwards = false
|
||||
}this.$search.set(a);
|
||||
this.$find()
|
||||
};
|
||||
this.findPrevious = function(a) {
|
||||
a = a || {};
|
||||
if(typeof a.backwards == "undefined") {
|
||||
a.backwards = true
|
||||
}this.$search.set(a);
|
||||
this.$find()
|
||||
};
|
||||
this.$find = function(a) {
|
||||
this.selection.isEmpty() || this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())});
|
||||
typeof a != "undefined" && this.$search.set({backwards:a});
|
||||
if(a = this.$search.find(this.doc)) {
|
||||
this.gotoLine(a.end.row + 1, a.end.column);
|
||||
this.$updateDesiredColumn();
|
||||
this.selection.setSelectionRange(a)
|
||||
}
|
||||
};
|
||||
this.undo = function() {
|
||||
this.doc.getUndoManager().undo()
|
||||
};
|
||||
this.redo = function() {
|
||||
this.doc.getUndoManager().redo()
|
||||
}
|
||||
}).call(g.prototype);
|
||||
r.Editor = g
|
||||
});
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
define(function(e, n) {
|
||||
var j = e("pilot/useragent"), m = e("pilot/event"), o = e("ace/conf/keybindings/default_mac").bindings, p = e("ace/conf/keybindings/default_win").bindings, q = e("pilot/canon");
|
||||
e("ace/commands/default_commands");
|
||||
e = function(k, i, l) {
|
||||
this.setConfig(l);
|
||||
var b = this;
|
||||
m.addKeyListener(k, function(a) {
|
||||
var d = (b.config.reverse[j.isOpera && j.isMac ? 0 | (a.metaKey ? 1 : 0) | (a.altKey ? 2 : 0) | (a.shiftKey ? 4 : 0) | (a.ctrlKey ? 8 : 0) : 0 | (a.ctrlKey ? 1 : 0) | (a.altKey ? 2 : 0) | (a.shiftKey ? 4 : 0) | (a.metaKey ? 8 : 0)] || {})[(b.keyNames[a.keyCode] || String.fromCharCode(a.keyCode)).toLowerCase()];
|
||||
if(q.exec(d, {editor:i})) {
|
||||
return m.stopEvent(a)
|
||||
}
|
||||
})
|
||||
};
|
||||
(function() {
|
||||
function k(b, a, d, f) {
|
||||
return(f && b.toLowerCase() || b).replace(/(?:^\s+|\n|\s+$)/g, "").split(new RegExp("[\\s ]*" + a + "[\\s ]*", "g"), d || 999)
|
||||
}
|
||||
function i(b, a, d) {
|
||||
var f, g = 0;
|
||||
b = k(b, "\\-", null, true);
|
||||
for(var c = 0, h = b.length;c < h;++c) {
|
||||
if(this.keyMods[b[c]]) {
|
||||
g |= this.keyMods[b[c]]
|
||||
}else {
|
||||
f = b[c] || "-"
|
||||
}
|
||||
}(d[g] || (d[g] = {}))[f] = a;
|
||||
return d
|
||||
}
|
||||
function l(b, a) {
|
||||
var d, f, g, c, h = {};
|
||||
for(d in b) {
|
||||
c = b[d];
|
||||
if(a && typeof c == "string") {
|
||||
c = c.split(a);
|
||||
f = 0;
|
||||
for(g = c.length;f < g;++f) {
|
||||
i.call(this, c[f], d, h)
|
||||
}
|
||||
}else {
|
||||
i.call(this, c, d, h)
|
||||
}
|
||||
}return h
|
||||
}
|
||||
this.keyMods = {ctrl:1, alt:2, option:2, shift:4, meta:8, command:8};
|
||||
this.keyNames = {"8":"Backspace", "9":"Tab", "13":"Enter", "27":"Esc", "32":"Space", "33":"PageUp", "34":"PageDown", "35":"End", "36":"Home", "37":"Left", "38":"Up", "39":"Right", "40":"Down", "45":"Insert", "46":"Delete", "107":"+", "112":"F1", "113":"F2", "114":"F3", "115":"F4", "116":"F5", "117":"F6", "118":"F7", "119":"F8", "120":"F9", "121":"F10", "122":"F11", "123":"F12"};
|
||||
this.setConfig = function(b) {
|
||||
this.config = b || (j.isMac ? o : p);
|
||||
if(typeof this.config.reverse == "undefined") {
|
||||
this.config.reverse = l.call(this, this.config, "|")
|
||||
}
|
||||
}
|
||||
}).call(e.prototype);
|
||||
n.KeyBinding = e
|
||||
});
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
define(function(b, f) {
|
||||
var d = b("pilot/dom");
|
||||
b = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_cursor-layer";
|
||||
a.appendChild(this.element);
|
||||
this.cursor = document.createElement("div");
|
||||
this.cursor.className = "ace_cursor";
|
||||
this.isVisible = false
|
||||
};
|
||||
(function() {
|
||||
this.setDocument = function(a) {
|
||||
this.doc = a
|
||||
};
|
||||
this.setCursor = function(a, c) {
|
||||
this.position = {row:a.row, column:this.doc.documentToScreenColumn(a.row, a.column)};
|
||||
c ? d.addCssClass(this.cursor, "ace_overwrite") : d.removeCssClass(this.cursor, "ace_overwrite")
|
||||
};
|
||||
this.hideCursor = function() {
|
||||
this.isVisible = false;
|
||||
this.cursor.parentNode && this.cursor.parentNode.removeChild(this.cursor);
|
||||
clearInterval(this.blinkId)
|
||||
};
|
||||
this.showCursor = function() {
|
||||
this.isVisible = true;
|
||||
this.element.appendChild(this.cursor);
|
||||
this.cursor.style.visibility = "visible";
|
||||
this.restartTimer()
|
||||
};
|
||||
this.restartTimer = function() {
|
||||
clearInterval(this.blinkId);
|
||||
if(this.isVisible) {
|
||||
var a = this.cursor;
|
||||
this.blinkId = setInterval(function() {
|
||||
a.style.visibility = "hidden";
|
||||
setTimeout(function() {
|
||||
a.style.visibility = "visible"
|
||||
}, 400)
|
||||
}, 1E3)
|
||||
}
|
||||
};
|
||||
this.getPixelPosition = function() {
|
||||
if(!this.config || !this.position) {
|
||||
return{left:0, top:0}
|
||||
}var a = this.position.row * this.config.lineHeight;
|
||||
return{left:Math.round(this.position.column * this.config.characterWidth), top:a}
|
||||
};
|
||||
this.update = function(a) {
|
||||
if(this.position) {
|
||||
this.config = a;
|
||||
var c = Math.round(this.position.column * a.characterWidth), e = this.position.row * a.lineHeight;
|
||||
this.pixelPos = {left:c, top:e};
|
||||
this.cursor.style.left = c + "px";
|
||||
this.cursor.style.top = e - a.firstRow * a.lineHeight + "px";
|
||||
this.cursor.style.width = a.characterWidth + "px";
|
||||
this.cursor.style.height = a.lineHeight + "px";
|
||||
this.isVisible && this.element.appendChild(this.cursor);
|
||||
this.restartTimer()
|
||||
}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
f.Cursor = b
|
||||
});
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
define(function(d, e) {
|
||||
var f = d("pilot/dom");
|
||||
d = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_gutter-layer";
|
||||
a.appendChild(this.element);
|
||||
this.$breakpoints = [];
|
||||
this.$decorations = []
|
||||
};
|
||||
(function() {
|
||||
this.addGutterDecoration = function(a, b) {
|
||||
this.$decorations[a] || (this.$decorations[a] = "");
|
||||
this.$decorations[a] += " ace_" + b
|
||||
};
|
||||
this.removeGutterDecoration = function(a, b) {
|
||||
this.$decorations[a] = this.$decorations[a].replace(" ace_" + b, "")
|
||||
};
|
||||
this.setBreakpoints = function(a) {
|
||||
this.$breakpoints = a.concat()
|
||||
};
|
||||
this.update = function(a) {
|
||||
this.$config = a;
|
||||
for(var b = [], c = a.firstRow;c <= a.lastRow;c++) {
|
||||
b.push("<div class='ace_gutter-cell", this.$decorations[c] || "", this.$breakpoints[c] ? " ace_breakpoint" : "", "' style='height:", a.lineHeight, "px;'>", c + 1, "</div>");
|
||||
b.push("</div>")
|
||||
}this.element = f.setInnerHtml(this.element, b.join(""));
|
||||
this.element.style.height = a.minHeight + "px"
|
||||
}
|
||||
}).call(d.prototype);
|
||||
e.Gutter = d
|
||||
});
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
define(function(h, j) {
|
||||
var i = h("ace/range").Range, k = h("pilot/dom");
|
||||
h = function(d) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_marker-layer";
|
||||
d.appendChild(this.element);
|
||||
this.markers = {};
|
||||
this.$markerId = 1
|
||||
};
|
||||
(function() {
|
||||
this.setDocument = function(d) {
|
||||
this.doc = d
|
||||
};
|
||||
this.addMarker = function(d, a, e) {
|
||||
var b = this.$markerId++;
|
||||
this.markers[b] = {range:d, type:e || "line", clazz:a};
|
||||
return b
|
||||
};
|
||||
this.removeMarker = function(d) {
|
||||
this.markers[d] && delete this.markers[d]
|
||||
};
|
||||
this.update = function(d) {
|
||||
if(d = d || this.config) {
|
||||
this.config = d;
|
||||
var a = [];
|
||||
for(var e in this.markers) {
|
||||
var b = this.markers[e], c = b.range.clipRows(d.firstRow, d.lastRow);
|
||||
if(!c.isEmpty()) {
|
||||
if(c.isMultiLine()) {
|
||||
b.type == "text" ? this.drawTextMarker(a, c, b.clazz, d) : this.drawMultiLineMarker(a, c, b.clazz, d)
|
||||
}else {
|
||||
this.drawSingleLineMarker(a, c, b.clazz, d)
|
||||
}
|
||||
}
|
||||
}this.element = k.setInnerHtml(this.element, a.join(""))
|
||||
}
|
||||
};
|
||||
this.drawTextMarker = function(d, a, e, b) {
|
||||
var c = a.start.row, f = new i(c, a.start.column, c, this.doc.getLine(c).length);
|
||||
this.drawSingleLineMarker(d, f, e, b, 1);
|
||||
c = a.end.row;
|
||||
f = new i(c, 0, c, a.end.column);
|
||||
this.drawSingleLineMarker(d, f, e, b);
|
||||
for(c = a.start.row + 1;c < a.end.row;c++) {
|
||||
f.start.row = c;
|
||||
f.end.row = c;
|
||||
f.end.column = this.doc.getLine(c).length;
|
||||
this.drawSingleLineMarker(d, f, e, b, 1)
|
||||
}
|
||||
};
|
||||
this.drawMultiLineMarker = function(d, a, e, b) {
|
||||
a = a.toScreenRange(this.doc);
|
||||
var c = b.lineHeight, f = Math.round(b.width - a.start.column * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight, l = Math.round(a.start.column * b.characterWidth);
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "width:", f, "px;", "top:", g, "px;", "left:", l, "px;'></div>");
|
||||
g = (a.end.row - b.firstRow) * b.lineHeight;
|
||||
f = Math.round(a.end.column * b.characterWidth);
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "top:", g, "px;", "width:", f, "px;'></div>");
|
||||
c = (a.end.row - a.start.row - 1) * b.lineHeight;
|
||||
if(!(c < 0)) {
|
||||
g = (a.start.row + 1 - b.firstRow) * b.lineHeight;
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "width:", b.width, "px;", "top:", g, "px;'></div>")
|
||||
}
|
||||
};
|
||||
this.drawSingleLineMarker = function(d, a, e, b, c) {
|
||||
a = a.toScreenRange(this.doc);
|
||||
var f = b.lineHeight;
|
||||
c = Math.round((a.end.column + (c || 0) - a.start.column) * b.characterWidth);
|
||||
var g = (a.start.row - b.firstRow) * b.lineHeight;
|
||||
a = Math.round(a.start.column * b.characterWidth);
|
||||
d.push("<div class='", e, "' style='", "height:", f, "px;", "width:", c, "px;", "top:", g, "px;", "left:", a, "px;'></div>")
|
||||
}
|
||||
}).call(h.prototype);
|
||||
j.Marker = h
|
||||
});
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
define(function(k, n) {
|
||||
var o = k("pilot/oop"), l = k("pilot/dom"), p = k("pilot/lang"), q = k("pilot/event_emitter").EventEmitter;
|
||||
k = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_text-layer";
|
||||
a.appendChild(this.element);
|
||||
this.$characterSize = this.$measureSizes();
|
||||
this.$pollSizeChanges()
|
||||
};
|
||||
(function() {
|
||||
o.implement(this, q);
|
||||
this.EOF_CHAR = "¶";
|
||||
this.EOL_CHAR = "¬";
|
||||
this.TAB_CHAR = "→";
|
||||
this.SPACE_CHAR = "·";
|
||||
this.setTokenizer = function(a) {
|
||||
this.tokenizer = a
|
||||
};
|
||||
this.getLineHeight = function() {
|
||||
return this.$characterSize.height || 1
|
||||
};
|
||||
this.getCharacterWidth = function() {
|
||||
return this.$characterSize.width || 1
|
||||
};
|
||||
this.$pollSizeChanges = function() {
|
||||
var a = this;
|
||||
setInterval(function() {
|
||||
var b = a.$measureSizes();
|
||||
if(a.$characterSize.width !== b.width || a.$characterSize.height !== b.height) {
|
||||
a.$characterSize = b;
|
||||
a._dispatchEvent("changeCharaterSize", {data:b})
|
||||
}
|
||||
}, 500)
|
||||
};
|
||||
this.$fontStyles = {fontFamily:1, fontSize:1, fontWeight:1, fontStyle:1, lineHeight:1};
|
||||
this.$measureSizes = function() {
|
||||
if(!this.$measureNode) {
|
||||
var a = this.$measureNode = document.createElement("div"), b = a.style;
|
||||
b.width = b.height = "auto";
|
||||
b.left = b.top = "-1000px";
|
||||
b.visibility = "hidden";
|
||||
b.position = "absolute";
|
||||
b.overflow = "visible";
|
||||
b.whiteSpace = "nowrap";
|
||||
a.innerHTML = p.stringRepeat("Xy", 1E3);
|
||||
document.body.insertBefore(a, document.body.firstChild)
|
||||
}b = this.$measureNode.style;
|
||||
for(var e in this.$fontStyles) {
|
||||
a = l.computedStyle(this.element, e);
|
||||
b[e] = a
|
||||
}return{height:this.$measureNode.offsetHeight, width:this.$measureNode.offsetWidth / 2E3}
|
||||
};
|
||||
this.setDocument = function(a) {
|
||||
this.doc = a
|
||||
};
|
||||
this.showInvisibles = false;
|
||||
this.setShowInvisibles = function(a) {
|
||||
if(this.showInvisibles == a) {
|
||||
return false
|
||||
}this.showInvisibles = a;
|
||||
return true
|
||||
};
|
||||
this.$computeTabString = function() {
|
||||
var a = this.doc.getTabSize();
|
||||
if(this.showInvisibles) {
|
||||
a = a / 2;
|
||||
this.$tabString = "<span class='ace_invisible'>" + (new Array(Math.floor(a))).join(" ") + this.TAB_CHAR + (new Array(Math.ceil(a) + 1)).join(" ") + "</span>"
|
||||
}else {
|
||||
this.$tabString = (new Array(a + 1)).join(" ")
|
||||
}
|
||||
};
|
||||
this.updateLines = function(a, b, e) {
|
||||
this.$computeTabString();
|
||||
this.config = a;
|
||||
var g = Math.max(b, a.firstRow), c = Math.min(e, a.lastRow), d = this.element.childNodes, h = this;
|
||||
this.tokenizer.getTokens(g, c, function(i) {
|
||||
for(var f = g;f <= c;f++) {
|
||||
var j = d[f - a.firstRow];
|
||||
if(j) {
|
||||
var m = [];
|
||||
h.$renderLine(m, f, i[f - g].tokens);
|
||||
l.setInnerHtml(j, m.join(""))
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
this.scrollLines = function(a) {
|
||||
function b(i) {
|
||||
a.firstRow < c.firstRow ? g.$renderLinesFragment(a, a.firstRow, c.firstRow - 1, function(f) {
|
||||
d.firstChild ? d.insertBefore(f, d.firstChild) : d.appendChild(f);
|
||||
i()
|
||||
}) : i()
|
||||
}
|
||||
function e() {
|
||||
a.lastRow > c.lastRow && g.$renderLinesFragment(a, c.lastRow + 1, a.lastRow, function(i) {
|
||||
d.appendChild(i)
|
||||
})
|
||||
}
|
||||
var g = this;
|
||||
this.$computeTabString();
|
||||
var c = this.config;
|
||||
this.config = a;
|
||||
if(!c || c.lastRow < a.firstRow) {
|
||||
return this.update(a)
|
||||
}if(a.lastRow < c.firstRow) {
|
||||
return this.update(a)
|
||||
}var d = this.element;
|
||||
if(c.firstRow < a.firstRow) {
|
||||
for(var h = c.firstRow;h < a.firstRow;h++) {
|
||||
d.removeChild(d.firstChild)
|
||||
}
|
||||
}if(c.lastRow > a.lastRow) {
|
||||
for(h = a.lastRow + 1;h <= c.lastRow;h++) {
|
||||
d.removeChild(d.lastChild)
|
||||
}
|
||||
}b(e)
|
||||
};
|
||||
this.$renderLinesFragment = function(a, b, e, g) {
|
||||
var c = document.createDocumentFragment(), d = this;
|
||||
this.tokenizer.getTokens(b, e, function(h) {
|
||||
for(var i = b;i <= e;i++) {
|
||||
var f = document.createElement("div");
|
||||
f.className = "ace_line";
|
||||
var j = f.style;
|
||||
j.height = d.$characterSize.height + "px";
|
||||
j.width = a.width + "px";
|
||||
j = [];
|
||||
d.$renderLine(j, i, h[i - b].tokens);
|
||||
f.innerHTML = j.join("");
|
||||
c.appendChild(f)
|
||||
}g(c)
|
||||
})
|
||||
};
|
||||
this.update = function(a) {
|
||||
this.$computeTabString();
|
||||
this.config = a;
|
||||
var b = [], e = this;
|
||||
this.tokenizer.getTokens(a.firstRow, a.lastRow, function(g) {
|
||||
for(var c = a.firstRow;c <= a.lastRow;c++) {
|
||||
b.push("<div class='ace_line' style='height:" + e.$characterSize.height + "px;", "width:", a.width, "px'>");
|
||||
e.$renderLine(b, c, g[c - a.firstRow].tokens);
|
||||
b.push("</div>")
|
||||
}e.element = l.setInnerHtml(e.element, b.join(""))
|
||||
})
|
||||
};
|
||||
this.$textToken = {text:true, rparen:true, lparen:true};
|
||||
this.$renderLine = function(a, b, e) {
|
||||
for(var g = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g, c = 0;c < e.length;c++) {
|
||||
var d = e[c], h = d.value.replace(/&/g, "&").replace(/</g, "<").replace(g, " ").replace(/\t/g, this.$tabString);
|
||||
if(this.$textToken[d.type]) {
|
||||
a.push(h)
|
||||
}else {
|
||||
d = "ace_" + d.type.replace(/\./g, " ace_");
|
||||
a.push("<span class='", d, "'>", h, "</span>")
|
||||
}
|
||||
}if(this.showInvisibles) {
|
||||
b !== this.doc.getLength() - 1 ? a.push("<span class='ace_invisible'>" + this.EOL_CHAR + "</span>") : a.push("<span class='ace_invisible'>" + this.EOF_CHAR + "</span>")
|
||||
}
|
||||
}
|
||||
}).call(k.prototype);
|
||||
n.Text = k
|
||||
});
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
define("ace/mode/css_highlight_rules", ["require", "exports", "module", "pilot/oop", "pilot/lang", "ace/mode/text_highlight_rules"], function(b, j) {
|
||||
var k = b("pilot/oop"), c = b("pilot/lang");
|
||||
b = b("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var e = function() {
|
||||
function a(d) {
|
||||
var m = [];
|
||||
d = d.split("");
|
||||
for(var l = 0;l < d.length;l++) {
|
||||
m.push("[", d[l].toLowerCase(), d[l].toUpperCase(), "]")
|
||||
}return m.join("")
|
||||
}
|
||||
var f = c.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),
|
||||
g = c.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), h = c.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),
|
||||
i = c.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("em")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ex")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("px")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("cm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("mm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("in")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pt")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pc")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("deg")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("rad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("grad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ms")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("s")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("hz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("khz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))%"},
|
||||
{token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{6}"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{3}"}, {token:"lparen", regex:"{"}, {token:"rparen", regex:"}"}, {token:function(d) {
|
||||
return f[d.toLowerCase()] ? "support.type" : g[d.toLowerCase()] ? "support.function" : h[d.toLowerCase()] ? "support.constant" : i[d.toLowerCase()] ? "support.constant.color" : "text"
|
||||
}, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
k.inherits(e, b);
|
||||
j.CssHighlightRules = e
|
||||
});
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(b, j) {
|
||||
var k = b("ace/range").Range;
|
||||
b = function() {
|
||||
};
|
||||
(function() {
|
||||
this.checkOutdent = function(c, e) {
|
||||
if(!/^\s+$/.test(c)) {
|
||||
return false
|
||||
}return/^\s*\}/.test(e)
|
||||
};
|
||||
this.autoOutdent = function(c, e) {
|
||||
var a = c.getLine(e).match(/^(\s*\})/);
|
||||
if(!a) {
|
||||
return 0
|
||||
}a = a[1].length;
|
||||
var f = c.findMatchingBracket({row:e, column:a});
|
||||
if(!f || f.row == e) {
|
||||
return 0
|
||||
}f = this.$getIndent(c.getLine(f.row));
|
||||
c.replace(new k(e, 0, e, a - 1), f);
|
||||
return f.length - (a - 1)
|
||||
};
|
||||
this.$getIndent = function(c) {
|
||||
if(c = c.match(/^(\s+)/)) {
|
||||
return c[1]
|
||||
}return""
|
||||
}
|
||||
}).call(b.prototype);
|
||||
j.MatchingBraceOutdent = b
|
||||
});
|
||||
define("ace/mode/css", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent"], function(b, j) {
|
||||
var k = b("pilot/oop"), c = b("ace/mode/text").Mode, e = b("ace/tokenizer").Tokenizer, a = b("ace/mode/css_highlight_rules").CssHighlightRules, f = b("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
|
||||
b = function() {
|
||||
this.$tokenizer = new e((new a).getRules());
|
||||
this.$outdent = new f
|
||||
};
|
||||
k.inherits(b, c);
|
||||
(function() {
|
||||
this.getNextLineIndent = function(g, h, i) {
|
||||
var d = this.$getIndent(h);
|
||||
g = this.$tokenizer.getLineTokens(h, g).tokens;
|
||||
if(g.length && g[g.length - 1].type == "comment") {
|
||||
return d
|
||||
}if(h.match(/^.*\{\s*$/)) {
|
||||
d += i
|
||||
}return d
|
||||
};
|
||||
this.checkOutdent = function(g, h, i) {
|
||||
return this.$outdent.checkOutdent(h, i)
|
||||
};
|
||||
this.autoOutdent = function(g, h, i) {
|
||||
return this.$outdent.autoOutdent(h, i)
|
||||
}
|
||||
}).call(b.prototype);
|
||||
j.Mode = b
|
||||
});
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
define(function(c, h) {
|
||||
var i = c("pilot/oop"), d = c("pilot/lang");
|
||||
c = c("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var g = function() {
|
||||
function a(b) {
|
||||
var f = [];
|
||||
b = b.split("");
|
||||
for(var e = 0;e < b.length;e++) {
|
||||
f.push("[", b[e].toLowerCase(), b[e].toUpperCase(), "]")
|
||||
}return f.join("")
|
||||
}
|
||||
var j = d.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),
|
||||
k = d.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), l = d.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),
|
||||
m = d.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("em")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ex")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("px")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("cm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("mm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("in")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pt")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pc")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("deg")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("rad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("grad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ms")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("s")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("hz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("khz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))%"},
|
||||
{token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{6}"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{3}"}, {token:"lparen", regex:"{"}, {token:"rparen", regex:"}"}, {token:function(b) {
|
||||
return j[b.toLowerCase()] ? "support.type" : k[b.toLowerCase()] ? "support.function" : l[b.toLowerCase()] ? "support.constant" : m[b.toLowerCase()] ? "support.constant.color" : "text"
|
||||
}, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
i.inherits(g, c);
|
||||
h.CssHighlightRules = g
|
||||
});
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
define(function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"comment.doc", regex:"\\*\\/", next:"start"}, {token:"comment.doc.tag", regex:"@[\\w\\d_]+"}, {token:"comment.doc", regex:"s+"}, {token:"comment.doc", regex:"TODO"}, {token:"comment.doc", regex:"[^@\\*]+"}, {token:"comment.doc", regex:"."}]}
|
||||
};
|
||||
d.inherits(b, a);
|
||||
(function() {
|
||||
this.getStartRule = function(e) {
|
||||
return{token:"comment.doc", regex:"\\/\\*(?=\\*)", next:e}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
c.DocCommentHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
define("ace/mode/html_highlight_rules", ["require", "exports", "module", "pilot/oop", "ace/mode/css_highlight_rules", "ace/mode/javascript_highlight_rules", "ace/mode/text_highlight_rules"], function(a, f) {
|
||||
var g = a("pilot/oop"), h = a("ace/mode/css_highlight_rules").CssHighlightRules, i = a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var d = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"},
|
||||
{token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"},
|
||||
{token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]};
|
||||
this.addRules((new i).getRules(), "js-");
|
||||
this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"});
|
||||
this.addRules((new h).getRules(), "css-");
|
||||
this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"})
|
||||
};
|
||||
g.inherits(d, a);
|
||||
f.HtmlHighlightRules = d
|
||||
});
|
||||
define("ace/mode/html", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/mode/javascript", "ace/mode/css", "ace/tokenizer", "ace/mode/html_highlight_rules"], function(a, f) {
|
||||
var g = a("pilot/oop"), h = a("ace/mode/text").Mode, i = a("ace/mode/javascript").Mode, d = a("ace/mode/css").Mode, l = a("ace/tokenizer").Tokenizer, m = a("ace/mode/html_highlight_rules").HtmlHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new l((new m).getRules());
|
||||
this.$js = new i;
|
||||
this.$css = new d
|
||||
};
|
||||
g.inherits(a, h);
|
||||
(function() {
|
||||
this.toggleCommentLines = function() {
|
||||
return this.$delegate("toggleCommentLines", arguments, function() {
|
||||
return 0
|
||||
})
|
||||
};
|
||||
this.getNextLineIndent = function(j, b) {
|
||||
var e = this;
|
||||
return this.$delegate("getNextLineIndent", arguments, function() {
|
||||
return e.$getIndent(b)
|
||||
})
|
||||
};
|
||||
this.checkOutdent = function() {
|
||||
return this.$delegate("checkOutdent", arguments, function() {
|
||||
return false
|
||||
})
|
||||
};
|
||||
this.autoOutdent = function() {
|
||||
return this.$delegate("autoOutdent", arguments)
|
||||
};
|
||||
this.$delegate = function(j, b, e) {
|
||||
var k = b[0], c = k.split("js-");
|
||||
if(!c[0] && c[1]) {
|
||||
b[0] = c[1];
|
||||
return this.$js[j].apply(this.$js, b)
|
||||
}c = k.split("css-");
|
||||
if(!c[0] && c[1]) {
|
||||
b[0] = c[1];
|
||||
return this.$css[j].apply(this.$css, b)
|
||||
}return e ? e() : undefined
|
||||
}
|
||||
}).call(a.prototype);
|
||||
f.Mode = a
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
define(function(a, c) {
|
||||
var d = a("pilot/oop"), e = a("ace/mode/css_highlight_rules").CssHighlightRules, f = a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"},
|
||||
{token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"},
|
||||
{token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]};
|
||||
this.addRules((new f).getRules(), "js-");
|
||||
this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"});
|
||||
this.addRules((new e).getRules(), "css-");
|
||||
this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"})
|
||||
};
|
||||
d.inherits(b, a);
|
||||
c.HtmlHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
define(function(f, h) {
|
||||
var i = f("pilot/oop"), j = f("ace/mode/text").Mode, k = f("ace/tokenizer").Tokenizer, l = f("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules, m = f("ace/mode/matching_brace_outdent").MatchingBraceOutdent, n = f("ace/range").Range;
|
||||
f = function() {
|
||||
this.$tokenizer = new k((new l).getRules());
|
||||
this.$outdent = new m
|
||||
};
|
||||
i.inherits(f, j);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(c, a, d, g) {
|
||||
var e = true;
|
||||
c = /^(\s*)\/\//;
|
||||
for(var b = d;b <= g;b++) {
|
||||
if(!c.test(a.getLine(b))) {
|
||||
e = false;
|
||||
break
|
||||
}
|
||||
}if(e) {
|
||||
e = new n(0, 0, 0, 0);
|
||||
for(b = d;b <= g;b++) {
|
||||
d = a.getLine(b).replace(c, "$1");
|
||||
e.start.row = b;
|
||||
e.end.row = b;
|
||||
e.end.column = d.length + 2;
|
||||
a.replace(e, d)
|
||||
}return-2
|
||||
}else {
|
||||
return a.indentRows(d, g, "//")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(c, a, d) {
|
||||
var g = this.$getIndent(a), e = this.$tokenizer.getLineTokens(a, c), b = e.tokens;
|
||||
e = e.state;
|
||||
if(b.length && b[b.length - 1].type == "comment") {
|
||||
return g
|
||||
}if(c == "start") {
|
||||
if(c = a.match(/^.*[\{\(\[]\s*$/)) {
|
||||
g += d
|
||||
}
|
||||
}else {
|
||||
if(c == "doc-start") {
|
||||
if(e == "start") {
|
||||
return""
|
||||
}if(c = a.match(/^\s*(\/?)\*/)) {
|
||||
if(c[1]) {
|
||||
g += " "
|
||||
}g += "* "
|
||||
}
|
||||
}
|
||||
}return g
|
||||
};
|
||||
this.checkOutdent = function(c, a, d) {
|
||||
return this.$outdent.checkOutdent(a, d)
|
||||
};
|
||||
this.autoOutdent = function(c, a, d) {
|
||||
return this.$outdent.autoOutdent(a, d)
|
||||
}
|
||||
}).call(f.prototype);
|
||||
h.Mode = f
|
||||
});
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
define(function(a, e) {
|
||||
var f = a("pilot/oop"), c = a("pilot/lang"), g = a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
JavaScriptHighlightRules = function() {
|
||||
var d = new g, h = c.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")), i = c.arrayToMap("null|Infinity|NaN|undefined".split("|")), j = c.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"\\/\\/.*$"}, d.getStartRule("doc-start"), {token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string.regexp", regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:'["].*\\\\$', next:"qqstring"}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"string", regex:"['].*\\\\$", next:"qstring"}, {token:"constant.numeric",
|
||||
regex:"0[xX][0-9a-fA-F]+\\b"}, {token:"constant.numeric", regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, {token:"constant.language.boolean", regex:"(?:true|false)\\b"}, {token:function(b) {
|
||||
return b == "this" ? "variable.language" : h[b] ? "keyword" : i[b] ? "constant.language" : j[b] ? "invalid.illegal" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"}, {token:"lparen", regex:"[[({]"}, {token:"rparen", regex:"[\\])}]"}, {token:"text", regex:"\\s+"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}], qqstring:[{token:"string", regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||
next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next:"start"}, {token:"string", regex:".+"}]};
|
||||
this.addRules(d.getRules(), "doc-");
|
||||
this.$rules["doc-start"][0].next = "start"
|
||||
};
|
||||
f.inherits(JavaScriptHighlightRules, a);
|
||||
e.JavaScriptHighlightRules = JavaScriptHighlightRules
|
||||
});
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
define(function(e, f) {
|
||||
var g = e("ace/range").Range;
|
||||
e = function() {
|
||||
};
|
||||
(function() {
|
||||
this.checkOutdent = function(a, b) {
|
||||
if(!/^\s+$/.test(a)) {
|
||||
return false
|
||||
}return/^\s*\}/.test(b)
|
||||
};
|
||||
this.autoOutdent = function(a, b) {
|
||||
var c = a.getLine(b).match(/^(\s*\})/);
|
||||
if(!c) {
|
||||
return 0
|
||||
}c = c[1].length;
|
||||
var d = a.findMatchingBracket({row:b, column:c});
|
||||
if(!d || d.row == b) {
|
||||
return 0
|
||||
}d = this.$getIndent(a.getLine(d.row));
|
||||
a.replace(new g(b, 0, b, c - 1), d);
|
||||
return d.length - (c - 1)
|
||||
};
|
||||
this.$getIndent = function(a) {
|
||||
if(a = a.match(/^(\s+)/)) {
|
||||
return a[1]
|
||||
}return""
|
||||
}
|
||||
}).call(e.prototype);
|
||||
f.MatchingBraceOutdent = e
|
||||
});
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
define(function(d, h) {
|
||||
var i = d("pilot/oop"), j = d("./text").Mode, k = d("../tokenizer").Tokenizer, l = d("./php_highlight_rules").PhpHighlightRules, m = d("./matching_brace_outdent").MatchingBraceOutdent, n = d("../range").Range;
|
||||
d = function() {
|
||||
this.$tokenizer = new k((new l).getRules());
|
||||
this.$outdent = new m
|
||||
};
|
||||
i.inherits(d, j);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(f, a, b, g) {
|
||||
var c = true;
|
||||
f = /^(\s*)#/;
|
||||
for(var e = b;e <= g;e++) {
|
||||
if(!f.test(a.getLine(e))) {
|
||||
c = false;
|
||||
break
|
||||
}
|
||||
}if(c) {
|
||||
c = new n(0, 0, 0, 0);
|
||||
for(e = b;e <= g;e++) {
|
||||
b = a.getLine(e).replace(f, "$1");
|
||||
c.start.row = e;
|
||||
c.end.row = e;
|
||||
c.end.column = b.length + 2;
|
||||
a.replace(c, b)
|
||||
}return-2
|
||||
}else {
|
||||
return a.indentRows(b, g, "#")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(f, a, b) {
|
||||
var g = this.$getIndent(a), c = this.$tokenizer.getLineTokens(a, f).tokens;
|
||||
if(c.length && c[c.length - 1].type == "comment") {
|
||||
return g
|
||||
}if(f == "start") {
|
||||
if(a.match(/^.*[\{\(\[\:]\s*$/)) {
|
||||
g += b
|
||||
}
|
||||
}return g
|
||||
};
|
||||
this.checkOutdent = function(f, a, b) {
|
||||
return this.$outdent.checkOutdent(a, b)
|
||||
};
|
||||
this.autoOutdent = function(f, a, b) {
|
||||
return this.$outdent.autoOutdent(a, b)
|
||||
}
|
||||
}).call(d.prototype);
|
||||
h.Mode = d
|
||||
});
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
define("ace/mode/python_highlight_rules", ["require", "exports", "module", "pilot/oop", "pilot/lang", "./text_highlight_rules"], function(a, l) {
|
||||
var m = a("pilot/oop"), b = a("pilot/lang");
|
||||
a = a("./text_highlight_rules").TextHighlightRules;
|
||||
PythonHighlightRules = function() {
|
||||
var f = b.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), h = b.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), i = b.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
n = b.arrayToMap("".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string",
|
||||
regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},
|
||||
{token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(c) {
|
||||
return f[c] ? "keyword" : h[c] ? "constant.language" : n[c] ? "invalid.illegal" : i[c] ? "support.function" : c == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]}
|
||||
};
|
||||
m.inherits(PythonHighlightRules, a);
|
||||
l.PythonHighlightRules = PythonHighlightRules
|
||||
});
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(a, l) {
|
||||
var m = a("ace/range").Range;
|
||||
a = function() {
|
||||
};
|
||||
(function() {
|
||||
this.checkOutdent = function(b, f) {
|
||||
if(!/^\s+$/.test(b)) {
|
||||
return false
|
||||
}return/^\s*\}/.test(f)
|
||||
};
|
||||
this.autoOutdent = function(b, f) {
|
||||
var h = b.getLine(f).match(/^(\s*\})/);
|
||||
if(!h) {
|
||||
return 0
|
||||
}h = h[1].length;
|
||||
var i = b.findMatchingBracket({row:f, column:h});
|
||||
if(!i || i.row == f) {
|
||||
return 0
|
||||
}i = this.$getIndent(b.getLine(i.row));
|
||||
b.replace(new m(f, 0, f, h - 1), i);
|
||||
return i.length - (h - 1)
|
||||
};
|
||||
this.$getIndent = function(b) {
|
||||
if(b = b.match(/^(\s+)/)) {
|
||||
return b[1]
|
||||
}return""
|
||||
}
|
||||
}).call(a.prototype);
|
||||
l.MatchingBraceOutdent = a
|
||||
});
|
||||
define("ace/mode/python", ["require", "exports", "module", "pilot/oop", "./text", "../tokenizer", "./python_highlight_rules", "./matching_brace_outdent", "../range"], function(a, l) {
|
||||
var m = a("pilot/oop"), b = a("./text").Mode, f = a("../tokenizer").Tokenizer, h = a("./python_highlight_rules").PythonHighlightRules, i = a("./matching_brace_outdent").MatchingBraceOutdent, n = a("../range").Range;
|
||||
a = function() {
|
||||
this.$tokenizer = new f((new h).getRules());
|
||||
this.$outdent = new i
|
||||
};
|
||||
m.inherits(a, b);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(c, d, e, k) {
|
||||
var g = true;
|
||||
c = /^(\s*)#/;
|
||||
for(var j = e;j <= k;j++) {
|
||||
if(!c.test(d.getLine(j))) {
|
||||
g = false;
|
||||
break
|
||||
}
|
||||
}if(g) {
|
||||
g = new n(0, 0, 0, 0);
|
||||
for(j = e;j <= k;j++) {
|
||||
e = d.getLine(j).replace(c, "$1");
|
||||
g.start.row = j;
|
||||
g.end.row = j;
|
||||
g.end.column = e.length + 2;
|
||||
d.replace(g, e)
|
||||
}return-2
|
||||
}else {
|
||||
return d.indentRows(e, k, "#")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(c, d, e) {
|
||||
var k = this.$getIndent(d), g = this.$tokenizer.getLineTokens(d, c).tokens;
|
||||
if(g.length && g[g.length - 1].type == "comment") {
|
||||
return k
|
||||
}if(c == "start") {
|
||||
if(d.match(/^.*[\{\(\[\:]\s*$/)) {
|
||||
k += e
|
||||
}
|
||||
}return k
|
||||
};
|
||||
this.checkOutdent = function(c, d, e) {
|
||||
return this.$outdent.checkOutdent(d, e)
|
||||
};
|
||||
this.autoOutdent = function(c, d, e) {
|
||||
return this.$outdent.autoOutdent(d, e)
|
||||
}
|
||||
}).call(a.prototype);
|
||||
l.Mode = a
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
define(function(a, d) {
|
||||
var e = a("pilot/oop"), c = a("pilot/lang");
|
||||
a = a("./text_highlight_rules").TextHighlightRules;
|
||||
PythonHighlightRules = function() {
|
||||
var f = c.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), g = c.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), h = c.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
i = c.arrayToMap("".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string",
|
||||
regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},
|
||||
{token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(b) {
|
||||
return f[b] ? "keyword" : g[b] ? "constant.language" : i[b] ? "invalid.illegal" : h[b] ? "support.function" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]}
|
||||
};
|
||||
e.inherits(PythonHighlightRules, a);
|
||||
d.PythonHighlightRules = PythonHighlightRules
|
||||
});
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
define(function(a, c) {
|
||||
var d = a("ace/tokenizer").Tokenizer, e = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new d((new e).getRules())
|
||||
};
|
||||
(function() {
|
||||
this.getTokenizer = function() {
|
||||
return this.$tokenizer
|
||||
};
|
||||
this.toggleCommentLines = function() {
|
||||
return 0
|
||||
};
|
||||
this.getNextLineIndent = function() {
|
||||
return""
|
||||
};
|
||||
this.checkOutdent = function() {
|
||||
return false
|
||||
};
|
||||
this.autoOutdent = function() {
|
||||
};
|
||||
this.$getIndent = function(b) {
|
||||
if(b = b.match(/^(\s+)/)) {
|
||||
return b[1]
|
||||
}return""
|
||||
}
|
||||
}).call(a.prototype);
|
||||
c.Mode = a
|
||||
});
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
define(function(a, h) {
|
||||
a = function() {
|
||||
this.$rules = {start:[{token:"text", regex:".+"}]}
|
||||
};
|
||||
(function() {
|
||||
this.addRules = function(g, b) {
|
||||
for(var c in g) {
|
||||
for(var d = g[c], e = 0;e < d.length;e++) {
|
||||
var f = d[e];
|
||||
f.next = f.next ? b + f.next : b + c
|
||||
}this.$rules[b + c] = d
|
||||
}
|
||||
};
|
||||
this.getRules = function() {
|
||||
return this.$rules
|
||||
}
|
||||
}).call(a.prototype);
|
||||
h.TextHighlightRules = a
|
||||
});
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "pilot/oop", "ace/mode/text_highlight_rules"], function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>",
|
||||
next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
d.inherits(b, a);
|
||||
c.XmlHighlightRules = b
|
||||
});
|
||||
define("ace/mode/xml", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/xml_highlight_rules"], function(a, c) {
|
||||
var d = a("pilot/oop"), b = a("ace/mode/text").Mode, e = a("ace/tokenizer").Tokenizer, f = a("ace/mode/xml_highlight_rules").XmlHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new e((new f).getRules())
|
||||
};
|
||||
d.inherits(a, b);
|
||||
(function() {
|
||||
this.getNextLineIndent = function(h, g) {
|
||||
return this.$getIndent(g)
|
||||
}
|
||||
}).call(a.prototype);
|
||||
c.Mode = a
|
||||
});
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
define(function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>",
|
||||
next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
d.inherits(b, a);
|
||||
c.XmlHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
define(function(h, f) {
|
||||
var c = function(a, b, d, e) {
|
||||
this.start = {row:a, column:b};
|
||||
this.end = {row:d, column:e}
|
||||
};
|
||||
(function() {
|
||||
this.toString = function() {
|
||||
return"Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"
|
||||
};
|
||||
this.contains = function(a, b) {
|
||||
return this.compare(a, b) == 0
|
||||
};
|
||||
this.compare = function(a, b) {
|
||||
if(!this.isMultiLine()) {
|
||||
if(a === this.start.row) {
|
||||
return b < this.start.column ? -1 : b > this.end.column ? 1 : 0
|
||||
}
|
||||
}if(a < this.start.row) {
|
||||
return-1
|
||||
}if(a > this.end.row) {
|
||||
return 1
|
||||
}if(this.start.row === a) {
|
||||
return b >= this.start.column ? 0 : -1
|
||||
}if(this.end.row === a) {
|
||||
return b <= this.end.column ? 0 : 1
|
||||
}return 0
|
||||
};
|
||||
this.clipRows = function(a, b) {
|
||||
if(this.end.row > b) {
|
||||
var d = {row:b + 1, column:0}
|
||||
}if(this.start.row > b) {
|
||||
var e = {row:b + 1, column:0}
|
||||
}if(this.start.row < a) {
|
||||
e = {row:a, column:0}
|
||||
}if(this.end.row < a) {
|
||||
d = {row:a, column:0}
|
||||
}return c.fromPoints(e || this.start, d || this.end)
|
||||
};
|
||||
this.extend = function(a, b) {
|
||||
var d = this.compare(a, b);
|
||||
if(d == 0) {
|
||||
return this
|
||||
}else {
|
||||
if(d == -1) {
|
||||
var e = {row:a, column:b}
|
||||
}else {
|
||||
var g = {row:a, column:b}
|
||||
}
|
||||
}return c.fromPoints(e || this.start, g || this.end)
|
||||
};
|
||||
this.isEmpty = function() {
|
||||
return this.start.row == this.end.row && this.start.column == this.end.column
|
||||
};
|
||||
this.isMultiLine = function() {
|
||||
return this.start.row !== this.end.row
|
||||
};
|
||||
this.clone = function() {
|
||||
return c.fromPoints(this.start, this.end)
|
||||
};
|
||||
this.collapseRows = function() {
|
||||
return this.end.column == 0 ? new c(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new c(this.start.row, 0, this.end.row, 0)
|
||||
};
|
||||
this.toScreenRange = function(a) {
|
||||
return new c(this.start.row, a.documentToScreenColumn(this.start.row, this.start.column), this.end.row, a.documentToScreenColumn(this.end.row, this.end.column))
|
||||
}
|
||||
}).call(c.prototype);
|
||||
c.fromPoints = function(a, b) {
|
||||
return new c(a.row, a.column, b.row, b.column)
|
||||
};
|
||||
f.Range = c
|
||||
});
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
define(function(d, f) {
|
||||
var e = d("pilot/event");
|
||||
d = function(b) {
|
||||
this.onRender = b;
|
||||
this.pending = false;
|
||||
this.changes = 0
|
||||
};
|
||||
(function() {
|
||||
this.schedule = function(b) {
|
||||
this.changes |= b;
|
||||
if(!this.pending) {
|
||||
this.pending = true;
|
||||
var a = this;
|
||||
this.setTimeoutZero(function() {
|
||||
a.pending = false;
|
||||
var c = a.changes;
|
||||
a.changes = 0;
|
||||
a.onRender(c)
|
||||
})
|
||||
}
|
||||
};
|
||||
if(window.postMessage) {
|
||||
this.messageName = "zero-timeout-message";
|
||||
this.setTimeoutZero = function(b) {
|
||||
if(!this.attached) {
|
||||
var a = this;
|
||||
e.addListener(window, "message", function(c) {
|
||||
if(c.source == window && a.callback && c.data == a.messageName) {
|
||||
e.stopPropagation(c);
|
||||
a.callback()
|
||||
}
|
||||
});
|
||||
this.attached = true
|
||||
}this.callback = b;
|
||||
window.postMessage(this.messageName, "*")
|
||||
}
|
||||
}else {
|
||||
this.setTimeoutZero = function(b) {
|
||||
setTimeout(b, 0)
|
||||
}
|
||||
}
|
||||
}).call(d.prototype);
|
||||
f.RenderLoop = d
|
||||
});
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
define(function(a, c) {
|
||||
var d = a("pilot/oop"), e = a("pilot/dom"), f = a("pilot/event"), g = a("pilot/event_emitter").EventEmitter;
|
||||
a = function(b) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_sb";
|
||||
this.inner = document.createElement("div");
|
||||
this.element.appendChild(this.inner);
|
||||
b.appendChild(this.element);
|
||||
this.width = e.scrollbarWidth();
|
||||
this.element.style.width = this.width;
|
||||
f.addListener(this.element, "scroll", this.onScroll.bind(this))
|
||||
};
|
||||
(function() {
|
||||
d.implement(this, g);
|
||||
this.onScroll = function() {
|
||||
this._dispatchEvent("scroll", {data:this.element.scrollTop})
|
||||
};
|
||||
this.getWidth = function() {
|
||||
return this.width
|
||||
};
|
||||
this.setHeight = function(b) {
|
||||
this.element.style.height = Math.max(0, b - this.width) + "px"
|
||||
};
|
||||
this.setInnerHeight = function(b) {
|
||||
this.inner.style.height = b + "px"
|
||||
};
|
||||
this.setScrollTop = function(b) {
|
||||
this.element.scrollTop = b
|
||||
}
|
||||
}).call(a.prototype);
|
||||
c.ScrollBar = a
|
||||
});
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
define(function(o, r) {
|
||||
var p = o("pilot/lang"), s = o("pilot/oop"), t = o("ace/range").Range, l = function() {
|
||||
this.$options = {needle:"", backwards:false, wrap:false, caseSensitive:false, wholeWord:false, scope:l.ALL, regExp:false}
|
||||
};
|
||||
l.ALL = 1;
|
||||
l.SELECTION = 2;
|
||||
(function() {
|
||||
this.set = function(a) {
|
||||
s.mixin(this.$options, a);
|
||||
return this
|
||||
};
|
||||
this.getOptions = function() {
|
||||
return p.copyObject(this.$options)
|
||||
};
|
||||
this.find = function(a) {
|
||||
if(!this.$options.needle) {
|
||||
return null
|
||||
}var b = null;
|
||||
(this.$options.backwards ? this.$backwardMatchIterator(a) : this.$forwardMatchIterator(a)).forEach(function(c) {
|
||||
b = c;
|
||||
return true
|
||||
});
|
||||
return b
|
||||
};
|
||||
this.findAll = function(a) {
|
||||
if(!this.$options.needle) {
|
||||
return[]
|
||||
}var b = [];
|
||||
(this.$options.backwards ? this.$backwardMatchIterator(a) : this.$forwardMatchIterator(a)).forEach(function(c) {
|
||||
b.push(c)
|
||||
});
|
||||
return b
|
||||
};
|
||||
this.replace = function(a, b) {
|
||||
var c = this.$assembleRegExp(), g = c.exec(a);
|
||||
return g && g[0].length == a.length ? this.$options.regExp ? a.replace(c, b) : b : null
|
||||
};
|
||||
this.$forwardMatchIterator = function(a) {
|
||||
var b = this.$assembleRegExp(), c = this;
|
||||
return{forEach:function(g) {
|
||||
c.$forwardLineIterator(a).forEach(function(d, i, k) {
|
||||
if(i) {
|
||||
d = d.substring(i)
|
||||
}var j = [];
|
||||
d.replace(b, function(e) {
|
||||
j.push({str:e, offset:i + arguments[arguments.length - 2]});
|
||||
return e
|
||||
});
|
||||
for(d = 0;d < j.length;d++) {
|
||||
var h = j[d];
|
||||
h = c.$rangeFromMatch(k, h.offset, h.str.length);
|
||||
if(g(h)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
})
|
||||
}}
|
||||
};
|
||||
this.$backwardMatchIterator = function(a) {
|
||||
var b = this.$assembleRegExp(), c = this;
|
||||
return{forEach:function(g) {
|
||||
c.$backwardLineIterator(a).forEach(function(d, i, k) {
|
||||
if(i) {
|
||||
d = d.substring(i)
|
||||
}var j = [];
|
||||
d.replace(b, function(e, f) {
|
||||
j.push({str:e, offset:i + f});
|
||||
return e
|
||||
});
|
||||
for(d = j.length - 1;d >= 0;d--) {
|
||||
var h = j[d];
|
||||
h = c.$rangeFromMatch(k, h.offset, h.str.length);
|
||||
if(g(h)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
})
|
||||
}}
|
||||
};
|
||||
this.$rangeFromMatch = function(a, b, c) {
|
||||
return new t(a, b, a, b + c)
|
||||
};
|
||||
this.$assembleRegExp = function() {
|
||||
var a = this.$options.regExp ? this.$options.needle : p.escapeRegExp(this.$options.needle);
|
||||
if(this.$options.wholeWord) {
|
||||
a = "\\b" + a + "\\b"
|
||||
}var b = "g";
|
||||
this.$options.caseSensitive || (b += "i");
|
||||
return new RegExp(a, b)
|
||||
};
|
||||
this.$forwardLineIterator = function(a) {
|
||||
function b(e) {
|
||||
var f = a.getLine(e);
|
||||
if(c && e == g.end.row) {
|
||||
f = f.substring(0, g.end.column)
|
||||
}return f
|
||||
}
|
||||
var c = this.$options.scope == l.SELECTION, g = a.getSelection().getRange(), d = a.getSelection().getCursor(), i = c ? g.start.row : 0, k = c ? g.start.column : 0, j = c ? g.end.row : a.getLength() - 1, h = this.$options.wrap;
|
||||
return{forEach:function(e) {
|
||||
for(var f = d.row, m = b(f), n = d.column, q = false;!e(m, n, f);) {
|
||||
if(q) {
|
||||
return
|
||||
}f++;
|
||||
n = 0;
|
||||
if(f > j) {
|
||||
if(h) {
|
||||
f = i;
|
||||
n = k
|
||||
}else {
|
||||
return
|
||||
}
|
||||
}if(f == d.row) {
|
||||
q = true
|
||||
}m = b(f)
|
||||
}
|
||||
}}
|
||||
};
|
||||
this.$backwardLineIterator = function(a) {
|
||||
var b = this.$options.scope == l.SELECTION, c = a.getSelection().getRange(), g = b ? c.end : c.start, d = b ? c.start.row : 0, i = b ? c.start.column : 0, k = b ? c.end.row : a.getLength() - 1, j = this.$options.wrap;
|
||||
return{forEach:function(h) {
|
||||
for(var e = g.row, f = a.getLine(e).substring(0, g.column), m = 0, n = false;!h(f, m, e);) {
|
||||
if(n) {
|
||||
return
|
||||
}e--;
|
||||
m = 0;
|
||||
if(e < d) {
|
||||
if(j) {
|
||||
e = k
|
||||
}else {
|
||||
return
|
||||
}
|
||||
}if(e == g.row) {
|
||||
n = true
|
||||
}f = a.getLine(e);
|
||||
if(b) {
|
||||
if(e == d) {
|
||||
m = i
|
||||
}else {
|
||||
if(e == k) {
|
||||
f = f.substring(0, c.end.column)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
}).call(l.prototype);
|
||||
r.Search = l
|
||||
});
|
||||
|
|
@ -1,261 +0,0 @@
|
|||
define(function(d, g) {
|
||||
var h = d("pilot/oop"), i = d("pilot/lang"), j = d("pilot/event_emitter").EventEmitter, f = d("ace/range").Range;
|
||||
d = function(a) {
|
||||
this.doc = a;
|
||||
this.clearSelection();
|
||||
this.selectionLead = {row:0, column:0}
|
||||
};
|
||||
(function() {
|
||||
h.implement(this, j);
|
||||
this.isEmpty = function() {
|
||||
return!this.selectionAnchor || this.selectionAnchor.row == this.selectionLead.row && this.selectionAnchor.column == this.selectionLead.column
|
||||
};
|
||||
this.isMultiLine = function() {
|
||||
if(this.isEmpty()) {
|
||||
return false
|
||||
}return this.getRange().isMultiLine()
|
||||
};
|
||||
this.getCursor = function() {
|
||||
return this.selectionLead
|
||||
};
|
||||
this.setSelectionAnchor = function(a, b) {
|
||||
a = this.$clipPositionToDocument(a, b);
|
||||
if(this.selectionAnchor) {
|
||||
if(this.selectionAnchor.row !== a.row || this.selectionAnchor.column !== a.column) {
|
||||
this.selectionAnchor = a;
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
}else {
|
||||
this.selectionAnchor = a;
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
};
|
||||
this.getSelectionAnchor = function() {
|
||||
return this.selectionAnchor ? this.$clone(this.selectionAnchor) : this.$clone(this.selectionLead)
|
||||
};
|
||||
this.getSelectionLead = function() {
|
||||
return this.$clone(this.selectionLead)
|
||||
};
|
||||
this.shiftSelection = function(a) {
|
||||
if(this.isEmpty()) {
|
||||
this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + a)
|
||||
}else {
|
||||
var b = this.getSelectionAnchor(), c = this.getSelectionLead(), e = this.isBackwards();
|
||||
if(!e || b.column !== 0) {
|
||||
this.setSelectionAnchor(b.row, b.column + a)
|
||||
}if(e || c.column !== 0) {
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(c.row, c.column + a)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
this.isBackwards = function() {
|
||||
var a = this.selectionAnchor || this.selectionLead, b = this.selectionLead;
|
||||
return a.row > b.row || a.row == b.row && a.column > b.column
|
||||
};
|
||||
this.getRange = function() {
|
||||
var a = this.selectionAnchor || this.selectionLead, b = this.selectionLead;
|
||||
return this.isBackwards() ? f.fromPoints(b, a) : f.fromPoints(a, b)
|
||||
};
|
||||
this.clearSelection = function() {
|
||||
if(this.selectionAnchor) {
|
||||
this.selectionAnchor = null;
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
};
|
||||
this.selectAll = function() {
|
||||
var a = this.doc.getLength() - 1;
|
||||
this.setSelectionAnchor(a, this.doc.getLine(a).length);
|
||||
if(!this.selectionAnchor) {
|
||||
this.selectionAnchor = this.$clone(this.selectionLead)
|
||||
}a = {row:0, column:0};
|
||||
if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) {
|
||||
this.selectionLead = a;
|
||||
this._dispatchEvent("changeSelection", {blockScrolling:true})
|
||||
}
|
||||
};
|
||||
this.setSelectionRange = function(a, b) {
|
||||
if(b) {
|
||||
this.setSelectionAnchor(a.end.row, a.end.column);
|
||||
this.selectTo(a.start.row, a.start.column)
|
||||
}else {
|
||||
this.setSelectionAnchor(a.start.row, a.start.column);
|
||||
this.selectTo(a.end.row, a.end.column)
|
||||
}
|
||||
};
|
||||
this.$moveSelection = function(a) {
|
||||
var b = false;
|
||||
if(!this.selectionAnchor) {
|
||||
b = true;
|
||||
this.selectionAnchor = this.$clone(this.selectionLead)
|
||||
}var c = this.$clone(this.selectionLead);
|
||||
a.call(this);
|
||||
if(c.row !== this.selectionLead.row || c.column !== this.selectionLead.column) {
|
||||
b = true
|
||||
}b && this._dispatchEvent("changeSelection", {})
|
||||
};
|
||||
this.selectTo = function(a, b) {
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(a, b)
|
||||
})
|
||||
};
|
||||
this.selectToPosition = function(a) {
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorToPosition(a)
|
||||
})
|
||||
};
|
||||
this.selectUp = function() {
|
||||
this.$moveSelection(this.moveCursorUp)
|
||||
};
|
||||
this.selectDown = function() {
|
||||
this.$moveSelection(this.moveCursorDown)
|
||||
};
|
||||
this.selectRight = function() {
|
||||
this.$moveSelection(this.moveCursorRight)
|
||||
};
|
||||
this.selectLeft = function() {
|
||||
this.$moveSelection(this.moveCursorLeft)
|
||||
};
|
||||
this.selectLineStart = function() {
|
||||
this.$moveSelection(this.moveCursorLineStart)
|
||||
};
|
||||
this.selectLineEnd = function() {
|
||||
this.$moveSelection(this.moveCursorLineEnd)
|
||||
};
|
||||
this.selectFileEnd = function() {
|
||||
this.$moveSelection(this.moveCursorFileEnd)
|
||||
};
|
||||
this.selectFileStart = function() {
|
||||
this.$moveSelection(this.moveCursorFileStart)
|
||||
};
|
||||
this.selectWordRight = function() {
|
||||
this.$moveSelection(this.moveCursorWordRight)
|
||||
};
|
||||
this.selectWordLeft = function() {
|
||||
this.$moveSelection(this.moveCursorWordLeft)
|
||||
};
|
||||
this.selectWord = function() {
|
||||
var a = this.selectionLead;
|
||||
this.setSelectionRange(this.doc.getWordRange(a.row, a.column))
|
||||
};
|
||||
this.selectLine = function() {
|
||||
this.setSelectionAnchor(this.selectionLead.row, 0);
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(this.selectionLead.row + 1, 0)
|
||||
})
|
||||
};
|
||||
this.moveCursorUp = function() {
|
||||
this.moveCursorBy(-1, 0)
|
||||
};
|
||||
this.moveCursorDown = function() {
|
||||
this.moveCursorBy(1, 0)
|
||||
};
|
||||
this.moveCursorLeft = function() {
|
||||
if(this.selectionLead.column == 0) {
|
||||
this.selectionLead.row > 0 && this.moveCursorTo(this.selectionLead.row - 1, this.doc.getLine(this.selectionLead.row - 1).length)
|
||||
}else {
|
||||
var a = this.doc, b = a.getTabSize(), c = this.selectionLead;
|
||||
a.isTabStop(c) && a.getLine(c.row).slice(c.column - b, c.column).split(" ").length - 1 == b ? this.moveCursorBy(0, -b) : this.moveCursorBy(0, -1)
|
||||
}
|
||||
};
|
||||
this.moveCursorRight = function() {
|
||||
if(this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) {
|
||||
this.selectionLead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.selectionLead.row + 1, 0)
|
||||
}else {
|
||||
var a = this.doc, b = a.getTabSize(), c = this.selectionLead;
|
||||
a.isTabStop(c) && a.getLine(c.row).slice(c.column, c.column + b).split(" ").length - 1 == b ? this.moveCursorBy(0, b) : this.moveCursorBy(0, 1)
|
||||
}
|
||||
};
|
||||
this.moveCursorLineStart = function() {
|
||||
var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a).slice(0, b).match(/^\s*/);
|
||||
if(c[0].length == 0) {
|
||||
this.moveCursorTo(a, this.doc.getLine(a).match(/^\s*/)[0].length)
|
||||
}else {
|
||||
c[0].length >= b ? this.moveCursorTo(a, 0) : this.moveCursorTo(a, c[0].length)
|
||||
}
|
||||
};
|
||||
this.moveCursorLineEnd = function() {
|
||||
this.moveCursorTo(this.selectionLead.row, this.doc.getLine(this.selectionLead.row).length)
|
||||
};
|
||||
this.moveCursorFileEnd = function() {
|
||||
var a = this.doc.getLength() - 1, b = this.doc.getLine(a).length;
|
||||
this.moveCursorTo(a, b)
|
||||
};
|
||||
this.moveCursorFileStart = function() {
|
||||
this.moveCursorTo(0, 0)
|
||||
};
|
||||
this.moveCursorWordRight = function() {
|
||||
var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a), e = c.substring(b);
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
if(b == c.length) {
|
||||
this.moveCursorRight()
|
||||
}else {
|
||||
if(this.doc.nonTokenRe.exec(e)) {
|
||||
b += this.doc.nonTokenRe.lastIndex;
|
||||
this.doc.nonTokenRe.lastIndex = 0
|
||||
}else {
|
||||
if(this.doc.tokenRe.exec(e)) {
|
||||
b += this.doc.tokenRe.lastIndex;
|
||||
this.doc.tokenRe.lastIndex = 0
|
||||
}
|
||||
}this.moveCursorTo(a, b)
|
||||
}
|
||||
};
|
||||
this.moveCursorWordLeft = function() {
|
||||
var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a);
|
||||
c = i.stringReverse(c.substring(0, b));
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
if(b == 0) {
|
||||
this.moveCursorLeft()
|
||||
}else {
|
||||
if(this.doc.nonTokenRe.exec(c)) {
|
||||
b -= this.doc.nonTokenRe.lastIndex;
|
||||
this.doc.nonTokenRe.lastIndex = 0
|
||||
}else {
|
||||
if(this.doc.tokenRe.exec(c)) {
|
||||
b -= this.doc.tokenRe.lastIndex;
|
||||
this.doc.tokenRe.lastIndex = 0
|
||||
}
|
||||
}this.moveCursorTo(a, b)
|
||||
}
|
||||
};
|
||||
this.moveCursorBy = function(a, b) {
|
||||
this.moveCursorTo(this.selectionLead.row + a, this.selectionLead.column + b)
|
||||
};
|
||||
this.moveCursorToPosition = function(a) {
|
||||
this.moveCursorTo(a.row, a.column)
|
||||
};
|
||||
this.moveCursorTo = function(a, b) {
|
||||
a = this.$clipPositionToDocument(a, b);
|
||||
if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) {
|
||||
this.selectionLead = a;
|
||||
this._dispatchEvent("changeCursor", {data:this.getCursor()})
|
||||
}
|
||||
};
|
||||
this.moveCursorUp = function() {
|
||||
this.moveCursorBy(-1, 0)
|
||||
};
|
||||
this.$clipPositionToDocument = function(a, b) {
|
||||
var c = {};
|
||||
if(a >= this.doc.getLength()) {
|
||||
c.row = Math.max(0, this.doc.getLength() - 1);
|
||||
c.column = this.doc.getLine(c.row).length
|
||||
}else {
|
||||
if(a < 0) {
|
||||
c.row = 0;
|
||||
c.column = 0
|
||||
}else {
|
||||
c.row = a;
|
||||
c.column = Math.min(this.doc.getLine(c.row).length, Math.max(0, b))
|
||||
}
|
||||
}return c
|
||||
};
|
||||
this.$clone = function(a) {
|
||||
return{row:a.row, column:a.column}
|
||||
}
|
||||
}).call(d.prototype);
|
||||
g.Selection = d
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
require("../../../support/paths");
|
||||
var async = require("async");
|
||||
async.concat(require("./change_document_test"), require("./document_test"), require("./event_emitter_test"), require("./navigation_test"), require("./range_test"), require("./search_test"), require("./selection_test"), require("./text_edit_test"), require("./mode/css_test"), require("./mode/css_tokenizer_test"), require("./mode/html_test"), require("./mode/html_tokenizer_test"), require("./mode/javascript_test"), require("./mode/javascript_tokenizer_test"), require("./mode/text_test"), require("./mode/xml_test"),
|
||||
require("./mode/xml_tokenizer_test")).exec();
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
define(function(e, f, g) {
|
||||
var a = e("assert");
|
||||
a.position = function(b, c, d) {
|
||||
a.equal(b.row, c);
|
||||
a.equal(b.column, d)
|
||||
};
|
||||
a.range = function(b, c, d, h, i) {
|
||||
a.position(b.start, c, d);
|
||||
a.position(b.end, h, i)
|
||||
};
|
||||
a.notOk = function(b) {
|
||||
a.equal(b, false)
|
||||
};
|
||||
f.jsonEquals = function(b, c) {
|
||||
a.equal(JSON.stringify(b), JSON.stringify(c))
|
||||
};
|
||||
g.exports = a
|
||||
});
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
define(function(c, d, f) {
|
||||
c("./mockdom");
|
||||
var e = c("../document").Document, g = c("../editor").Editor, h = c("../mode/text").Mode, i = c("../mode/javascript").Mode, j = c("./mockrenderer"), a = c("./assertions");
|
||||
d = {setUp:function() {
|
||||
this.doc1 = new e("abc\ndef");
|
||||
this.doc2 = new e("ghi\njkl");
|
||||
this.editor = new g(new j)
|
||||
}, "test: change document":function() {
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.equal(this.editor.getDocument(), this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.equal(this.editor.getDocument(), this.doc2)
|
||||
}, "test: only changes to the new document should have effect":function() {
|
||||
var b = false;
|
||||
this.editor.onDocumentChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
this.doc1.duplicateLines(0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.duplicateLines(0, 0);
|
||||
a.notOk(b)
|
||||
}, "test: should use cursor of new document":function() {
|
||||
this.doc1.getSelection().moveCursorTo(0, 1);
|
||||
this.doc2.getSelection().moveCursorTo(1, 0);
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.position(this.editor.getCursorPosition(), 0, 1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getCursorPosition(), 1, 0)
|
||||
}, "test: only changing the cursor of the new doc should not have an effect":function() {
|
||||
this.editor.onCursorChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getCursorPosition(), 0, 0);
|
||||
var b = false;
|
||||
this.doc1.getSelection().moveCursorTo(0, 1);
|
||||
a.position(this.editor.getCursorPosition(), 0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.getSelection().moveCursorTo(1, 1);
|
||||
a.position(this.editor.getCursorPosition(), 1, 1);
|
||||
a.ok(b)
|
||||
}, "test: should use selection of new document":function() {
|
||||
this.doc1.getSelection().selectTo(0, 1);
|
||||
this.doc2.getSelection().selectTo(1, 0);
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 1, 0)
|
||||
}, "test: only changing the selection of the new doc should not have an effect":function() {
|
||||
this.editor.onSelectionChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 0);
|
||||
var b = false;
|
||||
this.doc1.getSelection().selectTo(0, 1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.getSelection().selectTo(1, 1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 1, 1);
|
||||
a.ok(b)
|
||||
}, "test: should use mode of new document":function() {
|
||||
this.editor.onDocumentModeChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
var b = false;
|
||||
this.doc1.setMode(new h);
|
||||
a.notOk(b);
|
||||
this.doc2.setMode(new i);
|
||||
a.ok(b)
|
||||
}};
|
||||
f.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
define(function(e, g, i) {
|
||||
var c = e("../document").Document, h = e("../undomanager").UndoManager;
|
||||
e("./mockrenderer");
|
||||
var f = e("../range").Range, b = e("./assertions");
|
||||
e("async");
|
||||
g = {"test: find matching opening bracket":function() {
|
||||
var a = new c(["(()(", "())))"]);
|
||||
b.position(a.findMatchingBracket({row:0, column:3}), 0, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:2}), 1, 0);
|
||||
b.position(a.findMatchingBracket({row:1, column:3}), 0, 3);
|
||||
b.position(a.findMatchingBracket({row:1, column:4}), 0, 0);
|
||||
b.equal(a.findMatchingBracket({row:1, column:5}), null)
|
||||
}, "test: find matching closing bracket":function() {
|
||||
var a = new c(["(()(", "())))"]);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:0, column:4}), 1, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:2}), 0, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:1}), 1, 3);
|
||||
b.equal(a.findMatchingBracket({row:0, column:0}), null)
|
||||
}, "test: match different bracket types":function() {
|
||||
var a = new c(["({[", ")]}"]);
|
||||
b.position(a.findMatchingBracket({row:0, column:1}), 1, 0);
|
||||
b.position(a.findMatchingBracket({row:0, column:2}), 1, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:3}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 0, 0);
|
||||
b.position(a.findMatchingBracket({row:1, column:2}), 0, 2);
|
||||
b.position(a.findMatchingBracket({row:1, column:3}), 0, 1)
|
||||
}, "test: move lines down":function() {
|
||||
var a = new c(["a1", "a2", "a3", "a4"]);
|
||||
a.moveLinesDown(0, 1);
|
||||
b.equal(a.toString(), "a3\na1\na2\na4");
|
||||
a.moveLinesDown(1, 2);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesDown(2, 3);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesDown(2, 2);
|
||||
b.equal(a.toString(), "a3\na4\na2\na1")
|
||||
}, "test: move lines up":function() {
|
||||
var a = new c(["a1", "a2", "a3", "a4"]);
|
||||
a.moveLinesUp(2, 3);
|
||||
b.equal(a.toString(), "a1\na3\na4\na2");
|
||||
a.moveLinesUp(1, 2);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesUp(0, 1);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesUp(2, 2);
|
||||
b.equal(a.toString(), "a3\na1\na4\na2")
|
||||
}, "test: duplicate lines":function() {
|
||||
var a = new c(["1", "2", "3", "4"]);
|
||||
a.duplicateLines(1, 2);
|
||||
b.equal(a.toString(), "1\n2\n3\n2\n3\n4")
|
||||
}, "test: duplicate last line":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
a.duplicateLines(2, 2);
|
||||
b.equal(a.toString(), "1\n2\n3\n3")
|
||||
}, "test: duplicate first line":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
a.duplicateLines(0, 0);
|
||||
b.equal(a.toString(), "1\n1\n2\n3")
|
||||
}, "test: should handle unix style new lines":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: should handle windows style new lines":function() {
|
||||
var a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'windows' should use '\r\n' as new lines":function() {
|
||||
var a = new c("1\n2\n3");
|
||||
a.setNewLineMode("windows");
|
||||
b.equal(a.toString(), "1\r\n2\r\n3")
|
||||
}, "test: set new line mode to 'unix' should use '\n' as new lines":function() {
|
||||
var a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'auto' should detect the incoming nl type":function() {
|
||||
var a = new c("1\n2\n3");
|
||||
a.setNewLineMode("auto");
|
||||
b.equal(a.toString(), "1\n2\n3");
|
||||
a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("auto");
|
||||
b.equal(a.toString(), "1\r\n2\r\n3");
|
||||
a.replace(new f(0, 0, 2, 1), "4\n5\n6");
|
||||
b.equal("4\n5\n6", a.toString())
|
||||
}, "test: convert document to screen coordinates":function() {
|
||||
var a = new c("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
b.equal(a.documentToScreenColumn(0, 6), 9);
|
||||
b.equal(a.documentToScreenColumn(0, 12), 15);
|
||||
b.equal(a.documentToScreenColumn(0, 13), 19);
|
||||
a.setTabSize(2);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
b.equal(a.documentToScreenColumn(0, 6), 7);
|
||||
b.equal(a.documentToScreenColumn(0, 12), 13);
|
||||
b.equal(a.documentToScreenColumn(0, 13), 15)
|
||||
}, "test: convert document to scrren coordinates with leading tabs":function() {
|
||||
var a = new c("\t\t123");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 1), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 2), 8);
|
||||
b.equal(a.documentToScreenColumn(0, 3), 9)
|
||||
}, "test: convert screen to document coordinates":function() {
|
||||
var a = new c("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.screenToDocumentColumn(0, 0), 0);
|
||||
b.equal(a.screenToDocumentColumn(0, 4), 4);
|
||||
b.equal(a.screenToDocumentColumn(0, 5), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 6), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 7), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 8), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 9), 6);
|
||||
b.equal(a.screenToDocumentColumn(0, 15), 12);
|
||||
b.equal(a.screenToDocumentColumn(0, 19), 13)
|
||||
}, "test: insert text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "juhu 1");
|
||||
b.equal(d.rows, 0);
|
||||
b.equal(d.columns, 6);
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd")
|
||||
}, "test: undo insert text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = new h;
|
||||
a.setUndoManager(d);
|
||||
a.multiRowInsert([0, 1, 2], 2, "juhu 1");
|
||||
a.$informUndoManager.call();
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd");
|
||||
d.undo();
|
||||
b.equal(a.toString(), "12\n\nabcd");
|
||||
d.redo();
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd")
|
||||
}, "test: insert new line in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "\n");
|
||||
b.equal(d.rows, 1);
|
||||
b.equal(a.toString(), "12\n\n \n\nab\ncd")
|
||||
}, "test: insert multi line text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "juhu\n12");
|
||||
b.equal(d.rows, 1);
|
||||
b.equal(a.toString(), "12juhu\n12\n juhu\n12\nabjuhu\n12cd")
|
||||
}, "test: remove right in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]);
|
||||
a.multiRowRemove([0, 1, 2], new f(0, 2, 0, 3));
|
||||
b.equal(a.toString(), "12\n\nabd")
|
||||
}, "test: undo remove right in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = new h;
|
||||
a.setUndoManager(d);
|
||||
a.multiRowRemove([0, 1, 2], new f(0, 1, 0, 3));
|
||||
a.$informUndoManager.call();
|
||||
b.equal(a.toString(), "1\n\nad");
|
||||
d.undo();
|
||||
b.equal(a.toString(), "12\n\nabcd");
|
||||
d.redo();
|
||||
b.equal(a.toString(), "1\n\nad")
|
||||
}};
|
||||
i.exports = e("async/test").testcase(g)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
require("../../../support/paths");
|
||||
var oop = require("pilot/oop");
|
||||
EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
assert = require("./assertions");
|
||||
var Emitter = function() {
|
||||
};
|
||||
oop.implement(Emitter.prototype, EventEmitter);
|
||||
var Test = {"test: dispatch event with no data":function() {
|
||||
var a = new Emitter, b = false;
|
||||
a.addEventListener("juhu", function(c) {
|
||||
b = true;
|
||||
assert.equal(c.type, "juhu")
|
||||
});
|
||||
a._dispatchEvent("juhu");
|
||||
assert.ok(b)
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
var dom = require("jsdom/level2/html").dom.level2.html, browser = require("jsdom/browser/index").windowAugmentation(dom);
|
||||
global.document = browser.document;
|
||||
global.window = browser.window;
|
||||
global.self = browser.self;
|
||||
global.navigator = browser.navigator;
|
||||
global.location = browser.location;
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
define(function() {
|
||||
MockRenderer = function(a) {
|
||||
this.container = document.createElement("div");
|
||||
this.cursor = {row:0, column:0};
|
||||
this.visibleRowCount = a || 20;
|
||||
this.layerConfig = {firstVisibleRow:0, lastVisibleRow:this.visibleRowCount}
|
||||
};
|
||||
MockRenderer.prototype.getFirstVisibleRow = function() {
|
||||
return this.layerConfig.firstVisibleRow
|
||||
};
|
||||
MockRenderer.prototype.getLastVisibleRow = function() {
|
||||
return this.layerConfig.lastVisibleRow
|
||||
};
|
||||
MockRenderer.prototype.getContainerElement = function() {
|
||||
return this.container
|
||||
};
|
||||
MockRenderer.prototype.getMouseEventTarget = function() {
|
||||
return this.container
|
||||
};
|
||||
MockRenderer.prototype.setDocument = function(a) {
|
||||
this.lines = a.lines
|
||||
};
|
||||
MockRenderer.prototype.setTokenizer = function() {
|
||||
};
|
||||
MockRenderer.prototype.updateCursor = function(a) {
|
||||
this.cursor.row = a.row;
|
||||
this.cursor.column = a.column
|
||||
};
|
||||
MockRenderer.prototype.scrollCursorIntoView = function() {
|
||||
if(this.cursor.row < this.layerConfig.firstVisibleRow) {
|
||||
this.scrollToRow(this.cursor.row)
|
||||
}else {
|
||||
this.cursor.row > this.layerConfig.lastVisibleRow && this.scrollToRow(this.cursor.row)
|
||||
}
|
||||
};
|
||||
MockRenderer.prototype.scrollToRow = function(a) {
|
||||
a = Math.min(this.lines.length - this.visibleRowCount, Math.max(0, a));
|
||||
this.layerConfig.firstVisibleRow = a;
|
||||
this.layerConfig.lastVisibleRow = a + this.visibleRowCount
|
||||
};
|
||||
MockRenderer.prototype.getScrollTopRow = function() {
|
||||
return this.layerConfig.firstVisibleRow
|
||||
};
|
||||
MockRenderer.prototype.draw = function() {
|
||||
};
|
||||
MockRenderer.prototype.updateLines = function() {
|
||||
};
|
||||
MockRenderer.prototype.addMarker = function() {
|
||||
};
|
||||
MockRenderer.prototype.setBreakpoints = function() {
|
||||
};
|
||||
MockRenderer.prototype.updateFull = function() {
|
||||
};
|
||||
MockRenderer.prototype.updateText = function() {
|
||||
};
|
||||
MockRenderer.prototype.showCursor = function() {
|
||||
};
|
||||
MockRenderer.prototype.visualizeFocus = function() {
|
||||
};
|
||||
return MockRenderer
|
||||
});
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
define(function(b, c, e) {
|
||||
var f = b("ace/document").Document, g = b("ace/mode/css").Mode, a = b("../assertions");
|
||||
c = {setUp:function() {
|
||||
this.mode = new g
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var d = new f(" abc\ncde\nfg");
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
a.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "test: lines should keep indentation":function() {
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " abc", " "));
|
||||
a.equal("\t", this.mode.getNextLineIndent("start", "\tabc", " "))
|
||||
}, "test: new line after { should increase indent":function() {
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " abc{", " "));
|
||||
a.equal("\t ", this.mode.getNextLineIndent("start", "\tabc { ", " "))
|
||||
}, "test: no indent increase after { in a comment":function() {
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " /*{", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " /*{ ", " "))
|
||||
}};
|
||||
e.exports = b("async/test").testcase(c)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/css").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize pixel number":function() {
|
||||
var a = this.tokenizer.getLineTokens("-12px", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize hex3 color":function() {
|
||||
var a = this.tokenizer.getLineTokens("#abc", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize hex6 color":function() {
|
||||
var a = this.tokenizer.getLineTokens("#abc012", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize parens":function() {
|
||||
var a = this.tokenizer.getLineTokens("{()}", "start").tokens;
|
||||
b.equal(3, a.length);
|
||||
b.equal("lparen", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("rparen", a[2].type)
|
||||
}, "test for last rule in ruleset to catch capturing group bugs":function() {
|
||||
var a = this.tokenizer.getLineTokens("top", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("support.type", a[0].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d, "css tokenizer")
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
define(function(a, c, e) {
|
||||
var f = a("ace/document").Document, g = a("ace/range").Range, h = a("ace/mode/html").Mode, b = a("../assertions");
|
||||
c = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var d = new f([" abc", "cde", "fg"]);
|
||||
new g(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
b.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "test: next line indent should be the same as the current line indent":function() {
|
||||
b.equal(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
b.equal("", this.mode.getNextLineIndent("start", "abc"));
|
||||
b.equal("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}};
|
||||
e.exports = a("async/test").testcase(c)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/html").Mode, a = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize embedded script":function() {
|
||||
var b = this.tokenizer.getLineTokens("<script a='a'>var<\/script>'123'", "start").tokens;
|
||||
a.equal("text", b[0].type);
|
||||
a.equal("keyword", b[1].type);
|
||||
a.equal("text", b[2].type);
|
||||
a.equal("keyword", b[3].type);
|
||||
a.equal("text", b[4].type);
|
||||
a.equal("string", b[5].type);
|
||||
a.equal("text", b[6].type);
|
||||
a.equal("keyword", b[7].type);
|
||||
a.equal("text", b[8].type);
|
||||
a.equal("keyword", b[9].type);
|
||||
a.equal("text", b[10].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
define(function(d, e, f) {
|
||||
var c = d("ace/document").Document, g = d("ace/tokenizer").Tokenizer, h = d("ace/mode/javascript").Mode, a = d("../assertions");
|
||||
e = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: getTokenizer() (smoke test)":function() {
|
||||
var b = this.mode.getTokenizer();
|
||||
a.ok(b instanceof g);
|
||||
b = b.getLineTokens("'juhu'", "start").tokens;
|
||||
a.equal("string", b[0].type)
|
||||
}, "test: toggle comment lines should prepend '//' to each line":function() {
|
||||
var b = new c([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal("// abc\n//cde\nfg", b.toString())
|
||||
}, "test: toggle comment on commented lines should remove leading '//' chars":function() {
|
||||
var b = new c(["// abc", "//cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: toggle comment lines twice should return the original text":function() {
|
||||
var b = new c([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
a.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: toggle comment on multiple lines with one commented line prepend '//' to each line":function() {
|
||||
var b = new c(["// abc", "//cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
a.equal("//// abc\n////cde\n//fg", b.toString())
|
||||
}, "test: toggle comment on a comment line with leading white space":function() {
|
||||
var b = new c(["//cde", " //fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal("cde\n fg", b.toString())
|
||||
}, "test: auto indent after opening brace":function() {
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", "if () {", " "))
|
||||
}, "test: no auto indent after opening brace in multi line comment":function() {
|
||||
a.equal("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("comment", " abcd", " "))
|
||||
}, "test: no auto indent after opening brace in single line comment":function() {
|
||||
a.equal("", this.mode.getNextLineIndent("start", "//if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " //if () {", " "))
|
||||
}, "test: no auto indent should add to existing indent":function() {
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " cde", " "))
|
||||
}, "test: special indent in doc comments":function() {
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", "/**", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " /**", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("doc-start", " abc", " "))
|
||||
}, "test: no indent after doc comments":function() {
|
||||
a.equal("", this.mode.getNextLineIndent("doc-start", " */", " "))
|
||||
}, "test: trigger outdent if line is space and new text starts with closing brace":function() {
|
||||
a.ok(this.mode.checkOutdent("start", " ", " }"));
|
||||
a.ok(!this.mode.checkOutdent("start", " a ", " }"));
|
||||
a.ok(!this.mode.checkOutdent("start", "", "}"));
|
||||
a.ok(!this.mode.checkOutdent("start", " ", "a }"));
|
||||
a.ok(!this.mode.checkOutdent("start", " }", "}"))
|
||||
}, "test: auto outdent should indent the line with the same indent as the line with the matching opening brace":function() {
|
||||
var b = new c([" function foo() {", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", b, 2);
|
||||
a.equal(" }", b.getLine(2))
|
||||
}, "test: no auto outdent if no matching brace is found":function() {
|
||||
var b = new c([" function foo()", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", b, 2);
|
||||
a.equal(" }", b.getLine(2))
|
||||
}};
|
||||
f.exports = d("async/test").testcase(e)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/javascript").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize1":function() {
|
||||
var a = this.tokenizer.getLineTokens("foo = function", "start").tokens;
|
||||
b.equal(5, a.length);
|
||||
b.equal("identifier", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("keyword.operator", a[2].type);
|
||||
b.equal("text", a[3].type);
|
||||
b.equal("keyword", a[4].type)
|
||||
}, "test: tokenize doc comment":function() {
|
||||
var a = this.tokenizer.getLineTokens("abc /** de */ fg", "start").tokens;
|
||||
b.equal(5, a.length);
|
||||
b.equal("identifier", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("comment.doc", a[2].type);
|
||||
b.equal("text", a[3].type);
|
||||
b.equal("identifier", a[4].type)
|
||||
}, "test: tokenize doc comment with tag":function() {
|
||||
var a = this.tokenizer.getLineTokens("/** @param {} */", "start").tokens;
|
||||
b.equal(3, a.length);
|
||||
b.equal("comment.doc", a[0].type);
|
||||
b.equal("comment.doc.tag", a[1].type);
|
||||
b.equal("comment.doc", a[2].type)
|
||||
}, "test: tokenize parens":function() {
|
||||
var a = this.tokenizer.getLineTokens("[{( )}]", "start").tokens;
|
||||
b.equal(3, a.length);
|
||||
b.equal("lparen", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("rparen", a[2].type)
|
||||
}, "test for last rule in ruleset to catch capturing group bugs":function() {
|
||||
var a = this.tokenizer.getLineTokens("}", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("rparen", a[0].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
define(function(a, b, e) {
|
||||
var f = a("ace/document").Document, g = a("ace/mode/text").Mode, c = a("../assertions");
|
||||
b = {setUp:function() {
|
||||
this.mode = new g
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var d = new f([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
c.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "text: lines should not be indented":function() {
|
||||
c.equal("", this.mode.getNextLineIndent("start", " abc", " "))
|
||||
}};
|
||||
e.exports = a("async/test").testcase(b)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
define(function(c, d, e) {
|
||||
var f = c("ace/document").Document, g = c("ace/tokenizer").Tokenizer, h = c("ace/mode/xml").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: getTokenizer() (smoke test)":function() {
|
||||
var a = this.mode.getTokenizer();
|
||||
b.ok(a instanceof g);
|
||||
a = a.getLineTokens("<juhu>", "start").tokens;
|
||||
b.equal("keyword", a[1].type)
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var a = new f([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", a, 0, 1);
|
||||
b.equal(" abc\ncde\nfg", a.toString())
|
||||
}, "test: next line indent should be the same as the current line indent":function() {
|
||||
b.equal(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
b.equal("", this.mode.getNextLineIndent("start", "abc"));
|
||||
b.equal("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/xml").Mode, a = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize1":function() {
|
||||
var b = this.tokenizer.getLineTokens("<Juhu>//Juhu Kinners</Kinners>", "start").tokens;
|
||||
a.equal(5, b.length);
|
||||
a.equal("text", b[0].type);
|
||||
a.equal("keyword", b[1].type);
|
||||
a.equal("text", b[2].type);
|
||||
a.equal("keyword", b[3].type);
|
||||
a.equal("text", b[4].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
define(function(d, h, i) {
|
||||
d("./mockdom");
|
||||
var g = d("../Document").Document, e = d("../Editor").Editor, f = d("./mockrenderer"), b = d("./assertions");
|
||||
h = {createTextDocument:function(a, c) {
|
||||
c = (new Array(c + 1)).join("a");
|
||||
a = (new Array(a)).join(c + "\n") + c;
|
||||
return new g(a)
|
||||
}, "test: navigate to end of file should scroll the last line into view":function() {
|
||||
var a = this.createTextDocument(200, 10);
|
||||
a = new e(new f, a);
|
||||
a.navigateFileEnd();
|
||||
var c = a.getCursorPosition();
|
||||
b.ok(a.getFirstVisibleRow() <= c.row);
|
||||
b.ok(a.getLastVisibleRow() >= c.row)
|
||||
}, "test: navigate to start of file should scroll the first row into view":function() {
|
||||
var a = this.createTextDocument(200, 10);
|
||||
a = new e(new f, a);
|
||||
a.moveCursorTo(a.getLastVisibleRow() + 20);
|
||||
a.navigateFileStart();
|
||||
b.equal(a.getFirstVisibleRow(), 0)
|
||||
}, "test: goto hidden line should scroll the line into the middle of the viewport":function() {
|
||||
var a = new e(new f, this.createTextDocument(200, 5));
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(101);
|
||||
b.position(a.getCursorPosition(), 100, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 90);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(11);
|
||||
b.position(a.getCursorPosition(), 10, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(6);
|
||||
b.position(a.getCursorPosition(), 5, 0);
|
||||
b.equal(0, a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(1);
|
||||
b.position(a.getCursorPosition(), 0, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(191);
|
||||
b.position(a.getCursorPosition(), 190, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 180);
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(196);
|
||||
b.position(a.getCursorPosition(), 195, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 180)
|
||||
}, "test: goto visible line should only move the cursor and not scroll":function() {
|
||||
var a = new e(new f, this.createTextDocument(200, 5));
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(12);
|
||||
b.position(a.getCursorPosition(), 11, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(30, 0);
|
||||
a.gotoLine(33);
|
||||
b.position(a.getCursorPosition(), 32, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 30)
|
||||
}, "test: navigate from the end of a long line down to a short line and back should maintain the curser column":function() {
|
||||
var a = new e(new f, new g(["123456", "1"]));
|
||||
a.navigateTo(0, 6);
|
||||
b.position(a.getCursorPosition(), 0, 6);
|
||||
a.navigateDown();
|
||||
b.position(a.getCursorPosition(), 1, 1);
|
||||
a.navigateUp();
|
||||
b.position(a.getCursorPosition(), 0, 6)
|
||||
}, "test: reset desired column on navigate left or right":function() {
|
||||
var a = new e(new f, new g(["123456", "12"]));
|
||||
a.navigateTo(0, 6);
|
||||
b.position(a.getCursorPosition(), 0, 6);
|
||||
a.navigateDown();
|
||||
b.position(a.getCursorPosition(), 1, 2);
|
||||
a.navigateLeft();
|
||||
b.position(a.getCursorPosition(), 1, 1);
|
||||
a.navigateUp();
|
||||
b.position(a.getCursorPosition(), 0, 1)
|
||||
}};
|
||||
i.exports = d("async/test").testcase(h)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
define(function(e, f, g) {
|
||||
var c = e("../range").Range, b = e("./assertions");
|
||||
f = {"test: create range":function() {
|
||||
var a = new c(1, 2, 3, 4);
|
||||
b.equal(a.start.row, 1);
|
||||
b.equal(a.start.column, 2);
|
||||
b.equal(a.end.row, 3);
|
||||
b.equal(a.end.column, 4)
|
||||
}, "test: create from points":function() {
|
||||
var a = c.fromPoints({row:1, column:2}, {row:3, column:4});
|
||||
b.equal(a.start.row, 1);
|
||||
b.equal(a.start.column, 2);
|
||||
b.equal(a.end.row, 3);
|
||||
b.equal(a.end.column, 4)
|
||||
}, "test: clip to rows":function() {
|
||||
b.range((new c(0, 20, 100, 30)).clipRows(10, 30), 10, 0, 31, 0);
|
||||
b.range((new c(0, 20, 30, 10)).clipRows(10, 30), 10, 0, 30, 10);
|
||||
var a = new c(0, 20, 3, 10);
|
||||
a = a.clipRows(10, 30);
|
||||
b.ok(a.isEmpty());
|
||||
b.range(a, 10, 0, 10, 0)
|
||||
}, "test: isEmpty":function() {
|
||||
var a = new c(1, 2, 1, 2);
|
||||
b.ok(a.isEmpty());
|
||||
a = new c(1, 2, 1, 6);
|
||||
b.notOk(a.isEmpty())
|
||||
}, "test: is multi line":function() {
|
||||
var a = new c(1, 2, 1, 6);
|
||||
b.notOk(a.isMultiLine());
|
||||
a = new c(1, 2, 2, 6);
|
||||
b.ok(a.isMultiLine())
|
||||
}, "test: clone":function() {
|
||||
var a = new c(1, 2, 3, 4), d = a.clone();
|
||||
b.position(d.start, 1, 2);
|
||||
b.position(d.end, 3, 4);
|
||||
d.start.column = 20;
|
||||
b.position(a.start, 1, 2);
|
||||
d.end.column = 20;
|
||||
b.position(a.end, 3, 4)
|
||||
}, "test: contains for multi line ranges":function() {
|
||||
var a = new c(1, 10, 5, 20);
|
||||
b.ok(a.contains(1, 10));
|
||||
b.ok(a.contains(2, 0));
|
||||
b.ok(a.contains(3, 100));
|
||||
b.ok(a.contains(5, 19));
|
||||
b.ok(a.contains(5, 20));
|
||||
b.notOk(a.contains(1, 9));
|
||||
b.notOk(a.contains(0, 0));
|
||||
b.notOk(a.contains(5, 21))
|
||||
}, "test: contains for single line ranges":function() {
|
||||
var a = new c(1, 10, 1, 20);
|
||||
b.ok(a.contains(1, 10));
|
||||
b.ok(a.contains(1, 15));
|
||||
b.ok(a.contains(1, 20));
|
||||
b.notOk(a.contains(0, 9));
|
||||
b.notOk(a.contains(2, 9));
|
||||
b.notOk(a.contains(1, 9));
|
||||
b.notOk(a.contains(1, 21))
|
||||
}, "test: extend range":function() {
|
||||
var a = new c(2, 10, 2, 30);
|
||||
a = a.extend(2, 5);
|
||||
b.range(a, 2, 5, 2, 30);
|
||||
a = a.extend(2, 35);
|
||||
b.range(a, 2, 5, 2, 35);
|
||||
a = a.extend(2, 15);
|
||||
b.range(a, 2, 5, 2, 35);
|
||||
a = a.extend(1, 4);
|
||||
b.range(a, 1, 4, 2, 35);
|
||||
a = a.extend(6, 10);
|
||||
b.range(a, 1, 4, 6, 10)
|
||||
}, "test: collapse rows":function() {
|
||||
var a = new c(0, 2, 1, 2);
|
||||
b.range(a.collapseRows(), 0, 0, 1, 0);
|
||||
a = new c(2, 2, 3, 1);
|
||||
b.range(a.collapseRows(), 2, 0, 3, 0);
|
||||
a = new c(2, 2, 3, 0);
|
||||
b.range(a.collapseRows(), 2, 0, 2, 0);
|
||||
a = new c(2, 0, 2, 0);
|
||||
b.range(a.collapseRows(), 2, 0, 2, 0)
|
||||
}};
|
||||
g.exports = e("async/test").testcase(f)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
define(function(g, h, i) {
|
||||
var d = g("../document").Document, c = g("../search").Search, b = g("./assertions");
|
||||
h = {"test: configure the search object":function() {
|
||||
(new c).set({needle:"juhu", scope:c.ALL})
|
||||
}, "test: find simple text in document":function() {
|
||||
var a = new d(["juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 12)
|
||||
}, "test: find simple text in next line":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: find text starting at cursor position":function() {
|
||||
var a = new d(["juhu kinners", "juhu kinners 123"]);
|
||||
a.getSelection().moveCursorTo(0, 6);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: wrap search is off by default":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var e = (new c).set({needle:"kinners"});
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: wrap search should wrap at file end":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
a = (new c).set({needle:"kinners", wrap:true}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: wrap search with no match should return 'null'":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var e = (new c).set({needle:"xyz", wrap:true});
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: case sensitive is by default off":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]), e = (new c).set({needle:"JUHU"});
|
||||
b.range(e.find(a), 1, 0, 1, 4)
|
||||
}, "test: case sensitive search":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"KINNERS", caseSensitive:true}).find(a);
|
||||
b.equal(a, null)
|
||||
}, "test: whole word search should not match inside of words":function() {
|
||||
var a = new d(["juhukinners", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners", wholeWord:true}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: find backwards":function() {
|
||||
var a = new d(["juhu juhu juhu juhu"]);
|
||||
a.getSelection().moveCursorTo(0, 10);
|
||||
a = (new c).set({needle:"juhu", backwards:true}).find(a);
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 9)
|
||||
}, "test: find in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]);
|
||||
a.getSelection().setSelectionAnchor(1, 0);
|
||||
a.getSelection().selectTo(3, 5);
|
||||
var e = (new c).set({needle:"juhu", wrap:true, scope:c.SELECTION}), f = e.find(a);
|
||||
b.position(f.start, 1, 0);
|
||||
b.position(f.end, 1, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
f = e.find(a);
|
||||
b.position(f.start, 1, 0);
|
||||
b.position(f.end, 1, 4)
|
||||
}, "test: find backwards in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]), e = (new c).set({needle:"juhu", wrap:true, backwards:true, scope:c.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
var f = e.find(a);
|
||||
b.position(f.start, 2, 0);
|
||||
b.position(f.end, 2, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(1, 2);
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: edge case - match directly before the cursor":function() {
|
||||
var a = new d(["123", "123", "juhu"]), e = (new c).set({needle:"juhu", wrap:true});
|
||||
a.getSelection().moveCursorTo(2, 5);
|
||||
a = e.find(a);
|
||||
b.position(a.start, 2, 0);
|
||||
b.position(a.end, 2, 4)
|
||||
}, "test: edge case - match backwards directly after the cursor":function() {
|
||||
var a = new d(["123", "123", "juhu"]), e = (new c).set({needle:"juhu", wrap:true, backwards:true});
|
||||
a.getSelection().moveCursorTo(2, 0);
|
||||
a = e.find(a);
|
||||
b.position(a.start, 2, 0);
|
||||
b.position(a.end, 2, 4)
|
||||
}, "test: find using a regular expression":function() {
|
||||
var a = new d(["abc123 123 cd", "abc"]);
|
||||
a = (new c).set({needle:"\\d+", regExp:true}).find(a);
|
||||
b.position(a.start, 0, 3);
|
||||
b.position(a.end, 0, 6)
|
||||
}, "test: find using a regular expression and whole word":function() {
|
||||
var a = new d(["abc123 123 cd", "abc"]);
|
||||
a = (new c).set({needle:"\\d+\\b", regExp:true, wholeWord:true}).find(a);
|
||||
b.position(a.start, 0, 7);
|
||||
b.position(a.end, 0, 10)
|
||||
}, "test: use regular expressions with capture groups":function() {
|
||||
var a = new d([" ab: 12px", " <h1 abc"]);
|
||||
a = (new c).set({needle:"(\\d+)", regExp:true}).find(a);
|
||||
b.position(a.start, 0, 6);
|
||||
b.position(a.end, 0, 8)
|
||||
}, "test: find all matches in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]), e = (new c).set({needle:"uh", wrap:true, scope:c.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
a = e.findAll(a);
|
||||
b.equal(a.length, 2);
|
||||
b.position(a[0].start, 1, 1);
|
||||
b.position(a[0].end, 1, 3);
|
||||
b.position(a[1].start, 2, 1);
|
||||
b.position(a[1].end, 2, 3)
|
||||
}, "test: replace() should return the replacement if the input matches the needle":function() {
|
||||
var a = (new c).set({needle:"juhu"});
|
||||
b.equal(a.replace("juhu", "kinners"), "kinners");
|
||||
b.equal(a.replace("", "kinners"), null);
|
||||
b.equal(a.replace(" juhu", "kinners"), null)
|
||||
}, "test: replace with a RegExp search":function() {
|
||||
var a = (new c).set({needle:"\\d+", regExp:true});
|
||||
b.equal(a.replace("123", "kinners"), "kinners");
|
||||
b.equal(a.replace("01234", "kinners"), "kinners");
|
||||
b.equal(a.replace("", "kinners"), null);
|
||||
b.equal(a.replace("a12", "kinners"), null);
|
||||
b.equal(a.replace("12a", "kinners"), null)
|
||||
}, "test: replace with RegExp match and capture groups":function() {
|
||||
var a = (new c).set({needle:"ab(\\d\\d)", regExp:true});
|
||||
b.equal(a.replace("ab12", "cd$1"), "cd12");
|
||||
b.equal(a.replace("ab12", "-$&-"), "-ab12-");
|
||||
b.equal(a.replace("ab12", "$$"), "$")
|
||||
}};
|
||||
i.exports = g("async/test").testcase(h)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
define(function(e, f, g) {
|
||||
var d = e("../document").Document, b = e("./assertions");
|
||||
f = {createTextDocument:function(a, c) {
|
||||
c = (new Array(c + 1)).join("a");
|
||||
a = (new Array(a)).join(c + "\n") + c;
|
||||
return new d(a)
|
||||
}, "test: move cursor to end of file should place the cursor on last row and column":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorFileEnd();
|
||||
b.position(a.getCursor(), 199, 10)
|
||||
}, "test: moveCursor to start of file should place the cursor on the first row and column":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorFileStart();
|
||||
b.position(a.getCursor(), 0, 0)
|
||||
}, "test: move selection lead to end of file":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorTo(100, 5);
|
||||
a.selectFileEnd();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 100, 5);
|
||||
b.position(a.end, 199, 10)
|
||||
}, "test: move selection lead to start of file":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorTo(100, 5);
|
||||
a.selectFileStart();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 100, 5)
|
||||
}, "test: move cursor word right":function() {
|
||||
var a = (new d("ab\n Juhu Kinners (abc, 12)\n cde")).getSelection();
|
||||
a.moveCursorDown();
|
||||
b.position(a.getCursor(), 1, 0);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 1);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 5);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 6);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 13);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 15);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 18);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 20);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 22);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 23);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 2, 0)
|
||||
}, "test: select word right if cursor in word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 2);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 0, 4)
|
||||
}, "test: moveCursor word left":function() {
|
||||
var a = (new d("ab\n Juhu Kinners (abc, 12)\n cde")).getSelection();
|
||||
a.moveCursorDown();
|
||||
a.moveCursorLineEnd();
|
||||
b.position(a.getCursor(), 1, 23);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 22);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 20);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 18);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 15);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 13);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 6);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 5);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 1);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 0);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 0, 2)
|
||||
}, "test: select word left if cursor in word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 8);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 0, 5)
|
||||
}, "test: select word right and select":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 0);
|
||||
a.selectWordRight();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 0, 4)
|
||||
}, "test: select word left and select":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 3);
|
||||
a.selectWordLeft();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 0, 3)
|
||||
}, "test: select word with cursor in word should select the word":function() {
|
||||
var a = (new d("Juhu Kinners 123")).getSelection();
|
||||
a.moveCursorTo(0, 8);
|
||||
a.selectWord();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 12)
|
||||
}, "test: select word with cursor betwen white space and word should select the word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 4);
|
||||
a.selectWord();
|
||||
var c = a.getRange();
|
||||
b.position(c.start, 0, 0);
|
||||
b.position(c.end, 0, 4);
|
||||
a.moveCursorTo(0, 5);
|
||||
a.selectWord();
|
||||
c = a.getRange();
|
||||
b.position(c.start, 0, 5);
|
||||
b.position(c.end, 0, 12)
|
||||
}, "test: select word with cursor in white space should select white space":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
a.selectWord();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 4);
|
||||
b.position(a.end, 0, 6)
|
||||
}, "test: moving cursor should fire a 'changeCursor' event":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
var c = false;
|
||||
a.addEventListener("changeCursor", function() {
|
||||
c = true
|
||||
});
|
||||
a.moveCursorTo(0, 6);
|
||||
b.ok(c)
|
||||
}, "test: calling setCursor with the same position should not fire an event":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
var c = false;
|
||||
a.addEventListener("changeCursor", function() {
|
||||
c = true
|
||||
});
|
||||
a.moveCursorTo(0, 5);
|
||||
b.notOk(c)
|
||||
}};
|
||||
g.exports = e("async/test").testcase(f)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,247 +0,0 @@
|
|||
define(function(g, k, n) {
|
||||
g("./mockdom");
|
||||
var d = g("../document").Document, e = g("../editor").Editor, i = g("../mode/javascript").Mode, o = g("../undomanager").UndoManager, f = g("./mockrenderer"), c = g("./assertions");
|
||||
k = {"test: delete line from the middle":function() {
|
||||
var b = new d("a\nb\nc\nd"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nc\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\n");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\n");
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete multiple selected lines":function() {
|
||||
var b = new d("a\nb\nc\nd"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete first line":function() {
|
||||
var b = new d("a\nb\nc"), a = new e(new f, b);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "b\nc");
|
||||
c.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: delete last":function() {
|
||||
var b = new d("a\nb\nc"), a = new e(new f, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nb\n");
|
||||
c.position(a.getCursorPosition(), 2, 0)
|
||||
}, "test: indent block":function() {
|
||||
var b = new d("a12345\nb12345\nc12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 3);
|
||||
a.getSelection().selectDown();
|
||||
a.indent();
|
||||
c.equal("a12345\n b12345\n c12345", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 7);
|
||||
b = a.getSelectionRange();
|
||||
c.position(b.start, 1, 7);
|
||||
c.position(b.end, 2, 7)
|
||||
}, "test: indent selected lines":function() {
|
||||
var b = new d("a12345\nb12345\nc12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 0);
|
||||
a.getSelection().selectDown();
|
||||
a.indent();
|
||||
c.equal("a12345\n b12345\nc12345", b.toString())
|
||||
}, "test: no auto indent if cursor is before the {":function() {
|
||||
var b = new d("{", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 0);
|
||||
a.onTextInput("\n");
|
||||
c.equal("\n{", b.toString())
|
||||
}, "test: outdent block":function() {
|
||||
var b = new d(" a12345\n b12345\n c12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 5);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectDown();
|
||||
a.blockOutdent();
|
||||
c.equal(b.toString(), " a12345\nb12345\n c12345");
|
||||
c.position(a.getCursorPosition(), 2, 1);
|
||||
var h = a.getSelectionRange();
|
||||
c.position(h.start, 0, 1);
|
||||
c.position(h.end, 2, 1);
|
||||
a.blockOutdent();
|
||||
c.equal(b.toString(), "a12345\nb12345\nc12345");
|
||||
h = a.getSelectionRange();
|
||||
c.position(h.start, 0, 0);
|
||||
c.position(h.end, 2, 0)
|
||||
}, "test: outent without a selection should update cursor":function() {
|
||||
var b = new d(" 12"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 3);
|
||||
a.blockOutdent(" ");
|
||||
c.equal(b.toString(), " 12");
|
||||
c.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: comment lines should perserve selection":function() {
|
||||
var b = new d(" abc\ncde", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 2);
|
||||
a.getSelection().selectDown();
|
||||
a.toggleCommentLines();
|
||||
c.equal("// abc\n//cde", b.toString());
|
||||
b = a.getSelectionRange();
|
||||
c.position(b.start, 0, 4);
|
||||
c.position(b.end, 1, 4)
|
||||
}, "test: uncomment lines should perserve selection":function() {
|
||||
var b = new d("// abc\n//cde", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectRight();
|
||||
a.getSelection().selectRight();
|
||||
a.toggleCommentLines();
|
||||
c.equal(" abc\ncde", b.toString());
|
||||
c.range(a.getSelectionRange(), 0, 0, 1, 1)
|
||||
}, "test: toggle comment lines twice should return the original text":function() {
|
||||
var b = new d([" abc", "cde", "fg"], new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 0);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectDown();
|
||||
a.toggleCommentLines();
|
||||
a.toggleCommentLines();
|
||||
c.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: comment lines - if the selection end is at the line start it should stay there":function() {
|
||||
var b = new d("abc\ncde", new i);
|
||||
b = new e(new f, b);
|
||||
b.moveCursorTo(0, 0);
|
||||
b.getSelection().selectDown();
|
||||
b.toggleCommentLines();
|
||||
c.range(b.getSelectionRange(), 0, 2, 1, 0);
|
||||
b = new d("abc\ncde", new i);
|
||||
b = new e(new f, b);
|
||||
b.moveCursorTo(1, 0);
|
||||
b.getSelection().selectUp();
|
||||
b.toggleCommentLines();
|
||||
c.range(b.getSelectionRange(), 0, 2, 1, 0)
|
||||
}, "test: move lines down should select moved lines":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n11\n22\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n44\n11\n22", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
c.position(a.getSelection().getSelectionLead(), 2, 0);
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n44\n11\n22", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
c.position(a.getSelection().getSelectionLead(), 2, 0)
|
||||
}, "test: move lines up should select moved lines":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesUp();
|
||||
c.equal(b.toString(), "11\n33\n44\n22");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesUp();
|
||||
c.equal(b.toString(), "33\n44\n11\n22");
|
||||
c.position(a.getCursorPosition(), 0, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 0, 0)
|
||||
}, "test: move line without active selection should move cursor to start of the moved line":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.clearSelection();
|
||||
a.moveLinesDown();
|
||||
c.equal("11\n33\n22\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
a.clearSelection();
|
||||
a.moveLinesUp();
|
||||
c.equal("11\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: copy lines down should select lines and place cursor at the selection start":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesDown();
|
||||
c.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 5, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 3, 0)
|
||||
}, "test: copy lines up should select lines and place cursor at the selection start":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesUp();
|
||||
c.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0)
|
||||
}, "test: input a tab with soft tab should convert it to spaces":function() {
|
||||
var b = new d(""), a = new e(new f, b);
|
||||
b.setTabSize(2);
|
||||
b.setUseSoftTabs(true);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), " ");
|
||||
b.setTabSize(5);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), " ")
|
||||
}, "test: input tab without soft tabs should keep the tab character":function() {
|
||||
var b = new d(""), a = new e(new f, b);
|
||||
b.setUseSoftTabs(false);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), "\t")
|
||||
}, "test: undo/redo for delete line":function() {
|
||||
var b = new d(["111", "222", "333"]), a = new o;
|
||||
b.setUndoManager(a);
|
||||
var h = b.toString(), j = new e(new f, b);
|
||||
j.removeLines();
|
||||
var l = b.toString();
|
||||
c.equal(l, "222\n333");
|
||||
b.$informUndoManager.call();
|
||||
j.removeLines();
|
||||
var m = b.toString();
|
||||
c.equal(m, "333");
|
||||
b.$informUndoManager.call();
|
||||
j.removeLines();
|
||||
j = b.toString();
|
||||
c.equal(j, "");
|
||||
b.$informUndoManager.call();
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), m);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), l);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), h);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), h)
|
||||
}, "test: remove left should remove character left of the cursor":function() {
|
||||
var b = new d(["123", "456"]), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123\n56")
|
||||
}, "test: remove left should remove line break if cursor is at line start":function() {
|
||||
var b = new d(["123", "456"]), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 0);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123456")
|
||||
}, "test: remove left should remove tabsize spaces if cursor is on a tab stop and preceeded by spaces":function() {
|
||||
var b = new d(["123", " 456"]);
|
||||
b.setUseSoftTabs(true);
|
||||
b.setTabSize(4);
|
||||
var a = new e(new f, b);
|
||||
a.moveCursorTo(1, 8);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123\n 456")
|
||||
}};
|
||||
n.exports = g("async/test").testcase(k)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
define(function(d, e, f) {
|
||||
d("./mockdom");
|
||||
var g = d("../document").Document, h = d("../virtual_renderer").VirtualRenderer, b = d("./assertions");
|
||||
e = {"test: screen2text the column should be rounded to the next character edge":function() {
|
||||
var c = document.createElement("div");
|
||||
c.style.left = "0px";
|
||||
c.style.top = "0px";
|
||||
c.style.width = "100px";
|
||||
c.style.height = "100px";
|
||||
document.body.style.margin = "0px";
|
||||
document.body.style.padding = "0px";
|
||||
document.body.appendChild(c);
|
||||
var a = new h(c);
|
||||
a.setDocument(new g("1234"));
|
||||
a.characterWidth = 10;
|
||||
a.lineHeight = 15;
|
||||
b.position(a.screenToTextCoordinates(0, 0), 0, 0);
|
||||
b.position(a.screenToTextCoordinates(4, 0), 0, 0);
|
||||
b.position(a.screenToTextCoordinates(5, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(9, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(10, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(14, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(15, 0), 0, 2);
|
||||
document.body.removeChild(c)
|
||||
}};
|
||||
f.exports = d("async/test").testcase(e)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
define(function(l, m) {
|
||||
var b = l("pilot/event");
|
||||
m.TextInput = function(n, c) {
|
||||
function e() {
|
||||
if(!f) {
|
||||
var d = a.value;
|
||||
if(d) {
|
||||
if(d.charCodeAt(d.length - 1) == j.charCodeAt(0)) {
|
||||
(d = d.slice(0, -1)) && c.onTextInput(d)
|
||||
}else {
|
||||
c.onTextInput(d)
|
||||
}
|
||||
}
|
||||
}f = false;
|
||||
a.value = j;
|
||||
a.select()
|
||||
}
|
||||
var a = document.createElement("textarea"), h = a.style;
|
||||
h.position = "absolute";
|
||||
h.left = "-10000px";
|
||||
h.top = "-10000px";
|
||||
n.appendChild(a);
|
||||
var j = String.fromCharCode(0);
|
||||
e();
|
||||
var i = false, f = false, g = function() {
|
||||
setTimeout(function() {
|
||||
i || e()
|
||||
}, 0)
|
||||
}, k = function() {
|
||||
c.onCompositionUpdate(a.value)
|
||||
};
|
||||
b.addListener(a, "keypress", g);
|
||||
b.addListener(a, "textInput", g);
|
||||
b.addListener(a, "paste", g);
|
||||
b.addListener(a, "propertychange", g);
|
||||
b.addListener(a, "copy", function() {
|
||||
f = true;
|
||||
a.value = c.getCopyText();
|
||||
a.select();
|
||||
f = true;
|
||||
setTimeout(e, 0)
|
||||
});
|
||||
b.addListener(a, "cut", function() {
|
||||
f = true;
|
||||
a.value = c.getCopyText();
|
||||
c.onCut();
|
||||
a.select();
|
||||
setTimeout(e, 0)
|
||||
});
|
||||
b.addListener(a, "compositionstart", function() {
|
||||
i = true;
|
||||
e();
|
||||
a.value = "";
|
||||
c.onCompositionStart();
|
||||
setTimeout(k, 0)
|
||||
});
|
||||
b.addListener(a, "compositionupdate", k);
|
||||
b.addListener(a, "compositionend", function() {
|
||||
i = false;
|
||||
c.onCompositionEnd();
|
||||
g()
|
||||
});
|
||||
b.addListener(a, "blur", function() {
|
||||
c.onBlur()
|
||||
});
|
||||
b.addListener(a, "focus", function() {
|
||||
c.onFocus();
|
||||
a.select()
|
||||
});
|
||||
this.focus = function() {
|
||||
c.onFocus();
|
||||
a.select();
|
||||
a.focus()
|
||||
};
|
||||
this.blur = function() {
|
||||
a.blur()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-clouds .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds .ace_scroller { background-color: #FFFFFF;}.ace-clouds .ace_text-layer { cursor: text; color: #000000;}.ace-clouds .ace_cursor { border-left: 2px solid #000000;}.ace-clouds .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-clouds .ace_marker-layer .ace_selection { background: #BDD5FC;}.ace-clouds .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds .ace_marker-layer .ace_active_line { background: #FFFBD1;} .ace-clouds .ace_invisible { color: #BFBFBF;}.ace-clouds .ace_keyword { color:#AF956F;}.ace-clouds .ace_keyword.ace_operator { color:#484848;}.ace-clouds .ace_constant { }.ace-clouds .ace_constant.ace_language { color:#39946A;}.ace-clouds .ace_constant.ace_library { }.ace-clouds .ace_constant.ace_numeric { color:#46A609;}.ace-clouds .ace_invalid { background-color:#FF002A;}.ace-clouds .ace_invalid.ace_illegal { }.ace-clouds .ace_invalid.ace_deprecated { }.ace-clouds .ace_support { }.ace-clouds .ace_support.ace_function { color:#C52727;}.ace-clouds .ace_function.ace_buildin { }.ace-clouds .ace_string { color:#5D90CD;}.ace-clouds .ace_string.ace_regexp { }.ace-clouds .ace_comment { color:#BCC8BA;}.ace-clouds .ace_comment.ace_doc { }.ace-clouds .ace_comment.ace_doc.ace_tag { }.ace-clouds .ace_variable { }.ace-clouds .ace_variable.ace_language { }.ace-clouds .ace_xml_pe { }");
|
||||
b.cssClass = "ace-clouds"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-clouds-midnight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds-midnight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds-midnight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds-midnight .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds-midnight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds-midnight .ace_scroller { background-color: #191919;}.ace-clouds-midnight .ace_text-layer { cursor: text; color: #929292;}.ace-clouds-midnight .ace_cursor { border-left: 2px solid #7DA5DC;}.ace-clouds-midnight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #7DA5DC;} .ace-clouds-midnight .ace_marker-layer .ace_selection { background: #000000;}.ace-clouds-midnight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds-midnight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds-midnight .ace_marker-layer .ace_active_line { background: rgba(215, 215, 215, 0.031);} .ace-clouds-midnight .ace_invisible { color: #BFBFBF;}.ace-clouds-midnight .ace_keyword { color:#927C5D;}.ace-clouds-midnight .ace_keyword.ace_operator { color:#4B4B4B;}.ace-clouds-midnight .ace_constant { }.ace-clouds-midnight .ace_constant.ace_language { color:#39946A;}.ace-clouds-midnight .ace_constant.ace_library { }.ace-clouds-midnight .ace_constant.ace_numeric { color:#46A609;}.ace-clouds-midnight .ace_invalid { color:#FFFFFF;background-color:#E92E2E;}.ace-clouds-midnight .ace_invalid.ace_illegal { }.ace-clouds-midnight .ace_invalid.ace_deprecated { }.ace-clouds-midnight .ace_support { }.ace-clouds-midnight .ace_support.ace_function { color:#E92E2E;}.ace-clouds-midnight .ace_function.ace_buildin { }.ace-clouds-midnight .ace_string { color:#5D90CD;}.ace-clouds-midnight .ace_string.ace_regexp { }.ace-clouds-midnight .ace_comment { color:#3C403B;}.ace-clouds-midnight .ace_comment.ace_doc { }.ace-clouds-midnight .ace_comment.ace_doc.ace_tag { }.ace-clouds-midnight .ace_variable { }.ace-clouds-midnight .ace_variable.ace_language { }.ace-clouds-midnight .ace_xml_pe { }");
|
||||
b.cssClass = "ace-clouds-midnight"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-cobalt .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-cobalt .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-cobalt .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-cobalt .ace_gutter-layer { width: 100%; text-align: right;}.ace-cobalt .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-cobalt .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-cobalt .ace_scroller { background-color: #002240;}.ace-cobalt .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-cobalt .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-cobalt .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-cobalt .ace_marker-layer .ace_selection { background: rgba(179, 101, 57, 0.75);}.ace-cobalt .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-cobalt .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.35);} .ace-cobalt .ace_invisible { color: rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_keyword { color:#FF9D00;}.ace-cobalt .ace_keyword.ace_operator { }.ace-cobalt .ace_constant { color:#FF628C;}.ace-cobalt .ace_constant.ace_language { }.ace-cobalt .ace_constant.ace_library { }.ace-cobalt .ace_constant.ace_numeric { }.ace-cobalt .ace_invalid { color:#F8F8F8;background-color:#800F00;}.ace-cobalt .ace_invalid.ace_illegal { }.ace-cobalt .ace_invalid.ace_deprecated { }.ace-cobalt .ace_support { color:#80FFBB;}.ace-cobalt .ace_support.ace_function { color:#FFB054;}.ace-cobalt .ace_function.ace_buildin { }.ace-cobalt .ace_string { }.ace-cobalt .ace_string.ace_regexp { color:#80FFC2;}.ace-cobalt .ace_comment { font-style:italic;color:#0088FF;}.ace-cobalt .ace_comment.ace_doc { }.ace-cobalt .ace_comment.ace_doc.ace_tag { }.ace-cobalt .ace_variable { color:#CCCCCC;}.ace-cobalt .ace_variable.ace_language { color:#FF80E1;}.ace-cobalt .ace_xml_pe { }");
|
||||
b.cssClass = "ace-cobalt"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-dawn .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-dawn .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-dawn .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-dawn .ace_gutter-layer { width: 100%; text-align: right;}.ace-dawn .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-dawn .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-dawn .ace_scroller { background-color: #F9F9F9;}.ace-dawn .ace_text-layer { cursor: text; color: #080808;}.ace-dawn .ace_cursor { border-left: 2px solid #000000;}.ace-dawn .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-dawn .ace_marker-layer .ace_selection { background: rgba(39, 95, 255, 0.30);}.ace-dawn .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-dawn .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(75, 75, 126, 0.50);}.ace-dawn .ace_marker-layer .ace_active_line { background: rgba(36, 99, 180, 0.12);} .ace-dawn .ace_invisible { color: rgba(75, 75, 126, 0.50);}.ace-dawn .ace_keyword { color:#794938;}.ace-dawn .ace_keyword.ace_operator { }.ace-dawn .ace_constant { color:#811F24;}.ace-dawn .ace_constant.ace_language { }.ace-dawn .ace_constant.ace_library { }.ace-dawn .ace_constant.ace_numeric { }.ace-dawn .ace_invalid { }.ace-dawn .ace_invalid.ace_illegal { text-decoration:underline;font-style:italic;color:#F8F8F8;background-color:#B52A1D;}.ace-dawn .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#B52A1D;}.ace-dawn .ace_support { color:#691C97;}.ace-dawn .ace_support.ace_function { color:#693A17;}.ace-dawn .ace_function.ace_buildin { }.ace-dawn .ace_string { color:#0B6125;}.ace-dawn .ace_string.ace_regexp { color:#CF5628;}.ace-dawn .ace_comment { font-style:italic;color:#5A525F;}.ace-dawn .ace_comment.ace_doc { }.ace-dawn .ace_comment.ace_doc.ace_tag { }.ace-dawn .ace_variable { color:#234A97;}.ace-dawn .ace_variable.ace_language { }.ace-dawn .ace_xml_pe { }");
|
||||
b.cssClass = "ace-dawn"
|
||||
});
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
.ace-eclipse .ace_editor {
|
||||
border: 2px solid rgb(159, 159, 159);
|
||||
}
|
||||
.ace-eclipse .ace_editor.ace_focus {
|
||||
border: 2px solid #327fbd;
|
||||
}
|
||||
.ace-eclipse .ace_gutter {
|
||||
width: 40px;
|
||||
background: rgb(227, 227, 227);
|
||||
border-right: 1px solid rgb(159, 159, 159);
|
||||
color: rgb(136, 136, 136);
|
||||
}
|
||||
.ace-eclipse .ace_gutter-layer {
|
||||
right: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
.ace-eclipse .ace_text-layer {
|
||||
cursor: text;
|
||||
}
|
||||
.ace-eclipse .ace_cursor {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {
|
||||
color: rgb(127, 0, 85);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_constant.ace_buildin {
|
||||
color: rgb(88, 72, 246);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_constant.ace_library {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_function {
|
||||
color: rgb(60, 76, 114);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_string {
|
||||
color: rgb(42, 0, 255);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_comment {
|
||||
color: rgb(63, 127, 95);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_comment.ace_doc {
|
||||
color: rgb(63, 95, 191);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {
|
||||
color: rgb(127, 159, 191);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_constant.ace_numeric {
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_tag {
|
||||
color: rgb(63, 127, 127);
|
||||
}
|
||||
.ace-eclipse .ace_line .ace_xml_pe {
|
||||
color: rgb(104, 104, 91);
|
||||
}
|
||||
.ace-eclipse .ace_marker-layer .ace_selection {
|
||||
background: rgb(181, 213, 255);
|
||||
}
|
||||
.ace-eclipse .ace_marker-layer .ace_bracket {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid rgb(192, 192, 192);
|
||||
}
|
||||
.ace-eclipse .ace_marker-layer .ace_active_line {
|
||||
background: rgb(232, 242, 254);
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
define("ace/theme/eclipse", ["require", "exports", "module", "pilot/dom", "text!ace/theme/eclipse.css!.ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 40px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n right: 10px;\n text-align: right;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}"],
|
||||
function(a, b) {
|
||||
var c = a("pilot/dom");
|
||||
a = a("text!ace/theme/eclipse.css!.ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 40px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n right: 10px;\n text-align: right;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}");
|
||||
c.importCssString(a);
|
||||
b.cssClass = "ace-eclipse"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-idle-fingers .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-idle-fingers .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-idle-fingers .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-idle-fingers .ace_gutter-layer { width: 100%; text-align: right;}.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-idle-fingers .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-idle-fingers .ace_scroller { background-color: #323232;}.ace-idle-fingers .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-idle-fingers .ace_cursor { border-left: 2px solid #91FF00;}.ace-idle-fingers .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #91FF00;} .ace-idle-fingers .ace_marker-layer .ace_selection { background: rgba(90, 100, 126, 0.88);}.ace-idle-fingers .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-idle-fingers .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #404040;}.ace-idle-fingers .ace_marker-layer .ace_active_line { background: #353637;} .ace-idle-fingers .ace_invisible { color: #404040;}.ace-idle-fingers .ace_keyword { color:#CC7833;}.ace-idle-fingers .ace_keyword.ace_operator { }.ace-idle-fingers .ace_constant { color:#6C99BB;}.ace-idle-fingers .ace_constant.ace_language { }.ace-idle-fingers .ace_constant.ace_library { }.ace-idle-fingers .ace_constant.ace_numeric { }.ace-idle-fingers .ace_invalid { color:#FFFFFF;background-color:#FF0000;}.ace-idle-fingers .ace_invalid.ace_illegal { }.ace-idle-fingers .ace_invalid.ace_deprecated { }.ace-idle-fingers .ace_support { color:#bc9458;}.ace-idle-fingers .ace_support.ace_function { color:#B83426;}.ace-idle-fingers .ace_function.ace_buildin { }.ace-idle-fingers .ace_string { color:#A5C261;}.ace-idle-fingers .ace_string.ace_regexp { color:#CCCC33;}.ace-idle-fingers .ace_comment { font-style:italic; color:#BC9458;}.ace-idle-fingers .ace_comment.ace_doc { }.ace-idle-fingers .ace_comment.ace_doc.ace_tag { }.ace-idle-fingers .ace_variable { color:#b7dff8;}.ace-idle-fingers .ace_variable.ace_language { color:#b7dff8;}.ace-idle-fingers .ace_xml_pe { }");
|
||||
b.cssClass = "ace-idle-fingers"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-kr-theme .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-kr-theme .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-kr-theme .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-kr-theme .ace_gutter-layer { width: 100%; text-align: right;}.ace-kr-theme .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-kr-theme .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-kr-theme .ace_scroller { background-color: #0B0A09;}.ace-kr-theme .ace_text-layer { cursor: text; color: #FCFFE0;}.ace-kr-theme .ace_cursor { border-left: 2px solid #FF9900;}.ace-kr-theme .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FF9900;} .ace-kr-theme .ace_marker-layer .ace_selection { background: rgba(170, 0, 255, 0.45);}.ace-kr-theme .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-kr-theme .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_marker-layer .ace_active_line { background: #38403D;} .ace-kr-theme .ace_invisible { color: rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_keyword { color:#949C8B;}.ace-kr-theme .ace_keyword.ace_operator { }.ace-kr-theme .ace_constant { color:rgba(210, 117, 24, 0.76);}.ace-kr-theme .ace_constant.ace_language { }.ace-kr-theme .ace_constant.ace_library { }.ace-kr-theme .ace_constant.ace_numeric { }.ace-kr-theme .ace_invalid { color:#F8F8F8;background-color:#A41300;}.ace-kr-theme .ace_invalid.ace_illegal { }.ace-kr-theme .ace_invalid.ace_deprecated { }.ace-kr-theme .ace_support { color:#9FC28A;}.ace-kr-theme .ace_support.ace_function { color:#85873A;}.ace-kr-theme .ace_function.ace_buildin { }.ace-kr-theme .ace_string { }.ace-kr-theme .ace_string.ace_regexp { color:rgba(125, 255, 192, 0.65);}.ace-kr-theme .ace_comment { font-style:italic;color:#706D5B;}.ace-kr-theme .ace_comment.ace_doc { }.ace-kr-theme .ace_comment.ace_doc.ace_tag { }.ace-kr-theme .ace_variable { color:#D1A796;}.ace-kr-theme .ace_variable.ace_language { color:#FF80E1;}.ace-kr-theme .ace_xml_pe { }");
|
||||
b.cssClass = "ace-kr-theme"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-mono-industrial .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-mono-industrial .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-mono-industrial .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-mono-industrial .ace_gutter-layer { width: 100%; text-align: right;}.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-mono-industrial .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-mono-industrial .ace_scroller { background-color: #222C28;}.ace-mono-industrial .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-mono-industrial .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-mono-industrial .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-mono-industrial .ace_marker-layer .ace_selection { background: rgba(145, 153, 148, 0.40);}.ace-mono-industrial .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-mono-industrial .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_marker-layer .ace_active_line { background: rgba(12, 13, 12, 0.25);} .ace-mono-industrial .ace_invisible { color: rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_keyword { color:#A39E64;}.ace-mono-industrial .ace_keyword.ace_operator { color:#A8B3AB;}.ace-mono-industrial .ace_constant { color:#E98800;}.ace-mono-industrial .ace_constant.ace_language { }.ace-mono-industrial .ace_constant.ace_library { }.ace-mono-industrial .ace_constant.ace_numeric { color:#E98800;}.ace-mono-industrial .ace_invalid { color:#FFFFFF;background-color:rgba(153, 0, 0, 0.68);}.ace-mono-industrial .ace_invalid.ace_illegal { }.ace-mono-industrial .ace_invalid.ace_deprecated { }.ace-mono-industrial .ace_support { }.ace-mono-industrial .ace_support.ace_function { color:#588E60;}.ace-mono-industrial .ace_function.ace_buildin { }.ace-mono-industrial .ace_string { }.ace-mono-industrial .ace_string.ace_regexp { }.ace-mono-industrial .ace_comment { color:#666C68;background-color:#151C19;}.ace-mono-industrial .ace_comment.ace_doc { }.ace-mono-industrial .ace_comment.ace_doc.ace_tag { }.ace-mono-industrial .ace_variable { }.ace-mono-industrial .ace_variable.ace_language { color:#648BD2;}.ace-mono-industrial .ace_xml_pe { }");
|
||||
b.cssClass = "ace-mono-industrial"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-monokai .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-monokai .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-monokai .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-monokai .ace_gutter-layer { width: 100%; text-align: right;}.ace-monokai .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-monokai .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-monokai .ace_scroller { background-color: #272822;}.ace-monokai .ace_text-layer { cursor: text; color: #F8F8F2;}.ace-monokai .ace_cursor { border-left: 2px solid #F8F8F0;}.ace-monokai .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #F8F8F0;} .ace-monokai .ace_marker-layer .ace_selection { background: #49483E;}.ace-monokai .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #49483E;}.ace-monokai .ace_marker-layer .ace_active_line { background: #49483E;} .ace-monokai .ace_invisible { color: #49483E;}.ace-monokai .ace_keyword { color:#F92672;}.ace-monokai .ace_keyword.ace_operator { }.ace-monokai .ace_constant { }.ace-monokai .ace_constant.ace_language { color:#AE81FF;}.ace-monokai .ace_constant.ace_library { }.ace-monokai .ace_constant.ace_numeric { color:#AE81FF;}.ace-monokai .ace_invalid { color:#F8F8F0;background-color:#F92672;}.ace-monokai .ace_invalid.ace_illegal { }.ace-monokai .ace_invalid.ace_deprecated { color:#F8F8F0;background-color:#AE81FF;}.ace-monokai .ace_support { }.ace-monokai .ace_support.ace_function { color:#66D9EF;}.ace-monokai .ace_function.ace_buildin { }.ace-monokai .ace_string { color:#E6DB74;}.ace-monokai .ace_string.ace_regexp { }.ace-monokai .ace_comment { color:#75715E;}.ace-monokai .ace_comment.ace_doc { }.ace-monokai .ace_comment.ace_doc.ace_tag { }.ace-monokai .ace_variable { }.ace-monokai .ace_variable.ace_language { }.ace-monokai .ace_xml_pe { }");
|
||||
b.cssClass = "ace-monokai"
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-pastel-on-dark .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-pastel-on-dark .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-pastel-on-dark .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-pastel-on-dark .ace_gutter-layer { width: 100%; text-align: right;}.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-pastel-on-dark .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-pastel-on-dark .ace_scroller { background-color: #2c2828;}.ace-pastel-on-dark .ace_text-layer { cursor: text; color: #8f938f;}.ace-pastel-on-dark .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-pastel-on-dark .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-pastel-on-dark .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-pastel-on-dark .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-pastel-on-dark .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-pastel-on-dark .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_keyword { color:#757ad8;}.ace-pastel-on-dark .ace_keyword.ace_operator { color:#797878;}.ace-pastel-on-dark .ace_constant { color:#4fb7c5;}.ace-pastel-on-dark .ace_constant.ace_language { }.ace-pastel-on-dark .ace_constant.ace_library { }.ace-pastel-on-dark .ace_constant.ace_numeric { }.ace-pastel-on-dark .ace_invalid { }.ace-pastel-on-dark .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-pastel-on-dark .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-pastel-on-dark .ace_support { color:#9a9a9a;}.ace-pastel-on-dark .ace_support.ace_function { color:#aeb2f8;}.ace-pastel-on-dark .ace_function.ace_buildin { }.ace-pastel-on-dark .ace_string { color:#66a968;}.ace-pastel-on-dark .ace_string.ace_regexp { color:#E9C062;}.ace-pastel-on-dark .ace_comment { color:#656865;}.ace-pastel-on-dark .ace_comment.ace_doc { color:A6C6FF;}.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag { color:A6C6FF;}.ace-pastel-on-dark .ace_variable { color:#bebf55;}.ace-pastel-on-dark .ace_variable.ace_language { color:#bebf55;}.ace-pastel-on-dark .ace_xml_pe { color:#494949;}");
|
||||
b.cssClass = "ace-pastel-on-dark"
|
||||
});
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
define(function(a, b) {
|
||||
var c = a("pilot/dom");
|
||||
a = a("text!ace/theme/tm.css!.ace-tm .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-tm .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-tm .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-tm .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-tm .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-tm .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_text-layer {\n cursor: text;\n}\n\n.ace-tm .ace_cursor {\n border-left: 2px solid black;\n}\n\n.ace-tm .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid black;\n}\n \n.ace-tm .ace_line .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_line .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_invalid {\n background-color: rgb(153, 0, 0);\n color: white;\n}\n\n.ace-tm .ace_line .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_line .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_support.ace_type,\n.ace-tm .ace_line .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_line .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_line .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_line .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_line .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_line .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0) \n}");
|
||||
c.importCssString(a);
|
||||
b.cssClass = "ace-tm"
|
||||
});
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
.ace-tm .ace_editor {
|
||||
border: 2px solid rgb(159, 159, 159);
|
||||
}
|
||||
.ace-tm .ace_editor.ace_focus {
|
||||
border: 2px solid #327fbd;
|
||||
}
|
||||
.ace-tm .ace_gutter {
|
||||
width: 50px;
|
||||
background: #e8e8e8;
|
||||
color: #333;
|
||||
overflow : hidden;
|
||||
}
|
||||
.ace-tm .ace_gutter-layer {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
.ace-tm .ace_gutter-layer .ace_gutter-cell {
|
||||
padding-right: 6px;
|
||||
}
|
||||
.ace-tm .ace_editor .ace_printMargin {
|
||||
width: 1px;
|
||||
background: #e8e8e8;
|
||||
}
|
||||
.ace-tm .ace_text-layer {
|
||||
cursor: text;
|
||||
}
|
||||
.ace-tm .ace_cursor {
|
||||
border-left: 2px solid black;
|
||||
}
|
||||
.ace-tm .ace_cursor.ace_overwrite {
|
||||
border-left: 0px;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.ace-tm .ace_line .ace_invisible {
|
||||
color: rgb(191, 191, 191);
|
||||
}
|
||||
.ace-tm .ace_line .ace_keyword {
|
||||
color: blue;
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_buildin {
|
||||
color: rgb(88, 72, 246);
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_language {
|
||||
color: rgb(88, 92, 246);
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_library {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
.ace-tm .ace_line .ace_invalid {
|
||||
background-color: rgb(153, 0, 0);
|
||||
color: white;
|
||||
}
|
||||
.ace-tm .ace_line .ace_support.ace_function {
|
||||
color: rgb(60, 76, 114);
|
||||
}
|
||||
.ace-tm .ace_line .ace_support.ace_constant {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
.ace-tm .ace_line .ace_support.ace_type,
|
||||
.ace-tm .ace_line .ace_support.ace_class {
|
||||
color: rgb(109, 121, 222);
|
||||
}
|
||||
.ace-tm .ace_line .ace_keyword.ace_operator {
|
||||
color: rgb(104, 118, 135);
|
||||
}
|
||||
.ace-tm .ace_line .ace_string {
|
||||
color: rgb(3, 106, 7);
|
||||
}
|
||||
.ace-tm .ace_line .ace_comment {
|
||||
color: rgb(76, 136, 107);
|
||||
}
|
||||
.ace-tm .ace_line .ace_comment.ace_doc {
|
||||
color: rgb(0, 102, 255);
|
||||
}
|
||||
.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {
|
||||
color: rgb(128, 159, 191);
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_numeric {
|
||||
color: rgb(0, 0, 205);
|
||||
}
|
||||
.ace-tm .ace_line .ace_variable {
|
||||
color: rgb(49, 132, 149);
|
||||
}
|
||||
.ace-tm .ace_line .ace_xml_pe {
|
||||
color: rgb(104, 104, 91);
|
||||
}
|
||||
.ace-tm .ace_marker-layer .ace_selection {
|
||||
background: rgb(181, 213, 255);
|
||||
}
|
||||
.ace-tm .ace_marker-layer .ace_step {
|
||||
background: rgb(252, 255, 0);
|
||||
}
|
||||
.ace-tm .ace_marker-layer .ace_stack {
|
||||
background: rgb(164, 229, 101);
|
||||
}
|
||||
.ace-tm .ace_marker-layer .ace_bracket {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid rgb(192, 192, 192);
|
||||
}
|
||||
.ace-tm .ace_marker-layer .ace_active_line {
|
||||
background: rgb(232, 242, 254);
|
||||
}
|
||||
.ace-tm .ace_string.ace_regex {
|
||||
color: rgb(255, 0, 0)
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-twilight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-twilight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-twilight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-twilight .ace_gutter-layer { width: 100%; text-align: right;}.ace-twilight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-twilight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-twilight .ace_scroller { background-color: #141414;}.ace-twilight .ace_text-layer { cursor: text; color: #F8F8F8;}.ace-twilight .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-twilight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-twilight .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-twilight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-twilight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-twilight .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-twilight .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-twilight .ace_keyword { color:#CDA869;}.ace-twilight .ace_keyword.ace_operator { }.ace-twilight .ace_constant { color:#CF6A4C;}.ace-twilight .ace_constant.ace_language { }.ace-twilight .ace_constant.ace_library { }.ace-twilight .ace_constant.ace_numeric { }.ace-twilight .ace_invalid { }.ace-twilight .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-twilight .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-twilight .ace_support { color:#9B859D;}.ace-twilight .ace_support.ace_function { color:#DAD085;}.ace-twilight .ace_function.ace_buildin { }.ace-twilight .ace_string { color:#8F9D6A;}.ace-twilight .ace_string.ace_regexp { color:#E9C062;}.ace-twilight .ace_comment { font-style:italic;color:#5F5A60;}.ace-twilight .ace_comment.ace_doc { }.ace-twilight .ace_comment.ace_doc.ace_tag { }.ace-twilight .ace_variable { color:#7587A6;}.ace-twilight .ace_variable.ace_language { }.ace-twilight .ace_xml_pe { color:#494949;}");
|
||||
b.cssClass = "ace-twilight"
|
||||
});
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
define(function(i, m) {
|
||||
i = function(f) {
|
||||
this.rules = f;
|
||||
this.regExps = {};
|
||||
for(var a in this.rules) {
|
||||
f = this.rules[a];
|
||||
for(var b = [], c = 0;c < f.length;c++) {
|
||||
b.push(f[c].regex)
|
||||
}this.regExps[a] = new RegExp("(?:(" + b.join(")|(") + ")|(.))", "g")
|
||||
}
|
||||
};
|
||||
(function() {
|
||||
this.getLineTokens = function(f, a) {
|
||||
a = a;
|
||||
var b = this.rules[a], c = this.regExps[a];
|
||||
c.lastIndex = 0;
|
||||
for(var g, j = [], h = 0, e = {type:null, value:""};g = c.exec(f);) {
|
||||
var k = "text", l = g[0];
|
||||
if(c.lastIndex == h) {
|
||||
throw new Error("tokenizer error");
|
||||
}h = c.lastIndex;
|
||||
for(var d = 0;d < b.length;d++) {
|
||||
if(g[d + 1]) {
|
||||
k = typeof b[d].token == "function" ? b[d].token(g[0]) : b[d].token;
|
||||
if(b[d].next && b[d].next !== a) {
|
||||
a = b[d].next;
|
||||
b = this.rules[a];
|
||||
h = c.lastIndex;
|
||||
c = this.regExps[a];
|
||||
c.lastIndex = h
|
||||
}break
|
||||
}
|
||||
}if(e.type !== k) {
|
||||
e.type && j.push(e);
|
||||
e = {type:k, value:l}
|
||||
}else {
|
||||
e.value += l
|
||||
}
|
||||
}e.type && j.push(e);
|
||||
return{tokens:j, state:a}
|
||||
}
|
||||
}).call(i.prototype);
|
||||
m.Tokenizer = i
|
||||
});
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
define(function(b, c) {
|
||||
b = function() {
|
||||
this.$undoStack = [];
|
||||
this.$redoStack = []
|
||||
};
|
||||
(function() {
|
||||
this.execute = function(a) {
|
||||
var d = a.args[0];
|
||||
this.$doc = a.args[1];
|
||||
this.$undoStack.push(d)
|
||||
};
|
||||
this.undo = function() {
|
||||
var a = this.$undoStack.pop();
|
||||
if(a) {
|
||||
this.$doc.undoChanges(a);
|
||||
this.$redoStack.push(a)
|
||||
}
|
||||
};
|
||||
this.redo = function() {
|
||||
var a = this.$redoStack.pop();
|
||||
if(a) {
|
||||
this.$doc.redoChanges(a);
|
||||
this.$undoStack.push(a)
|
||||
}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
c.UndoManager = b
|
||||
});
|
||||
|
|
@ -1,369 +0,0 @@
|
|||
define(function(d, k) {
|
||||
var l = d("pilot/oop"), f = d("pilot/dom"), i = d("pilot/event"), m = d("ace/layer/gutter").Gutter, n = d("ace/layer/marker").Marker, o = d("ace/layer/text").Text, p = d("ace/layer/cursor").Cursor, q = d("ace/scrollbar").ScrollBar, r = d("ace/renderloop").RenderLoop, s = d("pilot/event_emitter").EventEmitter, j = d('text!ace/css/editor.css!.ace_editor {\n position: absolute;\n overflow: hidden;\n\n font-family: "Menlo", "Monaco", "Courier New", monospace;\n font-size: 12px; \n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden; \n}\n\n.ace_gutter {\n position: absolute;\n overflow-x: hidden;\n overflow-y: hidden;\n height: 100%;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0px;\n}\n\n.ace_editor .ace_printMargin {\n position: absolute;\n height: 100%;\n}\n\n.ace_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden; \n white-space: nowrap;\n height: 100%;\n}\n\n.ace_text-layer {\n font-family: Monaco, "Courier New", monospace;\n color: black;\n}\n\n.ace_cursor-layer {\n cursor: text;\n}\n\n.ace_cursor {\n z-index: 3;\n position: absolute;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer {\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 4;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 1;\n}');
|
||||
f.importCssString(j);
|
||||
j = function(a, b) {
|
||||
this.container = a;
|
||||
f.addCssClass(this.container, "ace_editor");
|
||||
this.setTheme(b);
|
||||
this.$gutter = document.createElement("div");
|
||||
this.$gutter.className = "ace_gutter";
|
||||
this.container.appendChild(this.$gutter);
|
||||
this.scroller = document.createElement("div");
|
||||
this.scroller.className = "ace_scroller";
|
||||
this.container.appendChild(this.scroller);
|
||||
this.content = document.createElement("div");
|
||||
this.content.style.position = "absolute";
|
||||
this.scroller.appendChild(this.content);
|
||||
this.$gutterLayer = new m(this.$gutter);
|
||||
this.$markerLayer = new n(this.content);
|
||||
var c = this.$textLayer = new o(this.content);
|
||||
this.canvas = c.element;
|
||||
this.characterWidth = c.getCharacterWidth();
|
||||
this.lineHeight = c.getLineHeight();
|
||||
this.$cursorLayer = new p(this.content);
|
||||
this.layers = [this.$markerLayer, c, this.$cursorLayer];
|
||||
this.scrollBar = new q(a);
|
||||
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
||||
this.scrollTop = 0;
|
||||
this.cursorPos = {row:0, column:0};
|
||||
var e = this;
|
||||
this.$textLayer.addEventListener("changeCharaterSize", function() {
|
||||
e.characterWidth = c.getCharacterWidth();
|
||||
e.lineHeight = c.getLineHeight();
|
||||
e.$loop.schedule(e.CHANGE_FULL)
|
||||
});
|
||||
i.addListener(this.$gutter, "click", this.$onGutterClick.bind(this));
|
||||
i.addListener(this.$gutter, "dblclick", this.$onGutterClick.bind(this));
|
||||
this.$size = {width:0, height:0, scrollerHeight:0, scrollerWidth:0};
|
||||
this.$loop = new r(this.$renderChanges.bind(this));
|
||||
this.$loop.schedule(this.CHANGE_FULL);
|
||||
this.$updatePrintMargin();
|
||||
this.setPadding(4)
|
||||
};
|
||||
(function() {
|
||||
this.showGutter = true;
|
||||
this.CHANGE_CURSOR = 1;
|
||||
this.CHANGE_MARKER = 2;
|
||||
this.CHANGE_GUTTER = 4;
|
||||
this.CHANGE_SCROLL = 8;
|
||||
this.CHANGE_LINES = 16;
|
||||
this.CHANGE_TEXT = 32;
|
||||
this.CHANGE_SIZE = 64;
|
||||
this.CHANGE_FULL = 128;
|
||||
l.implement(this, s);
|
||||
this.setDocument = function(a) {
|
||||
this.lines = a.lines;
|
||||
this.doc = a;
|
||||
this.$cursorLayer.setDocument(a);
|
||||
this.$markerLayer.setDocument(a);
|
||||
this.$textLayer.setDocument(a);
|
||||
this.$loop.schedule(this.CHANGE_FULL)
|
||||
};
|
||||
this.updateLines = function(a, b) {
|
||||
if(b === undefined) {
|
||||
b = Infinity
|
||||
}if(this.$changedLines) {
|
||||
if(this.$changedLines.firstRow > a) {
|
||||
this.$changedLines.firstRow = a
|
||||
}if(this.$changedLines.lastRow < b) {
|
||||
this.$changedLines.lastRow = b
|
||||
}
|
||||
}else {
|
||||
this.$changedLines = {firstRow:a, lastRow:b}
|
||||
}this.$loop.schedule(this.CHANGE_LINES)
|
||||
};
|
||||
this.updateText = function() {
|
||||
this.$loop.schedule(this.CHANGE_TEXT)
|
||||
};
|
||||
this.updateFull = function() {
|
||||
this.$loop.schedule(this.CHANGE_FULL)
|
||||
};
|
||||
this.onResize = function() {
|
||||
var a = this.CHANGE_SIZE, b = f.getInnerHeight(this.container);
|
||||
if(this.$size.height != b) {
|
||||
this.$size.height = b;
|
||||
this.scroller.style.height = b + "px";
|
||||
this.scrollBar.setHeight(b);
|
||||
if(this.doc) {
|
||||
this.scrollToY(this.getScrollTop());
|
||||
a |= this.CHANGE_FULL
|
||||
}
|
||||
}b = f.getInnerWidth(this.container);
|
||||
if(this.$size.width != b) {
|
||||
this.$size.width = b;
|
||||
var c = this.showGutter ? this.$gutter.offsetWidth : 0;
|
||||
this.scroller.style.left = c + "px";
|
||||
this.scroller.style.width = Math.max(0, b - c - this.scrollBar.getWidth()) + "px"
|
||||
}this.$size.scrollerWidth = this.scroller.clientWidth;
|
||||
this.$size.scrollerHeight = this.scroller.clientHeight;
|
||||
this.$loop.schedule(a)
|
||||
};
|
||||
this.setTokenizer = function(a) {
|
||||
this.$tokenizer = a;
|
||||
this.$textLayer.setTokenizer(a);
|
||||
this.$loop.schedule(this.CHANGE_TEXT)
|
||||
};
|
||||
this.$onGutterClick = function(a) {
|
||||
var b = i.getDocumentX(a), c = i.getDocumentY(a);
|
||||
this._dispatchEvent("gutter" + a.type, {row:this.screenToTextCoordinates(b, c).row, htmlEvent:a})
|
||||
};
|
||||
this.setShowInvisibles = function(a) {
|
||||
this.$textLayer.setShowInvisibles(a) && this.$loop.schedule(this.CHANGE_TEXT)
|
||||
};
|
||||
this.getShowInvisibles = function() {
|
||||
return this.$textLayer.showInvisibles
|
||||
};
|
||||
this.$showPrintMargin = true;
|
||||
this.setShowPrintMargin = function(a) {
|
||||
this.$showPrintMargin = a;
|
||||
this.$updatePrintMargin()
|
||||
};
|
||||
this.getShowPrintMargin = function() {
|
||||
return this.$showPrintMargin
|
||||
};
|
||||
this.$printMarginColumn = 80;
|
||||
this.setPrintMarginColumn = function(a) {
|
||||
this.$printMarginColumn = a;
|
||||
this.$updatePrintMargin()
|
||||
};
|
||||
this.getPrintMarginColumn = function() {
|
||||
return this.$printMarginColumn
|
||||
};
|
||||
this.setShowGutter = function(a) {
|
||||
this.$gutter.style.display = a ? "block" : "none";
|
||||
this.showGutter = a;
|
||||
this.onResize()
|
||||
};
|
||||
this.$updatePrintMargin = function() {
|
||||
if(this.$showPrintMargin || this.$printMarginEl) {
|
||||
if(!this.$printMarginEl) {
|
||||
this.$printMarginEl = document.createElement("div");
|
||||
this.$printMarginEl.className = "ace_printMargin";
|
||||
this.content.insertBefore(this.$printMarginEl, this.$textLayer.element)
|
||||
}var a = this.$printMarginEl.style;
|
||||
a.left = this.characterWidth * this.$printMarginColumn + "px";
|
||||
a.visibility = this.$showPrintMargin ? "visible" : "hidden"
|
||||
}
|
||||
};
|
||||
this.getContainerElement = function() {
|
||||
return this.container
|
||||
};
|
||||
this.getMouseEventTarget = function() {
|
||||
return this.content
|
||||
};
|
||||
this.getFirstVisibleRow = function() {
|
||||
return(this.layerConfig || {}).firstRow || 0
|
||||
};
|
||||
this.getFirstFullyVisibleRow = function() {
|
||||
if(!this.layerConfig) {
|
||||
return 0
|
||||
}return this.layerConfig.firstRow + (this.layerConfig.offset == 0 ? 0 : 1)
|
||||
};
|
||||
this.getLastFullyVisibleRow = function() {
|
||||
if(!this.layerConfig) {
|
||||
return 0
|
||||
}return this.layerConfig.firstRow - 1 + Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight)
|
||||
};
|
||||
this.getLastVisibleRow = function() {
|
||||
return(this.layerConfig || {}).lastRow || 0
|
||||
};
|
||||
this.$padding = null;
|
||||
this.setPadding = function(a) {
|
||||
this.$padding = a;
|
||||
this.content.style.padding = "0 " + a + "px";
|
||||
this.$loop.schedule(this.CHANGE_FULL)
|
||||
};
|
||||
this.onScroll = function(a) {
|
||||
this.scrollToY(a.data)
|
||||
};
|
||||
this.$updateScrollBar = function() {
|
||||
this.scrollBar.setInnerHeight(this.doc.getLength() * this.lineHeight);
|
||||
this.scrollBar.setScrollTop(this.scrollTop)
|
||||
};
|
||||
this.$renderChanges = function(a) {
|
||||
if(!(!a || !this.doc || !this.$tokenizer)) {
|
||||
if(!this.layerConfig || a & this.CHANGE_FULL || a & this.CHANGE_SIZE || a & this.CHANGE_TEXT || a & this.CHANGE_LINES || a & this.CHANGE_SCROLL) {
|
||||
this.$computeLayerConfig()
|
||||
}if(a & this.CHANGE_FULL) {
|
||||
this.$textLayer.update(this.layerConfig);
|
||||
this.showGutter && this.$gutterLayer.update(this.layerConfig);
|
||||
this.$markerLayer.update(this.layerConfig);
|
||||
this.$cursorLayer.update(this.layerConfig);
|
||||
this.$updateScrollBar()
|
||||
}else {
|
||||
if(a & this.CHANGE_SCROLL) {
|
||||
a & this.CHANGE_TEXT || a & this.CHANGE_LINES ? this.$textLayer.update(this.layerConfig) : this.$textLayer.scrollLines(this.layerConfig);
|
||||
this.showGutter && this.$gutterLayer.update(this.layerConfig);
|
||||
this.$markerLayer.update(this.layerConfig);
|
||||
this.$cursorLayer.update(this.layerConfig);
|
||||
this.$updateScrollBar()
|
||||
}else {
|
||||
if(a & this.CHANGE_TEXT) {
|
||||
this.$textLayer.update(this.layerConfig);
|
||||
this.showGutter && this.$gutterLayer.update(this.layerConfig)
|
||||
}else {
|
||||
if(a & this.CHANGE_LINES) {
|
||||
this.$updateLines();
|
||||
this.$updateScrollBar();
|
||||
this.showGutter && this.$gutterLayer.update(this.layerConfig)
|
||||
}else {
|
||||
a & this.CHANGE_GUTTER && this.showGutter && this.$gutterLayer.update(this.layerConfig)
|
||||
}
|
||||
}a & this.CHANGE_CURSOR && this.$cursorLayer.update(this.layerConfig);
|
||||
a & this.CHANGE_MARKER && this.$markerLayer.update(this.layerConfig);
|
||||
a & this.CHANGE_SIZE && this.$updateScrollBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$computeLayerConfig = function() {
|
||||
var a = this.scrollTop % this.lineHeight, b = this.$size.scrollerHeight + this.lineHeight, c = this.$getLongestLine(), e = !this.layerConfig ? true : this.layerConfig.width != c, h = Math.ceil(b / this.lineHeight), g = Math.max(0, Math.round((this.scrollTop - a) / this.lineHeight));
|
||||
h = Math.max(0, Math.min(this.lines.length, g + h) - 1);
|
||||
this.layerConfig = {width:c, padding:this.$padding, firstRow:g, lastRow:h, lineHeight:this.lineHeight, characterWidth:this.characterWidth, minHeight:b, offset:a, height:this.$size.scrollerHeight};
|
||||
for(g = 0;g < this.layers.length;g++) {
|
||||
h = this.layers[g];
|
||||
if(e) {
|
||||
h.element.style.width = c + "px"
|
||||
}
|
||||
}this.$gutterLayer.element.style.marginTop = -a + "px";
|
||||
this.content.style.marginTop = -a + "px";
|
||||
this.content.style.width = c + "px";
|
||||
this.content.style.height = b + "px"
|
||||
};
|
||||
this.$updateLines = function() {
|
||||
var a = this.$changedLines.firstRow, b = this.$changedLines.lastRow;
|
||||
this.$changedLines = null;
|
||||
var c = this.layerConfig;
|
||||
if(c.width != this.$getLongestLine()) {
|
||||
return this.$textLayer.update(c)
|
||||
}if(!(a > c.lastRow + 1)) {
|
||||
if(!(b < c.firstRow)) {
|
||||
if(b === Infinity) {
|
||||
this.showGutter && this.$gutterLayer.update(c);
|
||||
this.$textLayer.update(c)
|
||||
}else {
|
||||
this.$textLayer.updateLines(c, a, b)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$getLongestLine = function() {
|
||||
var a = this.doc.getScreenWidth();
|
||||
if(this.$textLayer.showInvisibles) {
|
||||
a += 1
|
||||
}return Math.max(this.$size.scrollerWidth - this.$padding * 2, Math.round(a * this.characterWidth))
|
||||
};
|
||||
this.addMarker = function(a, b, c) {
|
||||
a = this.$markerLayer.addMarker(a, b, c);
|
||||
this.$loop.schedule(this.CHANGE_MARKER);
|
||||
return a
|
||||
};
|
||||
this.removeMarker = function(a) {
|
||||
this.$markerLayer.removeMarker(a);
|
||||
this.$loop.schedule(this.CHANGE_MARKER)
|
||||
};
|
||||
this.addGutterDecoration = function(a, b) {
|
||||
this.$gutterLayer.addGutterDecoration(a, b);
|
||||
this.$loop.schedule(this.CHANGE_GUTTER)
|
||||
};
|
||||
this.removeGutterDecoration = function(a, b) {
|
||||
this.$gutterLayer.removeGutterDecoration(a, b);
|
||||
this.$loop.schedule(this.CHANGE_GUTTER)
|
||||
};
|
||||
this.setBreakpoints = function(a) {
|
||||
this.$gutterLayer.setBreakpoints(a);
|
||||
this.$loop.schedule(this.CHANGE_GUTTER)
|
||||
};
|
||||
this.updateCursor = function(a, b) {
|
||||
this.$cursorLayer.setCursor(a, b);
|
||||
this.$loop.schedule(this.CHANGE_CURSOR)
|
||||
};
|
||||
this.hideCursor = function() {
|
||||
this.$cursorLayer.hideCursor()
|
||||
};
|
||||
this.showCursor = function() {
|
||||
this.$cursorLayer.showCursor()
|
||||
};
|
||||
this.scrollCursorIntoView = function() {
|
||||
var a = this.$cursorLayer.getPixelPosition(), b = a.left + this.$padding;
|
||||
a = a.top;
|
||||
this.getScrollTop() > a && this.scrollToY(a);
|
||||
this.getScrollTop() + this.$size.scrollerHeight < a + this.lineHeight && this.scrollToY(a + this.lineHeight - this.$size.scrollerHeight);
|
||||
this.scroller.scrollLeft > b && this.scrollToX(b);
|
||||
this.scroller.scrollLeft + this.$size.scrollerWidth < b + this.characterWidth && this.scrollToX(Math.round(b + this.characterWidth - this.$size.scrollerWidth))
|
||||
};
|
||||
this.getScrollTop = function() {
|
||||
return this.scrollTop
|
||||
};
|
||||
this.getScrollLeft = function() {
|
||||
return this.scroller.scrollLeft
|
||||
};
|
||||
this.getScrollTopRow = function() {
|
||||
return this.scrollTop / this.lineHeight
|
||||
};
|
||||
this.scrollToRow = function(a) {
|
||||
this.scrollToY(a * this.lineHeight)
|
||||
};
|
||||
this.scrollToY = function(a) {
|
||||
a = Math.max(0, Math.min(this.lines.length * this.lineHeight - this.$size.scrollerHeight, a));
|
||||
if(this.scrollTop !== a) {
|
||||
this.scrollTop = a;
|
||||
this.$loop.schedule(this.CHANGE_SCROLL)
|
||||
}
|
||||
};
|
||||
this.scrollToX = function(a) {
|
||||
if(a <= this.$padding) {
|
||||
a = 0
|
||||
}this.scroller.scrollLeft = a
|
||||
};
|
||||
this.scrollBy = function(a, b) {
|
||||
b && this.scrollToY(this.scrollTop + b);
|
||||
a && this.scrollToX(this.scroller.scrollLeft + a)
|
||||
};
|
||||
this.screenToTextCoordinates = function(a, b) {
|
||||
var c = this.scroller.getBoundingClientRect();
|
||||
a = Math.round((a + this.scroller.scrollLeft - c.left - this.$padding) / this.characterWidth);
|
||||
b = Math.floor((b + this.scrollTop - c.top) / this.lineHeight);
|
||||
return{row:b, column:this.doc.screenToDocumentColumn(Math.max(0, Math.min(b, this.doc.getLength() - 1)), a)}
|
||||
};
|
||||
this.textToScreenCoordinates = function(a, b) {
|
||||
var c = this.scroller.getBoundingClientRect();
|
||||
b = this.$padding + Math.round(this.doc.documentToScreenColumn(a, b) * this.characterWidth);
|
||||
a = a * this.lineHeight;
|
||||
return{pageX:c.left + b - this.getScrollLeft(), pageY:c.top + a - this.getScrollTop()}
|
||||
};
|
||||
this.visualizeFocus = function() {
|
||||
f.addCssClass(this.container, "ace_focus")
|
||||
};
|
||||
this.visualizeBlur = function() {
|
||||
f.removeCssClass(this.container, "ace_focus")
|
||||
};
|
||||
this.showComposition = function() {
|
||||
};
|
||||
this.setCompositionText = function() {
|
||||
};
|
||||
this.hideComposition = function() {
|
||||
};
|
||||
this.setTheme = function(a) {
|
||||
function b(e) {
|
||||
c.$theme && f.removeCssClass(c.container, c.$theme);
|
||||
c.$theme = e ? e.cssClass : null;
|
||||
c.$theme && f.addCssClass(c.container, c.$theme);
|
||||
if(c.$size) {
|
||||
c.$size.width = 0;
|
||||
c.onResize()
|
||||
}
|
||||
}
|
||||
var c = this;
|
||||
if(!a || typeof a == "string") {
|
||||
a = a || "ace/theme/textmate";
|
||||
d([a], function(e) {
|
||||
b(e)
|
||||
})
|
||||
}else {
|
||||
b(a)
|
||||
}c = this
|
||||
}
|
||||
}).call(j.prototype);
|
||||
k.VirtualRenderer = j
|
||||
});
|
||||
101
build/build.txt
|
|
@ -1,101 +0,0 @@
|
|||
|
||||
demo/boot.js
|
||||
----------------
|
||||
pilot/fixoldbrowsers.js
|
||||
pilot/console.js
|
||||
pilot/useragent.js
|
||||
pilot/stacktrace.js
|
||||
pilot/promise.js
|
||||
pilot/plugin_manager.js
|
||||
pilot/oop.js
|
||||
pilot/types.js
|
||||
pilot/event_emitter.js
|
||||
pilot/catalog.js
|
||||
pilot/settings.js
|
||||
pilot/environment.js
|
||||
pilot/types/basic.js
|
||||
pilot/lang.js
|
||||
pilot/canon.js
|
||||
pilot/types/command.js
|
||||
pilot/types/settings.js
|
||||
pilot/commands/settings.js
|
||||
pilot/typecheck.js
|
||||
pilot/commands/basic.js
|
||||
pilot/settings/canon.js
|
||||
pilot/index.js
|
||||
cockpit/cli.js
|
||||
cockpit/test/assert.js
|
||||
cockpit/test/testCli.js
|
||||
cockpit/ui/settings.js
|
||||
pilot/event.js
|
||||
pilot/dom.js
|
||||
pilot/keyboard/keyutil.js
|
||||
pilot/domtemplate.js
|
||||
cockpit/ui/requestView.js
|
||||
cockpit/ui/cliView.js
|
||||
cockpit/index.js
|
||||
ace/textinput.js
|
||||
ace/conf/keybindings/default_mac.js
|
||||
ace/conf/keybindings/default_win.js
|
||||
ace/commands/default_commands.js
|
||||
ace/keybinding.js
|
||||
ace/range.js
|
||||
ace/selection.js
|
||||
ace/tokenizer.js
|
||||
ace/mode/text_highlight_rules.js
|
||||
ace/mode/text.js
|
||||
ace/document.js
|
||||
ace/search.js
|
||||
ace/background_tokenizer.js
|
||||
ace/editor.js
|
||||
ace/layer/gutter.js
|
||||
ace/layer/marker.js
|
||||
ace/layer/text.js
|
||||
ace/layer/cursor.js
|
||||
ace/scrollbar.js
|
||||
ace/renderloop.js
|
||||
ace/virtual_renderer.js
|
||||
ace/theme/textmate.js
|
||||
ace/mode/doc_comment_highlight_rules.js
|
||||
ace/mode/javascript_highlight_rules.js
|
||||
ace/mode/matching_brace_outdent.js
|
||||
ace/mode/javascript.js
|
||||
ace/mode/css_highlight_rules.js
|
||||
ace/mode/css.js
|
||||
ace/mode/html_highlight_rules.js
|
||||
ace/mode/html.js
|
||||
ace/mode/xml_highlight_rules.js
|
||||
ace/mode/xml.js
|
||||
ace/mode/python_highlight_rules.js
|
||||
ace/mode/python.js
|
||||
ace/mode/php_highlight_rules.js
|
||||
ace/mode/php.js
|
||||
ace/undomanager.js
|
||||
demo/startup.js
|
||||
demo/boot.js
|
||||
|
||||
ace/theme/eclipse.js
|
||||
----------------
|
||||
ace/theme/eclipse.js
|
||||
|
||||
ace/mode/xml.js
|
||||
----------------
|
||||
ace/mode/xml_highlight_rules.js
|
||||
ace/mode/xml.js
|
||||
|
||||
ace/mode/css.js
|
||||
----------------
|
||||
ace/mode/css_highlight_rules.js
|
||||
ace/mode/matching_brace_outdent.js
|
||||
ace/mode/css.js
|
||||
|
||||
ace/mode/html.js
|
||||
----------------
|
||||
ace/mode/html_highlight_rules.js
|
||||
ace/mode/html.js
|
||||
|
||||
ace/mode/python.js
|
||||
----------------
|
||||
ace/mode/python_highlight_rules.js
|
||||
ace/mode/matching_brace_outdent.js
|
||||
ace/mode/python.js
|
||||
|
|
@ -1,427 +0,0 @@
|
|||
define(function(l, o) {
|
||||
function j(b, a, c, d, e) {
|
||||
this.status = b;
|
||||
this.message = a;
|
||||
if(typeof c === "number") {
|
||||
this.start = c;
|
||||
this.end = d;
|
||||
this.predictions = e
|
||||
}else {
|
||||
this.start = c.start;
|
||||
this.end = c.end;
|
||||
this.predictions = c.predictions
|
||||
}
|
||||
}
|
||||
function u(b, a) {
|
||||
this.status = b.status;
|
||||
this.message = b.message;
|
||||
if(a) {
|
||||
this.start = a.start;
|
||||
this.end = a.end
|
||||
}else {
|
||||
this.end = this.start = 0
|
||||
}this.predictions = b.predictions
|
||||
}
|
||||
function h(b, a, c, d, e) {
|
||||
this.emitter = b;
|
||||
this.setText(a);
|
||||
this.start = c;
|
||||
this.end = d;
|
||||
this.priorSpace = e
|
||||
}
|
||||
function q(b, a) {
|
||||
this.param = b;
|
||||
this.requisition = a;
|
||||
this.setValue(b.defaultValue)
|
||||
}
|
||||
function p(b) {
|
||||
this.env = b;
|
||||
this.commandAssignment = new q(s, this)
|
||||
}
|
||||
function i(b, a) {
|
||||
p.call(this, b);
|
||||
if(a && a.flags) {
|
||||
this.flags = a.flags
|
||||
}
|
||||
}
|
||||
l("pilot/console");
|
||||
var v = l("pilot/lang"), r = l("pilot/oop"), w = l("pilot/event_emitter").EventEmitter;
|
||||
l("pilot/types");
|
||||
var k = l("pilot/types").Status;
|
||||
l("pilot/types");
|
||||
var t = l("pilot/canon");
|
||||
o.startup = function() {
|
||||
t.upgradeType("command", s)
|
||||
};
|
||||
j.prototype = {};
|
||||
j.sort = function(b, a) {
|
||||
a !== undefined && b.forEach(function(c) {
|
||||
c.distance = c.start === h.AT_CURSOR ? 0 : a < c.start ? c.start - a : a > c.end ? a - c.end : 0
|
||||
}, this);
|
||||
b.sort(function(c, d) {
|
||||
if(a !== undefined) {
|
||||
var e = c.distance - d.distance;
|
||||
if(e != 0) {
|
||||
return e
|
||||
}
|
||||
}return d.status - c.status
|
||||
});
|
||||
a !== undefined && b.forEach(function(c) {
|
||||
delete c.distance
|
||||
}, this);
|
||||
return b
|
||||
};
|
||||
o.Hint = j;
|
||||
r.inherits(u, j);
|
||||
h.prototype = {merge:function(b) {
|
||||
if(b.emitter != this.emitter) {
|
||||
throw new Error("Can't merge Arguments from different EventEmitters");
|
||||
}return new h(this.emitter, this.text + b.priorSpace + b.text, this.start, b.end, this.priorSpace)
|
||||
}, setText:function(b) {
|
||||
if(b == null) {
|
||||
throw new Error("Illegal text for Argument: " + b);
|
||||
}var a = {argument:this, oldText:this.text, text:b};
|
||||
this.text = b;
|
||||
this.emitter._dispatchEvent("argumentChange", a)
|
||||
}, toString:function() {
|
||||
return this.priorSpace + this.text
|
||||
}};
|
||||
h.merge = function(b, a, c) {
|
||||
a = a === undefined ? 0 : a;
|
||||
c = c === undefined ? b.length : c;
|
||||
var d;
|
||||
for(a = a;a < c;a++) {
|
||||
var e = b[a];
|
||||
d = d ? d.merge(e) : e
|
||||
}return d
|
||||
};
|
||||
h.AT_CURSOR = -1;
|
||||
q.prototype = {param:undefined, conversion:undefined, value:undefined, arg:undefined, value:undefined, setValue:function(b) {
|
||||
if(this.value !== b) {
|
||||
if(b === undefined) {
|
||||
b = this.param.defaultValue;
|
||||
this.arg = undefined
|
||||
}this.value = b;
|
||||
b = b == null ? "" : this.param.type.stringify(b);
|
||||
this.arg && this.arg.setText(b);
|
||||
this.conversion = undefined;
|
||||
this.requisition._assignmentChanged(this)
|
||||
}
|
||||
}, arg:undefined, setArgument:function(b) {
|
||||
if(this.arg !== b) {
|
||||
this.arg = b;
|
||||
this.conversion = this.param.type.parse(b.text);
|
||||
this.conversion.arg = b;
|
||||
this.value = this.conversion.value;
|
||||
this.requisition._assignmentChanged(this)
|
||||
}
|
||||
}, getHint:function() {
|
||||
if(this.param.getCustomHint && this.value && this.arg) {
|
||||
var b = this.param.getCustomHint(this.value, this.arg);
|
||||
if(b) {
|
||||
return b
|
||||
}
|
||||
}b = "<strong>" + this.param.name + "</strong>: ";
|
||||
if(this.param.description) {
|
||||
b += this.param.description.trim();
|
||||
if(b.charAt(b.length - 1) !== ".") {
|
||||
b += "."
|
||||
}if(b.charAt(b.length - 1) !== " ") {
|
||||
b += " "
|
||||
}
|
||||
}var a = k.VALID, c = this.arg ? this.arg.start : h.AT_CURSOR, d = this.arg ? this.arg.end : h.AT_CURSOR, e;
|
||||
if(this.conversion) {
|
||||
a = this.conversion.status;
|
||||
if(this.conversion.message) {
|
||||
b += this.conversion.message
|
||||
}e = this.conversion.predictions
|
||||
}var f = this.arg && this.arg.text !== "";
|
||||
f = this.value !== undefined || f;
|
||||
if(this.param.defaultValue === undefined && !f) {
|
||||
a = k.INVALID;
|
||||
b += "<strong>Required<strong>"
|
||||
}return new j(a, b, c, d, e)
|
||||
}, complete:function() {
|
||||
this.conversion && this.conversion.predictions && this.conversion.predictions.length > 0 && this.setValue(this.conversion.predictions[0])
|
||||
}, decrement:function() {
|
||||
var b = this.param.type.decrement(this.value);
|
||||
b != null && this.setValue(b)
|
||||
}, increment:function() {
|
||||
var b = this.param.type.increment(this.value);
|
||||
b != null && this.setValue(b)
|
||||
}, toString:function() {
|
||||
return this.arg ? this.arg.toString() : ""
|
||||
}};
|
||||
o.Assignment = q;
|
||||
var s = {name:"command", type:"command", description:"The command to execute", getCustomHint:function(b, a) {
|
||||
var c = [];
|
||||
c.push("<strong><tt> > ");
|
||||
c.push(b.name);
|
||||
b.params && b.params.length > 0 && b.params.forEach(function(d) {
|
||||
d.defaultValue === undefined ? c.push(" [" + d.name + "]") : c.push(" <em>[" + d.name + "]</em>")
|
||||
}, this);
|
||||
c.push("</tt></strong><br/>");
|
||||
c.push(b.description ? b.description : "(No description)");
|
||||
c.push("<br/>");
|
||||
if(b.params && b.params.length > 0) {
|
||||
c.push("<ul>");
|
||||
b.params.forEach(function(d) {
|
||||
c.push("<li>");
|
||||
c.push("<strong><tt>" + d.name + "</tt></strong>: ");
|
||||
c.push(d.description ? d.description : "(No description)");
|
||||
if(d.defaultValue === undefined) {
|
||||
c.push(" <em>[Required]</em>")
|
||||
}else {
|
||||
d.defaultValue === null ? c.push(" <em>[Optional]</em>") : c.push(" <em>[Default: " + d.defaultValue + "]</em>")
|
||||
}c.push("</li>")
|
||||
}, this);
|
||||
c.push("</ul>")
|
||||
}return new j(k.VALID, c.join(""), a)
|
||||
}};
|
||||
p.prototype = {commandAssignment:undefined, assignmentCount:undefined, _assignments:undefined, _hints:undefined, _assignmentChanged:function(b) {
|
||||
if(b.param.name === "command") {
|
||||
this._assignments = {};
|
||||
b.value && b.value.params.forEach(function(a) {
|
||||
this._assignments[a.name] = new q(a, this)
|
||||
}, this);
|
||||
this.assignmentCount = Object.keys(this._assignments).length;
|
||||
this._dispatchEvent("commandChange", {command:b.value})
|
||||
}
|
||||
}, getAssignment:function(b) {
|
||||
return this._assignments[typeof b === "string" ? b : Object.keys(this._assignments)[b]]
|
||||
}, getParameterNames:function() {
|
||||
return Object.keys(this._assignments)
|
||||
}, cloneAssignments:function() {
|
||||
return Object.keys(this._assignments).map(function(b) {
|
||||
return this._assignments[b]
|
||||
}, this)
|
||||
}, _updateHints:function() {
|
||||
this._hints.push(this.commandAssignment.getHint());
|
||||
Object.keys(this._assignments).map(function(b) {
|
||||
b = this._assignments[b];
|
||||
b.arg && this._hints.push(b.getHint())
|
||||
}, this);
|
||||
j.sort(this._hints)
|
||||
}, getWorstHint:function() {
|
||||
return this._hints[0]
|
||||
}, getArgs:function() {
|
||||
var b = {};
|
||||
Object.keys(this._assignments).forEach(function(a) {
|
||||
b[a] = this.getAssignment(a).value
|
||||
}, this);
|
||||
return b
|
||||
}, setDefaultValues:function() {
|
||||
Object.keys(this._assignments).forEach(function(b) {
|
||||
this._assignments[b].setValue(undefined)
|
||||
}, this)
|
||||
}, exec:function() {
|
||||
t.exec(this.commandAssignment.value, this.env, this.getArgs(), this.toCanonicalString())
|
||||
}, toCanonicalString:function() {
|
||||
var b = [];
|
||||
b.push(this.commandAssignment.value.name);
|
||||
Object.keys(this._assignments).forEach(function(a) {
|
||||
a = this._assignments[a];
|
||||
var c = a.param.type;
|
||||
if(a.value !== a.param.defaultValue) {
|
||||
b.push(" ");
|
||||
b.push(c.stringify(a.value))
|
||||
}
|
||||
}, this);
|
||||
return b.join("")
|
||||
}};
|
||||
r.implement(p.prototype, w);
|
||||
o.Requisition = p;
|
||||
r.inherits(i, p);
|
||||
(function() {
|
||||
i.prototype.update = function(a) {
|
||||
this.input = a;
|
||||
this._hints = [];
|
||||
a = this._tokenize(a.typed);
|
||||
this._split(a);
|
||||
this.commandAssignment.value && this._assign(a);
|
||||
this._updateHints()
|
||||
};
|
||||
i.prototype.getInputStatusMarkup = function() {
|
||||
var a = this.toString().split("").map(function() {
|
||||
return k.VALID
|
||||
});
|
||||
this._hints.forEach(function(c) {
|
||||
for(var d = c.start;d <= c.end;d++) {
|
||||
if(c.status > a[d]) {
|
||||
a[d] = c.status
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
return a
|
||||
};
|
||||
i.prototype.toString = function() {
|
||||
var a = Object.keys(this._assignments).map(function(c) {
|
||||
return this._assignments[c].toString()
|
||||
}, this);
|
||||
a.unshift(this.commandAssignment.toString());
|
||||
return a.join("")
|
||||
};
|
||||
var b = i.prototype._updateHints;
|
||||
i.prototype._updateHints = function() {
|
||||
b.call(this);
|
||||
var a = this.input.cursor;
|
||||
this._hints.forEach(function(c) {
|
||||
var d = a.end >= c.start && a.end <= c.end;
|
||||
if(!(a.start >= c.start && a.start <= c.end || d) && c.status === k.INCOMPLETE) {
|
||||
c.status = k.INVALID
|
||||
}
|
||||
}, this);
|
||||
j.sort(this._hints)
|
||||
};
|
||||
i.prototype.getHints = function() {
|
||||
return this._hints
|
||||
};
|
||||
i.prototype.getAssignmentAt = function(a) {
|
||||
var c = this.commandAssignment.arg;
|
||||
if(c && a <= c.end) {
|
||||
return this.commandAssignment
|
||||
}c = Object.keys(this._assignments);
|
||||
for(var d = 0;d < c.length;d++) {
|
||||
var e = this._assignments[c[d]];
|
||||
if(e.arg && a <= e.arg.end) {
|
||||
return e
|
||||
}
|
||||
}throw new Error("position (" + a + ") is off end of requisition (" + this.toString() + ")");
|
||||
};
|
||||
i.prototype._tokenize = function(a) {
|
||||
function c(x) {
|
||||
return x.replace(/\uF000/g, " ").replace(/\uF001/g, "'").replace(/\uF002/g, '"')
|
||||
}
|
||||
if(a == null || a.length === 0) {
|
||||
return[new h(this, "", 0, 0, "")]
|
||||
}var d = 1;
|
||||
a = a.replace(/\\\\/g, "\\").replace(/\\b/g, "\u0008").replace(/\\f/g, "\u000c").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\v/g, "\u000b").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\ /g, "\uf000").replace(/\\'/g, "\uf001").replace(/\\"/g, "\uf002");
|
||||
for(var e = 0, f = 0, g = "", m = [];;) {
|
||||
if(e >= a.length) {
|
||||
if(d !== 1) {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g))
|
||||
}else {
|
||||
if(e !== f) {
|
||||
g = a.substring(f, e);
|
||||
m.push(new h(this, "", e, e, g))
|
||||
}
|
||||
}break
|
||||
}var n = a[e];
|
||||
switch(d) {
|
||||
case 1:
|
||||
if(n === "'") {
|
||||
g = a.substring(f, e);
|
||||
d = 3;
|
||||
f = e + 1
|
||||
}else {
|
||||
if(n === '"') {
|
||||
g = a.substring(f, e);
|
||||
d = 4;
|
||||
f = e + 1
|
||||
}else {
|
||||
if(!/ /.test(n)) {
|
||||
g = a.substring(f, e);
|
||||
d = 2;
|
||||
f = e
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
if(n === " ") {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e;
|
||||
g = ""
|
||||
}break;
|
||||
case 3:
|
||||
if(n === "'") {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e + 1;
|
||||
g = ""
|
||||
}break;
|
||||
case 4:
|
||||
if(n === '"') {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e + 1;
|
||||
g = ""
|
||||
}break
|
||||
}
|
||||
e++
|
||||
}return m
|
||||
};
|
||||
i.prototype._split = function(a) {
|
||||
for(var c = 1, d;c <= a.length;) {
|
||||
d = h.merge(a, 0, c);
|
||||
this.commandAssignment.setArgument(d);
|
||||
if(!this.commandAssignment.value) {
|
||||
break
|
||||
}if(this.commandAssignment.value.exec) {
|
||||
for(d = 0;d < c;d++) {
|
||||
a.shift()
|
||||
}break
|
||||
}c++
|
||||
}
|
||||
};
|
||||
i.prototype._assign = function(a) {
|
||||
if(a.length === 0) {
|
||||
this.setDefaultValues()
|
||||
}else {
|
||||
if(this.assignmentCount === 0) {
|
||||
this._hints.push(new j(k.INVALID, this.commandAssignment.value.name + " does not take any parameters", h.merge(a)))
|
||||
}else {
|
||||
if(this.assignmentCount === 1) {
|
||||
var c = this.getAssignment(0);
|
||||
if(c.param.type.name === "text") {
|
||||
c.setArgument(h.merge(a));
|
||||
return
|
||||
}
|
||||
}c = this.cloneAssignments();
|
||||
var d = this.getParameterNames();
|
||||
c.forEach(function(e) {
|
||||
for(var f = "--" + e.name, g = 0;;) {
|
||||
if(f !== a[g].text) {
|
||||
g++;
|
||||
if(g >= a.length) {
|
||||
break
|
||||
}
|
||||
}else {
|
||||
if(e.param.type.name === "boolean") {
|
||||
e.setValue(true)
|
||||
}else {
|
||||
if(g + 1 < a.length) {
|
||||
this._hints.push(new j(k.INCOMPLETE, "Missing value for: " + f, a[g]))
|
||||
}else {
|
||||
a.splice(g + 1, 1);
|
||||
e.setArgument(a[g + 1])
|
||||
}
|
||||
}v.arrayRemove(d, e.name);
|
||||
a.splice(g, 1)
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
d.forEach(function(e) {
|
||||
e = this.getAssignment(e);
|
||||
if(a.length === 0) {
|
||||
e.setValue(undefined)
|
||||
}else {
|
||||
var f = a[0];
|
||||
a.splice(0, 1);
|
||||
e.setArgument(f)
|
||||
}
|
||||
}, this);
|
||||
if(a.length > 0) {
|
||||
c = h.merge(a);
|
||||
this._hints.push(new j(k.INVALID, "Input '" + c.text + "' makes no sense.", c))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
o.CliRequisition = i
|
||||
});
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
define(function(a, d) {
|
||||
d.startup = function(b, c) {
|
||||
a("pilot/index");
|
||||
a("cockpit/cli").startup(b, c);
|
||||
window.testCli = a("cockpit/test/testCli");
|
||||
a("cockpit/ui/settings").startup(b, c);
|
||||
a("cockpit/ui/cliView").startup(b, c)
|
||||
}
|
||||
});
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
define(function(i, h) {
|
||||
var c = {success:function(a) {
|
||||
console.log(a)
|
||||
}, fail:function() {
|
||||
c._recordThrow("fail", arguments)
|
||||
}, assertTrue:function(a) {
|
||||
a || c._recordThrow("assertTrue", arguments)
|
||||
}, verifyTrue:function(a) {
|
||||
a || c._recordTrace("verifyTrue", arguments)
|
||||
}, assertFalse:function(a) {
|
||||
a && c._recordThrow("assertFalse", arguments)
|
||||
}, verifyFalse:function(a) {
|
||||
a && c._recordTrace("verifyFalse", arguments)
|
||||
}, assertNull:function(a) {
|
||||
a !== null && c._recordThrow("assertNull", arguments)
|
||||
}, verifyNull:function(a) {
|
||||
a !== null && c._recordTrace("verifyNull", arguments)
|
||||
}, assertNotNull:function(a) {
|
||||
a === null && c._recordThrow("assertNotNull", arguments)
|
||||
}, verifyNotNull:function(a) {
|
||||
a === null && c._recordTrace("verifyNotNull", arguments)
|
||||
}, assertUndefined:function(a) {
|
||||
a !== undefined && c._recordThrow("assertUndefined", arguments)
|
||||
}, verifyUndefined:function(a) {
|
||||
a !== undefined && c._recordTrace("verifyUndefined", arguments)
|
||||
}, assertNotUndefined:function(a) {
|
||||
a === undefined && c._recordThrow("assertNotUndefined", arguments)
|
||||
}, verifyNotUndefined:function(a) {
|
||||
a === undefined && c._recordTrace("verifyNotUndefined", arguments)
|
||||
}, assertNaN:function(a) {
|
||||
isNaN(a) || c._recordThrow("assertNaN", arguments)
|
||||
}, verifyNaN:function(a) {
|
||||
isNaN(a) || c._recordTrace("verifyNaN", arguments)
|
||||
}, assertNotNaN:function(a) {
|
||||
isNaN(a) && c._recordThrow("assertNotNaN", arguments)
|
||||
}, verifyNotNaN:function(a) {
|
||||
isNaN(a) && c._recordTrace("verifyNotNaN", arguments)
|
||||
}, assertEqual:function(a, b) {
|
||||
c._isEqual(a, b) || c._recordThrow("assertEqual", arguments)
|
||||
}, verifyEqual:function(a, b) {
|
||||
c._isEqual(a, b) || c._recordTrace("verifyEqual", arguments)
|
||||
}, assertNotEqual:function(a, b) {
|
||||
c._isEqual(a, b) && c._recordThrow("assertNotEqual", arguments)
|
||||
}, verifyNotEqual:function(a, b) {
|
||||
c._isEqual(a, b) && c._recordTrace("verifyNotEqual", arguments)
|
||||
}, assertSame:function(a, b) {
|
||||
a !== b && c._recordThrow("assertSame", arguments)
|
||||
}, verifySame:function(a, b) {
|
||||
a !== b && c._recordTrace("verifySame", arguments)
|
||||
}, assertNotSame:function(a, b) {
|
||||
a !== b && c._recordThrow("assertNotSame", arguments)
|
||||
}, verifyNotSame:function(a, b) {
|
||||
a !== b && c._recordTrace("verifyNotSame", arguments)
|
||||
}, _recordTrace:function() {
|
||||
c._record.apply(this, arguments);
|
||||
console.trace()
|
||||
}, _recordThrow:function() {
|
||||
c._record.apply(this, arguments);
|
||||
throw new Error;
|
||||
}, _record:function() {
|
||||
console.error(arguments);
|
||||
var a = arguments[0] + "(", b = arguments[1];
|
||||
if(typeof b == "string") {
|
||||
a += b
|
||||
}else {
|
||||
for(var d = 0;d < b.length;d++) {
|
||||
if(d != 0) {
|
||||
a += ", "
|
||||
}a += b[d]
|
||||
}
|
||||
}a += ")";
|
||||
console.log(a)
|
||||
}, _isEqual:function(a, b, d) {
|
||||
d || (d = 0);
|
||||
if(d > 10) {
|
||||
return true
|
||||
}if(a == null) {
|
||||
if(b != null) {
|
||||
console.log("expected: null, actual non-null: ", b);
|
||||
return false
|
||||
}return true
|
||||
}if(typeof a == "number" && isNaN(a)) {
|
||||
if(!(typeof b == "number" && isNaN(b))) {
|
||||
console.log("expected: NaN, actual non-NaN: ", b);
|
||||
return false
|
||||
}return true
|
||||
}if(b == null) {
|
||||
if(a != null) {
|
||||
console.log("actual: null, expected non-null: ", a);
|
||||
return false
|
||||
}return true
|
||||
}if(typeof a == "object") {
|
||||
if(typeof b != "object") {
|
||||
console.log("expected object, actual not an object");
|
||||
return false
|
||||
}var f = 0;
|
||||
for(var e in b) {
|
||||
if(typeof b[e] != "function" || typeof a[e] != "function") {
|
||||
var g = c._isEqual(b[e], a[e], d + 1);
|
||||
if(typeof g != "boolean" || !g) {
|
||||
console.log("element '" + e + "' does not match: " + g);
|
||||
return false
|
||||
}
|
||||
}f++
|
||||
}b = 0;
|
||||
for(e in a) {
|
||||
b++
|
||||
}if(f != b) {
|
||||
console.log("expected object size = " + b + ", actual object size = " + f);
|
||||
return false
|
||||
}return true
|
||||
}if(b != a) {
|
||||
console.log("expected = " + a + " (type=" + typeof a + "), actual = " + b + " (type=" + typeof b + ")");
|
||||
return false
|
||||
}if(a instanceof Array) {
|
||||
if(!(b instanceof Array)) {
|
||||
console.log("expected array, actual not an array");
|
||||
return false
|
||||
}if(b.length != a.length) {
|
||||
console.log("expected array length = " + a.length + ", actual array length = " + b.length);
|
||||
return false
|
||||
}for(f = 0;f < b.length;f++) {
|
||||
e = c._isEqual(b[f], a[f], d + 1);
|
||||
if(typeof e != "boolean" || !e) {
|
||||
console.log("element " + f + " does not match: " + e);
|
||||
return false
|
||||
}
|
||||
}return true
|
||||
}return true
|
||||
}};
|
||||
h.test = c
|
||||
});
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
define(function(l, j) {
|
||||
var a = l("cockpit/test/assert").test, i = l("pilot/types").Status, r = l("pilot/settings").settings;
|
||||
l("cockpit/cli");
|
||||
l("cockpit/cli");
|
||||
var n = l("cockpit/cli").CliRequisition;
|
||||
j.testAll = function() {
|
||||
j.testTokenize();
|
||||
j.testSplit();
|
||||
j.testCli();
|
||||
return"testAll Completed"
|
||||
};
|
||||
j.testTokenize = function() {
|
||||
var b, e = new n;
|
||||
b = e._tokenize("");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(0, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
b = e._tokenize("s");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
b = e._tokenize(" ");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("", b[0].text);
|
||||
a.verifyEqual(1, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual(" ", b[0].priorSpace);
|
||||
b = e._tokenize("s s");
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("s", b[1].text);
|
||||
a.verifyEqual(2, b[1].start);
|
||||
a.verifyEqual(3, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
b = e._tokenize(" 1234 '12 34'");
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("1234", b[0].text);
|
||||
a.verifyEqual(1, b[0].start);
|
||||
a.verifyEqual(5, b[0].end);
|
||||
a.verifyEqual(" ", b[0].priorSpace);
|
||||
a.verifyEqual("12 34", b[1].text);
|
||||
a.verifyEqual(8, b[1].start);
|
||||
a.verifyEqual(13, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
b = e._tokenize('12\'34 "12 34" \\');
|
||||
a.verifyEqual(3, b.length);
|
||||
a.verifyEqual("12'34", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(5, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("12 34", b[1].text);
|
||||
a.verifyEqual(7, b[1].start);
|
||||
a.verifyEqual(12, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
a.verifyEqual("\\", b[2].text);
|
||||
a.verifyEqual(14, b[2].start);
|
||||
a.verifyEqual(15, b[2].end);
|
||||
a.verifyEqual(" ", b[2].priorSpace);
|
||||
b = e._tokenize("a\\ b \\t\\n\\r \\'x\\\" 'd");
|
||||
a.verifyEqual(4, b.length);
|
||||
a.verifyEqual("a b", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(3, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("\t\n\r", b[1].text);
|
||||
a.verifyEqual(4, b[1].start);
|
||||
a.verifyEqual(7, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
a.verifyEqual("'x\"", b[2].text);
|
||||
a.verifyEqual(8, b[2].start);
|
||||
a.verifyEqual(11, b[2].end);
|
||||
a.verifyEqual(" ", b[2].priorSpace);
|
||||
a.verifyEqual("d", b[3].text);
|
||||
a.verifyEqual(13, b[3].start);
|
||||
a.verifyEqual(14, b[3].end);
|
||||
a.verifyEqual(" ", b[3].priorSpace);
|
||||
return"testTokenize Completed"
|
||||
};
|
||||
j.testSplit = function() {
|
||||
var b, e = new n;
|
||||
b = e._tokenize("s");
|
||||
e._split(b);
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyNull(e.commandAssignment.value);
|
||||
b = e._tokenize("set");
|
||||
e._split(b);
|
||||
a.verifyEqual([], b);
|
||||
a.verifyEqual("set", e.commandAssignment.value.name);
|
||||
b = e._tokenize("set a b");
|
||||
e._split(b);
|
||||
a.verifyEqual("set", e.commandAssignment.value.name);
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("a", b[0].text);
|
||||
a.verifyEqual("b", b[1].text);
|
||||
return"testSplit Completed"
|
||||
};
|
||||
j.testCli = function() {
|
||||
function b(k) {
|
||||
d.update(k);
|
||||
s && console.log('####### TEST: typed="' + k.typed + '" cur=' + k.cursor.start + " cli=", d);
|
||||
f = d.getWorstHint();
|
||||
c = d.getAssignmentAt(k.cursor.start).getHint();
|
||||
h = d.getInputStatusMarkup().map(function(o) {
|
||||
return o.valueOf()
|
||||
}).join("");
|
||||
if(d.commandAssignment.value && d.commandAssignment.value.name === "set") {
|
||||
g = d.getAssignment("setting");
|
||||
m = d.getAssignment("value")
|
||||
}else {
|
||||
m = g = undefined
|
||||
}
|
||||
}
|
||||
function e(k, o) {
|
||||
return o.every(function(q) {
|
||||
return k === q || k === q.name
|
||||
}, this)
|
||||
}
|
||||
var g, m, d = new n, s = true, f, c, h, p = r.getSetting("historyLength");
|
||||
b({typed:"", cursor:{start:0, end:0}});
|
||||
a.verifyEqual("", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(0, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:" ", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("0", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(1, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:" ", cursor:{start:0, end:0}});
|
||||
a.verifyEqual("0", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(1, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:"s", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("1", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyTrue(c.predictions.length > 0);
|
||||
a.verifyTrue(c.predictions.length < 20);
|
||||
e("set", c.predictions);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:"set", cursor:{start:3, end:3}});
|
||||
a.verifyEqual("000", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set ", cursor:{start:4, end:4}});
|
||||
a.verifyEqual("0000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(4, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set ", cursor:{start:2, end:2}});
|
||||
a.verifyEqual("0000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set h", cursor:{start:5, end:5}});
|
||||
a.verifyEqual("00001", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(5, c.end);
|
||||
a.verifyTrue(c.predictions.length > 0);
|
||||
e("historyLength", c.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("h", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt", cursor:{start:16, end:16}});
|
||||
a.verifyEqual("0000111111111111", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(16, c.end);
|
||||
a.verifyEqual(1, c.predictions.length);
|
||||
e("historyLength", c.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("0000222222222222", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual(i.INVALID, f.status);
|
||||
a.verifyEqual(4, f.start);
|
||||
a.verifyEqual(16, f.end);
|
||||
a.verifyEqual(1, f.predictions.length);
|
||||
e("historyLength", f.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt ", cursor:{start:17, end:17}});
|
||||
a.verifyEqual("00002222222222222", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(17, c.start);
|
||||
a.verifyEqual(17, c.end);
|
||||
a.verifyEqual(i.INVALID, f.status);
|
||||
a.verifyEqual(4, f.start);
|
||||
a.verifyEqual(16, f.end);
|
||||
a.verifyEqual(1, f.predictions.length);
|
||||
e("historyLength", f.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLength", cursor:{start:17, end:17}});
|
||||
a.verifyEqual("00000000000000000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
b({typed:"set historyLength ", cursor:{start:18, end:18}});
|
||||
a.verifyEqual("000000000000000000", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
b({typed:"set historyLength 6", cursor:{start:19, end:19}});
|
||||
a.verifyEqual("0000000000000000000", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
a.verifyEqual("6", m.arg.text);
|
||||
a.verifyEqual(6, m.value);
|
||||
a.verifyEqual("number", typeof m.value);
|
||||
return"testCli Completed"
|
||||
}
|
||||
});
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
define(function() {
|
||||
});
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
|
||||
#cockpitInput { padding-left: 16px; }
|
||||
#cockpitOutput { overflow: auto; }
|
||||
#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }
|
||||
.cptFocusPopup { display: none; }
|
||||
#cockpitInput:focus ~ .cptFocusPopup { display: block; }
|
||||
#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }
|
||||
.cptCompletion { padding: 0; position: absolute; z-index: -1000; }
|
||||
.cptCompletion.VALID { background: #FFF; }
|
||||
.cptCompletion.INCOMPLETE { background: #DDD; }
|
||||
.cptCompletion.INVALID { background: #DDD; }
|
||||
.cptCompletion span { color: #FFF; }
|
||||
.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }
|
||||
.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }
|
||||
span.cptPrompt { color: #66F; font-weight: bold; }
|
||||
.cptHints {
|
||||
color: #000;
|
||||
position: absolute;
|
||||
border: 1px solid rgba(230, 230, 230, 0.8);
|
||||
background: rgba(250, 250, 250, 0.8);
|
||||
-moz-border-radius-topleft: 10px;
|
||||
-moz-border-radius-topright: 10px;
|
||||
border-top-left-radius: 10px; border-top-right-radius: 10px;
|
||||
z-index: 1000;
|
||||
padding: 8px;
|
||||
display: none;
|
||||
}
|
||||
.cptHints ul { margin: 0; padding: 0 15px; }
|
||||
.cptGt { font-weight: bold; font-size: 120%; }
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
define(function(f, m) {
|
||||
function i(a, b) {
|
||||
this.cli = a;
|
||||
this.doc = document;
|
||||
this.win = d.getParentWindow(this.doc);
|
||||
if(this.element = this.doc.getElementById("cockpitInput")) {
|
||||
this.settings = b.settings;
|
||||
this.hintDirection = this.settings.getSetting("hintDirection");
|
||||
this.outputDirection = this.settings.getSetting("outputDirection");
|
||||
this.outputHeight = this.settings.getSetting("outputHeight");
|
||||
this.isUpdating = false;
|
||||
this.createElements();
|
||||
this.update()
|
||||
}else {
|
||||
console.log("No element with an id of cockpit. Bailing on cli")
|
||||
}
|
||||
}
|
||||
var j = f("text!cockpit/ui/cliView.css!\n#cockpitInput { padding-left: 16px; }\n\n#cockpitOutput { overflow: auto; }\n#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }\n\n.cptFocusPopup { display: none; }\n#cockpitInput:focus ~ .cptFocusPopup { display: block; }\n#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }\n\n.cptCompletion { padding: 0; position: absolute; z-index: -1000; }\n.cptCompletion.VALID { background: #FFF; }\n.cptCompletion.INCOMPLETE { background: #DDD; }\n.cptCompletion.INVALID { background: #DDD; }\n.cptCompletion span { color: #FFF; }\n.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }\n.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }\nspan.cptPrompt { color: #66F; font-weight: bold; }\n\n\n.cptHints {\n color: #000;\n position: absolute;\n border: 1px solid rgba(230, 230, 230, 0.8);\n background: rgba(250, 250, 250, 0.8);\n -moz-border-radius-topleft: 10px;\n -moz-border-radius-topright: 10px;\n border-top-left-radius: 10px; border-top-right-radius: 10px;\n z-index: 1000;\n padding: 8px;\n display: none;\n}\n.cptHints ul { margin: 0; padding: 0 15px; }\n\n.cptGt { font-weight: bold; font-size: 120%; }\n"),
|
||||
k = f("pilot/event"), d = f("pilot/dom");
|
||||
d.importCssString(j);
|
||||
var n = f("pilot/canon"), h = f("pilot/types").Status, g = f("pilot/keyboard/keyutil"), o = f("cockpit/cli").CliRequisition;
|
||||
j = f("cockpit/cli").Hint;
|
||||
var p = f("cockpit/ui/requestView").RequestView;
|
||||
new j(h.VALID, "", 0, 0);
|
||||
m.startup = function(a) {
|
||||
var b = new o(a.env);
|
||||
new i(b, a.env)
|
||||
};
|
||||
i.prototype = {createElements:function() {
|
||||
var a = this.element;
|
||||
this.output = this.doc.getElementById("cockpitOutput");
|
||||
this.popupOutput = this.output == null;
|
||||
if(!this.output) {
|
||||
this.output = this.doc.createElement("div");
|
||||
this.output.id = "cockpitOutput";
|
||||
this.output.className = "cptFocusPopup";
|
||||
a.parentNode.insertBefore(this.output, a.nextSibling);
|
||||
var b = function() {
|
||||
this.output.style.maxHeight = this.outputHeight.get() + "px"
|
||||
}.bind(this);
|
||||
this.outputHeight.addEventListener("change", b);
|
||||
b()
|
||||
}this.completer = this.doc.createElement("div");
|
||||
this.completer.className = "cptCompletion VALID";
|
||||
this.completer.style.color = d.computedStyle(a, "color");
|
||||
this.completer.style.fontSize = d.computedStyle(a, "fontSize");
|
||||
this.completer.style.fontFamily = d.computedStyle(a, "fontFamily");
|
||||
this.completer.style.fontWeight = d.computedStyle(a, "fontWeight");
|
||||
this.completer.style.fontStyle = d.computedStyle(a, "fontStyle");
|
||||
a.parentNode.insertBefore(this.completer, a.nextSibling);
|
||||
this.completer.style.backgroundColor = a.style.backgroundColor;
|
||||
a.style.backgroundColor = "transparent";
|
||||
this.hinter = this.doc.createElement("div");
|
||||
this.hinter.className = "cptHints cptFocusPopup";
|
||||
a.parentNode.insertBefore(this.hinter, a.nextSibling);
|
||||
b = this.resizer.bind(this);
|
||||
k.addListener(this.win, "resize", b);
|
||||
this.hintDirection.addEventListener("change", b);
|
||||
this.outputDirection.addEventListener("change", b);
|
||||
b();
|
||||
n.addEventListener("output", function(c) {
|
||||
new p(c.request, this)
|
||||
}.bind(this));
|
||||
g.addKeyDownListener(a, this.onKeyDown.bind(this));
|
||||
k.addListener(a, "keyup", this.onKeyUp.bind(this));
|
||||
k.addListener(a, "mouseup", function() {
|
||||
this.isUpdating = true;
|
||||
this.update();
|
||||
this.isUpdating = false
|
||||
}.bind(this));
|
||||
this.cli.addEventListener("argumentChange", this.onArgChange.bind(this))
|
||||
}, scrollOutputToBottom:function() {
|
||||
this.output.scrollTop = Math.max(this.output.scrollHeight, this.output.clientHeight) - this.output.clientHeight
|
||||
}, resizer:function() {
|
||||
var a = this.element.getClientRects()[0];
|
||||
this.completer.style.top = a.top + "px";
|
||||
var b = a.bottom - a.top;
|
||||
this.completer.style.height = b + "px";
|
||||
this.completer.style.lineHeight = b + "px";
|
||||
this.completer.style.left = a.left + "px";
|
||||
b = a.right - a.left;
|
||||
this.completer.style.width = b + "px";
|
||||
if(this.hintDirection.get() === "below") {
|
||||
this.hinter.style.top = a.bottom + "px";
|
||||
this.hinter.style.bottom = "auto"
|
||||
}else {
|
||||
this.hinter.style.top = "auto";
|
||||
this.hinter.style.bottom = this.doc.documentElement.clientHeight - a.top + "px"
|
||||
}this.hinter.style.left = a.left + 30 + "px";
|
||||
this.hinter.style.maxWidth = b - 110 + "px";
|
||||
if(this.popupOutput) {
|
||||
if(this.outputDirection.get() === "below") {
|
||||
this.output.style.top = a.bottom + "px";
|
||||
this.output.style.bottom = "auto"
|
||||
}else {
|
||||
this.output.style.top = "auto";
|
||||
this.output.style.bottom = this.doc.documentElement.clientHeight - a.top + "px"
|
||||
}this.output.style.left = a.left + "px";
|
||||
this.output.style.width = b - 80 + "px"
|
||||
}
|
||||
}, onKeyDown:function(a) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.TAB || a.keyCode === g.KeyHelper.KEY.UP || a.keyCode === g.KeyHelper.KEY.DOWN) {
|
||||
return true
|
||||
}
|
||||
}, onKeyUp:function(a) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.RETURN) {
|
||||
var b = this.cli.getWorstHint();
|
||||
if(b.status === h.VALID) {
|
||||
this.cli.exec();
|
||||
this.element.value = ""
|
||||
}else {
|
||||
this.element.selectionStart = b.start;
|
||||
this.element.selectionEnd = b.end
|
||||
}
|
||||
}this.update();
|
||||
if(b = this.cli.getAssignmentAt(this.element.selectionStart)) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.TAB) {
|
||||
b.complete();
|
||||
this.update()
|
||||
}if(a.keyCode === g.KeyHelper.KEY.UP) {
|
||||
b.increment();
|
||||
this.update()
|
||||
}if(a.keyCode === g.KeyHelper.KEY.DOWN) {
|
||||
b.decrement();
|
||||
this.update()
|
||||
}
|
||||
}
|
||||
}, update:function() {
|
||||
this.isUpdating = true;
|
||||
var a = {typed:this.element.value, cursor:{start:this.element.selectionStart, end:this.element.selectionEnd}};
|
||||
this.cli.update(a);
|
||||
a = this.cli.getAssignmentAt(a.cursor.start).getHint();
|
||||
d.removeCssClass(this.completer, h.VALID.toString());
|
||||
d.removeCssClass(this.completer, h.INCOMPLETE.toString());
|
||||
d.removeCssClass(this.completer, h.INVALID.toString());
|
||||
var b = '<span class="cptPrompt">></span> ';
|
||||
if(this.element.value.length > 0) {
|
||||
var c = this.cli.getInputStatusMarkup();
|
||||
b += this.markupStatusScore(c)
|
||||
}if(this.element.value.length > 0 && a.predictions && a.predictions.length > 0) {
|
||||
c = a.predictions[0];
|
||||
b += " ⇥ " + (c.name ? c.name : c)
|
||||
}this.completer.innerHTML = b;
|
||||
d.addCssClass(this.completer, this.cli.getWorstHint().status.toString());
|
||||
var e = "";
|
||||
if(this.element.value.length !== 0) {
|
||||
e += a.message;
|
||||
if(a.predictions && a.predictions.length > 0) {
|
||||
e += ": [ ";
|
||||
a.predictions.forEach(function(l) {
|
||||
e += l.name ? l.name : l;
|
||||
e += " | "
|
||||
}, this);
|
||||
e = e.replace(/\| $/, "]")
|
||||
}
|
||||
}this.hinter.innerHTML = e;
|
||||
e.length === 0 ? d.addCssClass(this.hinter, "cptNoPopup") : d.removeCssClass(this.hinter, "cptNoPopup");
|
||||
this.isUpdating = false
|
||||
}, markupStatusScore:function(a) {
|
||||
for(var b = "", c = 0, e = -1;;) {
|
||||
if(e !== a[c]) {
|
||||
b += "<span class=" + a[c].toString() + ">";
|
||||
e = a[c]
|
||||
}b += this.element.value[c];
|
||||
c++;
|
||||
if(c === this.element.value.length) {
|
||||
b += "</span>";
|
||||
break
|
||||
}if(e !== a[c]) {
|
||||
b += "</span>"
|
||||
}
|
||||
}return b
|
||||
}, onArgChange:function(a) {
|
||||
if(!this.isUpdating) {
|
||||
var b = this.element.value.substring(0, a.argument.start), c = this.element.value.substring(a.argument.end);
|
||||
a = typeof a.text === "string" ? a.text : a.text.name;
|
||||
this.element.value = b + a + c;
|
||||
b = (b + a).length;
|
||||
this.element.selectionStart = b;
|
||||
this.element.selectionEnd = b
|
||||
}
|
||||
}};
|
||||
m.CliView = i
|
||||
});
|
||||
|
Before Width: | Height: | Size: 669 B |
|
Before Width: | Height: | Size: 42 B |
|
Before Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 11 KiB |
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
.cptRowIn {
|
||||
display: box; display: -moz-box; display: -webkit-box;
|
||||
box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;
|
||||
box-align: center; -moz-box-align: center; -webkit-box-align: center;
|
||||
color: #333;
|
||||
background-color: #EEE;
|
||||
width: 100%;
|
||||
font-family: consolas, courier, monospace;
|
||||
}
|
||||
.cptRowIn > * { padding-left: 2px; padding-right: 2px; }
|
||||
.cptRowIn > img { cursor: pointer; }
|
||||
.cptHover { display: none; }
|
||||
.cptRowIn:hover > .cptHover { display: block; }
|
||||
.cptRowIn:hover > .cptHover.cptHidden { display: none; }
|
||||
.cptOutTyped {
|
||||
box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;
|
||||
font-weight: bold; color: #000; font-size: 120%;
|
||||
}
|
||||
.cptRowOutput { padding-left: 10px; line-height: 1.2em; }
|
||||
.cptRowOutput strong,
|
||||
.cptRowOutput b,
|
||||
.cptRowOutput th,
|
||||
.cptRowOutput h1,
|
||||
.cptRowOutput h2,
|
||||
.cptRowOutput h3 { color: #000; }
|
||||
.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }
|
||||
.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }
|
||||
.cptRowOutput input[type=password],
|
||||
.cptRowOutput input[type=text],
|
||||
.cptRowOutput textarea {
|
||||
color: #000; font-size: 120%;
|
||||
background: transparent; padding: 3px;
|
||||
border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
|
||||
}
|
||||
.cptRowOutput table,
|
||||
.cptRowOutput td,
|
||||
.cptRowOutput th { border: 0; padding: 0 2px; }
|
||||
.cptRowOutput .right { text-align: right; }
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
|
||||
<div class=cptRow>
|
||||
<!-- The div for the input (i.e. what was typed) -->
|
||||
<div class="cptRowIn" save="${rowin}"
|
||||
onclick="${copyToInput}"
|
||||
ondblclick="${executeRequest}">
|
||||
|
||||
<!-- What the user actually typed -->
|
||||
<div class="cptGt">> </div>
|
||||
<div class="cptOutTyped">${request.typed}</div>
|
||||
|
||||
<!-- The extra details that appear on hover -->
|
||||
<div class=cptHover save="${duration}"></div>
|
||||
<img class=cptHover onclick="${hideOutput}" save="${hide}"
|
||||
alt="Hide command output" _src="${imagePath}/minus.png"/>
|
||||
<img class="cptHover cptHidden" onclick="${showOutput}" save="${show}"
|
||||
alt="Show command output" _src="${imagePath}/plus.png"/>
|
||||
<img class=cptHover onclick="${remove}"
|
||||
alt="Remove this command from the history" _src="${imagePath}/closer.png"/>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- The div for the command output -->
|
||||
<div class="cptRowOut" save="${rowout}">
|
||||
<div class="cptRowOutput" save="${output}"></div>
|
||||
<img _src="${imagePath}/throbber.gif" save="${throb}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
define(function(b, j, c) {
|
||||
function i(a, d) {
|
||||
this.request = a;
|
||||
this.cliView = d;
|
||||
this.imagePath = g;
|
||||
this.throb = this.duration = this.show = this.hide = this.output = this.rowout = this.rowin = null;
|
||||
(new k).processNode(l.cloneNode(true), this);
|
||||
this.cliView.output.appendChild(this.rowin);
|
||||
this.cliView.output.appendChild(this.rowout);
|
||||
this.request.addEventListener("output", this.onRequestChange.bind(this))
|
||||
}
|
||||
var e = b("pilot/dom"), h = b("pilot/event"), f = b('text!cockpit/ui/requestView.html!\n<div class=cptRow>\n <!-- The div for the input (i.e. what was typed) --\>\n <div class="cptRowIn" save="${rowin}"\n onclick="${copyToInput}"\n ondblclick="${executeRequest}">\n \n <!-- What the user actually typed --\>\n <div class="cptGt">> </div>\n <div class="cptOutTyped">${request.typed}</div>\n\n <!-- The extra details that appear on hover --\>\n <div class=cptHover save="${duration}"></div>\n <img class=cptHover onclick="${hideOutput}" save="${hide}"\n alt="Hide command output" _src="${imagePath}/minus.png"/>\n <img class="cptHover cptHidden" onclick="${showOutput}" save="${show}"\n alt="Show command output" _src="${imagePath}/plus.png"/>\n <img class=cptHover onclick="${remove}"\n alt="Remove this command from the history" _src="${imagePath}/closer.png"/>\n \n </div>\n \n <!-- The div for the command output --\>\n <div class="cptRowOut" save="${rowout}">\n <div class="cptRowOutput" save="${output}"></div>\n <img _src="${imagePath}/throbber.gif" save="${throb}"/>\n </div>\n</div>\n'),
|
||||
k = b("pilot/domtemplate").Templater;
|
||||
b = b("text!cockpit/ui/requestView.css!\n.cptRowIn {\n display: box; display: -moz-box; display: -webkit-box;\n box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;\n box-align: center; -moz-box-align: center; -webkit-box-align: center;\n color: #333;\n background-color: #EEE;\n width: 100%;\n font-family: consolas, courier, monospace;\n}\n.cptRowIn > * { padding-left: 2px; padding-right: 2px; }\n.cptRowIn > img { cursor: pointer; }\n.cptHover { display: none; }\n.cptRowIn:hover > .cptHover { display: block; }\n.cptRowIn:hover > .cptHover.cptHidden { display: none; }\n.cptOutTyped {\n box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;\n font-weight: bold; color: #000; font-size: 120%;\n}\n.cptRowOutput { padding-left: 10px; line-height: 1.2em; }\n.cptRowOutput strong,\n.cptRowOutput b,\n.cptRowOutput th,\n.cptRowOutput h1,\n.cptRowOutput h2,\n.cptRowOutput h3 { color: #000; }\n.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }\n.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }\n.cptRowOutput input[type=password],\n.cptRowOutput input[type=text],\n.cptRowOutput textarea {\n color: #000; font-size: 120%;\n background: transparent; padding: 3px;\n border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;\n}\n.cptRowOutput table,\n.cptRowOutput td,\n.cptRowOutput th { border: 0; padding: 0 2px; }\n.cptRowOutput .right { text-align: right; }\n");
|
||||
e.importCssString(b);
|
||||
b = document.createElement("div");
|
||||
b.innerHTML = f;
|
||||
var l = b.querySelector(".cptRow");
|
||||
f = c.id.split("/").pop() + ".js";
|
||||
var g;
|
||||
if(c.uri.substr(-f.length) !== f) {
|
||||
console.error("module.id", c.id);
|
||||
console.error("module.uri", c.uri);
|
||||
console.error("filename", f);
|
||||
console.error("Can't work out path from module.uri/module/id");
|
||||
g = "."
|
||||
}else {
|
||||
g = c.uri.substr(0, c.uri.length - f.length) + "images"
|
||||
}i.prototype = {copyToInput:function() {
|
||||
this.cliView.element.value = this.request.typed
|
||||
}, executeRequest:function() {
|
||||
this.cliView.cli.update({typed:this.request.typed, cursor:{start:0, end:0}});
|
||||
this.cliView.cli.exec()
|
||||
}, hideOutput:function(a) {
|
||||
this.output.style.display = "none";
|
||||
e.addCssClass(this.hide, "cmd_hidden");
|
||||
e.removeCssClass(this.show, "cmd_hidden");
|
||||
h.stopPropagation(a)
|
||||
}, showOutput:function(a) {
|
||||
this.output.style.display = "block";
|
||||
e.removeCssClass(this.hide, "cmd_hidden");
|
||||
e.addCssClass(this.show, "cmd_hidden");
|
||||
h.stopPropagation(a)
|
||||
}, remove:function(a) {
|
||||
this.cliView.output.removeChild(this.rowin);
|
||||
this.cliView.output.removeChild(this.rowout);
|
||||
h.stopPropagation(a)
|
||||
}, onRequestChange:function() {
|
||||
this.duration.innerHTML = this.request.duration ? "completed in " + this.request.duration / 1E3 + " sec " : "";
|
||||
this.output.innerHTML = "";
|
||||
this.request.outputs.forEach(function(a) {
|
||||
var d;
|
||||
if(typeof a == "string") {
|
||||
d = document.createElement("p");
|
||||
d.innerHTML = a
|
||||
}else {
|
||||
d = a
|
||||
}this.output.appendChild(d)
|
||||
}, this);
|
||||
this.cliView.scrollOutputToBottom();
|
||||
e.setCssClass(this.output, "cmd_error", this.request.error);
|
||||
this.throb.style.display = this.request.completed ? "none" : "block"
|
||||
}};
|
||||
j.RequestView = i
|
||||
});
|
||||