Read about our upcoming Code of Conduct on this issue

  1. 08 Nov, 2015 1 commit
    • Leon Arnott's avatar
      Reinstated the debug notification for the (set:) macro · 2e3cd53e25b4
      Leon Arnott authored
      This was formerly removed in 6f68c369ce69, because the change in 4022efc59d4c that made (set:) return a special object instead of a string can be leveraged to supply the debug notification without passing it directly to userland code. This is fortunate indeed.
      
       * Updated the README to list version 1.2 details, and changed the version numbers.
      
       * Removed the still-in-development (enchant:) macro for now.
      2e3cd53e25b4
  2. 07 Nov, 2015 2 commits
  3. 20 Aug, 2015 1 commit
  4. 19 Aug, 2015 1 commit
  5. 17 Aug, 2015 1 commit
    • Leon Arnott's avatar
      Migrated build tools from Grunt to Make. · 6f8f191a159b
      Leon Arnott authored
      This toolshift should result in better running times for basic tasks, and a somewhat cleaner build script.
      
      Also, as a consequence, proper jshintrc files have been created in each codebase (the Harlowe source, and the test specs). However, due to the loss of grunt-contrib-jshint, a custom jshint reporter adapted from it must be included to retain its desirable reporting messages.
      6f8f191a159b
  6. 13 Aug, 2015 1 commit
    • Leon Arnott's avatar
      Fixed the (move:) macro, and improved its behaviour with hook references. · a0c223b7c944
      Leon Arnott authored
      Now, the (move:) macro should again correctly delete the value from the source after copying it to the destination. Also, new semantics for deleting a hook reference have been implemented: (move: ?a to $a) will, after copying, replace ?a's content with the empty string.
      
      Tests for the above have also been added.
      a0c223b7c944
  7. 08 Aug, 2015 1 commit
    • Leon Arnott's avatar
      Added container slice-indexing syntax to TwineScript. · cb71b041050e
      Leon Arnott authored
       * Now, authors can supply an array of property names to the "'s" and "of" property syntax to obtain a "slice" of the container. For instance, "(a: 'A','B','C')'s (a: 1,2)" will evaluate to a subarray of the first array, containing just 'A' and 'B'.
      
       * As well as creating subarrays, you can also get a slice of the values in a datamap - in effect, a subarray of the datamap's datavalues. You can do "(datamap:'Hat','Beret','Shoe','Clog','Sock','Long')'s (a: 'Hat','Sock')" to obtain an array "(a: 'Beret','Long')".
      
       * Additionally, you can obtain characters from a string - "abcde"'s (a: 2,4) becomes the string "bd". Note that for convenience, slices of strings are also strings, not arrays of characters.
      
       * Combined this with the (range:) macro, this essentially obsoletes the (subarray:) and (substring:) macros. However, those will remain for compatibility reasons for now.
      
       * Also added several more tests related to this and property indexing in general.
      cb71b041050e
  8. 28 Jul, 2015 1 commit
  9. 27 Jul, 2015 1 commit
    • Leon Arnott's avatar
      Converted (if:)/(unless:)/(elseif:)/(else:) to be changer macros rather than boolean value macros. · d15d6a463977
      Leon Arnott authored
      This change, a TODO for awhile, provides the following benefits: 1) authors are warned when their (if:) isn't attached to a hook, 2) it allows (if:) to be composed with other changers, such as (text-style:). However, there is, I admit, a potential problem: On creating a composed changer using, say, (if: $poweredUp), changing the value of $poweredUp won't change the value of the composed changer. This can be seen as functional side-effect hygeine, but it may be puzzling to authors.
      
      Also fixed the <audio> tests to work on browsers which lack Ogg support.
      d15d6a463977
  10. 26 Jul, 2015 1 commit
    • Leon Arnott's avatar
      Tightened up type-checking in a few areas related to (set:) · 134ebed27ab5
      Leon Arnott authored
       * Fixed a bug where (align:) commands didn't have structural equality with each other - (align:"==>") didn't equal another (align:"==>").
      
       * Added structural equality tests for several other changer command macros.
      
       * Now, (set:) and (put:) commands, as well as AssignmentRequests, are no longer accepted by macros that have an Any type-signature. Only passage prose (for the former) and (set:)/(put:) (for the latter) is a valid place for them.
      
       * Now, setting a markup string to a ?hookSet will cause that markup to be rendered in the hookset, instead of being used as raw text. Also, it is now an error to set a ?hookSet to a non-string.
      134ebed27ab5
  11. 25 Jul, 2015 1 commit
    • Leon Arnott's avatar
      Made certain values (like AssignmentRequests) unable to be stored or used in macros. · 4022efc59d4c
      Leon Arnott authored
      It always seemed a bit suspicious that values like "$a to 1" or even the return value of (set:) could be used in expression position inside macros without warranting an error. So, now this is the case - AssignmentRequests must now only be in (set:) or (put:) and not also any macro that accepts Any, and (set:)/(put:) can't be used inside other macros, but only in passage prose.
      
      Also added some tests related to direct variable printing and macro syntax.
      4022efc59d4c
  12. 21 Jul, 2015 1 commit
    • Leon Arnott's avatar
      A fix for <tw-story> enchantments, and a few others. · 6f68c369ce69
      Leon Arnott authored
       * Added a brief kludge that causes <tw-enchantment>s (such as those created by (enchant:)), wrapping <tw-story>, to have width:100% and height:100% to match it, thus allowing changers such as (background:) to work correctly on it.
      
       * Removed the debug notification for the (set:) macro, solely due to the fact that it interferes with the evaluation of (set:) when it's in expression position - and using the evaluation to provide the notification, which isn't meant to be a user-facing datatype, was assuredly bad. This also indirectly "fixes" the fact that (put:) didn't have a similar notification.
      
       * Altered (print:)'s internals such that when it receives a value it cannot print, it should throw a JS error, rather than return a TwineError - this allows the test cases to be a bit more robust, as invalid objects being passed to (print:) will cause the test to (usually) fail.
      
       * Added a test suite file for variable syntax and the (set:) macro. It still needs to be elaborated on, though.
      6f68c369ce69
  13. 12 Jul, 2015 1 commit
    • Leon Arnott's avatar
      Added (link-repeat:) and (link-reveal:), two new (link:) variations. · 566812eb4928
      Leon Arnott authored
       * (link-reveal:) is similar to (link:) except that the link text remains in the passage after it's been clicked - a desirable use-case which is now available. Note that this currently necessitates that the attached hook always appear after the link element in the text, due to how the attaching syntax works.
      
       * (link-repeat:) is similar to the above as well, but allows the link to be clicked multiple times, rerunning the markup and code within.
      
       * Also added (link-replace:) as an alias to the current (link:) macro, indicating how it differs from the others.
      
       * Also added an (enchant:) test file missing from previous commits.
      566812eb4928
  14. 08 Jul, 2015 1 commit
  15. 06 Jul, 2015 2 commits
  16. 05 Jul, 2015 2 commits
    • Leon Arnott's avatar
      Reinstated backslash-escaping in string literals. · eccb3bfb6315
      Leon Arnott authored
      I don't particularly like this odd ancient method of escaping characters, but it turns out it's required for compatibility with the link syntax's desugaring - so it's back, sadly.
      
      Also added some basic tests for primitive data literals' syntax.
      eccb3bfb6315
    • Leon Arnott's avatar
      Initial batch of post-1.1.0 bugfixes. · 797dad1e7c42
      Leon Arnott authored
       * Fixed a bug where hand-coded <audio> elements inside transitioning-in elements would be detached by .unwrap(), and thus stop working. Now, any <tw-transition-container> elements which contain <audio>s will no longer be unwrapped, but instead have their CSS class nullified. (Note that Utils.transitionOut() will still wrap(), and thus silence, <audio>-containing structures.)
      
       * Now, save files should be properly namespaced with each story's IFID - stories in the same domain will no longer share save files.
      
       * Fixed a bug where (live:) macros would run one iteration too many when their attached hook triggered a (goto:). Now, (live:) macros will always stop when their passage is removed from the DOM.
      
       * Ported the HTML parsing bugfix from commit c0b3ba48b349.
      797dad1e7c42
  17. 01 Jul, 2015 1 commit
    • Leon Arnott's avatar
      Added a rudimentary implementation of HTML element selectors. · 8afef76c224b
      Leon Arnott authored
      Now, enchantment and revision macros like (replace:), when given a string formatted like "<tag>", will select HTML tags in the passage, or the <tw-story> itself if the string is "<tw-story>". This allows such macros to remain scoped to their passages, while still allowing the <tw-story> to be enchanted. This is the basis for page-wide CSS-esque styling.
      
      As this is a preliminary syntax enhancement, there's no test case for it yet.
      
      Also:
      
       * Reinstated the reverted CSS changes from commit 274.
      
       * Improved (background:) to now set the enchantment's display to "block" if it probably contains a block element.
      8afef76c224b
  18. 30 Jun, 2015 1 commit
  19. 28 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Fixed bugs preventing the story format from loading in TwineJS. · 3234ca0f1a8a
      Leon Arnott authored
      These bugs had to do with Babel replacing certain 'this' occurrences with 'undefined'. This has been forcibly hammered down by using eval('this') in their place. Hrmm.
      
      Also confirmed the update to npm3 and its shallow node_modules directory, by changing a few build paths.
      
      Also added an experimental (enchant:) macro that enchants the given hooks or pseudo-hooks with the given changer. This will hopefully assist in the goal of producing an all-macro stylesheet API, one of Harlowe's long-term design goals.
      3234ca0f1a8a
  20. 25 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Split off an Enchantment internal type from the Enchantments macro module. · dd7ec2ea2848
      Leon Arnott authored
      This internal type allows the concept of an "enchantment" to be extended beyond just the act of styling clickable links created by (click:) and such, and can be a mechanism by which general layout macros could be implemented. This also separates the act of styling the sections from the enchantment event function attached by the macros, which is specific to (click:)'s implementation.
      
      Also, changed the alignment of some lines in the Patterns file.
      dd7ec2ea2848
  21. 23 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Fixed two bugs involving macro calls. · ad86e3cdc641
      Leon Arnott authored
       * Fixed a bug where (align: "<==") couldn't be used at all, even inside another aligned hook.
      
       * Fixed a bug where errors for using changer macros (such as (link:)) detached from a hook were not appearing.
      ad86e3cdc641
  22. 21 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Converted the codebase to ES6 with a Babel compile step. · 502749034f14
      Leon Arnott authored
      Now, the codebase uses the following ES6 features: block scoped variables, concise methods, object destructuring, shorthand properties and arrow functions. Other important features, like iterable destructuring, template strings, and so forth, are not yet present but can now be safely employed in future commits.
      
      This subset of features matches those available in Firefox, so rapid testing can be done on that browser without the very slow compile step. The test suite HTML file can detect Firefox and use the uncompiled ES6 source, or else use the most recently compiled JS file in the build directory.
      502749034f14
  23. 19 Jun, 2015 2 commits
  24. 14 Jun, 2015 2 commits
    • Leon Arnott's avatar
      Added tests for the (background:) macro. · 26c4d0892d36
      Leon Arnott authored
      Also added a file missing in the previous commit.
      26c4d0892d36
    • Leon Arnott's avatar
      Reorganised all of the test suite files. · 2d4205b1cbfb
      Leon Arnott authored
      Now, they're categorised in subfolders inside the spec folder, with some test files more strictly divided (for instance, most of the basic markup syntax is split into separate files, and the link syntax is now distinct from link macros - even though one desugars to the other).
      2d4205b1cbfb
  25. 13 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Finished fixing the (replace:) behaviour in the previous commit. · b0a5841edfa4
      Leon Arnott authored
      Now, using (replace:) from outside the collapsing syntax to alter a hook inside it will correctly use the original location's whitespace rules rather than the destination. This fix took some finagling, and it has no symmetry with the previous commit's fix, so you can understand I'm a little bothered by it. But, it seems to hold.
      b0a5841edfa4
  26. 11 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Partially fixed the behaviour of (replace:) replacing out of collapsing regions. · 925f950df43a
      Leon Arnott authored
      Now, using (replace:) inside the collapsing syntax to change a hook outside of it, will correctly collapse the attached hook's contents as it's copied into the distant hook. But the reverse scenario (replacing into the collapsing syntax) still needs to be implemented.
      
      This also fixes a bug where ChangeDescriptor.create() was overriding the parent descriptor's attr and styles arrays.
      925f950df43a
  27. 08 Jun, 2015 1 commit
  28. 07 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Fixed the handling of opening and trailing whitespace in hooks in collapsed syntax. · bd37023f0b1c
      Leon Arnott authored
       * Now, constructs like "{A[ B]<1|}" will no longer render as "AB", instead retaining the single space between the A and B. This, of course, required significant modifications to both the collapse() function and the text nodes jQuery plugins related to text nodes.
      
       * Also, this indirectly fixed a small bug where the space inside hooks such as "A(if:true)[ ]B" were being removed.
      bd37023f0b1c
  29. 04 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Added a restriction preventing similar number and string keys being used in a datamap. · d8fe722174d3
      Leon Arnott authored
      Now, using, say, a "2" name in a datamap while it already has a (number) 2 name will cause an error. This prevents some frightful confusion that would result if one were to get their types wrong.
      
      Also, added an error that occurs when using the same key twice in a single (datamap:) call - say, (datamap: 2, true, 2, false).
      
      Also, added special code to clean the global scope when TwineJS runs Harlowe from Test Play.
      d8fe722174d3
  30. 02 Jun, 2015 1 commit
    • Leon Arnott's avatar
      Refined the (textstyle:"blur") fix to be more comprehensive. · 4893e1c40903
      Leon Arnott authored
      If the user has complicated story CSS, it's not possible to determine what colour should be used for a blur hook via .css() until it's connected to the DOM. So, now the style application in ChangeDescriptor.update() is deferred via setTimeout(). This is of course a somewhat brittle fix, but a better solution isn't yet forthcoming.
      
      Also fixed some bugs that broke certain type signatures in the previous commit.
      4893e1c40903
  31. 01 Jun, 2015 2 commits
    • Leon Arnott's avatar
      Added custom type signature error messages to (if:) and (else-if:) · 5212cc871e0b
      Leon Arnott authored
      These provide a hint to the author about how to correct the error. I deem this necessary because that addition of (if:)'s tighter type signature is a breaking change from 1.0.1, and this should provide a little migration help for those whose bugs were silently ignored until now.
      
      Also added test specs for 'and', 'or' and 'not'.
      5212cc871e0b
    • Leon Arnott's avatar
      Removed tag v1.1.0 · 1951a0d559bb
      Leon Arnott authored
      1951a0d559bb
  32. 31 May, 2015 1 commit
  33. 30 May, 2015 2 commits