Merge remote branch 'upstream/master'
This commit is contained in:
commit
0791e1bb04
233 changed files with 4710 additions and 18632 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -11,4 +11,5 @@
|
|||
.*.gz
|
||||
|
||||
# A handy place to put stuff that git should ignore:
|
||||
/ignore/
|
||||
/ignore/
|
||||
/build/
|
||||
|
|
|
|||
6
.gitmodules
vendored
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
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
3
Makefile
|
|
@ -1,3 +0,0 @@
|
|||
package:
|
||||
rm -rf build
|
||||
support/requirejs/build/build.sh build.js
|
||||
1060
Makefile.dryice.js
Normal file
1060
Makefile.dryice.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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
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
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue