Options
All
  • Public
  • Public/Protected
  • All
Menu

ThoughtAsylum Drafts Library

Welcome

  1. Overview
  2. How-To Information
  3. FAQ
  4. Licensing
  5. Authors
  6. Legal Disclaimer
  7. Change Log

Overview

The ThoughtAsylum Drafts Library, also known as TADpoLe, is a collection of JavaScript for working with the Drafts application. They cover a broad range of areas, and will no doubt continue to grow over time. The library was built over the course of several years to meet the author's personal needs to build out more functionality in the Drafts application through it's actions framework, and in particular through the script (JavaScript) action step.

Being a JavaScript developer is not his day job (nor has it ever been); so it is very much a piece of work that is provided as-is and perhaps doesn't adhere to the coding styles and structures that others may use.

The library began construction in 2018 when Drafts 5 was released, and has been reworked several times and grown substantially in the intervening years. The expectation is that it will continue to grow and updates will be posted here when they are suitable for a public release.

At initial release in July 2020, the library contents came in at over 300 functions associated with standard JavaScript objects, Drafts objects, and some TADpoLe specific classes.

How-To Information

Using this Site

This site provides the documentation for the TADpoLe library as well as the library file itself. It is purposefully provided in a similar format to the Drafts scripting resource, and in a similar way you can review each class by selecting one of the links. Within each you will find a variety of properties and functions. Many of the functions are extensions of existing JavaScript or Drafts objects, and all library functions are prefixed TA_ as an identifier.

Functions provide details of the functionality, parameters, returns, and a simple example. Some functions also provide some more detailed sets of information about their use. Properties and classes unique to the library are similarly described with what we hope is enough detail for them to make sense and be used.

Additional Information

Additional pages of information on how to use specific parts of the library will be published over time at ThoughtAsylum.com. Links back to the most relevant posts and pages on ThoughtAsylum will be added here. In addition if you come up with any interesting use cases or how-to guides utilising the library, direct message @sylumer on the Drafts forums with the details, and they might just get included here.

Action Group Suite

The main way that most users will gain access to the library will be through the use of the suite of ThoughtAsylum Action Groups, available from the Drafts Action Directory.

TypeScript Declaration File

Many editors and IDEs accept TypeScript declaration files as inputs to allow intellitype-style features. A TypeScript definition file for this library is available for download. It should always match the details in the latest version.

Download TypeScript Declaration File

JavaScript File

The JavaScript file that contains all of the code for the library can be downloaded directly from this site, but generally we would advise utilising the ThoughtAsylum Action Group to get the latest copy of the library.

Download JavaScript File

Configuration File

The library makes use of a configuration file that applies across many of the functions and directly influences the way some functions operate, and the data available to other functions. The configuration file is in JSON format, and the details can be found in the TadLibrary class section in regards to what all of the library settings/TadLibrary properties are. The file itself is stored by convention in /Library/Scripts/tad.json in the Drafts iCloud directory structure.

If you wish to tailor a value from it's current value, simply edit the value as you might any other JSON file.

JavaScript Beautifier Configuration

The JavaScript beautifier functioality relies on the js-beautify library, and utilises the settings associated with that.

For additional details, take a look at the TA_devBeautifyJSDraft function documentation.

FAQ

1. Why is the library called "tadpole"?
The library name is "TADpoLe". The "TA" refers to thoughtasylum.com, the personal website of the author. The "D" is for Drafts, and the "L" is for library. The other letters just fill in some gaps to make it easier to reference, and hopefully make it a little more memorable.

2. Why do the functions start "TA" rather than "TAD", or "TADL" then? Honestly, the library came later and at first it was just going to be a "ThoughtAsylum" library, so it started out as TA. The library naming came much (years) later, and so the "TA" prefix has been kept, and it's also just a little bit shorter for people to type.

The point of having it in the first place is to hopefully avoid namespace clashes with functions users might already have written that would otherwise have the potential of genearting namespace clashes.

3. What is the licensing for this library?
See the licensing section section below, but basically it is free to use and re-use.

4. Are there any actions you could share that use the library?
Why yes there are, I guess you skipped over the action group section above. Go back and take a look.

5. I've found a bug, what should I do?
The library is shared on a best efforts basis, and is provided as is. If you have an honest to goodness bug, post to the Drafts forum and tag @sylumer with a simple example that can allow anyone to reproduce the issue. Be sure to provide any example content to prime the example, well formatted code (i.e. put your JavaScript between triple backticks) or a link to a shared action, along with a description of what you are seeing and what you would expect to see.

6. I'd like a function to work differently, what should I do?
Take a copy of the TADpoLe function, change it to do what you want it to, and then include it in your own projects.

Make sure that you save this in your own library file, otherwise, if you update the TADpoLe library, you'll lose your code as the file is oevrwritten. This also stops any issue of mis-attribution if you subsequently share your code.

6. I'd like some help on using the library functions, what should I do?
If you can't figure it out yourself, consider posting to the Drafts forum and seeing if someone there can help you. Be sure to be make your request specific and not boundless or asking for someone else to do all the work for you.

Licensing

TADpoLe is Coffeeware. You are free to make use of this library as long as you like and as much as you like. You owe us nothing.

But, if you do want to give a little, all development is fuelled by coffee, and you can make a donation to the author's coffee fund.

Donate a coffeeDonate a coffee

Please also take the time to read the legal disclaimer below.

Third Party Additions

There are a handful of additional components used by this library, and we would thank the authors for making their code available, and we provide further information about their licensing details here.

Crypto-JS

Crypto-JS is used within some of the encryption/decryption helper functionality.

Crypto-JS (minified) https://github.com/brix/crypto-js

The MIT License (MIT)

Copyright (c) 2009-2013 Jeff Mott
Copyright (c) 2013-2016 Evan Vosberg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Highlighter

Highlighter is used to apply syntax highlighting to code blocks.

BSD 3-Clause License

Copyright (c) 2006, Ivan Sagalaev. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

JS Beautifier

JavaScript Beautifier is used for the JavaScript formatting functionality.

JS Beautifier (minified) https://github.com/beautify-web/js-beautify

The MIT License (MIT)

Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Mermaid

Mermaid is used for the diagramming in HTML previews.

The MIT License (MIT)

Copyright (c) 2014 - 2020 Knut Sveidqvist

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

To Title Case

The String extensions section include a function to convert to title case. This function is a slightly modified version of the To Title Case (v2.1) by David Gouch.

To Title Case 2.1 – http://individed.com/code/to-title-case/
Copyright © 2008–2013 David Gouch. Licensed under the MIT License.

Authors

Author Web Site E-mail Twitter Handle Drafts Forum Handle
Stephen Millard thoughtasylum.com Rarely checked 😬 @sylumer @sylumer

Legal Disclaimer

This library is shared publicly to help others and to contribute back to the wider Drafts community. You may use, and copy small (up to five functions) amounts and distribute it with your own code without any need to reference (though references are appreciated). Anything larger and you should distribute with the library and appropriate references back to it so as to enable the recipient to keep up to date with the original content.

Any modifications or derivative works based on any proportion of this library, must carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge this site as the original source of the library.

This library is expressly provided "AS IS." WE MAKE NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. WE NEITHER REPRESENTS NOR WARRANT THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE CODE.

You are solely responsible for determining the appropriateness of using the library and you assume all risks associated with its use, including but not limited to the risks and costs of errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This library is not intended to be used in any situation where a failure could cause risk of injury or damage to property.

Basically, we use this ourselves, we're sharing it publicly so others may benefit, please don't pass the effort put into this off as your own, and while we guarantee nothing regarding use, we really hope that you find it useful in processing your drafts, and remember to always keep good backups just in case.

Change Log

2021-04-02

  • New: TadPastebin class for working with pastebin.com.
  • New: Draft - TA_postToPastebin() and TA_postBodyToPastebin() - convenience draft functions for working with pastebin.com.
  • New: Editor - TA_replaceInSelection() - carry out a find and replace in the current selection.
  • New: Math - TA_integerToRoman() - convert a positive integer to a Roman numeral equivalent.
  • Doc Update: Added OpenGraph content to site.
  • Doc Fix: TadGitHub - constructor - fixed a typo in the description.
  • Doc Fix: Workspace - TA_selectWorkspace - fixed description.

2021-03-18

  • Fix: TadBear - TA_deviceUUIDforBear() fixed an incorrect function call. (sz_coding)

2021-02-28

  • New: Draft - TA_getEmailAddresses() return an array of e-mail addresses found in a draft.
  • New: Editor - functions to move the cursor between marked field entries - TA_cursorMoveAfterNextOpenMarker(), TA_cursorMoveBeforeNextCloseMarker(), TA_cursorMoveAfterPreviousOpenMarker(), and TA_cursorMoveBeforePreviousCloseMarker().
  • New: Editor - functions to reduce selections andplace the cursor to the start/end of the current selection - TA_selectionReduceToStart() and TA_selectionReduceToEnd().
  • New: HTMLPrompt - TA_draft (very) simple prompt based editor for creating and editing drafts, setting tags and flagged status.
  • New: String - TA_getEmailAddresses() return an array of e-mail addresses found in a string.
  • Update: HTMLPrompt - updated TA_textFieldLarge to accept an optional initial content parameter.
  • Fix: TadGitHub - TA_accountGetRepos() corrected use of function parameters.
  • Doc Fix: TadBear - TA_create() and TA_openNote() - correction of "option" to "optional".
  • Doc Fix: TadHTMLPrompt - TA_textFieldLarge() - correction of "unspecified" typo.

2021-01-16

  • Fix: TadGitHub - TA_fileGetSHA() and TA_fileUpdate() - updated to include URI encoding of some URL components that could otherwise result in an undefined error.

2020-01-10

  • New: Added mermaid set-up on refresh to support diagramming in some new preview actions in the ThoughtAsylum Action Group Suite.
  • New: Added highlight set-up on refresh to support syntax highlighting in some new preview actions in the ThoughtAsylum Action Group Suite.
  • New: TadGitHub - new class for working with the GitHub API.
  • New: Draft - TA_MDPreviewAdvanced() a new advanced preview function that supports, well, a lot of stuff.
  • Fix: TadLib - TA_displayVersionInfo() fixed mismatch in heading HTML.

2020-12-31

  • New: Added crypto-js dependency to library for crypto helper functions; all crypto handled by that library, not by TADpoLe. TADpoLe just offers up a set of Drafts focused convenience functions to get easier access to some crypto functionality.
  • New: TadBear - new class for interactions with Bear app via URL scheme.
  • New: TadLib - added new crypto library details to the TADpoLe properties - cryptoURL and cryptoName.
  • New: TadLib - TA_displayVersionInfo() display version information in an HTML prompt window.
  • New: TadHTMLPrompt - TA_message() equivalent to a JavaScript alert, but with HTML styling and layout options.
  • New: TadMisc - functions to generate truly random strings and integers - TA_randomStrings() and TA_randomInteger().
  • New: TadMisc - functions to generate keys - TA_random128BitKey(), TA_random192BitKey(), and TA_random256BitKey().
  • New: TadMisc - functions to work with AES encryption - TA_encryptAES() and TA_decryptAES().
  • New: TadMisc - TA_randomorgQuotaCheck() for checking remaining IP address quota at random.org.
  • New: Prompt - TA_encryptionPromptAES() for capturing or generating an AES encryption key.
  • New: Prompt - TA_decryptionPromptAES() for capturing an AES decryption key.
  • New: Prompt - created a new object TadKey for holding crypto key geneartion information during a script run.
  • New: App - added a couple of clipboard AES crypto functions - TA_encryptAESOntoClipboard() and TA_decryptAESOntoClipboard().
  • New: Draft - added several AES crypto functions - TA_encryptAES(), TA_decryptAES(), TA_encryptAESNew(), TA_decryptAESNew(), TA_encryptAESSelf(), TA_decryptAESSelf(), TA_encryptAESOntoClipboard(), and TA_decryptAESOntoClipboard().
  • New: Draft - added some content obfuscation/deobfuscation functions - TA_obfuscate() and TA_deobfuscate().
  • New: Draft - TA_addTags() adds all tags from an array to a draft.
  • New: Editor - TA_getSelectionWide() returns selected text, or all text if no selection.
  • New: String - added a couple of AES crypto functions - TA_encryptAES() and TA_decryptAES().
  • Fix: Editor - TA_unprependLinesRetainSelection() corrected to fix the case of outdenting the first line where the first line selection began at the start of an indented line.
  • Fix: HTMLPrompt - updated constructor to enforce UTF-8 compatibility.
  • Doc Fix: Prompt - added return information for TA_promptButtonArray() and TA_singleTextFieldPrompt().
  • Doc Fix: String - Added '//Example' to several example scripts where the intro line was missing.

2020-11-28

  • New: App - action group loading by name functions - TA_loadActionListByName() and TA_loadActionBarByName().
  • New: Array - return the length of the longest element in an array - TA_maxElementLength().
  • New: Editor - TA_cutLine() for cutting current line(s).
  • New: Editor - TA_setCurrentLineNoNewLine() replaces current line selection, but leaves any trailing newline untouched.
  • New: Editor - functions for getting the content of the previous and next lines - TA_getPreviousLineContent(), TA_getNextLineContent().
  • New: Editor - functions for deleting, selecting, copying and cutting previous line - TA_deletePreviousLine(), TA_selectPreviousLine(), TA_copyPreviousLine(), TA_cutPreviousLine().
  • New: Editor - functions for deleting, selecting, copying and cutting next line - TA_deleteNextLine(), TA_selectNextLine(), TA_copyNextLine(), TA_cutNextLine().
  • New: Editor - functions for moving the current line selection up and down in the editor - TA_moveLinesUp(), TA_moveLinesDown(), TA_moveLinesToStart(), TA_moveLinesToEnd().
  • New: String - functions for generating character-based boxes around text - TA_boxer(), TA_boxerSingle(), TA_boxerDouble().
  • New: String - TA_switchWordMarkers() makes regular expression based updates to translate word markers such as opening and closing quotes, and contraction markers (apostrophe).
  • New: String - TA_mdSimpleRenumber() function for renumbering Markdown numbered entries in a string - but only top level numbering of a continuous numbered list.
  • Update: Draft - TA_draftNew() added optional grammar parameter.
  • Update: Editor - minor amendment of editor references to this in TA_taskpaperToggleSelectedTask(), TA_taskpaperToggleExtendedTask(), TA_taskpaperSetSelectedToTask(), TA_taskpaperSetExtendedToTask(), TA_taskpaperSetSelectedToNotTask(), TA_taskpaperSetExtendedToNotTask().
  • Fix: Editor - corrected TA_taskpaperModifyCurrentLineTask() calls to TA_taskpaperModifyTask() calls in TA_taskpaperToggleSelectedTask(), TA_taskpaperToggleExtendedTask(), TA_taskpaperSetSelectedToTask(), TA_taskpaperSetExtendedToTask(), TA_taskpaperSetSelectedToNotTask(), TA_taskpaperSetExtendedToNotTask().
  • Doc Fix: App - TA_processCrossLink() corrected reference to editor in example to be app.
  • Doc Fix: Draft - TA_processLinesFunctionRetain() removed duplicate semicolon in example code.
  • Doc Fix: Draft - TA_setSyntaxAllStandard() corrected typo in description.
  • Doc Fix: String - TA_csvWrapDoubleQuotes() correction of function name and parameters - I was not having a good copy & paste day on the 14th.
  • Doc Fix: corrected a 2020-11-14 change log entry to have the correct function name: TA_navigationMarkersGet().
  • Doc Fix: corrected a 2020-11-14 change log entry to remove duplicate line for TA_csvWrap().

2020-11-15

  • Fix: String - fixed escaping function calls TA_removeLinesContaining() and TA_removeLinesNotContaining(). (Andreas_Haberle)

2020-11-14

  • New:TadLibrary - TA_versionOnline() returns the version number of the last published TADpoLe version.
  • New App - TA_processCrossLink() script version of clicking/tapping on a wiki-style cross link.
  • New App - TA_queueActionByName() for queueing an action by name on a draft.
  • New Draft - TA_chooseAndOpenMDLink() displays a list of Markdown links in the draft and then opens the one selected by the user.
  • New Draft - TA_exportFileMac() export the content of the draft to a file in a location in the Mac file system (includes locations outside of the usual sandbox).
  • New Draft - TA_matchMDLinks()returns an arry of Markdown links in the draft.
  • New Draft - TA_mergeLines() merge content into one line, allowing for various configuration options.
  • New Draft - TA_navigationMarkersGet() get the navigation markers for a draft.
  • New Draft - TA_queueActionByName() for queueing an action by name on the draft.
  • New Draft - TA_wikiLinkContent() fetch an array of Drafts wiki links from a draft.
  • New Editor - wrap substrings with text strings for every line in an extended selection, with matching based on regex determination of what comes before and after the substring - TA_lineSubstringWrapInsertion(), TA_lineSubstringWrapInsertions().
  • New Editor - TA_mergeSelectedLines() merge selected lines into one line, allowing for various configuration options.
  • New Editor - TA_processMDXLink() process (open/run/trigger) any Markdown link or cross link the cursor is currently in.
  • New String - TA_afterFirstOccurrence() return the text in a string that appears after the first occurrence of a substring in that string.
  • New String - TA_chooseAndOpenMDLink() displays a list of Markdown links in the string and then opens the one selected by the user.
  • New String - TA_countOccurrences() count the occurrences in the string of another string.
  • New String - TA_csvWrap() puts strings before and after each entry in a CSV string, with accounting for double quotes and inter value padding.
  • New String - TA_csvWrapDoubleQuotes() wraps each entry in a CSV string in double quotes, with accounting for existing double quotes and inter value padding.
  • New String - TA_exportFileMac() export the string to a file in a location in the Mac file system (includes locations outside of the usual sandbox).
  • New String - TA_matchMDLinks()returns an arry of Markdown links in the string.
  • New String - TA_mergeLines() merge lines into one line, allowing for various configuration options.
  • New String - TA_wikiLinkContent() fetch an array of Drafts wiki links from a string.
  • Doc Fix: Corrected an error in Editor for the TA_loadAc() function's example.
  • Doc Fix: Typo in TadMiscellaneous functions TA_sleep(), TA_sleepMS(), and TA_sleepMSDisplay() descriptions.
  • Doc Fix: Error in String documentation, remove accidentally added (duplicate) Editor Taskpaper function information.
  • Doc Fix: Added details around regular expression use to String functions TA_removeLinesContaining() and TA_removeLinesNotContaining(). (Andreas_Haberle)
  • Doc Fix: Typo in RegExp function TA_escape().
  • Doc Fix: Fixed missing parameter details and JavaScript example not being displayed in RegExp function TA_escape().

2020-10-31

  • Fix: tadMisc - renamed fixPoorDiscourseJavaScriptOnClipboard() to TA_fixPoorDiscourseJavaScriptOnClipboard().
  • Fix: tadMisc - applied a workaround for a race condition on updating tags in TA_devSetRunDraft(). (Andreas_Haberle)
  • Fix: App - renamed fileImporterBasic() and fileImporterTagEnabled() to TA_fileImporterBasic() and TA_fileImporterTagEnabled() respectively.
  • Fix: String - removed debugging code from TA_fixPoorDiscourseJavascript().

2020-10-26

  • New: TadHTMLPrompt - TA_textFieldLarge() for displaying a large text entry field with count up/down and max length limitation.
  • New: TadMiscellaneous - fixPoorDiscourseJavaScriptOnClipboard() for fixing JavaScript from Discourse on the clipboard.
  • New: Draft - TA_devBeautifyJSDraft() format a draft containining JavaScript using the JS Beautifier library.
  • New: Draft - TA_exportOutsideMacSandbox() exports a file outside of the iCloud sandbox on macOS (utilises a shell script).
  • New: Draft - TA_randomLine() return a random line of text from a draft.
  • New: Draft - functions for function processing all content lines - TA_processLinesFunctionRetain(), TA_processLinesFunctionReplace().
  • New: Editor - functions for function processing all selected content as lines - TA_processExtendedLinesFunctionRetain(), TA_processSelectedLinesFunctionReplace().
  • New: Editor - functions for function processing the extended selection as lines - TA_processSelectedLinesFunctionReplace(), TA_processExtendedLinesFunctionReplace().
  • New: Editor - functions for Taskpaper task project management - TA_taskpaperModifyCurrentLineProject(), TA_taskpaperToggleCurrentLineProject(), TA_taskpaperSetCurrentLineToProject(), TA_taskpaperSetCurrentLineToNotProject(), TA_taskpaperToggleSelectedProject(), TA_taskpaperToggleExtendedProject(), TA_taskpaperSetSelectedToProject(), TA_taskpaperSetExtendedToProject(), TA_taskpaperSetSelectedToNotProject(), TA_taskpaperSetExtendedToNotProject().
  • New: Editor - functions for Taskpaper task item management - TA_taskpaperModifyCurrentLineTask(), TA_taskpaperToggleCurrentLineTask(), TA_taskpaperSetCurrentLineToTask(), TA_taskpaperSetCurrentLineToNotTask(), TA_taskpaperToggleSelectedTask(), TA_taskpaperToggleExtendedTask(), TA_taskpaperSetSelectedToTask(), TA_taskpaperSetExtendedToTask(), TA_taskpaperSetSelectedToNotTask(), TA_taskpaperSetExtendedToNotTask().
  • New: Prompt - TA_promptButtonArrayValue() returns a value associated with a button for a prompt of an array of buttons.
  • New: Prompt - TA_promptButtonAction() returns an action name associated with a button for a prompt of an array of buttons.
  • New: String - TA_devBeautifyJS() format a JavaScript string using the JS Beautifier library.
  • New: String - TA_fixPoorDiscourseJavascript() added for fixing and formatting JavaScript posted to Discourse forums without code block wrappers.
  • New: String - TA_processLinesFunction() process each line in a string with another function.
  • New: String - TA_randomLine() return a random line of text from a string.
  • New: String - TA_rot13() - ROT13 cipher function, useful for fcbvyref (spoilers).
  • New: String - TA_taskpaperModifyProject() - toggle/set/remove Taskpaper project identifier on a string.
  • New: String - TA_taskpaperModifyTask() - toggle/set/remove Taskpaper task identifier on a string.
  • Update: Modified TadLibrary.beautifierSettings to use beautifier.json. (chrillek)
  • Doc Fix: Typo in TadLibrary.buildLibraryAction() description.
  • Update: Modified TadMiscellaneous.TA_devBeautifyJSDraft() to use Draft.TA_devBeautifyJS().
  • Doc Fix: Typo in TadHTMLPrompt.TA_textFields().
  • Doc Fix: Added omitted TadLibrary.beautifier* settings.
  • Doc Fix: Fixed error in example for Prompt.TA_promptButtonArray() and a typo.
  • Doc Fix: Added omitted documentation for Prompt.TA_promptButtonArrayIndexed().
  • Doc Fix: Various typos and grammatical corrections in home page information.
  • Doc Fix: Incorrect metadata function names in change log for 2020-08-08.

2020-10-10

  • New: Editor - functions for adding and removing text to lines while retaining the same effective selection - TA_prependLinesRetainSelection(), TA_unprependLinesRetainSelection(), TA_appendLinesRetainSelection(), TA_unappendLinesRetainSelection().
  • New: Editor - functions for working with the sections created by navigation markers - TA_sectionGetContentByIndex(), TA_sectionGetContentByHeading(), TA_sectionGetIndexesForHeading(), TA_sectionWrapByIndex(), TA_sectionAppendByIndex(), TA_sectionPrependByIndex(), TA_sectionWrapByHeading(), TA_sectionAppendByHeading(), TA_sectionPrependByHeading(), TA_sectionHeadingByIndex(), TA_sectionBodyByIndex(), TA_sectionBodyByHeading(), TA_sectionGetHeadings().
  • New: Prompt - TA_promptButtonArrayIndexed() - get the index of selected button from an array of buttons in a prompt.
  • Update: Prompt - modifified some code to compact some simple conditionals down to single lines to aid readability.
  • Doc Fix: Editor - TA_isTextSelected() - typo in function name.
  • Doc Fix: Editor - TA_mdScriptSelectedText() - typo in function description.

2020-09-28

  • Doc Fix: Workspace - TA_selectWorkspace() - added some more details about return on cancel.
  • Bug Fix: Workspace - TA_selectLoadWorkspaceByButton() - correction of a length to a null check on cancel of workspace selection. (FlohGro)

2020-09-27

  • New: Action - TA_getAllActions() - class method to retrieve action objects for all installed actions.
  • New: Action - TA_actionPopulateMore() - populates an action with several additional properties (also documented in the class).
  • New: App - line based content insertion functions - fileImporterBasic(), fileImporterTagEnabled().
  • New: Draft - file import functions - TA_addAfterLine(), TA_addAtStartOfLine(), TA_addAtEndOfLine().
  • New: Draft - TA_tagAddArray() - add an array of tags to a draft.
  • New: Math - TA_isOneIn() - generates Boolean based on a 1 in N chance of occurrence.
  • New: String - functions for purposefully adding corruptions to text for checking spell check, etc. - TA_mistypeSlip(), TA_mistypeSlipQWERTY(), TA_mistypeSwitch().
  • New: String - functions for working with simple front matter content - TA_frontMatterIncluded(), TA_frontMatterSimpleKeyValue().
  • New: String - functions for removing text from the start and end of a string - TA_startsWithRemove(), TA_endsWithRemove().
  • New: String - TA_randChar() - generates Boolean based on a 1 in N chance of occurrence.
  • Update: Library file now built to includes additional markers denoting what sub-module file was used in populating a section of the library file.
  • New: String - TA_csvToArray() - converts comma separated values to an array with better reliability than a split(",") alone would provide.
  • Update: Draft - TA_tagAddCSV() modified to utilise TA_tagAddArray().
  • Doc Fix: Added description for TadLibrary.metaPath.
  • Doc Fix: Revised some of the descriptions around Draft.TA_meta*() functions.
  • Doc Fix: Various typo corrections across the site.

2020-09-05

  • New: TadHTMLPrompt - new class for displaying some standardised HTML Prompts.
  • New: TadLibrary - new back link related settings.
  • New: ActionGroup - functions for returning count information about all action groups - TA_actionGroupCounts(), TA_actionGroupActionCount(), TA_actionGroupSeparatorCount().
  • New: ActionGroup - functions for returning information about an action group - TA_actionNames(), TA_separatorNames().
  • New: App - TA_toggleThemeMode() - switches the app theme between light and dark.
  • New: App - functions for returning count information about all action groups - TA_actionGroupCounts(), TA_actionGroupActionCount(), TA_actionGroupSeparatorCount().
  • New: App - functions for returning information about and across action groups - TA_actionNames(), TA_actionGroupNames(), TA_getActionGroupActionNames(), TA_getActionGroupSeparatorNames().
  • New: Draft - TA_backLinkAdHoc() - display a list of drafts that backlink to a draft using any of the wiki-link methods, along with some draft data, and allow the user to select to load a draft.
  • New: Draft - TA_backLinkSectionInsertLink() - insert a draft wiki-style cross-link into a special back-link section of a draft; useful to create a back-link when also creating a fore link in another draft.
  • New: Draft - TA_bodyFirstNonBlankLine() - return the first non-blank line in a draft, after the title.
  • New: Draft - TA_mdTitleLinks() - convert unlinked URLs in a draft to Markdown links using the page title of the URL as the link text.
  • New: Draft - functions for version counts - TA_versionCount(), TA_versionCountMax(), TA_versionDraftMax().
  • New: Editor - TA_isTextSelected() - check function for if any text is currently selected in the editor.
  • New: Editor - TA_loadAcUUID() - load draft with specified UUID into editor and activates.
  • New: Editor - functions for expanded copy & paste - TA_extendedCopy(), TA_extendedCut().
  • New: String - TA_mdTitleLinks() - convert unlinked URLs to Markdoown links using the page title of the URL as the link text.
  • New: String - TA_removeMDHeader() - remove Markdown heading markers from a string.
  • New: String - TA_trimToSnippet() - trims a string down to a maximum length and adds an ellipsis to indicate it was longer, where necessary;
  • Update: Draft - TA_draftCountSummary() - now includes count information for Action Groups, a little draft versions information, and a typo correction.
  • Update: HTTP - TA_getTitleFromURL() - now trims whitespace from the title.
  • Doc Fix: Various typo corrections across the site.

2020-08-08

  • New: TadLibrary - testLibsAlert - added a new property to allow the test libraries alert to be disabled as it can slow things down if you use the library functionality a lot.
  • New: TadMiscellaneous - additional code execution functions - TA_devExecuteRunSelection(), TA_devExecuteRunSelectedLines(), TA_devExecuteRunCurrentDraft().
  • New: TadMiscellaneous - TA_playSoundPath() and TA_playMP3Data() - triggering of audio playback (Mac only).
  • New: TadMiscellaneous - TA_decimalSeparator() - returns the decimal separatror character.
  • New: App - additional clipboard management functions - TA_clipboardAppend(), TA_clipboardPrepend(), TA_clipboardEmpty().
  • New: Draft - functions for working with custom, peristent, meta data for a draft: TA_metaRead(), TA_metaWrite(), TA_metaTag().
  • New: FileManager - functions to work with files where a file path is associated with a draft in its meta data - TA_fileMetaPath(), TA_fileMetaSave(),
  • New: Math - TA_frac() - get the fractional part of a number to "reasonable" precision.
  • New: String - functions for removing lines that match or don't match a substring: removeLinesStarting(), removeLinesNotStarting(), removeLinesEnding(), removeLinesNotEnding(), removeLinesContaining(), removeLinesNotContaining(), TA_fileMetaLoad();
  • New: String - TA_removeTrailingNewlines() - removes new line characters from the end of a string.
  • New: Workspace - TA_loadWorkspaceNext() & TA_loadWorkspacePrevious() - allow cycling through workspaces in the order defined in Drafts.
  • Update: TadLibrary - TA_libraryTestLibLoad() - now uses testLibsAlert to determine if testing should be alerted to on each run.
  • Doc Fix: TadMiscellaneous - TA_JSONArraySorter() - missing documentation added.
  • Doc Fix: Math - TA_randInt() - correction of example.
  • Doc Fix: Various typo corrections across the site.

2020-08-01

  • New: TadConsole - new log entry retrieval functions TA_filterLog(), TA_filterLogEntry(), TA_filterLogEntries(), TA_logEntryFirst(), TA_logEntryLast(), TA_logEntryFirstType(), TA_logEntryLastType(), TA_logEntryFirstCode(), TA_logEntryLastCode(), TA_logEntryFormat().
  • New:TadLibrary property, encodeMap used to define a set of URL encoding mappings for a new string function.
  • New:TadLibrary - TA_buildLibraryAction() used to rebuild the libarry action from file. Doing it by hand occasionally crashes the Mac app because the script step is so large. Doing this programmatically without dabbling in the UI gives a much quicker result with vastly reduced risk of crashing.
  • New: TadMiscellaneous - TA_JSONArraySorter() - JSON array sort comparator function.
  • New: Prompt - TA_confirm() - confirmation prompt that allows the user to selecte a yes/no response.
  • New: String - new overwriting and inserting functions: TA_overwriteRange0(), TA_overwriteRange1(), TA_insertAfter0(), TA_insertAfter1().
  • New: String - TA_replaceAllMap() - carries out a set of multiple text replacements based on a set of key value pairs.
  • New: String - TA_encodeURI() - applies a more extensive and extensible range of URL encoding than encodeURIComponent().
  • Update: Prompt - TA_promptButtonArray() - added an optional parameter to hide the cancel button.
  • Bug Fix: TadConsole - TA_saveLog() - fixed attempt to capture draft version information before first draft has been created. (BJB)
  • Bug Fix: Prompt - TA_promptButtonArray() - fixed message entry not displaying.
  • Doc Fix: TadConsole_logEntry - Corrected description.
  • Doc Fix: Various typo corrections across the site.

2020-07-25

  • New: TadConsole - new class for advanced console-like logging.
  • New: Math - TA_randInt() - generates a random integer between two values (inclusive).
  • New: Editor - new word wrapping functions: TA_selectionPrependWords(), TA_selectionAppendWords(), TA_selectionWrapWords(), TA_selectionDelimitWords().
  • New: FileManager - TA_delete() - file deletion.
  • New: FileManager - TA_snapshot() - timstamped file duplication.
  • New: HTTP - TA_quoteSimpsons() - access The Simpsons quote generator to get a random character quote.
  • New: String - new word wrapping functions: TA_prependWords(), TA_appendWords(), TA_wrapWords(), TA_delimitWords().
  • New: String - new file path functions: TA_fileNameFromPath(), TA_fileNameBaseFromPath(), TA_fileNameExtensionFromPath(), TA_fileNameRemoveExtensionFromPath(), TA_folderPathFromPath().
  • New: TadMiscellaneous - TA_getTimestampyyyyMMddhhmmssxxx() - generates timestamps accurate to milliseconds.
  • New: TadMiscellaneous - TA_uuidv4() - UUID generator.
  • Update: TadMiscellaneous - TA_getTimestampyyyyMMddhhmmss() - changed to use a better element padding technique.
  • Bug Fix: Draft - TA_selectRecentTagRename() - Corrected to include display summary information parameter described in documentaion.
  • Bug Fix: Draft - TA_selectAnyTagDelete() - Corrected to include display summary information parameter described in documentaion.
  • Bug Fix: Draft - TA_selectRecentTagDelete() - Corrected to include display summary information parameter described in documentaion.
  • Doc Update: Revisions across the library to display Optional label against optional function parameters.
  • Doc Fix: Draft - TA_tagAddCSV() - Corrected example to not use a single item array as the parameter.
  • Doc Fix: Draft - TA_draftNew() - Corrected example to include an example parameter.
  • Doc Fix: Draft - TA_dictateList() - Corrected to include some missing parameter definitions.
  • Doc Fix: HTTP - TA_randomInteger() - Added missing details about parameters.
  • Doc Fix: Prompt - TA_promptButtonArray() - Corrected to specify that p_strMessage parameter can be set to an empty string, but is not an optional parameter.
  • Doc Fix: Prompt - TA_doubleTextFieldPrompt() - Corrected to specify that default value parameters can be set to be empty strings, but are not optional parameters.
  • Doc Fix: String - TA_capitalise() - Corrected structure of the example.

2020-07-14

  • Bug Fix: Fix for duplication of '.js' on library naming. (FlohGro)

2020-07-12

  • Bug Fix: Re-added TadCommand class to library build scripts for rebuild and redistribution.

2020-07-10

  • Initial release.