diff --git a/Drop.dart.js b/Drop.dart.js index c118a17..fec5d85 100644 --- a/Drop.dart.js +++ b/Drop.dart.js @@ -4,8 +4,8 @@ init(); var $ = Isolate.$isolateProperties; Isolate.$defineClass("DurationImplementation", "Object", ["inMilliseconds?"], { toString$0: function() { - var t0 = new $.Closure9(); - var t1 = new $.Closure10(); + var t0 = new $.Closure14(); + var t1 = new $.Closure15(); if ($.ltB(this.inMilliseconds, 0)) { return '-' + $.stringToString($.DurationImplementation$5(0, 0, 0, 0, $.neg(this.inMilliseconds))); } @@ -60,7 +60,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n var length$ = $.get$length(this._keys); for (var i = 0; $.ltB(i, length$); i = i + 1) { var key = $.index(this._keys, i); - if (!(key === (void 0)) && !(key === $.CTC12)) { + if (!(key === (void 0)) && !(key === $.CTC7)) { f.$call$2(key, $.index(this._values, i)); } } @@ -81,7 +81,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n operator$indexSet$2: function(key, value) { this._ensureCapacity$0(); var index = this._probeForAdding$1(key); - if ($.index(this._keys, index) === (void 0) || $.index(this._keys, index) === $.CTC12) { + if ($.index(this._keys, index) === (void 0) || $.index(this._keys, index) === $.CTC7) { this._numberOfEntries = $.add(this._numberOfEntries, 1); } $.indexSet(this._keys, index, key); @@ -112,7 +112,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n var t1 = oldKeys.length; if (i < 0 || i >= t1) throw $.ioore(i); var t2 = oldKeys[i]; - if (t2 === (void 0) || t2 === $.CTC12) { + if (t2 === (void 0) || t2 === $.CTC7) { continue; } var t3 = oldValues.length; @@ -156,7 +156,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n if (!$.ltB(i, capacity)) break L0; c$0:{ var key = $.index(oldKeys, i); - if (key === (void 0) || key === $.CTC12) { + if (key === (void 0) || key === $.CTC7) { break c$0; } var value = $.index(oldValues, i); @@ -215,7 +215,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n return hash0; } else { insertionIndex0 = insertionIndex; - if ($.ltB(insertionIndex, 0) && $.CTC12 === existingKey) { + if ($.ltB(insertionIndex, 0) && $.CTC7 === existingKey) { insertionIndex0 = hash0; } var numberOfProbes1 = numberOfProbes + 1; @@ -256,7 +256,7 @@ Isolate.$defineClass("HashMapImplementation", "Object", ["_numberOfDeleted", "_n return hash0; } else { insertionIndex0 = insertionIndex; - if ($.ltB(insertionIndex, 0) && $.CTC12 === existingKey) { + if ($.ltB(insertionIndex, 0) && $.CTC7 === existingKey) { insertionIndex0 = hash0; } var numberOfProbes1 = numberOfProbes + 1; @@ -341,7 +341,7 @@ Isolate.$defineClass("HashSetIterator", "Object", ["_nextValidIndex", "_entries" break; } entry = $.index(this._entries, this._nextValidIndex); - } while (entry === (void 0) || entry === $.CTC12); + } while (entry === (void 0) || entry === $.CTC7); }, next$0: function() { if (this.hasNext$0() !== true) { @@ -355,7 +355,7 @@ Isolate.$defineClass("HashSetIterator", "Object", ["_nextValidIndex", "_entries" if ($.geB(this._nextValidIndex, $.get$length(this._entries))) { return false; } - if ($.index(this._entries, this._nextValidIndex) === $.CTC12) { + if ($.index(this._entries, this._nextValidIndex) === $.CTC7) { this._advance$0(); } return $.lt(this._nextValidIndex, $.get$length(this._entries)); @@ -391,7 +391,7 @@ Isolate.$defineClass("LinkedHashMapImplementation", "Object", ["_map", "_lib2_li forEach$1: function(f) { var t0 = ({}); t0.f_1 = f; - $.forEach(this._lib2_list, new $.Closure17(t0)); + $.forEach(this._lib2_list, new $.Closure7(t0)); }, operator$index$1: function(key) { var entry = $.index(this._map, key); @@ -454,13 +454,13 @@ Isolate.$defineClass("DoubleLinkedQueueEntry", "Object", ["_lib2_element?", "_ne Isolate.$defineClass("_DoubleLinkedQueueEntrySentinel", "DoubleLinkedQueueEntry", ["_lib2_element", "_next", "_previous"], { get$element: function() { - throw $.captureStackTrace($.CTC11); + throw $.captureStackTrace($.CTC6); }, _asNonSentinelEntry$0: function() { return; }, remove$0: function() { - throw $.captureStackTrace($.CTC11); + throw $.captureStackTrace($.CTC6); }, _DoubleLinkedQueueEntrySentinel$0: function() { this._link$2(this, this); @@ -509,7 +509,7 @@ Isolate.$defineClass("DoubleLinkedQueue", "Object", ["_sentinel"], { get$length: function() { var t0 = ({}); t0.counter_1 = 0; - this.forEach$1(new $.Closure16(t0)); + this.forEach$1(new $.Closure6(t0)); return t0.counter_1; }, lastEntry$0: function() { @@ -695,9 +695,9 @@ Isolate.$defineClass("DateImplementation", "Object", ["timeZone?", "value?"], { return $.DateImplementation$fromEpoch$2($.add(this.value, duration.get$inMilliseconds()), this.timeZone); }, toString$0: function() { - var t0 = new $.Closure11(); - var t1 = new $.Closure12(); - var t2 = new $.Closure13(); + var t0 = new $.Closure16(); + var t1 = new $.Closure17(); + var t2 = new $.Closure18(); var y = t0.$call$1(this.get$year()); var m = t2.$call$1(this.get$month()); var d = t2.$call$1(this.get$day()); @@ -897,32 +897,43 @@ Isolate.$defineClass("IllegalJSRegExpException", "Object", ["_errmsg", "_pattern } }); -Isolate.$defineClass("Drop", "Object", ["oldPage", "oldSection"], { +Isolate.$defineClass("Drop", "Object", ["oldVersion", "oldPage", "oldSection"], { escape$1: function(html) { return $.replaceAll($.replaceAll($.replaceAll(html, '&', '&'), '<', '<'), '>', '>'); }, showMetaPage$1: function(relativeUri) { var metareq = '/repos/generateui/generateui.github.com/commits?path=' + $.stringToString(relativeUri) + '.html'; - $.XMLHttpRequest$get('' + $.stringToString('https://api.github.com') + $.stringToString(metareq), new $.Closure3(this)); + $.XMLHttpRequest$get('' + $.stringToString('https://api.github.com') + $.stringToString(metareq), new $.Closure11(this)); }, - showError$0: function() { + renderVersionedPage$1: function(e) { + var data = $.parse(e.get$data()); + $.document().query$1('#content').set$innerHTML(data); + }, + get$renderVersionedPage: function() { return new $.Closure30(this); }, + showError$1: function(e) { var error = $.document().query$1('#error'); error.get$style().set$display('block'); var t0 = error.get$innerHTML(); $.document().query$1('#content').set$innerHTML(t0); }, + get$showError: function() { return new $.Closure31(this); }, showPage$2: function(relativeUri, hash) { + var t0 = ({}); + t0.relativeUri_1 = relativeUri; if ($.eqNullB(hash)) { - $.add$1($.XMLHttpRequest$get('' + $.stringToString(relativeUri) + '.html', new $.Closure18()).get$on().get$error(), new $.Closure19(this)); + $.print(t0.relativeUri_1); + $.add$1($.XMLHttpRequest$get('' + $.stringToString(t0.relativeUri_1) + '.html', new $.Closure21()).get$on().get$error(), this.get$showError()); } else { - $.XMLHttpRequest$get('' + $.stringToString('https://raw.github.com/generateui/generateui.github.com') + '/' + $.stringToString(hash) + '/' + $.stringToString(relativeUri) + '.html', new $.Closure20()); + t0.ghuri_2 = 'https://api.github.com'; + var metareq = 'repos/generateui/generateui.github.com/git/trees/' + $.stringToString(hash); + $.XMLHttpRequest$get('' + $.stringToString(t0.ghuri_2) + '/' + $.stringToString(metareq) + '?recursive=1', new $.Closure22(t0)); } }, - uriWithoutHash$1: function(page) { - if (this.uriHasHash$1(page) === true) { - var splitted = $.split(page, 'hash='); + uriWithoutVersion$1: function(page) { + if (this.uriHasVersion$1(page) === true) { + var splitted = $.split(page, $.versionParameter); if ($.endsWith($.index(splitted, 0), '?') === true) { - return $.substring$2($.index(splitted, 0), 0, $.sub($.get$length($.index(splitted, 0)), 2)); + return $.substring$2($.index(splitted, 0), 0, $.sub($.get$length($.index(splitted, 0)), 1)); } else { return $.index(splitted, 0); } @@ -930,55 +941,59 @@ Isolate.$defineClass("Drop", "Object", ["oldPage", "oldSection"], { return page; } }, - hashFromUri$1: function(uri) { - var splitted = $.split(uri, 'hash='); - if ($.eqB($.get$length(splitted), 2)) { - return $.index(splitted, 1); + versionFromUri$1: function(uri) { + if (this.uriHasVersion$1(uri) === true) { + var splitted = $.split(uri, $.versionParameter); + if ($.eqB($.get$length(splitted), 2)) { + return $.substring$2($.index(splitted, 1), 0, 40); + } else { + return; + } } else { return; } }, - uriHasHash$1: function(uri) { - return $.contains$1(uri, 'hash='); + uriHasVersion$1: function(uri) { + return $.contains$1(uri, $.versionParameter); }, - changeHash$1: function(hash) { - if (this.uriHasHash$1($.toString($.window().get$location())) === true) { - var loc = $.toString($.window().get$location()); - var loc0 = '' + $.stringToString($.substring$2(loc, 0, $.add($.lastIndexOf$1(loc, 'hash='), 5))) + $.stringToString(hash); + changeVersion$1: function(version) { + if (this.uriHasVersion$1($.toString($.window().get$location())) === true) { + var newLocation = $.toString($.window().get$location()); + var newLocation0 = '' + $.stringToString($.substring$2(newLocation, 0, $.add($.lastIndexOf$1(newLocation, $.versionParameter), $.get$length($.versionParameter)))) + $.stringToString(version); } else { - loc0 = '' + $.stringToString($.toString($.window().get$location())) + '?hash=' + $.stringToString(hash); + newLocation0 = '' + $.stringToString($.toString($.window().get$location())) + '?' + $.stringToString($.versionParameter) + $.stringToString(version); } - $.window().get$location().assign$1(loc0); + $.window().get$location().assign$1(newLocation0); }, loadFromHash$0: function() { - if ($.eqB($.window().get$location().get$hash(), '')) { - this.showPage$2('welcome', (void 0)); - } else { - var splitted = $.split($.window().get$location().get$hash(), '/'); - var section = $.substring$1($.index(splitted, 0), 1); - if ($.eqB($.get$length(splitted), 2)) { - var page = $.index(splitted, 1); - var hash = this.hashFromUri$1(page); - var uri = '' + $.stringToString(section) + '/' + $.stringToString(page); - this.showPage$2(this.uriWithoutHash$1(uri), hash); - if (!$.eqB(this.oldPage, page) && !$.eqB(this.oldSection, section)) { - this.showMetaPage$1(uri); - } - this.oldPage = page; - } else { - var uri0 = '' + $.stringToString(section); - var hash0 = this.hashFromUri$1(section); - this.showPage$2(this.uriWithoutHash$1(uri0), hash0); - if (!$.eqB(section, this.oldSection)) { - this.showMetaPage$1(uri0); - } + var splitted = $.split($.window().get$location().get$hash(), '/'); + var section = $.substring$1($.index(splitted, 0), 1); + if ($.eqB($.get$length(splitted), 2)) { + var page = $.index(splitted, 1); + var version = this.versionFromUri$1(page); + var uri = '' + $.stringToString(section) + '/' + $.stringToString(page); + this.showPage$2(this.uriWithoutVersion$1(uri), version); + if (!$.eqB(this.oldPage, page) && !$.eqB(this.oldSection, section)) { + this.showMetaPage$1(uri); } + this.oldPage = page; this.oldSection = section; + this.oldVersion = version; + } else { + var version0 = this.versionFromUri$1(section); + var section0 = this.uriWithoutVersion$1(section); + this.showPage$2(section0, version0); + if (!$.eqB(section0, this.oldSection)) { + this.showMetaPage$1(section0); + } + this.oldSection = section0; + this.oldVersion = version0; } }, Drop$0: function() { $.add$1($.window().get$on().get$hashChange(), new $.Closure(this)); - this.loadFromHash$0(); + $.window().get$on().get$message().add$2(this.get$renderVersionedPage(), false); + $.window().get$location().assign$1('' + $.stringToString($.toString($.window().get$location())) + '#welcome'); } }); @@ -995,6 +1010,9 @@ Isolate.$defineClass("_BatteryManagerEventsImpl", "_EventsImpl", ["_ptr"], { }); Isolate.$defineClass("_BodyElementEventsImpl", "_ElementEventsImpl", ["_ptr"], { + get$message: function() { + return this._get$1('message'); + }, get$hashChange: function() { return this._get$1('hashchange'); }, @@ -1010,13 +1028,19 @@ Isolate.$defineClass("_DOMApplicationCacheEventsImpl", "_EventsImpl", ["_ptr"], }); Isolate.$defineClass("_DedicatedWorkerContextEventsImpl", "_WorkerContextEventsImpl", ["_ptr"], { + get$message: function() { + return this._get$1('message'); + } }); Isolate.$defineClass("_DeprecatedPeerConnectionEventsImpl", "_EventsImpl", ["_ptr"], { get$open: function() { return this._get$1('open'); }, - open$3: function(arg0, arg1, arg2) { return this.get$open().$call$3(arg0, arg1, arg2); } + open$3: function(arg0, arg1, arg2) { return this.get$open().$call$3(arg0, arg1, arg2); }, + get$message: function() { + return this._get$1('message'); + } }); Isolate.$defineClass("_DocumentEventsImpl", "_ElementEventsImpl", ["_ptr"], { @@ -1077,7 +1101,7 @@ Isolate.$defineClass("FilteredElementList", "Object", ["_childNodes", "_node"], $.clear(this._childNodes); }, removeRange$2: function(start, rangeLength) { - $.forEach($.getRange(this.get$_filtered(), start, rangeLength), new $.Closure8()); + $.forEach($.getRange(this.get$_filtered(), start, rangeLength), new $.Closure5()); }, addLast$1: function(value) { this.add$1(value); @@ -1088,14 +1112,14 @@ Isolate.$defineClass("FilteredElementList", "Object", ["_childNodes", "_node"], add$1: function(value) { $.add$1(this._childNodes, value); }, - get$add: function() { return new $.Closure31(this); }, + get$add: function() { return new $.Closure33(this); }, set$length: function(newLength) { var len = $.get$length(this); if ($.geB(newLength, len)) { return; } else { if ($.ltB(newLength, 0)) { - throw $.captureStackTrace($.CTC6); + throw $.captureStackTrace($.CTC4); } } this.removeRange$2($.sub(newLength, 1), $.sub(len, newLength)); @@ -1117,7 +1141,7 @@ Isolate.$defineClass("FilteredElementList", "Object", ["_childNodes", "_node"], }, first$0: function() { return this.get$first().$call$0(); }, get$_filtered: function() { - return $.List$from($.filter(this._childNodes, new $.Closure6())); + return $.List$from($.filter(this._childNodes, new $.Closure3())); }, is$List2: function() { return true; }, is$Collection: function() { return true; } @@ -1188,7 +1212,7 @@ Isolate.$defineClass("_ChildrenElementList", "Object", ["_childElements", "_elem var t0 = ({}); t0.f_1 = f; var output = []; - this.forEach$1(new $.Closure7(t0, output)); + this.forEach$1(new $.Closure4(t0, output)); return $._FrozenElementList$_wrap$1(output); }, forEach$1: function(f) { @@ -1326,6 +1350,9 @@ Isolate.$defineClass("_EventSourceEventsImpl", "_EventsImpl", ["_ptr"], { return this._get$1('open'); }, open$3: function(arg0, arg1, arg2) { return this.get$open().$call$3(arg0, arg1, arg2); }, + get$message: function() { + return this._get$1('message'); + }, get$error: function() { return this._get$1('error'); } @@ -1366,6 +1393,9 @@ Isolate.$defineClass("_FileWriterEventsImpl", "_EventsImpl", ["_ptr"], { }); Isolate.$defineClass("_FrameSetElementEventsImpl", "_ElementEventsImpl", ["_ptr"], { + get$message: function() { + return this._get$1('message'); + }, get$hashChange: function() { return this._get$1('hashchange'); }, @@ -1408,6 +1438,9 @@ Isolate.$defineClass("_MediaStreamEventsImpl", "_EventsImpl", ["_ptr"], { }); Isolate.$defineClass("_MessagePortEventsImpl", "_EventsImpl", ["_ptr"], { + get$message: function() { + return this._get$1('message'); + } }); Isolate.$defineClass("_ChildNodeListLazy", "Object", ["_this"], { @@ -1596,6 +1629,9 @@ Isolate.$defineClass("_WebSocketEventsImpl", "_EventsImpl", ["_ptr"], { return this._get$1('open'); }, open$3: function(arg0, arg1, arg2) { return this.get$open().$call$3(arg0, arg1, arg2); }, + get$message: function() { + return this._get$1('message'); + }, get$error: function() { return this._get$1('error'); } @@ -1605,6 +1641,9 @@ Isolate.$defineClass("_WindowEventsImpl", "_EventsImpl", ["_ptr"], { get$mouseOver: function() { return this._get$1('mouseover'); }, + get$message: function() { + return this._get$1('message'); + }, get$hashChange: function() { return this._get$1('hashchange'); }, @@ -1614,6 +1653,9 @@ Isolate.$defineClass("_WindowEventsImpl", "_EventsImpl", ["_ptr"], { }); Isolate.$defineClass("_WorkerEventsImpl", "_AbstractWorkerEventsImpl", ["_ptr"], { + get$message: function() { + return this._get$1('message'); + } }); Isolate.$defineClass("_WorkerContextEventsImpl", "_EventsImpl", ["_ptr"], { @@ -2033,13 +2075,65 @@ Isolate.$defineClass("Closure2", "Closure28", ["box_0"], { } }); -Isolate.$defineClass("Closure3", "Closure28", ["this_2"], { +Isolate.$defineClass("Closure3", "Closure28", [], { + $call$1: function(n) { + return typeof n === 'object' && n.is$Element(); + } +}); + +Isolate.$defineClass("Closure4", "Closure28", ["box_0", "output_2"], { + $call$1: function(element) { + if (this.box_0.f_1.$call$1(element) === true) { + $.add$1(this.output_2, element); + } + } +}); + +Isolate.$defineClass("Closure5", "Closure28", [], { + $call$1: function(el) { + return el.remove$0(); + } +}); + +Isolate.$defineClass("Closure6", "Closure28", ["box_0"], { + $call$1: function(element) { + var counter = $.add(this.box_0.counter_1, 1); + this.box_0.counter_1 = counter; + } +}); + +Isolate.$defineClass("Closure7", "Closure28", ["box_0"], { + $call$1: function(entry) { + this.box_0.f_1.$call$2(entry.get$key(), entry.get$value()); + } +}); + +Isolate.$defineClass("Closure8", "Closure28", ["box_0"], { + $call$0: function() { + return this.box_0.closure_1.$call$0(); + } +}); + +Isolate.$defineClass("Closure9", "Closure28", ["box_0"], { + $call$0: function() { + return this.box_0.closure_1.$call$1(this.box_0.arg1_2); + } +}); + +Isolate.$defineClass("Closure10", "Closure28", ["box_0"], { + $call$0: function() { + return this.box_0.closure_1.$call$2(this.box_0.arg1_2, this.box_0.arg2_3); + } +}); + +Isolate.$defineClass("Closure11", "Closure28", ["this_2"], { $call$1: function(oh) { var data = $.parse(oh.get$responseText()); var sb = $.StringBufferImpl$1(''); + sb.add$1('
    '); for (var t0 = $.iterator(data); t0.hasNext$0() === true; ) { var t1 = t0.next$0(); - sb.add$1('

    ' + $.stringToString(this.this_2.escape$1($.index($.index(t1, 'commit'), 'message'))) + '

    '); + sb.add$1('
  1. ' + $.stringToString(this.this_2.escape$1($.index($.index(t1, 'commit'), 'message'))) + ''); var date = $.DateImplementation$fromString($.substring$2($.index($.index($.index(t1, 'commit'), 'author'), 'date'), 0, 10)); var daysago = $.DateImplementation$now$0().difference$1(date).get$inDays(); if ($.eqB(daysago, 0)) { @@ -2051,31 +2145,31 @@ Isolate.$defineClass("Closure3", "Closure28", ["this_2"], { durationString = '' + $.stringToString(daysago) + ' days ago'; } } - sb.add$1('

    ' + $.stringToString(durationString) + ', '); + sb.add$1('

    ' + $.stringToString(durationString) + ', '); var hashString = $.index(t1, 'sha'); var shortHashString = $.substring$2(hashString, 0, 10); - sb.add$1('' + $.stringToString(shortHashString) + '


    '); + sb.add$1('' + $.stringToString(shortHashString) + '

  2. '); } + sb.add$1('
'); $.document().query$1('#metacontent-changes').set$innerHTML(sb.toString$0()); - for (var t2 = $.iterator($.document().query$1('#metacontent-changes').queryAll$1('.hash')); t2.hasNext$0() === true; ) { + for (var t2 = $.iterator($.document().query$1('#metacontent-changes').queryAll$1('li.meta')); t2.hasNext$0() === true; ) { var t3 = ({}); t3.se_1 = t2.next$0(); - $.add$1(t3.se_1.get$on().get$mouseOver(), new $.Closure5(this.this_2, t3)); + $.add$1(t3.se_1.get$on().get$mouseOver(), new $.Closure13(this.this_2, t3)); } - var sb2 = $.StringBufferImpl$1(''); - sb.add$1('Last edited ' + $.stringToString($.index($.index($.index(data, 0), 'committer'), 'date')) + ''); - var t4 = sb2.toString$0(); + var t4 = $.StringBufferImpl$1('').toString$0(); $.document().query$1('#metacontent-summary').set$innerHTML(t4); } }); -Isolate.$defineClass("Closure5", "Closure28", ["this_3", "box_0"], { +Isolate.$defineClass("Closure13", "Closure28", ["this_3", "box_0"], { $call$1: function(e) { - this.this_3.changeHash$1(this.box_0.se_1.get$id()); + var id = this.box_0.se_1.query$1('.hash').get$id(); + this.this_3.changeVersion$1(id); } }); -Isolate.$defineClass("Closure4", "Closure28", ["box_0", "request_2"], { +Isolate.$defineClass("Closure12", "Closure28", ["box_0", "request_2"], { $call$1: function(e) { if ($.eqB(this.request_2.get$readyState(), 4) && ($.eqB(this.request_2.get$status(), 200) || $.eqB(this.request_2.get$status(), 0))) { this.box_0.onSuccess_1.$call$1(this.request_2); @@ -2083,27 +2177,7 @@ Isolate.$defineClass("Closure4", "Closure28", ["box_0", "request_2"], { } }); -Isolate.$defineClass("Closure6", "Closure28", [], { - $call$1: function(n) { - return typeof n === 'object' && n.is$Element(); - } -}); - -Isolate.$defineClass("Closure7", "Closure28", ["box_0", "output_2"], { - $call$1: function(element) { - if (this.box_0.f_1.$call$1(element) === true) { - $.add$1(this.output_2, element); - } - } -}); - -Isolate.$defineClass("Closure8", "Closure28", [], { - $call$1: function(el) { - return el.remove$0(); - } -}); - -Isolate.$defineClass("Closure9", "Closure28", [], { +Isolate.$defineClass("Closure14", "Closure28", [], { $call$1: function(n) { if ($.geB(n, 100)) { return '' + $.stringToString(n); @@ -2115,7 +2189,7 @@ Isolate.$defineClass("Closure9", "Closure28", [], { } }); -Isolate.$defineClass("Closure10", "Closure28", [], { +Isolate.$defineClass("Closure15", "Closure28", [], { $call$1: function(n) { if ($.geB(n, 10)) { return '' + $.stringToString(n); @@ -2124,7 +2198,7 @@ Isolate.$defineClass("Closure10", "Closure28", [], { } }); -Isolate.$defineClass("Closure11", "Closure28", [], { +Isolate.$defineClass("Closure16", "Closure28", [], { $call$1: function(n) { var absN = $.abs(n); if ($.ltB(n, 0)) { @@ -2148,7 +2222,7 @@ Isolate.$defineClass("Closure11", "Closure28", [], { } }); -Isolate.$defineClass("Closure12", "Closure28", [], { +Isolate.$defineClass("Closure17", "Closure28", [], { $call$1: function(n) { if ($.geB(n, 100)) { return '' + $.stringToString(n); @@ -2160,7 +2234,7 @@ Isolate.$defineClass("Closure12", "Closure28", [], { } }); -Isolate.$defineClass("Closure13", "Closure28", [], { +Isolate.$defineClass("Closure18", "Closure28", [], { $call$1: function(n) { if ($.geB(n, 10)) { return '' + $.stringToString(n); @@ -2169,7 +2243,7 @@ Isolate.$defineClass("Closure13", "Closure28", [], { } }); -Isolate.$defineClass("Closure14", "Closure28", [], { +Isolate.$defineClass("Closure19", "Closure28", [], { $call$1: function(matched) { if (matched === (void 0) || $.eqB(matched, '')) { return 0; @@ -2178,7 +2252,7 @@ Isolate.$defineClass("Closure14", "Closure28", [], { } }); -Isolate.$defineClass("Closure15", "Closure28", [], { +Isolate.$defineClass("Closure20", "Closure28", [], { $call$1: function(matched) { if (matched === (void 0) || $.eqB(matched, '')) { return 0.0; @@ -2187,56 +2261,31 @@ Isolate.$defineClass("Closure15", "Closure28", [], { } }); -Isolate.$defineClass("Closure16", "Closure28", ["box_0"], { - $call$1: function(element) { - var counter = $.add(this.box_0.counter_1, 1); - this.box_0.counter_1 = counter; - } -}); - -Isolate.$defineClass("Closure17", "Closure28", ["box_0"], { - $call$1: function(entry) { - this.box_0.f_1.$call$2(entry.get$key(), entry.get$value()); - } -}); - -Isolate.$defineClass("Closure18", "Closure28", [], { +Isolate.$defineClass("Closure21", "Closure28", [], { $call$1: function(oh) { - $.print(oh.get$status()); var t0 = oh.get$responseText(); $.document().query$1('#content').set$innerHTML(t0); } }); -Isolate.$defineClass("Closure19", "Closure28", ["this_0"], { - $call$1: function(er) { - return this.this_0.showError$0(); - } -}); - -Isolate.$defineClass("Closure20", "Closure28", [], { - $call$1: function(oh) { - $.print(oh.get$status()); - var t0 = oh.get$responseText(); - $.document().query$1('#content').set$innerHTML(t0); - } -}); - -Isolate.$defineClass("Closure21", "Closure28", ["box_0"], { - $call$0: function() { - return this.box_0.closure_1.$call$0(); - } -}); - Isolate.$defineClass("Closure22", "Closure28", ["box_0"], { - $call$0: function() { - return this.box_0.closure_1.$call$1(this.box_0.arg1_2); + $call$1: function(oh) { + for (var t0 = $.iterator($.index($.parse(oh.get$responseText()), 'tree')), sha = (void 0); t0.hasNext$0() === true; sha = sha0) { + var sha0 = sha; + var t1 = t0.next$0(); + sha0 = sha; + if ($.eqB($.index(t1, 'path'), '' + $.stringToString(this.box_0.relativeUri_1) + '.html')) { + sha0 = $.index(t1, 'sha'); + } + } + $.XMLHttpRequest$get('' + $.stringToString(this.box_0.ghuri_2) + '/' + $.stringToString('repos/generateui/generateui.github.com/git/blobs/') + $.stringToString(sha), new $.Closure23()); } }); -Isolate.$defineClass("Closure23", "Closure28", ["box_0"], { - $call$0: function() { - return this.box_0.closure_1.$call$2(this.box_0.arg1_2, this.box_0.arg2_3); +Isolate.$defineClass("Closure23", "Closure28", [], { + $call$1: function(oh2) { + var x = $.decode($.index($.parse(oh2.get$responseText()), 'content')); + $.document().query$1('#content').set$innerHTML(x); } }); @@ -2273,9 +2322,15 @@ Isolate.$defineClass('Closure29', 'Closure28', function BoundClosure(self) { thi $call$0: function() { return this.self.isUtc$0(); } }); Isolate.$defineClass('Closure30', 'Closure28', function BoundClosure(self) { this.self = self; }, { - $call$1: function(arg0) { return this.self.error$1(arg0); } + $call$1: function(arg0) { return this.self.renderVersionedPage$1(arg0); } }); Isolate.$defineClass('Closure31', 'Closure28', function BoundClosure(self) { this.self = self; }, { + $call$1: function(arg0) { return this.self.showError$1(arg0); } +}); +Isolate.$defineClass('Closure32', 'Closure28', function BoundClosure(self) { this.self = self; }, { + $call$1: function(arg0) { return this.self.error$1(arg0); } +}); +Isolate.$defineClass('Closure33', 'Closure28', function BoundClosure(self) { this.self = self; }, { $call$1: function(arg0) { return this.self.add$1(arg0); } }); $.XMLHttpRequest$get = function(url, onSuccess) { @@ -2381,6 +2436,12 @@ $.typeNameInIE = function(obj) { return name$; }; +$.DoubleLinkedQueueEntry$1 = function(e) { + var t0 = new $.DoubleLinkedQueueEntry((void 0), (void 0), (void 0)); + t0.DoubleLinkedQueueEntry$1(e); + return t0; +}; + $.regExpMatchStart = function(m) { return m.index; }; @@ -2408,13 +2469,6 @@ $.clear = function(receiver) { $.set$length(receiver, 0); }; -$.tdiv = function(a, b) { - if ($.checkNumbers(a, b) === true) { - return $.truncate((a) / (b)); - } - return a.operator$tdiv$1(b); -}; - $.JSSyntaxRegExp$_globalVersionOf$1 = function(other) { var t0 = other.get$pattern(); var t1 = other.get$multiLine(); @@ -2423,6 +2477,13 @@ $.JSSyntaxRegExp$_globalVersionOf$1 = function(other) { return t2; }; +$.tdiv = function(a, b) { + if ($.checkNumbers(a, b) === true) { + return $.truncate((a) / (b)); + } + return a.operator$tdiv$1(b); +}; + $.printString = function(string) { if (typeof console == "object") { console.log(string); @@ -2490,7 +2551,7 @@ $.stringReplaceAllUnchecked = function(receiver, from, to) { return result.toString$0(); } } else { - return $.stringReplaceJS(receiver, $.regExpMakeNative($.JSSyntaxRegExp$3((from.replace($.regExpMakeNative($.CTC10, true), "\\$&")), false, false), true), to); + return $.stringReplaceJS(receiver, $.regExpMakeNative($.JSSyntaxRegExp$3((from.replace($.regExpMakeNative($.CTC12, true), "\\$&")), false, false), true), to); } } else { if (typeof from === 'object' && !!from.is$JSSyntaxRegExp) { @@ -2577,13 +2638,13 @@ $.invokeClosure = function(closure, isolate, numberOfArguments, arg1, arg2) { t0.arg1_2 = arg1; t0.closure_1 = closure; if ($.eqB(numberOfArguments, 0)) { - return new $.Closure21(t0).$call$0(); + return new $.Closure8(t0).$call$0(); } else { if ($.eqB(numberOfArguments, 1)) { - return new $.Closure22(t0).$call$0(); + return new $.Closure9(t0).$call$0(); } else { if ($.eqB(numberOfArguments, 2)) { - return new $.Closure23(t0).$call$0(); + return new $.Closure10(t0).$call$0(); } else { throw $.captureStackTrace($.ExceptionImplementation$1('Unsupported number of arguments for wrapped closure')); } @@ -2602,13 +2663,6 @@ $.String$fromCharCodes = function(charCodes) { return $.createFromCharCodes(charCodes); }; -$.last = function(receiver) { - if ($.isJsArray(receiver) !== true) { - return receiver.last$0(); - } - return $.index(receiver, $.sub($.get$length(receiver), 1)); -}; - $.assert = function(condition) { }; @@ -2636,24 +2690,6 @@ $.buildDynamicMetadata = function(inputTable) { return result; }; -$.filter = function(receiver, predicate) { - if ($.isJsArray(receiver) !== true) { - return receiver.filter$1(predicate); - } else { - return $.filter2(receiver, [], predicate); - } -}; - -$.filter2 = function(source, destination, f) { - for (var t0 = $.iterator(source); t0.hasNext$0() === true; ) { - var t1 = t0.next$0(); - if (f.$call$1(t1) === true) { - $.add$1(destination, t1); - } - } - return destination; -}; - $.contains$1 = function(receiver, other) { if (!(typeof receiver === 'string')) { return receiver.contains$1(other); @@ -2676,16 +2712,6 @@ $.parseInt = function(str) { return $.parseInt2(str); }; -$.filter3 = function(source, destination, f) { - for (var t0 = $.iterator(source); t0.hasNext$0() === true; ) { - var t1 = t0.next$0(); - if (f.$call$1(t1) === true) { - $.add$1(destination, t1); - } - } - return destination; -}; - $._NotificationEventsImpl$1 = function(_ptr) { return new $._NotificationEventsImpl(_ptr); }; @@ -2718,6 +2744,13 @@ $._browserPrefix = function() { return $._cachedBrowserPrefix; }; +$.last = function(receiver) { + if ($.isJsArray(receiver) !== true) { + return receiver.last$0(); + } + return $.index(receiver, $.sub($.get$length(receiver), 1)); +}; + $.neg = function(a) { if (typeof a === "number") { return -a; @@ -2774,6 +2807,13 @@ $._WorkerContextEventsImpl$1 = function(_ptr) { return new $._WorkerContextEventsImpl(_ptr); }; +$.or = function(a, b) { + if ($.checkNumbers(a, b) === true) { + return (a | b) >>> 0; + } + return a.operator$or$1(b); +}; + $._DocumentEventsImpl$1 = function(_ptr) { return new $._DocumentEventsImpl(_ptr); }; @@ -2783,7 +2823,7 @@ $.regExpTest = function(regExp, str) { }; $.Drop$0 = function() { - var t0 = new $.Drop((void 0), (void 0)); + var t0 = new $.Drop((void 0), (void 0), (void 0)); t0.Drop$0(); return t0; }; @@ -2797,6 +2837,14 @@ $.getDay = function(receiver) { return t0; }; +$.filter = function(receiver, predicate) { + if ($.isJsArray(receiver) !== true) { + return receiver.filter$1(predicate); + } else { + return $.filter2(receiver, [], predicate); + } +}; + $._EventsImpl$1 = function(_ptr) { return new $._EventsImpl(_ptr); }; @@ -2815,6 +2863,16 @@ $._IDBRequestEventsImpl$1 = function(_ptr) { return new $._IDBRequestEventsImpl(_ptr); }; +$.filter2 = function(source, destination, f) { + for (var t0 = $.iterator(source); t0.hasNext$0() === true; ) { + var t1 = t0.next$0(); + if (f.$call$1(t1) === true) { + $.add$1(destination, t1); + } + } + return destination; +}; + $.stringSplitUnchecked = function(receiver, pattern) { if (typeof pattern === 'string') { return receiver.split(pattern); @@ -2827,12 +2885,6 @@ $.stringSplitUnchecked = function(receiver, pattern) { } }; -$.DoubleLinkedQueueEntry$1 = function(e) { - var t0 = new $.DoubleLinkedQueueEntry((void 0), (void 0), (void 0)); - t0.DoubleLinkedQueueEntry$1(e); - return t0; -}; - $.checkGrowable = function(list, reason) { if (!!(list.fixed$length)) { throw $.captureStackTrace($.UnsupportedOperationException$1(reason)); @@ -2853,11 +2905,14 @@ $._SVGElementInstanceEventsImpl$1 = function(_ptr) { return new $._SVGElementInstanceEventsImpl(_ptr); }; -$.isEmpty = function(receiver) { - if (typeof receiver === 'string' || $.isJsArray(receiver) === true) { - return receiver.length === 0; +$.filter3 = function(source, destination, f) { + for (var t0 = $.iterator(source); t0.hasNext$0() === true; ) { + var t1 = t0.next$0(); + if (f.$call$1(t1) === true) { + $.add$1(destination, t1); + } } - return receiver.isEmpty$0(); + return destination; }; $.add$1 = function(receiver, value) { @@ -2877,20 +2932,13 @@ $.regExpExec = function(regExp, str) { return result; }; -$.iterator = function(receiver) { - if ($.isJsArray(receiver) === true) { - return $.ListIterator$1(receiver); - } - return receiver.iterator$0(); -}; - $.get = function(url, onSuccess) { var t0 = ({}); t0.onSuccess_1 = onSuccess; var request = $.XMLHttpRequest(); request.open$3('GET', url, true); request.set$withCredentials(true); - $.add$1(request.get$on().get$readyStateChange(), new $.Closure4(t0, request)); + $.add$1(request.get$on().get$readyStateChange(), new $.Closure12(t0, request)); request.send$0(); return request; }; @@ -2917,6 +2965,13 @@ $.getMonth = function(receiver) { return t0; }; +$.iterator = function(receiver) { + if ($.isJsArray(receiver) === true) { + return $.ListIterator$1(receiver); + } + return receiver.iterator$0(); +}; + $.stringContainsUnchecked = function(receiver, other, startIndex) { if (typeof other === 'string') { return !($.indexOf$2(receiver, other, startIndex) === -1); @@ -2937,6 +2992,22 @@ $.window = function() { return window;; }; +$.add = function(a, b) { + if ($.checkNumbers(a, b) === true) { + return a + b; + } else { + if (typeof a === 'string') { + var b0 = $.toString(b); + if (typeof b0 === 'string') { + return a + b0; + } + $.checkNull(b0); + throw $.captureStackTrace($.IllegalArgumentException$1(b0)); + } + } + return a.operator$add$1(b); +}; + $.abs = function(receiver) { if (!(typeof receiver === 'number')) { return receiver.abs$0(); @@ -2990,6 +3061,13 @@ $.mapToString = function(m) { return result.toString$0(); }; +$.isEmpty = function(receiver) { + if (typeof receiver === 'string' || $.isJsArray(receiver) === true) { + return receiver.length === 0; + } + return receiver.isEmpty$0(); +}; + $.lazyAsJsDate = function(receiver) { if (receiver.date === (void 0)) { receiver.date = new Date(receiver.get$value()); @@ -2997,14 +3075,34 @@ $.lazyAsJsDate = function(receiver) { return receiver.date; }; -$._JavaScriptAudioNodeEventsImpl$1 = function(_ptr) { - return new $._JavaScriptAudioNodeEventsImpl(_ptr); +$.lastIndexOf2 = function(a, element, startIndex) { + if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.lastIndexOf2$bailout(a, element, startIndex, 0); + if ($.ltB(startIndex, 0)) { + return -1; + } + var i = startIndex; + if ($.geB(startIndex, a.length)) { + i = a.length - 1; + } + for (; $.geB(i, 0); i = $.sub(i, 1)) { + if (i !== (i | 0)) throw $.iae(i); + var t0 = a.length; + if (i < 0 || i >= t0) throw $.ioore(i); + if ($.eqB(a[i], element)) { + return i; + } + } + return -1; }; $._XMLHttpRequestEventsImpl$1 = function(_ptr) { return new $._XMLHttpRequestEventsImpl(_ptr); }; +$._JavaScriptAudioNodeEventsImpl$1 = function(_ptr) { + return new $._JavaScriptAudioNodeEventsImpl(_ptr); +}; + $._emitObject = function(o, result, visiting) { if (typeof o === 'object' && (o.constructor === Array || o.is$Collection())) { if ($._containsRef(visiting, o) === true) { @@ -3062,6 +3160,79 @@ $.ge = function(a, b) { return a.operator$ge$1(b); }; +$.decode = function(data) { + var result = $.List((void 0)); + $.setRuntimeTypeInfo(result, ({E: 'int'})); + for (var i = 0, charCount = 0, padCount = 0, value = 0; $.ltB(i, $.get$length(data)); i = i + 1, charCount = charCount0, padCount = padCount0, value = value0) { + var padCount0 = padCount; + var value0 = value; + var charCount0 = charCount; + var char$ = $.charCodeAt(data, i); + if ($.leB(65, char$) && $.leB(char$, 90)) { + var value1 = $.or($.shl(value, 6), $.sub(char$, 65)); + var charCount1 = charCount + 1; + var padCount1 = padCount; + var value2 = value1; + var charCount2 = charCount1; + } else { + if ($.leB(97, char$) && $.leB(char$, 122)) { + var value3 = $.or($.shl(value, 6), $.add($.sub(char$, 97), 26)); + padCount1 = padCount; + value2 = value3; + charCount2 = charCount + 1; + } else { + if ($.leB(48, char$) && $.leB(char$, 57)) { + var value4 = $.or($.shl(value, 6), $.add($.sub(char$, 48), 52)); + padCount1 = padCount; + value2 = value4; + charCount2 = charCount + 1; + } else { + if ($.eqB(char$, 43)) { + var value5 = ($.shl(value, 6) | 62) >>> 0; + padCount1 = padCount; + value2 = value5; + charCount2 = charCount + 1; + } else { + if ($.eqB(char$, 47)) { + var value6 = ($.shl(value, 6) | 63) >>> 0; + var charCount3 = charCount + 1; + padCount1 = padCount; + value2 = value6; + charCount2 = charCount3; + } else { + padCount1 = padCount; + value2 = value; + charCount2 = charCount; + if ($.eqB(char$, 61)) { + var value7 = $.shl(value, 6); + var charCount4 = charCount + 1; + padCount1 = padCount + 1; + value2 = value7; + charCount2 = charCount4; + } + } + } + } + } + } + value0 = value2; + charCount0 = charCount2; + if (charCount2 === 4) { + result.push($.shr((value2 & 16711680) >>> 0, 16)); + if (padCount1 < 2) { + result.push($.shr((value2 & 65280) >>> 0, 8)); + } + if (padCount1 === 0) { + result.push((value2 & 255) >>> 0); + } + value0 = 0; + charCount0 = 0; + } + padCount0 = padCount1; + } + return $.String$fromCharCodes(result); +}; + $._TextTrackCueEventsImpl$1 = function(_ptr) { return new $._TextTrackCueEventsImpl(_ptr); }; @@ -3108,22 +3279,6 @@ $.patchUpY2K = function(value, years, isUtc) { return date.valueOf(); }; -$.add = function(a, b) { - if ($.checkNumbers(a, b) === true) { - return a + b; - } else { - if (typeof a === 'string') { - var b0 = $.toString(b); - if (typeof b0 === 'string') { - return a + b0; - } - $.checkNull(b0); - throw $.captureStackTrace($.IllegalArgumentException$1(b0)); - } - } - return a.operator$add$1(b); -}; - $.MatchImplementation$5 = function(pattern, str, _start, _end, _groups) { return new $.MatchImplementation(_groups, _end, _start, str, pattern); }; @@ -3157,35 +3312,15 @@ $.indexOf$2 = function(receiver, element, start) { return receiver.indexOf(element, start); } } - return receiver.indexOf$2(element, start); -}; - -$._DedicatedWorkerContextEventsImpl$1 = function(_ptr) { - return new $._DedicatedWorkerContextEventsImpl(_ptr); -}; - -$._FileReaderEventsImpl$1 = function(_ptr) { - return new $._FileReaderEventsImpl(_ptr); -}; - -$.lastIndexOf = function(a, element, startIndex) { - if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.lastIndexOf$bailout(a, element, startIndex, 0); - if ($.ltB(startIndex, 0)) { - return -1; - } - var i = startIndex; - if ($.geB(startIndex, a.length)) { - i = a.length - 1; - } - for (; $.geB(i, 0); i = $.sub(i, 1)) { - if (i !== (i | 0)) throw $.iae(i); - var t0 = a.length; - if (i < 0 || i >= t0) throw $.ioore(i); - if ($.eqB(a[i], element)) { - return i; - } - } - return -1; + return receiver.indexOf$2(element, start); +}; + +$._DedicatedWorkerContextEventsImpl$1 = function(_ptr) { + return new $._DedicatedWorkerContextEventsImpl(_ptr); +}; + +$._FileReaderEventsImpl$1 = function(_ptr) { + return new $._FileReaderEventsImpl(_ptr); }; $.replaceAll = function(receiver, from, to) { @@ -3221,6 +3356,20 @@ $.Element$tag = function(tag) { return document.createElement(tag); }; +$._FrameSetElementEventsImpl$1 = function(_ptr) { + return new $._FrameSetElementEventsImpl(_ptr); +}; + +$.List$from = function(other) { + var result = $.List((void 0)); + $.setRuntimeTypeInfo(result, ({E: 'E'})); + var iterator = $.iterator(other); + for (; iterator.hasNext$0() === true; ) { + result.push(iterator.next$0()); + } + return result; +}; + $.valueFromDecomposedDate = function(years, month, day, hours, minutes, seconds, milliseconds, isUtc) { $.checkInt(years); $.checkInt(month); @@ -3263,40 +3412,6 @@ $.valueFromDecomposedDate = function(years, month, day, hours, minutes, seconds, return value; }; -$.lastIndexOf2 = function(a, element, startIndex) { - if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.lastIndexOf2$bailout(a, element, startIndex, 0); - if ($.ltB(startIndex, 0)) { - return -1; - } - var i = startIndex; - if ($.geB(startIndex, a.length)) { - i = a.length - 1; - } - for (; $.geB(i, 0); i = $.sub(i, 1)) { - if (i !== (i | 0)) throw $.iae(i); - var t0 = a.length; - if (i < 0 || i >= t0) throw $.ioore(i); - if ($.eqB(a[i], element)) { - return i; - } - } - return -1; -}; - -$.List$from = function(other) { - var result = $.List((void 0)); - $.setRuntimeTypeInfo(result, ({E: 'E'})); - var iterator = $.iterator(other); - for (; iterator.hasNext$0() === true; ) { - result.push(iterator.next$0()); - } - return result; -}; - -$._FrameSetElementEventsImpl$1 = function(_ptr) { - return new $._FrameSetElementEventsImpl(_ptr); -}; - $.newList = function(length$) { if (length$ === (void 0)) { return new Array(); @@ -3318,14 +3433,14 @@ $.main = function() { $.Drop$0(); }; -$.dateNow = function() { - return Date.now(); -}; - $._AbstractWorkerEventsImpl$1 = function(_ptr) { return new $._AbstractWorkerEventsImpl(_ptr); }; +$.dateNow = function() { + return Date.now(); +}; + $._computeLoadLimit = function(capacity) { return $.tdiv($.mul(capacity, 3), 4); }; @@ -3348,14 +3463,14 @@ $._IDBTransactionEventsImpl$1 = function(_ptr) { return new $._IDBTransactionEventsImpl(_ptr); }; -$._AllMatchesIterator$2 = function(re, _str) { - return new $._AllMatchesIterator(false, (void 0), _str, $.JSSyntaxRegExp$_globalVersionOf$1(re)); -}; - $._BodyElementEventsImpl$1 = function(_ptr) { return new $._BodyElementEventsImpl(_ptr); }; +$._AllMatchesIterator$2 = function(re, _str) { + return new $._AllMatchesIterator(false, (void 0), _str, $.JSSyntaxRegExp$_globalVersionOf$1(re)); +}; + $.iae = function(argument) { throw $.captureStackTrace($.IllegalArgumentException$1(argument)); }; @@ -3380,11 +3495,12 @@ $.isNaN = function(receiver) { } }; -$.isInfinite = function(receiver) { - if (!(typeof receiver === 'number')) { - return receiver.isInfinite$0(); +$.addLast = function(receiver, value) { + if ($.isJsArray(receiver) !== true) { + return receiver.addLast$1(value); } - return (receiver == Infinity) || (receiver == -Infinity); + $.checkGrowable(receiver, 'addLast'); + receiver.push(value); }; $.round = function(receiver) { @@ -3425,6 +3541,13 @@ $.allMatchesInStringUnchecked = function(needle, haystack) { return result; }; +$.isInfinite = function(receiver) { + if (!(typeof receiver === 'number')) { + return receiver.isInfinite$0(); + } + return (receiver == Infinity) || (receiver == -Infinity); +}; + $._ChildrenElementList$_wrap$1 = function(element) { return new $._ChildrenElementList(element.get$$$dom_children(), element); }; @@ -3433,14 +3556,6 @@ $._AllMatchesIterable$2 = function(_re, _str) { return new $._AllMatchesIterable(_str, _re); }; -$.addLast = function(receiver, value) { - if ($.isJsArray(receiver) !== true) { - return receiver.addLast$1(value); - } - $.checkGrowable(receiver, 'addLast'); - receiver.push(value); -}; - $.dynamicSetMetadata = function(inputTable) { var t0 = $.buildDynamicMetadata(inputTable); $._dynamicMetadata(t0); @@ -3592,6 +3707,12 @@ $.getRange = function(receiver, start, length$) { return receiver.slice(start, end); }; +$._DoubleLinkedQueueIterator$1 = function(_sentinel) { + var t0 = new $._DoubleLinkedQueueIterator((void 0), _sentinel); + t0._DoubleLinkedQueueIterator$1(_sentinel); + return t0; +}; + $.getRange2 = function(a, start, length$, accumulator) { if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.getRange2$bailout(a, start, length$, accumulator, 0); if ($.ltB(length$, 0)) { @@ -3613,10 +3734,8 @@ $.getRange2 = function(a, start, length$, accumulator) { return accumulator; }; -$._DoubleLinkedQueueIterator$1 = function(_sentinel) { - var t0 = new $._DoubleLinkedQueueIterator((void 0), _sentinel); - t0._DoubleLinkedQueueIterator$1(_sentinel); - return t0; +$._TextTrackListEventsImpl$1 = function(_ptr) { + return new $._TextTrackListEventsImpl(_ptr); }; $.lastIndexOf$1 = function(receiver, element) { @@ -3634,10 +3753,6 @@ $.lastIndexOf$1 = function(receiver, element) { return receiver.lastIndexOf$1(element); }; -$._TextTrackListEventsImpl$1 = function(_ptr) { - return new $._TextTrackListEventsImpl(_ptr); -}; - $._dynamicMetadata = function(table) { $dynamicMetadata = table; }; @@ -3680,6 +3795,26 @@ $.checkNull = function(object) { return object; }; +$.lastIndexOf = function(a, element, startIndex) { + if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.lastIndexOf$bailout(a, element, startIndex, 0); + if ($.ltB(startIndex, 0)) { + return -1; + } + var i = startIndex; + if ($.geB(startIndex, a.length)) { + i = a.length - 1; + } + for (; $.geB(i, 0); i = $.sub(i, 1)) { + if (i !== (i | 0)) throw $.iae(i); + var t0 = a.length; + if (i < 0 || i >= t0) throw $.ioore(i); + if ($.eqB(a[i], element)) { + return i; + } + } + return -1; +}; + $._EventListenerListImpl$2 = function(_ptr, _type) { return new $._EventListenerListImpl(_type, _ptr); }; @@ -3923,17 +4058,6 @@ $.checkBool = function(value) { return value; }; -$.removeLast = function(receiver) { - if ($.isJsArray(receiver) === true) { - $.checkGrowable(receiver, 'removeLast'); - if ($.get$length(receiver) === 0) { - throw $.captureStackTrace($.IndexOutOfRangeException$1(-1)); - } - return receiver.pop(); - } - return receiver.removeLast$0(); -}; - $._firstProbe = function(hashCode, length$) { return $.and(hashCode, $.sub(length$, 1)); }; @@ -3955,6 +4079,10 @@ $.set$length = function(receiver, newLength) { return newLength; }; +$.ioore = function(index) { + throw $.captureStackTrace($.IndexOutOfRangeException$1(index)); +}; + $.typeNameInFirefox = function(obj) { var name$ = $.constructorNameFallback(obj); if ($.eqB(name$, 'Window')) { @@ -3973,10 +4101,10 @@ $.typeNameInFirefox = function(obj) { }; $.DateImplementation$fromString = function(formattedString) { - var match = $.CTC8.firstMatch$1(formattedString); + var match = $.CTC10.firstMatch$1(formattedString); if (!(match === (void 0))) { - var t0 = new $.Closure14(); - var t1 = new $.Closure15(); + var t0 = new $.Closure19(); + var t1 = new $.Closure20(); var years = $.parseInt($.index(match, 1)); var month = $.parseInt($.index(match, 2)); var day = $.parseInt($.index(match, 3)); @@ -3992,7 +4120,7 @@ $.DateImplementation$fromString = function(formattedString) { } var isUtc = !($.index(match, 8) === (void 0)) && !$.eqB($.index(match, 8), ''); if (isUtc) { - var timezone = $.CTC9; + var timezone = $.CTC11; } else { timezone = $.TimeZoneImplementation$local$0(); } @@ -4010,31 +4138,6 @@ $.DateImplementation$fromString = function(formattedString) { } }; -$.ioore = function(index) { - throw $.captureStackTrace($.IndexOutOfRangeException$1(index)); -}; - -$.indexOf2 = function(a, element, startIndex, endIndex) { - if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.indexOf2$bailout(a, element, startIndex, endIndex, 0); - if (typeof endIndex !== 'number') return $.indexOf2$bailout(a, element, startIndex, endIndex, 0); - if ($.geB(startIndex, a.length)) { - return -1; - } - var i = startIndex; - if ($.ltB(startIndex, 0)) { - i = 0; - } - for (; $.ltB(i, endIndex); i = $.add(i, 1)) { - if (i !== (i | 0)) throw $.iae(i); - var t0 = a.length; - if (i < 0 || i >= t0) throw $.ioore(i); - if ($.eqB(a[i], element)) { - return i; - } - } - return -1; -}; - $.hashCode = function(receiver) { if (typeof receiver === 'number') { return receiver & 0x1FFFFFFF; @@ -4103,6 +4206,27 @@ $.le = function(a, b) { return a.operator$le$1(b); }; +$.indexOf2 = function(a, element, startIndex, endIndex) { + if (typeof a !== 'string' && (typeof a !== 'object'||a.constructor !== Array)) return $.indexOf2$bailout(a, element, startIndex, endIndex, 0); + if (typeof endIndex !== 'number') return $.indexOf2$bailout(a, element, startIndex, endIndex, 0); + if ($.geB(startIndex, a.length)) { + return -1; + } + var i = startIndex; + if ($.ltB(startIndex, 0)) { + i = 0; + } + for (; $.ltB(i, endIndex); i = $.add(i, 1)) { + if (i !== (i | 0)) throw $.iae(i); + var t0 = a.length; + if (i < 0 || i >= t0) throw $.ioore(i); + if ($.eqB(a[i], element)) { + return i; + } + } + return -1; +}; + $.toStringForNativeObject = function(obj) { return 'Instance of ' + $.stringToString($.getTypeNameOf(obj)); }; @@ -4113,10 +4237,6 @@ $.forEach2 = function(iterable, f) { } }; -$.TimeZoneImplementation$local$0 = function() { - return new $.TimeZoneImplementation(false); -}; - $.trim = function(receiver) { if (!(typeof receiver === 'string')) { return receiver.trim$0(); @@ -4124,6 +4244,21 @@ $.trim = function(receiver) { return receiver.trim(); }; +$.TimeZoneImplementation$local$0 = function() { + return new $.TimeZoneImplementation(false); +}; + +$.removeLast = function(receiver) { + if ($.isJsArray(receiver) === true) { + $.checkGrowable(receiver, 'removeLast'); + if ($.get$length(receiver) === 0) { + throw $.captureStackTrace($.IndexOutOfRangeException$1(-1)); + } + return receiver.pop(); + } + return receiver.removeLast$0(); +}; + $.dynamicBind = function(obj, name$, methods, arguments$) { var tag = $.getTypeNameOf(obj); var method = (methods[tag]); @@ -4202,16 +4337,16 @@ $.index = function(a, index) { return a.operator$index$1(index); }; +$._ElementEventsImpl$1 = function(_ptr) { + return new $._ElementEventsImpl(_ptr); +}; + $.forEach3 = function(iterable, f) { for (var t0 = $.iterator(iterable); t0.hasNext$0() === true; ) { f.$call$1(t0.next$0()); } }; -$._ElementEventsImpl$1 = function(_ptr) { - return new $._ElementEventsImpl(_ptr); -}; - $.toLowerCase = function(receiver) { if (!(typeof receiver === 'string')) { return receiver.toLowerCase$0(); @@ -4328,6 +4463,21 @@ $.indexOf = function(a, element, startIndex, endIndex) { return -1; }; +$.shl = function(a, b) { + if ($.checkNumbers(a, b) === true) { + var a0 = (a); + var b0 = (b); + if (b0 < 0) { + throw $.captureStackTrace($.IllegalArgumentException$1(b0)); + } + if (b0 > 31) { + return 0; + } + return (a0 << b0) >>> 0; + } + return a.operator$shl$1(b); +}; + $.document = function() { return document;; }; @@ -4500,7 +4650,7 @@ $.stringReplaceAllUnchecked$bailout = function(receiver, from, to, state, env0) return result.toString$0(); } } else { - return $.stringReplaceJS(receiver, $.regExpMakeNative($.JSSyntaxRegExp$3((from.replace($.regExpMakeNative($.CTC10, true), "\\$&")), false, false), true), to); + return $.stringReplaceJS(receiver, $.regExpMakeNative($.JSSyntaxRegExp$3((from.replace($.regExpMakeNative($.CTC12, true), "\\$&")), false, false), true), to); } } else { if (typeof from === 'object' && !!from.is$JSSyntaxRegExp) { @@ -4700,19 +4850,20 @@ Isolate.makeConstantList = function(list) { }; $.CTC = Isolate.makeConstantList([]); $.CTC3 = new Isolate.$isolateProperties.UnsupportedOperationException(''); -$.CTC5 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^[*a-zA-Z0-9]+$'); -$.CTC8 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^([+-]?\\d?\\d\\d\\d\\d)-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)? ?([zZ])?)?$'); -$.CTC12 = new Isolate.$isolateProperties._DeletedKeySentinel(); -$.CTC4 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^\\[name=["\'][^\'"]+[\'"]\\]$'); +$.CTC9 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^[*a-zA-Z0-9]+$'); +$.CTC10 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^([+-]?\\d?\\d\\d\\d\\d)-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)? ?([zZ])?)?$'); +$.CTC7 = new Isolate.$isolateProperties._DeletedKeySentinel(); +$.CTC8 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^\\[name=["\'][^\'"]+[\'"]\\]$'); $.CTC13 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, 'Chrome|DumpRenderTree'); -$.CTC9 = new Isolate.$isolateProperties.TimeZoneImplementation(true); +$.CTC11 = new Isolate.$isolateProperties.TimeZoneImplementation(true); $.CTC14 = new Isolate.$isolateProperties.Object(); -$.CTC6 = new Isolate.$isolateProperties.IllegalArgumentException('Invalid list length'); -$.CTC7 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^#[_a-zA-Z]\\w*$'); -$.CTC10 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '[-[\\]{}()*+?.,\\\\^$|#\\s]'); +$.CTC4 = new Isolate.$isolateProperties.IllegalArgumentException('Invalid list length'); +$.CTC5 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^#[_a-zA-Z]\\w*$'); +$.CTC12 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '[-[\\]{}()*+?.,\\\\^$|#\\s]'); $.CTC2 = new Isolate.$isolateProperties.NoMoreElementsException(); -$.CTC11 = new Isolate.$isolateProperties.EmptyQueueException(); +$.CTC6 = new Isolate.$isolateProperties.EmptyQueueException(); $._cachedBrowserPrefix = (void 0); +$.versionParameter = 'version='; $._getTypeNameOf = (void 0); $.tokens = (void 0); var $ = null; @@ -4879,17 +5030,20 @@ $.$defineNativeClass('HTMLCanvasElement', [], { is$Element: function() { return true; } }); -$.$defineNativeClass('CharacterData', ["length?"], { +$.$defineNativeClass('CharacterData', ["length?", "data?"], { }); $.$defineNativeClass('ClientRectList', ["length?"], { }); +$.$defineNativeClass('CompositionEvent', ["data?"], { +}); + _ConsoleImpl = (typeof console == 'undefined' ? {} : console); _ConsoleImpl.error$1 = function(arg) { return this.error(arg); }; -_ConsoleImpl.get$error = function() { return new $.Closure30(this); }; +_ConsoleImpl.get$error = function() { return new $.Closure32(this); }; $.$defineNativeClass('HTMLContentElement', [], { is$Element: function() { return true; } }); @@ -4907,7 +5061,7 @@ $.$defineNativeClass('DOMApplicationCache', ["status?"], { } }); -$.$defineNativeClass('DOMException', [], { +$.$defineNativeClass('DOMException', ["message?"], { toString$0: function() { return this.toString(); } @@ -5044,7 +5198,7 @@ $.$defineNativeClass('HTMLDivElement', [], { $.$defineNativeClass('HTMLDocument', ["readyState?"], { queryAll$1: function(selectors) { - if ($.CTC4.hasMatch$1(selectors) === true) { + if ($.CTC8.hasMatch$1(selectors) === true) { var mutableMatches = this.$dom_getElementsByName$1($.substring$2(selectors, 7, $.sub($.get$length(selectors), 2))); if (typeof mutableMatches !== 'string' && (typeof mutableMatches !== 'object'||mutableMatches.constructor !== Array)) return this.queryAll$1$bailout(selectors, 1, mutableMatches); var len = mutableMatches.length; @@ -5060,7 +5214,7 @@ $.$defineNativeClass('HTMLDocument', ["readyState?"], { } return $._FrozenElementList$_wrap$1(copyOfMatches); } else { - if ($.CTC5.hasMatch$1(selectors) === true) { + if ($.CTC9.hasMatch$1(selectors) === true) { var mutableMatches0 = this.$dom_getElementsByTagName$1(selectors); if (typeof mutableMatches0 !== 'string' && (typeof mutableMatches0 !== 'object'||mutableMatches0.constructor !== Array)) return this.queryAll$1$bailout(selectors, 2, mutableMatches0); var len0 = mutableMatches0.length; @@ -5093,7 +5247,7 @@ $.$defineNativeClass('HTMLDocument', ["readyState?"], { case 0: case 1: case 2: - if (state == 1 || (state == 0 && $.CTC4.hasMatch$1(selectors) === true)) { + if (state == 1 || (state == 0 && $.CTC8.hasMatch$1(selectors) === true)) { switch (state) { case 0: var mutableMatches = this.$dom_getElementsByName$1($.substring$2(selectors, 7, $.sub($.get$length(selectors), 2))); @@ -5117,7 +5271,7 @@ $.$defineNativeClass('HTMLDocument', ["readyState?"], { switch (state) { case 0: case 2: - if (state == 2 || (state == 0 && $.CTC5.hasMatch$1(selectors) === true)) { + if (state == 2 || (state == 0 && $.CTC9.hasMatch$1(selectors) === true)) { switch (state) { case 0: var mutableMatches0 = this.$dom_getElementsByTagName$1(selectors); @@ -5148,7 +5302,7 @@ $.$defineNativeClass('HTMLDocument', ["readyState?"], { return this.querySelector(selectors);; }, query$1: function(selectors) { - if ($.CTC7.hasMatch$1(selectors) === true) { + if ($.CTC5.hasMatch$1(selectors) === true) { return this.$dom_getElementById$1($.substring$1(selectors, 1)); } return this.$dom_querySelector$1(selectors); @@ -5289,7 +5443,10 @@ $.$defineNativeClass('EntrySync', [], { } }); -$.$defineNativeClass('EventException', [], { +$.$defineNativeClass('ErrorEvent', ["message?"], { +}); + +$.$defineNativeClass('EventException', ["message?"], { toString$0: function() { return this.toString(); } @@ -5325,7 +5482,7 @@ $.$defineNativeClass('HTMLFieldSetElement', [], { is$Element: function() { return true; } }); -$.$defineNativeClass('FileException', [], { +$.$defineNativeClass('FileException', ["message?"], { toString$0: function() { return this.toString(); } @@ -5643,7 +5800,7 @@ $.$defineNativeClass('IDBDatabase', [], { } }); -$.$defineNativeClass('IDBDatabaseException', [], { +$.$defineNativeClass('IDBDatabaseException', ["message?"], { toString$0: function() { return this.toString(); } @@ -5700,6 +5857,9 @@ $.$defineNativeClass('HTMLIFrameElement', [], { is$Element: function() { return true; } }); +$.$defineNativeClass('ImageData', ["data?"], { +}); + $.$defineNativeClass('HTMLImageElement', [], { is$Element: function() { return true; } }); @@ -5938,6 +6098,9 @@ $.$defineNativeClass('HTMLMediaElement', ["readyState?", "error?"], { is$Element: function() { return true; } }); +$.$defineNativeClass('MediaKeyEvent', ["message?"], { +}); + $.$defineNativeClass('MediaList', ["length?"], { getRange$2: function(start, rangeLength) { return $.getRange2(this, start, rangeLength, []); @@ -6013,6 +6176,9 @@ $.$defineNativeClass('HTMLMenuElement', [], { is$Element: function() { return true; } }); +$.$defineNativeClass('MessageEvent', ["data?"], { +}); + $.$defineNativeClass('MessagePort', [], { $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener),useCapture); @@ -6228,11 +6394,11 @@ $.$defineNativeClass('HTMLOListElement', [], { is$Element: function() { return true; } }); -$.$defineNativeClass('HTMLObjectElement', [], { +$.$defineNativeClass('HTMLObjectElement', ["data?"], { is$Element: function() { return true; } }); -$.$defineNativeClass('OperationNotAllowedException', [], { +$.$defineNativeClass('OperationNotAllowedException', ["message?"], { toString$0: function() { return this.toString(); } @@ -6267,10 +6433,16 @@ $.$defineNativeClass('PeerConnection00', ["readyState?"], { } }); +$.$defineNativeClass('PositionError', ["message?"], { +}); + $.$defineNativeClass('HTMLPreElement', [], { is$Element: function() { return true; } }); +$.$defineNativeClass('ProcessingInstruction', ["data?"], { +}); + $.$defineNativeClass('HTMLProgressElement', ["value="], { is$Element: function() { return true; } }); @@ -6290,12 +6462,18 @@ $.$defineNativeClass('Range', [], { } }); -$.$defineNativeClass('RangeException', [], { +$.$defineNativeClass('RangeException', ["message?"], { toString$0: function() { return this.toString(); } }); +$.$defineNativeClass('SQLError', ["message?"], { +}); + +$.$defineNativeClass('SQLException', ["message?"], { +}); + $.$defineNativeClass('SQLResultSetRowList', ["length?"], { }); @@ -6405,7 +6583,7 @@ $.$defineNativeClass('SVGEllipseElement', [], { is$Element: function() { return true; } }); -$.$defineNativeClass('SVGException', [], { +$.$defineNativeClass('SVGException', ["message?"], { toString$0: function() { return this.toString(); } @@ -6737,6 +6915,9 @@ $.$defineNativeClass('HTMLScriptElement', [], { }); $.$defineNativeClass('HTMLSelectElement', ["value=", "length="], { + add$2: function(element, before) { + return this.add(element,before); + }, is$Element: function() { return true; } }); @@ -6777,6 +6958,9 @@ $.$defineNativeClass('SpeechRecognition', [], { } }); +$.$defineNativeClass('SpeechRecognitionError', ["message?"], { +}); + $.$defineNativeClass('SpeechRecognitionEvent', ["error?"], { }); @@ -6923,6 +7107,9 @@ $.$defineNativeClass('HTMLTextAreaElement', ["value="], { is$Element: function() { return true; } }); +$.$defineNativeClass('TextEvent', ["data?"], { +}); + $.$defineNativeClass('TextTrack', [], { $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener),useCapture); @@ -7279,7 +7466,7 @@ $.$defineNativeClass('XMLHttpRequest', ["withCredentials!", "status?", "response } }); -$.$defineNativeClass('XMLHttpRequestException', [], { +$.$defineNativeClass('XMLHttpRequestException', ["message?"], { toString$0: function() { return this.toString(); } @@ -7294,14 +7481,14 @@ $.$defineNativeClass('XMLHttpRequestUpload', [], { } }); -$.$defineNativeClass('XPathException', [], { +$.$defineNativeClass('XPathException', ["message?"], { toString$0: function() { return this.toString(); } }); -// 281 dynamic classes. -// 298 classes +// 292 dynamic classes. +// 308 classes // 27 !leaf (function(){ var v0/*class(_SVGTextPositioningElementImpl)*/ = 'SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement'; diff --git a/Drop.dart.js_ b/Drop.dart.js_ index c78d7bd..645ab12 100644 --- a/Drop.dart.js_ +++ b/Drop.dart.js_ @@ -293,6 +293,9 @@ $defProp(Object.prototype, "is$html_Element", function() { $defProp(Object.prototype, "open$3", function($0, $1, $2) { return this.noSuchMethod("open", [$0, $1, $2]); }); +$defProp(Object.prototype, "query$1", function($0) { + return this.noSuchMethod("query", [$0]); +}); $defProp(Object.prototype, "remove$0", function() { return this.noSuchMethod("remove", []); }); @@ -457,6 +460,9 @@ Math.parseDouble = function(str) { return ret; } function Strings() {} +Strings.String$fromCharCodes$factory = function(charCodes) { + return StringBase.createFromCharCodes(charCodes); +} Strings.join = function(strings, separator) { return StringBase.join(strings, separator); } @@ -1197,6 +1203,12 @@ StringBufferImpl.prototype.toString = function() { StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; StringBufferImpl.prototype.clear$0 = StringBufferImpl.prototype.clear$_; function StringBase() {} +StringBase.createFromCharCodes = function(charCodes) { + if (Object.getPrototypeOf(charCodes) !== Array.prototype) { + charCodes = new ListFactory.ListFactory$from$factory(charCodes); + } + return String.fromCharCode.apply(null, charCodes); +} StringBase.join = function(strings, separator) { if (strings.get$length() == (0)) return ""; var s = strings.$index((0)); @@ -1291,7 +1303,7 @@ DateImplementation.fromEpoch$ctor = function(value, timeZone) { DateImplementation.fromEpoch$ctor.prototype = DateImplementation.prototype; function DateImplementation() {} DateImplementation.DateImplementation$fromString$factory = function(formattedString) { - var re = const$0005; + var re = const$0006; var match = re.firstMatch(formattedString); if (null != match) { function parseIntOrZero(matched) { @@ -1315,7 +1327,7 @@ DateImplementation.DateImplementation$fromString$factory = function(formattedStr milliseconds = (999); } var isUtc = (null != match.$index((8))) && (match.$index((8)) != ""); - var timezone = isUtc ? const$0006 : new TimeZoneImplementation.local$ctor(); + var timezone = isUtc ? const$0007 : new TimeZoneImplementation.local$ctor(); var epochValue = DateImplementation._valueFromDecomposed(years, month, day, hours, minutes, seconds, milliseconds, isUtc); if (null == epochValue) { $throw(new IllegalArgumentException(formattedString)); @@ -1600,6 +1612,9 @@ $dynamic("get$$$dom_lastElementChild").Element = function() { return this.lastElementChild; } $dynamic("get$style").Element = function() { return this.style; }; +$dynamic("query$1").Element = function($0) { + return this.querySelector($0); +}; $dynamic("get$on").AbstractWorker = function() { return new _AbstractWorkerEventsImpl(this); } @@ -1783,7 +1798,7 @@ $dynamic("get$on").HTMLDocument = function() { } $dynamic("get$readyState").HTMLDocument = function() { return this.readyState; }; $dynamic("query").HTMLDocument = function(selectors) { - if (const$0004.hasMatch(selectors)) { + if (const$0005.hasMatch(selectors)) { return this.getElementById(selectors.substring((1))); } return this.$dom_querySelector(selectors); @@ -1792,7 +1807,7 @@ $dynamic("$dom_querySelector").HTMLDocument = function(selectors) { return this.querySelector(selectors); } $dynamic("queryAll").HTMLDocument = function(selectors) { - if (const$0007.hasMatch(selectors)) { + if (const$0008.hasMatch(selectors)) { var mutableMatches = this.getElementsByName(selectors.substring((7), selectors.length - (2))); var len = mutableMatches.get$length(); var copyOfMatches = new Array(len); @@ -1802,7 +1817,7 @@ $dynamic("queryAll").HTMLDocument = function(selectors) { } return new _FrozenElementList._wrap$ctor(copyOfMatches); } - else if (const$0008.hasMatch(selectors)) { + else if (const$0009.hasMatch(selectors)) { var mutableMatches = this.getElementsByTagName(selectors); var len = mutableMatches.get$length(); var copyOfMatches = new Array(len); @@ -1816,6 +1831,9 @@ $dynamic("queryAll").HTMLDocument = function(selectors) { return new _FrozenElementList._wrap$ctor(this.querySelectorAll(selectors)); } } +$dynamic("query$1").HTMLDocument = function($0) { + return this.query($0); +}; $inherits(_DocumentEventsImpl, _ElementEventsImpl); function _DocumentEventsImpl(_ptr) { _ElementEventsImpl.call(this, _ptr); @@ -1931,6 +1949,9 @@ $dynamic("get$style").DocumentFragment = function() { $dynamic("get$on").DocumentFragment = function() { return new _ElementEventsImpl(this); } +$dynamic("query$1").DocumentFragment = function($0) { + return this.querySelector($0); +}; $dynamic("get$name").DocumentType = function() { return this.name; }; _ChildrenElementList._wrap$ctor = function(element) { this._childElements = element.get$$$dom_children(); @@ -2979,6 +3000,9 @@ $dynamic("filter$1").NodeList = function($0) { $dynamic("forEach$1").NodeList = function($0) { return this.forEach($wrap_call$1(to$call$1($0))); }; +$dynamic("query$1").NodeSelector = function($0) { + return this.querySelector($0); +}; $dynamic("get$on").Notification = function() { return new _NotificationEventsImpl(this); } @@ -3187,6 +3211,7 @@ function _TextTrackEventsImpl(_ptr) { $dynamic("get$on").TextTrackCue = function() { return new _TextTrackCueEventsImpl(this); } +$dynamic("get$id").TextTrackCue = function() { return this.id; }; $dynamic("$dom_addEventListener$3").TextTrackCue = function($0, $1, $2) { return this.addEventListener($0, $wrap_call$1(to$call$1($1)), $2); }; @@ -3395,6 +3420,9 @@ function _WindowEventsImpl(_ptr) { _WindowEventsImpl.prototype.get$hashChange = function() { return this._get("hashchange"); } +_WindowEventsImpl.prototype.get$message = function() { + return this._get("message"); +} _WindowEventsImpl.prototype.get$mouseOver = function() { return this._get("mouseover"); } @@ -3649,67 +3677,72 @@ function Drop() { return $this.loadFromHash(); }) ), false); - this.loadFromHash(); + get$$window().get$on().get$message().add($wrap_call$1(this.get$renderVersionedPage()), false); + get$$window().location.assign(("" + get$$window().location.toString() + "#welcome")); } Drop.prototype.loadFromHash = function() { - if (get$$window().location.hash == "") { - this.showPage("welcome", null); + var splitted = get$$window().location.hash.split$_("/"); + var section = splitted.$index((0)).substring$1((1)); + var uri = null; + if (splitted.get$length() == (2)) { + var page = splitted.$index((1)); + var version = null; + version = this.versionFromUri(page); + uri = ("" + section + "/" + page); + this.showPage(this.uriWithoutVersion(uri), version); + if (this.oldPage != page && this.oldSection != section) { + this.showMetaPage(uri); + } + this.oldPage = page; + this.oldSection = section; + this.oldVersion = version; } else { - var splitted = get$$window().location.hash.split$_("/"); - var section = splitted.$index((0)).substring$1((1)); - var uri = null; - if (splitted.get$length() == (2)) { - var page = splitted.$index((1)); - var hash = this.hashFromUri(page); - uri = ("" + section + "/" + page); - this.showPage(this.uriWithoutHash(uri), hash); - if (this.oldPage != page && this.oldSection != section) { - this.showMetaPage(uri); - } - this.oldPage = page; - } - else { - uri = ("" + section); - var hash = this.hashFromUri(section); - this.showPage(this.uriWithoutHash(uri), hash); - if (section != this.oldSection) { - this.showMetaPage(uri); - } + var version = this.versionFromUri(section); + section = this.uriWithoutVersion(section); + this.showPage(section, version); + if (section != this.oldSection) { + this.showMetaPage(section); } this.oldSection = section; + this.oldVersion = version; } } -Drop.prototype.changeHash = function(hash) { - var loc; - if (this.uriHasHash(get$$window().location.toString())) { - loc = get$$window().location.toString(); - var pos = loc.lastIndexOf("hash="); - loc = loc.substring((0), pos + (5)); - loc = ("" + loc + hash); +Drop.prototype.changeVersion = function(version) { + var newLocation; + if (this.uriHasVersion(get$$window().location.toString())) { + newLocation = get$$window().location.toString(); + var pos = newLocation.lastIndexOf($globals.Drop_versionParameter); + newLocation = newLocation.substring((0), pos + $globals.Drop_versionParameter.length); + newLocation = ("" + newLocation + version); } else { - loc = ("" + get$$window().location.toString() + "?hash=" + hash); + newLocation = ("" + get$$window().location.toString() + "?" + $globals.Drop_versionParameter + version); } - get$$window().location.assign(loc); + get$$window().location.assign(newLocation); } -Drop.prototype.uriHasHash = function(uri) { - return uri.contains("hash="); +Drop.prototype.uriHasVersion = function(uri) { + return uri.contains($globals.Drop_versionParameter); } -Drop.prototype.hashFromUri = function(uri) { - var splitted = uri.split$_("hash="); - if (splitted.get$length() == (2)) { - return splitted.$index((1)); +Drop.prototype.versionFromUri = function(uri) { + if (this.uriHasVersion(uri)) { + var splitted = uri.split$_($globals.Drop_versionParameter); + if (splitted.get$length() == (2)) { + return splitted.$index((1)).substring((0), (40)); + } + else { + return null; + } } else { return null; } } -Drop.prototype.uriWithoutHash = function(page) { - if (this.uriHasHash(page)) { - var splitted = page.split$_("hash="); +Drop.prototype.uriWithoutVersion = function(page) { + if (this.uriHasVersion(page)) { + var splitted = page.split$_($globals.Drop_versionParameter); if (splitted.$index((0)).endsWith("?")) { - return splitted.$index((0)).substring((0), splitted.$index((0)).get$length() - (2)); + return splitted.$index((0)).substring((0), splitted.$index((0)).get$length() - (1)); } else { return splitted.$index((0)); @@ -3720,33 +3753,53 @@ Drop.prototype.uriWithoutHash = function(page) { } } Drop.prototype.showPage = function(relativeUri, hash) { - var $this = this; if (hash == null) { + print$(relativeUri); var req = _XMLHttpRequestFactoryProvider.XMLHttpRequest$get$factory(("" + relativeUri + ".html"), $wrap_call$1((function (oh) { - print$(oh.get$status()); get$$document().query("#content").set$innerHTML(oh.get$responseText()); }) )); - req.get$on().get$error().add($wrap_call$1((function (er) { - return $this.showError(); - }) - ), false); + req.get$on().get$error().add($wrap_call$1(this.get$showError()), false); } else { - https: - var uri = "https://raw.github.com/generateui/generateui.github.com"; - var req = _XMLHttpRequestFactoryProvider.XMLHttpRequest$get$factory(("" + uri + "/" + hash + "/" + relativeUri + ".html"), $wrap_call$1((function (oh) { - print$(oh.get$status()); - get$$document().query("#content").set$innerHTML(oh.get$responseText()); + var ghuri = "https://api.github.com"; + var metareq = ("repos/generateui/generateui.github.com/git/trees/" + hash); + var req = _XMLHttpRequestFactoryProvider.XMLHttpRequest$get$factory(("" + ghuri + "/" + metareq + "?recursive=1"), $wrap_call$1((function (oh) { + var sha = null; + var data = json_JSON.parse(oh.get$responseText()); + var $$list = data.$index("tree"); + for (var $$i = $$list.iterator(); $$i.hasNext(); ) { + var item = $$i.next(); + if ($eq$(item.$index("path"), ("" + relativeUri + ".html"))) { + sha = item.$index("sha"); + } + } + var blobreq = "repos/generateui/generateui.github.com/git/blobs/"; + var breq = _XMLHttpRequestFactoryProvider.XMLHttpRequest$get$factory(("" + ghuri + "/" + blobreq + sha), $wrap_call$1((function (oh2) { + var data2 = json_JSON.parse(oh2.get$responseText()); + var x = decode(data2.$index("content")); + get$$document().query("#content").set$innerHTML(x); + }) + )); }) )); } } -Drop.prototype.showError = function() { +Drop.prototype.showError = function(e) { var error = get$$document().query("#error"); error.get$style().set$display("block"); get$$document().query("#content").set$innerHTML(error.get$innerHTML()); } +Drop.prototype.get$showError = function() { + return this.showError.bind(this); +} +Drop.prototype.renderVersionedPage = function(e) { + var data = json_JSON.parse(e.data); + get$$document().query("#content").set$innerHTML(data); +} +Drop.prototype.get$renderVersionedPage = function() { + return this.renderVersionedPage.bind(this); +} Drop.prototype.showMetaPage = function(relativeUri) { var $this = this; var ghuri = "https://api.github.com"; @@ -3754,9 +3807,10 @@ Drop.prototype.showMetaPage = function(relativeUri) { var req = _XMLHttpRequestFactoryProvider.XMLHttpRequest$get$factory(("" + ghuri + metareq), $wrap_call$1((function (oh) { var data = json_JSON.parse(oh.get$responseText()); var sb = new StringBufferImpl(""); + sb.add("
    "); for (var $$i = data.iterator(); $$i.hasNext(); ) { var d = $$i.next(); - sb.add(("

    " + $this.escape(d.$index("commit").$index("message")) + "

    ")); + sb.add(("
  1. " + $this.escape(d.$index("commit").$index("message")) + "")); var sdate = d.$index("commit").$index("author").$index("date"); sdate = sdate.substring((0), (10)); var date = DateImplementation.DateImplementation$fromString$factory(sdate); @@ -3771,24 +3825,25 @@ Drop.prototype.showMetaPage = function(relativeUri) { else { durationString = ("" + daysago + " days ago"); } - sb.add(("

    " + durationString + ", ")); + sb.add(("

    " + durationString + ", ")); var hashString = d.$index("sha"); var shortHashString = hashString.substring((0), (10)); - sb.add(("" + shortHashString + "


    ")); + sb.add(("" + shortHashString + "

  2. ")); } + sb.add("
"); var mcchanges = get$$document().query("#metacontent-changes"); mcchanges.set$innerHTML(sb.toString()); mcchanges = get$$document().query("#metacontent-changes"); - var $$list = mcchanges.queryAll(".hash"); + var $$list = mcchanges.queryAll("li.meta"); for (var $$i = $$list.iterator(); $$i.hasNext(); ) { var se = $$i.next(); se.get$on().get$mouseOver().add($wrap_call$1((function (se, e) { - $this.changeHash(se.get$id()); + var id = se.query$1(".hash").get$id(); + $this.changeVersion(id); }).bind(null, se) ), false); } var sb2 = new StringBufferImpl(""); - sb.add(("Last edited " + data.$index((0)).$index("committer").$index("date") + "")); get$$document().query("#metacontent-summary").set$innerHTML(sb2.toString()); }) )); @@ -3799,6 +3854,53 @@ Drop.prototype.escape = function(html) { result = result.replaceAll(">", ">"); return result; } +function decode(data) { + var result = new Array(); + var padCount = (0); + var charCount = (0); + var value = (0); + for (var i = (0); + i < data.length; i++) { + var char = data.charCodeAt(i); + if ((65) <= char && char <= (90)) { + value = (value << (6)) | char - (65); + charCount++; + } + else if ((97) <= char && char <= (122)) { + value = (value << (6)) | char - (97) + (26); + charCount++; + } + else if ((48) <= char && char <= (57)) { + value = (value << (6)) | char - (48) + (52); + charCount++; + } + else if (char == (43)) { + value = (value << (6)) | (62); + charCount++; + } + else if (char == (47)) { + value = (value << (6)) | (63); + charCount++; + } + else if (char == (61)) { + value = (value << (6)); + charCount++; + padCount++; + } + if (charCount == (4)) { + result.add((value & (16711680)) >> (16)); + if (padCount < (2)) { + result.add((value & (65280)) >> (8)); + } + if (padCount == (0)) { + result.add(value & (255)); + } + charCount = (0); + value = (0); + } + } + return Strings.String$fromCharCodes$factory(result); +} function main() { new Drop(); } @@ -3839,16 +3941,18 @@ function main() { $dynamicSetMetadata(table); })(); function $static_init(){ + $globals.Drop_versionParameter = "version="; } var const$0000 = Object.create(_DeletedKeySentinel.prototype, {}); var const$0001 = Object.create(NoMoreElementsException.prototype, {}); var const$0002 = Object.create(EmptyQueueException.prototype, {}); var const$0003 = Object.create(UnsupportedOperationException.prototype, {_message: {"value": "", writeable: false}}); -var const$0004 = new JSSyntaxRegExp("^#[_a-zA-Z]\\w*$"); -var const$0005 = new JSSyntaxRegExp("^([+-]?\\d?\\d\\d\\d\\d)-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)? ?([zZ])?)?$"); -var const$0006 = Object.create(TimeZoneImplementation.prototype, {isUtc: {"value": true, writeable: false}}); -var const$0007 = new JSSyntaxRegExp("^\\[name=[\"'][^'\"]+['\"]\\]$"); -var const$0008 = new JSSyntaxRegExp("^[*a-zA-Z0-9]+$"); +var const$0005 = new JSSyntaxRegExp("^#[_a-zA-Z]\\w*$"); +var const$0006 = new JSSyntaxRegExp("^([+-]?\\d?\\d\\d\\d\\d)-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(.\\d{1,6})?)?)? ?([zZ])?)?$"); +var const$0007 = Object.create(TimeZoneImplementation.prototype, {isUtc: {"value": true, writeable: false}}); +var const$0008 = new JSSyntaxRegExp("^\\[name=[\"'][^'\"]+['\"]\\]$"); +var const$0009 = new JSSyntaxRegExp("^[*a-zA-Z0-9]+$"); +var $globals = {}; $static_init(); if (typeof window != 'undefined' && typeof document != 'undefined' && window.addEventListener && document.readyState == 'loading') {