|
@@ -308,7 +308,7 @@ Function IncludeHTTPPathDelimiter (S : String) : String;
|
|
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
-uses strutils, typinfo, js;
|
|
|
|
|
|
+uses strutils, js;
|
|
|
|
|
|
Resourcestring
|
|
Resourcestring
|
|
EDuplicateRoute = 'Duplicate route pattern: %s';
|
|
EDuplicateRoute = 'Duplicate route pattern: %s';
|
|
@@ -358,17 +358,20 @@ function THTMLHistory.doPush(location: TRawLocation): TTransitionResult;
|
|
|
|
|
|
begin
|
|
begin
|
|
pushState(GetURL(Location));
|
|
pushState(GetURL(Location));
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function THTMLHistory.doreplace(location: TRawLocation): TTransitionResult;
|
|
function THTMLHistory.doreplace(location: TRawLocation): TTransitionResult;
|
|
|
|
|
|
begin
|
|
begin
|
|
ReplaceState(GetURL(Location));
|
|
ReplaceState(GetURL(Location));
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function THTMLHistory.doGo(N: integer): TTransitionResult;
|
|
function THTMLHistory.doGo(N: integer): TTransitionResult;
|
|
begin
|
|
begin
|
|
window.history.go(n);
|
|
window.history.go(n);
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure THTMLHistory.ensureURL(push: boolean);
|
|
procedure THTMLHistory.ensureURL(push: boolean);
|
|
@@ -463,11 +466,8 @@ end;
|
|
function THistory.TransitionTo(aLocation: TRawLocation): TTransitionResult;
|
|
function THistory.TransitionTo(aLocation: TRawLocation): TTransitionResult;
|
|
|
|
|
|
Var
|
|
Var
|
|
- H : TStrings;
|
|
|
|
Params : TStrings;
|
|
Params : TStrings;
|
|
R : TRoute;
|
|
R : TRoute;
|
|
- I : Integer;
|
|
|
|
-
|
|
|
|
begin
|
|
begin
|
|
Params:=TStringList.Create;
|
|
Params:=TStringList.Create;
|
|
try
|
|
try
|
|
@@ -487,6 +487,7 @@ begin
|
|
Finally
|
|
Finally
|
|
Params.Free;
|
|
Params.Free;
|
|
end;
|
|
end;
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function THistory.ConfirmTransition(aRoute: TRoute; Params : TStrings): TTransitionResult;
|
|
function THistory.ConfirmTransition(aRoute: TRoute; Params : TStrings): TTransitionResult;
|
|
@@ -1309,6 +1310,7 @@ begin
|
|
L:=NormalizeHash(location);
|
|
L:=NormalizeHash(location);
|
|
FLastHash:=L;
|
|
FLastHash:=L;
|
|
pushHash(L);
|
|
pushHash(L);
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function THashHistory.doreplace(location: TRawLocation): TTransitionResult;
|
|
function THashHistory.doreplace(location: TRawLocation): TTransitionResult;
|
|
@@ -1320,6 +1322,7 @@ begin
|
|
L:=NormalizeHash(location);
|
|
L:=NormalizeHash(location);
|
|
FLastHash:=L;
|
|
FLastHash:=L;
|
|
replaceHash(L);
|
|
replaceHash(L);
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function THashHistory.doGo(N: integer): TTransitionResult;
|
|
function THashHistory.doGo(N: integer): TTransitionResult;
|
|
@@ -1375,7 +1378,7 @@ end;
|
|
class function THashHistory.getUrl (APath : string) : string;
|
|
class function THashHistory.getUrl (APath : string) : string;
|
|
|
|
|
|
Var
|
|
Var
|
|
- Base,HRef : String;
|
|
|
|
|
|
+ HRef : String;
|
|
Idx : Integer;
|
|
Idx : Integer;
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -1438,12 +1441,14 @@ begin
|
|
Inc(FIndex);
|
|
Inc(FIndex);
|
|
MaybeGrow(FIndex);
|
|
MaybeGrow(FIndex);
|
|
FStack[FIndex]:=Location;
|
|
FStack[FIndex]:=Location;
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TAbstractHistory.doReplace(location: TRawLocation): TTransitionResult;
|
|
function TAbstractHistory.doReplace(location: TRawLocation): TTransitionResult;
|
|
|
|
|
|
begin
|
|
begin
|
|
FStack[FIndex]:=Location;
|
|
FStack[FIndex]:=Location;
|
|
|
|
+ Result:=trOK;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TAbstractHistory.doGo(N: integer): TTransitionResult;
|
|
function TAbstractHistory.doGo(N: integer): TTransitionResult;
|
|
@@ -1488,12 +1493,14 @@ begin
|
|
Route:=FStack[I]
|
|
Route:=FStack[I]
|
|
else
|
|
else
|
|
Result:='/';
|
|
Result:='/';
|
|
|
|
+ Result:=Route;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TAbstractHistory.ensureURL(Push: Boolean);
|
|
procedure TAbstractHistory.ensureURL(Push: Boolean);
|
|
|
|
|
|
begin
|
|
begin
|
|
// Noop
|
|
// Noop
|
|
|
|
+ if Push then ;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TAbstractHistory.Kind: THistoryKind;
|
|
function TAbstractHistory.Kind: THistoryKind;
|