Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -r237b65cfc791d8e6ef928be7e29969b3c5272490 -ra75e72e708fca84f14d1d3ff40eb60689a152474 Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -r237b65cfc791d8e6ef928be7e29969b3c5272490 -ra75e72e708fca84f14d1d3ff40eb60689a152474 Binary files differ Index: lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as =================================================================== diff -u -r43b51e2470e423b972243c08c452cf00e1a9e75a -ra75e72e708fca84f14d1d3ff40eb60689a152474 --- lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as (.../Dictionary.as) (revision 43b51e2470e423b972243c08c452cf00e1a9e75a) +++ lams_common/src/flash/org/lamsfoundation/lams/common/dict/Dictionary.as (.../Dictionary.as) (revision a75e72e708fca84f14d1d3ff40eb60689a152474) @@ -43,6 +43,9 @@ //Application instance is stored as a static in the application class private static var _instance:Dictionary = null; + private static var DICT_PREFIX:String = "dictionary."; + private static var DICT_DATE:String = "dictionary.date"; + private static var SO_SEPARATOR:String = "."; //Defined so compiler can 'see' events added at runtime by EventDispatcher private var dispatchEvent:Function; @@ -83,18 +86,21 @@ var _oldDate:Object = null; - //Cookie or server? + // 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'); - if(CookieMonster.cookieExists('dictionary.date')){ - _oldDate = CookieMonster.open('dictionary.date', true); + if(CookieMonster.cookieExists(DICT_DATE)){ + _oldDateCookie = CookieMonster.open(DICT_DATE, true); } Debugger.log('Existing date:'+String(_oldDate) + ' Current date:' + String(_currentDate),Debugger.GEN,'load','org.lamsfoundation.lams.dict.Dictionary'); - if(CookieMonster.cookieExists('dictionary.'+language+'.'+app.module) && Config.USE_CACHE && _oldDate != null) { + // 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(this._currentDate != _oldDate){ + // clear all data if dictionaries have been updated + if(this._currentDate != _oldDateCookie.date){ + clearAll(_oldDateCookie); openFromServer(); } else { openFromDisk(); @@ -112,6 +118,23 @@ dispatchEvent({type:'init',target:this}); } + /** + * Remove all stored dictionary data and old dictionary date cookie + * + * @param obj Array of language/module combination strings + * + */ + public function clearAll(obj:Object) { + for(var i=0; i