| 19 |
function GetItem : TBoard; |
function GetItem : TBoard; |
| 20 |
public |
public |
| 21 |
constructor Create( inURL : string; inTitle : string = ''; inItem : TBoard = nil ); |
constructor Create( inURL : string; inTitle : string = ''; inItem : TBoard = nil ); |
| 22 |
|
constructor CreateWithItem( inItem : TBoard ); |
| 23 |
property Item : TBoard read GetItem write FItem; |
property Item : TBoard read GetItem write FItem; |
| 24 |
property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される |
property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される |
| 25 |
property Title : string read FTitle write FTitle; |
property Title : string read FTitle write FTitle; |
| 33 |
function GetItem : TThreadItem; |
function GetItem : TThreadItem; |
| 34 |
public |
public |
| 35 |
constructor Create( inURL : string; inTitle : string = ''; inItem : TThreadItem = nil ); |
constructor Create( inURL : string; inTitle : string = ''; inItem : TThreadItem = nil ); |
| 36 |
|
constructor CreateWithItem( inItem : TThreadItem ); |
| 37 |
property Item : TThreadItem read GetItem write FItem; |
property Item : TThreadItem read GetItem write FItem; |
| 38 |
property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される |
property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される |
| 39 |
property Title : string read FTitle write FTitle; |
property Title : string read FTitle write FTitle; |
| 95 |
|
|
| 96 |
end; |
end; |
| 97 |
|
|
| 98 |
|
constructor TFavoriteBoardItem.CreateWithItem( |
| 99 |
|
inItem : TBoard |
| 100 |
|
); |
| 101 |
|
begin |
| 102 |
|
|
| 103 |
|
Create( inItem.URL, inItem.Title, inItem ); |
| 104 |
|
|
| 105 |
|
end; |
| 106 |
|
|
| 107 |
function TFavoriteBoardItem.GetItem : TBoard; |
function TFavoriteBoardItem.GetItem : TBoard; |
| 108 |
begin |
begin |
| 109 |
|
|
| 134 |
|
|
| 135 |
end; |
end; |
| 136 |
|
|
| 137 |
|
constructor TFavoriteThreadItem.CreateWithItem( |
| 138 |
|
inItem : TThreadItem |
| 139 |
|
); |
| 140 |
|
begin |
| 141 |
|
|
| 142 |
|
Create( inItem.URL, inItem.Title, inItem ); |
| 143 |
|
|
| 144 |
|
end; |
| 145 |
|
|
| 146 |
function TFavoriteThreadItem.GetItem : TThreadItem; |
function TFavoriteThreadItem.GetItem : TThreadItem; |
| 147 |
var |
var |
| 148 |
threadItem : TThreadItem; |
threadItem : TThreadItem; |
| 152 |
begin |
begin |
| 153 |
|
|
| 154 |
if FItem = nil then begin |
if FItem = nil then begin |
| 155 |
boardURL := GikoSys.GetThreadURL2BoardURL( URL ); |
boardURL := GikoSys.GetThreadURL2BoardURL( URL ); |
| 156 |
board := BBSsFindBoardFromURL( boardURL ); |
board := BBSsFindBoardFromURL( boardURL ); |
| 157 |
|
|
| 158 |
if board = nil then |
if board = nil then |
| 423 |
for i := 0 to Node.Count - 1 do begin |
for i := 0 to Node.Count - 1 do begin |
| 424 |
if TObject(Node.Item[i].Data) is TFavoriteFolder then begin |
if TObject(Node.Item[i].Data) is TFavoriteFolder then begin |
| 425 |
if Node.Item[ i ].Expanded then |
if Node.Item[ i ].Expanded then |
| 426 |
s := Format('<folder title="%s" expanded="true">', [HttpEncode(Node.Item[i].Text)]) |
s := Format('<folder title="%s" expanded="true">', [HtmlEncode(Node.Item[i].Text)]) |
| 427 |
else |
else |
| 428 |
s := Format('<folder title="%s" expanded="false">', [HttpEncode(Node.Item[i].Text)]); |
s := Format('<folder title="%s" expanded="false">', [HtmlEncode(Node.Item[i].Text)]); |
| 429 |
SaveList.Add(s); |
SaveList.Add(s); |
| 430 |
AddSaveString(Node.Item[i], SaveList); |
AddSaveString(Node.Item[i], SaveList); |
| 431 |
SaveList.Add('</folder>'); |
SaveList.Add('</folder>'); |
| 432 |
end else if TObject(Node.Item[i].Data) is TFavoriteBoardItem then begin |
end else if TObject(Node.Item[i].Data) is TFavoriteBoardItem then begin |
| 433 |
FavBoard := TFavoriteBoardItem(Node.Item[i].Data); |
FavBoard := TFavoriteBoardItem(Node.Item[i].Data); |
| 434 |
s := Format('<favitem type="2ch" favtype="board" url="%s" title="%s"/>', |
s := Format('<favitem type="2ch" favtype="board" url="%s" title="%s"/>', |
| 435 |
[HttpEncode( FavBoard.URL ), HttpEncode(FavBoard.Title)]); |
[HtmlEncode( FavBoard.URL ), HtmlEncode(FavBoard.Title)]); |
| 436 |
SaveList.Add(s); |
SaveList.Add(s); |
| 437 |
end else if TObject(Node.Item[i].Data) is TFavoriteThreadItem then begin |
end else if TObject(Node.Item[i].Data) is TFavoriteThreadItem then begin |
| 438 |
FavThread := TFavoriteThreadItem(Node.Item[i].Data); |
FavThread := TFavoriteThreadItem(Node.Item[i].Data); |
| 439 |
s := Format('<favitem type="2ch" favtype="thread" url="%s" title="%s"/>', |
s := Format('<favitem type="2ch" favtype="thread" url="%s" title="%s"/>', |
| 440 |
[HttpEncode( FavThread.URL ), HttpEncode(FavThread.Title)]); |
[HtmlEncode( FavThread.URL ), HtmlEncode(FavThread.Title)]); |
| 441 |
SaveList.Add(s); |
SaveList.Add(s); |
| 442 |
end; |
end; |
| 443 |
end; |
end; |