Skip to content

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
revig committed May 27, 2021
2 parents 7be6510 + 2221b4e commit 85a5f6a
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ The stylesheet system handles two nonstandard properties "padding" and "align".

## Meta

- Version: 1.0.2
- Version: 1.0.3
- Web Site: <https://revigniter.com/>
- Author: [Ralf Bitter](mailto:rabit@revigniter.com)

Expand Down
Binary file modified installer/stylesHelperInstaller.livecode
Binary file not shown.
37 changes: 20 additions & 17 deletions library/stylesLib.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ script "stylesLib"
--
-- copyright 2021 revIgniter.com
--
-- Version 1.0.1
-- Version 1.0.3
--
-- License: Apache License, Version 2.0, see http://www.apache.org/licenses/LICENSE-2.0
--
Expand Down Expand Up @@ -124,9 +124,9 @@ end syLoadStyles
--| COMMAND syApplyStyles
--|
--| Author: rabit
--| Version: 1.1
--| Version: 1.2
--| Created: 2021-03-19
--| Last Mod: 2021-05-19
--| Last Mod: 2021-05-27
--| Requires: syResizeElement
--|
--| Summary: Loop through the list of selectors of a control and apply the appropriate property values.
Expand Down Expand Up @@ -180,20 +180,23 @@ command syApplyStyles pControlID
if tProp <> "align" then

# CHECK IF THE PROPERTY NAME IS VALID
put the properties of control id pControlID into tControlPropsA
if tProp is not among the lines of the keys of tControlPropsA then
put "foregroundColor,firstcolor,textcolor,thumbcolor,fillfore,penfore,forecolor,backgroundColor,secondcolor,backcolor" into tPropSynos

if tProp is not among the items of tPropSynos then
delete variable sStylesA[tSelector][tProp]
answer warning "Invalid property name:" && quote & tProp & quote & "! Property name removed."

# SET FLAG TO RESAVE JSON FILE
put TRUE into sOverwriteStylesheet

next repeat
end if
end if -- if tProp is not among the lines of the keys of tControlPropsA
# EXCLUDE WIDGETS WHICH DO NOT HAVE A PROPERTIES PROPERTY
if word 1 of the name of control id pControlID <> "widget" then
put the properties of control id pControlID into tControlPropsA
if tProp is not among the lines of the keys of tControlPropsA then
put "foregroundColor,firstcolor,textcolor,thumbcolor,fillfore,penfore,forecolor,backgroundColor,secondcolor,backcolor,width,height,loc,location,left,top,right,bottom,layer" into tPropSynos

if tProp is not among the items of tPropSynos then
delete variable sStylesA[tSelector][tProp]
answer warning "Invalid property name:" && quote & tProp & quote & "! Property name removed."

# SET FLAG TO RESAVE JSON FILE
put TRUE into sOverwriteStylesheet

next repeat
end if
end if -- if tProp is not among the lines of the keys of tControlPropsA
end if -- if word 1 of the name of control id pControlID <> "widget"

put the tProp of control id pControlID into tCurrentPropVal

Expand Down
Binary file modified plugin/stylesHelper.livecode
Binary file not shown.
41 changes: 41 additions & 0 deletions plugin/stylesHelper_Scripts/diff/diff_1622127604.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
stack "stylesHelper"
/Users/rabit/Documents/gitMercurial/livecode-stylesheet-system/plugin/stylesHelper_Scripts/stack_stylesHelper_.livecodescript

@@ -527,15 +527,27 @@
# CHECK IF THE uStylesLibPath OF THE TARGET IS SET
# AND START USING STACK stylesLib
if tTargetLoaded then
- put the uStylesLibPath of stack tTarget into tStylesLibOfTarget
- if there is a file tStylesLibOfTarget then
- if tStylesLibFile is not "inUse" then
- start using stack tStylesLibOfTarget
- put "inUse" into tStylesLibFile
- end if
+ if the uStylesLibPath of stack tTarget <> empty then

- put tStylesLibOfTarget into tStylesLibPath
- end if -- if there is a file tStylesLibOfTarget
+ put the uStylesLibPath of stack tTarget into tStylesLibOfTarget
+ if there is a file tStylesLibOfTarget then
+ if tStylesLibFile is not "inUse" then
+ start using stack tStylesLibOfTarget
+ put "inUse" into tStylesLibFile
+ end if
+
+ put tStylesLibOfTarget into tStylesLibPath
+ end if -- if there is a file tStylesLibOfTarget
+
+ else -- if the uStylesLibPath of stack tTarget <> empty
+ # THIS IS A NEW STACK, CLOSE stylesLib
+ if tStylesLibFile is "inUse" then
+ stop using stack "stylesLib"
+ delete stack "stylesLib"
+ put empty into tStylesLibFile
+ end if -- if tStylesLibFile is "inUse"
+
+ end if -- if the uStylesLibPath of stack tTarget <> empty
end if -- if tTargetLoaded

# CHECK IF stylesLib IS IN USE IN CASE THE TARGET STACK IS LOADED


28 changes: 20 additions & 8 deletions plugin/stylesHelper_Scripts/stack_stylesHelper_.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -527,15 +527,27 @@ command prepareTarget
# CHECK IF THE uStylesLibPath OF THE TARGET IS SET
# AND START USING STACK stylesLib
if tTargetLoaded then
put the uStylesLibPath of stack tTarget into tStylesLibOfTarget
if there is a file tStylesLibOfTarget then
if tStylesLibFile is not "inUse" then
start using stack tStylesLibOfTarget
put "inUse" into tStylesLibFile
end if
if the uStylesLibPath of stack tTarget <> empty then

put the uStylesLibPath of stack tTarget into tStylesLibOfTarget
if there is a file tStylesLibOfTarget then
if tStylesLibFile is not "inUse" then
start using stack tStylesLibOfTarget
put "inUse" into tStylesLibFile
end if

put tStylesLibOfTarget into tStylesLibPath
end if -- if there is a file tStylesLibOfTarget

else -- if the uStylesLibPath of stack tTarget <> empty
# THIS IS A NEW STACK, CLOSE stylesLib
if tStylesLibFile is "inUse" then
stop using stack "stylesLib"
delete stack "stylesLib"
put empty into tStylesLibFile
end if -- if tStylesLibFile is "inUse"

put tStylesLibOfTarget into tStylesLibPath
end if -- if there is a file tStylesLibOfTarget
end if -- if the uStylesLibPath of stack tTarget <> empty
end if -- if tTargetLoaded

# CHECK IF stylesLib IS IN USE IN CASE THE TARGET STACK IS LOADED
Expand Down

0 comments on commit 85a5f6a

Please sign in to comment.