1var idevStorage = (function () { 2 // private static 3 var sessionStorageAvailable; 4 var testStorageValue = 'test'; 5 var subDir = globalSiteSubDirectory; 6 try { 7 sessionStorage.setItem(testStorageValue, testStorageValue); 8 sessionStorage.removeItem(testStorageValue); 9 sessionStorageAvailable = true; 10 } catch (e) { 11 sessionStorageAvailable = false; 12 } 13 14 // constructor 15 var cls = function () { 16 }; 17 18 // public static 19 cls.get_sessionStorageAvailable = function () { 20 return sessionStorageAvailable; 21 }; 22 23 cls.setStorageValue = function (key, value) { 24 if (sessionStorageAvailable) { 25 sessionStorage.setItem(subDir + key, value); 26 } 27 } 28 29 cls.getStorageValue = function (key, getValueAsyncMethod) { 30 if (sessionStorageAvailable) { 31 if (sessionStorage.getItem(key) == null) { 32 var translateValue = cls.getValueAsyncMethod(subDir + key); 33 if (translateValue !== '') 34 cls.setStorageValue(subDir + key, translateValue); 35 return translateValue; 36 } 37 else 38 return sessionStorage.getItem(subDir + key); 39 } 40 else 41 return getValueAsyncMethod(subDir + key); 42 }; 43 44 cls.getValueAsyncMethod = function getValueAsyncMethod(key) { 45 var keys = new Array(); 46 keys.push(key); 47 var r; 48 $.ajax({
49 async: false, 50 type: "POST", url: globalSiteSubDirectory + '/ajax/cms/language.aspx', data: { 51 "F": "Translate", "Keys": keys.join(",") 52 }, 53 success: function (result) { 54 r = result[0].Value; 55 }, 56 error: function(result) { 57 r = key; 58 }, dataType: 'json' 59 }); 60 return r; 61 } 62 63 return cls; 64})(); 65
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.