@@ -31,25 +31,6 @@ data SegmentType = Static String -- ^ a static path segment. like "/foo"
31 | Cap Arg -- ^ a capture. like "/:userid"
31 | Cap Arg -- ^ a capture. like "/:userid"
32 deriving (Eq, Show)
32 deriving (Eq, Show)
34−isCapture :: Segment -> Bool
35−isCapture (Cap _) = True
38−captureArg :: Segment -> Arg
39−captureArg (Cap s) = s
40−captureArg _ = error "captureArg called on non capture"
42−jsSegments :: [Segment] -> String
44−jsSegments [x] = "/" ++ segmentToStr x False
45−jsSegments (x:xs) = "/" ++ segmentToStr x True ++ jsSegments xs
47−segmentToStr :: Segment -> Bool -> String
48−segmentToStr (Static s) notTheEnd =
49− if notTheEnd then s else s ++ "'"
50−segmentToStr (Cap s) notTheEnd =
51− "' + encodeURIComponent(" ++ s ++ if notTheEnd then ") + '" else ")"
53type Path = [Segment]
34type Path = [Segment]
55data ArgType =
36data ArgType =
@@ -305,7 +286,7 @@ instance (KnownSymbol sym, HasJQ sublayout)
306 jqueryFor Proxy req =
287 jqueryFor Proxy req =
307 jqueryFor (Proxy :: Proxy sublayout) $
288 jqueryFor (Proxy :: Proxy sublayout) $
308− req & reqUrl.path._last.matrix <>~ [QueryArg str Normal]
289+ req & reqUrl.path._last.matrix <>~ [QueryArg strArg Normal]
310 where str = symbolVal (Proxy :: Proxy sym)
291 where str = symbolVal (Proxy :: Proxy sym)
311 strArg = str ++ "Value"
292 strArg = str ++ "Value"