Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ChapelR committed Jan 27, 2020
1 parent 2c8ddaa commit 7652156
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- UUID://29684286-9874-4F3B-A1F0-A2206575C893// --><tw-storydata name="Custom Macro Testing Suite" startnode="1" creator="Tweego" creator-version="2.0.0+089d4ca77e5b" ifid="29684286-9874-4F3B-A1F0-A2206575C893" zoom="1" format="Harlowe" format-version="3.1.0" options="" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css">/* speechbox.min.css, for Harlow Macro API, by Chapel */
.say{border:1px solid #eee;overflow:auto;font-size:1.2rem}.say img{max-width:20%;float:left;z-index:2;margin-right:1em}.say p:first-of-type{font-weight:700;margin:.2em 0;border-bottom:1px solid #eee}.say p:last-of-type{padding:.5em;margin:0}
/* end speechbox.min.css*/</style><script role="script" id="twine-user-script" type="text/twine-javascript">/* twine-user-script #1: "macro.min.js" */
// Harlowe Macro API, by Chapel; version 0.2.2
// Harlowe Macro API, by Chapel; version 0.3.0
;!function(){"use strict";var c=require("macros"),n=require("state"),r=require("engine"),u=require("datatypes/changercommand");function f(e,r,n){if(!(this instanceof f))return new f(e,r,n);this.name=e||"unknown",this.args=r||[],this.data=n||{},this.type=n&&n.type||"basic",this.fn=n&&n.fn||"handler","changer"===this.type&&("handler"===this.fn?this.instance=n&&n.instance||null:this.descriptor=n&&n.descriptor||null)}function t(e){return"number"==typeof e||"boolean"==typeof e||"string"==typeof e||null===e||Array.isArray(e)&&e.every(t)||e instanceof Set&&Array.from(e).every(t)||e instanceof Map&&Array.from(e.values()).every(t)||u.isPrototypeOf(e)}function a(){return n.passage}f.create=function(e,r,n){if(!e||"string"!=typeof e||!e.trim())throw new TypeError("Invalid macro name.");return r&&r instanceof Array||(r=[]),n&&"object"==typeof n||(n={type:"basic",fn:"handler"}),new f(e,r,n)},Object.assign(f.prototype,{clone:function(){return f.create(this.name,this.args,this.data)},syntax:function(){return"("+this.name+":)"},error:function(e,r){var n="Error in the "+this.syntax()+" macro: "+e;return r&&alert(n),console.warn("HARLOWE CUSTOM MACRO ERROR -> ",n),new Error(e)},typeCheck:function(e){e&&e instanceof Array||(e=[].slice.call(arguments));var a=this,i=[];if(e.forEach(function(e,r){var n=r+1,t=[];"string"==typeof e&&("any"===(t=e.includes("|")?e.split("|").map(function(e){return e.trim().toLowerCase()}):[e.trim().toLowerCase()])[0]||t.some(function(e){return typeof a.args[r]===e})||i.push("argument "+n+" should be a(n) "+t.join(" or ")))}),i.length)return a.error(i.join("; "))}}),window.Harlowe=Object.assign(window.Harlowe||{},{macro:function(e,r,n){if(!e||"string"!=typeof e||!e.trim())throw new TypeError("Invalid macro name.");if(!r||"function"!=typeof r)throw new TypeError("Invalid macro handler.");var t,a,i,o,s;n&&"function"==typeof n?(i=e,o=r,s=n,c.addChanger(i,function(){var e=[].slice.call(arguments).slice(1),r=u.create(i,e),n=f.create(i,e,{type:"changer",fn:"handler",instance:r});return o.apply(n,e),r},function(){var e=[].slice.call(arguments),r=e.shift(),n=f.create(i,e,{type:"changer",fn:"changer",descriptor:r});s.apply(n,e)},c.TypeSignature.zeroOrMore(c.TypeSignature.Any))):(t=e,a=r,c.add(t,function(){var e=[].slice.call(arguments).slice(1),r=f.create(t,e,{type:"basic",fn:"handler"}),n=a.apply(r,e);return null==n?"":n},c.TypeSignature.zeroOrMore(c.TypeSignature.Any)))},passage:a,tags:function(e){e=e||a();var r=$('tw-passagedata[name="'+e+'"]').attr("tags");return r?r.split(" "):[]},goto:function(e){return r.goToPassage(e)},variable:function(e,r){if("$"!==e[0])throw new Error('cannot access variable "'+e+'"');if(e=e.substr(1),void 0!==r){if(!t(r))throw new Error('The value passed to variable "'+e+'" cannot be serialized.');n.variables[e]=r}return n.variables[e]},visited:function(e){return n.passageNameVisited(e||a())},hasVisited:function(e){return 0<n.passageNameVisited(e||a())},turns:function(){return n.pastLength},API_ACCESS:{MACROS:c,STATE:n,CHANGER:u,ENGINE:r}})}();
// end Harlowe Macro API
/* twine-user-script #2: "articles.min.js" */
Expand Down

0 comments on commit 7652156

Please sign in to comment.