% % acceptance vectors for Value editing % sel@ % % the exiting value is preset to allow a 'found' vector % when set by lookups, it overrides the vector originally assumed found, % then when any nested lookup fails it results in a proper 'not found' vector % true !Ent.Exiting _Ent.Page < % % Value editing vector operations % |EditVals % % the case for the first tab is derived from the tab # in E4 % to derive startup, use a separate lookup for prior tab 'name' in E5 % tab names can be expected to contain possible padding spaces begin and end % Ent._E3 < |Initial % % initially in copy mode for drag % 0 !Hier.Drag "Desk\ValueEdit" *helpface |Tab % % react to the tab selection % Ent._E4 trim ">>Tab " log() < |Values % % check for first time entering form % Ent._E5 trim < |-1 % % this is startup, the first time form loaded % % inject a grid branch in Values pep % *gridallv % % no Value fields editing % *contfoff > not { % % any non-startup transit to tab 0 may return to tab 1 % to finish editing % _Edit any)? { % % individual Value is being edited, return to tab 1 % _Edit negative { % % this is a new value cancel, ok to cancel % empty !Edit *contfoff } { % % user has tried to return to tab 0, go back to tab 1 % "Tabber(1);" Help.! } ifelse } { % % ok to reset, not editing Value % *editrtrn % % disable Value name and content fields % *contfoff } ifelse } if |Content % % check for after entering content tab after edit start % Ent._E6 trim ">>>Content " log() < |Values % % this is edit of value content startup % _Grid.Row negative { % % no value is being edited % *untabber } { _Edit any)? { empty *enteronm Help.! } { % % preserve this row as the value editing flag % the flag is set here so that a right click on the % grid node is equivalent to a single click % followed by the Content tab % _Grid.Row !Edit *gridding } ifelse } ifelse > not { _Edit any)? { empty *enteronm Help.! } { empty *enteroff Help.! } ifelse } if |New % % add new Value starts with empty content and allowing target name change % % enable Value name and content fields % _Edit any)? { % % already an edit in process, return to Content tab % "Tabber(1);" Help.! } { -1 !Edit "SetVal('');NewVan();SetVed(false,false);" Help.! } ifelse |Editors % % change over to Javascript mode % other modes changes cancelled except Value % _Edit any)? { % % will stay on Editors tab, don't allow Value change % *contfoff } { *untabber } ifelse |SaveAs % % save as a different value name % unlock the disabled value name % % enable Value name and content fields % -1 !Edit "SetVed(false,false);" Help.! |Save % % save the current named value and content % the browser page has closed out any special editing in process % _Edit any)? { % % save the Value name and data supplied to us % *atvalues Ent._E7 Ent._E8 *vrlvalue % % if supplied value change flag true, mark editor as Text % sel@ Ent._E9 "true" eq$ { % % change the editor setting to Text % "Text" Ent._E7 unescape ^"_" \! } if Task.@ empty !Edit } if *untabber |Cancel % % do not save the value content % empty !Edit *untabber *griddinh( |Delete % % remove this value entirely % _Grid.Row negative { % % no row selected, return to tab 0 % } { *atvalues % % mark the value for deleted/restored in the tree node % _Grid.Row 4 "Cell" do "Cell" get "false" eq$ { "true" } { "false" } ifelse dup "Cell" set _Grid.Row 1 "Cell" do "Cell" get minus "Cell" set "false" eq$ { *gridgetr Task.@ \! } { Task.@ false _Grid.Cell _\ "Valued" set } ifelse } ifelse Task.@ empty !Edit Tree.Changed *untabber > pop |Note % % change over to Estk mode if properly editing % other modes changes cancelled except Value % _Edit any)? { Ent._E5 unescape !Editor.Text "Note" *cureditr } { *untabber } ifelse |Estk % % change over to Estk mode if properly editing % other modes changes cancelled except Value % _Edit any)? { Ent._E5 unescape !Editor.Text "Estk" *cureditr } { *untabber } ifelse % % links clicked within page % |Html % % change over to Html mode if properly editing % other modes changes cancelled except Value % _Edit any)? { Ent._E5 unescape !Editor.Text "Html" *cureditr } { *untabber } ifelse |Markdown % % change over to other markdown mode if properly editing % other modes changes cancelled except Value % selected markdown is through links % _Edit any)? { Ent._E5 unescape !Editor.Text "Markdown" *cureditr } { *untabber } ifelse |Javascript % % change over to Javascript mode % other modes changes cancelled except Value % _Edit any)? { % % edit the current value with the codemirror js-configured editor page % Ent._E5 unescape !Editor.Text "Js" *cureditr } { *untabber } ifelse |EpicMd % % change over to Markdown mode % other modes changes cancelled except Value % _Edit any)? { % % edit the current value with the codemirror js-configured editor page % Ent._E5 unescape !Editor.Text "Epic" *cureditr } { *untabber } ifelse |Save % % this is requested due to a right-click on the Value grid row % % save the current named value and content % Ent._E5 Ent._E6 *vrlvalue *untabber |Conedit % % invoke the last editor used with this Value % Ent._E5 unescape !Editor.Text Ent._E4 unescape ^"_" \_ *cureditr |Accept % % if supplied value change flag true, there is a change in the Value % Ent._E6 "true" eq$ _Edit any)? or { % % don't react to an accept that involves an incomplete Value change action % } { % % all other actions seem complete % remove the grid, return to this task trees main presentation % *gridgone % % mark the tree as changed % Task.@ Tree.Changed *treefeds Help.Hide *nodebacr *noeditor } ifelse |Reject % % remove the grid % *gridgone % % return to this task trees main presentation % Help.Hide *noeditor *nodebacr |Help "Desk\ValueEdit" !Help.Url *xhelstar > pop % % check for any special editor communication % | "conecmir" look | | "conedill" look | | "conetmce" look | | "coneepic" look | > *acceptun % % stack: found %