Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -r0efed7f8c1b9136f2a1f982dbfb425d0fb42e13a -ra1966ca59326d1bd211b524cf08004c1e6d2defe Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -r0efed7f8c1b9136f2a1f982dbfb425d0fb42e13a -ra1966ca59326d1bd211b524cf08004c1e6d2defe Binary files differ Index: lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as =================================================================== diff -u -r6975fa9e790e0853380e212b22fb96160da20d30 -ra1966ca59326d1bd211b524cf08004c1e6d2defe --- lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as (.../Dictionary.as) (revision 6975fa9e790e0853380e212b22fb96160da20d30) +++ lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as (.../Dictionary.as) (revision a1966ca59326d1bd211b524cf08004c1e6d2defe) @@ -85,7 +85,7 @@ this._currentDate = _root.langDate; var _oldDate:Object = null; - + var _removeCache:Boolean = Config.getInstance().removeCache; // Cookie or server? Debugger.log('Config.DOUBLE_CLICK_DELAY:'+Config.DOUBLE_CLICK_DELAY,Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); Debugger.log('Config.USE_CACHE:'+Config.USE_CACHE,Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); @@ -96,22 +96,21 @@ Debugger.log('Existing date:'+String(_oldDateCookie.date) + ' Current date:' + String(_currentDate),Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); // determine if dictionary should be loaded from cookie file or from server request - if(CookieMonster.cookieExists(DICT_PREFIX+language+SO_SEPARATOR+app.module) && Config.USE_CACHE && _oldDateCookie.date != null) { + if(CookieMonster.cookieExists(DICT_PREFIX+language+SO_SEPARATOR+app.module) && Config.USE_CACHE && _oldDateCookie.date != null && !_removeCache) { // clear all data if dictionaries have been updated if(this._currentDate != _oldDateCookie.date){ Debugger.log('Removing all dictionary cookies (updated date).',Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); clearAll(_oldDateCookie); openFromServer(); - } else if(Config.getInstance().removeCache) { - Debugger.log('Removing all dictionary cookies (clear cache)',Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); - clearAll(_oldDateCookie); - openFromServer(); } else { openFromDisk(); } - - }else { + } else if(_removeCache) { + Debugger.log('Removing all dictionary cookies (clear cache)',Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); + clearAll(_oldDateCookie); + openFromServer(); + } else { openFromServer(); } } Index: lams_common/src/flash/org/lamsfoundation/lams/common/style/ThemeManager.as =================================================================== diff -u -r735adeb5d2ea7849b86d4991480630c4613fadec -ra1966ca59326d1bd211b524cf08004c1e6d2defe --- lams_common/src/flash/org/lamsfoundation/lams/common/style/ThemeManager.as (.../ThemeManager.as) (revision 735adeb5d2ea7849b86d4991480630c4613fadec) +++ lams_common/src/flash/org/lamsfoundation/lams/common/style/ThemeManager.as (.../ThemeManager.as) (revision a1966ca59326d1bd211b524cf08004c1e6d2defe) @@ -62,6 +62,8 @@ //Declarations //This ensures that the ThemeManager is created private static var _instance:ThemeManager; + private static var THEME_PREFIX:String = "theme."; + private static var THEME_LOADED:String = THEME_PREFIX + "loaded"; //These are defined so that the compiler can 'see' the events that are added at runtime by EventDispatcher private var dispatchEvent:Function; @@ -94,18 +96,21 @@ //TODO DI 03/05/05 Stub for now but should query server to access themes //Set the selected theme to the default theme initially _currentThemeName = theme; + var _removeCache:Boolean = Config.getInstance().removeCache; //Cookie or server? - if(CookieMonster.cookieExists('theme.'+theme)&&Config.USE_CACHE) { + if(CookieMonster.cookieExists('theme.'+theme)&&Config.USE_CACHE&&!_removeCache) { //Whilst waiting for theme to load from disk - show busy - Cursor.showCursor(ApplicationParent.C_HOURGLASS); openFromDisk(theme); // show default cursor Cursor.showCursor(ApplicationParent.C_DEFAULT); - }else { + } else if(_removeCache) { + clearAll(CookieMonster.open(THEME_LOADED, true)); + openFromServer(theme); + } else { //testing style creator //createThemeFromCode(theme); @@ -527,8 +532,40 @@ //Convert to data object and then serialize before saving to a cookie var dataObj:Object = toData(); CookieMonster.save(dataObj,'theme.' + _currentThemeName,true); + + // open theme cookie if exists + var themeCookie:Object = null; + if(CookieMonster.cookieExists(THEME_LOADED)){ + themeCookie = CookieMonster.open(THEME_LOADED, true); + } + + // create new theme cookie object + var themeObj = new Object(); + themeObj.data = (themeCookie == null) ? new Array() : getThemeArray(themeCookie.data); + + themeObj.data.push(_currentThemeName); + + // save to file + CookieMonster.save(themeObj, THEME_LOADED, true); + } + /** + * Get the string array of loaded themes + * + * + * @param data theme loaded cookie + * @return array of themes + */ + + private function getThemeArray(data:Array):Array { + var arr:Array = new Array(); + for(var i=0; i