diff --git a/dist/runtime.js b/dist/runtime.js index a0adb5b..6d7dfad 100644 --- a/dist/runtime.js +++ b/dist/runtime.js @@ -1,8 +1,8 @@ (function (rxjs,$,CodeMirror) { 'use strict'; -$ = $ && 'default' in $ ? $['default'] : $; -CodeMirror = CodeMirror && 'default' in CodeMirror ? CodeMirror['default'] : CodeMirror; +$ = $ && $.hasOwnProperty('default') ? $['default'] : $; +CodeMirror = CodeMirror && CodeMirror.hasOwnProperty('default') ? CodeMirror['default'] : CodeMirror; /** * RxJS in action @@ -95,6 +95,123 @@ function consoleProxy() { } } +var asyncGenerator = function () { + function AwaitValue(value) { + this.value = value; + } + + function AsyncGenerator(gen) { + var front, back; + + function send(key, arg) { + return new Promise(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null + }; + + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + + function resume(key, arg) { + try { + var result = gen[key](arg); + var value = result.value; + + if (value instanceof AwaitValue) { + Promise.resolve(value.value).then(function (arg) { + resume("next", arg); + }, function (arg) { + resume("throw", arg); + }); + } else { + settle(result.done ? "return" : "normal", result.value); + } + } catch (err) { + settle("throw", err); + } + } + + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ + value: value, + done: true + }); + break; + + case "throw": + front.reject(value); + break; + + default: + front.resolve({ + value: value, + done: false + }); + break; + } + + front = front.next; + + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + + this._invoke = send; + + if (typeof gen.return !== "function") { + this.return = undefined; + } + } + + if (typeof Symbol === "function" && Symbol.asyncIterator) { + AsyncGenerator.prototype[Symbol.asyncIterator] = function () { + return this; + }; + } + + AsyncGenerator.prototype.next = function (arg) { + return this._invoke("next", arg); + }; + + AsyncGenerator.prototype.throw = function (arg) { + return this._invoke("throw", arg); + }; + + AsyncGenerator.prototype.return = function (arg) { + return this._invoke("return", arg); + }; + + return { + wrap: function (fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; + }, + await: function (value) { + return new AwaitValue(value); + } + }; +}(); + + + + + var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); @@ -255,6 +372,8 @@ var cookies = new CookieManager(); * @author Paul Daniels * @author Luis Atencio */ +'use strict'; + cookies.watchCookie('example').subscribe(function (x) { return console.log('Cookie is ' + x); }); @@ -272,8 +391,7 @@ rxjs.Observable.of('css', 'html', 'javascript').flatMap(function (tag) { }).subscribe(function (_ref) { var el = _ref.el, tag = _ref.tag; - var classList = el.classList, - id = el.id; + var classList = el.classList; classList.toggle('btn-primary'); @@ -430,7 +548,8 @@ var runtime$ = update$.debounceTime(1000).do(onCodeChange('combined')).map(funct * @author Paul Daniels * @author Luis Atencio */ -// Get the contents of the iframe +'use strict'; + var doc = $('#output').contents(); runtime$.subscribe(function (content) { diff --git a/dist/runtime.js.map b/dist/runtime.js.map index 21337b5..5ff2a6e 100644 --- a/dist/runtime.js.map +++ b/dist/runtime.js.map @@ -1 +1 @@ -{"version":3,"file":"runtime.js","sources":["utils/url.js","utils/tag.js","initial.js","console.js","utils/cookies.js","editors.js","runtime.js"],"sourcesContent":["/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function getUrlParams(url) {\r\n let match,\r\n pl = /\\+/g, // Regex for replacing addition symbol with a space\r\n search = /([^&=]+)=?([^&]*)/g,\r\n decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); },\r\n query = url.substring(1);\r\n\r\n const urlParams = {};\r\n while (match = search.exec(query))\r\n urlParams[decode(match[1])] = decode(match[2]);\r\n\r\n return urlParams;\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function buildTag(tagName, options, transform = x => x) {\r\n return (source) => {\r\n const attrs = [];\r\n for (let k in options) {\r\n options.hasOwnProperty(k) && attrs.push(`${k}=\"${options[k]}\"`);\r\n }\r\n\r\n return `<${tagName} ${attrs.join(' ')}>${transform(source)}`;\r\n };\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport const defaultHtml =\r\n `\r\n\r\n\r\n \r\n \r\n \r\n RxJS in Action\r\n \r\n \r\n\r\n`.trim();","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function consoleProxy(console = window.console) {\r\n if(console && console.log) {\r\n //Set up iframe for redirection\r\n let iframe = parent.document.getElementById('console');\r\n let consoleFrame = iframe.contentWindow || iframe.contentDocument;\r\n if (consoleFrame.document) consoleFrame = consoleFrame.document;\r\n let write = (frame => {\r\n return content => {\r\n frame.open();\r\n frame.write(content);\r\n frame.close();\r\n };\r\n })(consoleFrame);\r\n write(''); // clear contents on change\r\n\r\n window.console = {\r\n log: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n },\r\n warn: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n },\r\n error: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n }\r\n };\r\n }\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nclass CookieManager {\r\n constructor() {\r\n this._changed = new Subject();\r\n }\r\n _notifyChanged(key) {\r\n this._changed.next(key);\r\n }\r\n setCookie(key, value, opts = {}) {\r\n const {path, expires} = opts;\r\n let cookie = [`${key}=${value}`];\r\n path && cookie.push(`path=${path}`);\r\n expires && cookie.push(`expires=${expires}`);\r\n document.cookie = cookie.join('; ');\r\n this._notifyChanged(key);\r\n }\r\n\r\n static removeCookie(key) {\r\n document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\r\n }\r\n\r\n getCookie(key) {\r\n return Observable.defer(() => {\r\n const cookies = document.cookie;\r\n const cookieStart = cookies.indexOf(key);\r\n\r\n if (cookieStart < 0)\r\n return Observable.empty();\r\n else {\r\n const valueStart = cookies.indexOf('=', cookieStart) + 1;\r\n let cookieEnd = cookies.indexOf(';', cookieStart);\r\n cookieEnd = cookieEnd < 0 ? cookies.length : cookieEnd;\r\n\r\n return Observable.of(cookies.substring(valueStart, cookieEnd));\r\n }\r\n });\r\n }\r\n\r\n watchCookie(key) {\r\n return this._changed.asObservable()\r\n .filter(x => key === x)\r\n .startWith(key)\r\n .flatMapTo(this.getCookie(key));\r\n }\r\n}\r\n\r\nexport const cookies = new CookieManager();","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n'use strict';\r\n\r\nimport {getUrlParams} from './utils/url';\r\nimport {buildTag} from \"./utils/tag\";\r\nimport {defaultHtml} from \"./initial\";\r\nimport {consoleProxy} from \"./console\";\r\nimport {cookies} from './utils/cookies';\r\nimport { Observable } from 'rxjs';\r\nimport $ from 'jquery';\r\nimport CodeMirror from 'codemirror';\r\n\r\ncookies.watchCookie('example')\r\n .subscribe(x => console.log(`Cookie is ${x}`));\r\n\r\ncookies.setCookie('example', '7.2');\r\n\r\ncookies.setCookie('example', '7.3');\r\n\r\ncookies.setCookie('example', '8.1');\r\n\r\nObservable.of('css', 'html', 'javascript')\r\n .flatMap(\r\n tag => Observable.fromEvent(document.getElementById('show-' + tag), 'click'),\r\n (tag, value) => ({tag, el: value.target}))\r\n .subscribe(({el, tag}) => {\r\n const {classList, id} = el;\r\n\r\n classList.toggle('btn-primary');\r\n classList.toggle('btn-default');\r\n classList.toggle('active');\r\n\r\n document.getElementById(tag + '-container').classList.toggle('hidden');\r\n });\r\n\r\n// Builds a new code editor on the page\r\nconst jsEditor = CodeMirror.fromTextArea(document.getElementById('javascript'), {\r\n mode: \"javascript\",\r\n theme: 'dracula',\r\n lineNumbers: true,\r\n readOnly: false,\r\n value: 'Test'\r\n});\r\n\r\nconst htmlEditor = CodeMirror.fromTextArea(document.getElementById('html'), {\r\n mode: 'htmlmixed',\r\n theme: 'dracula',\r\n lineNumbers: true,\r\n});\r\n\r\nhtmlEditor.setValue(defaultHtml);\r\n\r\nconst cssEditor = CodeMirror.fromTextArea(document.getElementById('css'), {\r\n mode: 'css',\r\n theme: 'dracula',\r\n lineNumbers: true\r\n});\r\n\r\nconst exampleSelector = document.getElementById('example-change');\r\n\r\n// Url params always take precedence over the cookies\r\nconst urlParams = getUrlParams(window.location.search);\r\n\r\nObservable.from(exampleSelector.getElementsByTagName('option'))\r\n .filter(({value}) => value === urlParams['example'])\r\n .take(1)\r\n .subscribe(x => x.selected = 'selected');\r\n\r\nconst startWithIfPresent =\r\n (url, key) =>\r\n source =>\r\n url[key] ? source.startWith(url[key]) : source;\r\n\r\nObservable.fromEvent(\r\n exampleSelector,\r\n 'change',\r\n (e) => e.target.value\r\n)\r\n .let(startWithIfPresent(urlParams, 'example'))\r\n .map((e) => e.split('.')) // Split the chapter and id\r\n .filter(value => value.length === 2) // Sanity check\r\n .flatMap(([chapter, id]) => {\r\n return $.getJSON(`/rest/api/example/${chapter}/${id}`);\r\n })\r\n .subscribe(({js, css, html}) => {\r\n js && jsEditor.setValue(js);\r\n css && cssEditor.setValue(css);\r\n html && htmlEditor.setValue(html);\r\n });\r\n\r\nconst onCodeChange = (tag) => () => {\r\n console.log(tag, '[UPDATE]: CODE CHANGE', Date.now());\r\n};\r\n\r\nconst html$ = Observable.fromEvent(htmlEditor.doc, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('html'))\r\n .startWith(defaultHtml)\r\n .debounceTime(1000);\r\n\r\n// Babel compiler options\r\nconst compile$ = Observable.of({\r\n presets: ['es2015'],\r\n // TODO Compile this separately and load independently\r\n plugins: [\r\n [\"transform-object-rest-spread\", {\"useBuiltIns\": true}]\r\n ]\r\n});\r\n\r\nconst js$ = Observable.fromEvent(jsEditor, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('js'))\r\n .startWith('console.log(\"Welcome to RxJS in Action Code!\")')\r\n .debounceTime(1000)\r\n .do(() => console.log('Compiling...'))\r\n .combineLatest(compile$, (code, opts) => {\r\n try {\r\n return Babel.transform(code, opts).code\r\n } catch (e) {\r\n console.warn('Problem compiling the code', e);\r\n //FIXME Probably should not be returning code that babel doesn't even know how to compile\r\n return code;\r\n }\r\n })\r\n .map(buildTag('script', {type: 'application/javascript'}, function (code) {\r\n //Naive way of preventing this from polluting the global namespace\r\n return `;(${consoleProxy.toString().trim()})();\r\n (function wrapper() {\r\n ${code}\\n\r\n })()\\n`;\r\n }));\r\n // .map(code =>\r\n // buildTag('script', {\r\n // type: 'application/javascript',\r\n // src: 'babel-polyfill/dist/polyfill.min.js'\r\n // })(' ') + '\\n' + code\r\n // );\r\n\r\nconst css$ = Observable.fromEvent(cssEditor, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('css'))\r\n .startWith('')\r\n .debounceTime(1000)\r\n .map(buildTag('style'));\r\n\r\nconst update$ = js$.combineLatest(html$, css$,\r\n (javascript, html, css) => ({html, javascript, css}));\r\n\r\nexport const runtime$ = update$\r\n .debounceTime(1000)\r\n .do(onCodeChange('combined'))\r\n .map(contents => {\r\n const {javascript, html, css} = contents;\r\n let builder = [];\r\n\r\n try {\r\n const endOfHead = html.indexOf('');\r\n const endOfBody = html.indexOf('');\r\n\r\n const beforeCss = html.substring(0, endOfHead);\r\n const afterCss = html.substring(endOfHead, endOfBody);\r\n const afterJs = html.substring(endOfBody);\r\n\r\n builder.push(beforeCss);\r\n builder.push(css);\r\n builder.push(afterCss);\r\n\r\n builder.push(javascript);\r\n builder.push(afterJs);\r\n } catch (e) {\r\n console.log('Could not render content! ', e);\r\n }\r\n\r\n return builder.join('\\n');\r\n });\r\n","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n'use strict';\r\n\r\nimport {runtime$} from './editors';\r\nimport $ from 'jquery';\r\n\r\n// Get the contents of the iframe\r\nconst doc = $('#output').contents();\r\n\r\nruntime$.subscribe(\r\n content => {\r\n // Rewrites the contents of the iframe\r\n // Prevents carry over from previous examples\r\n doc[0].open();\r\n doc[0].write(content);\r\n doc[0].close();\r\n },\r\n err => {\r\n console.warn(\"Something went wrong! Please refresh the page.\", err)\r\n });\r\n"],"names":["getUrlParams","url","match","pl","decode","s","decodeURIComponent","replace","query","substring","urlParams","search","exec","buildTag","tagName","options","transform","x","source","attrs","k","hasOwnProperty","push","join","defaultHtml","trim","consoleProxy","console","window","log","iframe","parent","document","getElementById","consoleFrame","contentWindow","contentDocument","write","open","content","close","val","previous","body","innerHTML","CookieManager","_changed","Subject","key","next","value","opts","path","expires","cookie","_notifyChanged","Observable","defer","cookies","cookieStart","indexOf","empty","valueStart","cookieEnd","length","of","asObservable","filter","startWith","flatMapTo","getCookie","watchCookie","subscribe","setCookie","flatMap","fromEvent","tag","el","target","classList","id","toggle","jsEditor","CodeMirror","fromTextArea","htmlEditor","setValue","cssEditor","exampleSelector","location","from","getElementsByTagName","take","selected","startWithIfPresent","e","let","map","split","chapter","$","getJSON","js","css","html","onCodeChange","Date","now","html$","doc","instance","change","getValue","do","debounceTime","compile$","js$","combineLatest","code","Babel","warn","type","toString","css$","update$","javascript","runtime$","contents","builder","endOfHead","endOfBody","beforeCss","afterCss","afterJs","err"],"mappings":";;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,YAAT,CAAsBC,GAAtB,EAA2B;MAC5BC,cAAJ;MACEC,KAAS,KADX;;WAEW,oBAFX;MAGEC,SAAS,SAATA,MAAS,CAAUC,CAAV,EAAa;WAASC,mBAAmBD,EAAEE,OAAF,CAAUJ,EAAV,EAAc,GAAd,CAAnB,CAAP;GAH1B;MAIEK,QAASP,IAAIQ,SAAJ,CAAc,CAAd,CAJX;;MAMMC,YAAY,EAAlB;SACOR,QAAQS,OAAOC,I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GlyZXN9YCk7XHJcbiAgICBkb2N1bWVudC5jb29raWUgPSBjb29raWUuam9pbignOyAnKTtcclxuICAgIHRoaXMuX25vdGlmeUNoYW5nZWQoa2V5KTtcclxuICB9XHJcblxyXG4gIHN0YXRpYyByZW1vdmVDb29raWUoa2V5KSB7XHJcbiAgICBkb2N1bWVudC5jb29raWUgPSBgJHtrZXl9PTsgZXhwaXJlcz1UaHUsIDAxIEphbiAxOTcwIDAwOjAwOjAxIEdNVDtgO1xyXG4gIH1cclxuXHJcbiAgZ2V0Q29va2llKGtleSkge1xyXG4gICAgcmV0dXJuIE9ic2VydmFibGUuZGVmZXIoKCkgPT4ge1xyXG4gICAgICBjb25zdCBjb29raWVzID0gZG9jdW1lbnQuY29va2llO1xyXG4gICAgICBjb25zdCBjb29raWVTdGFydCA9IGNvb2tpZXMuaW5kZXhPZihrZXkpO1xyXG5cclxuICAgICAgaWYgKGNvb2tpZVN0YXJ0IDwgMClcclxuICAgICAgICByZXR1cm4gT2JzZXJ2YWJsZS5lbXB0eSgpO1xyXG4gICAgICBlbHNlIHtcclxuICAgICAgICBjb25zdCB2YWx1ZVN0YXJ0ID0gY29va2llcy5pbmRleE9mKCc9JywgY29va2llU3RhcnQpICsgMTtcclxuICAgICAgICBsZXQgY29va2llRW5kID0gY29va2llcy5pbmRleE9mKCc7JywgY29va2llU3RhcnQpO1xyXG4gICAgICAgIGNvb2tpZUVuZCA9IGNvb2tpZUVuZCA8IDAgPyBjb29raWVzLmxlbmd0aCA6IGNvb2tpZUVuZDtcclxuXHJcbiAgICAgICAgcmV0dXJuIE9ic2VydmFibGUub2YoY29va2llcy5zdWJzdHJpbmcodmFsdWVTdGFydCwgY29va2llRW5kKSk7XHJcbiAgICAgIH1cclxuICAgIH0pO1xyXG4gIH1cclxuXHJcbiAgd2F0Y2hDb29raWUoa2V5KSB7XHJcbiAgICByZXR1cm4gdGhpcy5fY2hhbmdlZC5hc09ic2VydmFibGUoKVxyXG4gICAgICAuZmlsdGVyKH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DQUFlLENBQWYsRUFBa0J3SCxTQUFsQixDQUFsQjtRQUNNRyxXQUFXNUIsS0FBSy9GLFNBQUwsQ0FBZXdILFNBQWYsRUFBMEJDLFNBQTFCLENBQWpCO1FBQ01HLFVBQVU3QixLQUFLL0YsU0FBTCxDQUFleUgsU0FBZixDQUFoQjs7WUFFUTVHLElBQVIsQ0FBYTZHLFNBQWI7WUFDUTdHLElBQVIsQ0FBYWlGLEdBQWI7WUFDUWpGLElBQVIsQ0FBYThHLFFBQWI7O1lBRVE5RyxJQUFSLENBQWF1RyxVQUFiO1lBQ1F2RyxJQUFSLENBQWErRyxPQUFiO0dBYkYsQ0FjRSxPQUFPdEMsQ0FBUCxFQUFVO1lBQ0ZsRSxHQUFSLENBQVksNEJBQVosRUFBMENrRSxDQUExQzs7O1NBR0tpQyxRQUFRekcsSUFBUixDQUFhLElBQWIsQ0FBUDtDQXpCb0IsQ0FBakI7O0FDekpQOzs7Ozs7QUFNQSxBQUtBO0FBQ0EsSUFBTXNGLE1BQU1ULEVBQUUsU0FBRixFQUFhMkIsUUFBYixFQUFaOztBQUVBRCxTQUFTdEQsU0FBVCxDQUNFLG1CQUFXOzs7TUFHTCxDQUFKLEVBQU9sQyxJQUFQO01BQ0ksQ0FBSixFQUFPRCxLQUFQLENBQWFFLE9BQWI7TUFDSSxDQUFKLEVBQU9DLEtBQVA7Q0FOSixFQVFFLGVBQU87VUFDR2dGLElBQVIsQ0FBYSxnREFBYixFQUErRGMsR0FBL0Q7Q0FUSjs7OzsifQ=="} \ No newline at end of file +{"version":3,"file":"runtime.js","sources":["utils/url.js","utils/tag.js","initial.js","console.js","utils/cookies.js","editors.js","runtime.js"],"sourcesContent":["/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function getUrlParams(url) {\r\n let match,\r\n pl = /\\+/g, // Regex for replacing addition symbol with a space\r\n search = /([^&=]+)=?([^&]*)/g,\r\n decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); },\r\n query = url.substring(1);\r\n\r\n const urlParams = {};\r\n while (match = search.exec(query))\r\n urlParams[decode(match[1])] = decode(match[2]);\r\n\r\n return urlParams;\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function buildTag(tagName, options, transform = x => x) {\r\n return (source) => {\r\n const attrs = [];\r\n for (let k in options) {\r\n options.hasOwnProperty(k) && attrs.push(`${k}=\"${options[k]}\"`);\r\n }\r\n\r\n return `<${tagName} ${attrs.join(' ')}>${transform(source)}`;\r\n };\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport const defaultHtml =\r\n `\r\n\r\n\r\n \r\n \r\n \r\n RxJS in Action\r\n \r\n \r\n\r\n`.trim();","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\nexport function consoleProxy(console = window.console) {\r\n if(console && console.log) {\r\n //Set up iframe for redirection\r\n let iframe = parent.document.getElementById('console');\r\n let consoleFrame = iframe.contentWindow || iframe.contentDocument;\r\n if (consoleFrame.document) consoleFrame = consoleFrame.document;\r\n let write = (frame => {\r\n return content => {\r\n frame.open();\r\n frame.write(content);\r\n frame.close();\r\n };\r\n })(consoleFrame);\r\n write(''); // clear contents on change\r\n\r\n window.console = {\r\n log: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n },\r\n warn: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n },\r\n error: (val) => {\r\n let previous = consoleFrame.body.innerHTML || '';\r\n write(previous.trim() + \"
\" + val);\r\n }\r\n };\r\n }\r\n}","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nclass CookieManager {\r\n constructor() {\r\n this._changed = new Subject();\r\n }\r\n _notifyChanged(key) {\r\n this._changed.next(key);\r\n }\r\n setCookie(key, value, opts = {}) {\r\n const {path, expires} = opts;\r\n let cookie = [`${key}=${value}`];\r\n path && cookie.push(`path=${path}`);\r\n expires && cookie.push(`expires=${expires}`);\r\n document.cookie = cookie.join('; ');\r\n this._notifyChanged(key);\r\n }\r\n\r\n static removeCookie(key) {\r\n document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\r\n }\r\n\r\n getCookie(key) {\r\n return Observable.defer(() => {\r\n const cookies = document.cookie;\r\n const cookieStart = cookies.indexOf(key);\r\n\r\n if (cookieStart < 0)\r\n return Observable.empty();\r\n else {\r\n const valueStart = cookies.indexOf('=', cookieStart) + 1;\r\n let cookieEnd = cookies.indexOf(';', cookieStart);\r\n cookieEnd = cookieEnd < 0 ? cookies.length : cookieEnd;\r\n\r\n return Observable.of(cookies.substring(valueStart, cookieEnd));\r\n }\r\n });\r\n }\r\n\r\n watchCookie(key) {\r\n return this._changed.asObservable()\r\n .filter(x => key === x)\r\n .startWith(key)\r\n .flatMapTo(this.getCookie(key));\r\n }\r\n}\r\n\r\nexport const cookies = new CookieManager();","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n'use strict';\r\n\r\nimport {getUrlParams} from './utils/url';\r\nimport {buildTag} from \"./utils/tag\";\r\nimport {defaultHtml} from \"./initial\";\r\nimport {consoleProxy} from \"./console\";\r\nimport {cookies} from './utils/cookies';\r\nimport { Observable } from 'rxjs';\r\nimport $ from 'jquery';\r\nimport CodeMirror from 'codemirror';\r\n\r\ncookies.watchCookie('example')\r\n .subscribe(x => console.log(`Cookie is ${x}`));\r\n\r\ncookies.setCookie('example', '7.2');\r\n\r\ncookies.setCookie('example', '7.3');\r\n\r\ncookies.setCookie('example', '8.1');\r\n\r\nObservable.of('css', 'html', 'javascript')\r\n .flatMap(\r\n tag => Observable.fromEvent(document.getElementById('show-' + tag), 'click'),\r\n (tag, value) => ({tag, el: value.target}))\r\n .subscribe(({el, tag}) => {\r\n const {classList, id} = el;\r\n\r\n classList.toggle('btn-primary');\r\n classList.toggle('btn-default');\r\n classList.toggle('active');\r\n\r\n document.getElementById(tag + '-container').classList.toggle('hidden');\r\n });\r\n\r\n// Builds a new code editor on the page\r\nconst jsEditor = CodeMirror.fromTextArea(document.getElementById('javascript'), {\r\n mode: \"javascript\",\r\n theme: 'dracula',\r\n lineNumbers: true,\r\n readOnly: false,\r\n value: 'Test'\r\n});\r\n\r\nconst htmlEditor = CodeMirror.fromTextArea(document.getElementById('html'), {\r\n mode: 'htmlmixed',\r\n theme: 'dracula',\r\n lineNumbers: true,\r\n});\r\n\r\nhtmlEditor.setValue(defaultHtml);\r\n\r\nconst cssEditor = CodeMirror.fromTextArea(document.getElementById('css'), {\r\n mode: 'css',\r\n theme: 'dracula',\r\n lineNumbers: true\r\n});\r\n\r\nconst exampleSelector = document.getElementById('example-change');\r\n\r\n// Url params always take precedence over the cookies\r\nconst urlParams = getUrlParams(window.location.search);\r\n\r\nObservable.from(exampleSelector.getElementsByTagName('option'))\r\n .filter(({value}) => value === urlParams['example'])\r\n .take(1)\r\n .subscribe(x => x.selected = 'selected');\r\n\r\nconst startWithIfPresent =\r\n (url, key) =>\r\n source =>\r\n url[key] ? source.startWith(url[key]) : source;\r\n\r\nObservable.fromEvent(\r\n exampleSelector,\r\n 'change',\r\n (e) => e.target.value\r\n)\r\n .let(startWithIfPresent(urlParams, 'example'))\r\n .map((e) => e.split('.')) // Split the chapter and id\r\n .filter(value => value.length === 2) // Sanity check\r\n .flatMap(([chapter, id]) => {\r\n return $.getJSON(`/rest/api/example/${chapter}/${id}`);\r\n })\r\n .subscribe(({js, css, html}) => {\r\n js && jsEditor.setValue(js);\r\n css && cssEditor.setValue(css);\r\n html && htmlEditor.setValue(html);\r\n });\r\n\r\nconst onCodeChange = (tag) => () => {\r\n console.log(tag, '[UPDATE]: CODE CHANGE', Date.now());\r\n};\r\n\r\nconst html$ = Observable.fromEvent(htmlEditor.doc, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('html'))\r\n .startWith(defaultHtml)\r\n .debounceTime(1000);\r\n\r\n// Babel compiler options\r\nconst compile$ = Observable.of({\r\n presets: ['es2015'],\r\n // TODO Compile this separately and load independently\r\n plugins: [\r\n [\"transform-object-rest-spread\", {\"useBuiltIns\": true}]\r\n ]\r\n});\r\n\r\nconst js$ = Observable.fromEvent(jsEditor, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('js'))\r\n .startWith('console.log(\"Welcome to RxJS in Action Code!\")')\r\n .debounceTime(1000)\r\n .do(() => console.log('Compiling...'))\r\n .combineLatest(compile$, (code, opts) => {\r\n try {\r\n return Babel.transform(code, opts).code\r\n } catch (e) {\r\n console.warn('Problem compiling the code', e);\r\n //FIXME Probably should not be returning code that babel doesn't even know how to compile\r\n return code;\r\n }\r\n })\r\n .map(buildTag('script', {type: 'application/javascript'}, function (code) {\r\n //Naive way of preventing this from polluting the global namespace\r\n return `;(${consoleProxy.toString().trim()})();\r\n (function wrapper() {\r\n ${code}\\n\r\n })()\\n`;\r\n }));\r\n // .map(code =>\r\n // buildTag('script', {\r\n // type: 'application/javascript',\r\n // src: 'babel-polyfill/dist/polyfill.min.js'\r\n // })(' ') + '\\n' + code\r\n // );\r\n\r\nconst css$ = Observable.fromEvent(cssEditor, 'change',\r\n (instance, change) => instance.getValue())\r\n .do(onCodeChange('css'))\r\n .startWith('')\r\n .debounceTime(1000)\r\n .map(buildTag('style'));\r\n\r\nconst update$ = js$.combineLatest(html$, css$,\r\n (javascript, html, css) => ({html, javascript, css}));\r\n\r\nexport const runtime$ = update$\r\n .debounceTime(1000)\r\n .do(onCodeChange('combined'))\r\n .map(contents => {\r\n const {javascript, html, css} = contents;\r\n let builder = [];\r\n\r\n try {\r\n const endOfHead = html.indexOf('');\r\n const endOfBody = html.indexOf('');\r\n\r\n const beforeCss = html.substring(0, endOfHead);\r\n const afterCss = html.substring(endOfHead, endOfBody);\r\n const afterJs = html.substring(endOfBody);\r\n\r\n builder.push(beforeCss);\r\n builder.push(css);\r\n builder.push(afterCss);\r\n\r\n builder.push(javascript);\r\n builder.push(afterJs);\r\n } catch (e) {\r\n console.log('Could not render content! ', e);\r\n }\r\n\r\n return builder.join('\\n');\r\n });\r\n","/**\r\n * RxJS in action\r\n * Chapter #\r\n * @author Paul Daniels\r\n * @author Luis Atencio\r\n */\r\n'use strict';\r\n\r\nimport {runtime$} from './editors';\r\nimport $ from 'jquery';\r\n\r\n// Get the contents of the iframe\r\nconst doc = $('#output').contents();\r\n\r\nruntime$.subscribe(\r\n content => {\r\n // Rewrites the contents of the iframe\r\n // Prevents carry over from previous examples\r\n doc[0].open();\r\n doc[0].write(content);\r\n doc[0].close();\r\n },\r\n err => {\r\n console.warn(\"Something went wrong! Please refresh the page.\", err)\r\n });\r\n"],"names":["getUrlParams","url","match","pl","decode","s","decodeURIComponent","replace","query","substring","urlParams","search","exec","buildTag","tagName","options","transform","x","source","attrs","k","hasOwnProperty","push","join","defaultHtml","trim","consoleProxy","console","window","log","iframe","parent","document","getElementById","consoleFrame","contentWindow","contentDocument","write","open","content","close","val","previous","body","innerHTML","CookieManager","_changed","Subject","key","next","value","opts","path","expires","cookie","_notifyChanged","Observable","defer","cookies","cookieStart","indexOf","empty","valueStart","cookieEnd","length","of","asObservable","filter","startWith","flatMapTo","getCookie","watchCookie","subscribe","setCookie","flatMap","fromEvent","tag","el","target","classList","toggle","jsEditor","CodeMirror","fromTextArea","htmlEditor","setValue","cssEditor","exampleSelector","location","from","getElementsByTagName","take","selected","startWithIfPresent","e","let","map","split","chapter","id","$","getJSON","js","css","html","onCodeChange","Date","now","html$","doc","instance","change","getValue","do","debounceTime","compile$","js$","combineLatest","code","Babel","warn","type","toString","css$","update$","javascript","runtime$","contents","builder","endOfHead","endOfBody","beforeCss","afterCss","afterJs","err"],"mappings":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lZCA9IG5ldyBTdWJqZWN0KCk7XHJcbiAgfVxyXG4gIF9ub3RpZnlDaGFuZ2VkKGtleSkge1xyXG4gICAgdGhpcy5fY2hhbmdlZC5uZXh0KGtleSk7XHJcbiAgfVxyXG4gIHNldENvb2tpZShrZXksIHZhbHVlLCBvcHRzID0ge30pIHtcclxuICAgIGNvbnN0IHtwYXRoLCBleHBpcmVzfSA9IG9wdHM7XHJcbiAgICBsZXQgY29va2llID0gW2Ake2tleX09JHt2YWx1ZX1gXTtcclxuICAgIHBhdGggJiYgY29va2llLnB1c2goYHBhdGg9JHtwYXRofWApO1xyXG4gICAgZXhwaXJlcyAmJiBjb29raWUucHVzaChgZXhwaXJlcz0ke2V4cGlyZXN9YCk7XHJcbiAgICBkb2N1bWVudC5jb29raWUgPSBjb29raWUuam9pbignOyAnKTtcclxuICAgIHRoaXMuX25vdGlmeUNoYW5nZWQoa2V5KTtcclxuICB9XHJcblxyXG4gIHN0YXRpYyByZW1vdmVDb29raWUoa2V5KSB7XHJcbiAgICBkb2N1bWVudC5jb29raWUgPSBgJHtrZXl9PTsgZXhwaXJlcz1UaHUsIDAxIEphbiAxOTcwIDAwOjAwOjAxIEdNVDtgO1xyXG4gIH1cclxuXHJcbiAgZ2V0Q29va2llKGtleSkge1xyXG4gICAgcmV0dXJuIE9ic2VydmFibGUuZGVmZXIoKCkgPT4ge1xyXG4gICAgICBjb25zdCBjb29raWVzID0gZG9jdW1lbnQuY29va2llO1xyXG4gICAgICBjb25zdCBjb29raWVTdGFydCA9IGNvb2tpZXMuaW5kZXhPZihrZXkpO1xyXG5cclxuICAgICAgaWYgKGNvb2tpZVN0YXJ0IDwgMClcclxuICAgICAgICByZXR1cm4gT2JzZXJ2YWJsZS5lbXB0eSgpO1xyXG4gICAgICBlbHNlIHtcclxuICAgICAgICBjb25zdCB2YWx1ZVN0YXJ0ID0gY29va2llcy5pbmRleE9mKCc9JywgY29va2llU3RhcnQpICsgMTtcclxuICAgICAgICBsZXQgY29va2llR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sSUFBTXNGLE1BQU1ULEVBQUUsU0FBRixFQUFhMkIsUUFBYixFQUFaOztBQUVBRCxTQUFTdEQsU0FBVCxDQUNFLG1CQUFXOzs7TUFHTCxDQUFKLEVBQU9sQyxJQUFQO01BQ0ksQ0FBSixFQUFPRCxLQUFQLENBQWFFLE9BQWI7TUFDSSxDQUFKLEVBQU9DLEtBQVA7Q0FOSixFQVFFLGVBQU87VUFDR2dGLElBQVIsQ0FBYSxnREFBYixFQUErRGMsR0FBL0Q7Q0FUSjs7OzsifQ=="} \ No newline at end of file diff --git a/examples/1/7_1.html b/examples/1/7_1.html index e7514fa..cf74c27 100644 --- a/examples/1/7_1.html +++ b/examples/1/7_1.html @@ -3,7 +3,7 @@ Listing 7.1 - + diff --git a/examples/10/10/10_10.html b/examples/10/10/10_10.html index 313a57f..12abe8d 100644 --- a/examples/10/10/10_10.html +++ b/examples/10/10/10_10.html @@ -7,7 +7,7 @@ - + diff --git a/examples/2/4/2_4.html b/examples/2/4/2_4.html index 5dcd450..2c6df24 100644 --- a/examples/2/4/2_4.html +++ b/examples/2/4/2_4.html @@ -3,7 +3,7 @@ Listing 2.4 - + diff --git a/examples/3/1/3_1.html b/examples/3/1/3_1.html index 5531076..093726b 100644 --- a/examples/3/1/3_1.html +++ b/examples/3/1/3_1.html @@ -3,7 +3,7 @@ Listing 3.1 - + diff --git a/examples/3/2/3_2.html b/examples/3/2/3_2.html index 4ecffcf..1e21113 100644 --- a/examples/3/2/3_2.html +++ b/examples/3/2/3_2.html @@ -3,7 +3,7 @@ Listing 3.2 - + diff --git a/examples/3/3/3_3.html b/examples/3/3/3_3.html index 4c62605..2f2e630 100644 --- a/examples/3/3/3_3.html +++ b/examples/3/3/3_3.html @@ -3,7 +3,7 @@ Listing 3.3 - + diff --git a/examples/3/4/3_4.html b/examples/3/4/3_4.html index 67d5f9f..16f141f 100644 --- a/examples/3/4/3_4.html +++ b/examples/3/4/3_4.html @@ -3,7 +3,7 @@ Listing 3.4 - + diff --git a/examples/3/5/3_5.html b/examples/3/5/3_5.html index 58695ae..b43c56f 100644 --- a/examples/3/5/3_5.html +++ b/examples/3/5/3_5.html @@ -3,7 +3,7 @@ Listing 3.5 - + diff --git a/examples/3/6/3_6.html b/examples/3/6/3_6.html index ecb9fd6..396974d 100644 --- a/examples/3/6/3_6.html +++ b/examples/3/6/3_6.html @@ -3,7 +3,7 @@ Listing 3.6 - + diff --git a/examples/3/7/3_7.html b/examples/3/7/3_7.html index 0ff1891..02d0650 100644 --- a/examples/3/7/3_7.html +++ b/examples/3/7/3_7.html @@ -3,7 +3,7 @@ Listing 3.7 - + diff --git a/examples/4/1/4_1.html b/examples/4/1/4_1.html index badb33b..49cec8f 100644 --- a/examples/4/1/4_1.html +++ b/examples/4/1/4_1.html @@ -3,7 +3,7 @@ Listing 4.1 - +
diff --git a/examples/4/10/4_10.html b/examples/4/10/4_10.html index 765a69c..8847afb 100644 --- a/examples/4/10/4_10.html +++ b/examples/4/10/4_10.html @@ -3,7 +3,7 @@ Listing 4.10 and 4.11 - + diff --git a/examples/4/12/4_12.html b/examples/4/12/4_12.html index b491dfc..4ee3f17 100644 --- a/examples/4/12/4_12.html +++ b/examples/4/12/4_12.html @@ -3,7 +3,7 @@ Listing 4.12 - + diff --git a/examples/4/13/4_13.html b/examples/4/13/4_13.html index 6148e29..e880c18 100644 --- a/examples/4/13/4_13.html +++ b/examples/4/13/4_13.html @@ -3,7 +3,7 @@ Listing 4.13 - + diff --git a/examples/4/14/4_14.html b/examples/4/14/4_14.html index deaa5fb..fd51434 100644 --- a/examples/4/14/4_14.html +++ b/examples/4/14/4_14.html @@ -3,7 +3,7 @@ Listing 4.14 - + diff --git a/examples/4/15/4_15.html b/examples/4/15/4_15.html index 0c73bd2..232df79 100644 --- a/examples/4/15/4_15.html +++ b/examples/4/15/4_15.html @@ -3,7 +3,7 @@ Listing 4.15 - + diff --git a/examples/4/2/4_2.html b/examples/4/2/4_2.html index 00900ce..598e5d2 100644 --- a/examples/4/2/4_2.html +++ b/examples/4/2/4_2.html @@ -3,7 +3,7 @@ Listing 4.2 - +
diff --git a/examples/4/3/4_3.html b/examples/4/3/4_3.html index facd25d..cc4781b 100644 --- a/examples/4/3/4_3.html +++ b/examples/4/3/4_3.html @@ -3,7 +3,7 @@ Listing 4.3 - + diff --git a/examples/4/4/4_4.html b/examples/4/4/4_4.html index 921729c..1b0df1b 100644 --- a/examples/4/4/4_4.html +++ b/examples/4/4/4_4.html @@ -3,7 +3,7 @@ Listing 4.4 - + diff --git a/examples/4/5/4_5.html b/examples/4/5/4_5.html index e2b936e..2ae8e95 100644 --- a/examples/4/5/4_5.html +++ b/examples/4/5/4_5.html @@ -3,7 +3,7 @@ Listing 4.5 - + diff --git a/examples/4/6/4_6.html b/examples/4/6/4_6.html index cce5647..048cad6 100644 --- a/examples/4/6/4_6.html +++ b/examples/4/6/4_6.html @@ -3,7 +3,7 @@ Listing 4.6 - + diff --git a/examples/4/7/4_7.html b/examples/4/7/4_7.html index 3bcd620..1ee5fd7 100644 --- a/examples/4/7/4_7.html +++ b/examples/4/7/4_7.html @@ -3,7 +3,7 @@ Listing 4.7 - + diff --git a/examples/4/8/4_8.html b/examples/4/8/4_8.html index 507a0a6..bb19989 100644 --- a/examples/4/8/4_8.html +++ b/examples/4/8/4_8.html @@ -3,7 +3,7 @@ Listing 4.8 - + diff --git a/examples/4/9/4_9.html b/examples/4/9/4_9.html index 44d9e1d..941d03e 100644 --- a/examples/4/9/4_9.html +++ b/examples/4/9/4_9.html @@ -3,7 +3,7 @@ Listing 4.9 - + diff --git a/examples/5/1/5_1.html b/examples/5/1/5_1.html index 46aca5d..cb7647a 100644 --- a/examples/5/1/5_1.html +++ b/examples/5/1/5_1.html @@ -3,7 +3,7 @@ Listing 5.1 - + diff --git a/examples/5/2/5_2.html b/examples/5/2/5_2.html index 63bceb5..6aa3a1c 100644 --- a/examples/5/2/5_2.html +++ b/examples/5/2/5_2.html @@ -3,7 +3,7 @@ Listing 5.2 - + diff --git a/examples/5/3/5_3.html b/examples/5/3/5_3.html index 2016b87..9d15c71 100644 --- a/examples/5/3/5_3.html +++ b/examples/5/3/5_3.html @@ -3,7 +3,7 @@ Listing 5.3 - + diff --git a/examples/5/4/5_4.html b/examples/5/4/5_4.html index da572e7..b5c9f9a 100644 --- a/examples/5/4/5_4.html +++ b/examples/5/4/5_4.html @@ -3,7 +3,7 @@ Listing 5.4 & 5.5 - + diff --git a/examples/5/6/5_6.html b/examples/5/6/5_6.html index 42b041a..5ed243e 100644 --- a/examples/5/6/5_6.html +++ b/examples/5/6/5_6.html @@ -3,7 +3,7 @@ Listing 5.6 - + diff --git a/examples/5/7/5_7.html b/examples/5/7/5_7.html index 0813e12..15c2932 100644 --- a/examples/5/7/5_7.html +++ b/examples/5/7/5_7.html @@ -3,7 +3,7 @@ Listing 5.7 - + diff --git a/examples/6/1/6_1.html b/examples/6/1/6_1.html index c6d57c1..c449b18 100644 --- a/examples/6/1/6_1.html +++ b/examples/6/1/6_1.html @@ -3,7 +3,7 @@ Listing 6.1 - + diff --git a/examples/6/2/6_2.html b/examples/6/2/6_2.html index b5e89ae..b6e53c0 100644 --- a/examples/6/2/6_2.html +++ b/examples/6/2/6_2.html @@ -3,7 +3,7 @@ Listing 6.2 and 6.3 - + diff --git a/examples/6/4/6_4.html b/examples/6/4/6_4.html index 94eeadd..fb5d2e0 100644 --- a/examples/6/4/6_4.html +++ b/examples/6/4/6_4.html @@ -3,7 +3,7 @@ Listing 6.4 - + diff --git a/examples/7/1/7_1.html b/examples/7/1/7_1.html index e7514fa..cf74c27 100644 --- a/examples/7/1/7_1.html +++ b/examples/7/1/7_1.html @@ -3,7 +3,7 @@ Listing 7.1 - + diff --git a/examples/7/2/7_2.html b/examples/7/2/7_2.html index 8b39f9b..0e4a97a 100644 --- a/examples/7/2/7_2.html +++ b/examples/7/2/7_2.html @@ -3,7 +3,7 @@ Listing 7.2 - + diff --git a/examples/7/3/7_3.html b/examples/7/3/7_3.html index 8a6e74a..30f0a90 100644 --- a/examples/7/3/7_3.html +++ b/examples/7/3/7_3.html @@ -3,7 +3,7 @@ Listing 7.3 - + diff --git a/examples/7/4/7_4.html b/examples/7/4/7_4.html index a7487bf..807381a 100644 --- a/examples/7/4/7_4.html +++ b/examples/7/4/7_4.html @@ -3,7 +3,7 @@ Listing 7.4 - + diff --git a/examples/7/5/7_5.html b/examples/7/5/7_5.html index 691149b..34f94dd 100644 --- a/examples/7/5/7_5.html +++ b/examples/7/5/7_5.html @@ -3,7 +3,7 @@ Listing 7.5 - + diff --git a/examples/7/6/7_6.html b/examples/7/6/7_6.html index 5ccdae1..ab13423 100644 --- a/examples/7/6/7_6.html +++ b/examples/7/6/7_6.html @@ -3,7 +3,7 @@ Listing 7.6 - + diff --git a/examples/7/7/7_7.html b/examples/7/7/7_7.html index 3632e34..c13ec98 100644 --- a/examples/7/7/7_7.html +++ b/examples/7/7/7_7.html @@ -3,7 +3,7 @@ Listing 7.7 - + diff --git a/examples/7/8/7_8.html b/examples/7/8/7_8.html index 700d182..153c927 100644 --- a/examples/7/8/7_8.html +++ b/examples/7/8/7_8.html @@ -3,7 +3,7 @@ Listing 7.8 - + diff --git a/examples/7/9/7_9.html b/examples/7/9/7_9.html index 2677eae..6e87670 100644 --- a/examples/7/9/7_9.html +++ b/examples/7/9/7_9.html @@ -3,7 +3,7 @@ Listing 7.9 - + diff --git a/examples/8/1/8_1.html b/examples/8/1/8_1.html index eff6018..5dd42db 100644 --- a/examples/8/1/8_1.html +++ b/examples/8/1/8_1.html @@ -3,7 +3,7 @@ Listing 8.1 - + diff --git a/examples/8/3/8_3.html b/examples/8/3/8_3.html index 7597e35..926026d 100644 --- a/examples/8/3/8_3.html +++ b/examples/8/3/8_3.html @@ -3,7 +3,7 @@ Listing 8.3 - + diff --git a/examples/8/4/8_4.html b/examples/8/4/8_4.html index abdbab6..152660f 100644 --- a/examples/8/4/8_4.html +++ b/examples/8/4/8_4.html @@ -3,7 +3,7 @@ Listing 8.4 - + diff --git a/examples/8/5/8_5.html b/examples/8/5/8_5.html index a85e66d..095844a 100644 --- a/examples/8/5/8_5.html +++ b/examples/8/5/8_5.html @@ -3,7 +3,7 @@ Listing 8.4 - +