====== SlyEdit installation ======
SlyEdit is the second full-featured full screen editor for Synchronet, written by ''[[person:nightfox]]'' in JavaScript.  SlyEdit can run in one of two styles, to mimic the look & feel of IceEdit or DCT Edit, two popular BBS message editors from the 1990s.  The style is specified by a command-line argument.  SlyEdit also supports customization of options via a configuration file and colors via theme files.\\
\\
The ''[[module:slyedit]]'' module page describes SlyEdit's features and configuration files in more detail. This page discusses SlyEdit's setup with Synchronet.
\\
SlyEdit will recognize the user's terminal size and set up the screen accordingly.\\
\\
Thanks go out to all the sysops and users who have reported bugs, made suggestions, and helped test SlyEdit, including the following people:
  * Access Denied of [[http://pharcyde.org|The Pharcyde]] ([[telnet://pharcyde.org|pharcyde.org]]) for testing the newer versions and for his input on various features, including message quoting and cross-posting
  * Psi-Jack of [[http://bbs.deckersheaven.com|Decker's Heaven]] ([[telnet://bbs.deckersheaven.com|bbs.deckersheaven.com]]) for providing an example of implementing support for PageUp, PageDown, and function keys
  * echicken of [[http://bbs.electronicchicken.com|Electronic Chicken]] ([[telnet://bbs.electronicchicken.com|bbs.electronicchicken.com]]) for his idea for looking up the original author of a message after a user changes the "To" name when replying to a message
  * Nick of [[http://web.archive.org/web/20141218191701/http://lightningbbs.dyndns.org/|Lightning BBS]] ([[telnet://lightningbbs.dyndns.org|lightningbbs.dyndns.org]]) for testing early versions

===== Minimum Synchronet version =====
SlyEdit supports Synchronet version 3.14 and newer.  However, version 3.16 (from at least July 5, 2015) or newer is recommended. The reason is due to the following changes in Synchronet 3.16 builds:
  * May 12, 2013: A change was made that lets SlyEdit correctly find author's initials to use on quote lines when replying to a message in a public message area.\\
  * June 22, 2015: A change was made that allows tag lines to be placed below the user's signature (if a user has a signature).  If you are running a Synchronet 3.16 build from before June 22, 2015, tag lines will not be included in the message.  For version 3.15 and earlier of Synchronet, the tag line will appear above the user's signature (if the user has a signature).\\
  * July 5, 2015: Synchronet now includes a 7th line in the MSGINF drop file that specifies the full path & filename of the tagline file.  SlyEdit will write the user's chosen tagline to the tagline file with that name if that line exists in the MSGINF file.\\
The latest successfully built Synchronet binaries can be downloaded [[ftp://vert.synchro.net/Synchronet/00index.html?$hgvp0m9u|from Vertrauen]] ([[ftp://vert.synchro.net/Synchronet/sbbs_dev.zip|sbbs_dev.zip]] for the Windows binaries or [[ftp://vert.synchro.net/Synchronet/sbbs_dev.tgz|sbbs_dev.tgz]] for the Linux binaries).

===== Getting SlyEdit =====
As of Synchronet 3.16, SlyEdit is included with Synchronet.  The latest version of SlyEdit can also be acquired by browsing to the Synchronet ''[[dev:git]]'' repository and downloading the following files, and copying them to the corresponding directories in your Synchronet setup:
  * [[https://gitlab.synchro.net/main/sbbs/-/tree/master/exec|exec directory]] directory: [[https://gitlab.synchro.net/main/sbbs/-/blob/master/exec/SlyEdit.js?ref_type=heads|SlyEdit.js]]
  * [[https://gitlab.synchro.net/main/sbbs/-/tree/master/exec/load|load directory]] directory: [[https://gitlab.synchro.net/main/sbbs/-/blob/master/exec/load/slyedit_misc.js|slyedit_misc.js]], [[https://gitlab.synchro.net/main/sbbs/-/blob/master/exec/load/slyedit_ice_stuff.js|slyedit_ice_stuff.js]], and [[https://gitlab.synchro.net/main/sbbs/-/blob/master/exec/load/slyedit_dct_stuff.js|slyedit_dct_stuff.js]]
  * [[https://gitlab.synchro.net/main/sbbs/-/tree/master/ctrl|ctrl]] directory: All of the Sly_* files

Additionally, there is a [[https://gitlab.synchro.net/main/sbbs/-/blob/master/docs/slyedit_readme.txt?ref_type=heads|SlyEdit readme file]] in the [[https://gitlab.synchro.net/main/sbbs/-/tree/master/docs|docs directory]]; however, that contains much of the same information that's available on the wiki.

===== Installation =====
Copy the .js files to the ''[[dir:exec]]'' directory and the .cfg files into the ''[[dir:ctrl]]'' directory.  If you make any changes to the SlyEdit configuration file (SlyEdit.cfg) or color theme files, it is recommended that you save your modified configuration/theme files to the ''[[dir:mods]]'' directory so that any modifications you make to them won't be accidentally overwritten when updating the Synchronet files from the Synchronet ''[[dev:git]]'' repository.

===== Configuration with Synchronet =====
Make sure this configuration is in [[util:SCFG]]->External Programs->External Editors.  Note that the ARS requirements string is "ANSI AND COLS 80".  This means that the user's terminal must support ANSI and have a width of at least 80  columns.

  Name                            SlyEdit
  Internal Code                   SLYEDIT
  Command line                    ?SlyEdit.js %f
  Access requirements             ANSI AND COLS 80
  Native Executable               No
  I/O method                      FOSSIL or UART
  Use Shell or New Context        No
  Record Terminal Width           Yes
  Word-wrap Quoted Text           Yes, for 79 columns
  Retain Ctrl-A Codes in Quotes   Yes
  Automatically Quoted Text       All
  Editor Information Files        QuickBBS MSGINF/MSGTMP
  Handle Soft CRs                 N/A
  Strip FidoNet Kludges           No
  Support UTF-8 Encoding          Yes
  BBS Drop File Type              None                          

The first time a user runs SlyEdit, they will be prompted about which style they want to use (Ice, DCT, or random).                       

===== SlyEdit configuration files =====
See ''[[module:slyedit]]'' for detailed information about SlyEdit's configuration file & color theme files.

\\
===== Upgrading from previous versions =====
The following is a list of changes and important notes for each version, if you are upgrading from a previous version of SlyEdit:\\
\\

New in version 2.00
-------------------
SlyEdit 2.00 has a new user setting (in the user settings menu, opened with Ctrl-U), to specify which UI style to use (Ice/DCT/Random), and if the user hasn't chosen, SlyEdit will ask the user when SlyEdit starts. That way, there only needs to be one SlyEdit entry in the external editors.

SlyEdit will still work as configured previously in Synchronet, but you may wish to edit their external editors in Synchronet  to have only one SlyEdit entry (and it can be just called "SlyEdit").

For the SlyEdit entry that is deleted, users who were using that style of SlyEdit may find that their editor has been defaulted to another editor, so they may need to change their preferred editor to SlyEdit again.

When removing the 2nd SlyEdit entry from your external editor configuration, you may want to change the internal code for your remaining SlyEdit entry to match (i.e., "SLYEDIT").

NOTE: Before changing your Synchronet editor configuration to only have one SlyEdit, download the following JS script and run it (either on your BBS PC using jsexec or on the terminal); It will list users who currently appear to be using SlyEdit.  Note them down:

[[http://digdist.synchro.net/usersUsingSlyedit.js]]

After changing your Synchronet external editor configuration to just have one SlyEdit (and changing its internal code), you should go through and check the users listed by that script to ensure they have SlyEdit selected as their external editor.

New in version 1.90
-------------------
For adding a 'meme' to a message, new configuration settings have been added in SlyEdit.cfg:
^Setting                              ^ Description^
| memeMaxTextLen | For appending a 'meme' to a message, this specifies the maximum text length for a meme. |
| memeDefaultWidth | The default width for memes |
| memeStyleRandom | For appending a meme to a message, whether or not to choose a random style (border style & color) for the meme. The user will still be able to change it. Valid values are true and false. If this is true, the border & color settings will be ignored. |
| memeDefaultBorder | Default border for posting a meme. This can be one none, single, mixed1, mixed2, mixed3, double, ornate1, ornate2, or ornate3. This can also be a number between 1 and the maximum number of meme border styles. You can refer to sbbs/exec/load/meme_lib.js - Near the top, there are definitions such as BORDER_NONE, BORDER_SINGLE, etc., up to BORDER_COUNT (which is the number of border styles supported). |
| memeDefaultColor | For appending a meme to a message, this is a number that specifies the coloring for the meme. This can be between 1 and the maximum number of coloring options supported by sbbs/exec/load/meme_chooser.js. You can refer to sbbs/exec/load/meme_chooser.js. At the time of this writing, under "function main" in that file, there is an array of attribute codes, declared via "var attr", and there are are 7 of them as of now. |
| memeJustify | For appending a meme to a message, this specifies the text justification. Valid values are center, left, and right. |

New in version 1.80
-------------------
New configuration settings have been added in SlyEdit.cfg:
^Setting                              ^ Description^
| allowColorSelection             | Whether or not to let the user change the text color |
| saveColorsAsANSI                | Whether or not to save message color/attribute codes as ANSI (if not, they will be saved as Synchronet attribute codes) |

The TextEditColor setting has been removed from the color theme configuration files.

New in version 1.71
-------------------
There is a new setting in SlyEdit.cfg, allowSpellCheck, which specifies whether the spell check feature is allowed.  Valid values are true and false; it defaults to true if not specified.  You might want to disable spell check if, for instance, the spell check feature causes an "out of memory" error on your system.

New in version 1.68
-------------------
Each paragraph of text written in a message is now saved as one long line so that they can be wrapped appropriately according to the terminal/reader width (which should work online as well as in offline readers).  Also, message uploads are now supported by typing /UPLOAD (or /UL) on a line by itself (the uploaded message will replace any message written into the editor).  Also, now honors the SUB_ANON and SUB_AONLY flags for the sub-boards when cross-posting so that the "from" name is "Anonymous" if either of those flags enabled.

New in version 1.67
--------------------
Version 1.67 added the ability to change the message subject.  Note that if using a Synchronet 3.17c development build, this requires a build from July 21, 2019 or newer (that build added the ability to use the RESULT.ED file, even if the editor is configured for QuickBBS MSGINF/MSGTMP).

1.66 update
-----------------
For dictionaries with localized spellings, the filenames can have a "-supplemental" at the
end of their name before the extension if they only contain words that are unique to a
particular region that don't exist for all regions.  Also, dictionary filenames can just
contain the language without a localization if they contain words common to all regions.
For example:
^ Filename                          ^ Description ^
| dictionary_en.txt                 | General English dictionary with spellings common to all regions |
| dictionary_en-US-supplemental.txt | English word spellings only specific to the US |
| dictionary_en-US.txt              | Full English US dictionary |

New in 1.64
-----------------
Version 1.64 added a spell checker feature.  There is a new option for SlyEdit.cfg,
dictionaryFilenames, which is a comma-separated list of filenames.  The filenames
are in the format dictionary_<language>.txt, where <language> is the language name.
For dictionaryFilenames, you can also just specify the language names if you want.
The dictionary filenames will be looked for in sbbs/mods, sbbs/ctrl, and then the
directory where SlyEdit.js is located.

New in version 1.63
-------------------------
This version allows using the full width of the terminal for message text.
After upgrading to this version, if you are using a Synchronet build from
April 13th, 2019 or later, ensure that the "Record Terminal Width" setting
in SCFG is enabled for SlyEdit.  This helps ensure that Synchronet re-wraps
message text for readers if the author used a different terminal width than
the reader.

New in version 1.34
-------------------------
This version includes a new configuration option in SlyEdit.cfg for Ice-style colors (in the [ICE_COLORS] section): menuOptClassicColors.  If this option is set to false, then new colors will be used for Ice-style menu options.  If this is set to false, then the classic Ice-style menu option colors will be used.

New in version 1.33
-------------------------
In this version, taglines can now be optionally prefixed with some text and/or surrounded by double quotes.  Also, the list of taglines can optionally be shuffled before being displayed to the user.  Three new configuration settings have been added in this version to configure these options:
^ Setting                         ^ Description ^
| taglinePrefix                   | Some text to be added to the front of a tagline that is selected from the user.  The intention of this setting is to differentiate taglines from the rest of the message.  This defaults to the string "... " (3 dots and a space).  If desired, this can be set to a blank string (nothing after the = ) - for instance, if you only want to put double quotes around text lines, you could set this to blank and enable the quoteTagLines setting. |
| quoteTaglines                   | Whether or not to put selected taglines in double quotes.  This defaults to false.  If you like taglines to have double quotes and no prefix, you can set this to true and set taglinePrefix to a blank string (nothing after the = ). |
| shuffleTaglines                 | Whether or not to shuffle (randomize) the list of taglines displayed to the user for selection. |

New in version 1.32
-------------------------
A new color setting has been added, listBoxItemHighlight, which is used for the currently selected item in a list box.

The color setting txtReplacementList has been changed to listBoxItemText.  This color applies to items written inside any list box, including the list of text replacements and the list of tag lines.

Taglines: Users can now (optionally) select a tagline to append to their message upon saving their message.  Users can configure whether or not they want to use taglines in their user settings, which is also a new feature in this version of SlyEdit (see the paragraph below).

New configuration settings have been added in SlyEdit.cfg:
^Setting                              ^ Description^
| enableTaglines                  | This serves as a default for user settings for whether or not to enable the option to add a tagline to their message upon saving the message. |
| tagLineFilename                 | This specifies the name of a text file where tag lines are stored.  By default, it is SlyEdit_Taglines.txt. |
| allowUserSettings               | Whether or not to allow users to configure their user settings. |

User settings: Users can now configure their own user settings in this version. Settings include whether or not to use tag lines, whether or not to quote messages using the original author's initials, and whether or not to indent quoted lines with initials.

The configuration settings useQuoteLineInitials indentQuoteLinesWithInitials in SlyEdit.cfg now serve as defaults for user settings rather than being used for everyone.

\\
New in version 1.29
-------------------------
A new "text replacements" (AKA macros) feature has been added.  This feature lets you (the sysop) define words to be replaced with other text.  This feature can be used, for instance, to replace commonly misspelled words with their correct versions or to replace swear words with less offensive words as the user types a message.  For more details, see the section regarding text replacements in SlyEdit's readme file.


The color settings crossPostBorder and crossPostBorderText have been renamed to listBoxBorder and listBoxBorderText.  crossPostBorder and crossPostBorderText will still work, but if listBoxBorder and listBoxBorderText are used in your theme configuration files, those will be used instead.

Also, the following color setting has been added (for both the DCT-style and Ice-style theme files):
^ Setting            ^ Description^
| txtReplacementList | The color to use for the text replacements in the text replacement list.  This option was added in version 1.29. |

\\
New in version 1.28
-------------------------
New general color settings (for both the DCT-style and Ice-style theme files):
^ Setting                         ^ Description^
| msgWillBePostedHdr              | The color to use for the text "Your message will be posted into the following area(s)" text when exiting SlyEdit |
| msgPostedGrpHdr                 | The color to use for the group name header when listing the message's posted message areas when exiting SlyEdit |
| msgPostedSubBoardName           | The color to use for the message sub-boards when listing the message's posted message areas when exiting SlyEdit |
| msgPostedOriginalAreaText       | The color to use for the text "(original message area)" when listing the message's posted message areas when exiting SlyEdit |
| msgHasBeenSavedText             | The color to use for the text "The message has been saved." when exiting SlyEdit |
| msgAbortedText                  | The color to use for the Message Aborted text when exiting SlyEdit |
| emptyMsgNotSentText             | The color to use for the Message Not Sent text when exiting SlyEdit |
| genMsgErrorText                 | The color to use for general message error text when exiting SlyEdit |

\\
New in version 1.20
-------------------------
Version 1.20 added a cross-posting feature, and there is a new configuration setting and some new color settings for cross-posting.  Also, starting with version 1.20, you can put your customized SlyEdit configuration file (SlyEdit.cfg) and color theme files in the ''[[dir:mods]]'' directory so that they won't be accidentally overwritten when updating the Synchronet files from the Synchronet ''[[dev:git]]'' repository.

New setting for SlyEdit.cfg:
^ Setting                         ^ Description^
| allowCrossPosting               | Whether or not to allow cross-posting.  Valid values are true and false.  This setting is enabled by default. |

New color settings (for both the DCT-style and Ice-style theme files):
^ Setting                         ^ Description^
| crossPostBorder                 | The color to use for the border of the cross-post area selection box |
| crossPostBorderText             | The color to use for the top border text of the cross-post area selection box |
| crossPostMsgAreaNum             | The color to use for the message group/sub-board numbers in the cross-post area selection box |
| crossPostMsgAreaNumHighlight    | The color to use for the highlighted (lightbar) message group/sub-board numbers in the cross-post area selection box |
| crossPostMsgAreaDesc            | The color to use for the message group/sub-board descriptions in the cross-post area selection box |
| crossPostMsgAreaDescHighlight   | The color to use for the highlighted (lightbar) message group/sub-board descriptions in the cross-post area selection box |
| crossPostChk                    | The color to use for the checkmarks for the enabled message sub-boards in the cross-post area selection box |
| crossPostChkHighlight           | The color to use for the highlighted (lightbar) checkmarks for the enabled message sub-boards in the cross-post area selection box |
| crossPostMsgGrpMark             | The color to use for the current message group marker character in the cross-post area selection box |
| crossPostMsgGrpMarkHighlight    | The color to use for the highlighted (lightbar) current message group marker character in the cross-post area selection box |

\\
New in version 1.18
-------------------------
* **Important:** If you use Digital Distortion's Message Lister on your BBS, then you must update Digital Distortion's Message Lister must to at least version 1.36 in order for message quoting with author's initials to work properly when replying to a message from Digital Distortion's Message Lister.  The latest version of the Digital Distortion BBS doors & add-ons can be downloaded from the [[http://digdist.synchro.net/DigDistBBSStuff/DigDistBBSStuff.html|Digital Distortion BBS Doors and Tools page]].

A feature has been added to allow quoted lines with author's initials to be indented by a space.  It is disabled by default.  To enable that option, add the following line in SlyEdit.cfg in the [BEHAVIOR] section:
  indentQuoteLinesWithInitials=true
That option can also be set to false to disable it.

\\
New in version 1.17
-------------------------
Starting with version 1.17, when replying to a message, quoted lines from the previous message will be prefixed with the last author's initials by default.  If desired, this behavior can be disabled by adding the following line in the [BEHAVIOR] section of SlyEdit.cfg:
  useQuoteLineInitials=false
When disabled, SlyEdit will quote message lines as before, prefixing them with " > " as was done in IceEdit, DCT Edit, and other editors of the early-mid 1990s.
Since many users participate in public message areas, it is recommended to let SlyEdit add the last author's initials to quote lines in order to make it easier for other readers to identify who wrote which parts and make it easier to follow the conversation.  That option can also be set to true in SlyEdit.cfg to enable it.

\\
New in version 1.16
-------------------------
As of version 1.16, the configuration files may be placed in the ''[[dir:ctrl]]'' directory if desired.  This change was made for SlyEdit's inclusion in the Synchronet ''[[dev:git]]'' repository.  The .js files can be placed anywhere, but for the standard Synchronet installation from the ''[[dev:git]]'' repository, the .js files will be in the ''[[dir:exec]]'' directory.

\\
New in version 1.15
-------------------------
In version 1.15, the configuration setting splitLongQuoteLines was removed and replaced with the reWrapQuoteLines setting.  Refer to the list of settings above for its description.

Also added the following configuration options and capabilities (refer to the list of settings above for their descriptions):
  * add3rdPartyStartupScript
  * addJSOnStart
  * add3rdPartyExitScript
  * addJSOnExit

\\
New in version 1.08
-------------------------
Starting with version 1.08, the "Expand Line Feeds to CRLF" for SlyEdit in SCFG should now be set to Yes.  This option enables Synchronet to save messages properly, regardless of whether Synchronet is running in Windows or a *nix system.  The SCFG examples above reflect this option.  Enabling this option fixes problems with line wrapping that was seen on Linux Synchronet systems when the messages were sent across some networks to other BBSs.  Thanks goes to Access Denied, sysop of The Pharcyde, for helping to test this.

Also, in version 1.08, two new configuration settings were added to the main configuration file (SlyEdit.cfg) in the BEHAVIOR section (refer to the list of settings above for their descriptions):
  * userInputTimeout
  * inputTimeoutMS

Note that the sysop is now always exempt from the input timeout.

In version 1.13, the setting splitLongQuoteLines was added to the main configuration file (SlyEdit.cfg) in the BEHAVIOR section.  Refer to the list of settings above for its description.
\\

New in version 1.07
-------------------------
Starting with version 1.07, the option "Expand Line Feeds to CRLF" in SCFG should now be set to Yes.  Refer to the example configuration near the top of this article.

===== See Also =====
  * [[:howto:editor:|howto:editor index]]

{{tag>javascript editor}}