1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-01-31 07:10:28 -05:00

Merge branch 'master' of ssh://villavu.com:54367/simba

This commit is contained in:
Merlijn Wajer 2010-10-04 11:23:57 +02:00
commit d7784d4de1

View File

@ -1,8 +1,22 @@
program Paster; program Paster;
//{$DEFINE DEV} //{$DEFINE DEV}
const
HOSTDef = 'paste.sheeva.villavu.com';
function GetName: string;
begin;
Result := 'Paster';
end;
function GetVersion: string;
begin;
Result := '0.3a';
end;
{$IFDEF EXTENSION} {$IFDEF EXTENSION}
var var
Paster_Menu, GetPaste_MenuItem, Private_MenuItem: TMenuItem; Paster_Menu, GetPaste_MenuItem, Private_MenuItem,
Browser_MenuItem, Paster_MenuItem, AltHost_Menu: TMenuItem; Browser_MenuItem, Paster_MenuItem, AltHost_Menu: TMenuItem;
Divider_MenuItems: array[1..2] of TMenuItem; Divider_MenuItems: array[1..2] of TMenuItem;
AltHost_Menus: array[1..5] of TMenuItem; AltHost_Menus: array[1..5] of TMenuItem;
@ -21,16 +35,6 @@ begin
Result := Replace(Result, Pattern[I], Replacement[I], [rfIgnoreCase, rfReplaceAll]); Result := Replace(Result, Pattern[I], Replacement[I], [rfIgnoreCase, rfReplaceAll]);
end; end;
function GetName: string;
begin;
Result := 'Paster';
end;
function GetVersion: string;
begin;
Result := '0.2a';
end;
function JSONRequest(var Data: string; const HOST, Method: string): boolean; function JSONRequest(var Data: string; const HOST, Method: string): boolean;
begin begin
{$IFDEF DEV} {$IFDEF DEV}
@ -61,7 +65,7 @@ var
Data: string; Data: string;
begin begin
if (HOST = '') then if (HOST = '') then
HOST := 'paste.sheeva.villavu.com'; HOST := HOSTDef;
if (InputQuery(GetName + ' ' + GetVersion + ' Extension', 'Which ID would you like too grab?', Data)) then if (InputQuery(GetName + ' ' + GetVersion + ' Extension', 'Which ID would you like too grab?', Data)) then
begin begin
if IntToStr(StrToInt(Data)) = Data then if IntToStr(StrToInt(Data)) = Data then
@ -92,7 +96,7 @@ end;
function PasteIt(out Data: string; HOST: string): boolean; function PasteIt(out Data: string; HOST: string): boolean;
begin begin
if (HOST = '') then if (HOST = '') then
HOST := 'paste.sheeva.villavu.com'; HOST := HOSTDef;
if (MessageDlg(GetName + ' ' + GetVersion + ' Extension', 'Upload this script to ' + HOST + '?', mtConfirmation, [mbYes, mbNo], 0) = mrYes) then if (MessageDlg(GetName + ' ' + GetVersion + ' Extension', 'Upload this script to ' + HOST + '?', mtConfirmation, [mbYes, mbNo], 0) = mrYes) then
begin begin
Data := '{"language": "delphi", "code": "' + EncodeString(ScriptText) + '", "private": ' + Lowercase(BoolToStr(Private_MenuItem.Checked)) + '}'; Data := '{"language": "delphi", "code": "' + EncodeString(ScriptText) + '", "private": ' + Lowercase(BoolToStr(Private_MenuItem.Checked)) + '}';
@ -184,7 +188,7 @@ end;
procedure Attach; procedure Attach;
begin; begin;
WriteLn(GetName + ' ' + GetVersion + ' Plugin Loaded!'); WriteLn(GetName + ' v' + GetVersion + ' by Dgby714 Loaded!');
Paster_Menu.Visible := True; Paster_Menu.Visible := True;
end; end;
@ -194,10 +198,10 @@ begin
end; end;
procedure Free; procedure Free;
var {var
I, K: integer; I, K: integer;}
begin begin
for I := 5 downto 1 do {for I := 5 downto 1 do
begin begin
for K := 4 downto 1 do for K := 4 downto 1 do
AltHost_MenuItems[I][K].Free; AltHost_MenuItems[I][K].Free;
@ -208,7 +212,7 @@ begin
for I := 2 downto 1 do for I := 2 downto 1 do
Divider_MenuItems[I].Free; Divider_MenuItems[I].Free;
Paster_MenuItem.Free; Paster_MenuItem.Free;
Paster_Menu.Free; Paster_Menu.Free;}
end; end;
procedure init; procedure init;
@ -291,9 +295,13 @@ begin;
end; end;
end; end;
{$ENDIF} {$ENDIF}
begin begin
{$IFNDEF EXTENSION} {$IFNDEF EXTENSION}
WriteLn('This is a Extension for Simba. If you are in Simba click View->Extensions and enable paster.sex!'); MessageDlg(GetName + ' v' + GetVersion + ' by Dgby714!',
'This is a Extension for Simba.'#13#10
'If you are in Simba click View->Extensions and enable paster.sex!',
mtWarning, [mbOK]);
{$ENDIF} {$ENDIF}
end. end.