Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | 1102x 1102x 1102x 13516x 13516x 1102x 1102x 2660x 2660x 2660x 1633x 1633x 999x 634x 1102x 1102x 6034x 4401x 4401x 9223x 4401x 1633x 2630x 1240x 1270x 1390x 2630x 633x 633x 633x 633x | define( ['underscore', 'oro/mediator'], function(_, mediator) { 'use strict'; var storageEnabled = typeof Storage !== 'undefined' && sessionStorage; var _get = function (alias, key) { Eif (storageEnabled) { return sessionStorage.getItem(alias + '.' + key); } }; var _getParsed = function(alias, key) { var rawValue = _get(alias, key); var parsedValue = {}; if (null == rawValue) { return rawValue; } rawValue.split("&").forEach(function(part) { if (!part) return; var item = part.split("="); var key = decodeURIComponent(item[0]); var from = key.indexOf("["); if (from==-1) { parsedValue[key] = decodeURIComponent(item[1]); } else { var to = key.indexOf("]"); var index = key.substring(from+1,to); key = key.substring(0,from); if (!parsedValue[key]) { parsedValue[key] = []; } if (!index) { parsedValue[key].push(item[1]); } else { parsedValue[key][index] = item[1]; } } }); return parsedValue; }; var _set = function (alias, key, value) { Eif (storageEnabled) { var oldValue = _get(alias, key); if (oldValue !== value) { sessionStorage.setItem(alias + '.' + key, value); if (oldValue === null) { mediator.trigger('grid:' + alias + ':state_set', { 'item': key, 'newValue': value }); } else { mediator.trigger('grid:' + alias + ':state_changed', { 'item': key, 'oldValue': oldValue, 'newValue': value }); } } } }; var _remove = function (alias, key) { if (storageEnabled) { var value = _get(alias, key); if (value !== null) { sessionStorage.removeItem(alias + '.' + key); mediator.trigger('grid:' + alias + ':state_reset', { 'item': key, 'oldValue': value }); } } }; /** * A wrapper for storing datagrid state */ return { get: function(alias, keys) { if (_.isArray(keys)) { var values = {}; _.each(keys, function(key) { values[key] = _get(alias, key); }); return values; } else { return _get.apply(this, arguments); } }, getParsed: function(alias, keys) { if (_.isArray(keys)) { var values = {}; _.each(keys, function(key) { values[key] = _getParsed(alias, key); }); return values; } else { return _getParsed.apply(this, arguments); } }, set: function(alias, data) { if (_.isObject(data)) { _.each(data, function(key, value) { _set(alias, value, key); }); } else { _set.apply(this, arguments); } return this; }, remove: function(alias, keys) { if (_.isArray(keys)) { _.each(keys, function(key) { _remove(alias, key); }); } else { _remove.apply(this, arguments); } return this; }, refreshFiltersFromUrl: function (alias) { var storageHash = this.get(alias, 'filters'); var hash = location.hash; Eif (-1 === hash.indexOf('|g/')) { return; } var urlHash = hash.split('|g/').pop(); if (!storageHash) { this.set(alias, {'filters': urlHash}); return; } var storageFilters = storageHash.split('&'); var urlFilters = urlHash.split('&'); if (!_.isEqual(urlFilters.sort(), storageFilters.sort())) { this.set(alias, {'filters': urlHash}); } } }; } ); |