ermouth: (Default)
[personal profile] ermouth

Оставлю для памяти – это только комменты к драфту запускателя яваскрипт-приложений – подгружает их, окна там переключает, состояния сохраняет. Запускатель работает по урлу в браузере, причём это всё синхронный реентерантный код, несколько сот строк.


//check url
//parse url
//combine 3+params if any into array
//check lock, return state if unsolicited reenter
//register only allowed if same app and same db
	//preconditions met?
	//############################ switch db				
		//db accessible?
		//db ui container exists?
		//is db starters already loaded?
			//'preload' field processing, obsolete	
			//loading templates if any
			//sorting and merging appkeys
			//loading apps
				//if app is not presented try to find it in acl'ed attaches
				//if still no app try to load it from public /app repo					
		//check if loaded					
		//render db main template
		//if no menubar for app, render it
		//render app methods list
	//############################ end switch db 
	//############################
	// appswitch
		//app exists?
			//if we have saved state 
				//copy params	
			//try to switch on default db app
			//no default app for db exists?	
		//container exists?
		//init done?
	// end appswitch ############################
	//############################
	//Method exec
	//guess method to exec
		//only in there were no initialization
		//method exist?
			//try to find other method
			//we may have somth in app state
			//list?
			//update?
			//any functions at all?
			//if we found method and we were called to guess params – may be some are stored?
	//end method guess
	//method invoke
	//really need invocation?
		//remember all opened db/apps
		//show all appropriate divs
		//try to invoke
		//end invoke
	//end method exec ############################
//check if we have some params scheduled by reenterant calls
//save states
//hide prev state divs
//recalc current state fields
// SETS STATE finally )
//show divs
//save states again		
//set app menu state
//set db menu state 
//end up

UPD. Тут надо добавить, что на общую логику меня натолкнуло наблюдение за работой аэропорта.

Profile

ermouth: (Default)
ermouth

November 2021

S M T W T F S
 123456
78910111213
14151617181920
21 222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 21st, 2026 10:55 am
Powered by Dreamwidth Studios