Produced by Araxis Merge on 2/1/2017 2:57:59 PM Eastern Standard 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 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM Portal\trunk\BTSSSPortal\js | jquery.timeago.js | Tue Dec 20 19:50:52 2016 UTC |
| 2 | Wed Feb 1 19:57:59 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 152 |
| 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 | * Timeago is a jQue ry plugin that makes it easy t o support automatica lly | |||||
| 3 | * updatin g fuzzy ti mestamps ( e.g. "4 mi nutes ago" or "about 1 day ago "). | |||||
| 4 | * | |||||
| 5 | * @name t imeago | |||||
| 6 | * @versio n 0.11.4 | |||||
| 7 | * @requir es jQuery v1.2.3+ | |||||
| 8 | * @author Ryan McGe ary | |||||
| 9 | * @licens e MIT Lice nse - http ://www.ope nsource.or g/licenses /mit-licen se.php | |||||
| 10 | * | |||||
| 11 | * For usa ge and exa mples, vis it: | |||||
| 12 | * http:// timeago.ya rp.com/ | |||||
| 13 | * | |||||
| 14 | * Copyrig ht (c) 200 8-2012, Ry an McGeary (ryan -[a t]- mcgear y [*dot*] org) | |||||
| 15 | */ | |||||
| 16 | (function ($) { | |||||
| 17 | $.time ago = func tion (time stamp) { | |||||
| 18 | if (timestam p instance of Date) { | |||||
| 19 | return i nWords(tim estamp); | |||||
| 20 | } else if (t ypeof time stamp === "string") { | |||||
| 21 | return i nWords($.t imeago.par se(timesta mp)); | |||||
| 22 | } else if (t ypeof time stamp === "number") { | |||||
| 23 | return i nWords(new Date(time stamp)); | |||||
| 24 | } else { | |||||
| 25 | return i nWords($.t imeago.dat etime(time stamp)); | |||||
| 26 | } | |||||
| 27 | }; | |||||
| 28 | var $t = $.timea go; | |||||
| 29 | ||||||
| 30 | $.exte nd($.timea go, { | |||||
| 31 | se ttings: { | |||||
| 32 | refreshM illis: 600 00, | |||||
| 33 | allowFut ure: false , | |||||
| 34 | strings: { | |||||
| 35 | pref ixAgo: nul l, | |||||
| 36 | pref ixFromNow: null, | |||||
| 37 | suff ixAgo: "ag o", | |||||
| 38 | suff ixFromNow: "from now ", | |||||
| 39 | seco nds: "less than a mi nute", | |||||
| 40 | minu te: "about a minute" , | |||||
| 41 | minu tes: "%d m inutes", | |||||
| 42 | hour : "about a n hour", | |||||
| 43 | hour s: "about %d hours", | |||||
| 44 | day: "a day", | |||||
| 45 | days : "%d days ", | |||||
| 46 | mont h: "about a month", | |||||
| 47 | mont hs: "%d mo nths", | |||||
| 48 | year : "about a year", | |||||
| 49 | year s: "%d yea rs", | |||||
| 50 | word Separator: " ", | |||||
| 51 | numb ers: [] | |||||
| 52 | } | |||||
| 53 | }, | |||||
| 54 | in Words: fun ction (dis tanceMilli s) { | |||||
| 55 | var $l = this.sett ings.strin gs; | |||||
| 56 | var pref ix = $l.pr efixAgo; | |||||
| 57 | var suff ix = $l.su ffixAgo; | |||||
| 58 | if (this .settings. allowFutur e) { | |||||
| 59 | if ( distanceMi llis < 0) { | |||||
| 60 | prefix = $ l.prefixFr omNow; | |||||
| 61 | suffix = $ l.suffixFr omNow; | |||||
| 62 | } | |||||
| 63 | } | |||||
| 64 | ||||||
| 65 | var seco nds = Math .abs(dista nceMillis) / 1000; | |||||
| 66 | var minu tes = seco nds / 60; | |||||
| 67 | var hour s = minute s / 60; | |||||
| 68 | var days = hours / 24; | |||||
| 69 | var year s = days / 365; | |||||
| 70 | ||||||
| 71 | function substitut e(stringOr Function, number) { | |||||
| 72 | var string = $ .isFunctio n(stringOr Function) ? stringOr Function(n umber, dis tanceMilli s) : strin gOrFunctio n; | |||||
| 73 | var value = ($ l.numbers && $l.numb ers[number ]) || numb er; | |||||
| 74 | retu rn string. replace(/% d/i, value ); | |||||
| 75 | } | |||||
| 76 | ||||||
| 77 | var word s = second s < 45 && substitute ($l.second s, Math.ro und(second s)) || | |||||
| 78 | second s < 90 && substitute ($l.minute , 1) || | |||||
| 79 | minute s < 45 && substitute ($l.minute s, Math.ro und(minute s)) || | |||||
| 80 | minute s < 90 && substitute ($l.hour, 1) || | |||||
| 81 | hours < 24 && su bstitute($ l.hours, M ath.round( hours)) || | |||||
| 82 | hours < 42 && su bstitute($ l.day, 1) || | |||||
| 83 | days < 30 && sub stitute($l .days, Mat h.round(da ys)) || | |||||
| 84 | days < 45 && sub stitute($l .month, 1) || | |||||
| 85 | days < 365 && su bstitute($ l.months, Math.round (days / 30 )) || | |||||
| 86 | years < 1.5 && s ubstitute( $l.year, 1 ) || | |||||
| 87 | substi tute($l.ye ars, Math. round(year s)); | |||||
| 88 | ||||||
| 89 | var sepa rator = $l .wordSepar ator === u ndefined ? " " : $l. wordSepara tor; | |||||
| 90 | return $ .trim([pre fix, words , suffix]. join(separ ator)); | |||||
| 91 | }, | |||||
| 92 | pa rse: funct ion (iso86 01) { | |||||
| 93 | var s = $.trim(iso 8601); | |||||
| 94 | s = s.re place(/\.\ d+/, ""); // remove millisecon ds | |||||
| 95 | s = s.re place(/-/, "/").repl ace(/-/, " /"); | |||||
| 96 | s = s.re place(/T/, " ").repl ace(/Z/, " UTC"); | |||||
| 97 | s = s.re place(/([\ +\-]\d\d)\ :?(\d\d)/, " $1$2"); // -04:00 -> -0400 | |||||
| 98 | return n ew Date(s) ; | |||||
| 99 | }, | |||||
| 100 | da tetime: fu nction (el em) { | |||||
| 101 | var iso8 601 = $t.i sTime(elem ) ? $(elem ).attr("da tetime") : $(elem).a ttr("title "); | |||||
| 102 | return $ t.parse(is o8601); | |||||
| 103 | }, | |||||
| 104 | is Time: func tion (elem ) { | |||||
| 105 | // jQuer y's `is()` doesn't p lay well w ith HTML5 in IE | |||||
| 106 | return $ (elem).get (0).tagNam e.toLowerC ase() === "time"; // $(elem).i s("time"); | |||||
| 107 | } | |||||
| 108 | }); | |||||
| 109 | ||||||
| 110 | $.fn.t imeago = f unction () { | |||||
| 111 | va r self = t his; | |||||
| 112 | se lf.each(re fresh); | |||||
| 113 | ||||||
| 114 | va r $s = $t. settings; | |||||
| 115 | if ($s.refre shMillis > 0) { | |||||
| 116 | setInter val(functi on () { se lf.each(re fresh); }, $s.refres hMillis); | |||||
| 117 | } | |||||
| 118 | re turn self; | |||||
| 119 | }; | |||||
| 120 | ||||||
| 121 | functi on refresh () { | |||||
| 122 | va r data = p repareData (this); | |||||
| 123 | if (!isNaN(d ata.dateti me)) { | |||||
| 124 | $(this). text(inWor ds(data.da tetime)); | |||||
| 125 | } | |||||
| 126 | re turn this; | |||||
| 127 | } | |||||
| 128 | ||||||
| 129 | functi on prepare Data(eleme nt) { | |||||
| 130 | el ement = $( element); | |||||
| 131 | if (!element .data("tim eago")) { | |||||
| 132 | element. data("time ago", { da tetime: $t .datetime( element) } ); | |||||
| 133 | var text = $.trim( element.te xt()); | |||||
| 134 | if (text .length > 0 && !($t. isTime(ele ment) && e lement.att r("title") )) { | |||||
| 135 | elem ent.attr(" title", te xt); | |||||
| 136 | } | |||||
| 137 | } | |||||
| 138 | re turn eleme nt.data("t imeago"); | |||||
| 139 | } | |||||
| 140 | ||||||
| 141 | functi on inWords (date) { | |||||
| 142 | re turn $t.in Words(dist ance(date) ); | |||||
| 143 | } | |||||
| 144 | ||||||
| 145 | functi on distanc e(date) { | |||||
| 146 | re turn (new Date().get Time() - d ate.getTim e()); | |||||
| 147 | } | |||||
| 148 | ||||||
| 149 | // fix for IE6 s uckage | |||||
| 150 | docume nt.createE lement("ab br"); | |||||
| 151 | docume nt.createE lement("ti me"); | |||||
| 152 | }(jQuery)) ; |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.