Produced by Araxis Merge on 7/6/2017 8:23:21 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jul 7 01:23:21 2017 UTC | ||
| 2 | OSCIF_CTT_v4_build 1.zip\rails_komet\app\assets\javascripts | ajax_cache.js | Wed May 31 03:58:56 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 47 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /* | |||||
| 2 | Copyright Notice | |||||
| 3 | ||||||
| 4 | This is a work of t he U.S. Go vernment a nd is not subject to copyright | |||||
| 5 | protectio n in the U nited Stat es. Foreig n copyrigh ts may app ly. | |||||
| 6 | ||||||
| 7 | Licensed under the Apache Lic ense, Vers ion 2.0 (t he "Licens e"); | |||||
| 8 | you may n ot use thi s file exc ept in com pliance wi th the Lic ense. | |||||
| 9 | You may o btain a co py of the License at | |||||
| 10 | ||||||
| 11 | http://ww w.apache.o rg/license s/LICENSE- 2.0 | |||||
| 12 | ||||||
| 13 | Unless re quired by applicable law or ag reed to in writing, software | |||||
| 14 | distribut ed under t he License is distri buted on a n "AS IS" BASIS, | |||||
| 15 | WITHOUT W ARRANTIES OR CONDITI ONS OF ANY KIND, eit her expres s or impli ed. | |||||
| 16 | See the L icense for the speci fic langua ge governi ng permiss ions and | |||||
| 17 | limitatio ns under t he License . | |||||
| 18 | */ | |||||
| 19 | //might ad d this in later when there is more to op timize | |||||
| 20 | var AjaxCa che = (fun ction () { | |||||
| 21 | var ca che = new Map(); | |||||
| 22 | //cons ole.log("A new cache was born! "); | |||||
| 23 | functi on fetch(p ath, param s, callbac k) { | |||||
| 24 | // console.lo g("path is " + path) ; | |||||
| 25 | // console.lo g("params is " + JSO N.stringif y(params)) ; | |||||
| 26 | va r key = {} ; | |||||
| 27 | ke y.url = pa th; | |||||
| 28 | ke y.paramete rs = param s; | |||||
| 29 | // console.lo g("cache i s +" + JSO N.stringif y(cache[ke y])); | |||||
| 30 | if (cache.get (key) === undefined) { | |||||
| 31 | console. log("NOT R eturning f rom the ca che!!"); | |||||
| 32 | $.get(pa th, params , function (data) { | |||||
| 33 | cach e.set(key, data); | |||||
| 34 | // co nsole.log( "Setting d ata in the cache!"); | |||||
| 35 | call back(data) ; | |||||
| 36 | }); | |||||
| 37 | } | |||||
| 38 | el se { | |||||
| 39 | // consol e.log("Ret urning fro m the cach e!!"); | |||||
| 40 | callback (cache.get (key)); | |||||
| 41 | } | |||||
| 42 | } | |||||
| 43 | ||||||
| 44 | return { | |||||
| 45 | fe tch: fetch | |||||
| 46 | }; | |||||
| 47 | })(); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.