mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-07 01:04:25 +03:00
Fixed Booleans (again)
This commit is contained in:
parent
7f7ab87d9d
commit
dbfc7e086e
|
@ -6,9 +6,9 @@ markdown = require('./markdown.coffee')
|
||||||
|
|
||||||
assert = (msg, assertion) -> console.assert assertion, msg
|
assert = (msg, assertion) -> console.assert assertion, msg
|
||||||
|
|
||||||
Function.prototype.fcall = Function.prototype.call;
|
Function.prototype.fcall = Function.prototype.call
|
||||||
Boolean.prototype.fcall = () ->
|
Boolean.prototype.fcall = () ->
|
||||||
return this
|
return this.valueOf()
|
||||||
String.prototype.fcall = () ->
|
String.prototype.fcall = () ->
|
||||||
return this
|
return this
|
||||||
|
|
||||||
|
|
|
@ -149,8 +149,8 @@ class SaletView
|
||||||
if (not listOfIds? or listOfIds.length == 0)
|
if (not listOfIds? or listOfIds.length == 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
currentRoom = salet.getCurrentRoom();
|
currentRoom = salet.getCurrentRoom()
|
||||||
$options = $("<ul>").addClass("options");
|
$options = $("<ul>").addClass("options")
|
||||||
for roomId in listOfIds
|
for roomId in listOfIds
|
||||||
room = salet.rooms[roomId]
|
room = salet.rooms[roomId]
|
||||||
assert(room, "unknown_situation".l({id:roomId}))
|
assert(room, "unknown_situation".l({id:roomId}))
|
||||||
|
@ -162,7 +162,7 @@ class SaletView
|
||||||
optionText = "choice".l({number:i+1})
|
optionText = "choice".l({number:i+1})
|
||||||
$option = $("<li>")
|
$option = $("<li>")
|
||||||
$a = $("<span>")
|
$a = $("<span>")
|
||||||
if (room.canChoose.fcall(this, salet, currentRoom) == true)
|
if (room.canChoose.fcall(this, salet, currentRoom))
|
||||||
$a = $("<a>").attr({href: roomId})
|
$a = $("<a>").attr({href: roomId})
|
||||||
$a.html(optionText)
|
$a.html(optionText)
|
||||||
$option.html($a)
|
$option.html($a)
|
||||||
|
@ -180,7 +180,7 @@ class SaletView
|
||||||
for a in $('#content').find('a')
|
for a in $('#content').find('a')
|
||||||
a = $(a)
|
a = $(a)
|
||||||
if (a.hasClass('sticky') || a.attr("href").match(/[?&]sticky[=&]?/))
|
if (a.hasClass('sticky') || a.attr("href").match(/[?&]sticky[=&]?/))
|
||||||
return;
|
return
|
||||||
a.replaceWith($("<span>").addClass("ex_link").html(a.html()))
|
a.replaceWith($("<span>").addClass("ex_link").html(a.html()))
|
||||||
contentToHide = $('#content .transient, #content ul.options')
|
contentToHide = $('#content .transient, #content ul.options')
|
||||||
contentToHide.add($("#content a").filter(() ->
|
contentToHide.add($("#content a").filter(() ->
|
||||||
|
|
Loading…
Reference in a new issue