conflict_resolution
stringlengths
27
16k
<<<<<<< let url: string; if (id.startsWith("ds-")) { url = config.registryApiUrl + `records/${encodeURIComponent(id)}?${parameters}`; } else if ( // lookup CKAN UUIDs id.match( /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g ) ) { url = config.registryApiUrl + `records?aspectQuery=ckan-dataset.id:${encodeURIComponent( id )}&${parameters}`; } else { // lookup CKAN dataset slugs url = config.registryApiUrl + `records?aspectQuery=ckan-dataset.name:${encodeURIComponent( id )}&${parameters}`; } return fetch(url, { credentials: "same-origin" }) ======= const url = config.registryApiUrl + `records/${encodeURIComponent(id)}?${parameters}`; return fetch(url) >>>>>>> const url = config.registryApiUrl + `records/${encodeURIComponent(id)}?${parameters}`; return fetch(url, { credentials: "same-origin" })
<<<<<<< </h3> {/* <CrappyChat ======= </h2> <CrappyChat >>>>>>> </h2> {/* <CrappyChat
<<<<<<< <div className="container container-mobile"> <SearchBox location={props.location} isMobile={true} isHome={props.theme === "home"} /> ======= <div className="container-mobile"> <SearchBox location={props.location} isMobile={true} /> >>>>>>> <div className="container-mobile"> <SearchBox location={props.location} isMobile={true} isHome={props.theme === "home"} />
<<<<<<< const displayName = BaseMap.displayName || 'BaseMap'; const containerWrapper = css` height: 100vh; min-height: 500px; `; ======= >>>>>>> const displayName = BaseMap.displayName || 'BaseMap'; const containerWrapper = css` height: 100vh; min-height: 500px; `;
<<<<<<< 'preloadSpreadsheet', 'mxmlc:prod', ======= 'buildSwf:prod', >>>>>>> 'mxmlc:prod', <<<<<<< 'preloadSpreadsheet', 'mxmlc:dev', ======= 'buildSwf:dev', >>>>>>> 'mxmlc:dev', <<<<<<< 'preloadSpreadsheet', 'mxmlc:prod' ======= 'buildSwf:prod' >>>>>>> 'mxmlc:prod'
<<<<<<< channel: m.channel, ======= type: type, >>>>>>> channel: m.channel, type: type,
<<<<<<< define(['/customize/languageSelector.js', '/customize/translations/messages.js', '/customize/translations/messages.es.js', '/customize/translations/messages.fr.js', // 1) additional translation files can be added here... '/customize/translations/messages.pl.js', '/bower_components/jquery/dist/jquery.min.js'], // 2) name your language module here... function(LS, Default, Spanish, French, Polish) { var $ = window.jQuery; // 3) add your module to this map so it gets used var map = { 'fr': French, 'es': Spanish, 'pl': Polish, }; var defaultLanguage = 'en'; var language = LS.getLanguage(); var messages; if (!language || language === defaultLanguage || language === 'default' || !map[language]) { messages = Default; } else { // Add the translated keys to the returned object messages = $.extend(true, {}, Default, map[language]); } // messages_languages return the available translations and their name in an object : // { "en": "English", "fr": "French", ... } messages._languages = { 'en': Default._languageName }; for (var l in map) { messages._languages[l] = map[l]._languageName || l; } messages._initSelector = LS.main; messages._checkTranslationState = function () { var missing = []; Object.keys(map).forEach(function (code) { var translation = map[code]; Object.keys(Default).forEach(function (k) { if (/^_/.test(k) || /nitialState$/.test(k)) { return; } if (!translation[k]) { var warning = "key [" + k + "] is missing from translation [" + code + "]"; missing.push(warning); } }); if (typeof(translation._languageName) !== 'string') { var warning = 'key [_languageName] is missing from translation [' + code + ']'; missing.push(warning); } }); return missing; }; // Get keys with parameters messages._getKey = function (key, argArray) { if (!messages[key]) { return '?'; } var text = messages[key]; return text.replace(/\{(\d+)\}/g, function (str, p1) { return argArray[p1] || null; }); }; messages._applyTranslation = function () { $('[data-localization]').each(function (i, e) { var $el = $(this); var key = $el.data('localization'); $el.html(messages[key]); }); $('[data-localization-title]').each(function (i, e) { var $el = $(this); var key = $el.data('localization-title'); $el.attr('title', messages[key]); }); }; // Non translatable keys messages.initialState = [ '<p>', 'This is <strong>CryptPad</strong>, the zero knowledge realtime collaborative editor.', '<br>', 'What you type here is encrypted so only people who have the link can access it.', '<br>', 'Even the server cannot see what you type.', '</p>', '<p>', '<small>', '<i>What you see here, what you hear here, when you leave here, let it stay here</i>', '</small>', '</p>', ].join(''); messages.codeInitialState = [ '/*\n', ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', ' What you type here is encrypted so only people who have the link can access it.\n', ' Even the server cannot see what you type.\n', ' What you see here, what you hear here, when you leave here, let it stay here.\n', '*/' ].join(''); messages.slideInitialState = [ '# CryptSlide\n', '* This is a zero knowledge realtime collaborative editor.\n', '* What you type here is encrypted so only people who have the link can access it.\n', '* Even the server cannot see what you type.\n', '* What you see here, what you hear here, when you leave here, let it stay here.\n', '\n', '---', '\n', '# How to use\n', '1. Write your slides content using markdown syntax\n', '2. Separate your slides with ---\n', '3. Click on the "Play" button to see the result' ].join(''); return messages; }); ======= define(['/customize/languageSelector.js', '/customize/translations/messages.js', '/customize/translations/messages.es.js', '/customize/translations/messages.fr.js', '/customize/translations/messages.de.js', // 1) additional translation files can be added here... '/bower_components/jquery/dist/jquery.min.js'], // 2) name your language module here... function(LS, Default, Spanish, French, German) { var $ = window.jQuery; // 3) add your module to this map so it gets used var map = { 'fr': French, 'es': Spanish, 'de': German, }; var defaultLanguage = 'en'; var language = LS.getLanguage(); var messages; if (!language || language === defaultLanguage || language === 'default' || !map[language]) { messages = Default; } else { // Add the translated keys to the returned object messages = $.extend(true, {}, Default, map[language]); } // messages_languages return the available translations and their name in an object : // { "en": "English", "fr": "French", ... } messages._languages = { 'en': Default._languageName }; for (var l in map) { messages._languages[l] = map[l]._languageName || l; } messages._initSelector = LS.main; messages._checkTranslationState = function () { var missing = []; Object.keys(map).forEach(function (code) { var translation = map[code]; Object.keys(Default).forEach(function (k) { if (/^_/.test(k) || /nitialState$/.test(k)) { return; } if (!translation[k]) { var warning = "key [" + k + "] is missing from translation [" + code + "]"; missing.push(warning); } }); if (typeof(translation._languageName) !== 'string') { var warning = 'key [_languageName] is missing from translation [' + code + ']'; missing.push(warning); } }); return missing; }; // Get keys with parameters messages._getKey = function (key, argArray) { if (!messages[key]) { return '?'; } var text = messages[key]; return text.replace(/\{(\d+)\}/g, function (str, p1) { return argArray[p1] || null; }); }; messages._applyTranslation = function () { $('[data-localization]').each(function (i, e) { var $el = $(this); var key = $el.data('localization'); $el.html(messages[key]); }); $('[data-localization-title]').each(function (i, e) { var $el = $(this); var key = $el.data('localization-title'); $el.attr('title', messages[key]); }); }; // Non translatable keys messages.initialState = [ '<p>', 'This is <strong>CryptPad</strong>, the zero knowledge realtime collaborative editor.', '<br>', 'What you type here is encrypted so only people who have the link can access it.', '<br>', 'Even the server cannot see what you type.', '</p>', '<p>', '<small>', '<i>What you see here, what you hear here, when you leave here, let it stay here</i>', '</small>', '</p>', ].join(''); messages.codeInitialState = [ '/*\n', ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', ' What you type here is encrypted so only people who have the link can access it.\n', ' Even the server cannot see what you type.\n', ' What you see here, what you hear here, when you leave here, let it stay here.\n', '*/' ].join(''); messages.slideInitialState = [ '# CryptSlide\n', '* This is a zero knowledge realtime collaborative editor.\n', '* What you type here is encrypted so only people who have the link can access it.\n', '* Even the server cannot see what you type.\n', '* What you see here, what you hear here, when you leave here, let it stay here.\n', '\n', '---', '\n', '# How to use\n', '1. Write your slides content using markdown syntax\n', '2. Separate your slides with ---\n', '3. Click on the "Play" button to see the result' ].join(''); return messages; }); >>>>>>> define(['/customize/languageSelector.js', '/customize/translations/messages.js', '/customize/translations/messages.es.js', '/customize/translations/messages.fr.js', // 1) additional translation files can be added here... '/customize/translations/messages.pl.js', '/customize/translations/messages.de.js', '/bower_components/jquery/dist/jquery.min.js'], // 2) name your language module here... function(LS, Default, Spanish, French, Polish, German) { var $ = window.jQuery; // 3) add your module to this map so it gets used var map = { 'fr': French, 'es': Spanish, 'pl': Polish, 'de': German, }; var defaultLanguage = 'en'; var language = LS.getLanguage(); var messages; if (!language || language === defaultLanguage || language === 'default' || !map[language]) { messages = Default; } else { // Add the translated keys to the returned object messages = $.extend(true, {}, Default, map[language]); } // messages_languages return the available translations and their name in an object : // { "en": "English", "fr": "French", ... } messages._languages = { 'en': Default._languageName }; for (var l in map) { messages._languages[l] = map[l]._languageName || l; } messages._initSelector = LS.main; messages._checkTranslationState = function () { var missing = []; Object.keys(map).forEach(function (code) { var translation = map[code]; Object.keys(Default).forEach(function (k) { if (/^_/.test(k) || /nitialState$/.test(k)) { return; } if (!translation[k]) { var warning = "key [" + k + "] is missing from translation [" + code + "]"; missing.push(warning); } }); if (typeof(translation._languageName) !== 'string') { var warning = 'key [_languageName] is missing from translation [' + code + ']'; missing.push(warning); } }); return missing; }; // Get keys with parameters messages._getKey = function (key, argArray) { if (!messages[key]) { return '?'; } var text = messages[key]; return text.replace(/\{(\d+)\}/g, function (str, p1) { return argArray[p1] || null; }); }; messages._applyTranslation = function () { $('[data-localization]').each(function (i, e) { var $el = $(this); var key = $el.data('localization'); $el.html(messages[key]); }); $('[data-localization-title]').each(function (i, e) { var $el = $(this); var key = $el.data('localization-title'); $el.attr('title', messages[key]); }); }; // Non translatable keys messages.initialState = [ '<p>', 'This is <strong>CryptPad</strong>, the zero knowledge realtime collaborative editor.', '<br>', 'What you type here is encrypted so only people who have the link can access it.', '<br>', 'Even the server cannot see what you type.', '</p>', '<p>', '<small>', '<i>What you see here, what you hear here, when you leave here, let it stay here</i>', '</small>', '</p>', ].join(''); messages.codeInitialState = [ '/*\n', ' This is CryptPad, the zero knowledge realtime collaborative editor.\n', ' What you type here is encrypted so only people who have the link can access it.\n', ' Even the server cannot see what you type.\n', ' What you see here, what you hear here, when you leave here, let it stay here.\n', '*/' ].join(''); messages.slideInitialState = [ '# CryptSlide\n', '* This is a zero knowledge realtime collaborative editor.\n', '* What you type here is encrypted so only people who have the link can access it.\n', '* Even the server cannot see what you type.\n', '* What you see here, what you hear here, when you leave here, let it stay here.\n', '\n', '---', '\n', '# How to use\n', '1. Write your slides content using markdown syntax\n', '2. Separate your slides with ---\n', '3. Click on the "Play" button to see the result' ].join(''); return messages; });
<<<<<<< ======= '/common/sframe-common.js', '/common/media-tag.js', >>>>>>> '/common/media-tag.js', <<<<<<< ======= if (!readOnly && !initializing) { userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf } else if (readOnly) { userDocStateDom.removeAttribute("contenteditable"); } restoreMediaTags(userDocStateDom); >>>>>>> restoreMediaTags(userDocStateDom); <<<<<<< if (framework.isReadOnly()) { ======= displayMediaTags(inner); if (readOnly) { >>>>>>> displayMediaTags(inner); if (framework.isReadOnly()) { <<<<<<< }); ======= }; var stringifyDOM = module.stringifyDOM = function (dom) { var hjson = Hyperjson.fromDOM(dom, isNotMagicLine, hjsonFilters); hjson[3] = { metadata: metadataMgr.getMetadataLazy() }; /*hjson[3] = { TODO users: UserList.userData, defaultTitle: Title.defaultTitle, type: 'pad' } }; if (!initializing) { hjson[3].metadata.title = Title.title; } else if (Cryptpad.initialName && !hjson[3].metadata.title) { hjson[3].metadata.title = Cryptpad.initialName; }*/ return stringify(hjson); }; var realtimeOptions = { readOnly: readOnly, // really basic operational transform transformFunction : JsonOT.validate, // cryptpad debug logging (default is 1) // logLevel: 0, validateContent: function (content) { try { JSON.parse(content); return true; } catch (e) { console.log("Failed to parse, rejecting patch"); return false; } } }; var setHistory = function (bool, update) { isHistoryMode = bool; setEditable(!bool); if (!bool && update) { realtimeOptions.onRemote(); } }; realtimeOptions.onRemote = function () { if (initializing) { return; } if (isHistoryMode) { return; } var oldShjson = stringifyDOM(inner); var shjson = module.realtime.getUserDoc(); // remember where the cursor is cursor.update(); // Update the user list (metadata) from the hyperjson // TODO Metadata.update(shjson); var newInner = JSON.parse(shjson); var newSInner; if (newInner.length > 2) { newSInner = stringify(newInner[2]); } if (newInner[3]) { metadataMgr.updateMetadata(newInner[3].metadata); } // build a dom from HJSON, diff, and patch the editor applyHjson(shjson); if (!readOnly) { var shjson2 = stringifyDOM(inner); // TODO //shjson = JSON.stringify(JSON.parse(shjson).slice(0,3)); if (shjson2 !== shjson) { console.error("shjson2 !== shjson"); module.patchText(shjson2); /* pushing back over the wire is necessary, but it can result in a feedback loop, which we call a browser fight */ if (module.logFights) { // what changed? var op = TextPatcher.diff(shjson, shjson2); // log the changes TextPatcher.log(shjson, op); var sop = JSON.stringify(TextPatcher.format(shjson, op)); var index = module.fights.indexOf(sop); if (index === -1) { module.fights.push(sop); console.log("Found a new type of browser disagreement"); console.log("You can inspect the list in your " + "console at `REALTIME_MODULE.fights`"); console.log(module.fights); } else { console.log("Encountered a known browser disagreement: " + "available at `REALTIME_MODULE.fights[%s]`", index); } } } } // Notify only when the content has changed, not when someone has joined/left var oldSInner = stringify(JSON.parse(oldShjson)[2]); if (newSInner && newSInner !== oldSInner) { common.notify(); } }; var exportFile = function () { var html = getHTML(inner); var suggestion = Title.suggestTitle('cryptpad-document'); Cryptpad.prompt(Messages.exportPrompt, Cryptpad.fixFileName(suggestion) + '.html', function (filename) { if (!(typeof(filename) === 'string' && filename)) { return; } var blob = new Blob([html], {type: "text/html;charset=utf-8"}); saveAs(blob, filename); }); }; var importFile = function (content) { var shjson = stringify(Hyperjson.fromDOM(domFromHTML(content).body)); applyHjson(shjson); realtimeOptions.onLocal(); }; realtimeOptions.onInit = function (info) { readOnly = metadataMgr.getPrivateData().readOnly; var titleCfg = { getHeadingText: getHeadingText }; Title = common.createTitle(titleCfg, realtimeOptions.onLocal); var configTb = { displayed: ['userlist', 'title', 'useradmin', 'spinner', 'newpad', 'share', 'limit'], title: Title.getTitleConfig(), metadataMgr: metadataMgr, readOnly: readOnly, ifrw: window, realtime: info.realtime, common: Cryptpad, sfCommon: common, $container: $bar, $contentContainer: $('#cke_1_contents'), }; toolbar = info.realtime.toolbar = Toolbar.create(configTb); Title.setToolbar(toolbar); var $rightside = toolbar.$rightside; var $drawer = toolbar.$drawer; var src = 'less!/customize/src/less/toolbar.less'; require([ src ], function () { var $html = $bar.closest('html'); $html .find('head style[data-original-src="' + src.replace(/less!/, '') + '"]') .appendTo($html.find('head')); }); $bar.find('#cke_1_toolbar_collapser').hide(); if (!readOnly) { // Expand / collapse the toolbar var $collapse = common.createButton(null, true); $collapse.removeClass('fa-question'); var updateIcon = function (isVisible) { $collapse.removeClass('fa-caret-down').removeClass('fa-caret-up'); if (!isVisible) { if (!initializing) { common.feedback('HIDETOOLBAR_PAD'); } $collapse.addClass('fa-caret-down'); } else { if (!initializing) { common.feedback('SHOWTOOLBAR_PAD'); } $collapse.addClass('fa-caret-up'); } }; updateIcon(); $collapse.click(function () { $(window).trigger('resize'); $('.cke_toolbox_main').toggle(); $(window).trigger('cryptpad-ck-toolbar'); var isVisible = $bar.find('.cke_toolbox_main').is(':visible'); common.setAttribute(['pad', 'showToolbar'], isVisible); updateIcon(isVisible); }); common.getAttribute(['pad', 'showToolbar'], function (err, data) { if (typeof(data) === "undefined" || data) { $('.cke_toolbox_main').show(); updateIcon(true); return; } $('.cke_toolbox_main').hide(); updateIcon(false); }); $rightside.append($collapse); } else { $('.cke_toolbox_main').hide(); } /* add a history button */ var histConfig = { onLocal: realtimeOptions.onLocal, onRemote: realtimeOptions.onRemote, setHistory: setHistory, applyVal: function (val) { applyHjson(val || '["BODY",{},[]]'); }, $toolbar: $bar }; var $hist = common.createButton('history', true, {histConfig: histConfig}); $drawer.append($hist); if (!metadataMgr.getPrivateData().isTemplate) { var templateObj = { rt: info.realtime, getTitle: function () { return metadataMgr.getMetadata().title; } }; var $templateButton = common.createButton('template', true, templateObj); $rightside.append($templateButton); } /* add an export button */ var $export = common.createButton('export', true, {}, exportFile); $drawer.append($export); >>>>>>> }); <<<<<<< ======= if (module.realtime !== info.realtime) { module.patchText = TextPatcher.create({ realtime: info.realtime, //logging: true, }); } module.realtime = info.realtime; var shjson = module.realtime.getUserDoc(); var newPad = false; if (shjson === '') { newPad = true; } if (!newPad) { if (shjson[0] !== '[') { var errorText = Messages.typeError; Cryptpad.errorLoadingScreen(errorText); throw new Error(errorText); } applyHjson(shjson); var parsed = JSON.parse(shjson); if (parsed[3] && parsed[3].metadata) { metadataMgr.updateMetadata(parsed[3].metadata); } if (!readOnly) { var shjson2 = stringifyDOM(inner); var hjson2 = JSON.parse(shjson2).slice(0,3); var hjson = JSON.parse(shjson).slice(0,3); if (stringify(hjson2) !== stringify(hjson)) { console.log('err'); console.error("shjson2 !== shjson"); console.log(stringify(hjson2)); console.log(stringify(hjson)); Cryptpad.errorLoadingScreen(Messages.wrongApp); throw new Error(); } } } else { Title.updateTitle(Cryptpad.initialName || Title.defaultTitle); documentBody.innerHTML = Messages.initialState; } Cryptpad.removeLoadingScreen(emitResize); setEditable(!readOnly); initializing = false; if (readOnly) { return; } if (newPad) { common.openTemplatePicker(); } onLocal(); var fmConfig = { ckeditor: editor, body: $('body'), onUploaded: function (ev, data) { var parsed = Cryptpad.parsePadUrl(data.url); var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel); var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName; var mt = '<media-tag contenteditable="false" src="' + src + '" data-crypto-key="cryptpad:' + parsed.hashData.key + '" tabindex="1"></media-tag>'; editor.insertElement(window.CKEDITOR.dom.element.createFromHtml(mt)); } }; window.APP.FM = common.createFileManager(fmConfig); >>>>>>> <<<<<<< }); ======= }; realtimeOptions.onConnectionChange = function (info) { setEditable(info.state); if (info.state) { initializing = true; Cryptpad.findOKButton().click(); } else { Cryptpad.alert(Messages.common_connectionLost, undefined, true); } }; realtimeOptions.onError = onConnectError; onLocal = realtimeOptions.onLocal = function () { console.log('onlocal'); if (initializing) { return; } if (isHistoryMode) { return; } if (readOnly) { return; } // stringify the json and send it into chainpad var shjson = stringifyDOM(inner); displayMediaTags(inner); >>>>>>> var fmConfig = { ckeditor: editor, body: $('body'), onUploaded: function (ev, data) { var parsed = Cryptpad.parsePadUrl(data.url); var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel); var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName; var mt = '<media-tag contenteditable="false" src="' + src + '" data-crypto-key="cryptpad:' + parsed.hashData.key + '" tabindex="1"></media-tag>'; editor.insertElement(window.CKEDITOR.dom.element.createFromHtml(mt)); } }; window.APP.FM = framework._.sfCommon.createFileManager(fmConfig); }); <<<<<<< }).nThen(function (waitFor) { Framework.create({}, waitFor(function (fw) { window.APP.framework = framework = fw; })); ======= }).nThen(function (/*waitFor*/) { editor.plugins.mediatag.translations = { title: Messages.pad_mediatagTitle, width: Messages.pad_mediatagWidth, height: Messages.pad_mediatagHeight }; /*if (Ckeditor.env.safari) { var fixIframe = function () { $('iframe.cke_wysiwyg_frame').height($('#cke_1_contents').height()); }; $(window).resize(fixIframe); fixIframe(); }*/ >>>>>>> }).nThen(function (waitFor) { Framework.create({}, waitFor(function (fw) { window.APP.framework = framework = fw; })); editor.plugins.mediatag.translations = { title: Messages.pad_mediatagTitle, width: Messages.pad_mediatagWidth, height: Messages.pad_mediatagHeight };
<<<<<<< data[attr] = clone(value); ======= data[attr] = value; cb(null); >>>>>>> data[attr] = clone(value); cb(null);
<<<<<<< out.button_newoodoc = 'Nouveau texte OnlyOffice'; out.button_newooslide = 'Nouvelle présentation OnlyOffice'; out.button_newoocell = 'Nouveau tableur OnlyOffice'; ======= out.button_newkanban = 'Nouveau kanban'; >>>>>>> out.button_newoodoc = 'Nouveau texte OnlyOffice'; out.button_newooslide = 'Nouvelle présentation OnlyOffice'; out.button_newoocell = 'Nouveau tableur OnlyOffice'; out.button_newkanban = 'Nouveau kanban';
<<<<<<< export { default as IconMap } from './IconMap/IconMap'; ======= export { default as PathMap } from './PathMap/PathMap'; >>>>>>> export { default as PathMap } from './PathMap/PathMap'; export { default as IconMap } from './IconMap/IconMap';
<<<<<<< // 1.7.0 - Hodag out.comingSoon = "Próximamente..."; // "Coming soon..." out.newVersion = ["<b>CryptPad ha sido actualizado!</b>", "Puedes ver lo que ha cambiada aquí (en inglés):", "<a href=\"https://github.com/xwiki-labs/cryptpad/releases/tag/{0}\" target=\"_blank\">Notas de versión para CryptPad {0}</a>"].join("<br>"); out.pinLimitReachedAlert = ["Has llegado a tu limite de espacio. Nuevos pads no serán guardados en tu CryptDrive.", "Puedes eliminar pads de tu CryptDrive o <a href=\"https://accounts.cryptpad.fr/#!on={0}\" target=\"_blank\">suscribirte a una oferta premium</a> para obtener más espacio."].join("<br>"); out.pinLimitReachedAlertNoAccounts = "Has llegado a tu limite de espacio"; out.pinAboveLimitAlert = "Desde esta versión, ponemos un limite de 50MB a las cuentas gratís y estás usando {0}. Tendrás que eliminar unos pads o suscribirte en <a href=\"https://accounts.cryptpad.fr/#!on={1}\" target=\"_blank\">accounts.cryptpad.fr</a>. Tu contribución nos ayuda a mejorar CryptPad y extender el Zero Knowledge. Por favor contacta <a href=\"https://accounts.cryptpad.fr/#/support\" target=\"_blank\">el soporte</a> si tienes preguntas adicionales."; out.previewButtonTitle = "Mostrar/esconder la vista previa Markdown"; out.fm_info_trash = "Vacía tu papelera para liberar espaci en tu CryptDrive."; out.fm_info_anonymous = "No estás conectado, así que estos pads pueden ser borrados (<a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">¿por qué?</a>). <a href=\"/register/\">Registrate</a> o <a href=\"/login/\">Inicia sesión</a> para asegurarlos."; out.fm_alert_anonymous = "Hola, estás usando CryptPad anónimamente. Está bien, pero tus pads pueden ser borrados después de un périodo de inactividad. Hemos desactivado funciones avanzadas de CryptDrive para usuarios anónimos porque queremos ser claros que no es un lugar seguro para almacenar cosas. Puedes <a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">leer este articulo</a> (en inglés) sobre por qué hacemos esto y por qué deberías <a href=\"/register/\">Registrarte</a> e <a href=\"/login/\">Iniciar sesión</a>."; out.fm_error_cantPin = "Error del servidor. Por favor, recarga la página e intentalo de nuevo."; out.upload_notEnoughSpace = "No tienes suficiente espacio para este archivo en tu CryptDrive"; out.upload_tooLarge = "Este archivo supera el límite de carga."; out.upload_choose = "Escoge un archivo"; out.upload_pending = "Esperando"; out.upload_cancelled = "Cancelado"; out.upload_name = "Nombre"; out.upload_size = "Tamaño"; out.upload_progress = "Progreso"; out.download_button = "Descifrar y descargar"; out.warn_notPinned = "Este pad no está en ningun CryptDrive. Expirará después de 3 meses. <a href='/about.html#pinning'>Acerca de...</a>"; ======= out.poll_remove = "Quitar"; out.poll_edit = "Editar"; out.poll_locked = "Cerrado"; out.poll_unlocked = "Abierto"; >>>>>>> // 1.7.0 - Hodag out.comingSoon = "Próximamente..."; // "Coming soon..." out.newVersion = ["<b>CryptPad ha sido actualizado!</b>", "Puedes ver lo que ha cambiada aquí (en inglés):", "<a href=\"https://github.com/xwiki-labs/cryptpad/releases/tag/{0}\" target=\"_blank\">Notas de versión para CryptPad {0}</a>"].join("<br>"); out.pinLimitReachedAlert = ["Has llegado a tu limite de espacio. Nuevos pads no serán guardados en tu CryptDrive.", "Puedes eliminar pads de tu CryptDrive o <a href=\"https://accounts.cryptpad.fr/#!on={0}\" target=\"_blank\">suscribirte a una oferta premium</a> para obtener más espacio."].join("<br>"); out.pinLimitReachedAlertNoAccounts = "Has llegado a tu limite de espacio"; out.pinAboveLimitAlert = "Desde esta versión, ponemos un limite de 50MB a las cuentas gratís y estás usando {0}. Tendrás que eliminar unos pads o suscribirte en <a href=\"https://accounts.cryptpad.fr/#!on={1}\" target=\"_blank\">accounts.cryptpad.fr</a>. Tu contribución nos ayuda a mejorar CryptPad y extender el Zero Knowledge. Por favor contacta <a href=\"https://accounts.cryptpad.fr/#/support\" target=\"_blank\">el soporte</a> si tienes preguntas adicionales."; out.previewButtonTitle = "Mostrar/esconder la vista previa Markdown"; out.fm_info_trash = "Vacía tu papelera para liberar espaci en tu CryptDrive."; out.fm_info_anonymous = "No estás conectado, así que estos pads pueden ser borrados (<a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">¿por qué?</a>). <a href=\"/register/\">Registrate</a> o <a href=\"/login/\">Inicia sesión</a> para asegurarlos."; out.fm_alert_anonymous = "Hola, estás usando CryptPad anónimamente. Está bien, pero tus pads pueden ser borrados después de un périodo de inactividad. Hemos desactivado funciones avanzadas de CryptDrive para usuarios anónimos porque queremos ser claros que no es un lugar seguro para almacenar cosas. Puedes <a href=\"https://blog.cryptpad.fr/2017/05/17/You-gotta-log-in/\" target=\"_blank\">leer este articulo</a> (en inglés) sobre por qué hacemos esto y por qué deberías <a href=\"/register/\">Registrarte</a> e <a href=\"/login/\">Iniciar sesión</a>."; out.fm_error_cantPin = "Error del servidor. Por favor, recarga la página e intentalo de nuevo."; out.upload_notEnoughSpace = "No tienes suficiente espacio para este archivo en tu CryptDrive"; out.upload_tooLarge = "Este archivo supera el límite de carga."; out.upload_choose = "Escoge un archivo"; out.upload_pending = "Esperando"; out.upload_cancelled = "Cancelado"; out.upload_name = "Nombre"; out.upload_size = "Tamaño"; out.upload_progress = "Progreso"; out.download_button = "Descifrar y descargar"; out.warn_notPinned = "Este pad no está en ningun CryptDrive. Expirará después de 3 meses. <a href='/about.html#pinning'>Acerca de...</a>"; out.poll_remove = "Quitar"; out.poll_edit = "Editar"; out.poll_locked = "Cerrado"; out.poll_unlocked = "Abierto";
<<<<<<< var id; //= Math.floor(Math.random()*100000); ======= /* jshint ignore:start */ var id = Math.floor(Math.random()*100000); >>>>>>> /* jshint ignore:start */ var id; //= Math.floor(Math.random()*100000);
<<<<<<< href: data.href, password: newPass ======= href: data.href || data.roHref, password: $(newPassword).find('input').val() >>>>>>> href: data.href || data.roHref, password: newPass <<<<<<< common.gotoURL(hasPassword && newPass ? undefined : data.href); ======= common.gotoURL(hasPassword ? undefined : (data.href || data.roHref)); >>>>>>> common.gotoURL(hasPassword && newPass ? undefined : (data.href || data.roHref)); <<<<<<< common.gotoURL(hasPassword && newPass ? undefined : data.href); ======= common.gotoURL(hasPassword ? undefined : (data.href || data.roHref)); >>>>>>> common.gotoURL(hasPassword && newPass ? undefined : (data.href || data.roHref));
<<<<<<< // New support message from the admins handlers['SUPPORT_MESSAGE'] = function (common, data) { var content = data.content; content.getFormatText = function () { return Messages.support_notification; }; content.handler = function () { common.openURL('/support/'); defaultDismiss(common, data)(); }; if (!content.archived) { content.dismissHandler = defaultDismiss(common, data); } }; ======= handlers['REQUEST_PAD_ACCESS'] = function (common, data) { var content = data.content; var msg = content.msg; // Check authenticity if (msg.author !== msg.content.user.curvePublic) { return; } // Display the notification content.getFormatText = function () { return 'Edit access request: ' + msg.content.title + ' - ' + msg.content.user.displayName; }; // XXX // if not archived, add handlers content.handler = function () { UI.confirm("Give edit rights?", function (yes) { if (!yes) { return; } common.getSframeChannel().event('EV_GIVE_ACCESS', { channel: msg.content.channel, user: msg.content.user }); defaultDismiss(common, data)(); }); }; if (!content.archived) { content.dismissHandler = defaultDismiss(common, data); } }; handlers['GIVE_PAD_ACCESS'] = function (common, data) { var content = data.content; var msg = content.msg; // Check authenticity if (msg.author !== msg.content.user.curvePublic) { return; } if (!msg.content.href) { return; } // Display the notification content.getFormatText = function () { return 'Edit access received: ' + msg.content.title + ' from ' + msg.content.user.displayName; }; // XXX // if not archived, add handlers content.handler = function () { common.openURL(msg.content.href); defaultDismiss(common, data)(); }; }; >>>>>>> // New support message from the admins handlers['SUPPORT_MESSAGE'] = function (common, data) { var content = data.content; content.getFormatText = function () { return Messages.support_notification; }; content.handler = function () { common.openURL('/support/'); defaultDismiss(common, data)(); }; }; handlers['REQUEST_PAD_ACCESS'] = function (common, data) { var content = data.content; var msg = content.msg; // Check authenticity if (msg.author !== msg.content.user.curvePublic) { return; } // Display the notification content.getFormatText = function () { return 'Edit access request: ' + msg.content.title + ' - ' + msg.content.user.displayName; }; // XXX // if not archived, add handlers content.handler = function () { UI.confirm("Give edit rights?", function (yes) { if (!yes) { return; } common.getSframeChannel().event('EV_GIVE_ACCESS', { channel: msg.content.channel, user: msg.content.user }); defaultDismiss(common, data)(); }); }; if (!content.archived) { content.dismissHandler = defaultDismiss(common, data); } }; handlers['GIVE_PAD_ACCESS'] = function (common, data) { var content = data.content; var msg = content.msg; // Check authenticity if (msg.author !== msg.content.user.curvePublic) { return; } if (!msg.content.href) { return; } // Display the notification content.getFormatText = function () { return 'Edit access received: ' + msg.content.title + ' from ' + msg.content.user.displayName; }; // XXX // if not archived, add handlers content.handler = function () { common.openURL(msg.content.href); defaultDismiss(common, data)(); }; };
<<<<<<< '/bower_components/chainpad/chainpad.dist.js', ======= '/common/common-interface.js', '/customize/messages.js', >>>>>>> '/bower_components/chainpad/chainpad.dist.js', '/common/common-interface.js', '/customize/messages.js', <<<<<<< ChainPad, ======= UI, Messages, >>>>>>> ChainPad, UI, Messages,
<<<<<<< migrateAttributes(el, id, parsed); if ((loggedIn || config.testMode) && rootFiles.indexOf(id) === -1) { ======= if ((Cryptpad.isLoggedIn() || config.testMode) && rootFiles.indexOf(id) === -1) { >>>>>>> if ((loggedIn || config.testMode) && rootFiles.indexOf(id) === -1) {
<<<<<<< config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'kanban', 'whiteboard', 'oodoc', 'ooslide', 'oocell', 'file', 'todo', 'contacts']; config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'oocell']; ======= config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'kanban', 'whiteboard', 'file', 'todo', 'contacts']; /* The registered only types are apps restricted to registered users. * You should never remove apps from this list unless you know what you're doing. The apps * listed here by default can't work without a user account. * You can however add apps to this list. The new apps won't be visible for unregistered * users and these users will be redirected to the login page if they still try to access * the app */ config.registeredOnlyTypes = ['file', 'contacts']; >>>>>>> config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'kanban', 'whiteboard', 'oodoc', 'ooslide', 'oocell', 'file', 'todo', 'contacts']; /* The registered only types are apps restricted to registered users. * You should never remove apps from this list unless you know what you're doing. The apps * listed here by default can't work without a user account. * You can however add apps to this list. The new apps won't be visible for unregistered * users and these users will be redirected to the login page if they still try to access * the app */ config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'oocell']; <<<<<<< file: 'fa-file-text-o', pad: 'fa-file-word-o', code: 'fa-file-code-o', slide: 'fa-file-powerpoint-o', poll: 'fa-calendar', whiteboard: 'fa-paint-brush', todo: 'fa-tasks', contacts: 'fa-users', oodoc: 'fa-file-word-o', ooslide: 'fa-file-powerpoint-o', oocell: 'fa-file-excel-o', kanban: 'fa-columns', ======= file: 'cptools-file', fileupload: 'cptools-file-upload', pad: 'cptools-pad', code: 'cptools-code', slide: 'cptools-slide', poll: 'cptools-poll', whiteboard: 'cptools-whiteboard', todo: 'cptools-todo', contacts: 'cptools-contacts', kanban: 'cptools-kanban', >>>>>>> file: 'cptools-file', fileupload: 'cptools-file-upload', pad: 'cptools-pad', code: 'cptools-code', slide: 'cptools-slide', poll: 'cptools-poll', whiteboard: 'cptools-whiteboard', todo: 'cptools-todo', contacts: 'cptools-contacts', kanban: 'cptools-kanban', oodoc: 'fa-file-word-o', ooslide: 'fa-file-powerpoint-o', oocell: 'fa-file-excel-o',
<<<<<<< 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', ======= 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/customize/src/less/loading.less', >>>>>>> 'less!/bower_components/components-font-awesome/css/font-awesome.min.css',
<<<<<<< storiesOf('Welcome', module).add('to Storybook', () => ( <Welcome showApp={linkTo('Button')} /> )); ======= storiesOf('Welcome', module) .addDecorator(checkA11y) .add('to Storybook', () => ( <Welcome showApp={linkTo('Button')} /> )); >>>>>>> storiesOf('Welcome', module) .addDecorator(checkA11y) .add('to Storybook', () => ( <Welcome showApp={linkTo('Button')} /> )); <<<<<<< ScatterPlotStory(); ======= BarChartStory(); lineChartStory(); >>>>>>> ScatterPlotStory(); BarChartStory(); lineChartStory();
<<<<<<< CivicCardLayoutVisualizationOnly, CivicCardLayoutSideBySide, RadioButtonGroup ======= CivicCardLayoutVisualizationOnly, CivicCardLayoutFullWithDescriptions >>>>>>> CivicCardLayoutVisualizationOnly, CivicCardLayoutSideBySide, RadioButtonGroup CivicCardLayoutFullWithDescriptions
<<<<<<< // const sourceMappingURL = sourceMapBaseUrl && (f => `${sourceMapBaseUrl}/${f.relative}.map`); return function (cb) { var jsFilter = filter('**/*.js', { restore: true }); var cssFilter = filter('**/*.css', { restore: true }); ======= const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined; return cb => { const jsFilter = filter('**/*.js', { restore: true }); const cssFilter = filter('**/*.css', { restore: true }); >>>>>>> // const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined; return cb => { const jsFilter = filter('**/*.js', { restore: true }); const cssFilter = filter('**/*.css', { restore: true }); <<<<<<< // sourceMappingURL, sourceRoot: null, ======= sourceMappingURL, sourceRoot: undefined, >>>>>>> // sourceMappingURL, sourceRoot: undefined,
<<<<<<< copyEmoji: "native", emojiMart: {}, emojiSearch: true }); ======= pickerResult: { automaticInsert: true, emojiCopy: true, // emojiCopyOnlyFallback MUST NOT be true, as optional clipboardWrite // permission is required for this // (As it leads to an error, that may happen in reality with sync, however, // it is anyway, handled in the options, but not really nice to see it // directly after installing the add-on) emojiCopyOnlyFallback: false, resultType: "native", showConfirmationMessage: true, closePopup: true, }, emojiMart: {} }; // freeze the inner objects, this is strongly recommend Object.values(defaultSettings).map(Object.freeze); /** * Export the default settings to be used. * * @public * @const * @type {Object} */ export const DEFAULT_SETTINGS = Object.freeze(defaultSettings); >>>>>>> pickerResult: { automaticInsert: true, emojiCopy: true, // emojiCopyOnlyFallback MUST NOT be true, as optional clipboardWrite // permission is required for this // (As it leads to an error, that may happen in reality with sync, however, // it is anyway, handled in the options, but not really nice to see it // directly after installing the add-on) emojiCopyOnlyFallback: false, resultType: "native", showConfirmationMessage: true, closePopup: true, }, emojiSearch: true, emojiMart: {} }; // freeze the inner objects, this is strongly recommend Object.values(defaultSettings).map(Object.freeze); /** * Export the default settings to be used. * * @public * @const * @type {Object} */ export const DEFAULT_SETTINGS = Object.freeze(defaultSettings);
<<<<<<< export { default as CivicSandboxMap } from './CivicSandboxMap/CivicSandboxMap'; export { default as PackageSelectorBox } from './PackageSelectorBox/PackageSelectorBox'; ======= export { default as CivicSandboxMap } from './CivicSandboxMap/CivicSandboxMap'; export { default as Collapsable } from './Collapsable/Collapsable'; >>>>>>> export { default as CivicSandboxMap } from './CivicSandboxMap/CivicSandboxMap'; export { default as PackageSelectorBox } from './PackageSelectorBox/PackageSelectorBox'; export { default as Collapsable } from './Collapsable/Collapsable';
<<<<<<< const { activeMarket, authToken, getLastVersion, currentPage, getSettings, } = this.props ======= const { activeMarket, authToken, getLastVersion, currentPage, } = this.props >>>>>>> const { activeMarket, authToken, getLastVersion, currentPage, getSettings, } = this.props <<<<<<< <Route path='/settings' render={() => ( <SettingsPage /> )} /> ======= >>>>>>> <Route path='/settings' render={() => ( <SettingsPage /> )} />
<<<<<<< border-top: 15px; border-top-style: solid; border-top-color: #EE495C; ======= ::before { content: ''; width: 100%; border-bottom: solid 8px #ef495c; position: absolute; left: 0; top: 0px; z-index: 1; } @media (max-width: 1024px) { max-width: 270px; right: 6%; } @media (max-width: 850px) { position: relative; max-width: none; width: 100%; top: 0; right: 0; box-sizing: border-box; } `; const iconWrapper = css` display: inline-block; width: 100px; margin: 0; margin-right: 24px; text-align: center; >>>>>>> ::before { content: ''; width: 100%; border-bottom: solid 8px #ef495c; position: absolute; left: 0; top: 0px; z-index: 1; } @media (max-width: 1024px) { max-width: 270px; right: 6%; } @media (max-width: 850px) { position: relative; max-width: none; width: 100%; top: 0; right: 0; box-sizing: border-box; } <<<<<<< <div className={missionStatementTitle}>Making Data Human</div> <div className={missionStatement}> CIVIC is a platform to empower data in a way that’s fundementally built to serve people. We’re reimagining how to make information actionable through visual models, open standards, and creative frameworks that harness human collaboration at scale. </div> <img src={cityPath} width="100%" /> ======= <div className={missionStatementTitle}>{'Making Data Human'}</div> <p className={missionStatement}>{`CIVIC is a powerful open platform using data in way that’s fundamentally built to serve people.`}</p> <p className={missionStatement}>{`We’re reimagining how to make information actionable through visual models, open standards, and creative frameworks that harness human collaboration at scale.`}</p> <div className={ctaStyle}><a href="#aboutCivic">Get started with your city &rsaquo;</a></div> <div className={citySkyline}><img src={require(`../../assets/cities/portland.png`)} width="100%" /></div> >>>>>>> <div className={missionStatementTitle}>{'Making Data Human'}</div> <p className={missionStatement}>{`CIVIC is a powerful open platform using data in way that’s fundamentally built to serve people.`}</p> <p className={missionStatement}>{`We’re reimagining how to make information actionable through visual models, open standards, and creative frameworks that harness human collaboration at scale.`}</p> <div className={ctaStyle}><a href="#aboutCivic">Get started with your city &rsaquo;</a></div> <div className={citySkyline}><img src={ cityPath} width="100%" /></div> <<<<<<< <h2 className={searchTitle}>Explore CIVIC Stories</h2> <h3 className={searchSubTitle}>Discover data near you</h3> ======= <div className={searchTitle}><strong>Explore CIVIC stories</strong></div> <div className={searchSubTitle}><em>Discover data near you.</em></div> >>>>>>> <div className={searchTitle}><strong>Explore CIVIC stories</strong></div> <div className={searchSubTitle}><em>Discover data near you.</em></div> <<<<<<< ======= class DataList extends React.Component { render(){ const slugify = (text) => { return text.toString().toLowerCase() .replace(/\s+/g, '-') // Replace spaces with - .replace(/[^\w\-]+/g, '') // Remove all non-word chars .replace(/\-\-+/g, '-') // Replace multiple - with single - .replace(/^-+/, '') // Trim - from start of text .replace(/-+$/, ''); // Trim - from end of text } const countryImage = this.props.repos.city ? <img src={require(`../../assets/country/usa.svg`)} width="100%" /> : <img src={require(`../../assets/country/usa.svg`)} width="100%" /> const stateImage = this.props.repos.state ? <img src={require(`../../assets/state/${slugify(this.props.repos.state)}.svg`)} width="100%" /> : <img src={require(`../../assets/state/or.svg`)} width="100%" /> const cityImage = this.props.repos.city ? <img src={require(`../../assets/cities/${slugify(this.props.repos.city)}.png`)} width="100%" /> : <img src={require(`../../assets/cities/portland.png`)} width="100%" /> const localImage = this.props.repos.city ? <img src={require(`../../assets/local/local.svg`)} width="70%" /> : <img src={require(`../../assets/local/local.svg`)} width="70%" /> const ctaMessage = this.props.repos.city === 'PORTLAND' ? (<div className={locationResult}> {`${this.props.repos.city}`} </div>) : (<div className={locationResult}> {`There's no CIVIC data for ${this.props.repos.city} yet! `}<span className={whyStyle}><a href="#aboutCivic">Why?</a></span> </div>) console.log(`${this.props.repos.city}`) return ( <div className={cardsWrapper}> <div className={card}> <div className={iconWrapper}> { countryImage } </div> <div className={cardTextWrapper}> <span className={eyebrowStyle}>National</span> <div className={locationTitle}>{this.props.repos.country ? this.props.repos.country : "?"}</div> </div> </div> <div className={card}> <div className={iconWrapper}> {stateImage} </div> <div className={cardTextWrapper}> <span className={eyebrowStyle}>State</span> <div className={locationTitle}>{this.props.repos.state ? this.props.repos.state : "?"}</div> </div> </div> <div className={card}> <div className={iconWrapper}> { localImage } </div> <div className={cardTextWrapper}> <span className={eyebrowStyle}>Local</span> <div className={locationTitle}>{this.props.repos.city ? ctaMessage : "Portland Data"}</div> </div> </div> </div> ) } } DataList.defaultProps = { repos: {} }; >>>>>>>
<<<<<<< setFiltredValueWithKey, ======= recvNotification, >>>>>>> setFiltredValueWithKey, recvNotification,
<<<<<<< let safeImageProps = {...StyleSheet.flatten(image.props.style)}; delete safeImageProps.tintColor; delete safeImageProps.overflow; delete safeImageProps.resizeMode; ======= // Get rid of any unused styles to avoid warnings let imageStyle = StyleSheet.flatten(image.props.style); delete imageStyle.resizeMode; >>>>>>> let safeImageProps = {...StyleSheet.flatten(image.props.style)}; delete safeImageProps.tintColor; delete safeImageProps.resizeMode; <<<<<<< <View style={[safeImageProps, styles.placeholder, this.props.placeholderStyle]}> ======= <View style={[imageStyle, styles.placeholder, this.props.placeholderStyle]}> >>>>>>> <View style={[safeImageProps, styles.placeholder, this.props.placeholderStyle]}>
<<<<<<< it('throws when <IntlProvider> is missing from ancestry', () => { const FormattedMessage = mockContext(null); expect(() => shallowDeep(<FormattedMessage />, 2)).toThrow( ======= it('throws when <IntlProvider> is missing from ancestry and there is no defaultMessage', () => { expect(() => renderer.render(<FormattedMessage />)).toThrow( >>>>>>> it('throws when <IntlProvider> is missing from ancestry and there is no defaultMessage', () => { const FormattedMessage = mockContext(null); expect(() => shallowDeep(<FormattedMessage />, 2)).toThrow( <<<<<<< it('accepts `tagName` prop', () => { const FormattedMessage = mockContext(intl); ======= it('accepts string as `tagName` prop', () => { const {intl} = intlProvider.getChildContext(); >>>>>>> it('accepts string as `tagName` prop', () => { const FormattedMessage = mockContext(intl);
<<<<<<< import PropTypes from "prop-types"; import * as d3 from "d3"; ======= import { scaleQuantize, extent, format } from "d3"; >>>>>>> import PropTypes from "prop-types"; import { scaleQuantize, extent, format } from "d3"; <<<<<<< ======= const createEqualBins = (data, color, getPropValue) => { const scale = scaleQuantize() .domain(extent(data.slide_data.features, getPropValue)) .range(color) .nice(); return scale; }; >>>>>>> const createEqualBins = (data, color, getPropValue) => { const scale = scaleQuantize() .domain(extent(data.slide_data.features, getPropValue)) .range(color) .nice(); return scale; };
<<<<<<< ======= import pullQuoteStory from './PullQuote.story'; import screenGridMapStory from './ScreenGridMap.story'; import pathMapStory from './PathMap.story'; import iconMapStory from './IconMap.story'; import boundaryMapStory from './BoundaryMap.story'; import { checkA11y } from '@storybook/addon-a11y'; >>>>>>> import pullQuoteStory from './PullQuote.story'; import screenGridMapStory from './ScreenGridMap.story'; import pathMapStory from './PathMap.story'; import iconMapStory from './IconMap.story'; import boundaryMapStory from './BoundaryMap.story'; import { checkA11y } from '@storybook/addon-a11y'; <<<<<<< scatterPlotMapStory(); dataTable(); ======= scatterPlotMapStory(); pullQuoteStory(); screenGridMapStory(); pathMapStory(); iconMapStory(); mapOverlayStory(); hexOverlayStory(); boundaryMapStory(); >>>>>>> scatterPlotMapStory(); dataTable(); pullQuoteStory(); screenGridMapStory(); pathMapStory(); iconMapStory(); mapOverlayStory(); hexOverlayStory(); boundaryMapStory();
<<<<<<< import "../assets/constants.css"; ======= import { SSL_OP_TLS_BLOCK_PADDING_BUG } from 'constants' import '@hackoregon/component-library/assets/constants.css' >>>>>>> import "../assets/constants.css"; <<<<<<< // The display area for components main: { backgroundColor: "white", margin: 15, maxWidth: 800 }, // Use CSS grid to center UI components in the Storybook display area storyGrid: { display: "grid", gridTemplateColumns: "1fr 2fr 1fr", gridTemplateRows: "1fr 1fr 1fr", gridGap: "10px" }, storyGridItem: { gridRow: 2, gridColumn: 2, alignSelf: "center", justifyContent: "center" }, // Show inverted logos on a dark background in the Branding Logos story invertedLogo: { backgroundColor: "#201024", margin: 20, padding: 20 }, logo: { paddingLeft: 20 }, // Display a solid color solidColorSample: { display: "flex" }, // Brand color palette colorBlock: { height: 125, width: 300, marginLeft: 0, marginTop: 10, marginRight: 20, marginBottom: 10 }, // Brand colors (make these global) primaryBkgnd: { backgroundColor: "rgba(34,15,37,1)" }, secondaryBkgnd: { backgroundColor: "rgba(238,73,92,1)" }, tertiaryBkgnd: { backgroundColor: "rgba(114,99,113,1)" }, mediumBkgnd: { backgroundColor: "rgba(170,164,171,1)" }, subduedBkgnd: { backgroundColor: "rgba(243,242,243,1)" }, pinkBkgnd: { backgroundColor: "rgba(220,69,86,1)" }, greenBkgnd: { backgroundColor: "rgba(25,183,170,1)" }, blueBkgnd: { backgroundColor: "rgba(30,98,189,1)" }, purpleBkgnd: { backgroundColor: "rgba(114,29,124,1)" }, yellowBkgnd: { backgroundColor: "rgba(255,178,38,1)" }, // Typography (make these global) dataText: { fontFamily: "Roboto Condensed", fontSize: 12 }, dataFont: { fontFamily: "Roboto Condensed" }, largeParagraph: { fontSize: 16 } }; // eslint-disable-next-line import/prefer-default-export export { storybookStyles }; ======= // The display area for components main: { backgroundColor: 'white', margin: 15, maxWidth: 800, }, // Use CSS grid to center UI components in the Storybook display area storyGrid: { display: 'grid', gridTemplateColumns: '1fr 2fr 1fr', gridTemplateRows: '1fr 1fr 1fr', gridGap: '10px', }, storyGridItem: { gridRow: 2, gridColumn: 2, alignSelf: 'center', justifyContent: 'center', }, // Show inverted logos on a dark background in the Branding Logos story invertedLogo: { backgroundColor: '#201024', margin: 20, padding: 20, }, logo: { paddingLeft: 20, }, // Display a solid color solidColorSample: { display: 'flex', }, // Brand color palette colorBlock: { height: 125, width: 300, marginLeft: 0, marginTop: 10, marginRight: 20, marginBottom: 10, }, // Brand colors (make these global) primaryBkgnd: { backgroundColor: 'rgba(34,15,37,1)', }, secondaryBkgnd: { backgroundColor: 'rgba(238,73,92,1)', }, tertiaryBkgnd: { backgroundColor: 'rgba(114,99,113,1)', }, mediumBkgnd: { backgroundColor: 'rgba(170,164,171,1)', }, subduedBkgnd: { backgroundColor: 'rgba(243,242,243,1)', }, pinkBkgnd: { backgroundColor: 'rgba(220,69,86,1)', }, greenBkgnd: { backgroundColor: 'rgba(25,183,170,1)', }, blueBkgnd: { backgroundColor: 'rgba(30,98,189,1)', }, purpleBkgnd: { backgroundColor: 'rgba(114,29,124,1)', }, yellowBkgnd: { backgroundColor: 'rgba(255,178,38,1)', }, // Typography (make these global) dataText: { fontFamily: 'Roboto Condensed', fontSize: 12, }, dataFont: { fontFamily: 'Roboto Condensed', }, largeParagraph: { fontSize: 16, }, } export { storybookStyles } >>>>>>> // The display area for components main: { backgroundColor: 'white', margin: 15, maxWidth: 800, }, // Use CSS grid to center UI components in the Storybook display area storyGrid: { display: 'grid', gridTemplateColumns: '1fr 2fr 1fr', gridTemplateRows: '1fr 1fr 1fr', gridGap: '10px', }, storyGridItem: { gridRow: 2, gridColumn: 2, alignSelf: 'center', justifyContent: 'center', }, // Show inverted logos on a dark background in the Branding Logos story invertedLogo: { backgroundColor: '#201024', margin: 20, padding: 20, }, logo: { paddingLeft: 20, }, // Display a solid color solidColorSample: { display: 'flex', }, // Brand color palette colorBlock: { height: 125, width: 300, marginLeft: 0, marginTop: 10, marginRight: 20, marginBottom: 10, }, // Brand colors (make these global) primaryBkgnd: { backgroundColor: 'rgba(34,15,37,1)', }, secondaryBkgnd: { backgroundColor: 'rgba(238,73,92,1)', }, tertiaryBkgnd: { backgroundColor: 'rgba(114,99,113,1)', }, mediumBkgnd: { backgroundColor: 'rgba(170,164,171,1)', }, subduedBkgnd: { backgroundColor: 'rgba(243,242,243,1)', }, pinkBkgnd: { backgroundColor: 'rgba(220,69,86,1)', }, greenBkgnd: { backgroundColor: 'rgba(25,183,170,1)', }, blueBkgnd: { backgroundColor: 'rgba(30,98,189,1)', }, purpleBkgnd: { backgroundColor: 'rgba(114,29,124,1)', }, yellowBkgnd: { backgroundColor: 'rgba(255,178,38,1)', }, // Typography (make these global) dataText: { fontFamily: 'Roboto Condensed', fontSize: 12, }, dataFont: { fontFamily: 'Roboto Condensed', }, largeParagraph: { fontSize: 16, }, } // eslint-disable-next-line import/prefer-default-export export { storybookStyles }
<<<<<<< myAppController.controller('ElementHistoryController', function($scope, dataFactory, dataService, _) { ======= myAppController.controller('ElementHistoryController', function ($scope, $window, $timeout, dataFactory, dataService, _) { >>>>>>> myAppController.controller('ElementHistoryController', function ($scope, $window, $timeout, dataFactory, dataService, _) { <<<<<<< dataFactory.getApi('history', '/' + device.id + '?show=24', true).then(function(response) { $scope.widgetHistory.alert = { message: false }; if (!response.data.data.deviceHistory) { ======= dataFactory.getApi('history_get', '?id=' + device.id + '&show='+$scope.widgetHistory.history_steps, true).then(function (response) { $scope.widgetHistory.alert = {message: false}; console.log(response); if (!response.data.history) { >>>>>>> dataFactory.getApi('history_get', '?id=' + device.id + '&show='+$scope.widgetHistory.history_steps, true).then(function (response) { $scope.widgetHistory.alert = { if (!response.data.history) { <<<<<<< $scope.widgetHistory.alert = { message: false }; $scope.widgetHistory.chartData = dataService.getChartData(response.data.data.deviceHistory, $scope.cfg.chart_colors); }, function(error) { ======= $scope.widgetHistory.alert = {message: false}; $scope.widgetHistory.chartData = dataService.getChartData(response.data.history, $scope.cfg.chart_colors); }, function (error) { >>>>>>> $scope.widgetHistory.alert = { $scope.widgetHistory.chartData = dataService.getChartData(response.data.history, $scope.cfg.chart_colors); }; }, function(error) {
<<<<<<< dataFactory.putApiWithHeaders('profiles', input.id, profile, headers).then(function(response) { var _profile = _.omit(response.data.data, 'dashboard', 'hide_single_device_events', 'rooms', 'salt'); ======= dataFactory.putApiWithHeaders('profiles', inputAuth.id, profile, headers).then(function(response) { >>>>>>> dataFactory.putApiWithHeaders('profiles', inputAuth.id, profile, headers).then(function(response) { var _profile = _.omit(response.data.data, 'dashboard', 'hide_single_device_events', 'rooms', 'salt'); <<<<<<< $scope.redirectAfterLogin(true, _profile, input.password, '#/dashboard/firstlogin'); ======= $scope.redirectAfterLogin(true, response.data.data, inputAuth.password, '#/dashboard/firstlogin'); >>>>>>> $scope.redirectAfterLogin(true, _profile, inputAuth.password, '#/dashboard/firstlogin');
<<<<<<< import Errors from '../../components/Errors'; ======= import { HotKeys } from 'react-hotkeys'; >>>>>>> import { HotKeys } from 'react-hotkeys'; <<<<<<< const { editorChanged, onEditorChange, config, updated, errors } = this.props; const { raw_content } = config; ======= const { editorChanged, onEditorChange, config, updated } = this.props; const keyboardHandlers = { 'save': this.handleClickSave, }; >>>>>>> const { editorChanged, onEditorChange, config, updated, errors } = this.props; const { raw_content } = config; const keyboardHandlers = { 'save': this.handleClickSave, }; <<<<<<< <div className="single"> {errors && errors.length > 0 && <Errors errors={errors} />} ======= <HotKeys handlers={keyboardHandlers}> >>>>>>> <HotKeys handlers={keyboardHandlers} className="single"> {errors && errors.length > 0 && <Errors errors={errors} />} <<<<<<< { raw_content && <Editor editorChanged={editorChanged} onEditorChange={onEditorChange} content={raw_content} ref="editor" /> } </div> ======= <Editor editorChanged={editorChanged} onEditorChange={onEditorChange} content={toYAML(config)} ref="editor" /> </HotKeys> >>>>>>> { raw_content && <Editor editorChanged={editorChanged} onEditorChange={onEditorChange} content={raw_content} ref="editor" /> } </HotKeys>
<<<<<<< export function putDataFile(directory, filename, data, new_path = '') { ======= export function putDataFile(filename, data, source = "editor") { >>>>>>> export function putDataFile(directory, filename, data, new_path = '', source = "editor") { <<<<<<< datafileAPIUrl(directory, filename), JSON.stringify(meta), ======= datafileAPIUrl(filename), JSON.stringify(payload), >>>>>>> datafileAPIUrl(directory, filename), JSON.stringify(payload),
<<<<<<< import { getLeaveMessage } from '../../constants/lang'; ======= import { injectDefaultFields } from '../../utils/metadata'; import { getLeaveMessage, getDeleteMessage, getNotFoundMessage } from '../../constants/lang'; >>>>>>> import { getLeaveMessage } from '../../constants/lang'; import { injectDefaultFields } from '../../utils/metadata'; import { getLeaveMessage, getDeleteMessage, getNotFoundMessage } from '../../constants/lang';
<<<<<<< import { getFilenameFromPath } from '../../utils/helpers'; ======= import { preventDefault } from '../../utils/helpers'; >>>>>>> import { preventDefault, getFilenameFromPath } from '../../utils/helpers'; <<<<<<< getDirectoryfromPath(path) { let directory = path.split("/"); directory.pop(); return directory.join("/"); } handleClickSave() { const { datafileChanged, putDataFile, params } = this.props; if (datafileChanged) { const path = this.refs.inputpath.refs.input.value; const directory = this.getDirectoryfromPath(path); const filename = getFilenameFromPath(path); const value = this.refs.editor.getValue(); putDataFile(directory, filename, value); ======= toggleView() { this.setState({ guiView: !this.state.guiView }); } handleChange(e) { const { onDataFileChanged } = this.props; let obj = {}; const key = e.target.id; const value = e.target.value; obj[key] = value; this.setState(obj); onDataFileChanged(); } handleClickSave(e) { const { datafileChanged, fieldChanged, putDataFile } = this.props; // Prevent the default event from bubbling preventDefault(e); let filename; if (datafileChanged || fieldChanged) { if (this.state.guiView) { filename = this.state.baseName + this.state.extn; putDataFile(filename, null, "gui"); } else { filename = this.refs.inputpath.refs.input.value; putDataFile(filename, this.refs.editor.getValue()); } >>>>>>> toggleView() { this.setState({ guiView: !this.state.guiView }); } handleChange(e) { const { onDataFileChanged } = this.props; let obj = {}; const key = e.target.id; const value = e.target.value; obj[key] = value; this.setState(obj); onDataFileChanged(); } handleClickSave(e) { const { datafileChanged, fieldChanged, putDataFile, params } = this.props; // Prevent the default event from bubbling preventDefault(e); let filename; if (datafileChanged || fieldChanged) { if (this.state.guiView) { filename = this.state.baseName + this.state.extn; putDataFile(this.state.directory, filename, null, null, "gui"); } else { filename = this.refs.inputpath.refs.input.value; putDataFile(params.splat, filename, this.refs.editor.getValue()); } <<<<<<< datafileChanged, onDataFileChanged, datafile, updated, errors, params ======= datafileChanged, fieldChanged, onDataFileChanged, updated, errors >>>>>>> datafileChanged, fieldChanged, onDataFileChanged, datafile, updated, errors, params <<<<<<< <InputPath onChange={onDataFileChanged} type="data files" path={initialPath} ref="inputpath" /> <Editor editorChanged={datafileChanged} onEditorChange={onDataFileChanged} content={""} ref="editor" /> ======= { this.state.guiView && <div> {this.renderGUInputs()} <DataGUI fields={{"key": "value"}} dataview /></div> } { !this.state.guiView && <div> <InputPath onChange={onDataFileChanged} type="datafiles" path="" ref="inputpath" /> <Editor editorChanged={datafileChanged} onEditorChange={onDataFileChanged} content={""} ref="editor" /></div> } >>>>>>> { this.state.guiView && <div> {this.renderGUInputs()} <DataGUI fields={{"key": "value"}} dataview /></div> } { !this.state.guiView && <div> <InputPath onChange={onDataFileChanged} type="datafiles" path="" ref="inputpath" /> <Editor editorChanged={datafileChanged} onEditorChange={onDataFileChanged} content={""} ref="editor" /></div> } <<<<<<< route: PropTypes.object.isRequired, params: PropTypes.object.isRequired ======= route: PropTypes.object.isRequired, fieldChanged: PropTypes.bool >>>>>>> route: PropTypes.object.isRequired, params: PropTypes.object.isRequired, fieldChanged: PropTypes.bool
<<<<<<< import { injectDefaultFields } from '../../utils/metadata'; ======= import { preventDefault } from '../../utils/helpers'; >>>>>>> import { injectDefaultFields } from '../../utils/metadata'; import { preventDefault } from '../../utils/helpers'; <<<<<<< const metafields = injectDefaultFields(config, directory, collection, front_matter); ======= const keyboardHandlers = { 'save': this.handleClickSave, }; >>>>>>> const metafields = injectDefaultFields(config, directory, collection, front_matter); const keyboardHandlers = { 'save': this.handleClickSave, };
<<<<<<< import { getLeaveMessage } from '../../constants/lang'; ======= import { getFilenameFromPath } from '../../utils/helpers'; import { injectDefaultFields } from '../../utils/metadata'; import { getLeaveMessage, getDeleteMessage, getNotFoundMessage } from '../../constants/lang'; >>>>>>> import { getLeaveMessage } from '../../constants/lang'; import { injectDefaultFields } from '../../utils/metadata'; import { getLeaveMessage, getDeleteMessage, getNotFoundMessage } from '../../constants/lang';
<<<<<<< import { StoryCard, Chart, ChartData, PieChart } from '../src'; import { getRandomValuesArray, colors, objectRandomizer, wallOfRichText } from './shared'; ======= import { StoryCard, Chart, ChartData, Pie } from '../src'; import { getRandomValuesArray, getColors, randomizer, wallOfRichText } from './shared'; import { checkA11y } from '@storybook/addon-a11y'; >>>>>>> import { StoryCard, Chart, ChartData, PieChart } from '../src'; import { getRandomValuesArray, colors, objectRandomizer, wallOfRichText } from './shared'; import { checkA11y } from '@storybook/addon-a11y';
<<<<<<< /* * The contents of this file are licenced. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function ( exports ) { "use strict"; /* global SieveDocument */ /* global SieveLexer */ /* global SieveGrammar */ var suite = exports.net.tschmid.yautt.test; if (!suite) throw new Error( "Could not append script test tools to test suite" ); /** * Parses the given script and returns a SieveDocument. * It honors the server's capabilities. * * @param{string} script * the script to parse * @param{Object.<string, boolean>} [capabilities] * optional parameter which simulates the the server's capabilities * * @return{SieveDocument} * the parsed sieve document */ function parseScript( script, capabilities ) { SieveGrammar.create( capabilities ); if (capabilities) SieveLexer.capabilities(capabilities); var doc = new SieveDocument(SieveLexer,null); doc.script(script); return doc; } suite.parseScript = parseScript; function validateDocument( doc, script, capabilities ) { suite.logTrace("Start Serializing Script"); var rv = doc.script(); suite.logTrace("End Serializing Script"); suite.assertEquals(script, rv); if (capabilities) { var requires = {}; doc.root().require(requires); suite.logTrace(rv); for (var capability in capabilities) { suite.logTrace("Testing Capability: "+capability); suite.assertEquals( true, requires[capability], "Did not find capability '" + capability + "'" ); } } } suite.validateDocument = validateDocument; function expectValidScript( script, capabilities ) { suite.logTrace( "Start Parsing Script" ); var doc = suite.parseScript( script, capabilities ); suite.logTrace( "End Parsing Script" ); suite.logTrace( "Start Serializing Script" ); validateDocument( doc, script, capabilities ); suite.logTrace( "End Serializing Script" ); return doc; } suite.expectValidScript = expectValidScript; function expectInvalidScript( script, exception, capabilities ) { SieveGrammar.create( capabilities ); if (capabilities) SieveLexer.capabilities(capabilities); var doc = new SieveDocument(SieveLexer,null); suite.logTrace("Start Parsing Script"); try { doc.script(script); } catch(e) { suite.logTrace("Exception caught"); suite.assertEquals( exception, e.toString().substr( 0, exception.length ) ); return; } throw new Error( "Exception expected" ); } suite.expectInvalidScript = expectInvalidScript; function expectValidSnipplet( type, snipplet, capabilities ) { SieveGrammar.create( capabilities ); if ( capabilities ) SieveLexer.capabilities( capabilities ); var doc = new SieveDocument( SieveLexer, null ); // Create element with defaults and convert it to a script sniplet... var rv1 = doc.createByName( type ).toScript(); // ... and should match our expectation. suite.assertEquals( snipplet, rv1 ); // ... then try to parse these script sniplet var rv2 = doc.createByName( type, rv1 ).toScript(); // and ensure both snipplets should be identical... suite.assertEquals( rv1, rv2 ); if ( capabilities ) { var requires = {}; doc.root().require( requires ); suite.logTrace( rv1 ); for ( var capability in capabilities ) { suite.logTrace( "Testing Capability: " + capability ); suite.assertEquals( true, requires[capability], "Did not find capability '" + capability + "'" ); } } return doc; } suite.expectValidSnipplet = expectValidSnipplet; }( window ) ); ======= /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ "use strict"; (function () { /* global net */ /* global SieveDocument */ /* global SieveLexer */ let suite = net.tschmid.yautt.test; if (!suite) throw new Error("Could not append script test tools to test suite"); suite.expectValidScript = function (script, capabilities) { if (capabilities) SieveLexer.capabilities(capabilities); let doc = new SieveDocument(SieveLexer, null); suite.logTrace("Start Parsing Script"); doc.script(script); suite.logTrace("End Parsing Script"); suite.logTrace("Start Serializing Script"); let rv = doc.script(); suite.logTrace("End Serializing Script"); suite.assertEquals(script, rv); if (capabilities) { let requires = {}; doc.root().require(requires); suite.logTrace(rv); for (let capability in capabilities) { suite.logTrace("Testing Capability: " + capability); suite.assertEquals(true, requires[capability]); } } return doc; }; suite.expectInvalidScript = function (script, exception, capabilities) { if (capabilities) SieveLexer.capabilities(capabilities); let doc = new SieveDocument(SieveLexer, null); suite.logTrace("Start Parsing Script"); try { doc.script(script); } catch (e) { suite.logTrace("Exception caught"); suite.assertEquals(exception, e); return; } throw new Error("Exception expected"); }; })(); >>>>>>> /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function ( exports ) { "use strict"; /* global SieveDocument */ /* global SieveLexer */ /* global SieveGrammar */ var suite = exports.net.tschmid.yautt.test; if (!suite) throw new Error( "Could not append script test tools to test suite" ); /** * Parses the given script and returns a SieveDocument. * It honors the server's capabilities. * * @param{string} script * the script to parse * @param{Object.<string, boolean>} [capabilities] * optional parameter which simulates the the server's capabilities * * @return{SieveDocument} * the parsed sieve document */ function parseScript( script, capabilities ) { SieveGrammar.create( capabilities ); if (capabilities) SieveLexer.capabilities(capabilities); var doc = new SieveDocument(SieveLexer,null); doc.script(script); return doc; } suite.parseScript = parseScript; function validateDocument( doc, script, capabilities ) { suite.logTrace("Start Serializing Script"); var rv = doc.script(); suite.logTrace("End Serializing Script"); suite.assertEquals(script, rv); if (capabilities) { var requires = {}; doc.root().require(requires); suite.logTrace(rv); for (var capability in capabilities) { suite.logTrace("Testing Capability: "+capability); suite.assertEquals( true, requires[capability], "Did not find capability '" + capability + "'" ); } } } suite.validateDocument = validateDocument; function expectValidScript( script, capabilities ) { suite.logTrace( "Start Parsing Script" ); var doc = suite.parseScript( script, capabilities ); suite.logTrace( "End Parsing Script" ); suite.logTrace( "Start Serializing Script" ); validateDocument( doc, script, capabilities ); suite.logTrace( "End Serializing Script" ); return doc; } suite.expectValidScript = expectValidScript; function expectInvalidScript( script, exception, capabilities ) { SieveGrammar.create( capabilities ); if (capabilities) SieveLexer.capabilities(capabilities); let doc = new SieveDocument(SieveLexer, null); suite.logTrace("Start Parsing Script"); try { doc.script(script); } catch(e) { suite.logTrace("Exception caught"); suite.assertEquals( exception, e.toString().substr( 0, exception.length ) ); return; } throw new Error( "Exception expected" ); } suite.expectInvalidScript = expectInvalidScript; function expectValidSnipplet( type, snipplet, capabilities ) { SieveGrammar.create( capabilities ); if ( capabilities ) SieveLexer.capabilities( capabilities ); var doc = new SieveDocument( SieveLexer, null ); // Create element with defaults and convert it to a script sniplet... var rv1 = doc.createByName( type ).toScript(); // ... and should match our expectation. suite.assertEquals( snipplet, rv1 ); // ... then try to parse these script sniplet var rv2 = doc.createByName( type, rv1 ).toScript(); // and ensure both snipplets should be identical... suite.assertEquals( rv1, rv2 ); if ( capabilities ) { var requires = {}; doc.root().require( requires ); suite.logTrace( rv1 ); for ( var capability in capabilities ) { suite.logTrace( "Testing Capability: " + capability ); suite.assertEquals( true, requires[capability], "Did not find capability '" + capability + "'" ); } } return doc; } suite.expectValidSnipplet = expectValidSnipplet; }( window ) );
<<<<<<< /* * The contents of this file are licenced. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ (function(exports) { "use strict"; /* global SieveLexer */ /* global SieveAbstractBlock */ function SieveBlockBody(docshell,id) { SieveAbstractBlock.call(this,docshell,id); this.elms = []; } SieveBlockBody.prototype = Object.create(SieveAbstractBlock.prototype); SieveBlockBody.prototype.constructor = SieveBlockBody; SieveBlockBody.isElement = function (parser, lexer) { return lexer.probeByClass(["action","condition","whitespace"],parser); }; SieveBlockBody.nodeName = function () { return "block/body"; }; SieveBlockBody.nodeType = function () { return "block/"; }; SieveBlockBody.prototype.init = function (parser) { while (this._probeByClass(["action","condition","whitespace"],parser)) this.elms.push( this._createByClass(["action","condition","whitespace"],parser)); return this; }; SieveBlockBody.prototype.toScript = function () { var str =""; for (var key in this.elms) str += this.elms[key].toScript(); return str; }; //****************************************************************************// function SieveBlock(docshell,id) { SieveBlockBody.call(this,docshell,id); } SieveBlock.prototype = Object.create(SieveBlockBody.prototype); SieveBlock.prototype.constructor = SieveBlock; SieveBlock.isElement = function (parser, lexer) { return parser.isChar("{"); }; SieveBlock.nodeName = function () { return "block/block"; }; SieveBlock.nodeType = function () { return "block/"; }; SieveBlock.prototype.init = function (parser) { parser.extractChar("{"); SieveBlockBody.prototype.init.call(this,parser); parser.extractChar("}"); return this; }; SieveBlock.prototype.toScript = function () { return "{" +SieveBlockBody.prototype.toScript.call(this)+"}"; }; //****************************************************************************// function SieveRootNode(docshell) { SieveBlockBody.call(this,docshell,-1); this.elms[0] = this._createByName("import"); this.elms[1] = this._createByName("block/body"); } SieveRootNode.prototype = Object.create(SieveBlockBody.prototype); SieveRootNode.prototype.constructor = SieveRootNode; SieveRootNode.isElement = function (/*token, doc*/) { return false; }; SieveRootNode.nodeName = function () { return "block/rootnode"; }; SieveRootNode.nodeType = function () { return "block/"; }; SieveRootNode.prototype.init = function (parser) { // requires are only valid if they are // before any other sieve command! if (this._probeByName("import",parser)) this.elms[0].init(parser); // After the import section only deadcode and actions are valid if (this._probeByName("block/body",parser)) this.elms[1].init(parser); return this; }; SieveRootNode.prototype.toScript = function () { var requires = []; // Step 1: collect requires this.elms[1].require(requires); // Step 2: Add require... for (var item in requires) this.elms[0].capability(item); // TODO Remove unused requires... // return the script return SieveBlockBody.prototype.toScript.call(this); }; if (!SieveLexer) throw new Error("Could not register Block Elements"); SieveLexer.register(SieveBlockBody); exports.SieveBlockBody = SieveBlockBody; SieveLexer.register(SieveBlock); exports.SieveBlock = SieveBlock; SieveLexer.register(SieveRootNode); ======= /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ "use strict"; (function (exports) { /* global SieveLexer */ /* global SieveAbstractElement */ /* global SieveAbstractBlock */ function SieveBlockBody(docshell, id) { SieveAbstractBlock.call(this, docshell, id); this.elms = []; } SieveBlockBody.prototype = Object.create(SieveAbstractBlock.prototype); SieveBlockBody.prototype.constructor = SieveBlockBody; SieveBlockBody.isElement = function (parser, lexer) { return lexer.probeByClass(["action", "condition", "whitespace"], parser); }; SieveBlockBody.nodeName = function () { return "block/body"; }; SieveBlockBody.nodeType = function () { return "block/"; }; SieveBlockBody.prototype.init = function (parser) { while (this._probeByClass(["action", "condition", "whitespace"], parser)) this.elms.push( this._createByClass(["action", "condition", "whitespace"], parser)); return this; }; SieveBlockBody.prototype.toScript = function () { let str = ""; for (let key in this.elms) str += this.elms[key].toScript(); return str; }; // ****************************************************************************// function SieveBlock(docshell, id) { SieveBlockBody.call(this, docshell, id); } SieveBlock.prototype = Object.create(SieveBlockBody.prototype); SieveBlock.prototype.constructor = SieveBlock; SieveBlock.isElement = function (parser, lexer) { return parser.isChar("{"); }; SieveBlock.nodeName = function () { return "block/block"; }; SieveBlock.nodeType = function () { return "block/"; }; SieveBlock.prototype.init = function (parser) { parser.extractChar("{"); SieveBlockBody.prototype.init.call(this, parser); parser.extractChar("}"); return this; }; SieveBlock.prototype.toScript = function () { return "{" + SieveBlockBody.prototype.toScript.call(this) + "}"; }; // ****************************************************************************// function SieveRootNode(docshell) { SieveBlockBody.call(this, docshell, -1); this.elms[0] = this._createByName("import"); this.elms[1] = this._createByName("block/body"); } SieveRootNode.prototype = Object.create(SieveBlockBody.prototype); SieveRootNode.prototype.constructor = SieveRootNode; SieveRootNode.isElement = function (token, doc) { return false; }; SieveRootNode.nodeName = function () { return "block/rootnode"; }; SieveRootNode.nodeType = function () { return "block/"; }; SieveRootNode.prototype.init = function (parser) { // requires are only valid if they are // before any other sieve command! if (this._probeByName("import", parser)) this.elms[0].init(parser); // After the import section only deadcode and actions are valid if (this._probeByName("block/body", parser)) this.elms[1].init(parser); return this; }; SieveRootNode.prototype.toScript = function () { let requires = []; // Step 1: collect requires this.elms[1].require(requires); // Step 2: Add require... for (let item in requires) this.elms[0].capability(item); // TODO Remove unused requires... // return the script return SieveBlockBody.prototype.toScript.call(this); }; if (!SieveLexer) throw new Error("Could not register Block Elements"); SieveLexer.register(SieveBlockBody); exports.SieveBlockBody = SieveBlockBody; SieveLexer.register(SieveBlock); exports.SieveBlock = SieveBlock; SieveLexer.register(SieveRootNode); >>>>>>> /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ (function(exports) { "use strict"; /* global SieveLexer */ /* global SieveAbstractElement */ /* global SieveAbstractBlock */ function SieveBlockBody(docshell, id) { SieveAbstractBlock.call(this,docshell,id); this.elms = []; } SieveBlockBody.prototype = Object.create(SieveAbstractBlock.prototype); SieveBlockBody.prototype.constructor = SieveBlockBody; SieveBlockBody.isElement = function (parser, lexer) { return lexer.probeByClass(["action","condition","whitespace"],parser); }; SieveBlockBody.nodeName = function () { return "block/body"; }; SieveBlockBody.nodeType = function () { return "block/"; }; SieveBlockBody.prototype.init = function (parser) { while (this._probeByClass(["action","condition","whitespace"],parser)) this.elms.push( this._createByClass(["action","condition","whitespace"],parser)); return this; }; SieveBlockBody.prototype.toScript = function () { let str = ""; for (let key in this.elms) str += this.elms[key].toScript(); return str; }; //****************************************************************************// function SieveBlock(docshell, id) { SieveBlockBody.call(this,docshell,id); } SieveBlock.prototype = Object.create(SieveBlockBody.prototype); SieveBlock.prototype.constructor = SieveBlock; SieveBlock.isElement = function (parser, lexer) { return parser.isChar("{"); }; SieveBlock.nodeName = function () { return "block/block"; }; SieveBlock.nodeType = function () { return "block/"; }; SieveBlock.prototype.init = function (parser) { parser.extractChar("{"); SieveBlockBody.prototype.init.call(this,parser); parser.extractChar("}"); return this; }; SieveBlock.prototype.toScript = function () { return "{" +SieveBlockBody.prototype.toScript.call(this)+"}"; }; //****************************************************************************// function SieveRootNode(docshell) { SieveBlockBody.call(this,docshell,-1); this.elms[0] = this._createByName("import"); this.elms[1] = this._createByName("block/body"); } SieveRootNode.prototype = Object.create(SieveBlockBody.prototype); SieveRootNode.prototype.constructor = SieveRootNode; SieveRootNode.isElement = function (token, doc) { return false; }; SieveRootNode.nodeName = function () { return "block/rootnode"; }; SieveRootNode.nodeType = function () { return "block/"; }; SieveRootNode.prototype.init = function (parser) { // requires are only valid if they are // before any other sieve command! if (this._probeByName("import",parser)) this.elms[0].init(parser); // After the import section only deadcode and actions are valid if (this._probeByName("block/body",parser)) this.elms[1].init(parser); return this; }; SieveRootNode.prototype.toScript = function () { let requires = []; // Step 1: collect requires this.elms[1].require(requires); // Step 2: Add require... for (let item in requires) this.elms[0].capability(item); // TODO Remove unused requires... // return the script return SieveBlockBody.prototype.toScript.call(this); }; if (!SieveLexer) throw new Error("Could not register Block Elements"); SieveLexer.register(SieveBlockBody); exports.SieveBlockBody = SieveBlockBody; SieveLexer.register(SieveBlock); exports.SieveBlock = SieveBlock; SieveLexer.register(SieveRootNode);
<<<<<<< } return skips; } _computeDiffClass(panelFloatingDisabled) { if (panelFloatingDisabled) { return 'noOverflow'; } } /** * @param {!Object} patchRangeRecord */ _computeEditMode(patchRangeRecord) { const patchRange = patchRangeRecord.base || {}; return this.patchNumEquals(patchRange.patchNum, this.EDIT_NAME); } /** * @param {boolean} editMode */ _computeContainerClass(editMode) { return editMode ? 'editMode' : ''; } _computeBlameToggleLabel(loaded, loading) { if (loaded) { return 'Hide blame'; } return 'Show blame'; } /** * Load and display blame information if it has not already been loaded. * Otherwise hide it. */ _toggleBlame() { if (this._isBlameLoaded) { this.$.diffHost.clearBlame(); return; } this._isBlameLoading = true; this.dispatchEvent(new CustomEvent('show-alert', { detail: {message: MSG_LOADING_BLAME}, composed: true, bubbles: true, })); this.$.diffHost.loadBlame() .then(() => { this._isBlameLoading = false; this.dispatchEvent(new CustomEvent('show-alert', { detail: {message: MSG_LOADED_BLAME}, composed: true, bubbles: true, })); }) .catch(() => { this._isBlameLoading = false; }); } _handleToggleBlame(e) { if (this.shouldSuppressKeyboardShortcut(e) || this.modifierPressed(e)) { return; } this._toggleBlame(); } _computeBlameLoaderClass(isImageDiff, path) { return !this.isMagicPath(path) && !isImageDiff ? 'show' : ''; } _getRevisionInfo(change) { return new RevisionInfo(change); } _computeFileNum(file, files) { // Polymer 2: check for undefined if ([file, files].some(arg => arg === undefined)) { return undefined; } return files.findIndex(({value}) => value === file) + 1; } /** * @param {number} fileNum * @param {!Array<string>} files * @return {string} */ _computeFileNumClass(fileNum, files) { if (files && fileNum > 0) { return 'show'; } return ''; } _handleExpandAllDiffContext(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this.$.diffHost.expandAllContext(); } _computeDiffPrefsDisabled(disableDiffPrefs, loggedIn) { return disableDiffPrefs || !loggedIn; } _handleNextUnreviewedFile(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this._setReviewed(true); // Ensure that the currently viewed file always appears in unreviewedFiles // so we resolve the right "next" file. const unreviewedFiles = this._fileList .filter(file => (file === this._path || !this._reviewedFiles.has(file))); this._navToFile(this._path, unreviewedFiles, 1); } _handleReloadingDiffPreference() { this._getDiffPreferences(); } _onChangeHeaderPanelHeightChanged(e) { this._scrollTopMargin = e.detail.value; } _computeIsLoggedIn(loggedIn) { return loggedIn ? true : false; } _computeCanEdit(loggedIn, changeChangeRecord) { return this._computeIsLoggedIn(loggedIn) && this.changeIsOpen(changeChangeRecord.base); } } customElements.define(GrDiffView.is, GrDiffView); ======= return ''; }, _handleExpandAllDiffContext(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this.$.diffHost.expandAllContext(); }, _computeDiffPrefsDisabled(disableDiffPrefs, loggedIn) { return disableDiffPrefs || !loggedIn; }, _handleNextUnreviewedFile(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this._setReviewed(true); // Ensure that the currently viewed file always appears in unreviewedFiles // so we resolve the right "next" file. const unreviewedFiles = this._fileList .filter(file => (file === this._path || !this._reviewedFiles.has(file))); this._navToFile(this._path, unreviewedFiles, 1); }, _handleReloadingDiffPreference() { this._getDiffPreferences(); }, _computeCanEdit(loggedIn, changeChangeRecord) { if ([changeChangeRecord, changeChangeRecord.base] .some(arg => arg === undefined)) { return false; } return loggedIn && this.changeIsOpen(changeChangeRecord.base); }, }); })(); >>>>>>> } return skips; } _computeDiffClass(panelFloatingDisabled) { if (panelFloatingDisabled) { return 'noOverflow'; } } /** * @param {!Object} patchRangeRecord */ _computeEditMode(patchRangeRecord) { const patchRange = patchRangeRecord.base || {}; return this.patchNumEquals(patchRange.patchNum, this.EDIT_NAME); } /** * @param {boolean} editMode */ _computeContainerClass(editMode) { return editMode ? 'editMode' : ''; } _computeBlameToggleLabel(loaded, loading) { if (loaded) { return 'Hide blame'; } return 'Show blame'; } /** * Load and display blame information if it has not already been loaded. * Otherwise hide it. */ _toggleBlame() { if (this._isBlameLoaded) { this.$.diffHost.clearBlame(); return; } this._isBlameLoading = true; this.dispatchEvent(new CustomEvent('show-alert', { detail: {message: MSG_LOADING_BLAME}, composed: true, bubbles: true, })); this.$.diffHost.loadBlame() .then(() => { this._isBlameLoading = false; this.dispatchEvent(new CustomEvent('show-alert', { detail: {message: MSG_LOADED_BLAME}, composed: true, bubbles: true, })); }) .catch(() => { this._isBlameLoading = false; }); } _handleToggleBlame(e) { if (this.shouldSuppressKeyboardShortcut(e) || this.modifierPressed(e)) { return; } this._toggleBlame(); } _computeBlameLoaderClass(isImageDiff, path) { return !this.isMagicPath(path) && !isImageDiff ? 'show' : ''; } _getRevisionInfo(change) { return new RevisionInfo(change); } _computeFileNum(file, files) { // Polymer 2: check for undefined if ([file, files].some(arg => arg === undefined)) { return undefined; } return files.findIndex(({value}) => value === file) + 1; } /** * @param {number} fileNum * @param {!Array<string>} files * @return {string} */ _computeFileNumClass(fileNum, files) { if (files && fileNum > 0) { return 'show'; } return ''; } _handleExpandAllDiffContext(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this.$.diffHost.expandAllContext(); } _computeDiffPrefsDisabled(disableDiffPrefs, loggedIn) { return disableDiffPrefs || !loggedIn; } _handleNextUnreviewedFile(e) { if (this.shouldSuppressKeyboardShortcut(e)) { return; } this._setReviewed(true); // Ensure that the currently viewed file always appears in unreviewedFiles // so we resolve the right "next" file. const unreviewedFiles = this._fileList .filter(file => (file === this._path || !this._reviewedFiles.has(file))); this._navToFile(this._path, unreviewedFiles, 1); } _handleReloadingDiffPreference() { this._getDiffPreferences(); } _onChangeHeaderPanelHeightChanged(e) { this._scrollTopMargin = e.detail.value; } _computeCanEdit(loggedIn, changeChangeRecord) { if ([changeChangeRecord, changeChangeRecord.base] .some(arg => arg === undefined)) { return false; } return loggedIn && this.changeIsOpen(changeChangeRecord.base); } } customElements.define(GrDiffView.is, GrDiffView);
<<<<<<< /* * The contents of this file are licenced. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ (function() { "use strict"; /* global net */ var suite = net.tschmid.yautt.test; if (!suite) throw new Error( "Could not initialize test suite" ); suite.add( function() { suite.log("Sieve Relational (RFC5231) unit tests..."); }); suite.add( function() { suite.log("Extended Example test"); var script = 'require ["relational", "comparator-i;ascii-numeric", "fileinto"];\r\n' + '\r\n' + 'if header :comparator "i;ascii-numeric" :value "lt" \r\n' + ' ["x-priority"] ["3"]\r\n' + '{\r\n' + ' fileinto "Priority";\r\n' + '}\r\n' + '\r\n' + 'elsif address :comparator "i;ascii-numeric" :count "gt" \r\n' + ' ["to"] ["5"]\r\n' + '{\r\n' + ' # everything with more than 5 recipients in the "to" field\r\n' + ' # is considered SPAM\r\n' + ' fileinto "SPAM";\r\n' + '}\r\n' + '\r\n' + 'elsif address :all :comparator "i;ascii-casemap" :value "gt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' fileinto "From N-Z";\r\n' + '} else {\r\n' + ' fileinto "From A-M";\r\n' + '}\r\n' + '\r\n' + 'if allof ( address :comparator "i;ascii-numeric" :count "eq" \r\n' + ' ["to", "cc"] ["1"] ,\r\n' + ' address :all :comparator "i;ascii-casemap" \r\n' + ' ["to", "cc"] ["[email protected]"] )\r\n' + '{\r\n' + ' fileinto "Only me";\r\n' + '}\r\n'; // FIXME: require comparator... suite.expectValidScript(script, {"relational":true, "fileinto":true, "comparator-i;ascii-numeric":true}); }); suite.add( function() { suite.log("Invalid operator"); var script = 'require ["relational"];\r\n' + '\r\n' + 'if address :all :comparator "i;ascii-casemap" :value "egt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' keep;\r\n' + '}\r\n'; suite.expectInvalidScript( script, "Error: Relational operator e", { "relational": true }); }); /* * address :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ---------- anyof ( address :count "ge" :comparator "i;ascii-numeric" ["to"] ["3"], address :count "ge" :comparator "i;ascii-numeric" ["cc"] ["3"] ) ------- header :count "ge" :comparator "i;ascii-numeric" ["received"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["received", "subject"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ------ */ }()); ======= /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ (function () { "use strict"; /* global net */ let suite = net.tschmid.yautt.test; if (!suite) throw new Error("Could not initialize test suite"); suite.add(function () { suite.log("Sieve Relational (RFC5231) unit tests..."); }); suite.add(function () { suite.log("Extended Example test"); let script = 'require ["relational", "comparator-i;ascii-numeric", "fileinto"];\r\n' + '\r\n' + 'if header :comparator "i;ascii-numeric" :value "lt" \r\n' + ' ["x-priority"] ["3"]\r\n' + '{\r\n' + ' fileinto "Priority";\r\n' + '}\r\n' + '\r\n' + 'elsif address :comparator "i;ascii-numeric" :count "gt" \r\n' + ' ["to"] ["5"]\r\n' + '{\r\n' + ' # everything with more than 5 recipients in the "to" field\r\n' + ' # is considered SPAM\r\n' + ' fileinto "SPAM";\r\n' + '}\r\n' + '\r\n' + 'elsif address :all :comparator "i;ascii-casemap" :value "gt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' fileinto "From N-Z";\r\n' + '} else {\r\n' + ' fileinto "From A-M";\r\n' + '}\r\n' + '\r\n' + 'if allof ( address :comparator "i;ascii-numeric" :count "eq" \r\n' + ' ["to", "cc"] ["1"] ,\r\n' + ' address :all :comparator "i;ascii-casemap" \r\n' + ' ["to", "cc"] ["[email protected]"] )\r\n' + '{\r\n' + ' fileinto "Only me";\r\n' + '}\r\n'; // FIXME: require comparator... suite.expectValidScript(script, { "relational": true, "fileinto": true, "comparator-i;ascii-numeric": true }); }); suite.add(function () { suite.log("Invalid operator"); let script = 'require ["relational"];\r\n' + '\r\n' + 'if address :all :comparator "i;ascii-casemap" :value "egt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' keep;\r\n' + '}\r\n'; suite.expectInvalidScript(script, "Relational operator expected", { "relational": true }); }); /* * address :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ---------- anyof ( address :count "ge" :comparator "i;ascii-numeric" ["to"] ["3"], address :count "ge" :comparator "i;ascii-numeric" ["cc"] ["3"] ) ------- header :count "ge" :comparator "i;ascii-numeric" ["received"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["received", "subject"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ------ */ })(); >>>>>>> /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ (function () { "use strict"; /* global net */ let suite = net.tschmid.yautt.test; if (!suite) throw new Error("Could not initialize test suite"); suite.add(function () { suite.log("Sieve Relational (RFC5231) unit tests..."); }); suite.add(function () { suite.log("Extended Example test"); let script = 'require ["relational", "comparator-i;ascii-numeric", "fileinto"];\r\n' + '\r\n' + 'if header :comparator "i;ascii-numeric" :value "lt" \r\n' + ' ["x-priority"] ["3"]\r\n' + '{\r\n' + ' fileinto "Priority";\r\n' + '}\r\n' + '\r\n' + 'elsif address :comparator "i;ascii-numeric" :count "gt" \r\n' + ' ["to"] ["5"]\r\n' + '{\r\n' + ' # everything with more than 5 recipients in the "to" field\r\n' + ' # is considered SPAM\r\n' + ' fileinto "SPAM";\r\n' + '}\r\n' + '\r\n' + 'elsif address :all :comparator "i;ascii-casemap" :value "gt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' fileinto "From N-Z";\r\n' + '} else {\r\n' + ' fileinto "From A-M";\r\n' + '}\r\n' + '\r\n' + 'if allof ( address :comparator "i;ascii-numeric" :count "eq" \r\n' + ' ["to", "cc"] ["1"] ,\r\n' + ' address :all :comparator "i;ascii-casemap" \r\n' + ' ["to", "cc"] ["[email protected]"] )\r\n' + '{\r\n' + ' fileinto "Only me";\r\n' + '}\r\n'; // FIXME: require comparator... suite.expectValidScript(script, { "relational": true, "fileinto": true, "comparator-i;ascii-numeric": true }); }); suite.add(function () { suite.log("Invalid operator"); let script = 'require ["relational"];\r\n' + '\r\n' + 'if address :all :comparator "i;ascii-casemap" :value "egt" \r\n' + ' ["from"] ["M"]\r\n' + '{\r\n' + ' keep;\r\n' + '}\r\n'; suite.expectInvalidScript( script, "Error: Relational operator e", { "relational": true }); }); /* * address :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ---------- anyof ( address :count "ge" :comparator "i;ascii-numeric" ["to"] ["3"], address :count "ge" :comparator "i;ascii-numeric" ["cc"] ["3"] ) ------- header :count "ge" :comparator "i;ascii-numeric" ["received"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["received", "subject"] ["3"] ------ header :count "ge" :comparator "i;ascii-numeric" ["to", "cc"] ["3"] ------ */ })();
<<<<<<< /* * The content of this file is licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> */ /* globals SieveSaslLoginRequest */ /* globals SieveResponseParser */ /* globals SieveSaslExternalRequest */ /* globals window */ (function(exports) { "use strict"; var suite = exports.net.tschmid.yautt.test; if (!suite) throw new Error( "Could not initialize test suite" ); suite.add( function() { suite.log("ManageSieve unit tests..."); }); suite.add( function() { suite.log("SASL Login - OK"); var request = new SieveSaslLoginRequest(); var hasError = null; var hasSucceded = null; var handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; request.addSaslListener(handler); request.addErrorListener(handler); request.setUsername("blubb"); request.setPassword("bla"); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('AUTHENTICATE "LOGIN"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "VXNlcm5hbWU6" which is a "USERNAME:" request.addResponse(new SieveResponseParser([0x22, 0x56, 0x58, 0x4e, 0x6c, 0x63, 0x6d, 0x35, 0x68, 0x62, 0x57, 0x55, 0x36, 0x22,0x0D,0x0A])); // CLIENT -> SERVER // Client sends the username, Ymx1YmI= equals blubb suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymx1YmI="\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "UGFzc3dvcmQ6" which is a "PASSWORD:" request.addResponse(new SieveResponseParser([0x22,0x55,0x47,0x46,0x7a,0x63,0x33,0x64,0x76,0x63,0x6d,0x51,0x36,0x22,0x0D,0x0A])); // CLIENT -> SERVER // Client sends the password, suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymxh"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server sends OK request.addResponse(new SieveResponseParser([0x4f,0x4b,0x0D,0x0A])); // Server sends NO //request.addResponse(new SieveResponseParser([0x4e,0x4f,0x0D,0x0A])); suite.assertEquals(false, request.hasNextRequest()); suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add( function() { suite.log("SASL External - OK"); // Single theaded javascript magic... var hasError = null; var hasSucceded = null; var handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; var request = new SieveSaslExternalRequest(); request.addSaslListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4f,0x4b,0x0D,0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add( function() { suite.log("SASL External - NO"); // Single theaded javascript magic... var hasError = null; var hasSucceded = null; var handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; var request = new SieveSaslExternalRequest(); request.addSaslListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4e,0x4f,0x0D,0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(null, hasSucceded); suite.assertEquals(true, hasError); }); }(window)); ======= /* * The content of this file is licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> */ /* globals SieveSaslLoginRequest */ /* globals SieveResponseParser */ /* globals SieveSaslExternalRequest */ /* globals window */ "use strict"; (function (exports) { let suite = exports.net.tschmid.yautt.test; if (!suite) throw new Error("Could not initialize test suite"); suite.add(function () { suite.log("ManageSieve unit tests..."); }); suite.add(function () { suite.log("SASL Login - OK"); let request = new SieveSaslLoginRequest(); let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function () { hasSucceded = true; }; handler.onError = function () { hasError = true; }; request.addResponseListener(handler); request.addErrorListener(handler); request.setUsername("blubb"); request.setPassword("bla"); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('AUTHENTICATE "LOGIN"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "VXNlcm5hbWU6" which is a "USERNAME:" request.addResponse(new SieveResponseParser([0x22, 0x56, 0x58, 0x4e, 0x6c, 0x63, 0x6d, 0x35, 0x68, 0x62, 0x57, 0x55, 0x36, 0x22, 0x0D, 0x0A])); // CLIENT -> SERVER // Client sends the username, Ymx1YmI= equals blubb suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymx1YmI="\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "UGFzc3dvcmQ6" which is a "PASSWORD:" request.addResponse(new SieveResponseParser([0x22, 0x55, 0x47, 0x46, 0x7a, 0x63, 0x33, 0x64, 0x76, 0x63, 0x6d, 0x51, 0x36, 0x22, 0x0D, 0x0A])); // CLIENT -> SERVER // Client sends the password, suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymxh"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server sends OK request.addResponse(new SieveResponseParser([0x4f, 0x4b, 0x0D, 0x0A])); // Server sends NO // request.addResponse(new SieveResponseParser([0x4e,0x4f,0x0D,0x0A])); suite.assertEquals(false, request.hasNextRequest()); suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add(function () { suite.log("SASL External - OK"); // Single theaded javascript magic... let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function () { hasSucceded = true; }; handler.onError = function () { hasError = true; }; let request = new SieveSaslExternalRequest(); request.addResponseListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4f, 0x4b, 0x0D, 0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add(function () { suite.log("SASL External - NO"); // Single theaded javascript magic... let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function () { hasSucceded = true; }; handler.onError = function () { hasError = true; }; let request = new SieveSaslExternalRequest(); request.addResponseListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4e, 0x4f, 0x0D, 0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(null, hasSucceded); suite.assertEquals(true, hasError); }); })(window); >>>>>>> /* * The content of this file is licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> */ /* globals SieveSaslLoginRequest */ /* globals SieveResponseParser */ /* globals SieveSaslExternalRequest */ /* globals window */ (function(exports) { "use strict"; var suite = exports.net.tschmid.yautt.test; if (!suite) throw new Error( "Could not initialize test suite" ); suite.add( function() { suite.log("ManageSieve unit tests..."); }); suite.add( function() { suite.log("SASL Login - OK"); let request = new SieveSaslLoginRequest(); let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; request.addResponseListener(handler); request.addErrorListener(handler); request.setUsername("blubb"); request.setPassword("bla"); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('AUTHENTICATE "LOGIN"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "VXNlcm5hbWU6" which is a "USERNAME:" request.addResponse(new SieveResponseParser([0x22, 0x56, 0x58, 0x4e, 0x6c, 0x63, 0x6d, 0x35, 0x68, 0x62, 0x57, 0x55, 0x36, 0x22,0x0D,0x0A])); // CLIENT -> SERVER // Client sends the username, Ymx1YmI= equals blubb suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymx1YmI="\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server responds with a "UGFzc3dvcmQ6" which is a "PASSWORD:" request.addResponse(new SieveResponseParser([0x22,0x55,0x47,0x46,0x7a,0x63,0x33,0x64,0x76,0x63,0x6d,0x51,0x36,0x22,0x0D,0x0A])); // CLIENT -> SERVER // Client sends the password, suite.assertEquals(true, request.hasNextRequest()); suite.assertEquals('"Ymxh"\r\n', request.getNextRequest()); // SERVER -> CLIENT // Server sends OK request.addResponse(new SieveResponseParser([0x4f,0x4b,0x0D,0x0A])); // Server sends NO //request.addResponse(new SieveResponseParser([0x4e,0x4f,0x0D,0x0A])); suite.assertEquals(false, request.hasNextRequest()); suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add( function() { suite.log("SASL External - OK"); // Single theaded javascript magic... let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; let request = new SieveSaslExternalRequest(); request.addResponseListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4f,0x4b,0x0D,0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(true, hasSucceded); suite.assertEquals(null, hasError); }); suite.add( function() { suite.log("SASL External - NO"); // Single theaded javascript magic... let hasError = null; let hasSucceded = null; let handler = {}; handler.onSaslResponse = function() { hasSucceded = true; }; handler.onError = function() { hasError = true; }; let request = new SieveSaslExternalRequest(); request.addResponseListener(handler); request.addErrorListener(handler); // CLIENT -> SERVER // Client sends mechanism to server. suite.assertEquals('AUTHENTICATE "EXTERNAL" ""\r\n', request.getNextRequest()); suite.assertEquals(false, request.hasNextRequest()); // SERVER -> CLIENT request.addResponse(new SieveResponseParser([0x4e,0x4f,0x0D,0x0A])); // This works only because of closures and javascript single threaded nature... suite.assertEquals(null, hasSucceded); suite.assertEquals(true, hasError); }); }(window));
<<<<<<< /* * The contents of this file are licenced. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function ( /*exports*/ ) { "use strict"; /* global SieveGrammar */ if ( !SieveGrammar ) throw new Error( "Could not register Reject Grammar" ); var reject = { node: "action/reject", type: "action", token: "reject", requires: "reject", properties: [{ id: "parameters", elements: [{ id: "reason", type: "string", value: "text:\r\n.\r\n" }] }] }; SieveGrammar.addAction( reject ); var ereject = { node: "action/ereject", type: "action", token: "ereject", requires: "ereject", properties: [{ id: "parameters", elements: [{ id: "reason", type: "string", value: "text:\r\n.\r\n" }] }] }; SieveGrammar.addAction( ereject ); })( window ); ======= /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ "use strict"; (function (exports) { /* global SieveLexer */ /* global SieveAbstractElement */ function SieveReject(docshell, id) { SieveAbstractElement.call(this, docshell, id); this.reason = this._createByName("string", "text:\r\n.\r\n"); this.whiteSpace = this._createByName("whitespace", " "); this.semicolon = this._createByName("atom/semicolon"); } SieveReject.prototype = Object.create(SieveAbstractElement.prototype); SieveReject.prototype.constructor = SieveReject; SieveReject.isElement = function (parser, lexer) { return parser.startsWith("reject"); }; SieveReject.isCapable = function (capabilities) { return (capabilities["reject"] === true); }; SieveReject.nodeName = function () { return "action/reject"; }; SieveReject.nodeType = function () { return "action"; }; SieveReject.prototype.init = function (parser) { // Syntax : // <"reject"> <reason: string> <";"> // remove the "redirect" identifier ... parser.extract("reject"); // ... eat the deadcode before the stringlist... this.whiteSpace.init(parser); // ... extract the reject reason... this.reason.init(parser); // ... drop the semicolon this.semicolon.init(parser); return this; }; SieveReject.prototype.getReason = function () { return this.reason.value(); }; SieveReject.prototype.setReason = function (reason) { return this.reason.value(reason); }; SieveReject.prototype.require = function (requires) { requires["reject"] = true; }; SieveReject.prototype.toScript = function () { return "reject" + this.whiteSpace.toScript() + this.reason.toScript() + this.semicolon.toScript(); }; // *****************************************************************************// function SieveEreject(docshell, id) { SieveAbstractElement.call(this, docshell, id); this.reason = this._createByName("string", "text:\r\n.\r\n"); this.whiteSpace = this._createByName("whitespace", " "); this.semicolon = this._createByName("atom/semicolon"); } SieveEreject.prototype = Object.create(SieveAbstractElement.prototype); SieveEreject.prototype.constructor = SieveEreject; SieveEreject.isElement = function (parser, lexer) { return parser.startsWith("ereject"); }; SieveEreject.isCapable = function (capabilities) { return (capabilities["ereject"] === true); }; SieveEreject.nodeName = function () { return "action/ereject"; }; SieveEreject.nodeType = function () { return "action"; }; SieveEreject.prototype.init = function (parser) { // Syntax : // <"ereject"> <reason: string> <";"> // remove the "redirect" identifier ... parser.extract("ereject"); // ... eat the deadcode before the stringlist... this.whiteSpace.init(parser); // ... extract the reject reason... this.reason.init(parser); // ... drop the semicolon this.semicolon.init(parser); return this; }; SieveEreject.prototype.getReason = function () { return this.reason.value(); }; SieveEreject.prototype.setReason = function (reason) { return this.reason.value(reason); }; SieveEreject.prototype.require = function (requires) { requires["ereject"] = true; }; SieveEreject.prototype.toScript = function () { return "ereject" + this.whiteSpace.toScript() + this.reason.toScript() + this.semicolon.toScript(); }; if (!SieveLexer) throw new Error("Could not register Actions"); SieveLexer.register(SieveReject); SieveLexer.register(SieveEreject); })(window); >>>>>>> /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function ( /*exports*/ ) { "use strict"; /* global SieveGrammar */ if ( !SieveGrammar ) throw new Error( "Could not register Reject Grammar" ); var reject = { node: "action/reject", type: "action", token: "reject", requires: "reject", properties: [{ id: "parameters", elements: [{ id: "reason", type: "string", value: "text:\r\n.\r\n" }] }] }; SieveGrammar.addAction( reject ); var ereject = { node: "action/ereject", type: "action", token: "ereject", requires: "ereject", properties: [{ id: "parameters", elements: [{ id: "reason", type: "string", value: "text:\r\n.\r\n" }] }] }; SieveGrammar.addAction( ereject ); })( window );
<<<<<<< /* * The contents of this file are licenced. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function (/*exports*/ ) { "use strict"; /* global SieveGrammar */ if ( !SieveGrammar ) throw new Error( "Could not register AddressParts" ); var userpart = { node: "address-part/user", type: "address-part/", requires: "subaddress", token: ":user" }; SieveGrammar.addTag( userpart ); var detailpart = { node: "address-part/detail", type: "address-part/", requires: "subaddress", token: ":detail" }; SieveGrammar.addTag( detailpart ); })( window ); // :user "+" :detail "@" :domain // \----:local-part----/ ======= /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ "use strict"; (function (exports) { /* global SieveLexer */ /* global SieveAbstractElement */ function SieveUserPart(docshell, id) { SieveAbstractElement.call(this, docshell, id); } SieveUserPart.prototype = Object.create(SieveAbstractElement.prototype); SieveUserPart.prototype.constructor = SieveUserPart; SieveUserPart.nodeName = function () { return "address-part/user"; }; SieveUserPart.nodeType = function () { return "address-part/"; }; SieveUserPart.isCapable = function (capabilities) { return (capabilities["subaddress"] === true); }; SieveUserPart.prototype.require = function (imports) { imports["subaddress"] = true; }; SieveUserPart.isElement = function (parser, lexer) { if (parser.startsWith(":user")) return true; return false; }; SieveUserPart.prototype.init = function (parser) { parser.extract(":user"); return this; }; SieveUserPart.prototype.toScript = function () { return ":user"; }; // *************************************************************************// function SieveDetailPart(docshell, id) { SieveAbstractElement.call(this, docshell, id); } SieveDetailPart.prototype = Object.create(SieveAbstractElement.prototype); SieveDetailPart.prototype.constructor = SieveDetailPart; SieveDetailPart.nodeName = function () { return "address-part/detail"; }; SieveDetailPart.nodeType = function () { return "address-part/"; }; SieveDetailPart.isCapable = function (capabilities) { return (capabilities["subaddress"] === true); }; SieveDetailPart.prototype.require = function (imports) { imports["subaddress"] = true; }; SieveDetailPart.isElement = function (parser, lexer) { if (parser.startsWith(":detail")) return true; return false; }; SieveDetailPart.prototype.init = function (parser) { parser.extract(":detail"); return this; }; SieveDetailPart.prototype.toScript = function () { return ":detail"; }; if (!SieveLexer) throw new Error("Could not register Subaddress"); SieveLexer.register(SieveUserPart); SieveLexer.register(SieveDetailPart); })(window); // :user "+" :detail "@" :domain // \----:local-part----/ >>>>>>> /* * The contents of this file are licensed. You may obtain a copy of * the license at https://github.com/thsmi/sieve/ or request it via * email from the author. * * Do not remove or change this comment. * * The initial author of the code is: * Thomas Schmid <[email protected]> * */ /* global window */ ( function (/*exports*/ ) { "use strict"; /* global SieveGrammar */ if ( !SieveGrammar ) throw new Error( "Could not register AddressParts" ); var userpart = { node: "address-part/user", type: "address-part/", requires: "subaddress", token: ":user" }; SieveGrammar.addTag( userpart ); var detailpart = { node: "address-part/detail", type: "address-part/", requires: "subaddress", token: ":detail" }; SieveGrammar.addTag( detailpart ); })( window ); // :user "+" :detail "@" :domain // \----:local-part----/
<<<<<<< ======= * Copies the material design icons into the build directory. * * @param {string} destination * where to place the material design sources * * @returns {Stream} * a stream to be consumed by gulp */ function packageMaterialIcons(destination) { "use strict"; return src([ BASE_DIR_MATERIALICONS + "/material-design-icons.css", BASE_DIR_MATERIALICONS + "/fonts/MaterialIcons-Regular.woff2" ], { base: BASE_DIR_MATERIALICONS }).pipe(dest(destination)); } /** * Packages the common libManageSieve files * * @param {string} destination * where to place the common libManageSieve files * * @returns {Stream} * a stream to be consumed by gulp */ function packageLibManageSieve(destination) { "use strict"; return src([ BASE_DIR_LIBMANAGESIEVE + "/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /** * Packages the common libSieve files * * @param {string} destination * where to place the common libSieve files * * @returns {Stream} * a stream to be consumed by gulp */ function packageLibSieve(destination) { "use strict"; return src([ BASE_DIR_LIBSIEVE + "/**", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/rfc*.txt", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/tests/", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/tests/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /** * Packages the common managesieve.ui files * * @param {string} destination * where to place the common managesieve.ui files * * @returns {Stream} * a stream to be consumed by gulp */ function packageManageSieveUi(destination) { "use strict"; return src([ BASE_DIR_MANAGESIEVEUI + "/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /** >>>>>>> /** * Packages the common libManageSieve files * * @param {string} destination * where to place the common libManageSieve files * * @returns {Stream} * a stream to be consumed by gulp */ function packageLibManageSieve(destination) { "use strict"; return src([ BASE_DIR_LIBMANAGESIEVE + "/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /** * Packages the common libSieve files * * @param {string} destination * where to place the common libSieve files * * @returns {Stream} * a stream to be consumed by gulp */ function packageLibSieve(destination) { "use strict"; return src([ BASE_DIR_LIBSIEVE + "/**", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/rfc*.txt", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/tests/", "!" + BASE_DIR_LIBSIEVE + "/libSieve/**/tests/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /** * Packages the common managesieve.ui files * * @param {string} destination * where to place the common managesieve.ui files * * @returns {Stream} * a stream to be consumed by gulp */ function packageManageSieveUi(destination) { "use strict"; return src([ BASE_DIR_MANAGESIEVEUI + "/**" ], { base: BASE_DIR_COMMON }).pipe(dest(destination)); } /**
<<<<<<< showCookieWarning: true, selectedUserTypes: [] ======= showCookieWarning: true, firstPageVisited: null >>>>>>> showCookieWarning: true, selectedUserTypes: [], firstPageVisited: null <<<<<<< }, getSelectedUserTypes: state => [...state.selectedUserTypes] ======= }, getFirstPageVisited: state => { return state.firstPageVisited; } >>>>>>> }, getSelectedUserTypes: state => [...state.selectedUserTypes], getFirstPageVisited: state => state.firstPageVisited <<<<<<< }, toggleSelectedUserTypes ({commit, getters}, value) { const index = getters.getSelectedUserTypes.indexOf(value); if (index === -1) { commit('ADD_SELECTED_USERTYPE', value); } else { commit('RM_SELECTED_USERTYPE', index); } ======= }, setFirstPageVisited ({commit}, value) { commit('SET_FIRST_PAGE_VISITED', value); >>>>>>> }, toggleSelectedUserTypes ({commit, getters}, value) { const index = getters.getSelectedUserTypes.indexOf(value); if (index === -1) { commit('ADD_SELECTED_USERTYPE', value); } else { commit('RM_SELECTED_USERTYPE', index); } }, setFirstPageVisited ({commit}, value) { commit('SET_FIRST_PAGE_VISITED', value); <<<<<<< }, ADD_SELECTED_USERTYPE: (state, value) => { state.selectedUserTypes.push(value); }, RM_SELECTED_USERTYPE: (state, index) => { state.selectedUserTypes.splice(index, 1); ======= }, SET_FIRST_PAGE_VISITED: (state, value) => { state.firstPageVisited = value; >>>>>>> }, ADD_SELECTED_USERTYPE: (state, value) => { state.selectedUserTypes.push(value); }, RM_SELECTED_USERTYPE: (state, index) => { state.selectedUserTypes.splice(index, 1); }, SET_FIRST_PAGE_VISITED: (state, value) => { state.firstPageVisited = value;
<<<<<<< }) test("lazy observable pending", done => { const lo = utils.lazyObservable(sink => new Promise(resolve => { setTimeout(resolve, 100) }).then(sink)) expect(lo.pending).toBeFalsy() lo.current() expect(lo.pending).toBeTruthy() setTimeout(() => { expect(lo.pending).toBeFalsy() done() }, 150) ======= setTimeout(() => { expect(lo.current()).toBe(2) done() }, 250) >>>>>>> setTimeout(() => { expect(lo.current()).toBe(2) done() }, 250) }) test("lazy observable pending", done => { const lo = utils.lazyObservable(sink => new Promise(resolve => { setTimeout(resolve, 100) }).then(sink)) expect(lo.pending).toBeFalsy() lo.current() expect(lo.pending).toBeTruthy() setTimeout(() => { expect(lo.pending).toBeFalsy() done() }, 150)
<<<<<<< (function(exports) { "use strict"; // Define the `firebase` module under which all AngularFire // services will live. angular.module("firebase", []) .value("Firebase", exports.Firebase) // used in conjunction with firebaseUtils.debounce function, this is the // amount of time we will wait for additional records before triggering // Angular's digest scope to dirty check and re-render DOM elements. A // larger number here significantly improves performance when working with // big data sets that are frequently changing in the DOM, but delays the // speed at which each record is rendered in real-time. A number less than // 100ms will usually be optimal. .value('firebaseBatchDelay', 50 /* milliseconds */); })(window); ======= // // AngularFire 0.7.2-pre // http://angularfire.com // License: MIT >>>>>>> <<<<<<< 'use strict'; angular.module('firebase').factory('$FirebaseArray', ["$q", "$log", "$firebaseUtils", function($q, $log, $firebaseUtils) { function FirebaseArray($firebase, recordFactory) { $firebaseUtils.assertValidRecordFactory(recordFactory); this._list = []; this._factory = recordFactory; this._inst = $firebase; this._promise = this._init(); return this._list; ======= "use strict"; var AngularFire, AngularFireAuth; // Define the `firebase` module under which all AngularFire // services will live. angular.module("firebase", []).value("Firebase", Firebase); // Define the `$firebase` service that provides synchronization methods. angular.module("firebase").factory("$firebase", ["$q", "$parse", "$timeout", function($q, $parse, $timeout) { // The factory returns an object containing the value of the data at // the Firebase location provided, as well as several methods. It // takes a single argument: // // * `ref`: A Firebase reference. Queries or limits may be applied. return function(ref) { var af = new AngularFire($q, $parse, $timeout, ref); return af.construct(); }; } ]); // Define the `orderByPriority` filter that sorts objects returned by // $firebase in the order of priority. Priority is defined by Firebase, // for more info see: https://www.firebase.com/docs/ordered-data.html angular.module("firebase").filter("orderByPriority", function() { return function(input) { var sorted = []; if (input) { if (!input.$getIndex || typeof input.$getIndex !== "function") { // input is not an angularFire instance if (angular.isArray(input)) { // If input is an array, copy it sorted = input.slice(0); } else if (angular.isObject(input)) { // If input is an object, map it to an array angular.forEach(input, function(prop) { sorted.push(prop); }); } } else { // input is an angularFire instance var index = input.$getIndex(); if (index.length > 0) { for (var i = 0; i < index.length; i++) { var val = input[index[i]]; if (val) { if (angular.isObject(val)) { val.$id = index[i]; } sorted.push(val); } } } } } return sorted; }; }); // Shim Array.indexOf for IE compatibility. if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (searchElement, fromIndex) { if (this === undefined || this === null) { throw new TypeError("'this' is null or not defined"); } // Hack to convert object.length to a UInt32 // jshint -W016 var length = this.length >>> 0; fromIndex = +fromIndex || 0; // jshint +W016 if (Math.abs(fromIndex) === Infinity) { fromIndex = 0; } if (fromIndex < 0) { fromIndex += length; if (fromIndex < 0) { fromIndex = 0; } >>>>>>> <<<<<<< save: function(indexOrItem) { var item = this._resolveItem(indexOrItem); var key = this._factory.getKey(item); return this.inst().set(key, this._factory.toJSON(item), this._compile); }, ======= if (typeof ref === "string") { throw new Error("Please provide a Firebase reference instead " + "of a URL, eg: new Firebase(url)"); } this._fRef = ref; }; >>>>>>> <<<<<<< }, ======= } if (typeof item === "object") { ref = self._fRef.ref().push(self._parseObject(item), _addCb); } else { ref = self._fRef.ref().push(item, _addCb); } >>>>>>> <<<<<<< _resolveItem: function(indexOrItem) { return angular.isNumber(indexOrItem)? this[indexOrItem] : indexOrItem; }, ======= // Set the current state of the object to the specified value. Calling // this is the equivalent of calling `set()` on a Firebase reference. // Takes a single mandatory argument: // // * `newValue`: The value which should overwrite data stored at // this location. // // This function returns a promise that will be resolved when the // data has been successfully saved to the server. object.$set = function(newValue) { var deferred = self._q.defer(); self._fRef.ref().set(self._parseObject(newValue), function(err) { if (err) { deferred.reject(err); } else { deferred.resolve(); } }); return deferred.promise; }; // Non-destructively update only a subset of keys for the current object. // This is the equivalent of calling `update()` on a Firebase reference. // Takes a single mandatory argument: // // * `newValue`: The set of keys and values that must be updated for // this location. // // This function returns a promise that will be resolved when the data // has been successfully saved to the server. object.$update = function(newValue) { var deferred = self._q.defer(); self._fRef.ref().update(self._parseObject(newValue), function(err) { if (err) { deferred.reject(err); } else { deferred.resolve(); } }); return deferred.promise; }; // Update a value within a transaction. Calling this is the // equivalent of calling `transaction()` on a Firebase reference. // // * `updateFn`: A developer-supplied function which will be passed // the current data stored at this location (as a // Javascript object). The function should return the // new value it would like written (as a Javascript // object). If "undefined" is returned (i.e. you // "return;" with no arguments) the transaction will // be aborted and the data at this location will not // be modified. // * `applyLocally`: By default, events are raised each time the // transaction update function runs. So if it is run // multiple times, you may see intermediate states. // You can set this to false to suppress these // intermediate states and instead wait until the // transaction has completed before events are raised. // // This function returns a promise that will be resolved when the // transaction function has completed. A successful transaction is // resolved with the snapshot. If the transaction is aborted, // the promise will be resolved with null. object.$transaction = function(updateFn, applyLocally) { var deferred = self._q.defer(); self._fRef.ref().transaction(updateFn, function(err, committed, snapshot) { if (err) { deferred.reject(err); } else if (!committed) { deferred.resolve(null); } else { deferred.resolve(snapshot); } }, applyLocally); return deferred.promise; }; // Remove this object from the remote data. Calling this is the // equivalent of calling `remove()` on a Firebase reference. This // function takes a single optional argument: // // * `key`: Specify a child key to remove. If no key is specified, the // entire object will be removed from the remote data store. // // This function returns a promise that will be resolved when the // object has been successfully removed from the server. object.$remove = function(key) { var deferred = self._q.defer(); function _removeCb(err) { if (err) { deferred.reject(err); } else { deferred.resolve(); } } >>>>>>> <<<<<<< _serverAdd: function(snap, prevId) { var data = parseVal(snap.name(), snap.val()); this._moveTo(snap.name(), data, prevId); this._handleEvent('child_added', snap.name(), data); }, ======= function _isPrimitive(v) { return v === null || typeof(v) !== "object"; } >>>>>>> <<<<<<< ======= // We handle primitives and objects here together. There is no harm in having // child_* listeners attached; if the data suddenly changes between an object // and a primitive, the child_added/removed events will fire, and our data here // will get updated accordingly so we should be able to transition without issue self._fRef.on("value", function(snap) { // primitive handling var value = snap.val(); if( _isPrimitive(value) ) { value = handleNullValues(value); self._updatePrimitive(value); } else { delete self._object.$value; } // broadcast the value event self._broadcastEvent("value", self._makeEventSnapshot(snap.name(), value)); // broadcast initial loaded event once data and indices are set up appropriately if( !self._loaded ) { _initialLoad(value); } }); >>>>>>> <<<<<<< _serverMove: function(snap, prevId) { var id = snap.name(); var oldPos = this.posByKey(id); if( oldPos !== -1 ) { var data = this.list[oldPos]; this.list.splice(oldPos, 1); this._moveTo(id, data, prevId); this._handleEvent('child_moved', snap.name(), data); ======= // Called whenever there is a remote change. Applies them to the local // model for both explicit and implicit sync modes. _updateModel: function(key, value) { if (value === null) { delete this._object[key]; } else { this._object[key] = value; >>>>>>> <<<<<<< _monit: function(event, method) { this.subs.push([event, this.ref.on(event, method.bind(this))]); } }; ======= // If event handlers for a specified event were attached, call them. _broadcastEvent: function(evt, param) { var cbs = this._on[evt] || []; if( evt === "loaded" ) { this._on[evt] = []; // release memory } var self = this; >>>>>>> <<<<<<< for(key in data) { if( data.hasOwnProperty(key) ) { base[key] = data[key]; ======= if (cbs.length > 0) { for (var i = 0; i < cbs.length; i++) { if (typeof cbs[i] === "function") { _wrapTimeout(cbs[i], param); } >>>>>>> <<<<<<< function isObject(x) { return typeof(x) === 'object' && x !== null; } function findKeyPos(list, key) { for(var i = 0, len = list.length; i < len; i++) { if( list[i].$id === key ) { return i; ======= // triggers an initial event for loaded, value, and child_added events (which get immediate feedback) _sendInitEvent: function(evt, callback) { var self = this; if( self._loaded && ["child_added", "loaded", "value"].indexOf(evt) > -1 ) { self._timeout(function() { var parsedValue = self._object.hasOwnProperty("$value")? self._object.$value : self._parseObject(self._object); switch(evt) { case "loaded": callback(parsedValue); break; case "value": callback(self._makeEventSnapshot(self._fRef.name(), parsedValue, null)); break; case "child_added": self._iterateChildren(parsedValue, function(name, val, prev) { callback(self._makeEventSnapshot(name, val, prev)); }); break; default: // not reachable } }); >>>>>>> <<<<<<< set: function(key, data) { var ref = this._ref; var def = $q.defer(); if( arguments.length > 1 ) { ref = ref.child(key); } else { data = key; } ref.set(data, this._handle(def)); return def.promise; }, ======= // This function creates a 3-way binding between the provided scope model // and Firebase. All changes made to the local model are saved to Firebase // and changes to the remote data automatically appear on the local model. _bind: function(scope, name, defaultFn) { var self = this; var deferred = self._q.defer(); // _updateModel or _updatePrimitive will take care of updating the local // model if _bound is set to true. self._name = name; self._bound = true; self._scope = scope; // If the local model is an object, call an update to set local values. var local = self._parse(name)(scope); if (local !== undefined && typeof local === "object") { self._fRef.ref().update(self._parseObject(local)); } >>>>>>> <<<<<<< update: function(key, data) { var ref = this._ref; var def = $q.defer(); if( arguments.length > 1 ) { ref = ref.child(key); ======= // Once we receive the initial value, the promise will be resolved. self._object.$on("loaded", function(value) { self._timeout(function() { if(value === null && typeof defaultFn === "function") { scope[name] = defaultFn(); >>>>>>> <<<<<<< _assertValidConfig: function(ref, cnf) { $firebaseUtils.assertValidRef(ref, 'Must pass a valid Firebase reference ' + 'to $firebase (not a string or URL)'); $firebaseUtils.assertValidRecordFactory(cnf.recordFactory); if( typeof(cnf.arrayFactory) !== 'function' ) { throw new Error('config.arrayFactory must be a valid function'); } if( typeof(cnf.objectFactory) !== 'function' ) { throw new Error('config.arrayFactory must be a valid function'); ======= // Parse a local model, removing all properties beginning with "$" and // converting $priority to ".priority". _parseObject: function(obj) { function _findReplacePriority(item) { for (var prop in item) { if (item.hasOwnProperty(prop)) { if (prop === "$priority") { item[".priority"] = item.$priority; delete item.$priority; } else if (typeof item[prop] === "object") { _findReplacePriority(item[prop]); } >>>>>>>
<<<<<<< '$q', '$firebaseUtils', function($q, $firebaseUtils) { ======= '$q', '$log', function($q, $log) { >>>>>>> '$q', '$firebaseUtils', '$log', function($q, $firebaseUtils, $log) { <<<<<<< var auth = new FirebaseAuth($q, $firebaseUtils, ref); ======= var auth = new FirebaseAuth($q, $log, ref); >>>>>>> var auth = new FirebaseAuth($q, $firebaseUtils, $log, ref); <<<<<<< FirebaseAuth = function($q, $firebaseUtils, ref) { ======= FirebaseAuth = function($q, $log, ref) { >>>>>>> FirebaseAuth = function($q, $firebaseUtils, $log, ref) { <<<<<<< this._utils = $firebaseUtils; ======= this._log = $log; >>>>>>> this._utils = $firebaseUtils; this._log = $log; <<<<<<< ======= /** * Common login completion handler for all authentication methods. * * @param {Promise} deferred A deferred promise which is either resolved or rejected. * @param {Error|null} error A Firebase error if authentication fails. * @param {Object|null} authData The authentication state upon successful authentication. */ _onLoginHandler: function(deferred, error, authData) { if (error !== null) { deferred.reject(error); } else { deferred.resolve(authData); } }, >>>>>>> <<<<<<< this._ref.createUser({ email: email, password: password }, this._utils.makeNodeResolver(deferred)); ======= // Allow this method to take a single credentials argument or two separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $createUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, password: password }; } this._ref.createUser(credentials, function(error) { if (error !== null) { deferred.reject(error); } else { deferred.resolve(user); } }); >>>>>>> // Allow this method to take a single credentials argument or two separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $createUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, password: password }; } this._ref.createUser(credentials, this._utils.makeNodeResolver(deferred)); <<<<<<< this._ref.changePassword({ email: email, oldPassword: oldPassword, newPassword: newPassword }, this._utils.makeNodeResolver(deferred)); ======= // Allow this method to take a single credentials argument or three separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $changePassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, oldPassword: oldPassword, newPassword: newPassword }; } this._ref.changePassword(credentials, function(error) { if (error !== null) { deferred.reject(error); } else { deferred.resolve(); } }); >>>>>>> // Allow this method to take a single credentials argument or three separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $changePassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, oldPassword: oldPassword, newPassword: newPassword }; } this._ref.changePassword(credentials, this._utils.makeNodeResolver(deferred)); <<<<<<< this._ref.removeUser({ email: email, password: password }, this._utils.makeNodeResolver(deferred)); ======= // Allow this method to take a single credentials argument or two separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $removeUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, password: password }; } this._ref.removeUser(credentials, function(error) { if (error !== null) { deferred.reject(error); } else { deferred.resolve(); } }); >>>>>>> // Allow this method to take a single credentials argument or two separate string arguments var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $removeUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials, password: password }; } this._ref.removeUser(credentials, this._utils.makeNodeResolver(deferred)); <<<<<<< this._ref.resetPassword({ email: email }, this._utils.makeNodeResolver(deferred)); ======= // Allow this method to take a single credentials argument or a single string argument var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $resetPassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials }; } this._ref.resetPassword(credentials, function(error) { if (error !== null) { deferred.reject(error); } else { deferred.resolve(); } }); >>>>>>> // Allow this method to take a single credentials argument or a single string argument var credentials = emailOrCredentials; if (typeof emailOrCredentials === "string") { this._log.warn("Passing in credentials to $resetPassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details."); credentials = { email: emailOrCredentials }; } this._ref.resetPassword(credentials, this._utils.makeNodeResolver(deferred));
<<<<<<< this.$id = $firebase.$ref().name(); this.$priority = null; ======= self.$id = $firebase.$ref().ref().name(); self.$priority = null; >>>>>>> this.$id = $firebase.$ref().ref().name(); this.$priority = null;
<<<<<<< this._fRef = ref; } ======= }; >>>>>>> this._fRef = ref; }; <<<<<<< ======= if (type === undefined) { type = []; } >>>>>>> <<<<<<< ======= self._remoteValue = type; if (snap && snap.val()) { var val = snap.val(); // If the remote type doesn't match what was provided, log a message // and exit. if (typeof val != typeof type) { self._log("Error: type mismatch"); return; } // Also distinguish between objects and arrays. var check = Object.prototype.toString; if (check.call(type) != check.call(val)) { self._log("Error: type mismatch"); return; } self._remoteValue = angular.copy(val); // If the new remote value is the same as the local value, ignore. if (angular.equals(val, self._parse(name)($scope))) { return; } } >>>>>>> <<<<<<< self._resolve($scope, name, resolve, remote) ======= self._resolve($scope, name, resolve, self._remoteValue); >>>>>>> self._resolve($scope, name, resolve, remote); <<<<<<< angular.extend(this, {$priority: ref.getPriority()}, ref.val()); } ======= angular.extend(this, {priority: ref.getPriority()}, ref.val()); }; >>>>>>> angular.extend(this, {$priority: ref.getPriority()}, ref.val()); };
<<<<<<< // These are private config props and functions used internally // they are collected here to reduce clutter in console.log and forEach this.$$conf = { ======= // IDE does not understand defineProperty so declare traditionally // to avoid lots of IDE warnings about invalid properties this.$$conf = { >>>>>>> // These are private config props and functions used internally // they are collected here to reduce clutter in console.log and forEach this.$$conf = { <<<<<<< this.$id = $firebase.$ref().ref().name(); this.$priority = null; ======= // this bit of magic makes $$conf non-enumerable and non-configurable // and non-writable (its properties are still writable but the ref cannot be replaced) Object.defineProperty(this, '$$conf', { value: this.$$conf }); this.$id = $firebase.$ref().ref().name(); this.$priority = null; $firebaseUtils.applyDefaults(this, this.$$defaults); >>>>>>> // this bit of magic makes $$conf non-enumerable and non-configurable // and non-writable (its properties are still writable but the ref cannot be replaced) // we declare it above so the IDE can relax Object.defineProperty(this, '$$conf', { value: this.$$conf }); this.$id = $firebase.$ref().ref().name(); this.$priority = null; $firebaseUtils.applyDefaults(this, this.$$defaults); <<<<<<< var self = this; return self.$inst().$set($firebaseUtils.toJSON(self)) ======= var notify = this.$$notify.bind(this); return this.$inst().$set($firebaseUtils.toJSON(this)) >>>>>>> var self = this; return self.$inst().$set($firebaseUtils.toJSON(self)) <<<<<<< }, /** * Called internally by $bindTo when data is changed in $scope. * Should apply updates to this record but should not call * notify(). */ $$scopeUpdated: function(newData) { // we use a one-directional loop to avoid feedback with 3-way bindings // since set() is applied locally anyway, this is still performant return this.$inst().$set($firebaseUtils.toJSON(newData)); }, /** * Updates any bound scope variables and notifies listeners registered * with $watch any time there is a change to data */ $$notify: function() { var self = this, list = this.$$conf.listeners.slice(); // be sure to do this after setting up data and init state angular.forEach(list, function (parts) { parts[0].call(parts[1], {event: 'value', key: self.$id}); }); ======= }, /** * Updates any bound scope variables and notifies listeners registered * with $watch any time there is a change to data */ $$notify: function() { var self = this; if( self.$$conf.bound ) { self.$$conf.bound.update(); } // be sure to do this after setting up data and init state angular.forEach(self.$$conf.listeners, function (parts) { parts[0].call(parts[1], {event: 'value', key: self.$id}); }); }, /** * Overrides how Angular.forEach iterates records on this object so that only * fields stored in Firebase are part of the iteration. To include meta fields like * $id and $priority in the iteration, utilize for(key in obj) instead. */ forEach: function(iterator, context) { return $firebaseUtils.each(this, iterator, context); >>>>>>> }, /** * Called internally by $bindTo when data is changed in $scope. * Should apply updates to this record but should not call * notify(). */ $$scopeUpdated: function(newData) { // we use a one-directional loop to avoid feedback with 3-way bindings // since set() is applied locally anyway, this is still performant return this.$inst().$set($firebaseUtils.toJSON(newData)); }, /** * Updates any bound scope variables and notifies listeners registered * with $watch any time there is a change to data */ $$notify: function() { var self = this, list = this.$$conf.listeners.slice(); // be sure to do this after setting up data and init state angular.forEach(list, function (parts) { parts[0].call(parts[1], {event: 'value', key: self.$id}); }); }, /** * Overrides how Angular.forEach iterates records on this object so that only * fields stored in Firebase are part of the iteration. To include meta fields like * $id and $priority in the iteration, utilize for(key in obj) instead. */ forEach: function(iterator, context) { return $firebaseUtils.each(this, iterator, context);
<<<<<<< render() { const html = _.get(this, 'props.data.markdownRemark.html', ''); ======= render() { const { markdownRemark } = this.props.data; const html = markdownRemark && markdownRemark.html ? markdownRemark.html : ''; >>>>>>> render() { const { markdownRemark } = this.props.data; const html = markdownRemark && markdownRemark.html ? markdownRemark.html : ''; <<<<<<< query($relativePath: String!) { markdownRemark(fields: { relativePath: { eq: $relativePath } }) { html } site { pathPrefix, siteMetadata { title description image url type siteName githubUrl } } menu { pages } ======= query DocsPostByPath($relativePath: String!) { markdownRemark(fields: { relativePath: { eq: $relativePath } }) { html >>>>>>> query DocsPostByPath($relativePath: String!) { markdownRemark(fields: { relativePath: { eq: $relativePath } }) { html } site { pathPrefix, siteMetadata { title description image url type siteName githubUrl } } menu { pages }
<<<<<<< var defs = { spo: ["subject", "predicate", "object"], sop: ["subject", "object", "predicate"], pso: ["predicate", "subject", "object"], pos: ["predicate", "object", "subject"], ops: ["object", "predicate", "subject"], osp: ["object", "subject", "predicate"] }; ======= var CallbackStream = require("callback-stream") , Variable = require("./variable") , defs = { spo: ["subject", "predicate", "object"], sop: ["subject", "object", "predicate"], pso: ["predicate", "object", "subject"], pos: ["predicate", "subject", "object"], ops: ["object", "predicate", "subject"], osp: ["object", "subject", "predicate"] }; >>>>>>> var CallbackStream = require("callback-stream") , Variable = require("./variable") , defs = { spo: ["subject", "predicate", "object"], sop: ["subject", "object", "predicate"], pso: ["predicate", "object", "subject"], pos: ["predicate", "subject", "object"], ops: ["object", "predicate", "subject"], osp: ["object", "subject", "predicate"] }; <<<<<<< var CallbackStream = require("./callbackstream") , Variable = require("./variable"); ======= >>>>>>> <<<<<<< module.exports.genActions = genActions; function materializer(pattern, data) { return Object.keys(pattern) .reduce(function(result, key) { if (pattern[key] instanceof Variable) { result[key] = data[pattern[key].name]; } else { result[key] = pattern[key]; } return result; }, {}); } module.exports.materializer = materializer; function objectMask(criteria, object) { return Object.keys(object). filter(function(key) { return criteria(object, key); }). reduce(function(acc, key) { acc[key] = object[key]; return acc; }, {}); } module.exports.queryMask = objectMask.bind(null, function(triple, key) { return typeof triple[key] !== "object"; }); module.exports.variablesMask = objectMask.bind(null, function(triple, key) { return triple[key] instanceof Variable; }); ======= module.exports.genActions = genActions; var objectMask = function(criteria, object) { return Object.keys(object). filter(function(key) { return criteria(object, key); }). reduce(function(acc, key) { acc[key] = object[key]; return acc; }, {}); }; module.exports.queryMask = objectMask.bind(null, function(triple, key) { return typeof triple[key] !== "object"; }); module.exports.variablesMask = objectMask.bind(null, function(triple, key) { return triple[key] instanceof Variable; }); >>>>>>> module.exports.genActions = genActions; function materializer(pattern, data) { return Object.keys(pattern) .reduce(function(result, key) { if (pattern[key] instanceof Variable) { result[key] = data[pattern[key].name]; } else { result[key] = pattern[key]; } return result; }, {}); } module.exports.materializer = materializer; var objectMask = function(criteria, object) { return Object.keys(object). filter(function(key) { return criteria(object, key); }). reduce(function(acc, key) { acc[key] = object[key]; return acc; }, {}); }; module.exports.queryMask = objectMask.bind(null, function(triple, key) { return typeof triple[key] !== "object"; }); module.exports.variablesMask = objectMask.bind(null, function(triple, key) { return triple[key] instanceof Variable; });
<<<<<<< version: "1.X.X", //Added in 1.8.8 ======= version: "1.9", //Added in 1.8.8 >>>>>>> version: "1.9", //Added in 1.8.8 <<<<<<< <option value="0" selected>Is Bot?</option> <option value="2">Is Kickable?</option> <option value="1">Is Bannable?</option> <option value="4">Is In Voice Channel?</option> <option value="5">Is User Manageable?</option> <option value="6">Is Bot Owner?</option> ======= <option value="0" selected>Is Bot</option> <option value="2">Is Kickable</option> <option value="1">Is Bannable</option> <option value="4">Is In Voice Channel</option> <option value="5">Is User Manageable?</option> >>>>>>> <option value="0" selected>Is Bot</option> <option value="2">Is Kickable</option> <option value="1">Is Bannable</option> <option value="4">Is In Voice Channel</option> <option value="5">Is User Manageable?</option> <option value="6">Is Bot Owner?</option> <<<<<<< case 5: result = member.manageable; break; case 6: if(member.id == dibiem.Files.data.settings.ownerId) { result = true; } else { result = false; } break; ======= case 5: result = member.manageable; break; >>>>>>> case 5: result = member.manageable; break; case 6: if(member.id == dibiem.Files.data.settings.ownerId) { result = true; } else { result = false; } break;
<<<<<<< import Layout from '~components/layout' import VolunteersList from '~components/common/volunteers-list' ======= import ContentfulContent from '~components/common/contentful-content' import Layout from '../../components/layout' import VolunteersList from '../../components/common/volunteers-list' >>>>>>> import ContentfulContent from '~components/common/contentful-content' import Layout from '~components/layout' import VolunteersList from '~components/common/volunteers-list'
<<<<<<< const SocialSharing = ({ shares, url, text }) => { ======= export default ({ shares, url, text, twitterText }) => { >>>>>>> const SocialSharing = ({ shares, url, text, twitterText }) => {
<<<<<<< centered ======= hero={hero} >>>>>>> centered hero={hero}
<<<<<<< /* eslint jsx-a11y/label-has-associated-control: 0 */ import React, { useState } from 'react' import { graphql } from 'gatsby' import { Combobox, ComboboxInput, ComboboxPopover, ComboboxList, ComboboxOption, } from '@reach/combobox' import '@reach/combobox/styles.css' import { Flex, Box } from '../../components/common/flexbox' import State from '../../components/common/state-data' import Layout from '../../components/layout' import { SyncInfobox } from '../../components/common/infobox' ======= import React from 'react' import { graphql } from 'gatsby' >>>>>>> /* eslint jsx-a11y/label-has-associated-control: 0 */ import React, { useState } from 'react' import { graphql } from 'gatsby' import { Combobox, ComboboxInput, ComboboxPopover, ComboboxList, ComboboxOption, } from '@reach/combobox' import '@reach/combobox/styles.css' import { Flex, Box } from '../../components/common/flexbox' import Layout from '../../components/layout' import { SyncInfobox } from '../../components/common/infobox' import React from 'react' import { graphql } from 'gatsby' <<<<<<< const StateList = ({ states, stateData }) => { const stateList = [] states.forEach(({ node }) => { const state = node stateData.forEach(data => { if (data.node.state === state.state) { state.stateData = data.node } }) stateList.push(state) }) return ( <Flex flexWrap="wrap" m="0 -10px"> {stateList.map(state => ( <Box width={1} mb={['1rem', '1.5rem']} p="0 10px" className="data-state" > <State state={state} stateData={state.stateData} /> </Box> ))} </Flex> ) } const StatesNoScriptNav = ({ stateList }) => ( <> <noscript> <style>{` .state-nav { display: block !important; } `}</style> </noscript> <Box width={[1, 1, 1, 1 / 2]} className="state-nav" m="0 auto 1rem"> <h3>Jump to a state:</h3> <ul> {stateList.map(({ node }) => ( <li key={node.state}> <a href={`#state-${node.state.toLowerCase()}`}>{node.state}</a> </li> ))} </ul> </Box> </> ) const StatesNav = ({ stateList }) => { const [searchTerm, setSearchTerm] = useState('') const searchStates = term => { if (term.trim() === '') { return null } const results = [] stateList.forEach(({ node }) => { if (node.name.toLowerCase().search(term.toLowerCase().trim()) === 0) { results.push(node) } }) return results } const results = searchStates(searchTerm) return ( <div className="state-combobox-nav"> <noscript> <style>{` .state-combobox-nav { display: none !important; } `}</style> </noscript> <label htmlFor="jump-to-state"> Type a state&apos;s name to jump to it </label> <Combobox openOnFocus onSelect={selectedItem => { const stateId = stateList.find(({ node }) => { return node.name === selectedItem }) if (stateId && typeof window !== 'undefined') { window.location.hash = `state-${stateId.node.state.toLowerCase()}` } }} > <ComboboxInput id="jump-to-state" placeholder="State or territory" autoComplete="off" onChange={event => { setSearchTerm(event.target.value) }} /> {results ? ( <ComboboxPopover className="state-combobox-popover"> {results.length > 0 ? ( <ComboboxList aria-label="States"> {results.slice(0, 10).map(result => ( <ComboboxOption key={`state-search-${result.state}`} value={result.name} /> ))} </ComboboxList> ) : ( <span style={{ display: 'block', margin: 8 }}> No states found </span> )} </ComboboxPopover> ) : ( <ComboboxPopover className="state-combobox-popover"> <ComboboxList> {stateList.map(({ node }) => ( <ComboboxOption key={`state-search-${node.state}`} value={node.name} /> ))} </ComboboxList> </ComboboxPopover> )} </Combobox> </div> ) } // The top-level content of this page is from 'src/content/snippets/data.md' ======= >>>>>>> const StatesNoScriptNav = ({ stateList }) => ( <> <noscript> <style>{` .state-nav { display: block !important; } `}</style> </noscript> <Box width={[1, 1, 1, 1 / 2]} className="state-nav" m="0 auto 1rem"> <h3>Jump to a state:</h3> <ul> {stateList.map(({ node }) => ( <li key={node.state}> <a href={`#state-${node.state.toLowerCase()}`}>{node.state}</a> </li> ))} </ul> </Box> </> ) const StatesNav = ({ stateList }) => { const [searchTerm, setSearchTerm] = useState('') const searchStates = term => { if (term.trim() === '') { return null } const results = [] stateList.forEach(({ node }) => { if (node.name.toLowerCase().search(term.toLowerCase().trim()) === 0) { results.push(node) } }) return results } const results = searchStates(searchTerm) return ( <div className="state-combobox-nav"> <noscript> <style>{` .state-combobox-nav { display: none !important; } `}</style> </noscript> <label htmlFor="jump-to-state"> Type a state&apos;s name to jump to it </label> <Combobox openOnFocus onSelect={selectedItem => { const stateId = stateList.find(({ node }) => { return node.name === selectedItem }) if (stateId && typeof window !== 'undefined') { window.location.hash = `state-${stateId.node.state.toLowerCase()}` } }} > <ComboboxInput id="jump-to-state" placeholder="State or territory" autoComplete="off" onChange={event => { setSearchTerm(event.target.value) }} /> {results ? ( <ComboboxPopover className="state-combobox-popover"> {results.length > 0 ? ( <ComboboxList aria-label="States"> {results.slice(0, 10).map(result => ( <ComboboxOption key={`state-search-${result.state}`} value={result.name} /> ))} </ComboboxList> ) : ( <span style={{ display: 'block', margin: 8 }}> No states found </span> )} </ComboboxPopover> ) : ( <ComboboxPopover className="state-combobox-popover"> <ComboboxList> {stateList.map(({ node }) => ( <ComboboxOption key={`state-search-${node.state}`} value={node.name} /> ))} </ComboboxList> </ComboboxPopover> )} </Combobox> </div> ) } // The top-level content of this page is from 'src/content/snippets/data.md' <<<<<<< <Flex flexWrap="wrap" alignItems="baseline" className="data-states-header" my={['0.5rem', '2rem']} > <Box width={[1, 1, 1 / 2]}> <h2 id="states-top">Totals by state</h2> </Box> <Box width={[1, 1, 1 / 2]} textAlign={['left', 'left', 'right']}> <StatesNav stateList={data.allCovidStateInfo.edges} /> </Box> </Flex> <StatesNoScriptNav stateList={data.allCovidStateInfo.edges} /> ======= <h2 id="states-top">States</h2> <StateNav stateList={data.allCovidState.edges} /> >>>>>>> <Flex flexWrap="wrap" alignItems="baseline" className="data-states-header" my={['0.5rem', '2rem']} > <Box width={[1, 1, 1 / 2]}> <h2 id="states-top">Totals by state</h2> </Box> <Box width={[1, 1, 1 / 2]} textAlign={['left', 'left', 'right']}> <StatesNav stateList={data.allCovidStateInfo.edges} /> </Box> </Flex> <StatesNoScriptNav stateList={data.allCovidStateInfo.edges} />
<<<<<<< const [menuState, setShowSubMenu] = useState() const ref = useRef() useOnClickOutside(ref, () => setShowSubMenu(menuState)) // Call hook passing in the ref and a function to call on outside click const toggleSubMenu = index => { setShowSubMenu(menuState === index ? '' : index) } ======= const subNavigation = {} data.allContentfulNavigationGroup.edges.forEach(({ node }) => { subNavigation[node.slug] = node.pages }) >>>>>>> const [menuState, setShowSubMenu] = useState() const ref = useRef() useOnClickOutside(ref, () => setShowSubMenu(menuState)) // Call hook passing in the ref and a function to call on outside click const toggleSubMenu = index => { setShowSubMenu(menuState === index ? '' : index) } const subNavigation = {} data.allContentfulNavigationGroup.edges.forEach(({ node }) => { subNavigation[node.slug] = node.pages }) <<<<<<< {data.allNavigationYaml.edges[0].node.items.map((item, index) => ( <li className={`${menuState === index ? headerStyle.showSubMenu : ''}`} key={item.link} ref={ref} > <Link to={item.link} aria-haspopup="true" aria-expanded="false"> {item.title} </Link> <ul className="sub-menu" aria-label="Sub-menu"> <li> <a href="#test">States / Territories</a> </li> <li> <a href="#test">Counties</a> </li> <li> <a href="#test">Historical Data</a> </li> <li> <a href="#test">API</a> </li> <li> <a href="#test">Racial Data Dashboard</a> </li> <li> <a href="#test">Nursing Home Data</a> </li> </ul> <button className={headerStyle.navCaret} type="button" aria-expanded={menuState === index} aria-label={menuState === index ? 'hide' : 'show'} onClick={() => { toggleSubMenu(index) }} > <img src={navCaretIcon} alt="" /> </button> ======= {data.allNavigationYaml.edges[0].node.items.map(item => ( <li key={item.link}> <Link to={item.link}>{item.title}</Link> {item.subNavigation && typeof subNavigation[item.subNavigation] !== 'undefined' && ( <SubNavigation items={subNavigation[item.subNavigation]} /> )} >>>>>>> {data.allNavigationYaml.edges[0].node.items.map((item, index) => ( <li key={item.link} ref={ref}> <Link to={item.link}>{item.title}</Link> {item.subNavigation && typeof subNavigation[item.subNavigation] !== 'undefined' && ( <SubNavigation items={subNavigation[item.subNavigation]} /> )} <button className={headerStyle.navCaret} type="button" aria-expanded={menuState === index} aria-label={menuState === index ? 'hide' : 'show'} onClick={() => { toggleSubMenu(index) }} > <img src={navCaretIcon} alt="" /> </button>
<<<<<<< const data = useMemo(() => { const nodes = query.allCovidUsDaily.nodes .map(node => [ { date: parseDate(node.date), label: 'Deaths', value: node.deathIncrease, }, ]) .reduce((acc, val) => acc.concat(val), []) return nodes.sort((a, b) => { ======= const data = query.allCovidUsDaily.nodes .map(node => [ { date: parseDate(node.date), label: 'Deaths', value: node.death, }, ]) .reduce((acc, val) => acc.concat(val), []) .sort((a, b) => { >>>>>>> const data = query.allCovidUsDaily.nodes .map(node => [ { date: parseDate(node.date), label: 'Deaths', value: node.deathIncrease, }, ]) .reduce((acc, val) => acc.concat(val), []) .sort((a, b) => { <<<<<<< <section> <div> <h4>Daily deaths in the US</h4> <div> <BarChart data={data} fill="#4C5559" height={400} marginBottom={40} marginLeft={80} marginRight={10} marginTop={10} xTicks={3} width={400} /> </div> </div> ======= <div> <h4>Total deaths in the US</h4> >>>>>>> <div> <h4>Daily deaths in the US</h4>
<<<<<<< annotations = false, ======= longTermCare, >>>>>>> longTermCare, annotations = false,
<<<<<<< <Layout title="Search results" textHeavy narrow> <Form ======= <Layout title="Search results" narrow> <form >>>>>>> <Layout title="Search results" narrow> <Form
<<<<<<< function buildDate(argument) { dt = DateTime.fromObject({ zone: 'America/New_York' }) meridiem = dt.hour > 11 ? 'p' : 'a' return `${dt.toFormat('h:mm')} ${meridiem}m ET` } ======= >>>>>>> <<<<<<< resolve: 'gatsby-source-covid-tracking-api', options: { file: './_data/v1/volunteers.json', type: 'CovidVolunteers', }, }, { resolve: `gatsby-plugin-typography`, ======= resolve: 'gatsby-plugin-typography', >>>>>>> resolve: 'gatsby-source-covid-tracking-api', options: { file: './_data/v1/volunteers.json', type: 'CovidVolunteers', }, }, { resolve: `gatsby-plugin-typography`,
<<<<<<< import Layout from '~components/layout' ======= import ContentfulContent from '~components/common/contentful-content' import Layout from '../components/layout' >>>>>>> import Layout from '~components/layout' import ContentfulContent from '~components/common/contentful-content'
<<<<<<< const groupedRaceNotes = [...new Set(Object.values(raceNotes))] .filter(value => value && value) .reverse() ======= const groupedRaceNotes = [...new Set(Object.values(raceNotes))].filter( value => value && value.trim().length && value, ) >>>>>>> const groupedRaceNotes = [...new Set(Object.values(raceNotes))] .filter(value => value && value) .reverse() <<<<<<< const groupedEthnicityNotes = [...new Set(Object.values(ethnicityNotes))] .filter(value => value && value) .reverse() ======= const groupedEthnicityNotes = [ ...new Set(Object.values(ethnicityNotes)), ].filter(value => value && value.trim().length && value) if (!stateData.anyPosData && !stateData.anyDeathData) { return <NoData stateName={stateData.name} /> } >>>>>>> const groupedEthnicityNotes = [...new Set(Object.values(ethnicityNotes))] .filter(value => value && value) .reverse() if (!stateData.anyPosData && !stateData.anyDeathData) { return <NoData stateName={stateData.name} /> }
<<<<<<< <StateCharts history={data.allCovidUsDaily.nodes} /> <DetailText> <MarkdownContent html={data.dataSummaryFootnote.content.childMarkdownRemark.html} /> </DetailText> ======= <Container narrow> <DetailText> <MarkdownContent html={data.dataSummaryFootnote.content.childMarkdownRemark.html} /> </DetailText> </Container> >>>>>>> <StateCharts history={data.allCovidUsDaily.nodes} /> <Container narrow> <DetailText> <MarkdownContent html={data.dataSummaryFootnote.content.childMarkdownRemark.html} /> </DetailText> </Container>
<<<<<<< createPage({ path: `/data/state/${slug}/hospital-facilities`, component: path.resolve(`./src/templates/state/hospital-facilities.js`), context: node, }) ======= createRedirect({ fromPath: `/data/state/${slug}/screenshots`, toPath: `https://screenshots.covidtracking.com/${slug}`, }) >>>>>>> createPage({ path: `/data/state/${slug}/hospital-facilities`, component: path.resolve(`./src/templates/state/hospital-facilities.js`), context: node, }) createRedirect({ fromPath: `/data/state/${slug}/screenshots`, toPath: `https://screenshots.covidtracking.com/${slug}`, })
<<<<<<< <svg className={chartStyles.chart} viewBox={`0 0 ${width} ${height}`}> <g transform={`translate(${marginLeft} ${marginTop})`}> <g> {yScale.ticks(yTicks).map((tick, i) => ( <g key={tick}> {i < showTicks && ( <> <text className={`${chartStyles.label} ${chartStyles.yTickLabel}`} y={yScale(tick) + 6} x={`${tick}`.length * -12} > {formatNumber(tick)} </text> <line className={chartStyles.gridLine} x1={0} x2={width - totalXMargin} y1={yScale(tick)} y2={yScale(tick)} /> </> )} </g> ))} ======= <div align={align}> <svg className={chartStyles.chart} viewBox={`0 0 ${width} ${height}`}> <g transform={`translate(${marginLeft} ${marginTop})`}> <g> {yScale.ticks(yTicks).map((tick, i) => ( <g key={tick}> {i < showTicks && ( <> <text className={chartStyles.yTickLabel} y={yScale(tick) + 6} x={`${tick}`.length * -12} > {formatNumber(tick)} </text> <line className={chartStyles.gridLine} x1={0} x2={width - totalXMargin} y1={yScale(tick)} y2={yScale(tick)} /> </> )} </g> ))} </g> >>>>>>> <svg className={chartStyles.chart} viewBox={`0 0 ${width} ${height}`}> <g transform={`translate(${marginLeft} ${marginTop})`}> {yScale.ticks(yTicks).map((tick, i) => ( <g key={tick}> {i < showTicks && ( <> <text className={`${chartStyles.label} ${chartStyles.yTickLabel}`} y={yScale(tick) + 6} x={`${tick}`.length * -12} > {formatNumber(tick)} </text> <line className={chartStyles.gridLine} x1={0} x2={width - totalXMargin} y1={yScale(tick)} y2={yScale(tick)} /> </> )}
<<<<<<< ======= <Hero /> <div className="homepage-press-logos-wrapper"> <Container> <h2>Our data has been cited by</h2> <PressLogos onlyFeatured /> </Container> </div> >>>>>>> <Hero /> <div className="homepage-press-logos-wrapper"> <Container> <h2>Our data has been cited by</h2> <PressLogos onlyFeatured /> </Container> </div>
<<<<<<< import { FormatDate } from '~components/utils/format' ======= import { FormatDate, FormatNumber } from '~components/utils/format' import Definitions from '~components/pages/data/definitions' >>>>>>> import { FormatDate } from '~components/utils/format' import Definitions from '~components/pages/data/definitions'
<<<<<<< const { disableError, disableSpinner, errorSize, imageStyle, src, style, loadingSize, loadingStyle } = this.props ======= const { color, disableSpinner, imageStyle, src, style, loadingSize, loadingStyle } = this.props >>>>>>> const { color, disableError, disableSpinner, errorSize, imageStyle, src, style, loadingSize, loadingStyle } = this.props <<<<<<< style={{ ...styles.img, opacity: !this.state.imageLoaded ? 0 : 1, transition: 'opacity 300ms ease-in-out', ...imageStyle }} ======= style={{ ...styles.img, opacity: !this.state.imageLoaded ? 0 : 1, transition: 'all 400ms cubic-bezier(0.4, 0.0, 0.2, 1)', ...imageStyle }} >>>>>>> style={{ ...styles.img, opacity: !this.state.imageLoaded ? 0 : 1, transition: 'all 400ms cubic-bezier(0.4, 0.0, 0.2, 1)', ...imageStyle }} <<<<<<< disableError: PropTypes.bool, ======= color: PropTypes.string, >>>>>>> disableError: PropTypes.bool, color: PropTypes.string,
<<<<<<< this.rootComponentIds = this._gatherRootComponentIds(props.routes); ======= this.currentOwner = null; >>>>>>> this.rootComponentIds = this._gatherRootComponentIds(props.routes); this.currentOwner = null;
<<<<<<< import { Column, Input, Row } from '@reactackle/reactackle'; import { DataRowStyled } from './styles/DataRowStyled'; import { DataAdditionalStyled } from './styles/DataAdditionalStyled'; ======= import { Column, TextField, Row } from '@reactackle/reactackle'; import './ConstructionTool.scss'; >>>>>>> import { Column, TextField, Row } from '@reactackle/reactackle'; import { DataRowStyled } from './styles/DataRowStyled'; import { DataAdditionalStyled } from './styles/DataAdditionalStyled';
<<<<<<< import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import ProjectRoute from '../../models/ProjectRoute'; // import { currentRouteSelector } from '../../selectors/index'; import { BlockContentViewButton } from '../../components'; import { toggleTreeViewMode } from '../../actions/desktop'; import { getLocalizedTextFromState, currentRouteSelector, } from '../../selectors'; const propTypes = { getLocalizedText: PropTypes.func.isRequired, currentRoute: PropTypes.instanceOf(ProjectRoute).isRequired, onToggleTreeViewMode: PropTypes.func.isRequired, }; ======= import React from "react"; import PropTypes from 'prop-types'; import { connect } from "react-redux"; import { Button } from "reactackle-button"; import { currentRouteSelector } from "../../selectors/index"; import { BlockContentViewButton, IconAdd } from "../../components"; import { toggleTreeViewMode } from "../../actions/desktop"; import { getLocalizedTextFromState } from "../../selectors"; >>>>>>> import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import ProjectRoute from '../../models/ProjectRoute'; // import { currentRouteSelector } from '../../selectors/index'; import { BlockContentViewButton } from '../../components'; import { toggleTreeViewMode } from '../../actions/desktop'; import { getLocalizedTextFromState, currentRouteSelector, } from '../../selectors'; <<<<<<< ======= addButtonAction, >>>>>>> <<<<<<< const formatRouteTitle = title => `${getLocalizedText( 'structure.routeTreeEditorTitle', )}: ${title}`.toUpperCase(); ======= const formatRouteTitle = title => getLocalizedText( "structure.routeTreeEditorTitle" ); >>>>>>> const formatRouteTitle = () => getLocalizedText( 'structure.routeTreeEditorTitle', ); <<<<<<< ContentViewButton.propTypes = propTypes; ======= ContentViewButton.propTypes = propTypes; ContentViewButton.defaultProps = defaultProps; >>>>>>> ContentViewButton.propTypes = propTypes; ContentViewButton.defaultProps = defaultProps;
<<<<<<< import { ChildrenWrapperStyled } from './styles/ChildrenWrapperStyled'; ======= import { IconArrowChevronRight } from '../../icons'; >>>>>>> import { ChildrenWrapperStyled } from './styles/ChildrenWrapperStyled'; import { IconArrowChevronRight } from '../../icons';
<<<<<<< Package.onUse(function(api) { api.versionsFrom('1.0'); api.use(['cfs:[email protected]', 'cfs:[email protected]']); api.addFiles([ ======= Package.on_use(function(api) { api.use(['cfs:[email protected]', 'cfs:[email protected]']); api.add_files([ >>>>>>> Package.onUse(function(api) { api.versionsFrom('1.0'); api.use(['cfs:[email protected]', 'cfs:[email protected]']); api.addFiles([ <<<<<<< Package.onTest(function(api) { api.use(['cfs:s3', 'test-helpers', 'tinytest'], 'server'); api.addFiles('tests/server-tests.js', 'server'); api.addFiles('tests/client-tests.js', 'client'); ======= Package.on_test(function(api) { api.use(['cfs:standard-packages', 'cfs:s3', 'test-helpers', 'tinytest'], 'server'); api.add_files('tests/server-tests.js', 'server'); api.add_files('tests/client-tests.js', 'client'); >>>>>>> Package.onTest(function(api) { api.use(['cfs:standard-packages', 'cfs:s3', 'test-helpers', 'tinytest'], 'server'); api.addFiles('tests/server-tests.js', 'server'); api.addFiles('tests/client-tests.js', 'client');
<<<<<<< const { pointCursor, setPointCursor } = usePointCursor(); ======= >>>>>>> <<<<<<< const goToPoint = useCallback(() => { goToPoints(); push(names.POINT); }, [goToPoints, push, names]); const goHome = useCallback(async () => { const _wallet = need.wallet(wallet); const _contracts = need.contracts(contracts); let deduced = pointCursor; // if no point cursor set by login logic, try to deduce it if (Nothing.hasInstance(deduced)) { const owned = await azimuth.azimuth.getOwnedPoints( _contracts, _wallet.address ); if (owned.length === 1) { deduced = Just(owned[0]); } } // if we have a deduced point or one in the global context, // navigate to that specific point, otherwise navigate to list of points if (Just.hasInstance(deduced)) { setPointCursor(deduced); goToPoint(); } else { goToPoints(); } }, [contracts, pointCursor, setPointCursor, wallet, goToPoint, goToPoints]); ======= >>>>>>> <<<<<<< ======= <Grid.Item full as={ForwardButton} solid className="mt2" disabled={Nothing.hasInstance(wallet)} onClick={doContinue}> Continue </Grid.Item> >>>>>>>
<<<<<<< import { MIN_PLANET, GAS_LIMITS, DEFAULT_GAS_PRICE_GWEI } from 'lib/constants'; ======= import { useSuggestedGasPrice } from 'lib/useSuggestedGasPrice'; import useArray from 'lib/useArray'; import { buildEmailInputConfig } from 'lib/useInputs'; import { MIN_PLANET, GAS_LIMITS } from 'lib/constants'; >>>>>>> import { MIN_PLANET, GAS_LIMITS } from 'lib/constants'; import { useSuggestedGasPrice } from 'lib/useSuggestedGasPrice'; <<<<<<< const { getHasReceived, sendMail } = useMailer(); const cachedEmails = useRef([]); ======= const { getHasReceived, syncHasReceivedForEmail, sendMail } = useMailer(); const { gasPrice } = useSuggestedGasPrice(networkType); >>>>>>> const { getHasReceived, sendMail } = useMailer(); const { gasPrice } = useSuggestedGasPrice(networkType); const cachedEmails = useRef([]); <<<<<<< INVITE_COST * emails.length, emails.map(email => invites[email].rawTx), ======= toWei((gasPrice * GAS_LIMIT * inputs.length).toString(), 'gwei'), inputs.map(input => invites[input.name].rawTx), >>>>>>> toWei((gasPrice * GAS_LIMIT * emails.length).toString(), 'gwei'), emails.map(email => invites[email].rawTx), <<<<<<< }, [web3, addReceipt, clearReceipts, invites, point, wallet, sendMail]); const onSubmit = useCallback( async values => { cachedEmails.current = values.emails; setStatus(STATUS.GENERATING); const errors = await generateInvites(values); if (errors) { return errors; } setStatus(STATUS.CAN_SEND); }, [generateInvites] ); const doSend = useCallback(async () => { ======= }, [ web3, gasPrice, inputs, addReceipt, clearReceipts, invites, point, wallet, sendMail, ]); const onClick = useCallback(async () => { >>>>>>> }, [ web3, wallet, point, gasPrice, clearReceipts, invites, addReceipt, sendMail, ]); const onSubmit = useCallback( async values => { cachedEmails.current = values.emails; setStatus(STATUS.GENERATING); const errors = await generateInvites(values); if (errors) { return errors; } setStatus(STATUS.CAN_SEND); }, [generateInvites] ); const doSend = useCallback(async () => {
<<<<<<< let mounted = true; ======= const gasPrice = parseInt( fromWei(estimatedGasPrice.toString(), 'gwei'), 10 ); setSuggestedGasPrice(gasPrice); setGasPrice(gasPrice); }, [estimatedGasPrice]); useEffect(() => { >>>>>>> const gasPrice = parseInt( fromWei(estimatedGasPrice.toString(), 'gwei'), 10 ); setSuggestedGasPrice(gasPrice); setGasPrice(gasPrice); }, [estimatedGasPrice]); useEffect(() => { let mounted = true; <<<<<<< setSuggestedGasPrice(gasPrice); setGasPrice(gasPrice); ======= >>>>>>> <<<<<<< return () => (mounted = false); }, [_wallet, _web3, setError, nonce, chainId]); ======= }, [_wallet, _web3, setError, nonce, chainId, networkType]); >>>>>>> return () => (mounted = false); }, [ _wallet, _web3, setError, nonce, chainId, networkType, estimatedGasPrice, ]);
<<<<<<< import React, { useCallback, useState, useMemo } from 'react'; import { Just, Nothing } from 'folktale/maybe'; import * as azimuth from 'azimuth-js'; ======= import React, { useCallback, useState } from 'react'; >>>>>>> import React, { useCallback, useState, useMemo } from 'react';
<<<<<<< ======= import DownloadSigilButton from 'components/DownloadSigilButton'; >>>>>>> import DownloadSigilButton from 'components/DownloadSigilButton'; <<<<<<< <Passport point={Just(point)} address={Just(address)} animationMode={'slide'} /> ======= <Passport point={Just(point)} /> >>>>>>> <Passport point={Just(point)} address={Just(address)} animationMode={'slide'} />
<<<<<<< ? [ { key: ROUTE_NAMES.LANDING }, { key: ROUTE_NAMES.LOGIN }, { key: ROUTE_NAMES.POINTS }, { key: ROUTE_NAMES.POINT }, ] : [{ key: ROUTE_NAMES.LANDING }]; ======= ? [{ key: ROUTE_NAMES.LANDING }, { key: ROUTE_NAMES.LOGIN }] : hasDisclaimed() ? [{ key: ROUTE_NAMES.LANDING }] : [{ key: ROUTE_NAMES.DISCLAIMER }]; >>>>>>> ? [ { key: ROUTE_NAMES.LANDING }, { key: ROUTE_NAMES.LOGIN }, { key: ROUTE_NAMES.POINTS }, { key: ROUTE_NAMES.POINT }, ] : hasDisclaimed() ? [{ key: ROUTE_NAMES.LANDING }] : [{ key: ROUTE_NAMES.DISCLAIMER }];
<<<<<<< this.bustPreventDefault(this.el.find('#transcript')); ======= $(window).scroll(this.scrollWindow); // Bust through the div's click event to allow all links to work apart from // the time link this.el.find('#transcript > div').find('dt.speaker a, dd a').click(function(e) { e.stopImmediatePropagation(); return true; }); >>>>>>> this.bustPreventDefault(this.el.find('#transcript')); <<<<<<< }, ======= }, scrollWindow: function(e) { if (this.highlightedLines.size() > 0) { return true; } var target = $(window).scrollTop(); var visible = _.detect( this.el.find('#transcript > div'), function(el) { return el.offsetTop >= target; } ); var logLine = new Artemis.LogLine({el: $(visible)}); Artemis.phasesView.setOriginalTranscriptPage(logLine.getTranscriptPage()); } >>>>>>> }, scrollWindow: function(e) { if (this.highlightedLines.size() > 0) { return true; } var target = $(window).scrollTop(); var visible = _.detect( this.el.find('#transcript > div'), function(el) { return el.offsetTop >= target; } ); var logLine = new Artemis.LogLine({el: $(visible)}); Artemis.phasesView.setOriginalTranscriptPage(logLine.getTranscriptPage());
<<<<<<< ` // #110 const Bla = styled.div` ${Button} { ${something}: blue; } background: ${bla}; ${someValue} ` ======= ` // Multi-line interpolations const MultiLineDiv = styled.div` color: ${ 'red' }; ${ 'long values' } `; >>>>>>> ` // #110 const Bla = styled.div` ${Button} { ${something}: blue; } background: ${bla}; ${someValue} ` // Multi-line interpolations const MultiLineDiv = styled.div` color: ${ 'red' }; ${ 'long values' } `;
<<<<<<< populates.push(col); return cb(null, [vals]); ======= return cb(null, [vals[col]]); >>>>>>> populates.push(col); return cb(null, [vals[col]]); <<<<<<< it('should populate all associations by default', function(done){ var person = new collection._model({ id: 3, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); person.save(function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 3); assert.deepEqual(populates, ['car', 'person', 'pet']); done(); }); }); it('should not populate any associations if options.populate = false', function(done){ var options; var person = new collection._model({ id: 4, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); options = { populate: false }; person.save(options, function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 1); assert.deepEqual(populates, ['person']); done(); }); }); it('should populate only the specified associations', function(done){ var options; var person = new collection._model({ id: 5, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); options = { populate: [ { key: 'cars' } ] }; person.save(options, function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 2); assert.deepEqual(populates, ['car', 'person']); done(); }); }); ======= it('should succeed when saving an unmodified nested model instance.', function(done) { // Person nested in pet as owner. var pet = new petCollection._model({ id: 1, type: 'dog', owner: {id: 1} }); pet.save(function(err, values) { assert(!err); assert.equal(values.id, 1); assert.equal(values.type, 'dog'); done(); }); }); >>>>>>> it('should populate all associations by default', function(done){ var person = new personCollection._model({ id: 3, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); person.save(function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 3); assert.deepEqual(populates, ['car', 'person', 'pet']); done(); }); }); it('should not populate any associations if options.populate = false', function(done){ var options; var person = new personCollection._model({ id: 4, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); options = { populate: false }; person.save(options, function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 1); assert.deepEqual(populates, ['person']); done(); }); }); it('should populate only the specified associations', function(done){ var options; var person = new personCollection._model({ id: 5, first_name: 'jane', last_name: 'doe' }, {showJoins: true}); // Update collection person.pets.push({type: 'dog'}); person.pets.push({type: 'frog'}); person.pets.push({type: 'log'}); person.cars.push({type: 'truck'}); person.cars.push({type: 'bike'}); options = { populate: [ { key: 'cars' } ] }; person.save(options, function(err, values) { assert(!err); populates.sort(); assert.equal(populates.length, 2); assert.deepEqual(populates, ['car', 'person']); done(); }); }); it('should succeed when saving an unmodified nested model instance.', function(done) { // Person nested in pet as owner. var pet = new petCollection._model({ id: 1, type: 'dog', owner: {id: 1} }); pet.save(function(err, values) { assert(!err); assert.equal(values.id, 1); assert.equal(values.type, 'dog'); done(); }); });
<<<<<<< import { pick, get } from 'lodash' ======= import { pick } from 'lodash' import urlJoin from 'url-join' >>>>>>> import { pick, get } from 'lodash' import urlJoin from 'url-join' <<<<<<< const generateCombinationsFromArray = (array, property) => { let results = [] for (let i = 0; i <= array.length - 1; i++) { for (let j = 0; j <= array.length - 1; j++) { if ((array[i][property] !== array[j][property]) && array[i].deposit && array[j].receive) { results.push([ { name: array[i]['name'], symbol: array[i][property] }, { name: array[j]['name'], symbol: array[j][property] } ]) } } if (i == array.length - 1) { return results } } } ======= const Document = ({ Html, Head, Body, children, siteData, routeInfo }) => ( <Html lang='en'> <Head> <meta charSet='utf-8' /> <meta name='viewport' content='width=device-width, initial-scale=1' /> <meta name='description' content={siteConfig.description}/> <meta name='author' content={siteConfig.author}/> <meta name='referrer' content='origin-when-cross-origin'/> <link rel="canonical" href={urlJoin(siteUrlProd, routeInfo ? routeInfo.path : '')}/> <link href='/static/vendor/ionicons-2.0/css/ionicons.min.css' rel='stylesheet'/> <link href='/static/vendor/font-awesome-5.5/css/all.min.css' rel='stylesheet'/> <link rel="icon" href="/favicon.png"/> <title>{siteData.title}</title> >>>>>>> const generateCombinationsFromArray = (array, property) => { let results = [] for (let i = 0; i <= array.length - 1; i++) { for (let j = 0; j <= array.length - 1; j++) { if ((array[i][property] !== array[j][property]) && array[i].deposit && array[j].receive) { results.push([ { name: array[i]['name'], symbol: array[i][property] }, { name: array[j]['name'], symbol: array[j][property] } ]) } } if (i == array.length - 1) { return results } } }
<<<<<<< // - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc). // Defined by: // - key: the key for the <dt> (e.g., "Bug Tracker"). Required. // - value: The value that will appear in the <dd> (e.g., "GitHub"). // - href: a URL for the value (e.g., "http://foo.com/issues"). Optional. // - data: an array of values and hrefs (e.g., [{value: "a", href:"b"}, {value: "c", href:"d"}]). ======= // - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing // list of the group. >>>>>>> // - otherLinks: an array of other links that you might want in the header (e.g., link github, twitter, etc). // Defined by: // - key: the key for the <dt> (e.g., "Bug Tracker"). Required. // - value: The value that will appear in the <dd> (e.g., "GitHub"). // - href: a URL for the value (e.g., "http://foo.com/issues"). Optional. // - data: an array of values and hrefs (e.g., [{value: "a", href:"b"}, {value: "c", href:"d"}]). // - subjectPrefix: the string that is expected to be used as a subject prefix when posting to the mailing // list of the group.
<<<<<<< it("should have the native-metrics package available", function() { expect(function() { require('@newrelic/native-metrics') }).to.not.throw() }) ======= it_native("should still gather native metrics when bound and unbound", function(done) { sampler.start(agent) sampler.stop() sampler.start(agent) sampler.nativeMetrics.emit('gc', { type: 'TestGC', typeId: 1337, duration: 50 * 1e9 // 50 seconds in nanoseconds }) var pause = agent.metrics.getOrCreateMetric(NAMES.GC.PAUSE_TIME) var type = agent.metrics.getOrCreateMetric(NAMES.GC.PREFIX + 'TestGC') // These are "at least" because a real GC might happen during the test. expect(pause).property('callCount').to.be.at.least(1) expect(pause).property('total').to.be.at.least(50) // These tests can be exact because we're using a fake GC type. expect(type).to.have.property('callCount', 1) expect(type).to.have.property('total', 50) sampler.nativeMetrics.getLoopMetrics() setTimeout(function runLoop() { sampler.sampleLoop(agent, sampler.nativeMetrics)() var stats = agent.metrics.getOrCreateMetric(NAMES.LOOP.USAGE) expect(stats.callCount).to.be.above(1) expect(stats.max).to.be.above(0) expect(stats.min).to.be.at.most(stats.max) expect(stats.total).to.be.at.least(stats.max) done() }, 1) }) it_native("should gather loop metrics", function(done) { sampler.start(agent) sampler.nativeMetrics.getLoopMetrics() setTimeout(function runLoop() { sampler.sampleLoop(agent, sampler.nativeMetrics)() var stats = agent.metrics.getOrCreateMetric(NAMES.LOOP.USAGE) expect(stats.callCount).to.be.above(1) expect(stats.max).to.be.above(0) expect(stats.min).to.be.at.most(stats.max) expect(stats.total).to.be.at.least(stats.max) done() }, 1) }) >>>>>>> it("should have the native-metrics package available", function() { expect(function() { require('@newrelic/native-metrics') }).to.not.throw() }) it("should still gather native metrics when bound and unbound", function(done) { sampler.start(agent) sampler.stop() sampler.start(agent) sampler.nativeMetrics.emit('gc', { type: 'TestGC', typeId: 1337, duration: 50 * 1e9 // 50 seconds in nanoseconds }) var pause = agent.metrics.getOrCreateMetric(NAMES.GC.PAUSE_TIME) var type = agent.metrics.getOrCreateMetric(NAMES.GC.PREFIX + 'TestGC') // These are "at least" because a real GC might happen during the test. expect(pause).property('callCount').to.be.at.least(1) expect(pause).property('total').to.be.at.least(50) // These tests can be exact because we're using a fake GC type. expect(type).to.have.property('callCount', 1) expect(type).to.have.property('total', 50) sampler.nativeMetrics.getLoopMetrics() setTimeout(function runLoop() { sampler.sampleLoop(agent, sampler.nativeMetrics)() var stats = agent.metrics.getOrCreateMetric(NAMES.LOOP.USAGE) expect(stats.callCount).to.be.above(1) expect(stats.max).to.be.above(0) expect(stats.min).to.be.at.most(stats.max) expect(stats.total).to.be.at.least(stats.max) done() }, 1) }) it("should gather loop metrics", function(done) { sampler.start(agent) sampler.nativeMetrics.getLoopMetrics() setTimeout(function runLoop() { sampler.sampleLoop(agent, sampler.nativeMetrics)() var stats = agent.metrics.getOrCreateMetric(NAMES.LOOP.USAGE) expect(stats.callCount).to.be.above(1) expect(stats.max).to.be.above(0) expect(stats.min).to.be.at.most(stats.max) expect(stats.total).to.be.at.least(stats.max) done() }, 1) })
<<<<<<< var attributes = { agentAttributes: this.attributes.get(DESTINATIONS.TRANS_TRACE), userAttributes: this.custom.get(DESTINATIONS.TRANS_TRACE), ======= const serializedTrace = this._serializeTrace() const trace = this if (!this.transaction.agent.config.simple_compression) { codec.encode(serializedTrace, respond) } else { setImmediate(respond, null, serializedTrace) } function respond(err, data) { if (err) { return callback(err, null, null) } return callback(null, trace._generatePayload(data), trace) } } /** * This is the synchronous version of Trace#generateJSON */ Trace.prototype.generateJSONSync = function generateJSONSync() { const serializedTrace = this._serializeTrace() const shouldCompress = !this.transaction.agent.config.simple_compression const data = shouldCompress ? codec.encodeSync(serializedTrace) : serializedTrace return this._generatePayload(data) } /** * Generates the payload used in a trace harvest. * * @private * * @returns {Array} The formatted payload. */ Trace.prototype._generatePayload = function _generatePayload(data) { let syntheticsResourceId = null if (this.transaction.syntheticsData) { syntheticsResourceId = this.transaction.syntheticsData.resourceId } return [ this.root.timer.start, // start this.transaction.getResponseTimeInMillis(), // response time this.transaction.getFullName(), // path this.transaction.url, // request.uri data, // encodedCompressedData '', // guid null, // reserved for future use false, // forcePersist null, // xraySessionId syntheticsResourceId // synthetics resource id ] } /** * Serializes the trace into the expected JSON format to be sent. * * @private * * @returns {Array} Serialized trace data. */ Trace.prototype._serializeTrace = function _serializeTrace() { const attributes = { agentAttributes: this.attributes.get(AttributeFilter.DESTINATIONS.TRANS_TRACE), userAttributes: this.custom.get(AttributeFilter.DESTINATIONS.TRANS_TRACE), >>>>>>> const serializedTrace = this._serializeTrace() const trace = this if (!this.transaction.agent.config.simple_compression) { codec.encode(serializedTrace, respond) } else { setImmediate(respond, null, serializedTrace) } function respond(err, data) { if (err) { return callback(err, null, null) } return callback(null, trace._generatePayload(data), trace) } } /** * This is the synchronous version of Trace#generateJSON */ Trace.prototype.generateJSONSync = function generateJSONSync() { const serializedTrace = this._serializeTrace() const shouldCompress = !this.transaction.agent.config.simple_compression const data = shouldCompress ? codec.encodeSync(serializedTrace) : serializedTrace return this._generatePayload(data) } /** * Generates the payload used in a trace harvest. * * @private * * @returns {Array} The formatted payload. */ Trace.prototype._generatePayload = function _generatePayload(data) { let syntheticsResourceId = null if (this.transaction.syntheticsData) { syntheticsResourceId = this.transaction.syntheticsData.resourceId } return [ this.root.timer.start, // start this.transaction.getResponseTimeInMillis(), // response time this.transaction.getFullName(), // path this.transaction.url, // request.uri data, // encodedCompressedData '', // guid null, // reserved for future use false, // forcePersist null, // xraySessionId syntheticsResourceId // synthetics resource id ] } /** * Serializes the trace into the expected JSON format to be sent. * * @private * * @returns {Array} Serialized trace data. */ Trace.prototype._serializeTrace = function _serializeTrace() { const attributes = { agentAttributes: this.attributes.get(DESTINATIONS.TRANS_TRACE), userAttributes: this.custom.get(DESTINATIONS.TRANS_TRACE),
<<<<<<< shimmer.wrapMethod(memcached.prototype, 'memcached.prototype', 'command', function (command) { ======= shimmer.wrapMethod(memcached && memcached.prototype, 'memcached.prototype', 'command', function (original) { >>>>>>> shimmer.wrapMethod(memcached && memcached.prototype, 'memcached.prototype', 'command', function (command) {
<<<<<<< shimmer.wrapMethod(mongodb.Collection.prototype, 'mongodb.Collection.prototype', operation, function (command) { ======= shimmer.wrapMethod(mongodb && mongodb.Collection && mongodb.Collection.prototype, 'mongodb.Collection.prototype', operation, function (original) { >>>>>>> shimmer.wrapMethod(mongodb && mongodb.Collection && mongodb.Collection.prototype, 'mongodb.Collection.prototype', operation, function (command) {
<<<<<<< test("Express 4 router introspection", function(t) { t.plan(12) ======= test("Express 4 router introspection", {skip: skip()}, function(t) { t.plan(14) >>>>>>> test("Express 4 router introspection", function(t) { t.plan(14)
<<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "\"foo\"", "should have the get key as a parameter" ) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.key, "\"foo\"", "should have the get key as a parameter" ) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "\"foo\"", "should have the get key as a parameter" ) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] t.notOk( segment.getAttributes().key, 'should not have any attributes' ) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.key, "\"foo\"", 'should still have the get key as a parameter' ) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "\"foo\"", 'should still have the get key as a parameter' ) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "[\"foo\",\"bar\"]", "should have the multiple keys fetched as a parameter" ) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.key, "[\"foo\",\"bar\"]", "should have the multiple keys fetched as a parameter" ) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "[\"foo\",\"bar\"]", "should have the multiple keys fetched as a parameter" ) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "\"foo\"", "should have the set key as a parameter" ) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.key, "\"foo\"", "should have the set key as a parameter" ) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.getAttributes().key, "\"foo\"", "should have the set key as a parameter" ) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance attributes' ) t.equals( attributes.port_path_or_id, String(params.memcached_port), 'should collect port instance attributes' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance parameters' ) t.equals( segment.parameters.port_path_or_id, String(params.memcached_port), 'should collect port instance parameters' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance attributes' ) t.equals( attributes.port_path_or_id, String(params.memcached_port), 'should collect port instance attributes' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance attributes' ) t.equals( attributes.port_path_or_id, String(params.memcached_port), 'should collect port instance attributes' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance parameters' ) t.equals( segment.parameters.port_path_or_id, String(params.memcached_port), 'should collect port instance parameters' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, getMetricHostName(agent, params.memcached_host), 'should collect host instance attributes' ) t.equals( attributes.port_path_or_id, String(params.memcached_port), 'should collect port instance attributes' ) var expectedMetrics = {} expectedMetrics['Datastore/instance/Memcache/' + HOST_ID] = 1 verifyMetrics(t, transaction.metrics, expectedMetrics) <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, undefined, 'should not have host instance parameter' ) t.equals( attributes.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric') }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.host, undefined, 'should not have host instance parameter' ) t.equals( segment.parameters.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric') >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, undefined, 'should not have host instance parameter' ) t.equals( attributes.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric') <<<<<<< transaction.end(function() { var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, undefined, 'should not have host instance parameter' ) t.equals( attributes.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric') }) ======= transaction.end() var segment = transaction.trace.root.children[0] t.equals( segment.parameters.host, undefined, 'should not have host instance parameter' ) t.equals( segment.parameters.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric') >>>>>>> transaction.end() var segment = transaction.trace.root.children[0] const attributes = segment.getAttributes() t.equals( attributes.host, undefined, 'should not have host instance parameter' ) t.equals( attributes.port_path_or_id, undefined, 'should should not have port instance parameter' ) var datastoreInstanceMetric = 'Datastore/instance/Memcache/' + HOST_ID t.notOk(agent.metrics.unscoped[datastoreInstanceMetric], 'should not have datastore instance metric')
<<<<<<< } else if (endpointName === 'transaction_sample_data') { aggregatorCheckOnEnd(agent.traces) ======= } else if (endpointName === 'analytic_event_data') { aggregatorCheckOnEnd(agent.transactionEventAggregator) >>>>>>> } else if (endpointName === 'transaction_sample_data') { aggregatorCheckOnEnd(agent.traces) } else if (endpointName === 'analytic_event_data') { aggregatorCheckOnEnd(agent.transactionEventAggregator)
<<<<<<< agent.spanEventAggregator.reconfigure(agent.config) ======= agent.transactionEventAggregator.reconfigure(agent.config) >>>>>>> agent.spanEventAggregator.reconfigure(agent.config) agent.transactionEventAggregator.reconfigure(agent.config) <<<<<<< if (agent.config.distributed_tracing.enabled && agent.config.span_events.enabled) { agent.spanEventAggregator.start() } ======= if (agent.config.transaction_events.enabled) { agent.transactionEventAggregator.start() } >>>>>>> if (agent.config.distributed_tracing.enabled && agent.config.span_events.enabled) { agent.spanEventAggregator.start() } if (agent.config.transaction_events.enabled) { agent.transactionEventAggregator.start() } <<<<<<< if (agent.config.distributed_tracing.enabled && agent.config.span_events.enabled) { agent.spanEventAggregator.start() } ======= if (agent.config.transaction_events.enabled) { agent.transactionEventAggregator.start() } >>>>>>> if (agent.config.distributed_tracing.enabled && agent.config.span_events.enabled) { agent.spanEventAggregator.start() } if (agent.config.transaction_events.enabled) { agent.transactionEventAggregator.start() } <<<<<<< this.spanEventAggregator.stop() ======= this.transactionEventAggregator.stop() >>>>>>> this.spanEventAggregator.stop() this.transactionEventAggregator.stop() <<<<<<< this.spanEventAggregator.send() ======= this.transactionEventAggregator.send() >>>>>>> this.spanEventAggregator.send() this.transactionEventAggregator.send()