From a4cde3fe417e2d039e9079e5f7f4813b801510d3 Mon Sep 17 00:00:00 2001 From: tduva Date: Sun, 15 Jan 2023 05:21:11 +0100 Subject: [PATCH] v0.22 files --- help/help-about.html | 2 + help/help-custom_commands.html | 175 ++++++++++++++++++++++++++++----- help/help-releases.html | 47 ++++++++- help/help-settings.html | 20 +--- help/help.html | 23 +++-- help/style.css | 16 +++ index.html | 16 +-- 7 files changed, 238 insertions(+), 61 deletions(-) diff --git a/help/help-about.html b/help/help-about.html index eb68b5b..2d282e5 100644 --- a/help/help-about.html +++ b/help/help-about.html @@ -38,6 +38,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.Java-WebSocket (MIT), SLF4J (MIT)
  • JTattoo by MH Software-Entwicklung (GPLv2 or later)
  • +
  • FlatLaf by FormDev + (Apache License 2.0)
  • Txtmark ("Apache License 2.0")
  • Apache HttpComponents Client ("Apache License 2.0")
  • diff --git a/help/help-custom_commands.html b/help/help-custom_commands.html index 7fe00c0..f1b7e84 100644 --- a/help/help-custom_commands.html +++ b/help/help-custom_commands.html @@ -233,7 +233,7 @@ Description - All + All chan The current channel context (without leading #) @@ -247,10 +247,6 @@ All currently open regular channels (separated by spaces, without leading #) - - hostedChan - The currently hosted channel (if any) - streamstatus Stream Status (Title/Game or Offline) @@ -443,15 +439,49 @@ replacement: $(1-) -> $join(1-,/)

    +

    Functions by topic (ones marked with * are not available in every context):

    + +

    The following functions are always available:

    -
    $if(<identifier>,<output if exists>,[output if not])
    +
    $if(<identifier>,<output if exists>,[output if not])
    If the value the identifier refers to exists (non-empty), it will return the first function parameter, the second otherwise.
    Example: $if(1,$1,nope) with command parameters cheese cake turns into cheese, with no parameters turns into nope, the optional [output if not] function parameter.
    -
    $ifeq(<identifier>,<comparison>,<output if equal>,[output if not])
    +
    $ifeq(<identifier>,<comparison>,<output if equal>,[output if not])
    Similar to $if, but instead of just checking for the existence of a parameter it compares it to a given value (<comparison>).
    @@ -460,31 +490,36 @@ cheese cake turns into an an empty string, since the optional [output if not] has not been specified. -
    $switch(<identifier>,<case1>:<result1>,..,[casen]:[resultn],[default])
    +
    $switch(<identifier>,<case1>:<result1>,..,[casen]:[resultn],[default])
    Similiar to a switch statement in programming, or one or several $ifeq() functions. Compares the value associated with the identifier with the case values and returns the following result if it matches. If none of the case values match, it will return the default, or an empty value.
    Example: /set fontSize $switch($get(fontSize),25:50,50:18,25) when added as a Custom Command alternates between font sizes 18, 25 and 50.
    -
    $join(<identifier>,<separator>)
    +
    $join(<identifier>,<separator>)
    Joins together the arguments the identifier refers to, using the given separator.
    Example: $join(1-,/) with 1- referring to flour sugar eggs turns into flour/sugar/eggs
    This effectively replaces spaces in the parameters with the separator.
    -
    $lower(<identifier>)
    +
    $lower(<identifier>)
    Makes the given input lowercase.
    Example: $lower(1) with 1 referring to Fremily turns into fremily.
    -
    $upper(<identifier>)
    +
    $upper(<identifier>)
    Makes the given input uppercase.
    Example: $upper(1) with 1 referring to Fremily turns into FREMILY.
    -
    $replace(<input>,<search>,<replace>,[method]) +
    $trim(<input>)
    +
    Removes leading and trailing space (U+0020 and lower, using the + String.trim() method).
    +
    Example: $trim( abc ) turns into abc.
    + +
    $replace(<input>,<search>,<replace>,[method])
    Search and replace in text.
    Especially when using Regex, remember escaping \ (\\) and $ (\$) @@ -512,14 +547,14 @@
    Example: $replace(Was timed out for 30 seconds,.*?(\\d+) seconds,Number of seconds: \$1,regRef) turns into Number of seconds: 30
    Example: $replace($1-,$"~([a-z]+)~",$replace($(g1),$"(\w)",$"$1+",regRef),regCustom) adds + behind every character surrounded by ~ (the inner $replace() is in the replace parameter and executed for each match)
    -
    $rand([output1],[output2],[output3],..)
    +
    $rand([output1],[output2],[output3],..)
    Randomly chooses one of the outputs.
    Example: $rand(cheesecake,strawberry cake,$1-) with 1- referring to apple pie turns into either cheesecake, strawberry cake or apple pie.
    -
    $randnum(<from>,<to>) or $randnum(<to>)
    +
    $randnum(<from>,<to>) or $randnum(<to>)
    Randomly chooses a number in the given range (inclusive). If only one number is given, it the range is 0 to the given number. If the "from" is not a number, it defaults to 0, if the "to" is not a @@ -529,7 +564,7 @@
    Example: $randum($$1) chooses a random number between 0 and what is the first parameter.
    -
    $calc(<simple math expression>)
    +
    $calc(<simple math expression>)
    Limited support for performing calculations, with binary operators (* / % + -) and functions (sqrt() sin() cos() tan()).
    Example: //echo $calc(2^3) $calc( (3+4\) / 2) @@ -540,7 +575,7 @@ (this uses $" " to specify literal text instead of escaping the parenthesis with a backslash).
    -
    $round(<number>,[numDecimalPlaces],[roundingMode],[minNumDecimalPlaces])
    +
    $round(<number>,[numDecimalPlaces],[roundingMode],[minNumDecimalPlaces])
    Round a number to the given amount of decimal places, with a rounding mode of empty (half-up), ceil, floor, @@ -551,13 +586,13 @@
    Example: //echo $round(345.5,3,floor,3) outputs 345.500 (fills up to 3 decimal places)
    Example: //echo $round(2.565,2,,2) outputs 2.57 (uses default rounding mode)
    -
    $urlencode(<input>)
    +
    $urlencode(<input>)
    Uses UrlEncoder.encode() to prepare the input to be used in a URL query parameter.
    Example: $urlencode($(msg)) in User Dialog encodes the currently selected message.
    -
    $sort(<input>,[type],[separator])
    +
    $sort(<input>,[type],[separator])
    Sorts the given input alphabetically. The sort type can be "abc" (default) for case-insensitive sorting or "Abc" for case-sensitive sorting. The separator is what separates the parts that are sorted, @@ -565,18 +600,19 @@
    Example: $sort(B c a) turns into a B c
    Example: $sort(B c a,Abc) turns into B a c
    -
    $input([message],[intial],[type])
    +
    $input([message],[intial],[type])
    Requests text input from the user by showing an input dialog. Execution is paused while the dialog is open. The user may enter an empty value (the result is just empty) or cancel the dialog (the command will not be executed).
    The message is shown in the input dialog, the initial text will already be in the input field when the dialog opens. The - type is currently not used and can just be left empty.
    + type can be set to simple to use the + previously default simple input dialog.
    Example: $input()
    Example: $input(Enter a number please)
    -
    $datetime([format],[timezone],[locale],[unix time])
    +
    $datetime([format],[timezone],[locale],[unix time])
    Outputs the current date/time. You can optionally give a format pattern (based on DateTimeFormatter), a timezone (based on ZoneId, @@ -634,12 +670,98 @@
    (Preset format, with timezone, no locale, with a time specified in milliseconds since 1970-01-01 00:00:00 UTC.)
    + + +
    $json(<input>,<output>)
    +
    Parse the JSON in <input> and use in <output>, + where $j(<path>,[default]) can be used to access specific values. + The JSON input could e.g. come from the $request() + function.
    +
    If the path isn't formatted correctly or the JSON is invalid the + command may not work. Check out the Debug Log (e.g. Extra - Debug + window) to find out what went wrong.
    +
    The <path> specifies what value to return from + the $j(<path>,[default]) function, whereas the optional [default] + value will be returned if the path is not valid or points to an empty value.
    +
    In the <path> you specify keys of JSON objects + separated by -> (e.g. key1->key2->key3) or + indices of JSON arrays in brackets [ ] (e.g. key1[0] + for the first element of the array key1). Additionally the brackets [ ] + can contain: +
    +
    Examples with the following JSON as input: +
    +    {
    +        "books":[
    +            {"title":"book1", "author":"author1", "tags":["tag1","tag2"]},
    +            {"title":"book2", "author":"author2", "tags":["tag1"]},
    +            {"title":"book3", "author":"author2", "tags":["tag1", "tag3"]},
    +            {"title":"book4", "author":"author2"}
    +        ],
    +        "numBooks": 4,
    +        "numAuthors": 2
    +    }
    +
    +
    $json($get(var,j),There are $j(numBooks) books of $j(numAuthors) authors.)
    +
    $json($get(var,j),There are $j(books[size]) books of $j(books->[collect:author][unique][size]) authors.)
    +
    There are 4 books of 2 authors.
    +
    Reading the "num" values provided in the JSON or determining + the same information from the "books" array.
    + +
    $json($get(var,j),The last book is called $j(books[last]->title) by $j(books[last]->author).)
    +
    The last book is called book4 by author2.
    + +
    $json($get(var,j),The first book is $j(books[0]))
    +
    The first book is {"author":"author1","title":"book1","tags":["tag1","tag2"]}
    +
    If the end of the specified path is a JSONArray or JSONObject + it will be returned as a JSON encoded String.
    + +
    $json($get(var,j),$j(books[10]->title,Book not found))
    +
    Book not found
    +
    Since the index 10 does not exist, the default + value Book not found is returned. If no default + value is provided an empty string would be returned.
    + +
    $json($get(var,j),Books of author2: $j(books[filter:author=author2][collect:title]))
    +
    Books of author2: ["book2","book3","book4"]
    + +
    $json($get(var,j),Tags of author2: $j(books[filter:author=author2][combine:tags][unique]))
    +
    Tags of author2: ["tag1","tag3"]
    + +
    $json($get(var,j),Tags of author2: $j(books[filter:author=author2][combine:tags][unique][join]))
    +
    Tags of author2: tag1, tag3
    +
    + You can test these examples yourself if you store the JSON in the + variable "j" using the command /set var j copyJSONfromabove + and then use the //echo $json($get(var,j),...) command + in the chat inputbox + to output an info message with the result in chat. Pasting the JSON + directly into the $json() function would require + escaping the , characters to work. +

    The following functions are only available in some contexts:

    -
    $is(<match input>)
    +
    $is(<match input>)
    Outputs true if the match succeeds, nothing otherwise. The match input is in the Highlight format, although what can actually be matched against depends on @@ -649,7 +771,7 @@ will output I'm a mod in channels where you are the broadcaster or a moderator, Not a mod otherwise.
    -
    $get(<settingName>,[key])
    +
    $get(<settingName>,[key])
    Returns the value of a setting. Different setting types return differently formatted values. There is no comprehensive list of settings, unless you count the Chatty source.
    @@ -662,7 +784,7 @@
    Example: $if($get(ontop),ONTOP) will return ONTOP only if "View - Always on top" is enabled.
    -
    $request(<url>,[options])
    +
    $request(<url>,[options])
    Performs a GET request on the given http/https URL and returns the body of the reponse interpreted as UTF-8 encoded text. If an error occurs the response will be empty.
    @@ -670,6 +792,11 @@
    Note: Normally Custom Commands are performed instantaneously, however the replacements for any Custom Command that contains the $request() diff --git a/help/help-releases.html b/help/help-releases.html index ab23b4b..4b31077 100644 --- a/help/help-releases.html +++ b/help/help-releases.html @@ -17,6 +17,7 @@

    Release Information

    + 0.22 | 0.21 | 0.20 | 0.19 | @@ -70,10 +71,52 @@ full list of changes.

    - Version 0.21 (This one!) (2022-10-17) + Version 0.22 (This one!) (2023-01-15) [back to top]

    -

    Twitch has announced that Twich chat comands will be removed from IRC in +

    +### Twitch Features
    +- Added chat message for outgoing raids with join link (due to API limits only
    +  in at most 10 live channels)
    +- Show poll start/end messages (broadcaster only)
    +- Added shield mode commands and display (for moderators)
    +
    +### Custom Commands
    +- Added "Anonymous Custom Command" hotkey action, where a Custom Command can be
    +  entered directly (instead of a the name of a Custom Command)
    +- Added function `$trim()` to remove leading and trailing whitespace
    +- Added `trim` option to `$request()`
    +- Added function `$json()` to parse JSON and access specific values
    +- Changed `$input()` inputbox to have the same features as the channel inputbox
    +  if run in a channel context
    +- Added `/exportText` options `-A` and `-L`
    +
    +### Other
    +- Added FlatLaf (new modern Look&Feel, selectable in the "Look" settings)
    +- Added feature to make a popout with one channel transparent
    +- Made AutoMod dialog dockable
    +- Improved Settings Dialog
    +- Removed SRL menu
    +- Removed some hosting related stuff, added raid context menu entries
    +- Added setting whether to hide tab pane when only a single channel is open
    +  (hidden by default, as was the previous behaviour)
    +- Added local caching to Pronouns for more reliability and faster display
    +- Added new Chatty icons to img folder
    +- Added context menu setting to Live Streams list to only show favorites
    +- Updated help
    +
    +### Bugfixes
    +- Fixed `/color` command not being able to set some default colors
    +- Fixed error occuring for some commands when no parameter is provided
    +- Fixed commands `/unvip` and `/unmod`
    +- Fixed channels sometimes not opening in the correct popout
    +    
    + +

    + Version 0.21 (2022-10-17) + [back to top] +

    +

    Twitch has announced that Twitch chat comands will be removed from IRC in February 2023, so they need to be migrated to the API. You will need to update your login with additional access scopes to be able to use most commands in this update.

    diff --git a/help/help-settings.html b/help/help-settings.html index 3490b38..752e87a 100644 --- a/help/help-settings.html +++ b/help/help-settings.html @@ -1376,10 +1376,6 @@
    user:name chan:tirean,gocnak
    Ignores the user with the name name in channels #tirean and #gocnak
    -
    config:info subscribed to
    -
    Ignores the x has subscribed to y info messages that - you get when someone subscribes in the channel that is being hosted
    -
    cat:ignore !chan:lotsofs,joshimuz
    Ignores users in the addressbook category ignore in all channels, except #lotsofs and #joshimuz
    @@ -1919,21 +1915,7 @@

    Other

    -
    -
    Auto-Unhost when your stream goes live
    -
    Automatically - sends the /unhost command to your channel if you started - your stream session in the last 15 minutes and the stream status - changes (usually from offline -> live).
    - For this to work, you need to have joined the channel in Chatty, - either with the broadcaster account (so your own account if it's - your stream) or with an account that is an editor in the channel - (in which case you also have to add the channel to the - autoUnhostStreams setting, via - /add autoUnhostStreams <streamName>, in order to - tell Chatty that you are authorized/want to use the automatic /unhost - feature in that channel).
    - +
    Prepend to window title
    Add some arbitrary text to the beginning of the window title. This can be useful if you run several instances of Chatty (to be able to diff --git a/help/help.html b/help/help.html index 50f24b0..ed92a4b 100644 --- a/help/help.html +++ b/help/help.html @@ -5,7 +5,7 @@ -

    Chatty (Version: 0.21)

    +

    Chatty (Version: 0.22)

    @@ -194,7 +194,7 @@ function getDownloads(tag) {
    @@ -117,11 +117,11 @@

    In addition, the titlebar will also show additional information, if enabled:

      -
    • The name of the channel that is being hosted
    • Sub for Subscriber-Only Mode
    • Slow: <time> for Slowmode
    • R9k for R9Kbeta Mode
    • EmoteOnly for Emote-Only Mode
    • +
    • Shield if Shield Mode is enabled (moderators only)
    • A language code if Broadcaster Language Mode is enabled
    • [FM] indicates a websocket connection (F for FrankerFaceZ, M for PubSub/Modlogs)
    • @@ -269,12 +269,12 @@
    • /timeout, /ban, /unban, /slow, /slowoff, /subscribers, /subscribersoff, - /clear, /mods, /host, - /unhost, /raid, /unraid, + /shieldMode, /shieldModeOff, + /clear, /mods, + /raid, /unraid, /color just like in normal Twitch Chat
    • /join <channel> - Joins the given channels, see Joining Channels for more information
    • -
    • /joinhosted - Join currently hosted channel (if any)
    • /part or /close - Leaves the current channel
    • /rejoin - Rejoins the channel (without clearing users or chat)
    • /reconnect - Disconnects and reconnects
    • @@ -360,7 +360,15 @@
    • /showJavaDir / /openJavaDir - Show/open the directory of the JRE used by Chatty
    • /showFallbackFontDir / /openFallbackFontDir - Show/open the directory where Java looks for fallback fonts
    • /showTempDir / /openTempDir - Show/open the system's temp directory
    • -
    • /exportText [-sna] <fileName> <text> - Write the text to a file in the "exported" directory in the settings directory (UTF-8), -s for no info message when writing successfully, -n for replacing "\n" in the text with a newline, -a for appending to the file (Example: /exportText -n abc.txt one\ntwo - Writes "one" and "two" as separate lines)
    • +
    • /exportText [-sna] <fileName> <text> - Write the text to a file in the "exported" directory in the settings directory (UTF-8) +
        +
      • -s - no info message when writing successfully
      • +
      • -n - replace "\n" in the text with a newline
      • +
      • -a - append to the file (instead of overwriting it)
      • +
      • -A - append to the file and append a newline character
      • +
      • -L - append to the file on a new line (prepend a newline character)
      • +
      + (Example: /exportText -n abc.txt one\ntwo - Writes "one" and "two" as separate lines)
    • /refresh <emoticons/badges/ffz/ffzglobal/bttvemotes> - Refresh the given data from it's respective API:
        @@ -387,8 +395,7 @@
      • /testNotification [channel] - Display a test notification (optionally with channel, which means right-clicking on the notification will join that channel)
      • /debug simulate <type> - Simulates a chat message - for testing. Some possible types: sub, resub, - bits, authost. + for testing. See the Chatty source code for possible values.
      • /debug allows for a number of debug commands to be run, but those may produce errors and strange behaviour, so you usually diff --git a/help/style.css b/help/style.css index b1f7ad3..d1a1901 100644 --- a/help/style.css +++ b/help/style.css @@ -1,11 +1,26 @@ body { max-width: 700px; font-size: 1em; + color: black; background-color: #FDFDFD; font-family: Arial, sans-serif; padding: 10px; margin: 0; } +/** +The link color with some LaF might be wrong, so set it explicitly. However just +a:link and similar doesn't seem to work in Java, but targeting a changes the +color of all a tags, including , in normal browsers. So first set +everything with a "name" attribute to black for normal browsers (which would set +*all* of them to black in Java if it came second) and then set them to blue for +Java. +*/ +a[name] { + color: black; +} +a { + color: blue; +} h1 { margin: 4px 0 5px 0; font-size: 1.2em; @@ -41,6 +56,7 @@ li { } code { background-color: #EEEEEE; + font-size: 1em; } .codeblock { diff --git a/index.html b/index.html index 5609f82..bf3258e 100644 --- a/index.html +++ b/index.html @@ -16,9 +16,9 @@ function loaded() { { ceiling: null, text: "$years years ago" } ] } - document.getElementById("ago").innerHTML = "Version 0.21 released "+humanized_time_span("2022/10/17", Date(), custom_date_formats)+""; + document.getElementById("ago").innerHTML = "Version 0.22 released "+humanized_time_span("2023/01/15", Date(), custom_date_formats)+""; - getDownloads("v0.21"); + getDownloads("v0.22"); slideshow_init("slideshow"); } @@ -158,7 +158,7 @@ function getDownloads(tag) {

        Download

        -

        Choose one of the following downloads of Chatty Version 0.21. For older versions or betas go to the GitHub Releases. Checksums for release files are available as SHA-256 hashes.

        +

        Choose one of the following downloads of Chatty Version 0.22. For older versions or betas go to the GitHub Releases. Checksums for release files are available as SHA-256 hashes.

        If this is your first time using Chatty check out the Getting Started Guide.

        Windows

        @@ -170,11 +170,11 @@ function getDownloads(tag) {
    -
    Download Windows Standalone (Installer) Recommended
    +
    Download Windows Standalone (Installer) Recommended
    Install into a folder of your choice and start Chatty.exe (or optionally created shortcuts).
    -
    Download Windows Standalone (.zip)
    +
    Download Windows Standalone (.zip)
    Extract the .zip into a folder of your choice and start Chatty.exe.
    @@ -182,11 +182,11 @@ function getDownloads(tag) {
    -
    Download JAR-Version (Installer)
    +
    Download JAR-Version (Installer)
    Install into a folder of your choice and start Chatty.jar (or optionally created shortcuts).
    -
    Download JAR-Version (.zip)
    +
    Download JAR-Version (.zip)
    Extract the .zip into a folder of your choice and start Chatty.jar.

    Non-Windows

    -

    For OS other than Windows (e.g. Linux or MacOS) you will need to download the JAR-Version (.zip) and must have Java 8 or later installed on your system. Extract the .zip into a folder of your choice and start Chatty.jar.

    +

    For OS other than Windows (e.g. Linux or MacOS) you will need to download the JAR-Version (.zip) and must have Java 8 or later installed on your system. Extract the .zip into a folder of your choice and start Chatty.jar.

    Contact

    If you have any feedback or questions feel free to contact me. You can join the Chatty Discord preferred, write me an E-Mail or use Twitter.