mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-06-28 21:05:03 +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
|
||||
|
||||
Function.prototype.fcall = Function.prototype.call;
|
||||
Function.prototype.fcall = Function.prototype.call
|
||||
Boolean.prototype.fcall = () ->
|
||||
return this
|
||||
return this.valueOf()
|
||||
String.prototype.fcall = () ->
|
||||
return this
|
||||
|
||||
|
|
|
@ -149,8 +149,8 @@ class SaletView
|
|||
if (not listOfIds? or listOfIds.length == 0)
|
||||
return
|
||||
|
||||
currentRoom = salet.getCurrentRoom();
|
||||
$options = $("<ul>").addClass("options");
|
||||
currentRoom = salet.getCurrentRoom()
|
||||
$options = $("<ul>").addClass("options")
|
||||
for roomId in listOfIds
|
||||
room = salet.rooms[roomId]
|
||||
assert(room, "unknown_situation".l({id:roomId}))
|
||||
|
@ -162,7 +162,7 @@ class SaletView
|
|||
optionText = "choice".l({number:i+1})
|
||||
$option = $("<li>")
|
||||
$a = $("<span>")
|
||||
if (room.canChoose.fcall(this, salet, currentRoom) == true)
|
||||
if (room.canChoose.fcall(this, salet, currentRoom))
|
||||
$a = $("<a>").attr({href: roomId})
|
||||
$a.html(optionText)
|
||||
$option.html($a)
|
||||
|
@ -180,7 +180,7 @@ class SaletView
|
|||
for a in $('#content').find('a')
|
||||
a = $(a)
|
||||
if (a.hasClass('sticky') || a.attr("href").match(/[?&]sticky[=&]?/))
|
||||
return;
|
||||
return
|
||||
a.replaceWith($("<span>").addClass("ex_link").html(a.html()))
|
||||
contentToHide = $('#content .transient, #content ul.options')
|
||||
contentToHide.add($("#content a").filter(() ->
|
||||
|
|
Loading…
Reference in a new issue