UNPKG

3.86 kBSource Map (JSON)View Raw
1{"version":3,"file":"index_.js","sourceRoot":"","sources":["../../../../../../../src/electron/renderer/riots/mytag/index_.ts"],"names":[],"mappings":";;AASA,oEAAmE;AAEtD,QAAA,cAAc,GAAG,UAAC,IAAS;IACpC,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEjB,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AAGD,MAAc,CAAC,UAAU,GAAG,UAAU,IAAS;IAAnB,iBA4C5B;IA3CG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAElB,IAAM,IAAI,GAAG,IAAe,CAAC;IAE7B,IAAI,CAAC,KAAK,CAAC,+CAAsB,CAAC,CAAC;IAEnC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;IACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAMxB,IAAI,CAAC,aAAa,GAAG,UAAC,EAAa;QAC/B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAE5B,EAAE,CAAC,aAAa,GAAG,IAAI,CAAC;QACxB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,QAAwB,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5D,UAAU,CAAC;YAEP,IAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,EAAE,IAAI,CAAC,CAAC;IACb,CAAC,CAAC;IACF,IAAI,CAAC,cAAc,GAAG,UAAC,EAAa;QAChC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,KAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,QAAwB,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5D,EAAE,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC,CAAC;IAEF,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE;QACb,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,GAAG,UAAC,IAAS,EAAE,QAAa;QACzC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,CAAC","sourcesContent":["// ==LICENSE-BEGIN==\n// Copyright 2017 European Digital Reading Lab. All rights reserved.\n// Licensed to the Readium Foundation under one or more contributor license agreements.\n// Use of this source code is governed by a BSD-style license\n// that can be found in the LICENSE file exposed on Github (readium) in the project repository.\n// ==LICENSE-END==\n\n// http://riotjs.com/guide/\n// http://riotjs.com/api/\nimport { riot_mixin_EventTracer } from \"../riot_mixin_EventTracer\";\n\nexport const riotMountMyTag = (opts: any): RiotTag[] => {\n const tag = riot.mount(\"riot-mytag\", opts);\n console.log(tag); // RiotTag[]\n // console.log((tag[0] as any).getOpts()); // see RiotMixinWithOpts\n return tag;\n};\n\n// tslint:disable-next-line:space-before-function-paren\n(window as any).riot_mytag = function (opts: any) {\n console.log(opts);\n console.log(this);\n\n const that = this as RiotTag;\n\n that.mixin(riot_mixin_EventTracer);\n\n this.prop1 = \"val1\";\n this.applyClazz = false;\n\n // ev.currentTarget (where event handler is attached)\n // ev.target (originating element)\n // ev.which (keyboard)\n // ev.item (loop)\n this.onclickButton = (ev: RiotEvent) => {\n console.log(\"CLICK button\");\n // applyClazz will not be taken into account immediately (no automatic call to update()\n ev.preventUpdate = true;\n this.applyClazz = false;\n (that.refs.testSpan as HTMLElement).style.fontSize = \"100%\";\n setTimeout(() => {\n // (window as any).riot.update();\n that.update();\n }, 1000);\n };\n this.onclickHeading = (ev: RiotEvent) => {\n console.log(\"CLICK heading\");\n this.applyClazz = true;\n (that.refs.testSpan as HTMLElement).style.fontSize = \"200%\";\n ev.preventDefault();\n };\n\n this.on(\"mount\", () => {\n console.log(that.root.id);\n console.log(document.getElementById(\"myRiotTagID\"));\n console.log(that.root.querySelectorAll(\"button\")[0]);\n });\n\n that.shouldUpdate = (data: any, nextOpts: any) => {\n console.log(data);\n console.log(nextOpts);\n return true;\n };\n};\n"]}
\No newline at end of file