add link helper
This commit is contained in:
parent
c45e3cf00d
commit
200333b787
15
iffy.coffee
15
iffy.coffee
|
@ -214,7 +214,12 @@ class Gst
|
||||||
stId = "__gen#{@igenID++}"
|
stId = "__gen#{@igenID++}"
|
||||||
@mpstId_dgOnClick.push([stId, dgOnClick])
|
@mpstId_dgOnClick.push([stId, dgOnClick])
|
||||||
stId
|
stId
|
||||||
|
|
||||||
|
Link: (stText, dgOnClick, stExtra) ->
|
||||||
|
if not stExtra?
|
||||||
|
stExtra = ""
|
||||||
|
"<a href='javascript:void(0)' id='#{@RegOnClick(dgOnClick)}' #{stExtra}>#{stText}</a>"
|
||||||
|
|
||||||
RgwstRun: () ->
|
RgwstRun: () ->
|
||||||
wst = @rgwstInit[@rgwstInit.length - 1].WstNext(@SectionCurrent().NevByName("start"))
|
wst = @rgwstInit[@rgwstInit.length - 1].WstNext(@SectionCurrent().NevByName("start"))
|
||||||
eniWst = Nevgen.EniWst(this, wst)
|
eniWst = Nevgen.EniWst(this, wst)
|
||||||
|
@ -371,10 +376,7 @@ TemplateFromStNev = (st, wst) ->
|
||||||
|
|
||||||
word = wst.gst.SectionCurrent().WordByName(wst.gst, stWord)
|
word = wst.gst.SectionCurrent().WordByName(wst.gst, stWord)
|
||||||
if word? and (rgverb = word.Rgverb(wst)).length > 0
|
if word? and (rgverb = word.Rgverb(wst)).length > 0
|
||||||
dgOnClick = (ev) -> wst.gst.ShowMenu(ev, this, rgverb)
|
JsStringLit(wst.gst.Link(stDisplay, ((ev) -> wst.gst.ShowMenu(ev, this, rgverb)), "class='iffy-word'"))
|
||||||
|
|
||||||
stId = wst.gst.RegOnClick(dgOnClick)
|
|
||||||
JsStringLit("<a href='javascript:void(0)' id='#{stId}' class='iffy-word'>#{stDisplay}</a>")
|
|
||||||
else
|
else
|
||||||
JsStringLit(stDisplay)
|
JsStringLit(stDisplay)
|
||||||
MatchInWord = MatchBracket(0, () -> PushText(true, StWord))
|
MatchInWord = MatchBracket(0, () -> PushText(true, StWord))
|
||||||
|
@ -450,8 +452,7 @@ class ActorPlayer
|
||||||
|
|
||||||
StHtmlUi: (wst) ->
|
StHtmlUi: (wst) ->
|
||||||
if (wst.nev.player_nevIDRespondedTo?)
|
if (wst.nev.player_nevIDRespondedTo?)
|
||||||
stId = wst.gst.RegOnClick(() => @RemoveResponse(wst.nev); wst.gst.Display())
|
wst.gst.Link("Undo", (() => @RemoveResponse(wst.nev); wst.gst.Display()), "class='iffy-undo'")
|
||||||
"<a href='javascript:void(0)' id='#{stId}' class='iffy-undo'>Undo</a>"
|
|
||||||
|
|
||||||
class Story
|
class Story
|
||||||
constructor: (@jStory) ->
|
constructor: (@jStory) ->
|
||||||
|
|
Loading…
Reference in a new issue