Skip to content

Commit

Permalink
#81 fixed: "Comment time is displayed in a timestamp format after edi…
Browse files Browse the repository at this point in the history
…t & cancel"
  • Loading branch information
ignatov committed Jul 25, 2011
1 parent cb31964 commit 94b8557
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/scala/tools/colladoc/lib/js/JqUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ object JqUI {

/** Confirm dialog. */
def ColladocConfirm(what: String) = Call("confirm", Str(what))

/** Run prettyDate function. */
case object PrettyDate extends JsExp with JsMember {
override def toJsCmd = "prettyDate();"
}
}

}
Expand Down
33 changes: 27 additions & 6 deletions src/main/scala/scala/tools/colladoc/page/Template.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
{ n }
<div class="buttons">
{ SHtml.ajaxButton(Text("Save"), () => SHtml.submitAjaxForm("edit_form_" + d.id, () => reloadDiscussion)) }
{ SHtml.a(Text("Cancel"), Replace("edit_form_" + d.id, discussionToHtmlWithActions(d)) & Jq(Str("button")) ~> Button(), ("class", "button")) }
{ SHtml.a(Text("Cancel"),
Replace("edit_form_" + d.id, discussionToHtmlWithActions(d)) &
PrettyDate &
Jq(Str("button")) ~> Button(),
("class", "button"))
}
</div>
</div>
</form>) & j & Jq(Str("button")) ~> Button()
Expand All @@ -232,7 +237,12 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
{ n }
<div class="buttons">
{ SHtml.ajaxButton(Text("Save"), () => SHtml.submitAjaxForm("discussion_form", () => reloadDiscussion)) }
{ SHtml.a(Text("Cancel"), Replace("discussion_form", discussionCommentAddButton) & Jq(Str("button")) ~> Button(), ("class", "button")) }
{ SHtml.a(Text("Cancel"),
Replace("discussion_form", discussionCommentAddButton) &
PrettyDate &
Jq(Str("button")) ~> Button(),
("class", "button"))
}
</div>
</div>
</form>) & j & Jq(Str("button")) ~> Button()
Expand All @@ -244,7 +254,7 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
/** Reload discussion block after new comment adding. */
private def reloadDiscussion = Replace("discussion", discussion) &
JsRaw("$('#discussion_wrapper').toggle();") &
JsRaw("prettyDate();") &
PrettyDate &
Jq(Str("button")) ~> Button()

/** Save discussion comment to database. */
Expand Down Expand Up @@ -337,7 +347,13 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
{ n }
<div class="buttons">
{ SHtml.ajaxButton(Text("Save"), () => SHtml.submitAjaxForm("edit_form_" + d.id, () => reloadContent)) }
{ SHtml.a(Text("Cancel"), Replace("edit_form_" + d.id, contentToHtmlWithActions(d)) & Jq(Str("button")) ~> Button(), ("class", "button")) }
{ SHtml.a(Text("Cancel"),
Replace("edit_form_" + d.id,
contentToHtmlWithActions(d)) &
PrettyDate &
Jq(Str("button")) ~> Button(),
("class", "button"))
}
</div>
</div>
</form>) & j & Jq(Str("button")) ~> Button()
Expand All @@ -352,7 +368,12 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
{ n }
<div class="buttons">
{ SHtml.ajaxButton(Text("Save"), () => SHtml.submitAjaxForm("content_form", () => reloadContent)) }
{ SHtml.a(Text("Cancel"), Replace("content_form", contentCommentAddButton) & Jq(Str("button")) ~> Button(), ("class", "button")) }
{ SHtml.a(Text("Cancel"),
Replace("content_form", contentCommentAddButton) &
PrettyDate &
Jq(Str("button")) ~> Button(),
("class", "button"))
}
</div>
</div>
</form>) & j & Jq(Str("button")) ~> Button()
Expand All @@ -364,7 +385,7 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
/** Reload content block after new comment adding. */
private def reloadContent = Replace("content", content) &
JsRaw("$('#content_wrapper').toggle();") &
JsRaw("prettyDate();") &
PrettyDate &
Jq(Str("button")) ~> Button()

/** Save content comment to database. */
Expand Down

0 comments on commit 94b8557

Please sign in to comment.