diff --git a/guide.cabal b/guide.cabal index 0afd384..bec0d0b 100644 --- a/guide.cabal +++ b/guide.cabal @@ -34,6 +34,7 @@ executable guide Config Types Utils + Merge Cache Markdown JS @@ -63,8 +64,8 @@ executable guide , friendly-time == 0.4.* , hashable , http-types - , iproute == 1.7.* , ilist + , iproute == 1.7.* , lucid >= 2.9.5 && < 3 , megaparsec == 4.4.* , microlens-platform >= 0.2.3 @@ -72,15 +73,18 @@ executable guide , mtl >= 2.1.1 , neat-interpolation == 0.3.* , network + , patches-vector , path-pieces , random >= 1.1 , safecopy , shortcut-links >= 0.4.2 + , split , stm-containers == 0.2.10.* , template-haskell , text-all == 0.3.* , time >= 1.5 , transformers + , vector , wai , wai-middleware-metrics , wai-middleware-static diff --git a/src/JS.hs b/src/JS.hs index cf9c0b4..9caba07 100644 --- a/src/JS.hs +++ b/src/JS.hs @@ -43,6 +43,7 @@ allJSFunctions = JS . T.unlines . map fromJS $ [ autosizeTextarea, expandHash, expandItemNotes, + showDiffPopup, -- Creating parts of interface makeTraitEditor, makeItemNotesEditor, @@ -289,6 +290,73 @@ expandItemNotes = switchSection("#item-notes-"+itemId, "expanded"); |] +showDiffPopup :: JSFunction a => a +showDiffPopup = + makeJSFunction "showDiffPopup" ["ours", "modified", "merged", "send"] + [text| + dialog = $("
", { + "class" : "diff-popup" + })[0]; + choices = $("
", { + "class" : "diff-choices" + })[0]; + + // our version + choiceOurs = $("
", { + "class" : "var-a" })[0]; + textOurs = $("
", { + "class" : "text", + "text" : ours })[0]; + headerOurs = $("", { + "text" : "Your version" })[0]; + buttonOurs = $("