Commit eec6b3d287db4c5ae18b3864d72793addc5ab534
1 parent
24f1fb39
old CB integration in AIAHTML5
Showing
3 changed files
with
760 additions
and
0 deletions
400-SOURCECODE/AIAHTML5+FlexCB/AppStartup.mxml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<mx:Application implements="com.adam.aia.IAppBase,com.magic.mvc.container.IMVCContainer" | ||
3 | + xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:kapit="fr.kapit.*" | ||
4 | + xmlns:controller="com.adam.aia.appstartup.controller.*" | ||
5 | + width="100%" height="100%" layout="absolute" | ||
6 | + backgroundColor="#000000" | ||
7 | + preinitialize="executePreinitializationTasks()" | ||
8 | + creationComplete="onCreationComplete();" | ||
9 | + verticalScrollPolicy="off" horizontalScrollPolicy="off"> | ||
10 | + <!--<kapit:KapInspect />--> | ||
11 | + <mx:Script> | ||
12 | + <![CDATA[ | ||
13 | + import com.adam.aia.CommonUtil; | ||
14 | + import com.adam.aia.IAppBase; | ||
15 | + import com.adam.aia.appstartup.event.StartupEventConst; | ||
16 | + import com.adam.aia.appstartup.model.UserContextVO; | ||
17 | + import com.adam.aia.appstartup.util.StartupOSTConst; | ||
18 | + import com.adam.aia.appstartup.view.LoginView; | ||
19 | + import com.adobe.cairngorm.business.ServiceLocator; | ||
20 | + import com.adobe.cairngorm.events.UMEvent; | ||
21 | + import com.magic.flexmdi.manager.MDIModuleWindowManager; | ||
22 | + import com.magic.mvc.container.IMVCContainer; | ||
23 | + import com.magic.mvc.container.MVCVBox; | ||
24 | + import com.magic.mvc.context.IMVCContext; | ||
25 | + import com.magic.mvc.context.MVCContextManager; | ||
26 | + import com.magic.util.LocaleManager; | ||
27 | + import com.magic.util.OSTManager; | ||
28 | + import com.magic.util.UriUtil; | ||
29 | + import com.magic.util.cache.CacheManager; | ||
30 | + | ||
31 | + import mx.controls.Alert; | ||
32 | + import mx.controls.ProgressBar; | ||
33 | + import mx.controls.SWFLoader; | ||
34 | + import mx.events.FlexEvent; | ||
35 | + import mx.managers.BrowserManager; | ||
36 | + import mx.managers.SystemManager; | ||
37 | + //import fr.kapit.KapInspect; | ||
38 | + | ||
39 | + public const LOGIN_SUCCESS:String = "LoginSuccess"; | ||
40 | + public const LOAD_LOGIN_APP:String = "LoadLoginApp"; | ||
41 | + public const LOAD_ADMIN_APP:String = "LoadAdminApp"; | ||
42 | + public const LOAD_MAIN_APP:String = "LoadContainerApp"; | ||
43 | + public const GET_USER_CONTEXT:String = "GetUserContext"; | ||
44 | + | ||
45 | + private const APP_ADMIN:String = "AppAdmin.swf"; | ||
46 | + private const APP_MAIN:String = "AppMain.swf"; | ||
47 | + private const APP_STARTUP:String = "AppStartup.swf"; | ||
48 | + private const LOCALE_XML:String = "locale.xml"; | ||
49 | + | ||
50 | + | ||
51 | + import com.adam.pattern.Request; | ||
52 | + import com.adam.pattern.Response; | ||
53 | + import com.adam.aia.appstartup.business.AppStartupConst; | ||
54 | + import com.adam.aia.appstartup.business.StartupRemoteDelegate; | ||
55 | + import com.adam.aia.appstartup.business.StartupRemoteDelegate; | ||
56 | + | ||
57 | + //****************************************************** | ||
58 | + // Public properties | ||
59 | + //****************************************************** | ||
60 | + | ||
61 | + private var _objSwfLoader:SWFLoader; | ||
62 | + private var _objProgressBar:ProgressBar; | ||
63 | + | ||
64 | + private const APPSTARTUP_OST_XML:String = "appstartup_ost.xml"; | ||
65 | + private const CONTENT_PATH:String = "content_path"; | ||
66 | + private const PATH_SEPARATOR:String="/"; | ||
67 | + | ||
68 | + | ||
69 | + public var _cmpLoginView:LoginView; | ||
70 | + | ||
71 | + public var objGlobalUserContext:UserContextVO = new UserContextVO(); | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + /** | ||
76 | + * Override of initialized method to defer application initialization | ||
77 | + * finish until AFTER the runtime style has been loaded | ||
78 | + * | ||
79 | + * @param value Has the UIComponent/application been initialized | ||
80 | + */ | ||
81 | + override public function set initialized(value:Boolean):void | ||
82 | + { | ||
83 | + // Hold off until the Runtime CSS SWF is done loading. | ||
84 | + } | ||
85 | + | ||
86 | + /** | ||
87 | + * This function is responsible for invoking task which needed to be done before initialization. | ||
88 | + * Basically the initialize the LocaleManager with the locale info. | ||
89 | + * | ||
90 | + */ | ||
91 | + private function executePreinitializationTasks():void | ||
92 | + { | ||
93 | + //new KapInspect(); | ||
94 | + | ||
95 | + setupMVCContextManager(); | ||
96 | + // just for the sake of initializing this first | ||
97 | + ServiceLocator.getInstance(); | ||
98 | + MDIModuleWindowManager.getInstance(); | ||
99 | + MVCContextManager.getInstance(); | ||
100 | + | ||
101 | + LocaleManager.getInstance().addEventListener(Event.COMPLETE,onLocale); | ||
102 | + LocaleManager.getInstance().load(UriUtil.getAbsoluteUriFromApplication(LOCALE_XML)); | ||
103 | + } | ||
104 | + | ||
105 | + /** | ||
106 | + * Once the locale xml is loaded and initialized the proceed | ||
107 | + * | ||
108 | + */ | ||
109 | + private function onLocale(objEvent:Event):void | ||
110 | + { | ||
111 | + super.initialized = true; | ||
112 | + } | ||
113 | + | ||
114 | + /** | ||
115 | + * Function implementation for IAppBase.doAction() | ||
116 | + * This is the only window to the AppBase any call should be made through this only | ||
117 | + */ | ||
118 | + public function doAction(strActionId:String, ...args):* | ||
119 | + { | ||
120 | + BrowserManager.getInstance().init("","A.D.A.M. Interactive Anatomy"); | ||
121 | + //displayError | ||
122 | + switch(strActionId) | ||
123 | + { | ||
124 | + case LOGIN_SUCCESS: | ||
125 | + loadApp(UriUtil.getAbsoluteUriFromApplication(APP_MAIN)); | ||
126 | + break; | ||
127 | + case LOAD_ADMIN_APP: | ||
128 | + loadApp(UriUtil.getAbsoluteUriFromApplication(APP_ADMIN)); | ||
129 | + break; | ||
130 | + case LOAD_LOGIN_APP: | ||
131 | + loadLoginView(); | ||
132 | + break; | ||
133 | + case GET_USER_CONTEXT: | ||
134 | + return objGlobalUserContext; | ||
135 | + break; | ||
136 | + } | ||
137 | + } | ||
138 | + | ||
139 | + /** | ||
140 | + * function to load an application swf. creates a new swf load instance and loads the application in that. | ||
141 | + * if there is already another application running then it will first unload that | ||
142 | + * @param : strPath - uri to the application swf that needs to be loaded | ||
143 | + * @return : void | ||
144 | + */ | ||
145 | + private function loadApp(strPath:String):void | ||
146 | + { | ||
147 | + unloadApp(); | ||
148 | + var objLoadContext:LoaderContext = new LoaderContext(false, | ||
149 | + ApplicationDomain.currentDomain); | ||
150 | + _objSwfLoader = new SWFLoader(); | ||
151 | + _objSwfLoader.visible = false; | ||
152 | + _objSwfLoader.percentHeight = 100; | ||
153 | + _objSwfLoader.percentWidth = 100; | ||
154 | + _objSwfLoader.showBusyCursor = true; | ||
155 | + _objSwfLoader.addEventListener(Event.COMPLETE, onAppLoadComplete); | ||
156 | + _objSwfLoader.addEventListener(IOErrorEvent.IO_ERROR, | ||
157 | + onAppLoadIOError); | ||
158 | + _objSwfLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, | ||
159 | + onAppLoadSecurityError); | ||
160 | + _objProgressBar = CommonUtil.getProgressBar(this, _objSwfLoader, CommonUtil.APP_LOADER_STRING); | ||
161 | + /* | ||
162 | + _objProgressBar.width = 300; | ||
163 | + _objProgressBar.x = (width-300)/2; | ||
164 | + _objProgressBar.y = (height)/2; | ||
165 | + _objProgressBar.mode = "pool"; | ||
166 | + _objProgressBar.label = APP_LOADER_STRING; | ||
167 | + _objProgressBar.source = _objSwfLoader; | ||
168 | + */ | ||
169 | + addChild(_objSwfLoader); | ||
170 | + //addChild(_objProgressBar); | ||
171 | + _objSwfLoader.loaderContext = objLoadContext; | ||
172 | + _objSwfLoader.source = strPath; | ||
173 | + | ||
174 | + } | ||
175 | + | ||
176 | + private function setupMVCContextManager():void | ||
177 | + { | ||
178 | + MVCContextManager.getInstance().flush(); | ||
179 | + //register Global MVC context | ||
180 | + MVCContextManager.getInstance().createGlobalContext( | ||
181 | + _objModelLocator, | ||
182 | + _objViewLocator, | ||
183 | + _objFrontController); | ||
184 | + } | ||
185 | + /** | ||
186 | + * unloads the currently loaded application. | ||
187 | + * @param : none | ||
188 | + * @return : void | ||
189 | + */ | ||
190 | + private function unloadApp():void | ||
191 | + { | ||
192 | + unloadLoginView(); | ||
193 | + if(_objSwfLoader != null) | ||
194 | + { | ||
195 | + | ||
196 | + cleanupApplication(); | ||
197 | + MDIModuleWindowManager.getInstance().flush(); | ||
198 | + MVCContextManager.getInstance().flush(); | ||
199 | + com.magic.util.CacheManager.getInstance().flush(); | ||
200 | + com.magic.util.cache.CacheManager.getInstance().dispose(); | ||
201 | + _objSwfLoader.source = null; | ||
202 | + removeChild(_objSwfLoader); | ||
203 | + _objSwfLoader = null; | ||
204 | + | ||
205 | + } | ||
206 | + } | ||
207 | + | ||
208 | + /** | ||
209 | + * This function retrieves the loaded application and invokes its prepareToUnload function. | ||
210 | + * | ||
211 | + * @param none | ||
212 | + * @return none | ||
213 | + */ | ||
214 | + private function cleanupApplication():void | ||
215 | + { | ||
216 | + if(_objSwfLoader.content == null) | ||
217 | + { | ||
218 | + return; | ||
219 | + } | ||
220 | + // | ||
221 | + var objSystemManager:SystemManager = SystemManager(_objSwfLoader.content); | ||
222 | + if(objSystemManager && objSystemManager.application) | ||
223 | + { | ||
224 | + var objApplication:Object = Object(objSystemManager.application); | ||
225 | + if(objApplication.hasOwnProperty("prepareToUnload")) | ||
226 | + { | ||
227 | + objApplication["prepareToUnload"]() | ||
228 | + } | ||
229 | + } | ||
230 | + } | ||
231 | + /** | ||
232 | + * event handler on application swf load complete. Remove the progress bar. | ||
233 | + * @param : objEvent | ||
234 | + * @return : void | ||
235 | + */ | ||
236 | + private function onAppLoadComplete(objEvent:Event):void | ||
237 | + { | ||
238 | + if(_objProgressBar != null && _objSwfLoader != null) | ||
239 | + { | ||
240 | + _objSwfLoader.showBusyCursor = false; | ||
241 | + _objSwfLoader.visible = true; | ||
242 | + removeChild(_objProgressBar); | ||
243 | + _objProgressBar = null; | ||
244 | + } | ||
245 | + } | ||
246 | + | ||
247 | + /** | ||
248 | + * Event handler of input/output error. prompt the error message to the user. | ||
249 | + * @param : none | ||
250 | + * @return : void | ||
251 | + */ | ||
252 | + private function onAppLoadIOError(objEvent:IOErrorEvent):void | ||
253 | + { | ||
254 | + // display error message | ||
255 | + } | ||
256 | + | ||
257 | + /** | ||
258 | + * Event handler of security error. prompt the error message to the user. | ||
259 | + * @param : none | ||
260 | + * @return : void | ||
261 | + */ | ||
262 | + private function onAppLoadSecurityError(objEvent:SecurityErrorEvent):void | ||
263 | + { | ||
264 | + // display error message | ||
265 | + } | ||
266 | + | ||
267 | + /** | ||
268 | + * function to load AppStartup.swf on creationComplete event | ||
269 | + * @param : none | ||
270 | + * @return : void | ||
271 | + */ | ||
272 | + private function onCreationComplete():void | ||
273 | + { | ||
274 | + // systemManager.addEventListener(FlexEvent.IDLE, handleApplicationIdle); | ||
275 | + //NIKITA 25July18 | ||
276 | + //doAction(LOAD_LOGIN_APP); | ||
277 | + var un:String = mx.core.Application.application.parameters.username; | ||
278 | + var up:String = mx.core.Application.application.parameters.password; | ||
279 | + | ||
280 | + //Alert.show(un+", "+up); | ||
281 | + //Encryption of the password for more security | ||
282 | + /*var saltValue:String = 'A1B2C3D4E5F6G7H8I9'; | ||
283 | + var password:String = event.data.password + saltValue; | ||
284 | + var sha1:SHA1 = new SHA1(); | ||
285 | + var src:ByteArray = new ByteArray(); | ||
286 | + src.writeUTFBytes(password); | ||
287 | + var digest:ByteArray = sha1.hash(src); | ||
288 | + var passwordHash:String = Hex.fromArray(digest);*/ | ||
289 | + | ||
290 | + var objData:Object = new Object(); | ||
291 | + objData.loginId = un; | ||
292 | + objData.password = up; | ||
293 | + | ||
294 | + var objEvent:UMEvent = new UMEvent(StartupEventConst.EVENT_LOGIN_CLICK,null,true,false,objData); | ||
295 | + objEvent.dispatch(); | ||
296 | + | ||
297 | + // doAction(LOGIN_SUCCESS); | ||
298 | + //25July18 | ||
299 | + | ||
300 | + //loadApp(UriUtil.getAbsoluteUriFromApplication(APP_STARTUP)); | ||
301 | + } | ||
302 | + private function handleApplicationIdle(event:FlexEvent):void | ||
303 | + { | ||
304 | + //Alert.show("IDLE"); | ||
305 | + if(event.currentTarget.mx_internal::idleCounter == 480){ | ||
306 | + Alert.show("Time out happened"); | ||
307 | + ExternalInterface.call("setUserIdleValue"); | ||
308 | + } | ||
309 | + } | ||
310 | + private function loadLoginView():void | ||
311 | + { | ||
312 | + unloadApp(); | ||
313 | + if(_cmpLoginView != null && _cmpLoginView.visible == false) | ||
314 | + { | ||
315 | + _cmpLoginView.visible = true; | ||
316 | + return; | ||
317 | + } | ||
318 | + | ||
319 | + //Intially load the appstartup_ost.xml for the Static UI data | ||
320 | + OSTManager.getInstance().addEventListener(Event.COMPLETE,onOstComplete); | ||
321 | + var uri:String = CommonUtil.getRelativeContentUri(APPSTARTUP_OST_XML ); | ||
322 | + OSTManager.getInstance().load(uri); | ||
323 | + } | ||
324 | + | ||
325 | + | ||
326 | + | ||
327 | + private function unloadLoginView():void | ||
328 | + { | ||
329 | + if(_cmpLoginView) | ||
330 | + { | ||
331 | + _cmpLoginView.visible = false; | ||
332 | + removeChild(_cmpLoginView); | ||
333 | + | ||
334 | + _cmpLoginView = null; | ||
335 | + | ||
336 | + } | ||
337 | + } | ||
338 | + | ||
339 | + /** | ||
340 | + * Function implementation for IMVCContainer.getInherentMvcContext() | ||
341 | + * returns the its MVC context. | ||
342 | + * | ||
343 | + */ | ||
344 | + public function getInherentMvcContext():IMVCContext | ||
345 | + { | ||
346 | + return MVCContextManager.getInstance().getGlobalContext(); | ||
347 | + } | ||
348 | + /** | ||
349 | + * once the appstartup_ost.xml load do action proceed | ||
350 | + */ | ||
351 | + private function onOstComplete(objEvent:Event):void | ||
352 | + { | ||
353 | + | ||
354 | + OSTManager.getInstance().removeEventListener(Event.COMPLETE,onOstComplete); | ||
355 | + CommonUtil.APP_LOADER_STRING = OSTManager.getInstance().getValue(StartupOSTConst.LOADING); | ||
356 | + setupMVCContextManager(); | ||
357 | + _cmpLoginView = new LoginView(); | ||
358 | + _cmpLoginView.percentHeight = 100; | ||
359 | + _cmpLoginView.percentWidth = 100; | ||
360 | + _cmpLoginView.minWidth = 972; | ||
361 | + _cmpLoginView.minHeight = 648; | ||
362 | + addChild(_cmpLoginView); | ||
363 | + | ||
364 | + | ||
365 | + } | ||
366 | + ]]> | ||
367 | + </mx:Script> | ||
368 | + | ||
369 | + <!-- | ||
370 | + Initialize MVC Framework classes | ||
371 | + --> | ||
372 | + <mx:Style source="css/Global.css"/> | ||
373 | + <mx:Style source="css/Toolbars.css"/> | ||
374 | + <service:AIAServiceLocator id="_objRemoteService" xmlns:service="com.adam.aia.business.*" /> | ||
375 | + | ||
376 | + <controller:StartupFrontController id="_objFrontController" xmlns:contoller="com.adam.aia.appstartup.controller.*" /> | ||
377 | + <viewlocator:LocalViewLocator id="_objViewLocator" xmlns:viewlocator="com.magic.cairngorm.view.*" /> | ||
378 | + <modellocator:StartupModelLocator id="_objModelLocator" xmlns:modellocator="com.adam.aia.appstartup.model.*" /> | ||
379 | + <viewhelper:AppStartupViewHelper id="_objViewHelper" xmlns:viewhelper="com.adam.aia.appstartup.view.helper.*" /> | ||
380 | + | ||
381 | +</mx:Application> |
400-SOURCECODE/AIAHTML5+FlexCB/Default.aspxPassingunamePassForOldCB
0 → 100644
1 | +<%@ Page Language="C#" AutoEventWireup="True" Inherits="_Default" Codebehind="Default.aspx.cs" %> | ||
2 | + | ||
3 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
4 | + | ||
5 | +<html lang="en"> | ||
6 | + | ||
7 | + <head> | ||
8 | + <title>A.D.A.M. Interactive Anatomy</title> | ||
9 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
10 | + <meta http-equiv="X-UA-Compatible" content="IE=11"/> | ||
11 | + | ||
12 | + <script type="text/javascript"> | ||
13 | + //var appVersion = 'v107'; | ||
14 | + //Below code is for opening CB directly from AIAHTML5 as CB is not ready | ||
15 | + //till Aug2018 and new AIAHTML5 is going live. v1018 is having the code which opens CB with user authentication | ||
16 | + var appVersion = 'v1018'; | ||
17 | + | ||
18 | + </script> | ||
19 | + | ||
20 | + <script type="text/javascript" src="v1018/js/lib/jquery-1.8.1.min.js?vers=v1018"></script> | ||
21 | + <script type="text/javascript" src="v1018/js/AC_OETags.js?vers=v1018"></script> | ||
22 | + <script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js?vers=v1018"></script> | ||
23 | + <!--<script type="text/javascript" src="v1018/js/unity3D.js?vers=v1018"></script>--> | ||
24 | + <script type="text/javascript" src="v1018/js/dynamicDiv.js?vers=v1018"></script> | ||
25 | + <script type="text/javascript" src="v1018/js/functions.js?vers=v1018"></script> | ||
26 | + <!--<script type="text/javascript" src="v1018/history/history.js?vers=v1018"></script>--> | ||
27 | + <!--<script type="text/javascript" src="v1018/js/maintenanceProperties.js?vers=v1018></script> | ||
28 | + <script type="text/javascript" src="v1018/js/messagePopUp.js?vers=v1018"></script>--> | ||
29 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script> | ||
30 | + <link rel="stylesheet" type="text/css" href="v1018/history/history.css" /> | ||
31 | + | ||
32 | + <style type="text/css"> | ||
33 | + html { height:100%; overflow:hidden; } | ||
34 | + body { margin: 0px;padding:0px; height:100%; } | ||
35 | + </style> | ||
36 | + | ||
37 | + <script type='text/VBScript'> | ||
38 | + function DetectUnityWebPlayerActiveX | ||
39 | + on error resume next | ||
40 | + dim tControl | ||
41 | + dim res | ||
42 | + res = 0 | ||
43 | + set tControl = CreateObject("UnityWebPlayer.UnityWebPlayer.1") | ||
44 | + if IsObject(tControl) then | ||
45 | + res = 1 | ||
46 | + end if | ||
47 | + DetectUnityWebPlayerActiveX = res | ||
48 | + end function | ||
49 | + </script> | ||
50 | + <script type="text/javascript"> | ||
51 | + if (tempTrace == null) { function tempTrace(message) { try { if (console != null && console.log != null) { console.log(message); } } catch (e) { } } } | ||
52 | + </script> | ||
53 | + <script type="text/javascript"> | ||
54 | + | ||
55 | + function resizeFlashDivHeight() { | ||
56 | + $('#flashDiv').height(window.document.body.offsetHeight); | ||
57 | + }; | ||
58 | + | ||
59 | + window.onresize = function () { setTimeout(resizeFlashDivHeight, 250); }; | ||
60 | + $(document).ready(resizeFlashDivHeight); | ||
61 | + | ||
62 | + function logoutUserNormal() { | ||
63 | + tempTrace("Default.aspx * DEBUG logoutUserNormal()"); | ||
64 | + // $.post('http://' + window.location.host + '/LogoutUser.aspx', {}, ''); | ||
65 | + //return "This request will cause to Logout from the application, You will have to login again to access the application."; | ||
66 | + return "Warning: You are leaving this product without logging out. If you continue, your information will be lost and your account will lock for 5 minutes."; | ||
67 | + } | ||
68 | + function logoutUser(evt) { | ||
69 | + tempTrace("Default.aspx * DEBUG logoutUser()"); | ||
70 | + if (typeof evt == 'undefined') { | ||
71 | + evt = window.event; | ||
72 | + } | ||
73 | + tempTrace("Default.aspx * DEBUG logoutUser() evt = " + evt); | ||
74 | + //if (evt && evt.clientX >= (window.event.screenX - 150) && evt.clientY >= -150 && evt.clientY <= 0) { //NOTE: Chrome did not return any clientX info. | ||
75 | + if (evt && evt.clientY >= -150 && evt.clientY <= 0) { //NOTE: Chrome did not return any clientX info. | ||
76 | + //$.post('http://' + window.location.host + '/LogoutUser.aspx', {}, ''); | ||
77 | + return "Warning: You are leaving this product without logging out. If you continue, your information will be lost and your account will lock for 5 minutes."; | ||
78 | + } | ||
79 | + } | ||
80 | + if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1) { | ||
81 | + window.onbeforeunload = logoutUser;//function () { return logoutUser(); }; | ||
82 | + } else { | ||
83 | + window.onbeforeunload = logoutUserNormal; | ||
84 | + } | ||
85 | + | ||
86 | + // Function to check the page opener and reload the parent if openner is an iframe. | ||
87 | + function checkOpener() { | ||
88 | + // Check if page is loading iside an iFrame. | ||
89 | + if (top != self) { | ||
90 | + parent.location.reload(); | ||
91 | + } | ||
92 | + } | ||
93 | + </script> | ||
94 | + <script language="JavaScript" type="text/javascript"> | ||
95 | + | ||
96 | + // ----------------------------------------------------------------------------- | ||
97 | + // Globals | ||
98 | + // Major version of Flash required | ||
99 | + var requiredMajorVersion = 10; | ||
100 | + // Minor version of Flash required | ||
101 | + var requiredMinorVersion = 0; | ||
102 | + // Minor version of Flash required | ||
103 | + var requiredRevision = 0; | ||
104 | + // ----------------------------------------------------------------------------- | ||
105 | + | ||
106 | + //----------------- Unity Player check ---------------------- | ||
107 | + function DetectUnityWebPlayer() { | ||
108 | + tempTrace("Default.aspx * DEBUG DetectUnityWebPlayer()"); | ||
109 | + var tInstalled = false; | ||
110 | + if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1) { | ||
111 | + tInstalled = DetectUnityWebPlayerActiveX(); | ||
112 | + } | ||
113 | + else { | ||
114 | + if (navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"]) { | ||
115 | + if (navigator.mimeTypes["application/vnd.unity"].enabledPlugin && navigator.plugins && navigator.plugins["Unity Player"]) { | ||
116 | + tInstalled = true; | ||
117 | + } | ||
118 | + } | ||
119 | + } | ||
120 | + return tInstalled; | ||
121 | + } | ||
122 | + | ||
123 | + function GetUnityInstallerPath() { | ||
124 | + tempTrace("Default.aspx * DEBUG GetUnityInstallerPath()"); | ||
125 | + var tDownloadURL = ""; | ||
126 | + var hasXpi = navigator.userAgent.toLowerCase().indexOf("firefox") != -1; | ||
127 | + | ||
128 | + // Use standalone installer | ||
129 | + if (navigator.platform == "MacIntel") | ||
130 | + tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-3.x/webplayer-i386.dmg"; | ||
131 | + else if (navigator.platform == "MacPPC") | ||
132 | + tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-3.x/webplayer-ppc.dmg"; | ||
133 | + else if (navigator.platform.toLowerCase().indexOf("win") != -1) | ||
134 | + tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-3.x/UnityWebPlayer.exe"; | ||
135 | + return tDownloadURL; | ||
136 | + } | ||
137 | + </script> | ||
138 | + | ||
139 | + </head> | ||
140 | +<body> | ||
141 | +<script type="text/javascript"> | ||
142 | + var maintenancePropertiesJs = document.createElement('script'); | ||
143 | + maintenancePropertiesJs.src = appVersion +"/js/maintenanceProperties.js?v="+new Date().getTime(); | ||
144 | + var messagePopUpJs = document.createElement('script'); | ||
145 | + messagePopUpJs.src = appVersion +"/js/messagePopUp.js?v="+new Date().getTime(); | ||
146 | + var head = document.getElementsByTagName('head')[0]; | ||
147 | + head.appendChild(maintenancePropertiesJs); | ||
148 | + setTimeout(function(){ | ||
149 | + head.appendChild(messagePopUpJs); | ||
150 | + },100); | ||
151 | +</script> | ||
152 | +<div id="flashDiv" style="z-index:0"> | ||
153 | + <script type="text/javascript"> | ||
154 | + | ||
155 | + //Below is for opening CB directly from AIAHTML5 as CB is not ready | ||
156 | + //till Aug2018 and new AIAHTML5 is going live. | ||
157 | + | ||
158 | + var UserName = new URL(location.href).searchParams.get('un'); | ||
159 | + var UserPassword = new URL(location.href).searchParams.get('up'); | ||
160 | + | ||
161 | + | ||
162 | + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA"); | ||
163 | + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw"); | ||
164 | + | ||
165 | + | ||
166 | + var decryptedUserName = (CryptoJS.AES.decrypt(UserName, key, { iv: iv })).toString(CryptoJS.enc.Utf8); | ||
167 | + var decryptedPassword = (CryptoJS.AES.decrypt(UserPassword, key, { iv: iv })).toString(CryptoJS.enc.Utf8); | ||
168 | + | ||
169 | + | ||
170 | + | ||
171 | + // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) | ||
172 | + var hasProductInstall = DetectFlashVer(6, 0, 65); | ||
173 | + | ||
174 | + // alert('has Player: ' + hasProductInstall); | ||
175 | + | ||
176 | + // Version check based upon the values defined in globals | ||
177 | + var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); | ||
178 | + | ||
179 | + if (hasProductInstall && !hasRequestedVersion) { | ||
180 | + // DO NOT MODIFY THE FOLLOWING FOUR LINES | ||
181 | + // Location visited after installation is complete if installation is required | ||
182 | + var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; | ||
183 | + var MMredirectURL = window.location; | ||
184 | + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; | ||
185 | + var MMdoctitle = document.title; | ||
186 | + window.location.href = 'http://qa.interactiveanatomy.com/AdobePlayerDownloadLink.html'; | ||
187 | + | ||
188 | + } else if (hasRequestedVersion) { | ||
189 | + tempTrace("Default.aspx * DEBUG hasRequestedVersion write will occur"); | ||
190 | + // if we've detected an acceptable version | ||
191 | + // embed the Flash Content SWF when all tests are passed | ||
192 | + var params = "<%=urlParams%>"; | ||
193 | + AC_FL_RunContent( | ||
194 | + "src", appVersion + "/AppStartup" + params, | ||
195 | + "width", "100%", | ||
196 | + "height", "100%", | ||
197 | + "align", "middle", | ||
198 | + "id", "flashObject", | ||
199 | + "quality", "high", | ||
200 | + "bgcolor", "#000000", | ||
201 | + "name", "flashObject", | ||
202 | + "wmode", "opaque", | ||
203 | + "allowScriptAccess", "sameDomain", | ||
204 | + "type", "application/x-shockwave-flash", | ||
205 | + "pluginspage", "http://www.adobe.com/go/getflashplayer", | ||
206 | + "FlashVars","username="+decryptedUserName+"&password="+decryptedPassword | ||
207 | + | ||
208 | + ); | ||
209 | + } else | ||
210 | + { | ||
211 | + // THE CODE ON 15th MACHINE flash is too old or we can't detect the plugin | ||
212 | + tempTrace("Default.aspx * DEBUG objNewInstall write will occur"); | ||
213 | + window.location.href = 'http://qa.interactiveanatomy.com/AdobePlayerDownloadLink.html'; | ||
214 | + | ||
215 | + | ||
216 | + } | ||
217 | + | ||
218 | + </script> | ||
219 | +<noscript><p>JavaScript is not activated.</p></noscript> | ||
220 | + | ||
221 | +</div> | ||
222 | + <!-- Here Test --> | ||
223 | + <div id="myConsole" runat="server"></div> | ||
224 | +</body> | ||
225 | +</html> | ||
0 | \ No newline at end of file | 226 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5+FlexCB/ShadowedTextToggleButtonBar.as
0 → 100644
1 | +package com.magic.component | ||
2 | +{ | ||
3 | + import flash.events.MouseEvent; | ||
4 | + | ||
5 | + import mx.controls.ToggleButtonBar; | ||
6 | + import mx.core.ClassFactory; | ||
7 | + import mx.core.IFlexDisplayObject; | ||
8 | + import mx.core.IUITextField; | ||
9 | + import mx.styles.CSSStyleDeclaration; | ||
10 | + import flash.events.KeyboardEvent; | ||
11 | + import mx.styles.StyleManager; | ||
12 | + | ||
13 | + public class ShadowedTextToggleButtonBar extends ToggleButtonBar | ||
14 | + { | ||
15 | + private var navItemFactory:ClassFactory; | ||
16 | + | ||
17 | + private var buttonStyleNameProp:String = "buttonStyleName"; | ||
18 | + | ||
19 | + /** | ||
20 | + * @private | ||
21 | + * Name of style used to specify buttonStyleName. | ||
22 | + * Overridden by TabBar. | ||
23 | + */ | ||
24 | + private var firstButtonStyleNameProp:String = "firstButtonStyleName"; | ||
25 | + | ||
26 | + /** | ||
27 | + * @private | ||
28 | + * Name of style used to specify buttonStyleName. | ||
29 | + * Overridden by TabBar. | ||
30 | + */ | ||
31 | + private var lastButtonStyleNameProp:String = "lastButtonStyleName"; | ||
32 | + | ||
33 | + /** | ||
34 | + * @private | ||
35 | + * Name of style used to specify buttonWidth. | ||
36 | + * Overridden by TabBar. | ||
37 | + */ | ||
38 | + private var buttonWidthProp:String = "buttonWidth"; | ||
39 | + | ||
40 | + /** | ||
41 | + * @private | ||
42 | + * Name of style used to specify buttonHeight. | ||
43 | + * Overridden by TabBar. | ||
44 | + */ | ||
45 | + private var buttonHeightProp:String = "buttonHeight"; | ||
46 | + | ||
47 | + private var recalcButtonWidths:Boolean = false; | ||
48 | + | ||
49 | + /** | ||
50 | + * @private | ||
51 | + * Flag indicating whether buttons heights should be recalculated. | ||
52 | + */ | ||
53 | + private var recalcButtonHeights:Boolean = false; | ||
54 | + | ||
55 | + public function ShadowedTextToggleButtonBar() | ||
56 | + { | ||
57 | + //TODO: implement function | ||
58 | + super(); | ||
59 | + navItemFactory = new ClassFactory(ShadowedTextButton); | ||
60 | + } | ||
61 | + // overridden to block keyboard temporarily. | ||
62 | + override protected function keyDownHandler(event:KeyboardEvent):void | ||
63 | + { | ||
64 | + //do nothing | ||
65 | + } | ||
66 | + override protected function createNavItem(strLabel:String, clsIcon:Class=null):IFlexDisplayObject | ||
67 | + { | ||
68 | + var newButton:ShadowedTextButton = ShadowedTextButton(navItemFactory.newInstance()); | ||
69 | + // Set tabEnabled to false so individual buttons don't get focus. | ||
70 | + newButton.focusEnabled = false; | ||
71 | + | ||
72 | + var buttonStyleName:String = getStyle(buttonStyleNameProp); | ||
73 | + var firstButtonStyleName:String = getStyle(firstButtonStyleNameProp); | ||
74 | + var lastButtonStyleName:String = getStyle(lastButtonStyleNameProp); | ||
75 | + | ||
76 | + if (!buttonStyleName) | ||
77 | + buttonStyleName = "ButtonBarButton"; | ||
78 | + if (!firstButtonStyleName) | ||
79 | + firstButtonStyleName = buttonStyleName; | ||
80 | + if (!lastButtonStyleName) | ||
81 | + lastButtonStyleName = buttonStyleName; | ||
82 | + | ||
83 | + var n:int = numChildren; | ||
84 | + if (n == 0) | ||
85 | + { | ||
86 | + newButton.styleName = buttonStyleName; | ||
87 | + } | ||
88 | + else | ||
89 | + { | ||
90 | + if(strLabel!="Curriculum Builder"){ | ||
91 | + newButton.styleName = lastButtonStyleName; | ||
92 | + //var CBuilderButton:ShadowedTextButton = ShadowedTextButton(getChildAt(6)); | ||
93 | + //CBuilderButton.setStyle("color","#000000"); | ||
94 | + } | ||
95 | + else{ | ||
96 | + newButton.setStyle("color","#0000FF"); | ||
97 | + } | ||
98 | + var cssStyleDeclaration:CSSStyleDeclaration = | ||
99 | + StyleManager.getStyleDeclaration("." + lastButtonStyleName); | ||
100 | + | ||
101 | + if (cssStyleDeclaration && | ||
102 | + !cssStyleDeclaration.getStyle("focusRoundedCorners")) | ||
103 | + { | ||
104 | + newButton.setStyle("focusRoundedCorners", "tr br"); | ||
105 | + } | ||
106 | + | ||
107 | + // Refresh the skins for the last button that was in this position. | ||
108 | + var first:Boolean = (n == 1); | ||
109 | + var lastButton:ShadowedTextButton = ShadowedTextButton(getChildAt(first ? 0 : n - 1)); | ||
110 | + | ||
111 | + if (first) | ||
112 | + { | ||
113 | + lastButton.styleName = firstButtonStyleName; | ||
114 | + cssStyleDeclaration = | ||
115 | + StyleManager.getStyleDeclaration("." + firstButtonStyleName); | ||
116 | + | ||
117 | + if (cssStyleDeclaration && | ||
118 | + !cssStyleDeclaration.getStyle("focusRoundedCorners")) | ||
119 | + { | ||
120 | + lastButton.setStyle("focusRoundedCorners", "tl bl"); | ||
121 | + } | ||
122 | + } | ||
123 | + else | ||
124 | + { | ||
125 | + lastButton.styleName = buttonStyleName; | ||
126 | + cssStyleDeclaration = | ||
127 | + StyleManager.getStyleDeclaration("." + buttonStyleName); | ||
128 | + | ||
129 | + if (cssStyleDeclaration && | ||
130 | + !cssStyleDeclaration.getStyle("focusRoundedCorners")) | ||
131 | + { | ||
132 | + lastButton.setStyle("focusRoundedCorners", ""); | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + // lastButton.changeSkins(); | ||
137 | + lastButton.invalidateDisplayList(); | ||
138 | + } | ||
139 | + | ||
140 | + newButton.label = strLabel; | ||
141 | + // newButton.setStyle("icon", icon); | ||
142 | + newButton.minHeight=35; | ||
143 | + //newButton.maxHeight=38; | ||
144 | + newButton.addEventListener(MouseEvent.CLICK, clickHandler); | ||
145 | + | ||
146 | + this.addChild(newButton); | ||
147 | + | ||
148 | + recalcButtonWidths = recalcButtonHeights = true; | ||
149 | + newButton.addTextFilter(); | ||
150 | + return newButton; | ||
151 | + } | ||
152 | + | ||
153 | + } | ||
154 | +} | ||
0 | \ No newline at end of file | 155 | \ No newline at end of file |