Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 89097b4

Browse files
authored
Merge pull request #1773 from livecode/script-extensions
[[ ScriptExtensions ]] Support script library extension loading
2 parents 18749e6 + 6d6bedd commit 89097b4

33 files changed

Lines changed: 760 additions & 430 deletions

Documentation/dictionary/datagrid.lcdoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
Name: Datagrid
1+
Library: Datagrid
22

33
Type: object
44

5-
Syntax: Datagrid
6-
75
Summary: An object for forms or tables
86

97
Description:

Toolset/home.livecodescript

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -525,16 +525,6 @@ function revInternal__StackFiles
525525
if tFolder begins with "." then next repeat
526526
put return & tComponentFolder & slash & tFolder after tFolders
527527
end repeat
528-
529-
-- script libraries
530-
repeat for each item tRepo in (revEnvironmentCommercialRepositoryPath() & comma & revEnvironmentRepositoryPath())
531-
local tScriptLibrariesFolder
532-
put tRepo & "/extensions/script-libraries" into tScriptLibrariesFolder
533-
repeat for each line tFolder in folders(tScriptLibrariesFolder)
534-
if tFolder begins with "." then next repeat
535-
put return & tScriptLibrariesFolder & slash & tFolder after tFolders
536-
end repeat
537-
end repeat
538528
end if
539529

540530
local tStackFiles, tStackName
@@ -1183,32 +1173,24 @@ command revInternal__InitialiseLibraries
11831173
revInternal_SetJAVA_HOME
11841174

11851175
local tLoadList
1186-
put "revDatabaseLibrary" into tLoadList
1176+
put "revCommonLibrary" into tLoadList
1177+
put return & "revDatabaseLibrary" after tLoadList
11871178
put return & "revIDEDocumentationLibrary" after tLoadList
1179+
put return & "revMetadataLibrary" after tLoadList
1180+
put return & "revSBLibrary" after tLoadList
11881181
put return & "revideextensionlibrary" after tLoadList
11891182
put return & "revIDELibrary" after tLoadList
11901183
put return & "revidemessagehandlerlibrary" after tLoadList
11911184
put return & "revBackScriptLibrary" after tLoadList
1192-
put return & "revSBLibrary" after tLoadList
11931185
put return & "revDeployLibrary" after tLoadList
11941186
put return & "revDebuggerLibrary" after tLoadList
1195-
put return & "revMetadataLibrary" after tLoadList
11961187
put return & "revLibUrl" after tLoadList
1197-
put return & "revCommonLibrary" after tLoadList
11981188
put return & "revPrintLibrary" after tLoadList
11991189
put return & "revAnimationLibrary" after tLoadList
12001190
put return & "revGeometryLibrary" after tLoadList
12011191
put return & "revXMLRPCLibrary" after tLoadList
12021192
put return & "revProfilesLibrary" after tLoadList
12031193
put return & "revTableLibrary" after tLoadList
1204-
put return & "oauth2" after tLoadList
1205-
put return & "getopt" after tLoadList
1206-
put return & "mime" after tLoadList
1207-
put return & "diff" after tLoadList
1208-
put return & "messageauthentication" after tLoadList
1209-
put return & "dropbox" after tLoadList
1210-
put return & "httpd" after tLoadList
1211-
put return & "qr" after tLoadList
12121194
put return & "revhtml5urllibrary" after tLoadList
12131195

12141196
if revEnvironmentEditionProperty("autocomplete_pro") then
@@ -1218,14 +1200,6 @@ command revInternal__InitialiseLibraries
12181200
if revEnvironmentEditionProperty("autocomplete") then
12191201
put return & "autocomplete" after tLoadList
12201202
end if
1221-
1222-
switch the editionType
1223-
case "professional"
1224-
put return & "remotedebugger" after tLoadList
1225-
put return & "scriptprofiler" after tLoadList
1226-
case "commercial"
1227-
put return & "aws" after tLoadList
1228-
end switch
12291203

12301204
local tBackList
12311205
put "revidedeveloperextensionlibrary" into tBackList
@@ -1240,7 +1214,8 @@ command revInternal__InitialiseLibraries
12401214
put return & "revIDEProjectBrowserLibrary" after tBackList
12411215

12421216
local tLib
1243-
repeat for each line tLib in tLoadList
1217+
repeat for each line tLib in tLoadList
1218+
revInternal__Log "Message", "Loading library" && tLib
12441219
revInternal__LoadLibrary tLib
12451220
if the result is not empty then
12461221
revInternal__Log "Error", the result
@@ -2062,12 +2037,21 @@ function revEnvironmentExternalsPath
20622037
end revEnvironmentExternalsPath
20632038

20642039
function revEnvironmentExtensionsPath
2040+
return line 1 of revEnvironmentExtensionsPaths()
2041+
end revEnvironmentExtensionsPath
2042+
2043+
function revEnvironmentExtensionsPaths
20652044
if revEnvironmentIsInstalled() then
20662045
return hookToolsPath("extensions", sToolsPath & "/Extensions")
20672046
else
2068-
return revEnvironmentBinariesPath() & slash & "packaged_extensions"
2047+
-- Load the real extensions rather than the packaged versions
2048+
local tPaths
2049+
put revEnvironmentRepositoryPath() & slash & "extensions" into tPaths
2050+
put return & revEnvironmentCommercialRepositoryPath() \
2051+
& slash & "extensions" after tPaths
2052+
return tPaths
20692053
end if
2070-
end revEnvironmentExtensionsPath
2054+
end revEnvironmentExtensionsPaths
20712055

20722056
function revEnvironmentRuntimePath
20732057
return hookToolsPath("runtime", sToolsPath & "/Runtime")

Toolset/libraries/revanimationlibrary.livecodescript

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
script "revanimationlibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is me then
55
insert the script of me into back
66
end if
7-
end revLoadLibrary
7+
end extensionInitialize
88

9-
on revUnloadLibrary
9+
on extensionFinalize
1010
if the target is me then
1111
remove the script of me from back
1212
end if
13-
end revUnloadLibrary
13+
end extensionFinalize
1414

1515
--------Animation Library--------
1616
local lOverRide

Toolset/libraries/revbackscriptlibrary.livecodescript

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
script "revbackscriptlibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is me then
55
insert the script of me into back
66
revIDESubscribe "ideMouseMove"
77
end if
8-
end revLoadLibrary
8+
end extensionInitialize
99

10-
on revUnloadLibrary
10+
on extensionFinalize
1111
if the target is me then
1212
remove the script of me from back
1313
revIDEUnsubscribeAll
1414
end if
15-
end revUnloadLibrary
15+
end extensionFinalize
1616

1717
global gREVSuppressMessages
1818

@@ -2972,46 +2972,6 @@ on revShutDown
29722972

29732973
end revShutDown
29742974

2975-
function revCombineFilePaths pPaths, pPaths2
2976-
-- combines file paths based on last item, where duplicates keeps list 1
2977-
set the itemDel to slash
2978-
2979-
local tPaths
2980-
repeat for each line l in pPaths2
2981-
if the number of words in l is 0 then next repeat
2982-
put l into tPaths[item -1 of l]
2983-
end repeat
2984-
repeat for each line l in pPaths
2985-
if the number of words in l is 0 then next repeat
2986-
put l into tPaths[item -1 of l]
2987-
end repeat
2988-
2989-
local tReturn
2990-
repeat for each element e in tPaths
2991-
put e & cr after tReturn
2992-
end repeat
2993-
delete last char of tReturn
2994-
return tReturn
2995-
end revCombineFilePaths
2996-
2997-
function revAbsoluteFolderListing pDirectory
2998-
local tReturn
2999-
if there is no directory pDirectory then return empty
3000-
put the directory into tReturn
3001-
set the directory to pDirectory
3002-
3003-
local tFiles
3004-
put the files into tFiles
3005-
3006-
local tOutput
3007-
repeat for each line l in tFiles
3008-
put the directory & slash & l & cr after tOutput
3009-
end repeat
3010-
delete last char of tOutput
3011-
set the directory to tReturn
3012-
return tOutput
3013-
end revAbsoluteFolderListing
3014-
30152975
function revCalculateRelativePath pRoot, pFile
30162976
local tResult, tCount
30172977
set the itemDel to "/"

Toolset/libraries/revcommonlibrary.livecodescript

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
script "revcommonlibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is me then
55
insert the script of me into back
66
end if
7-
end revLoadLibrary
7+
end extensionInitialize
88

9-
on revUnloadLibrary
9+
on extensionFinalize
1010
if the target is me then
1111
remove the script of me from back
1212
end if
13-
end revUnloadLibrary
13+
end extensionFinalize
1414

1515
function revTargetStack pWhich
1616
local tParse
@@ -1573,3 +1573,40 @@ function revRuggedId pObject
15731573

15741574
return tId
15751575
end revRuggedId
1576+
1577+
function revAbsoluteFolderListing pDirectory
1578+
if there is no directory pDirectory then return empty
1579+
1580+
local tFiles
1581+
put files(pDirectory) into tFiles
1582+
1583+
local tOutput
1584+
repeat for each line tFile in tFiles
1585+
put the directory & slash & tFile & return after tOutput
1586+
end repeat
1587+
delete last char of tOutput
1588+
1589+
return tOutput
1590+
end revAbsoluteFolderListing
1591+
1592+
function revCombineFilePaths pPaths, pPaths2
1593+
-- combines file paths based on last item, where duplicates keeps list 1
1594+
set the itemDel to slash
1595+
1596+
local tPaths
1597+
repeat for each line l in pPaths2
1598+
if the number of words in l is 0 then next repeat
1599+
put l into tPaths[item -1 of l]
1600+
end repeat
1601+
repeat for each line l in pPaths
1602+
if the number of words in l is 0 then next repeat
1603+
put l into tPaths[item -1 of l]
1604+
end repeat
1605+
1606+
local tReturn
1607+
repeat for each element e in tPaths
1608+
put e & cr after tReturn
1609+
end repeat
1610+
delete last char of tReturn
1611+
return tReturn
1612+
end revCombineFilePaths

Toolset/libraries/revdatabaselibrary.livecodescript

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
script "revdatabaselibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is not me then
5-
pass "revLoadLibrary"
5+
pass "extensionInitialize"
66
end if
77
insert the script of me into front
88

@@ -14,14 +14,14 @@ on revLoadLibrary
1414
revSetDatabaseDriverPath revEnvironmentBinariesPath()
1515
end if
1616
end if
17-
end revLoadLibrary
17+
end extensionInitialize
1818

19-
on revUnloadLibrary
19+
on extensionFinalize
2020
if the target is not me then
21-
pass "revUnloadLibrary"
21+
pass "extensionFinalize"
2222
end if
2323
remove the script of me from front
24-
end revUnloadLibrary
24+
end extensionFinalize
2525

2626
####################################################################################################
2727
# Original comment by J.S

Toolset/libraries/revdebuggerlibrary.livecodescript

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
script "revdebuggerlibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is not me then
5-
pass "revLoadLibrary"
5+
pass "extensionInitialize"
66
end if
77
insert the script of me into front
88

@@ -11,14 +11,14 @@ on revLoadLibrary
1111
end if
1212

1313
__Initialize
14-
end revLoadLibrary
14+
end extensionInitialize
1515

16-
on revUnloadLibrary
16+
on extensionFinalize
1717
if the target is not me then
18-
pass "revUnloadLibrary"
18+
pass "extensionFinalize"
1919
end if
2020
remove the script of me from front
21-
end revUnloadLibrary
21+
end extensionFinalize
2222

2323

2424

@@ -203,7 +203,7 @@ function revDebuggerContexts
203203
# debugger itself and anything that was called by the debugger, i.e. appears after a debugger
204204
# call in the call stack.
205205

206-
if tStack is "revDebuggerLibrary" or tStack is "com.livecode.script-library.remotedebugger" then
206+
if tStack is "revDebuggerLibrary" or tStack is "com.livecode.library.remotedebugger" then
207207
# No debugger stack contexts are placed onto the call stack, however we also need to remove
208208
# *any* contexts that appear after a trace, traceError or traceBreak (or traceDone although less important).
209209
--if item -2 of tContext is among the words of "trace traceError traceBreak traceDone" then
@@ -1992,7 +1992,7 @@ private function __StackAllowed pStack
19921992
global gREVDevelopment
19931993
if "development" is not in the environment or gREVDEvelopment then
19941994
# With gREVDevelopment allow all stacks to be debugged except the debugger, as doing this will probably not work anyway.
1995-
if the short name of pStack is among the items of "revDebuggerLibrary,com.livecode.script-library.remotedebugger" then
1995+
if the short name of pStack is among the items of "revDebuggerLibrary,com.livecode.library.remotedebugger" then
19961996
return false
19971997
else
19981998
return true

Toolset/libraries/revdeploylibrary.livecodescript

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
script "revDeployLibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is me then
55
insert the script of me into back
66
end if
7-
end revLoadLibrary
7+
end extensionInitialize
88

9-
on revUnloadLibrary
9+
on extensionFinalize
1010
if the target is me then
1111
remove the script of me from back
1212
end if
13-
end revUnloadLibrary
13+
end extensionFinalize
1414

1515
////////////////////////////////////////////////////////////////////////////////
1616

Toolset/libraries/revfrontscriptlibrary.livecodescript

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
script "revfrontscriptlibrary"
22

3-
on revLoadLibrary
3+
on extensionInitialize
44
if the target is not me then
5-
pass "revLoadLibrary"
5+
pass "extensionInitialize"
66
end if
77
insert the script of me into front
8-
end revLoadLibrary
8+
end extensionInitialize
99

10-
on revUnloadLibrary
10+
on extensionFinalize
1111
if the target is not me then
12-
pass "revUnloadLibrary"
12+
pass "extensionFinalize"
1313
end if
1414
remove the script of me from front
15-
end revUnloadLibrary
15+
end extensionFinalize
1616

1717
global gREVSuppressMessages
1818
local lRefreshAOTimerID

0 commit comments

Comments
 (0)