Skip to content

Commit

Permalink
changed colors, fixed a few small things
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmaier committed May 23, 2017
1 parent 563b805 commit 7088657
Show file tree
Hide file tree
Showing 104 changed files with 10,941 additions and 307 deletions.
Binary file modified Howstr_Desktop_Beta/Howstr_Desktop_Beta.livecode
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@ command adjList @pMain,@pShort
repeat for each key tDoc in pMain
put pMain[tDoc][0]["pointerTags"] into pShort[tDoc][0]["pointerTags"]
end repeat
-- hacky way to track states that should export with a weight of 1
if pMain[1][0]["onlyone"] is not empty then
put pMain[1][0]["onlyone"] into pShort[1][0]["onlyone"]
end if
end adjList

command topoSort @pShort,@pTopo,@pNoViz,@pNotes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local sMain -- main[doc][rec][tag]=data/pointers
--------------[filepath] = URL to the *.how file
--------------[saveStatus] = opened/saved/unsaved
--------------[UUID] = a Livecode generated Universally Unique IDentifier; distinguishes this project from all others
--------------[onlyone] = #,#,# list of records, when exported as resource/result their weight should be 1
-- sMain[1][1-n] = record keys
----------------[step] = this record is pointing to all of the information tags that together make up a graph element
----------------[myStep] = points back to the step that owns a tag
Expand All @@ -34,6 +35,7 @@ local sMainShort
-- sMainShort[1][0] = metadata (doesn't contain [lastKey] because sMainShort is not edited)
-------------------[undo] = true if something can be undone
-------------------[redo] = true if something can be redone
-------------------[onlyone] = #,#,# list of records, when exported as resource/result their weight should be 1
-- sMainShort[1][1-n] = record keys (but only the ones representing graph elements)
---------------------[type] = they should all have this tag, since they're all graph elements
-- other tags will appear when that step contains them (title, links, etc)
Expand Down Expand Up @@ -158,20 +160,19 @@ local sForBubbleA
-----------------[project][title]=text
---------------------------[memo]=text
---------------------------[figure]=URL
---------------------------[bubble_id]=unique id from bubble's database
---------------------------[bubble_id]=bubble's unique id for project_ver
---------------------------[filepath]=URL from pMain
---------------------------[UUID]=UUID of project
---------------------------[resources]=list of nodes
---------------------------[results]=list of nodes
-----------------[action][#][inputs/thruput/outputs]=#,#,#
----------------------------[weights]=string, each input and output with its multiple, if larger than 1
---------------------------[resources/results][rec]=weight
-----------------[action][#][thruput]=rec
----------------------------[inputs/outputs][rec]=weight
----------------------------[bubble_id]=unique id from bubble's database
-----------------[node][#][title]=text
----------------------------[memo]=text
----------------------------[figure]=URL
----------------------------[record]=#
----------------------------[bubble_id]=unique id from bubble's database
----------------------------[as_resource/as_result]=need #x total cr #x for title cr etc / have #x total cr #x from title cr etc


on setupAsOf3FEB2016
set the defaultstack to "HowstrBeta"
Expand All @@ -183,10 +184,10 @@ on setupAsOf3FEB2016
set the minHeight of stack "howstrBeta" to 400
set the minWidth of stack "howstrBeta" to 500
-- -- shouldn't be necessary forever, but a good hack for now
set the foregroundColor of card 1 of stack "Ask Dialog" to "0,220,220"
set the foregroundColor of card 1 of stack "Ask Dialog" to "0,0,0"
-- set the opaque of button "Ok" of card 1 of stack "Ask Dialog" to false
-- set the opaque of button "Cancel" of card 1 of stack "Ask Dialog" to false
set the foregroundColor of card 1 of stack "Answer Dialog" to "0,220,220"
set the foregroundColor of card 1 of stack "Answer Dialog" to "0,0,0"
-- set the opaque of button "Ok" of card 1 of stack "Answer Dialog" to false
-- set the opaque of button "close current" of card 1 of stack "Answer Dialog" to false
-- set the opaque of button "close" of card 1 of stack "Answer Dialog" to false
Expand Down Expand Up @@ -636,6 +637,21 @@ on nodeDetailsChanged
changeInfo sMain,tStuff -- grapheriffic
end if -- tKey is a num and 'new' is not [empty]
end repeat
-- ! a crude hack, but this 'onlyone' check is only relevant to exporting a weight 4MAY2017
if tDeets["onlyone"] is "true" then
put sMain[sNowDoc][0]["onlyone"] into tList
put tDeets["rec"] into item ((the number of items of tList) + 1) of tList
put noDupes(tList,comma) into tList2
put tList2 into sMain[sNowDoc][0]["onlyone"]
else
put sMain[sNowDoc][0]["onlyone"] into tList
set the wholematches to true
put itemoffset(tDeets["rec"],tList) into tOffset
if tOffset is not 0 then
put empty into item tOffset of tList
put tList into sMain[sNowDoc][0]["onlyone"]
end if
end if
refreshDraw
refreshDisplay
end nodeDetailsChanged
Expand Down Expand Up @@ -741,18 +757,6 @@ on repoButtMouseUp
put tPath & "/software/repowrangler.livecode" into tRepoWrangler
go to stack tRepoWrangler
set the cSaveStatus of stack "repoWrangler" to sMain[sNowDoc][0]["saveStatus"]
-- need to save first (commit to local repository)
-- if sMain[sNowDoc][0]["filepath"] is empty then
-- saveAsButtMouseUp
-- if sMain[sNowDoc][0]["filepath"] is empty then exit repoButtMouseUp
-- end if
-- -- adjList already called on every change
-- topoSort sMainShort,sTopoSort,sNotVisited,sNoteList
-- supplyDemand sMainShort,sScopeSketch,sResources,sSomethingChanged,sNotVisited
-- -- put writeInstructions(sMain,sMainShort,sTopoSort,sNotVisited) into tInstr
-- arrayForBubble sMain,sMainShort,sTopoSort,sNotVisited,sForBubbleA,sScopeSketch,sResources -- in displayerang
-- set the cPayload of stack "repowrangler" to sForBubbleA
-- go to stack "repowrangler"
end repoButtMouseUp

on uploadPrep
Expand All @@ -774,7 +778,7 @@ on saveButtMouseUp
-- put the result into URL ("file:" & sMain[sNowDoc][0]["filepath"])
put tResult into URL ("file:" & sMain[sNowDoc][0]["filepath"])
put "saved" into sMain[sNowDoc][0]["saveStatus"]
set the cSaveStatus of stack "repoWrangler" to "saved"
-- set the cSaveStatus of stack "repoWrangler" to "saved"
set itemdelimiter to slash
put item -1 of sMain[sNowDoc][0]["filepath"] into tForShow
-- replace ".how" with "" in tForShow
Expand Down Expand Up @@ -847,7 +851,7 @@ on saveAsButtMouseUp
put jsonFromArray(sMain[sNowDoc]) into tReq["fileData"]
put saveNewProject(tReq) into tFullName
put "saved" into sMain[sNowDoc][0]["saveStatus"]
set the cSaveStatus of stack "repoWrangler" to "saved"
-- set the cSaveStatus of stack "repoWrangler" to "saved"
put tFullName into sMain[sNowDoc][0]["filepath"]
put item -1 of tFullName into tForShow
replace ".how" with "" in tForShow
Expand Down Expand Up @@ -1109,3 +1113,55 @@ on repoButtMouseUp
go stack "software/repowrangler.livecode"
end repoButtMouseUp

function noDupes tList,tDelim,tCaseSensitive
/* noDupes Text Items
Syntax:
noDupes (tList,[tDelim],[tCaseSensitive])
Examples:
assuming theList starts as a comma-delimited list

noDupes (theList)
noDupes (theList,comma)
noDupes (theList,comma,true)

following which theList will contain the original list
stripped of empty and duplicate items

Description:
strips duplicate (and empty) lines/items from a list

. if tDelim = empty then looks first for the presence of cr in tList,
. if found, defaults to cr as the delimiter
. if no cr found, looks for the presence of comma in tList,
. if found, defaults to comma as the delimiter
. if neither found, returns empty (user should have specified another delim)

returns a list with same delim as input list
order of list will likely be changed, may require re-sorting
the *command* NoDuplicates (q.v.) scales better with very large lists
but is inherently case-sensitive, ie, will retain both "Chuck" and "chuck"

Source:
noDupes */

if tCaseSensitive = empty then put false into tCaseSensitive
set the caseSensitive to tCaseSensitive
if tList = empty then return empty
if tDelim = empty then
if cr is in tList then
put sr into tDelim
else if comma is in tList then
put comma into tDelim
else
return empty
end if
end if
set the itemdelimiter to tDelim
repeat for each item i in tList
if i = empty then next repeat
put 1 into aFinal[i]
end repeat
put the keys of aFinal into finalList
replace cr with tDelim in finalList
return finalList
end noDupes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 7088657

Please sign in to comment.