Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/engine_builder.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private command engineBuilderBuildEnvironment pEdition, pVersion
local tKeyFile
put the tempName into tKeyFile
put tPubKey into URL ("binfile:" & tKeyFile)
get shell(builderSystemFolder() & "/public_key_setter -ui" && builderCommercialFolder() & "/src/Environment.rev" && tKeyFile)
get shell(builderSystemFolder() & "/public_key_setter -ui" && builderCommercialFolder() & "/src/environment.livecode" && tKeyFile)
builderLog "message", it
delete file tKeyFile

Expand Down
46 changes: 32 additions & 14 deletions engine/engine.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'targets':
[
{
'target_name': 'update_liburl_script',
'target_name': 'descriptify_environment_stack',
'type': 'none',

'variables':
Expand Down Expand Up @@ -50,6 +50,25 @@
],
},

'sources':
[
'src/environment.livecode',
'../ide-support/revliburl.livecodescript',
'src/environment/accountsignupcardbehavior.livecodescript',
'src/environment/automaticactivationactivationgroupbehavior.livecodescript',
'src/environment/automaticactivationactivationinputpassfieldbehavior.livecodescript',
'src/environment/automaticactivationbackgroundgroupbehavior.livecodescript',
'src/environment/automaticactivationcardbehavior.livecodescript',
'src/environment/automaticactivationprocessinggroupbehavior.livecodescript',
'src/environment/getstartedgetstartedstatusgroupbehavior.livecodescript',
'src/environment/resourcesresourcesloadergroupbehavior.livecodescript',
'src/environment/resourcesresourcespushbuttonbehaviorbuttonbehavior.livecodescript',
'src/environment/stackbehavior.livecodescript',
'src/environment/unlicensedactivatefieldbehavior.livecodescript',
'src/environment/unlicensedbkgndbehavior.livecodescript',
'src/environment/unlicensedbuynowbuttonbehavior.livecodescript',
],

'dependencies':
[
# Requires a working LiveCode engine
Expand All @@ -59,28 +78,27 @@
'actions':
[
{
'action_name': 'update_liburl',
'message': 'Updating environment stack liburl script',
'action_name': 'descriptify_environment_stack',
'message': 'De-scriptifying the environment stack',

'inputs':
[
'src/Environment.rev',
'../ide-support/revliburl.livecodescript',
'../util/update-liburl.livecodescript',
'../util/descriptify_stack.livecodescript',
'<@(_sources)',
],

'outputs':
[
'<(SHARED_INTERMEDIATE_DIR)/src/Environment_LibURL.rev',
'<(SHARED_INTERMEDIATE_DIR)/src/environment_descriptified.livecode',
],

'action':
[
'<(engine)',
'../util/update-liburl.livecodescript',
'src/Environment.rev',
'../ide-support/revliburl.livecodescript',
'<(SHARED_INTERMEDIATE_DIR)/src/Environment_LibURL.rev',
'../util/descriptify_stack.livecodescript',
'<(SHARED_INTERMEDIATE_DIR)/src/environment_descriptified.livecode',
'<@(_sources)',

],
},
],
Expand All @@ -92,7 +110,7 @@

'dependencies':
[
'update_liburl_script',
'descriptify_environment_stack',
],

'actions':
Expand All @@ -102,7 +120,7 @@
'inputs':
[
'../util/compress_data.pl',
'<(SHARED_INTERMEDIATE_DIR)/src/Environment_LibURL.rev',
'<(SHARED_INTERMEDIATE_DIR)/src/environment_descriptified.livecode',
],
'outputs':
[
Expand All @@ -113,7 +131,7 @@
[
'<@(perl)',
'../util/compress_data.pl',
'src/Environment.rev',
'<(SHARED_INTERMEDIATE_DIR)/src/environment_descriptified.livecode',
'<@(_outputs)',
# Really nasty hack to prevent this from being treated as a path
'$(this_is_an_undefined_variable)MCstartupstack',
Expand Down
Binary file removed engine/src/Environment.rev
Binary file not shown.
Binary file added engine/src/environment.livecode
Binary file not shown.
60 changes: 60 additions & 0 deletions engine/src/environment/accountsignupcardbehavior.livecodescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
script "EnvironmentAccountSignupCardBehavior"
on preOpenCard
put empty into field "name"
put empty into field "email"
put empty into field "password"
set the cPassword of field "password" to empty
put empty into field "retype password"
set the cPassword of field "retype password" to empty
put empty into field "signup_message"
hide field "signup_message"
hide image "loader"
selectIndicator "account"
end preOpenCard

on accountSignup
// Verify information
local tName, tEmail, tPassword,tReType

put field "name" into tName
put field "email" into tEmail
put the cPassword of field "password" into tPassword
put the cPassword of field "retype password" into tReType

if tName is empty then
accountSignUpMessage "Please enter your name."
exit accountSignup
end if

if tEmail is empty then
accountSignUpMessage "Please enter your email address."
exit accountSignup
end if

if tPassword is empty then
accountSignUpMessage "Please enter a password."
exit accountSignup
end if

if tReType is empty then
accountSignUpMessage "Please retype the password."
exit accountSignup
end if

if tPassword is not tReType then
accountSignUpMessage "Please ensure your password and retyped password match."
exit accountSignup
end if

accountCreate tName, tEmail, tPassword
end accountSignup

on openField
accountSignupMessageClose
end openField

on focusIn
accountSignupMessageClose
end focusIn


Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
script "EnvironmentAccountSignupPasswordFieldBehaviorButtonBehavior"
on keydown tKey
local tSChar,tEChar, tPasswd, tBulletCode
put word 2 of the selectedChunk of me into tSChar
put word 4 of the selectedChunk of me into tEChar
put the cPassword of me into tPasswd
if tEChar > tSChar then -- some text is selected
delete char tSChar to tEChar of me
delete char tSChar to tEChar of tPasswd
end if
put word 2 of the selectedChunk of me into tSChar
put word 4 of the selectedChunk of me into tEChar
put tKey after char tEChar of tPasswd
set the cPassword of me to tPasswd
--put tPasswd # debugging
if the platform is "MacOS" then
put 165 into tBulletCode
else
put 149 into tBulletCode
end if

put numtochar(tBulletCode) after char tEChar of the target
end keyDown

on backspaceKey
local tSChar,tEChar, tPasswd
put word 2 of the selectedChunk of me into tSChar
put word 4 of the selectedChunk of me into tEChar
put the cPassword of me into tPasswd
if tEChar > tSChar then -- text is selected
delete char tSChar to tEChar of me
delete char tSChar to tEChar of tPasswd
else
delete char tEChar of me
delete char tEChar of tPasswd
end if
set the cPassword of me to tPasswd

--put tPasswd # debugging
end backspaceKey

on deleteKey
local tSChar,tEChar, tPasswd
put word 2 of the selectedChunk of me into tSChar
put word 4 of the selectedChunk of me into tEChar
put the cPassword of me into tPasswd
if tEChar > tSChar then -- text is selected
delete char tSChar to tEChar of me
delete char tSChar to tEChar of tPasswd
else
delete char tSChar of me
delete char tSChar of tPasswd
end if
set the cPassword of me to tPasswd

--put tPasswd # debugging
end deleteKey

on openField
--put the cPassword of me # for debugging
put bulletize(the cPassword of me) into me
accountSignupMessageClose
end openField

function bulletize pText
local tBulletCode, tBullets, tChar
if the platform is "MacOS" then
put 165 into tBulletCode
else
put 149 into tBulletCode
end if
put empty into tBullets
repeat for each char tChar in pText
put numToChar(tBulletCode) after tBullets
end repeat
return tBullets
end bulletize
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
script "EnvironmentAutomaticActivationActivationGroupBehavior"
local sPasswordIsHash
local sPassword

on preOpenBackground
set the textFont of field "Error Message" to messageFont()
set the textSize of field "Error Message" to messageFontSize()

set the textColor of field "Pass Label" to headingColor()
set the textColor of field "Pass" to subtitleColor()
set the textColor of field "Login" to subtitleColor()
set the textColor of field "Login Label" to headingColor()
set the textColor of field "Error Message" to primaryErrorColor()

repeat for each item tControl in "Login Label,Login,Pass Label,Pass"
set the textFont of control tControl to entryFont()
set the textSize of control tControl to entryFontSize()
set the textStyle of control tControl to "bold"
end repeat

set the uLabel of control "Quit" to "Quit"
set the uDefault of control "Quit" to false
set the uEnabled of control "Quit" to true

set the uLabel of control "Activate" to "Activate"
set the uDefault of control "Activate" to true

pass preOpenBackground
end preOpenBackground

################################################################################

command setLogin pEmail
put pEmail into field "Login"
updateActivateEnablement
end setLogin

command attemptActivation
if field "Login" is empty or field "Pass" is empty then
exit attemptActivation
end if

if sPasswordIsHash then
performAutomaticActivation word 1 to -1 of field "Login", empty, word 1 to -1 of sPassword
else
performAutomaticActivation word 1 to -1 of field "Login", word 1 to -1 of sPassword, the md5Digest of word 1 to -1 of sPassword
end if
if the result is "error" then
show group "Input"
updateErrorMessage
end if
end attemptActivation

command updateActivateEnablement
set the uEnabled of control "Activate" to (word 1 to -1 of field "Login" is not empty and word 1 to -1 of field "Pass" is not empty)
end updateActivateEnablement

################################################################################

command updateErrorMessage
local tMessage
put activationError() into tMessage
if tMessage is empty then
put activationReason() into tMessage
end if
if tMessage is empty then
hide group "Error"
exit updateErrorMessage
end if

lock screen
set the width of field "Error Message" to 1024

put tMessage into field "Error Message"
set the width of field "Error Message" to min(the formattedWidth of field "Error Message", the width of group "Error" - 20)
set the height of field "Error Message" to the formattedHeight of field "Error Message"
set the left of field "Error Message" to the left of group "Error" + (the width of group "Error" - the width of field "Error Message") div 2 + 20
set the loc of button "Error Symbol" to the loc of group "Error"
set the left of button "Error Symbol" to the left of field "Error Message" - 20

show group "Error"
unlock screen
end updateErrorMessage

################################################################################

command setPassword pHash, pValue
put pHash into sPasswordIsHash
put pValue into sPassword
updatePassword
end setPassword

command updatePassword
lock screen
if sPasswordIsHash then
put "********" into field "Pass"
else
put sPassword into field "Pass"
end if
repeat with x = 1 to the number of chars of field "Pass"
set the imageSource of char x of field "Pass" to 10025
end repeat
unlock screen
end updatePassword

on keyDown
if the short name of the target is "Pass" then
selectionChanged
end if
pass keyDown
end keyDown

on rawKeyUp
if the short name of the target is "Pass" then
selectionChanged
end if
updateActivateEnablement
end rawKeyUp

on selectionChanged
if the short name of the target is "Pass" then
if sPasswordIsHash and the text of field "Pass" is "********" then
select char 1 to -1 of field "Pass"
else
get the selectedChunk
put false into sPasswordIsHash
put the text of field "Pass" into sPassword
updatePassword
select it
end if
end if
updateActivateEnablement
end selectionChanged

################################################################################
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
script "EnvironmentAutomaticActivationActivationInputPassFieldBehavior"
on returnInField
click at the loc of control "Activate"
--attemptActivation
end returnInField
Loading