conflict_resolution
stringlengths
27
16k
<<<<<<< updateFilterSize = () => { const {selectedDashboardIndex, index} = this.props this.props.filterResizeHandler(selectedDashboardIndex, index, this.state.width) } ======= resizeStartHandler = (direction, styleSize, clientSize, e) => { if(e.preventDefault) e.preventDefault(); } dragStartHandler = (e) => { if(e.preventDefault) e.preventDefault(); } >>>>>>> updateFilterSize = () => { const {selectedDashboardIndex, index} = this.props this.props.filterResizeHandler(selectedDashboardIndex, index, this.state.width) } resizeStartHandler = (direction, styleSize, clientSize, e) => { if(e.preventDefault) e.preventDefault(); } dragStartHandler = (e) => { if(e.preventDefault) e.preventDefault(); } <<<<<<< onResize={this.filterResizeHandler} onResizeStop={this.updateFilterSize} ======= onResize={this.widgetResizeHandler} onResizeStart={this.resizeStartHandler} onDragStart={this.dragStartHandler} >>>>>>> onResize={this.filterResizeHandler} onResizeStop={this.updateFilterSize} onResize={this.widgetResizeHandler} onResizeStart={this.resizeStartHandler} onDragStart={this.dragStartHandler}
<<<<<<< onResultTabChanged, resultSectionActiveKey ======= onResultTabChanged, resultLoading, dataLoading, visualisationLoading >>>>>>> onResultTabChanged, resultSectionActiveKey, resultLoading, dataLoading, visualisationLoading <<<<<<< onResultTabChanged={onResultTabChanged} resultSectionActiveKey={resultSectionActiveKey} /> ======= onResultTabChanged={onResultTabChanged} resultLoading={resultLoading} dataLoading={dataLoading} visualisationLoading={visualisationLoading} /> >>>>>>> onResultTabChanged={onResultTabChanged} resultSectionActiveKey={resultSectionActiveKey} resultLoading={resultLoading} dataLoading={dataLoading} visualisationLoading={visualisationLoading} />
<<<<<<< super(props) this.state = { showEditWidgetModal: false, showAddWidgetModal: false, selectedWidget: null, editorContent: null, newWidget: null, newWidgetApiParams: {} } ======= super(props) this.state = { showEditWidgetModal: false, showAddWidgetModal: false, showFilterModal: false, selectedWidget: null, editorContent: null, newWidget: null, newWidgetApiParams: {}, apiParamMessage: '', filterValues: {} } >>>>>>> super(props) this.state = { showEditWidgetModal: false, showAddWidgetModal: false, selectedWidget: null, editorContent: null, newWidget: null, newWidgetApiParams: {}, filterValues: {} } <<<<<<< let selectedWidgetNewDefinition = JSON.parse(JSON.stringify(this.state.selectedWidget)) selectedWidgetNewDefinition[keyToUpdate] = updatedValue this.setState({ selectedWidget: selectedWidgetNewDefinition }) ======= let selectedWidgetNewDefinition = Object.assign({}, this.state.selectedWidget) selectedWidgetNewDefinition[keyToUpdate] = updatedValue this.setState({ selectedWidget: selectedWidgetNewDefinition }) >>>>>>> let selectedWidgetNewDefinition = JSON.parse(JSON.stringify(this.state.selectedWidget)) selectedWidgetNewDefinition[keyToUpdate] = updatedValue this.setState({ selectedWidget: selectedWidgetNewDefinition }) <<<<<<< if (isJsonString(this.state.editorContent)) { let updatedWidgetDefinition = JSON.parse(JSON.stringify(this.state.selectedWidget)) updatedWidgetDefinition.chartStyles = JSON.parse(this.state.editorContent) this.props.updateWidgetDefinition(this.props.dashboardIndex, this.selectedWidgetIndex, updatedWidgetDefinition) this.setState({ showEditWidgetModal: false }) } else { console.error(INCORRECT_JSON_ERROR) } ======= if (isJsonString(this.state.editorContent)) { let updatedWidgetDefinition = Object.assign({}, this.state.selectedWidget) updatedWidgetDefinition.chartStyles = JSON.parse(this.state.editorContent) this.props.updateWidgetDefinition(this.props.dashboardIndex, this.selectedWidgetIndex, updatedWidgetDefinition) this.setState({ showEditWidgetModal: false }) } else { console.error(INCORRECT_JSON_ERROR) } >>>>>>> if (isJsonString(this.state.editorContent)) { let updatedWidgetDefinition = JSON.parse(JSON.stringify(this.state.selectedWidget)) updatedWidgetDefinition.chartStyles = JSON.parse(this.state.editorContent) this.props.updateWidgetDefinition(this.props.dashboardIndex, this.selectedWidgetIndex, updatedWidgetDefinition) this.setState({ showEditWidgetModal: false }) } else { console.error(INCORRECT_JSON_ERROR) }
<<<<<<< "classicLayersSection": false, "customCssCode": '', ======= "rememberPanelOpenClosedState": false, >>>>>>> "classicLayersSection": false, "customCssCode": '', "rememberPanelOpenClosedState": false, <<<<<<< //React when a browser action's icon is clicked. chrome.browserAction.onClicked.addListener(function (tab) { chrome.tabs.insertCSS(tab.id, { file: "style.css" }); chrome.tabs.insertCSS(tab.id, { file: "jquery-ui.css" }); if (!settings.get("classicLayersSection")) chrome.tabs.insertCSS(tab.id, { file: "compact-layers-section.css" }); var customCssCode = settings.get("customCssCode"); if (customCssCode) chrome.tabs.insertCSS(tab.id, { code: customCssCode}); ======= function togglePanel(){ chrome.tabs.executeScript(null, { code: "togglePanel();" }); } function injectIntoTab(tabId){ chrome.tabs.insertCSS(tabId, { file: "style.css" }); chrome.tabs.insertCSS(tabId, { file: "jquery-ui.css" }); >>>>>>> function togglePanel(){ chrome.tabs.executeScript(null, { code: "togglePanel();" }); } function injectIntoTab(tabId){ chrome.tabs.insertCSS(tabId, { file: "style.css" }); chrome.tabs.insertCSS(tabId, { file: "jquery-ui.css" }); if (!settings.get("classicLayersSection")) chrome.tabs.insertCSS(tabId, { file: "compact-layers-section.css" }); var customCssCode = settings.get("customCssCode"); if (customCssCode) chrome.tabs.insertCSS(tabId, { code: customCssCode});
<<<<<<< blockFastHash = cnUtil.get_block_id(shareBuffer).toString('hex'); ======= >>>>>>>
<<<<<<< blockFastHash = cnUtil.get_block_id(shareBuffer).toString('hex'); ======= >>>>>>>
<<<<<<< let allSidebars = require(CWD + "/sidebar.json"); Object.assign(allSidebars, versionFallback.sidebarData()); ======= const allSidebars = require(CWD + "/sidebars.json"); >>>>>>> let allSidebars = require(CWD + "/sidebars.json"); Object.assign(allSidebars, versionFallback.sidebarData());
<<<<<<< shell.exec( `git commit -m "Deploy website" -m "Deploy website version based on ${ currentCommit }"` ); ======= if ( shell.exec( `git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"` ).code !== 0 ) { shell.echo(`Error: Committing static website failed`); shell.exit(1); } >>>>>>> shell.exec( `git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"` );
<<<<<<< open: false, due_soon: false, overdue: false, closed: false, mine_as_poc: false, mine_as_helper: false, min_due_date: "", max_due_date: "", min_request_date: "", max_request_date: "", requester_name: "", department: "", // Using an attribute called 'page' makes weird things happen here. JFYI. page_number: 1, bloop: 5, ======= page_number: 1, // Using an attribute called 'page' makes weird things happen here. JFYI. is_closed: 'true', my_requests: 'false', department: "All departments", >>>>>>> open: false, due_soon: false, overdue: false, closed: false, mine_as_poc: false, mine_as_helper: false, min_due_date: "", max_due_date: "", min_request_date: "", max_request_date: "", requester_name: "", department: "", // Using an attribute called 'page' makes weird things happen here. JFYI. page_number: 1, bloop: 5, <<<<<<< this.set('page_number', this.get('page_number') - 1); ======= this.set({ page_number: parseInt(this.get("page_number")) - 1 }) >>>>>>> this.set('page_number', this.get('page_number') - 1); <<<<<<< ======= >>>>>>> <<<<<<< this._query.on("change", this.build, this); ======= var that = this // this wouldn't be needed if we named page and search consistently: this._filters = ['is_closed', 'requester_name', 'my_requests', 'department', 'page_number', 'sort_by_ascending', 'sort_by_attribute', 'search_term'] $.each(this._filters, function( index, filter) { var value = getURLParameter(filter) if (value != 'null' && value != undefined && value != 'undefined') { that._query.set(filter, value) } }); this._query.on( "change", this.build, this ) >>>>>>> this._query.on("change", this.build, this); var that = this // this wouldn't be needed if we named page and search consistently: this._filters = ['is_closed', 'requester_name', 'my_requests', 'department', 'page_number', 'sort_by_ascending', 'sort_by_attribute', 'search_term'] $.each(this._filters, function( index, filter) { var value = getURLParameter(filter) if (value != 'null' && value != undefined && value != 'undefined') { that._query.set(filter, value) } }); this._query.on( "change", this.build, this ) <<<<<<< ======= build: function () { var route_url = "" var that = this var data_params = {} $.each(this._filters, function( index, filter ) { value = that._query.get(filter) if (value != "" && value != 'undefined' && value != undefined) { data_params[filter] = value if (route_url == "") { route_url += "requests?" } else { route_url += "&" } route_url = route_url + encodeURIComponent(filter) + "=" + encodeURIComponent(value) } }); Router.navigate(route_url) >>>>>>> <<<<<<< "start_index": response.start_index, "end_index": response.end_index, "num_results": response.num_results ======= "start_index": response.start_index, "end_index": response.end_index, "num_results": response.num_results >>>>>>> "start_index": response.start_index, "end_index": response.end_index, "num_results": response.num_results <<<<<<< request_set.fetch(); ======= >>>>>>> request_set.fetch();
<<<<<<< 'use strict' const ut = require('./utils') const err = require('./errors') const urljoin = require('url-join') const builder = require('xmlbuilder') const SitemapItem = require('./sitemap-item') exports.Sitemap = Sitemap exports.SitemapItem = SitemapItem exports.createSitemap = createSitemap exports.createSitemapIndex = createSitemapIndex exports.buildSitemapIndex = buildSitemapIndex ======= 'use strict'; var ut = require('./utils') , err = require('./errors') , urlparser = require('url') , fs = require('fs') , urljoin = require('url-join'); exports.Sitemap = Sitemap; exports.SitemapItem = SitemapItem; exports.createSitemap = createSitemap; exports.createSitemapIndex = createSitemapIndex; exports.buildSitemapIndex = buildSitemapIndex; >>>>>>> 'use strict' const ut = require('./utils') const err = require('./errors') const urljoin = require('url-join') const fs = require('fs') const builder = require('xmlbuilder') const SitemapItem = require('./sitemap-item') exports.Sitemap = Sitemap exports.SitemapItem = SitemapItem exports.createSitemap = createSitemap exports.createSitemapIndex = createSitemapIndex exports.buildSitemapIndex = buildSitemapIndex <<<<<<< ======= * Create sitemap xml * @return {String} */ SitemapItem.prototype.toXML = function () { return this.toString(); }; /** * Alias for toXML() * @return {String} */ SitemapItem.prototype.toString = function () { // result xml var xml = '<url> {loc} {lastmod} {changefreq} {priority} {img} {video} {links} {expires} {androidLink} {mobile} {news} {ampLink}</url>' // xml property , props = ['loc', 'img', 'video', 'lastmod', 'changefreq', 'priority', 'links', 'expires', 'androidLink', 'mobile', 'news', 'ampLink'] // property array size (for loop) , ps = props.length // current property name (for loop) , p; while (ps--) { p = props[ps]; if (this[p] && p == 'img') { var imagexml = ''; // Image handling if (typeof(this[p]) != 'object' || this[p].length == undefined) { // make it an array this[p] = [this[p]]; } this[p].forEach(function (image) { if(typeof(image) != 'object') { // it’s a string // make it an object image = {url: image}; } var caption = image.caption ? '<image:caption><![CDATA['+image.caption+']]></image:caption>' : ''; var geoLocation = image.geoLocation ? '<image:geo_location>'+image.geoLocation+'</image:geo_location>' : ''; var title = image.title ? '<image:title><![CDATA['+image.title+']]></image:title>' : ''; var license = image.license ? '<image:license>'+image.license+'</image:license>' : ''; imagexml += '<image:image><image:loc>' + safeUrl({url: image.url}) + '</image:loc>' + caption + geoLocation + title + license + '</image:image> '; }); xml = xml.replace('{' + p + '}', imagexml); } else if (this[p] && p == 'video') { var videoxml = ''; // Image handling if (typeof(this[p]) != 'object' || this[p].length == undefined) { // make it an array this[p] = [this[p]]; } this[p].forEach(function (video) { if(typeof(video) != 'object' || !video.thumbnail_loc || !video.title || !video.description) { // has to be an object and include required categories https://developers.google.com/webmasters/videosearch/sitemaps throw new err.InvalidVideoFormat(); } if(video.description.length > 2048) { throw new err.InvalidVideoDescription(); } videoxml += '<video:video>' + '<video:thumbnail_loc>' + safeUrl({url: video.thumbnail_loc}) + '</video:thumbnail_loc>' + '<video:title><![CDATA[' + video.title + ']]></video:title>' + '<video:description><![CDATA[' + video.description + ']]></video:description>'; if (video.content_loc) videoxml += '<video:content_loc>' + safeUrl({url: video.content_loc }) + '</video:content_loc>'; if (video.player_loc) { videoxml += '<video:player_loc' + attrBuilder(video, 'player_loc:autoplay') + '>' + safeUrl({url: video.player_loc}) + '</video:player_loc>'; } if (video.duration) videoxml += '<video:duration>' + safeDuration(video.duration) + '</video:duration>'; if (video.expiration_date) videoxml += '<video:expiration_date>' + video.expiration_date + '</video:expiration_date>'; if (video.rating) videoxml += '<video:rating>' + video.rating + '</video:rating>'; if (video.view_count) videoxml += '<video:view_count>' + video.view_count + '</video:view_count>'; if (video.publication_date) videoxml += '<video:publication_date>' + video.publication_date + '</video:publication_date>'; if (video.family_friendly) videoxml += '<video:family_friendly>' + video.family_friendly + '</video:family_friendly>'; if (video.tag) videoxml += '<video:tag>' + video.tag + '</video:tag>'; if (video.category) videoxml += '<video:category>' + video.category + '</video:category>'; if (video.restriction) { videoxml += '<video:restriction' + attrBuilder(video, 'restriction:relationship') + '>' + video.restriction + '</video:restriction>'; } if (video.gallery_loc) { videoxml += '<video:gallery_loc' + attrBuilder(video, 'gallery_loc:title') + '>' + safeUrl({url: video.gallery_loc}) + '</video:gallery_loc>'; } if (video.price) { videoxml += '<video:price' + attrBuilder(video, ['price:resolution', 'price:currency', 'price:type']) + '>' + video.price + '</video:price>'; } if (video.requires_subscription) videoxml += '<video:requires_subscription>' + video.requires_subscription + '</video:requires_subscription>'; if (video.uploader) videoxml += '<video:uploader>' + video.uploader + '</video:uploader>'; if (video.platform) { videoxml += '<video:platform' + attrBuilder(video, 'platform:relationship') + '>' + video.platform + '</video:platform>'; } if (video.live) videoxml += '<video:live>' + video.live + '</video:live>'; videoxml += '</video:video>' }); xml = xml.replace('{' + p + '}', videoxml); } else if (this[p] && p == 'links') { xml = xml.replace('{' + p + '}', this[p].map(function (link) { return '<xhtml:link rel="alternate" hreflang="' + link.lang + '" href="' + safeUrl(link) + '" />'; }).join(" ")); } else if (this[p] && p === 'expires') { xml = xml.replace('{' + p + '}', '<' + p + '>' + new Date(this[p]).toISOString() + '</' + p + '>'); } else if (this[p] && p == 'androidLink') { xml = xml.replace('{' + p + '}', '<xhtml:link rel="alternate" href="' + this[p] + '" />'); } else if (this[p] && p == 'mobile') { xml = xml.replace('{' + p + '}', '<mobile:mobile/>'); } else if (p == 'priority' && (this[p] >= 0.0 && this[p] <= 1.0)) { xml = xml.replace('{' + p + '}', '<' + p + '>' + parseFloat(this[p]).toFixed(1) + '</' + p + '>'); } else if (this[p] && p == 'ampLink') { xml = xml.replace('{' + p + '}', '<xhtml:link rel="amphtml" href="' + this[p] + '" />'); } else if (this[p] && p == 'news') { var newsitem = '<news:news>'; if (!this[p].publication || !this[p].publication.name || !this[p].publication.language || !this[p].publication_date || !this[p].title ) { throw new err.InvalidNewsFormat() } newsitem += '<news:publication>'; newsitem += '<news:name>' + this[p].publication.name + '</news:name>'; newsitem += '<news:language>' + this[p].publication.language + '</news:language>'; newsitem += '</news:publication>'; if (this[p].access) { if ( this[p].access !== 'Registration' && this[p].access !== 'Subscription' ) { throw new err.InvalidNewsAccessValue() } newsitem += '<news:access>' + this[p].access + '</news:access>'; } if (this[p].genres) { newsitem += '<news:genres>' + this[p].genres + '</news:genres>'; } newsitem += '<news:publication_date>' + this[p].publication_date + '</news:publication_date>'; newsitem += '<news:title>' + this[p].title + '</news:title>'; if (this[p].keywords) { newsitem += '<news:keywords>' + this[p].keywords + '</news:keywords>'; } if (this[p].stock_tickers) { newsitem += '<news:stock_tickers>' + this[p].stock_tickers + '</news:stock_tickers>'; } newsitem += '</news:news>'; xml = xml.replace('{' + p + '}', newsitem); } else if (this[p]) { xml = xml.replace('{' + p + '}', '<' + p + '>' + this[p] + '</' + p + '>'); } else { xml = xml.replace('{' + p + '}', ''); } xml = xml.replace(' ', ' '); } return xml.replace(' ', ' '); }; /** >>>>>>> <<<<<<< if (urls) Object.assign(this.urls, (urls instanceof Array) ? urls : [urls]) ======= if (urls) this.urls = Array.isArray(urls) ? Array.from(urls) : [urls]; >>>>>>> if (urls) this.urls = Array.isArray(urls) ? Array.from(urls) : [urls] <<<<<<< self.fs = require('fs') ======= >>>>>>> <<<<<<< if (!self.fs.statSync(targetFolder).isDirectory()) { throw new err.UndefinedTargetFolder() ======= if (!fs.statSync(targetFolder).isDirectory()) { throw new err.UndefinedTargetFolder(); >>>>>>> if (!fs.statSync(targetFolder).isDirectory()) { throw new err.UndefinedTargetFolder() <<<<<<< self.urls = urls || [] if (!(self.urls instanceof Array)) { ======= self.urls = urls || []; if (!Array.isArray(self.urls)) { >>>>>>> self.urls = urls || [] if (!Array.isArray(self.urls)) { <<<<<<< var stream = self.fs.createWriteStream(targetFolder + '/' + filename) ======= var stream = fs.createWriteStream(targetFolder + '/' + filename); >>>>>>> var stream = fs.createWriteStream(targetFolder + '/' + filename) <<<<<<< var stream = self.fs.createWriteStream(targetFolder + '/' + self.sitemapName + '-index.xml') ======= var stream = fs.createWriteStream(targetFolder + '/' + self.sitemapName + '-index.xml'); >>>>>>> var stream = fs.createWriteStream(targetFolder + '/' + self.sitemapName + '-index.xml')
<<<<<<< 'use strict' const { resolve } = require('path') const { createReadStream, createWriteStream } = require('fs') const {clearLine, cursorTo} = require('readline') const { finished } = require('stream') const { promisify } = require('util') const { lineSeparatedURLsToSitemapOptions, SitemapStream } = require('../dist/index') const finishedP = promisify(finished) ======= 'use strict'; const { resolve } = require('path'); const { createReadStream, readFileSync, createWriteStream } = require('fs'); const { clearLine, cursorTo } = require('readline'); const { finished } = require('stream'); const { promisify } = require('util'); const { createSitemap, lineSeparatedURLsToSitemapOptions, SitemapStream, } = require('../dist/index'); const finishedP = promisify(finished); >>>>>>> 'use strict'; const { resolve } = require('path'); const { createReadStream, createWriteStream } = require('fs'); const { clearLine, cursorTo } = require('readline'); const { finished } = require('stream'); const { promisify } = require('util'); const { lineSeparatedURLsToSitemapOptions, SitemapStream, } = require('../dist/index'); const finishedP = promisify(finished); <<<<<<< ======= case 'creation': console.log('testing sitemap creation w/o printing'); printPerf( 'sitemap creation', await run([], 0, () => createSitemap({ hostname: 'https://roosterteeth.com', urls: JSON.parse( readFileSync(resolve(__dirname, 'mocks', 'perf-data.json'), { encoding: 'utf8', }) ), }) ) ); break; case 'toString': console.log('testing toString'); const sitemap = createSitemap({ hostname: 'https://roosterteeth.com', urls: JSON.parse( readFileSync(resolve(__dirname, 'mocks', 'perf-data.json'), { encoding: 'utf8', }) ), }); printPerf('toString', await run([], 0, () => sitemap.toString())); break; case 'combined': console.log('testing combined'); printPerf( 'combined', await run([], 0, () => createSitemap({ hostname: 'https://roosterteeth.com', urls: JSON.parse( readFileSync(resolve(__dirname, 'mocks', 'perf-data.json'), { encoding: 'utf8', }) ), }).toString() ) ); break; >>>>>>>
<<<<<<< window.onkeydown = function(evt) { if(evt.ctrlKey && evt.which == 83) { evt.preventDefault(); console.log("CTRL+S - SYNCING"); sync.syncNow('/', function(errors) {}); return false; } } ======= //TODO: discuss with Niklas how to wire all these events. it should be onload, but inside the display function seems wrong sync.syncNow('/', function(errors) { }); >>>>>>> window.onkeydown = function(evt) { if(evt.ctrlKey && evt.which == 83) { evt.preventDefault(); console.log("CTRL+S - SYNCING"); sync.syncNow('/', function(errors) {}); return false; } } //TODO: discuss with Niklas how to wire all these events. it should be onload, but inside the display function seems wrong sync.syncNow('/', function(errors) { });
<<<<<<< ======= mqtt_client.on('message', function (topic, message) { try { message = message.toString(); var action = getActionFromTopic(topic); var options = getDeviceFromTopic(topic); debug("receive settings", JSON.stringify({ topic: topic, action: action, message: message, options: options })); var device = new TuyaDevice(options); device.then(function (params) { var device = params.device; switch (action) { case "command": var command = getCommandFromTopic(topic, message); debug("receive command", command); if (command == "toggle") { device.switch(command).then((data) => { debug("set device status completed", data); }); } if (command.schema === true) { // this command is very useful. IT IS A COMMAND. It's place under the command topic. // It's the ONLY command that does not use device.set to get a result. // You have to use device.get and send the get method an exact JSON string of { schema: true } // This schema command does NOT // change the state of the device, all it does is query the device // as a confirmation that all communications are working properly. // Otherwise you have to physically change the state of the device just to // find out if you can talk to it. If this command returns no errors than // we know we are have an established communication channel. This is a native TuyAPI call that // the TuyAPI interface defines (its only available via the GET command. // this call returns a object of results device.schema(command).then((data) => { }); debug("get (schema) device status completed"); } else { device.set(command).then((data) => { debug("set device status completed", data); }); } break; case "color": var color = message.toLowerCase(); debugColor("set color: ", color); device.setColor(color).then((data) => { debug("set device color completed", data); }); break; } }).catch((err) => { debugError(err); }); } catch (e) { debugError(e); } }); >>>>>>> mqtt_client.on('message', function (topic, message) { try { message = message.toString(); var action = getActionFromTopic(topic); var options = getDeviceFromTopic(topic); debug("receive settings", JSON.stringify({ topic: topic, action: action, message: message, options: options })); var device = new TuyaDevice(options); device.then(function (params) { var device = params.device; switch (action) { case "command": var command = getCommandFromTopic(topic, message); debug("receive command", command); if (command == "toggle") { device.switch(command).then((data) => { debug("set device status completed", data); }); } if (command.schema === true) { // this command is very useful. IT IS A COMMAND. It's place under the command topic. // It's the ONLY command that does not use device.set to get a result. // You have to use device.get and send the get method an exact JSON string of { schema: true } // This schema command does NOT // change the state of the device, all it does is query the device // as a confirmation that all communications are working properly. // Otherwise you have to physically change the state of the device just to // find out if you can talk to it. If this command returns no errors than // we know we are have an established communication channel. This is a native TuyAPI call that // the TuyAPI interface defines (its only available via the GET command. // this call returns a object of results device.schema(command).then((data) => { }); debug("get (schema) device status completed"); } else { device.set(command).then((data) => { debug("set device status completed", data); }); } break; case "color": var color = message.toLowerCase(); debugColor("set color: ", color); device.setColor(color).then((data) => { debug("set device color completed", data); }); break; } }).catch((err) => { debugError(err); }); } catch (e) { debugError(e); } }); <<<<<<< // Call the main code main() ======= /** * Function call on script exit */ function onExit() { TuyaDevice.disconnectAll(); if (tester) tester.destroy(); }; >>>>>>> // Call the main code main() /** * Function call on script exit */ function onExit() { TuyaDevice.disconnectAll(); if (tester) tester.destroy(); };
<<<<<<< import * as it from './translations/it.json'; ======= import * as ru from './translations/ru.json'; >>>>>>> import * as it from './translations/it.json'; import * as ru from './translations/ru.json'; <<<<<<< pl, it ======= pl, ru >>>>>>> pl, it, ru
<<<<<<< }); /* * Code for parsing the slot string from inputSlotString * */ $("#inputSlotString + span .btn").click(function() { var input = $("#inputSlotString").val().trim(); var slotArray = input.split("+"); console.log(slotArray); slotArray.forEach(function(slot) { markSlot(slot); }); }); /** * Toggles slot highlighting of passed slot in the table. * @param {string} slot individual slot obtained from passed input. * @return {undefined} */ function markSlot(slot) { var labSlotPattern = /^L\d{1,2}$/; var slotNum; if(labSlotPattern.test(slot)) { if(!labArray) makeLabArray(); slotNum = Number(slot.substring(1)); if(!(slotNum >= 15 && slotNum <= 18)) labArray.eq(slotNum - 1) .toggleClass("highlight"); } else if($("." + slot)) { $("." + slot).toggleClass("highlight"); } } /** * Prepares a $ collection of all the slots in the table in ascending order * and pads 3 null objects to compensate for missing slots. The result is * stored in labArray. * @return {undefined} */ function makeLabArray() { var left = $(), right = $(); var slots = $(".TimetableContent"); slots.splice(26, 0, null, null, null); var length = slots.length; var i; for(i = 0; i < 60; ++i) { if(i % 12 < 6) left.push(slots.eq(i)); else right.push(slots.eq(i)); } labArray = left.add(right); } ======= }); $(".alert-dismissible .close").click(function() { $(this).parent() .toggleClass("hide"); }); >>>>>>> }); /* * Code for parsing the slot string from inputSlotString * */ $("#inputSlotString + span .btn").click(function() { var input = $("#inputSlotString").val().trim(); var slotArray = input.split("+"); console.log(slotArray); slotArray.forEach(function(slot) { markSlot(slot); }); }); /** * Toggles slot highlighting of passed slot in the table. * @param {string} slot individual slot obtained from passed input. * @return {undefined} */ function markSlot(slot) { var labSlotPattern = /^L\d{1,2}$/; var slotNum; if(labSlotPattern.test(slot)) { if(!labArray) makeLabArray(); slotNum = Number(slot.substring(1)); if(!(slotNum >= 15 && slotNum <= 18)) labArray.eq(slotNum - 1) .toggleClass("highlight"); } else if($("." + slot)) { $("." + slot).toggleClass("highlight"); } } /** * Prepares a $ collection of all the slots in the table in ascending order * and pads 3 null objects to compensate for missing slots. The result is * stored in labArray. * @return {undefined} */ function makeLabArray() { var left = $(), right = $(); var slots = $(".TimetableContent"); slots.splice(26, 0, null, null, null); var length = slots.length; var i; for(i = 0; i < 60; ++i) { if(i % 12 < 6) left.push(slots.eq(i)); else right.push(slots.eq(i)); } labArray = left.add(right); } $(".alert-dismissible .close").click(function() { $(this).parent() .toggleClass("hide"); });
<<<<<<< var coevery = angular.module('coevery', ['ng', 'ngGrid', 'ngResource', 'agt.detour', 'ui.utils', 'coevery.formdesigner', 'SharedServices', 'ui.bootstrap', 'coevery.common']); ======= var coevery = angular.module('coevery', ['ng', 'ngGrid', 'ngResource', 'agt.detour', 'ui.utils', 'coevery.formdesigner', 'coevery.grid', 'SharedServices', 'ui.bootstrap']); >>>>>>> var coevery = angular.module('coevery', ['ng', 'ngGrid', 'ngResource', 'agt.detour', 'ui.utils', 'coevery.formdesigner', 'coevery.grid', 'SharedServices', 'ui.bootstrap', 'coevery.common']);
<<<<<<< var isMobileWeb = Ti.Platform.osname === 'mobileweb', isTizen = Ti.Platform.osname === 'tizen', win = Titanium.UI.createWindow(); ======= var win = Titanium.UI.createWindow({ title:_args.title }); >>>>>>> var isMobileWeb = Ti.Platform.osname === 'mobileweb', isTizen = Ti.Platform.osname === 'tizen', win = Titanium.UI.createWindow({ title:_args.title }); <<<<<<< w = new Win(), b = Titanium.UI.createButton( {title: 'Close'} ); isTizen || (b.style = Titanium.UI.iPhone.SystemButtonStyle.PLAIN); w.title = 'Modal Window'; w.barColor = 'black'; isTizen ? w.add(b) : w.setLeftNavButton(b); b.addEventListener('click',function() { ======= w = new Win({title: 'Modal Window'}); w.barColor = 'black'; var b = Titanium.UI.createButton({ title:'Close', style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN }); w.setLeftNavButton(b); b.addEventListener('click',function() { >>>>>>> w = new Win(), b = Titanium.UI.createButton( {title: 'Close'} ); isTizen || (b.style = Titanium.UI.iPhone.SystemButtonStyle.PLAIN); w.title = 'Modal Window'; w.barColor = 'black'; isTizen ? w.add(b) : w.setLeftNavButton(b); b.addEventListener('click',function() {
<<<<<<< import Intersection from './directives/Intersection.js' ======= import Mutation from './directives/Mutation.js' >>>>>>> import Intersection from './directives/Intersection.js' import Mutation from './directives/Mutation.js' <<<<<<< Intersection, ======= Mutation, >>>>>>> Intersection, Mutation,
<<<<<<< if (Ti.Platform.osname !== 'android' && Ti.Platform.osname !== 'tizen') { ======= data.push({title:'Contact images',hasChild:true, test:'ui/common/phone/contacts_image'}); if (Ti.Platform.osname !== 'android') { >>>>>>> data.push({title:'Contact images',hasChild:true, test:'ui/common/phone/contacts_image'}); if (Ti.Platform.osname !== 'android' && Ti.Platform.osname !== 'tizen') {
<<<<<<< capacitor: {}, bin: {}, ======= bex: { builder: { directories: { input: '', output: '' } } }, >>>>>>> capacitor: {}, bin: {}, bex: { builder: { directories: { input: '', output: '' } } }, <<<<<<< else if (this.ctx.mode.cordova || this.ctx.mode.capacitor || this.ctx.mode.electron) { ======= else if (this.ctx.mode.cordova || this.ctx.mode.electron || this.ctx.mode.bex) { >>>>>>> else if (this.ctx.mode.cordova || this.ctx.mode.capacitor || this.ctx.mode.electron || this.ctx.mode.bex) { <<<<<<< if (this.ctx.mode.cordova || this.ctx.mode.capacitor) { cfg.build.packagedDistDir = path.join(cfg.build.distDir, this.ctx.targetName) } if (this.ctx.mode.cordova || this.ctx.mode.capacitor) { cfg.build.distDir = appPaths.resolve[this.ctx.modeName]('www') } else if (this.ctx.mode.electron) { cfg.build.packagedDistDir = cfg.build.distDir ======= if (this.ctx.mode.electron || this.ctx.mode.bex) { cfg.build.packagedDistDir = cfg.build.distDir >>>>>>> if (this.ctx.mode.cordova || this.ctx.mode.capacitor) { cfg.build.packagedDistDir = path.join(cfg.build.distDir, this.ctx.targetName) } if (this.ctx.mode.cordova || this.ctx.mode.capacitor) { cfg.build.distDir = appPaths.resolve[this.ctx.modeName]('www') } else if (this.ctx.mode.electron || this.ctx.mode.bex) { cfg.build.packagedDistDir = cfg.build.distDir <<<<<<< else if (this.ctx.mode.cordova || this.ctx.mode.capacitor) { ======= else if (this.ctx.mode.cordova || this.ctx.mode.bex) { >>>>>>> else if (this.ctx.mode.cordova || this.ctx.mode.capacitor || this.ctx.mode.bex) {
<<<<<<< force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner hideOnInstall: true, // Hide the banner after "VIEW" is clicked. layer: false // Display as overlay layer or slide down the page } $.smartbanner.Constructor = SmartBanner; // ============================================================ // Bootstrap transition // Copyright 2011-2014 Twitter, Inc. // Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) function transitionEnd() { var el = document.createElement('smartbanner') var transEndEventNames = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return {end: transEndEventNames[name]} } } return false // explicit for ie8 ( ._.) } if ($.support.transition !== undefined) return // Prevent conflict with Twitter Bootstrap // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function(duration) { var called = false, $el = this $(this).one($.support.transition.end, function() { called = true }) var callback = function() { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this ======= force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner iOSUniversalApp: true // If the iOS App is a universal app for both iPad and iPhone, display Smart Banner to iPad users, too. >>>>>>> force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner hideOnInstall: true, // Hide the banner after "VIEW" is clicked. layer: false, // Display as overlay layer or slide down the page iOSUniversalApp: true // If the iOS App is a universal app for both iPad and iPhone, display Smart Banner to iPad users, too. } $.smartbanner.Constructor = SmartBanner; // ============================================================ // Bootstrap transition // Copyright 2011-2014 Twitter, Inc. // Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) function transitionEnd() { var el = document.createElement('smartbanner') var transEndEventNames = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return {end: transEndEventNames[name]} } } return false // explicit for ie8 ( ._.) } if ($.support.transition !== undefined) return // Prevent conflict with Twitter Bootstrap // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function(duration) { var called = false, $el = this $(this).one($.support.transition.end, function() { called = true }) var callback = function() { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this
<<<<<<< case 'persistState': console.log('message to persist state hit'); switchPersistMode(); break; ======= // Todo: Implementing the throttle change case 'throttleEdit': let throttleVal = parseInt(msg.data.payload.value); throttleLimit = throttleVal; console.log('this is the throttleEdits', throttleVal); break; >>>>>>> case 'persistState': console.log('message to persist state hit'); switchPersistMode(); break; // Todo: Implementing the throttle change case 'throttleEdit': let throttleVal = parseInt(msg.data.payload.value); throttleLimit = throttleVal; console.log('this is the throttleEdits', throttleVal); break;
<<<<<<< // Handle events when the user finishes the content. Useful for logging exercise results. instance.$.on('finish', function (event) { if (event.data !== undefined) { H5P.setFinished(contentId, event.data.score, event.data.maxScore, event.data.time); } }); if (H5P.isFramed) var resizeDelay;{ if (H5P.externalEmbed === false) { // Internal embed // Make it possible to resize the iframe when the content changes size. This way we get no scrollbars. var iframe = window.parent.document.getElementById('h5p-iframe-' + contentId); var resizeIframe = function () { if (window.parent.H5P.isFullscreen) { return; // Skip if full screen. } // Retain parent size to avoid jumping/scrolling var parentHeight = iframe.parentElement.style.height; iframe.parentElement.style.height = iframe.parentElement.clientHeight + 'px'; // Reset iframe height, in case content has shrinked. iframe.style.height = '1px'; // Resize iframe so all content is visible. iframe.style.height = (iframe.contentDocument.body.scrollHeight) + 'px'; // Free parent iframe.parentElement.style.height = parentHeight; }; instance.$.on('resize', function () { // Use a delay to make sure iframe is resized to the correct size. clearTimeout(resizeDelay); resizeDelay = setTimeout(function () { resizeIframe(); }, 1); }); } else if (H5P.communicator) { // External embed var parentIsFriendly = false; // Handle hello message from our parent window H5P.communicator.on('hello', function () { // Initial setup/handshake is done parentIsFriendly = true; // Hide scrollbars for correct size document.body.style.overflow = 'hidden'; H5P.communicator.send('prepareResize'); }); // When resize has been prepared tell parent window to resize H5P.communicator.on('resizePrepared', function (data) { H5P.communicator.send('resize', { height: document.body.scrollHeight, parentHeight: data.parentHeight }); }); H5P.communicator.on('resize', function () { instance.$.trigger('resize'); }); instance.$.on('resize', function () { if (H5P.isFullscreen) { return; // Skip iframe resize } // Use a delay to make sure iframe is resized to the correct size. clearTimeout(resizeDelay); resizeDelay = setTimeout(function () { // Only resize if the iframe can be resized if (parentIsFriendly) { H5P.communicator.send('prepareResize'); } else { H5P.communicator.send('hello'); } }, 0); }); } } if (!H5P.isFramed || H5P.externalEmbed === false) { // Resize everything when window is resized. H5P.jQuery(window.top).resize(function () { ======= if (H5P.isFramed) { // Make it possible to resize the iframe when the content changes size. This way we get no scrollbars. var iframe = window.parent.document.getElementById('h5p-iframe-' + contentId); var resizeIframe = function () { >>>>>>> // Handle events when the user finishes the content. Useful for logging exercise results. H5P.on(instance, 'finish', function (event) { if (event.data !== undefined) { H5P.setFinished(contentId, event.data.score, event.data.maxScore, event.data.time); } }); // Listen for xAPI events. H5P.on(instance, 'xAPI', H5P.xAPICompletedListener); H5P.on(instance, 'xAPI', H5P.externalDispatcher.trigger); if (H5P.isFramed) var resizeDelay;{ if (H5P.externalEmbed === false) { // Internal embed // Make it possible to resize the iframe when the content changes size. This way we get no scrollbars. var iframe = window.parent.document.getElementById('h5p-iframe-' + contentId); var resizeIframe = function () { if (window.parent.H5P.isFullscreen) { return; // Skip if full screen. } // Retain parent size to avoid jumping/scrolling var parentHeight = iframe.parentElement.style.height; iframe.parentElement.style.height = iframe.parentElement.clientHeight + 'px'; // Reset iframe height, in case content has shrinked. iframe.style.height = '1px'; // Resize iframe so all content is visible. iframe.style.height = (iframe.contentDocument.body.scrollHeight) + 'px'; // Free parent iframe.parentElement.style.height = parentHeight; }; H5P.on(instance, 'resize', function () { // Use a delay to make sure iframe is resized to the correct size. clearTimeout(resizeDelay); resizeDelay = setTimeout(function () { resizeIframe(); }, 1); }); } else if (H5P.communicator) { // External embed var parentIsFriendly = false; // Handle hello message from our parent window H5P.communicator.on('hello', function () { // Initial setup/handshake is done parentIsFriendly = true; // Hide scrollbars for correct size document.body.style.overflow = 'hidden'; H5P.communicator.send('prepareResize'); }); // When resize has been prepared tell parent window to resize H5P.communicator.on('resizePrepared', function (data) { H5P.communicator.send('resize', { height: document.body.scrollHeight, parentHeight: data.parentHeight }); }); H5P.communicator.on('resize', function () { H5P.trigger(instance, 'resize'); }); H5P.on(instance, 'resize', function () { if (H5P.isFullscreen) { return; // Skip iframe resize } // Use a delay to make sure iframe is resized to the correct size. clearTimeout(resizeDelay); resizeDelay = setTimeout(function () { // Only resize if the iframe can be resized if (parentIsFriendly) { H5P.communicator.send('prepareResize'); } else { H5P.communicator.send('hello'); } }, 0); }); } } if (!H5P.isFramed || H5P.externalEmbed === false) { // Resize everything when window is resized. H5P.jQuery(window.top).resize(function () { <<<<<<< ======= H5P.on(instance, 'xAPI', H5P.xAPICompletedListener); H5P.on(instance, 'xAPI', H5P.externalDispatcher.trigger); // Resize everything when window is resized. $window.resize(function () { if (window.parent.H5P.isFullscreen) { // Use timeout to avoid bug in certain browsers when exiting fullscreen. Some browser will trigger resize before the fullscreenchange event. H5P.trigger(instance, 'resize'); } else { H5P.trigger(instance, 'resize'); } }); >>>>>>> <<<<<<< instance.$.trigger('resize'); instance.$.trigger('focus'); instance.$.trigger('enterFullScreen'); ======= H5P.trigger(instance, 'resize'); H5P.trigger(instance, 'focus'); >>>>>>> H5P.trigger(instance, 'resize'); H5P.trigger(instance, 'focus'); H5P.trigger(instance, 'enterFullScreen'); <<<<<<< } ======= } // Finally, we want to run init when document is ready. // TODO: Move to integration. Systems like Moodle using YUI cannot get its translations set before this starts! if (H5P.jQuery) { H5P.jQuery(document).ready(function () { if (!H5P.initialized) { H5P.initialized = true; H5P.init(); } }); } /** * Trigger an event on an instance * * Helper function that triggers an event if the instance supports event handling * * @param {function} instance * An H5P instance * @param {string} eventType * The event type */ H5P.trigger = function(instance, eventType) { // Try new event system first if (instance.trigger !== undefined) { instance.trigger(eventType); } // Try deprecated event system else if (instance.$ !== undefined && instance.$.trigger !== undefined) { instance.$.trigger(eventType) } }; /** * Register an event handler * * Helper function that registers an event handler for an event type if * the instance supports event handling * * @param {function} instance * An h5p instance * @param {string} eventType * The event type * @param {function} handler * Callback that gets triggered for events of the specified type */ H5P.on = function(instance, eventType, handler) { // Try new event system first if (instance.on !== undefined) { instance.on(eventType, handler); } // Try deprecated event system else if (instance.$ !== undefined && instance.$.on !== undefined) { instance.$.on(eventType, handler) } }; >>>>>>> } /** * Trigger an event on an instance * * Helper function that triggers an event if the instance supports event handling * * @param {function} instance * An H5P instance * @param {string} eventType * The event type */ H5P.trigger = function(instance, eventType) { // Try new event system first if (instance.trigger !== undefined) { instance.trigger(eventType); } // Try deprecated event system else if (instance.$ !== undefined && instance.$.trigger !== undefined) { instance.$.trigger(eventType) } }; /** * Register an event handler * * Helper function that registers an event handler for an event type if * the instance supports event handling * * @param {function} instance * An h5p instance * @param {string} eventType * The event type * @param {function} handler * Callback that gets triggered for events of the specified type */ H5P.on = function(instance, eventType, handler) { // Try new event system first if (instance.on !== undefined) { instance.on(eventType, handler); } // Try deprecated event system else if (instance.$ !== undefined && instance.$.on !== undefined) { instance.$.on(eventType, handler) } };
<<<<<<< '<input class="h5p-admin-restricted" type="checkbox"/>', library.numContent, library.numContentDependencies, library.numLibraryDependencies, ======= { text: library.numContent, class: 'h5p-admin-center' }, { text: library.numContentDependencies, class: 'h5p-admin-center' }, { text: library.numLibraryDependencies, class: 'h5p-admin-center' }, >>>>>>> '<input class="h5p-admin-restricted" type="checkbox"/>', { text: library.numContent, class: 'h5p-admin-center' }, { text: library.numContentDependencies, class: 'h5p-admin-center' }, { text: library.numLibraryDependencies, class: 'h5p-admin-center' }, <<<<<<< H5PLibraryList.addRestricted($('.h5p-admin-restricted', $libraryRow), library.restrictedUrl, library.restricted); ======= var hasContent = !(library.numContent === '' || library.numContent === 0); >>>>>>> H5PLibraryList.addRestricted($('.h5p-admin-restricted', $libraryRow), library.restrictedUrl, library.restricted); var hasContent = !(library.numContent === '' || library.numContent === 0);
<<<<<<< function handleCustomText(paneClass) { // Function Objective: Search for and handle block of VTT Message text... //...in pane Notes or Description const outCustomRollFuncs = { before: [], replace:[], after: [], roll: (customTextFuncList, normalRollFunction=undefined) => { if (customTextFuncList.length > 0) { for (let i = 0; i < customTextFuncList.length; i++) { customTextFuncList[i](); } } else if (normalRollFunction) { normalRollFunction(); } }, }; const regexp = /```\[([^\]]*)\]\s*((\S|\s)*?)\s*```/g; const rollOrderTypes = ["before", "after", "replace"];//(relative to normal roll msg) const paneText = descriptionToString($(`.${paneClass}`).find(".ddbc-property-list__property:contains('Notes:'), .ct-action-detail__description, .ct-spell-detail__description, .ct-item-detail__description, .ddbc-action-detail__description, .ddbc-spell-detail__description, .ddbc-item-detail__description")); console.log("Pane Text: " + paneText); const matchedText = [...paneText.matchAll(regexp)]; //Handle Matched Text if (matchedText) { console.log("Matched Text:\n"+matchedText); for (let i = 0; i < matchedText.length; i++) { const cMatchType = matchedText[i][1].toLowerCase(); const cMatchText = matchedText[i][2]; // Determine if we should prevent the default action/message from being sent to the VTT console.log("Note Match #"+i+" (Provided Type: "+cMatchType+"):\n"+cMatchText); let rollOrder = rollOrderTypes[0]; if (rollOrderTypes.includes(cMatchType)) { rollOrder = cMatchType; } else { console.warn(`Invalid CustomText roll order specified ("${cMatchType}"). Defaulting to "${rollOrder}" instead.`) } outCustomRollFuncs[rollOrder].push(()=>{ sendRollWithCharacter("action", 0, { "type": "chat-message", "text": cMatchText }); }); } } return outCustomRollFuncs; } function execute(paneClass) { console.log("Beyond20: Executing panel : " + paneClass); const execRoll = function() { if (["ct-skill-pane", "ct-custom-skill-pane"].includes(paneClass)) rollSkillCheck(paneClass); else if (paneClass == "ct-ability-pane") rollAbilityCheck(); else if (paneClass == "ct-ability-saving-throws-pane") rollSavingThrow(); else if (paneClass == "ct-initiative-pane") rollInitiative(); else if (paneClass == "ct-item-pane") rollItem(); else if (["ct-action-pane", "ct-custom-action-pane"].includes(paneClass)) rollAction(paneClass); else if (paneClass == "ct-spell-pane") rollSpell(); else displayPanel(paneClass); } const customTextRolls = handleCustomText(paneClass); customTextRolls.roll(customTextRolls.before); customTextRolls.roll(customTextRolls.replace, execRoll); customTextRolls.roll(customTextRolls.after); ======= function execute(paneClass, force_to_hit_only = false, force_damages_only = false) { console.log("Beyond20: Executing panel : " + paneClass, force_to_hit_only, force_damages_only); if (["ct-skill-pane", "ct-custom-skill-pane"].includes(paneClass)) rollSkillCheck(paneClass); else if (paneClass == "ct-ability-pane") rollAbilityCheck(); else if (paneClass == "ct-ability-saving-throws-pane") rollSavingThrow(); else if (paneClass == "ct-initiative-pane") rollInitiative(); else if (paneClass == "ct-item-pane") rollItem(false, force_to_hit_only, force_damages_only); else if (["ct-action-pane", "ct-custom-action-pane"].includes(paneClass)) rollAction(paneClass, force_to_hit_only, force_damages_only); else if (paneClass == "ct-spell-pane") rollSpell(false, force_to_hit_only, force_damages_only); else displayPanel(paneClass); >>>>>>> function handleCustomText(paneClass) { // Function Objective: Search for and handle block of VTT Message text... //...in pane Notes or Description const outCustomRollFuncs = { before: [], replace:[], after: [], roll: (customTextFuncList, normalRollFunction=undefined) => { if (customTextFuncList.length > 0) { for (let i = 0; i < customTextFuncList.length; i++) { customTextFuncList[i](); } } else if (normalRollFunction) { normalRollFunction(); } }, }; const regexp = /```\[([^\]]*)\]\s*((\S|\s)*?)\s*```/g; const rollOrderTypes = ["before", "after", "replace"];//(relative to normal roll msg) const paneText = descriptionToString($(`.${paneClass}`).find(".ddbc-property-list__property:contains('Notes:'), .ct-action-detail__description, .ct-spell-detail__description, .ct-item-detail__description, .ddbc-action-detail__description, .ddbc-spell-detail__description, .ddbc-item-detail__description")); console.log("Pane Text: " + paneText); const matchedText = [...paneText.matchAll(regexp)]; //Handle Matched Text if (matchedText) { console.log("Matched Text:\n"+matchedText); for (let i = 0; i < matchedText.length; i++) { const cMatchType = matchedText[i][1].toLowerCase(); const cMatchText = matchedText[i][2]; // Determine if we should prevent the default action/message from being sent to the VTT console.log("Note Match #"+i+" (Provided Type: "+cMatchType+"):\n"+cMatchText); let rollOrder = rollOrderTypes[0]; if (rollOrderTypes.includes(cMatchType)) { rollOrder = cMatchType; } else { console.warn(`Invalid CustomText roll order specified ("${cMatchType}"). Defaulting to "${rollOrder}" instead.`) } outCustomRollFuncs[rollOrder].push(()=>{ sendRollWithCharacter("action", 0, { "type": "chat-message", "text": cMatchText }); }); } } return outCustomRollFuncs; } function execute(paneClass, force_to_hit_only = false, force_damages_only = false) { console.log("Beyond20: Executing panel : " + paneClass, force_to_hit_only, force_damages_only); const execRoll = function() { if (["ct-skill-pane", "ct-custom-skill-pane"].includes(paneClass)) rollSkillCheck(paneClass); else if (paneClass == "ct-ability-pane") rollAbilityCheck(); else if (paneClass == "ct-ability-saving-throws-pane") rollSavingThrow(); else if (paneClass == "ct-initiative-pane") rollInitiative(); else if (paneClass == "ct-item-pane") rollItem(false, force_to_hit_only, force_damages_only); else if (["ct-action-pane", "ct-custom-action-pane"].includes(paneClass)) rollAction(paneClass, force_to_hit_only, force_damages_only); else if (paneClass == "ct-spell-pane") rollSpell(false, force_to_hit_only, force_damages_only); else displayPanel(paneClass); } const customTextRolls = handleCustomText(paneClass); customTextRolls.roll(customTextRolls.before); customTextRolls.roll(customTextRolls.replace, execRoll); customTextRolls.roll(customTextRolls.after);
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true ======= }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true >>>>>>> }, "genies-vessel": { "title": "Genie's Vessel: Genie's Wrath - Extra Damage", "description": "You genie patron lends their wrath to your attacks.", "type": "bool", "default": true }, "halfling-lucky": { "title": "Halfling Lucky", "description": "The luck of your people guides your steps", "type": "bool", "default": true
<<<<<<< docsSideNavCollapsible: false, ======= algolia: { apiKey: 'a2f42d84af398a5bc73faf5caf364f6a', indexName: 'trustworktech_create-react-ssr-app', }, >>>>>>> docsSideNavCollapsible: false, algolia: { apiKey: 'a2f42d84af398a5bc73faf5caf364f6a', indexName: 'trustworktech_create-react-ssr-app', },
<<<<<<< { jhipsterVar, jhipsterFunc }, this.options.testmode ? { local: require.resolve('generator-jhipster/generators/modules') } : null ); this.prodDatabaseType = jhipsterVar.prodDatabaseType; /* TODO remove on prod this.log(chalk.blue('<<<<<BEFORE')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/ ======= { jhipsterVar, jhipsterFunc }, this.options.testmode ? { local: require.resolve('generator-jhipster/generators/modules') } : null ); /* / TODO remove on prod this.prodDatabaseType = jhipsterVar.prodDatabaseType; this.log(chalk.blue('<<<<<BEFORE')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/ >>>>>>> { jhipsterVar, jhipsterFunc }, this.options.testmode ? { local: require.resolve('generator-jhipster/generators/modules') } : null ); /* / TODO remove on prod this.prodDatabaseType = jhipsterVar.prodDatabaseType; this.log(chalk.blue('<<<<<BEFORE')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/ <<<<<<< ======= >>>>>>> <<<<<<< // Update the tableName this.log(chalk.blue('tableName from ' + this.entityConfig.entityTableName + ' to ' + this.tableNameInput)); jhipsterFunc.replaceContent(files.config, '"entityTableName": "' + this.entityConfig.entityTableName, '"entityTableName": "' + this.tableNameInput); jhipsterFunc.replaceContent(files.ORM, '@Table(name = "' + this.entityConfig.entityTableName, '@Table(name = "' + this.tableNameInput); jhipsterFunc.replaceContent(files.liquibase, '<createTable tableName="' + this.entityConfig.entityTableName, '<createTable tableName="' + this.tableNameInput); // Add/update the columnName for each field this.columnsInput.forEach((columnItem) => { const fieldNameMatch = `"fieldName": "${columnItem.fieldName}"`; if (columnItem.columnName === undefined) { // We add columnName under fieldName log(chalk.blue(`(${columnItem.fieldName}) ADDING columnName ${columnItem.newColumnName}`)); // '(\\s*)' is for capturing indentation jhipsterFunc.replaceContent(files.config, '(\\s*)' + fieldNameMatch, '$1' + fieldNameMatch + ',$1"columnName": "' + columnItem.newColumnName + '"', true); } else if(columnItem.columnName != columnItem.newColumnName){ // We update existing columnName log(chalk.blue('(' + columnItem.fieldName + ') UPDATING columnName from ' + columnItem.columnName + ' to ' + columnItem.newColumnName)); jhipsterFunc.replaceContent(files.config, '"columnName": "' + columnItem.columnName, '"columnName": "' + columnItem.newColumnName); } else { log(chalk.blue('(' + columnItem.fieldName + ') KEEP columnName ' + columnItem.newColumnName)); } // TODO entity generator uses fieldNameAsDatabaseColumn and not fieldNameUnderscored anymore, we don't dispose of the former thou. jhipsterFunc.replaceContent(files.ORM, `@Column(name = "${columnItem.fieldNameUnderscored}`, `@Column(name = "${columnItem.newColumnName}`); jhipsterFunc.replaceContent(files.liquibase, `<column name="${columnItem.fieldNameUnderscored}`, `<column name="${columnItem.newColumnName}`); }); ======= // TODO entity generator uses fieldNameAsDatabaseColumn and not fieldNameUnderscored anymore, we don't dispose of the former thou. jhipsterFunc.replaceContent(files.ORM, `@Column(name = "${columnItem.fieldNameUnderscored}`, `@Column(name = "${columnItem.newColumnName}`); jhipsterFunc.replaceContent(files.liquibase, `<column name="${columnItem.fieldNameUnderscored}`, `<column name="${columnItem.newColumnName}`); }); >>>>>>> // Update the tableName this.log(chalk.blue('tableName from ' + this.entityConfig.entityTableName + ' to ' + this.tableNameInput)); jhipsterFunc.replaceContent(files.config, '"entityTableName": "' + this.entityConfig.entityTableName, '"entityTableName": "' + this.tableNameInput); jhipsterFunc.replaceContent(files.ORM, '@Table(name = "' + this.entityConfig.entityTableName, '@Table(name = "' + this.tableNameInput); jhipsterFunc.replaceContent(files.liquibase, '<createTable tableName="' + this.entityConfig.entityTableName, '<createTable tableName="' + this.tableNameInput); // Add/update the columnName for each field this.columnsInput.forEach((columnItem) => { const fieldNameMatch = `"fieldName": "${columnItem.fieldName}"`; if (columnItem.columnName === undefined) { // We add columnName under fieldName log(chalk.blue(`(${columnItem.fieldName}) ADDING columnName ${columnItem.newColumnName}`)); // '(\\s*)' is for capturing indentation jhipsterFunc.replaceContent(files.config, '(\\s*)' + fieldNameMatch, '$1' + fieldNameMatch + ',$1"columnName": "' + columnItem.newColumnName + '"', true); } else if(columnItem.columnName != columnItem.newColumnName){ // We update existing columnName log(chalk.blue('(' + columnItem.fieldName + ') UPDATING columnName from ' + columnItem.columnName + ' to ' + columnItem.newColumnName)); jhipsterFunc.replaceContent(files.config, '"columnName": "' + columnItem.columnName, '"columnName": "' + columnItem.newColumnName); } else { log(chalk.blue('(' + columnItem.fieldName + ') KEEP columnName ' + columnItem.newColumnName)); } // TODO entity generator uses fieldNameAsDatabaseColumn and not fieldNameUnderscored anymore, we don't dispose of the former thou. jhipsterFunc.replaceContent(files.ORM, `@Column(name = "${columnItem.fieldNameUnderscored}`, `@Column(name = "${columnItem.newColumnName}`); jhipsterFunc.replaceContent(files.liquibase, `<column name="${columnItem.fieldNameUnderscored}`, `<column name="${columnItem.newColumnName}`); }); <<<<<<< /* TODO remove on prod this.log(chalk.blue('AFTER>>>>>')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/ ======= /* / TODO remove on prod this.log(chalk.blue('AFTER>>>>>')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/ >>>>>>> /* TODO remove on prod this.log(chalk.blue('AFTER>>>>>')); this.log(chalk.blue('entityConfig')); this.log(this.entityConfig); this.log(chalk.blue('fields')); this.log(this.fields); this.log(chalk.blue('json'); this.log(this.fs.readJSON(files.config)); this.log(chalk.blue('jhipsterVar')); this.log(jhipsterVar); //*/
<<<<<<< // Generates a JSON-serializable token object representing the interval // of text between the end of the last generated token and the current // stream position. ======= markTokenStart: function() { this.tokenStart = this.pos; }, >>>>>>> markTokenStart: function() { this.tokenStart = this.pos; }, // Generates a JSON-serializable token object representing the interval // of text between the end of the last generated token and the current // stream position.
<<<<<<< ======= function initApp() { return spawn(sane, [ 'new', '.', '--skip-npm', '--skip-bower', '--skip-analytics' ], { stdio: 'ignore' }); } >>>>>>>
<<<<<<< for ( var i = 0; i < styles.length; i++) { if ( styles[i].rel.toLowerCase() === 'stylesheet' && !styles[i].hasAttribute('data-norem') ) { ======= for (i = 0; i < styles.length; i++) { // here we need to use getAttribute instead of hasAttribute to support IE < 8 if ( styles[i].rel.toLowerCase() === 'stylesheet' && styles[i].getAttribute('data-norem') === null ) { >>>>>>> for ( var i = 0; i < styles.length; i++) { if ( styles[i].rel.toLowerCase() === 'stylesheet' && styles[i].getAttribute('data-norem') === null ) { <<<<<<< if ( window.XMLHttpRequest ){ // If browser supports AJAX ======= try { // This targets modern browsers and modern versions of IE, // which don't need the "new" keyword. >>>>>>> try { // This targets modern browsers and modern versions of IE, // which don't need the "new" keyword. <<<<<<< } else { // Then we expect the browser should support AJAX through ActiveX (basically used to target IE6 and IE7) xhr.onreadystatechange = new function() { // IE6 and IE7 need the "new function()" syntax to work properly ======= } catch (e) { // This block targets old versions of IE, which require "new". xhr.onreadystatechange = new function() { //IE6 and IE7 need the "new function()" syntax to work properly >>>>>>> } catch (e) { // This block targets old versions of IE, which require "new". xhr.onreadystatechange = new function() { //IE6 and IE7 need the "new function()" syntax to work properly
<<<<<<< it('should support rtl resize', done => { timeout({ children: [ <Table.Column dataIndex='id' resizable width={200}></Table.Column>, <Table.Column dataIndex='name' width={200}></Table.Column> ], rtl: true, onResizeChange: (dataIndex, value) => { console.log(dataIndex, value) } }, () => { wrapper.find('.next-table-resize-handler').simulate('mousedown', {pageX: 0}); assert(document.body.style.cursor === 'ew-resize'); document.dispatchEvent(new Event('mousemove', {pageX: 0})); document.dispatchEvent(new Event('mouseup')); setTimeout(()=> { assert(document.body.style.cursor === ''); done(); }, 100) }) }); ======= it('should support dataSource [] => [{},{}] => []', () => { wrapper.setProps({ children: [<Table.Column dataIndex='id' lock width={200}></Table.Column>, <Table.Column dataIndex='id' lock='right' width={200}></Table.Column>] }) wrapper.debug(); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); assert(wrapper.find('div.next-table-empty').length === 0); wrapper.setProps({ dataSource: [] }); assert(wrapper.find('div.next-table-empty').length !== 0); wrapper.setProps({ dataSource: [{ id: '1', name: 'test' }, { id: '2', name: 'test2' }] }); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); assert(wrapper.find('div.next-table-empty').length === 0); }) it('should support lock scroll x', () => { wrapper.setProps({ children: [<Table.Column dataIndex='id' lock width={200}></Table.Column>, <Table.Column dataIndex='name' width={200}></Table.Column>, <Table.Column dataIndex='id' lock='right' width={200}></Table.Column>] }) wrapper.debug(); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); const body = wrapper.find('div.next-table-lock .next-table-body').at(1).props().onWheel({deltaY: 200, deltaX: 5}) }) >>>>>>> it('should support rtl resize', done => { timeout({ children: [ <Table.Column dataIndex='id' resizable width={200}></Table.Column>, <Table.Column dataIndex='name' width={200}></Table.Column> ], rtl: true, onResizeChange: (dataIndex, value) => { console.log(dataIndex, value) } }, () => { wrapper.find('.next-table-resize-handler').simulate('mousedown', {pageX: 0}); assert(document.body.style.cursor === 'ew-resize'); document.dispatchEvent(new Event('mousemove', {pageX: 0})); document.dispatchEvent(new Event('mouseup')); setTimeout(()=> { assert(document.body.style.cursor === ''); done(); }, 100) }) }); it('should support dataSource [] => [{},{}] => []', () => { wrapper.setProps({ children: [<Table.Column dataIndex='id' lock width={200}></Table.Column>, <Table.Column dataIndex='id' lock='right' width={200}></Table.Column>] }) wrapper.debug(); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); assert(wrapper.find('div.next-table-empty').length === 0); wrapper.setProps({ dataSource: [] }); assert(wrapper.find('div.next-table-empty').length !== 0); wrapper.setProps({ dataSource: [{ id: '1', name: 'test' }, { id: '2', name: 'test2' }] }); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); assert(wrapper.find('div.next-table-empty').length === 0); }) it('should support lock scroll x', () => { wrapper.setProps({ children: [<Table.Column dataIndex='id' lock width={200}></Table.Column>, <Table.Column dataIndex='name' width={200}></Table.Column>, <Table.Column dataIndex='id' lock='right' width={200}></Table.Column>] }) wrapper.debug(); assert(wrapper.find('div.next-table-lock-left').length === 1); assert(wrapper.find('div.next-table-lock-right').length === 1); const body = wrapper.find('div.next-table-lock .next-table-body').at(1).props().onWheel({deltaY: 200, deltaX: 5}) })
<<<<<<< }; export const normalizeToArray = items => { if (items) { if (Array.isArray(items)) { return items; } return [items]; } return []; }; export const isSibling = (currentPos, targetPos) => { const currentNums = currentPos.split('-').slice(0, -1); const targetNums = targetPos.split('-').slice(0, -1); return ( currentNums.length === targetNums.length && currentNums.every((num, index) => { return num === targetNums[index]; }) ); }; export const isAncestor = (currentPos, targetPos) => { const currentNums = currentPos.split('-'); const targetNums = targetPos.split('-'); return ( currentNums.length > targetNums.length && targetNums.every((num, index) => { return num === currentNums[index]; }) ); }; export const isAvailablePos = (refPos, targetPos, _p2n) => { const { type, disabled } = _p2n[targetPos]; return ( isSibling(refPos, targetPos) && ((type === 'item' && !disabled) || type === 'submenu') ); }; export const getFirstAvaliablelChildKey = (parentPos, _p2n) => { const pos = Object.keys(_p2n).find(p => isAvailablePos(`${parentPos}-0`, p, _p2n) ); return pos ? _p2n[pos].key : null; ======= }; /** * 如果 key 在 SelectedKeys 的选中链上(例如 SelectedKeys 是['0-1-2'], key是 0-1 ),那么返回true * * selectMode?: string; 当前的选择模式,一般为 multiple single * selectedKeys?: string[]; 选中的key值 * root?: any; * _key?: string; 待测试的key值 * * @return bool 当前元素是否有孩子被选中 */ export const getChildSelected = ({ selectMode, selectedKeys, root, _key }) => { const _keyPos = `${root.k2n[_key].pos}-`; return ( !!selectMode && selectedKeys.some( key => root.k2n[key] && root.k2n[key].pos.indexOf(_keyPos) === 0 ) ); >>>>>>> }; export const normalizeToArray = items => { if (items) { if (Array.isArray(items)) { return items; } return [items]; } return []; }; export const isSibling = (currentPos, targetPos) => { const currentNums = currentPos.split('-').slice(0, -1); const targetNums = targetPos.split('-').slice(0, -1); return ( currentNums.length === targetNums.length && currentNums.every((num, index) => { return num === targetNums[index]; }) ); }; export const isAncestor = (currentPos, targetPos) => { const currentNums = currentPos.split('-'); const targetNums = targetPos.split('-'); return ( currentNums.length > targetNums.length && targetNums.every((num, index) => { return num === currentNums[index]; }) ); }; export const isAvailablePos = (refPos, targetPos, _p2n) => { const { type, disabled } = _p2n[targetPos]; return ( isSibling(refPos, targetPos) && ((type === 'item' && !disabled) || type === 'submenu') ); }; export const getFirstAvaliablelChildKey = (parentPos, _p2n) => { const pos = Object.keys(_p2n).find(p => isAvailablePos(`${parentPos}-0`, p, _p2n) ); return pos ? _p2n[pos].key : null; }; /** * 如果 key 在 SelectedKeys 的选中链上(例如 SelectedKeys 是['0-1-2'], key是 0-1 ),那么返回true * * selectMode?: string; 当前的选择模式,一般为 multiple single * selectedKeys?: string[]; 选中的key值 * root?: any; * _key?: string; 待测试的key值 * * @return bool 当前元素是否有孩子被选中 */ export const getChildSelected = ({ selectMode, selectedKeys, root, _key }) => { const _keyPos = `${root.k2n[_key].pos}-`; return ( !!selectMode && selectedKeys.some( key => root.k2n[key] && root.k2n[key].pos.indexOf(_keyPos) === 0 ) );
<<<<<<< const paragraphNode = header.find(child => child.type === 'paragraph'); let desc = ''; if (paragraphNode && paragraphNode.children) { desc = paragraphNode.children.map(itemNode => { if (itemNode.type === 'inlineCode') { return `<code>${html2Escape(itemNode.value)}</code>`; } return itemNode.value; }).join(' '); } result.meta.desc = desc; } } if (bodyContent) { const bodyAST = remark.parse(bodyContent); if (bodyAST && bodyAST.children) { const body = bodyAST.children; const jsNode = body.find(child => child.type === 'code' && (child.lang === 'js' || child.lang === 'jsx')); if (jsNode) { result.js = jsNode.value; ======= const paragraphNode = header.find(child => child.type === 'paragraph'); let desc = ''; if (paragraphNode && paragraphNode.children) { desc = paragraphNode.children.map(itemNode => itemNode.value).join(' '); } result.meta.desc = desc; } >>>>>>> const paragraphNode = header.find(child => child.type === 'paragraph'); let desc = ''; if (paragraphNode && paragraphNode.children) { desc = paragraphNode.children.map(itemNode => { if (itemNode.type === 'inlineCode') { return `<code>${html2Escape(itemNode.value)}</code>`; } return itemNode.value; }).join(' '); } result.meta.desc = desc; } }
<<<<<<< 'intDivisionTruncate.sol', 'stringBytesLength.sol' ======= 'intDivisionTruncate.sol', 'ERC20.sol' >>>>>>> 'intDivisionTruncate.sol', 'ERC20.sol', 'stringBytesLength.sol' <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 1, 'stringBytesLength.sol': 1 ======= 'intDivisionTruncate.sol': 1, 'ERC20.sol': 2 >>>>>>> 'intDivisionTruncate.sol': 1, 'ERC20.sol': 2, 'stringBytesLength.sol': 1 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 5, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 5, 'ERC20.sol': 0 >>>>>>> 'ERC20.sol': 0, 'intDivisionTruncate.sol': 5, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 1, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 1, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 1, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< 'intDivisionTruncate.sol': 2, 'stringBytesLength.sol': 0 ======= 'intDivisionTruncate.sol': 2, 'ERC20.sol': 0 >>>>>>> 'intDivisionTruncate.sol': 2, 'ERC20.sol': 0, 'stringBytesLength.sol': 0 <<<<<<< test('Integration test stringBytesLength.js', function (t) { t.plan(testFiles.length) var module = require('../../src/solidity-analyzer/modules/stringBytesLength') var lengthCheck = { 'KingOfTheEtherThrone.sol': 0, 'assembly.sol': 0, 'ballot.sol': 0, 'ballot_reentrant.sol': 0, 'ballot_withoutWarnings.sol': 0, 'cross_contract.sol': 0, 'inheritance.sol': 0, 'modifier1.sol': 0, 'modifier2.sol': 0, 'notReentrant.sol': 0, 'structReentrant.sol': 0, 'thisLocal.sol': 0, 'globals.sol': 0, 'library.sol': 0, 'transfer.sol': 0, 'ctor.sol': 0, 'forgottenReturn.sol': 0, 'selfdestruct.sol': 0, 'deleteDynamicArray.sol': 0, 'blockLevelCompare.sol': 0, 'intDivisionTruncate.sol': 0, 'stringBytesLength.sol': 1 } runModuleOnFiles(module, t, (file, report) => { t.equal(report.length, lengthCheck[file], `${file} has right amount of stringBytesLength warnings`) }) }) ======= test('Integration test erc20Decimal.js', function (t) { t.plan(testFiles.length) var module = require('../../src/solidity-analyzer/modules/erc20Decimals') var lengthCheck = { 'KingOfTheEtherThrone.sol': 0, 'assembly.sol': 0, 'ballot.sol': 0, 'ballot_reentrant.sol': 0, 'ballot_withoutWarnings.sol': 0, 'cross_contract.sol': 0, 'inheritance.sol': 0, 'modifier1.sol': 0, 'modifier2.sol': 0, 'notReentrant.sol': 0, 'structReentrant.sol': 0, 'thisLocal.sol': 0, 'globals.sol': 0, 'library.sol': 0, 'transfer.sol': 0, 'ctor.sol': 0, 'forgottenReturn.sol': 0, 'selfdestruct.sol': 0, 'deleteDynamicArray.sol': 0, 'blockLevelCompare.sol': 0, 'intDivisionTruncate.sol': 0, 'ERC20.sol': 1 } runModuleOnFiles(module, t, (file, report) => { t.equal(report.length, lengthCheck[file], `${file} has right amount of erc20Decimals warnings`) }) }) >>>>>>> test('Integration test erc20Decimal.js', function (t) { t.plan(testFiles.length) var module = require('../../src/solidity-analyzer/modules/erc20Decimals') var lengthCheck = { 'KingOfTheEtherThrone.sol': 0, 'assembly.sol': 0, 'ballot.sol': 0, 'ballot_reentrant.sol': 0, 'ballot_withoutWarnings.sol': 0, 'cross_contract.sol': 0, 'inheritance.sol': 0, 'modifier1.sol': 0, 'modifier2.sol': 0, 'notReentrant.sol': 0, 'structReentrant.sol': 0, 'thisLocal.sol': 0, 'globals.sol': 0, 'library.sol': 0, 'transfer.sol': 0, 'ctor.sol': 0, 'forgottenReturn.sol': 0, 'selfdestruct.sol': 0, 'deleteDynamicArray.sol': 0, 'blockLevelCompare.sol': 0, 'intDivisionTruncate.sol': 0, 'ERC20.sol': 1, 'stringBytesLength.sol': 0 } runModuleOnFiles(module, t, (file, report) => { t.equal(report.length, lengthCheck[file], `${file} has right amount of erc20Decimals warnings`) }) }) test('Integration test stringBytesLength.js', function (t) { t.plan(testFiles.length) var module = require('../../src/solidity-analyzer/modules/stringBytesLength') var lengthCheck = { 'KingOfTheEtherThrone.sol': 0, 'assembly.sol': 0, 'ballot.sol': 0, 'ballot_reentrant.sol': 0, 'ballot_withoutWarnings.sol': 0, 'cross_contract.sol': 0, 'inheritance.sol': 0, 'modifier1.sol': 0, 'modifier2.sol': 0, 'notReentrant.sol': 0, 'structReentrant.sol': 0, 'thisLocal.sol': 0, 'globals.sol': 0, 'library.sol': 0, 'transfer.sol': 0, 'ctor.sol': 0, 'forgottenReturn.sol': 0, 'selfdestruct.sol': 0, 'deleteDynamicArray.sol': 0, 'blockLevelCompare.sol': 0, 'intDivisionTruncate.sol': 0, 'ERC20.sol': 0, 'stringBytesLength.sol': 1 } runModuleOnFiles(module, t, (file, report) => { t.equal(report.length, lengthCheck[file], `${file} has right amount of stringBytesLength warnings`) }) })
<<<<<<< this.mainAxis = new THREE.Object3D(); this.cameraDummy = new THREE.Object3D(); ======= this.localPhi = 0; this.localTheta = 0; >>>>>>> this.mainAxis = new THREE.Object3D(); this.cameraDummy = new THREE.Object3D(); this.localPhi = 0; this.localTheta = 0; <<<<<<< ======= >>>>>>> <<<<<<< state = scope.keyCtrl ? STATE.ROTATE : STATE.MOVE_GLOBE; ======= if(scope.keyCtrl) { state = STATE.ROTATE; }else if(scope.keyShift) { state = STATE.ROTATEONITSELF; } else{ computeTarget(scope.engine.picking()); scope.engine.renderScene(); // TODO debug to remove white screen, but why? state = STATE.MOVE_GLOBE; } >>>>>>> if(scope.keyCtrl) { state = STATE.ROTATE; }else if(scope.keyShift) { state = STATE.ROTATEONITSELF; } else{ computeTarget(scope.engine.picking()); scope.engine.renderScene(); // TODO debug to remove white screen, but why? state = STATE.MOVE_GLOBE; } <<<<<<< } function computeTarget(position) { scope.mainAxis.lookAt(position); //scope.mainAxis.updateMatrixWorld(); ======= /* position = scope.globeTarget.worldToLocal(scope.object.position.clone()); angle = Math.atan2(position.z,position.y); scope.globeTarget.quaternion.multiply(new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), angle - Math.PI * 0.5)); */ //TODO revient à prendre le repère caméra.... à tester >>>>>>> } function computeTarget(position) { scope.mainAxis.lookAt(position); //scope.mainAxis.updateMatrixWorld(); <<<<<<< this.mainAxis.lookAt(target); this.mainAxis.add(this.globeTarget); ======= // var axisHelper = new THREE.AxisHelper( 500000 ); // this.globeTarget.add( axisHelper ); >>>>>>> this.mainAxis.lookAt(target); this.mainAxis.add(this.globeTarget);
<<<<<<< if(this.controls.click) { var position = this.picking(this.controls.pointClick); this.updateDummy(position,this.dummy); this.controls.setPointGlobe(position); //console.log(position); var p = position.clone(); p.x = -position.x; p.y = position.z; p.z = position.y; var R = p.length(); var a = 6378137; var b = 6356752.314245179497563967; var e = Math.sqrt((a*a - b*b)/(a*a)); var f = 1 - Math.sqrt(1 - e*e); var rsqXY = Math.sqrt(p.x*p.x + p.y*p.y); var theta = Math.atan2(p.y,p.x); var nu = Math.atan(p.z/rsqXY*((1-f)+ e*e*a/R)); var sinu = Math.sin(nu); var cosu = Math.cos(nu); var phi = Math.atan((p.z*(1-f) + e*e*a*sinu*sinu*sinu)/((1-f)*(rsqXY - e*e*a*cosu*cosu*cosu))); var h = (rsqXY*Math.cos(phi)) + p.z*Math.sin(phi) - a * Math.sqrt(1-e*e*Math.sin(phi)*Math.sin(phi)); console.log(theta + ' ' + phi + ' ' + h ); this.controls.click = false; } else ======= if(this.controls instanceof THREE.GlobeControls) >>>>>>> if(this.controls instanceof THREE.GlobeControls) if(this.controls.click) { var position = this.picking(this.controls.pointClick); this.updateDummy(position,this.dummy); this.controls.setPointGlobe(position); //console.log(position); var p = position.clone(); p.x = -position.x; p.y = position.z; p.z = position.y; var R = p.length(); var a = 6378137; var b = 6356752.314245179497563967; var e = Math.sqrt((a*a - b*b)/(a*a)); var f = 1 - Math.sqrt(1 - e*e); var rsqXY = Math.sqrt(p.x*p.x + p.y*p.y); var theta = Math.atan2(p.y,p.x); var nu = Math.atan(p.z/rsqXY*((1-f)+ e*e*a/R)); var sinu = Math.sin(nu); var cosu = Math.cos(nu); var phi = Math.atan((p.z*(1-f) + e*e*a*sinu*sinu*sinu)/((1-f)*(rsqXY - e*e*a*cosu*cosu*cosu))); var h = (rsqXY*Math.cos(phi)) + p.z*Math.sin(phi) - a * Math.sqrt(1-e*e*Math.sin(phi)*Math.sin(phi)); console.log(theta + ' ' + phi + ' ' + h ); this.controls.click = false; } else
<<<<<<< function c3DEngine(scene, positionCamera, viewerDiv, debugMode, gLDebug) { ======= /* var step = function(val,stepVal) { if(val<stepVal) return 0.0; else return 1.0; }; var exp2 = function(expo) { return Math.pow(2,expo); }; function parseFloat2(str) { var float = 0, sign, order, mantiss,exp, int = 0, multi = 1; if (/^0x/.exec(str)) { int = parseInt(str,16); }else{ for (var i = str.length -1; i >=0; i -= 1) { if (str.charCodeAt(i)>255) { console.log('Wrong string parametr'); return false; } int += str.charCodeAt(i) * multi; multi *= 256; } } sign = (int>>>31)?-1:1; exp = (int >>> 23 & 0xff) - 127; mantissa = ((int & 0x7fffff) + 0x800000).toString(2); for (i=0; i<mantissa.length; i+=1){ float += parseInt(mantissa[i])? Math.pow(2,exp):0; exp--; } return float*sign; } var decode32 = function(rgba) { var Sign = 1.0 - step(128.0,rgba[0])*2.0; var Exponent = 2.0 * (rgba[0]%128.0) + step(128.0,rgba[1]) - 127.0; var Mantissa = (rgba[1]%128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + parseFloat2(0x800000); var Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); return Result; }; var bf = new Float32Array([1256.211]); var bui = new Uint8Array(bf.buffer); var v = new THREE.Vector4().fromArray(bui); v.set(v.w,v.z,v.y,v.x); console.log(decode32(v.toArray()),parseFloat2(0x800000)); */ function c3DEngine(scene, positionCamera, debugMode, gLDebug) { >>>>>>> /* var step = function(val,stepVal) { if(val<stepVal) return 0.0; else return 1.0; }; var exp2 = function(expo) { return Math.pow(2,expo); }; function parseFloat2(str) { var float = 0, sign, order, mantiss,exp, int = 0, multi = 1; if (/^0x/.exec(str)) { int = parseInt(str,16); }else{ for (var i = str.length -1; i >=0; i -= 1) { if (str.charCodeAt(i)>255) { console.log('Wrong string parametr'); return false; } int += str.charCodeAt(i) * multi; multi *= 256; } } sign = (int>>>31)?-1:1; exp = (int >>> 23 & 0xff) - 127; mantissa = ((int & 0x7fffff) + 0x800000).toString(2); for (i=0; i<mantissa.length; i+=1){ float += parseInt(mantissa[i])? Math.pow(2,exp):0; exp--; } return float*sign; } var decode32 = function(rgba) { var Sign = 1.0 - step(128.0,rgba[0])*2.0; var Exponent = 2.0 * (rgba[0]%128.0) + step(128.0,rgba[1]) - 127.0; var Mantissa = (rgba[1]%128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + parseFloat2(0x800000); var Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); return Result; }; var bf = new Float32Array([1256.211]); var bui = new Uint8Array(bf.buffer); var v = new THREE.Vector4().fromArray(bui); v.set(v.w,v.z,v.y,v.x); console.log(decode32(v.toArray()),parseFloat2(0x800000)); */ function c3DEngine(scene, positionCamera, viewerDiv, debugMode, gLDebug) { <<<<<<< this.viewerDiv = viewerDiv; this.debug = debugMode; ======= this.debug = debugMode; >>>>>>> this.viewerDiv = viewerDiv; this.debug = debugMode; <<<<<<< this.width = this.debug ? this.viewerDiv.clientWidth * 0.5 : this.viewerDiv.clientWidth; this.height = this.viewerDiv.clientHeight; this.camera.resize(this.width, this.height); ======= this.width = this.debug ? window.innerWidth * 0.5 : window.innerWidth; this.height = window.innerHeight; this.camera.resize(this.width, this.height); >>>>>>> this.width = this.debug ? this.viewerDiv.clientWidth * 0.5 : this.viewerDiv.clientWidth; this.height = this.viewerDiv.clientHeight; this.camera.resize(this.width, this.height); <<<<<<< // // Create canvas // var canvas = document.createElement( 'canvas' ); canvas.id = 'canvasWebGL'; ======= >>>>>>> // // Create canvas // var canvas = document.createElement( 'canvas' ); canvas.id = 'canvasWebGL'; <<<<<<< // ======= // >>>>>>> // <<<<<<< //this.viewerDiv.appendChild(canvas); viewerDiv.appendChild(this.renderer.domElement); ======= document.body.appendChild(this.renderer.domElement); >>>>>>> //this.viewerDiv.appendChild(canvas); viewerDiv.appendChild(this.renderer.domElement); <<<<<<< var pixelBuffer = new Float32Array(width * height * 4); ======= //var pixelBuffer = new Float32Array(width * height * 4); var pixelBuffer = new Uint8Array( 4 ); >>>>>>> //var pixelBuffer = new Float32Array(width * height * 4); var pixelBuffer = new Uint8Array( 4 ); <<<<<<< var worldPosition = glslPosition.applyMatrix4(this.camera.camera3D.matrixWorld); ======= var worldPosition = glslPosition.applyMatrix4(camera.matrixWorld); >>>>>>> var worldPosition = glslPosition.applyMatrix4(camera.matrixWorld); <<<<<<< return undefined; ======= return undefined; >>>>>>> return undefined;
<<<<<<< var layer = map.colorTerrain.children[i]; //var provider = this.manager.getProvider(layer); var tileMT = this.providerColorTexture.layersWMTS[colorServices[i]].tileMatrixSet; ======= var layer = this.providerColorTexture.layersWMTS[colorServices[i]]; var tileMT = layer.tileMatrixSet; >>>>>>> var layer = this.providerColorTexture.layersWMTS[colorServices[i]]; var tileMT = layer.tileMatrixSet; //var provider = this.manager.getProvider(layer);
<<<<<<< Globe.prototype.setLayerVisibility = function(id,visible){ ======= Globe.prototype.addColorLayer = function(layerId){ this.colorTerrain.services.push(layerId); var subLayer = new Layer(); subLayer.services.push(layerId); var idLayerTile = this.colorTerrain.children.length; subLayer.description = {style:{layerTile:idLayerTile}}; this.colorTerrain.add(subLayer); }; Globe.prototype.moveLayerUp = function(id){ var colorLayer = this.getLayerColor(id); var index = this.colorTerrain.children.indexOf(colorLayer); if(index < this.colorTerrain.children.length-1) this.moveLayerToIndex(id,index+1) }; Globe.prototype.moveLayerDown = function(id){ var colorLayer = this.getLayerColor(id); var index = this.colorTerrain.children.indexOf(colorLayer); if(index > 0) this.moveLayerToIndex(id,index-1) }; Globe.prototype.moveLayerToIndex = function(layer,newId){ var index = this.colorTerrain.children.indexOf(this.getLayerColor(layer)); this.colorTerrain.children.splice(newId,0,this.colorTerrain.children.splice(index,1)[0]); this.colorTerrain.services.splice(newId,0,this.colorTerrain.services.splice(index,1)[0]); var cO = function(object){ if(object.changeSequenceLayers) object.changeSequenceLayers(this.colorTerrain.services); }.bind(this); this.tiles.children[0].traverse(cO); }; Globe.prototype.removeColorLayer = function(id){ var colorLayer = this.getLayerColor(id); if(colorLayer) { var cO = function(object){ if(object.removeLayerColor) object.removeLayerColor(id); }; this.tiles.children[0].traverse(cO); var services = this.colorTerrain.services; var idService = services.indexOf(id); if(idService>-1) services.splice(idService,1); return true; } return false; }; Globe.prototype.setLayerVibility = function(id,visible){ >>>>>>> Globe.prototype.addColorLayer = function(layerId){ this.colorTerrain.services.push(layerId); var subLayer = new Layer(); subLayer.services.push(layerId); var idLayerTile = this.colorTerrain.children.length; subLayer.description = {style:{layerTile:idLayerTile}}; this.colorTerrain.add(subLayer); }; Globe.prototype.moveLayerUp = function(id){ var colorLayer = this.getLayerColor(id); var index = this.colorTerrain.children.indexOf(colorLayer); if(index < this.colorTerrain.children.length-1) this.moveLayerToIndex(id,index+1) }; Globe.prototype.moveLayerDown = function(id){ var colorLayer = this.getLayerColor(id); var index = this.colorTerrain.children.indexOf(colorLayer); if(index > 0) this.moveLayerToIndex(id,index-1) }; Globe.prototype.moveLayerToIndex = function(layer,newId){ var index = this.colorTerrain.children.indexOf(this.getLayerColor(layer)); this.colorTerrain.children.splice(newId,0,this.colorTerrain.children.splice(index,1)[0]); this.colorTerrain.services.splice(newId,0,this.colorTerrain.services.splice(index,1)[0]); var cO = function(object){ if(object.changeSequenceLayers) object.changeSequenceLayers(this.colorTerrain.services); }.bind(this); this.tiles.children[0].traverse(cO); }; Globe.prototype.removeColorLayer = function(id){ var colorLayer = this.getLayerColor(id); if(colorLayer) { var cO = function(object){ if(object.removeLayerColor) object.removeLayerColor(id); }; this.tiles.children[0].traverse(cO); var services = this.colorTerrain.services; var idService = services.indexOf(id); if(idService>-1) services.splice(idService,1); return true; } return false; }; Globe.prototype.setLayerVisibility = function(id,visible){ <<<<<<< if(object.material.setLayerVisibility) object.material.setLayerVisibility(idLtile,visible); ======= if(object.material.setLayerVibility) object.material.setLayerVibility(object.getIndexLayerColor(id),visible); >>>>>>> if(object.material.setLayerVibility) object.material.setLayerVibility(object.getIndexLayerColor(id),visible);
<<<<<<< var exen = 6356752.3142451793/6378137; ======= this.ellipsoid = new Ellipsoid(this.size); >>>>>>> this.ellipsoid = new Ellipsoid(this.size); var exen = 6356752.3142451793/6378137; <<<<<<< var position = this.ellipsoid().cartographicToCartesian(new CoordCarto().setFromDegreeGeo(48.87, 0, 200)); position = new THREE.Vector3(4201215.424138484,171429.945145441,4779294.873914789); // http://www.apsalin.com/convert-geodetic-to-cartesian.aspx // 48.846931,2.337219,50 position = new THREE.Vector3(4201801.65418896,171495.727885073,4779411.45896233); ======= var position = this.ellipsoid.cartographicToCartesian(new CoordCarto().setFromDegreeGeo(48.87, 0, 200)); >>>>>>> var position = this.ellipsoid.cartographicToCartesian(new CoordCarto().setFromDegreeGeo(48.87, 0, 200)); position = new THREE.Vector3(4201215.424138484,171429.945145441,4779294.873914789); // http://www.apsalin.com/convert-geodetic-to-cartesian.aspx // 48.846931,2.337219,50 position = new THREE.Vector3(4201801.65418896,171495.727885073,4779411.45896233); var position = this.ellipsoid.cartographicToCartesian(new CoordCarto().setFromDegreeGeo(48.87, 0, 200));
<<<<<<< //默认过滤规则相关配置项目 //,disabledTableInTable:true //禁止表格嵌套 //,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 ======= >>>>>>> //默认过滤规则相关配置项目 //,disabledTableInTable:true //禁止表格嵌套 //,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式
<<<<<<< // Debugging helper to inspect JSON response body content recieved from server inspectJSON: function() { this.after(function(err, res, body) { console.log(util.inspect(JSON.parse(body))); }); return this; }, ======= // Debugging helper to inspect HTTP response code recieved from server inspectStatus: function() { this.after(function(err, res, body) { console.log(res.statusCode); }); return this; }, >>>>>>> // Debugging helper to inspect JSON response body content recieved from server inspectJSON: function() { this.after(function(err, res, body) { console.log(util.inspect(JSON.parse(body))); }); return this; }, // Debugging helper to inspect HTTP response code recieved from server inspectStatus: function() { this.after(function(err, res, body) { console.log(res.statusCode); }); return this; }, <<<<<<< exports.version = '0.1.6'; ======= exports.version = '0.1.5'; >>>>>>> exports.version = '0.1.6';
<<<<<<< // DEV: Process may be different for useState components ======= // BUG FIX: Don't print the Router as a component // Change how the children are printed >>>>>>> // DEV: Process may be different for useState components // BUG FIX: Don't print the Router as a component // Change how the children are printed
<<<<<<< customChildren: existingChildren.concat(React.createElement('footer', { className: 'footer_footer' }, ======= customInnerChildren: React.createElement('footer', { className: 'footer_footer' }, >>>>>>> customInnerChildren: existingChildren.concat(React.createElement('footer', { className: 'footer_footer' },
<<<<<<< var url = "https://plus.google.com/hangouts/_?gid=rofl&gd=sessionId:" + session.id; ======= var url = "https://plus.google.com/hangouts/_?gid=fun&gd=sessionId:" + session.id; var clock = sinon.useFakeTimers(); >>>>>>> var url = "https://plus.google.com/hangouts/_?gid=rofl&gd=sessionId:" + session.id; var clock = sinon.useFakeTimers();
<<<<<<< exports.server.init({ "transport":"file", "level":"debug", "GOOGLE_CLIENT_ID":true, "GOOGLE_CLIENT_SECRET":true, "REDIS_DB":1, "timeoutHttp":true, "mockAuth": true ======= exports.server.init({"GOOGLE_CLIENT_ID":true, "GOOGLE_CLIENT_SECRET":true, "REDIS_DB":1, "timeoutHttp":true}); }); } exports.mockSetup = function(admin, callback) { return function(done) { exports.server = new unhangoutServer.UnhangoutServer(); exports.server.on("inited", function() {exports.server.start()}); exports.server.on("started", function() { if(callback) { callback(done); } else { done(); } >>>>>>> exports.server.init({ "GOOGLE_CLIENT_ID":true, "GOOGLE_CLIENT_SECRET":true, "REDIS_DB":1, "timeoutHttp":true, "mockAuth": true <<<<<<< }); ======= if(_.isUndefined(admin)) { admin = false; } seed.run(1, redis, function() { exports.server.init({"GOOGLE_CLIENT_ID":true, "GOOGLE_CLIENT_SECRET":true, "REDIS_DB":1, "mock-auth":true, "mock-auth-admin":admin, "timeoutHttp":true}); }); } >>>>>>> });
<<<<<<< permalinkSessions: null, unauthenticatedSockets: null, ======= users: null, // backbone collection of known users (loaded on startup) events: null, // backbone collection of known events (loaded on startup) >>>>>>> permalinkSessions: null, users: null, // backbone collection of known users (loaded on startup) events: null, // backbone collection of known events (loaded on startup) <<<<<<< var oldUser = this.users.get(newUser.id); if(!_.isUndefined(oldUser)) { logger.warn("Found an existing user with id " + newUser.id + " in our user list. It will be replaced. Old user attributes: " + JSON.stringify(oldUser.attributes)); } // we're not really going to do anything special here, except note it in the logs. ======= // a google plus profile can have more than one email. check // all of them to see if any of them are an admin email. // if any of them are, mark this user as an admin. >>>>>>> var oldUser = this.users.get(newUser.id); if(!_.isUndefined(oldUser)) { logger.warn("Found an existing user with id " + newUser.id + " in our user list. It will be replaced. Old user attributes: " + JSON.stringify(oldUser.attributes)); } // we're not really going to do anything special here, except note it in the logs. // a google plus profile can have more than one email. check // all of them to see if any of them are an admin email. // if any of them are, mark this user as an admin. <<<<<<< // removed the ensureAuthenticated call here, so for permalink hangouts // we don't have to bounce them off google auth just to click the join // link. this.express.get("/session/:id", _.bind(function(req, res) { var session = getSession(req.params.id, this.events, this.permalinkSessions); ======= // this endpoint connects someone to the hangout for a particular session. // the :id in this case is not an actual session id, instead we use // session-keys for this. (getSession checks for both) // we do this for authentication reasons, so someone can't arbitrarily // join a session hangout that isn't started yet or that they're // not supposed to have access to. It's a little thing - anyone // with access can send the link to anyone else - but it's better // than nothing. this.express.get("/session/:id", ensureAuthenticated, _.bind(function(req, res) { var session = getSession(req.params.id, this.events); >>>>>>> // this endpoint connects someone to the hangout for a particular session. // the :id in this case is not an actual session id, instead we use // session-keys for this. (getSession checks for both) // we do this for authentication reasons, so someone can't arbitrarily // join a session hangout that isn't started yet or that they're // not supposed to have access to. It's a little thing - anyone // with access can send the link to anyone else - but it's better // than nothing. this.express.get("/session/:id", ensureAuthenticated, _.bind(function(req, res) { var session = getSession(req.params.id, this.events, this.permalinkSessions); <<<<<<< this.express.post("/h/admin/:code", _.bind(function(req, res) { logger.info("request for /h/:code" + JSON.stringify(req.body)); if(!("creationKey" in req.body)) { res.status(400); res.send(); return; } // otherwise, if creationKey is present, check it against the specified session. var session = this.permalinkSessions.find(function(s) { return s.get("shortCode")==req.params.code; }); if(_.isUndefined(session)) { logger.warn("sess:unknown (set title/desc)" + JSON.stringify(req.body)); res.status(404); res.send(); return; } if(req.body.creationKey===session.get("creationKey")) { session.set("title", req.body.title); session.set("description", req.body.description); session.save(); logger.debug("updating session with params: " + JSON.stringify(req.body)); res.redirect("/h/" + req.params.code); } else { logger.warn("POST to /h/admin/:code with invaid creationKey."); res.status(403); res.send(); return; } }, this)); ======= // all messages from the hangout app running in each of the active hangouts // go to this endpoint. // TODO verify that this is using session keys, not sessionids (otherwise it would // be super easy to spoof) // TODO think about whether we want more security here. the right thing // to do would be to require some sort of handshake on election so the keys // for posting hangout messages aren't the same as the ones public to all >>>>>>> this.express.post("/h/admin/:code", _.bind(function(req, res) { logger.info("request for /h/:code" + JSON.stringify(req.body)); if(!("creationKey" in req.body)) { res.status(400); res.send(); return; } // otherwise, if creationKey is present, check it against the specified session. var session = this.permalinkSessions.find(function(s) { return s.get("shortCode")==req.params.code; }); if(_.isUndefined(session)) { logger.warn("sess:unknown (set title/desc)" + JSON.stringify(req.body)); res.status(404); res.send(); return; } if(req.body.creationKey===session.get("creationKey")) { session.set("title", req.body.title); session.set("description", req.body.description); session.save(); logger.debug("updating session with params: " + JSON.stringify(req.body)); res.redirect("/h/" + req.params.code); } else { logger.warn("POST to /h/admin/:code with invaid creationKey."); res.status(403); res.send(); return; } }, this)); // all messages from the hangout app running in each of the active hangouts // go to this endpoint. // TODO verify that this is using session keys, not sessionids (otherwise it would // be super easy to spoof) // TODO think about whether we want more security here. the right thing // to do would be to require some sort of handshake on election so the keys // for posting hangout messages aren't the same as the ones public to all
<<<<<<< const mongoose = require('mongoose'); const Test = require('./TestModel.js'); Test.create({ item: 'test1', number: 1, createdAt: {type: Date, default: Date.now} }, (err, test) => { if(err) console.log('CREATE ERR', err) else console.log('CREATE', test) }); // Test.find({}, (err, test) => { // if(err) console.log('FIND ERR', err) // else console.log('FIND', test) // }) // Test.findOneAndRemove({item: 'test1'}, (err, test) => { // if(err) console.log('FOAR ERR', err) // else console.log('FOAR', test) // }) ======= const Test = require('./TestModel.js'); const async_perf_hooks = require('../async_perf_hooks.js'); const mongoose = require('mongoose'); // const mongoURI = 'mongodb://alektest:[email protected]:49798/iteration_deep'; // mongoose.connect(mongoURI) // mongoose.connect('mongodb://localhost/mongodb-orm'); // let test2 = Test.new({ // item: 'Test2', // number: 2 // }) // test2.save((err) => { // if(err) console.log(err) // console.log('saved') // }) process._rawDebug(Date.now()) Test.create({ item: 'Test2', number: 2, }) // Test.create({ // item: 'Test4', // number: 4, // }) // Test.create({ // item: 'Test3', // number: 3, // }) // Test.create({ // item: 'Test1', // number: 1, // }) // Test.find({}, (err, test) => { // if(err) { // console.log('err', err) // } else { // console.log(test) // } // }) // Test.findOneAndRemove({number: 2}, (err, test) => { // if(err) console.log('no way jose ', err) // else console.log(test) // }) // Test.findOneAndUpdate({number: 1}, {number: 6}, (err, test) => { // if(err) console.log('no can do ', err) // else console.log(test) // }) >>>>>>> const Test = require('./TestModel.js'); const async_perf_hooks = require('../async_perf_hooks.js'); const mongoose = require('mongoose'); Test.create({ item: 'Test2', number: 2, }) // Test.create({ // item: 'Test4', // number: 4, // }) // Test.create({ // item: 'Test3', // number: 3, // }) // Test.create({ // item: 'Test1', // number: 1, // }) // Test.find({}, (err, test) => { // if(err) { // console.log('err', err) // } else { // console.log(test) // } // }) // Test.findOneAndRemove({number: 2}, (err, test) => { // if(err) console.log('no way jose ', err) // else console.log(test) // }) // Test.findOneAndUpdate({number: 1}, {number: 6}, (err, test) => { // if(err) console.log('no can do ', err) // else console.log(test) // })
<<<<<<< let timer; ======= >>>>>>> let timer; <<<<<<< clearTimeout(timer); ======= scaleDuration(); >>>>>>> clearTimeout(timer); scaleDuration(); <<<<<<< var funcData = d3.select("#nodes") .selectAll(".node") funcData.filter((d) => { return d.isNew === true }).select("rect") .call(pulse, 750) funcData.filter((d) => { return !d.isNew }).select("rect") .transition() .duration(500) .style("stroke-opacity", 1) // funcData.on("mouseenter", (d) => { // if(d.isNew){ // newEventArray.forEach((event) => { // funcData.filter((d) => { // return d.id === event.target.id // }).select("rect").style("opacity", .25) // }) // } // }) // funcData.on("mouseleave", () => { // newEventArray.forEach((event) => { // funcData.filter((d) => { // return d.id === event.target.id // }).select("rect").style("opacity", 1) // }) // }) } function pulse(path, duration, end){ path.transition() .duration(duration) .style('stroke-opacity', .2) .transition() .style('stroke-opacity', 1) timer = setTimeout(function() { pulse(path, duration); }, duration*2); } }); ======= >>>>>>> var funcData = d3.select("#nodes") .selectAll(".node") funcData.filter((d) => { return d.isNew === true }).select("rect") .call(pulse, 750) funcData.filter((d) => { return !d.isNew }).select("rect") .transition() .duration(500) .style("stroke-opacity", 1) // funcData.on("mouseenter", (d) => { // if(d.isNew){ // newEventArray.forEach((event) => { // funcData.filter((d) => { // return d.id === event.target.id // }).select("rect").style("opacity", .25) // }) // } // }) // funcData.on("mouseleave", () => { // newEventArray.forEach((event) => { // funcData.filter((d) => { // return d.id === event.target.id // }).select("rect").style("opacity", 1) // }) // }) } function pulse(path, duration, end){ path.transition() .duration(duration) .style('stroke-opacity', .2) .transition() .style('stroke-opacity', 1) timer = setTimeout(function() { pulse(path, duration); }, duration*2); } }); <<<<<<< if(!hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`]){ nodeObj.isNew = true hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`] = true newEventArray.push(nodeObj) } else { nodeObj.isNew = false } if (!nodeObj.duration) nodeObj.duration = MIN_DURATION; ======= >>>>>>> if(!hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`]){ nodeObj.isNew = true hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`] = true newEventArray.push(nodeObj) } else { nodeObj.isNew = false } if (!nodeObj.duration) nodeObj.duration = MIN_DURATION; <<<<<<< if (!linkObj.value) linkObj.value = MIN_DURATION; // if(!hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`]){ // newEventArray.push(linkObj) // hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`] = true; // // console.log('after', hasSeen) // } ======= if(!hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`]){ newEventArray.push(linkObj) hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`] = true; } >>>>>>> // if(!hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`]){ // newEventArray.push(linkObj) // hasSeen[`${funcInfoNode.type}${funcInfoNode.asyncId}`] = true; // }
<<<<<<< const skill = await session.skill(); const absences = await session.absences(); ======= const evaluations = await session.evaluations(); >>>>>>> const evaluations = await session.evaluations(); const absences = await session.absences(); <<<<<<< console.log("Timetable : "+timetable); console.log("Marks : "+marks); console.log("Skill : "+skill); console.log("Absences : "+absences); ======= console.log('Done'); >>>>>>> console.log('Done');
<<<<<<< const absence = require('./absence'); ======= const homeworks = require('./homeworks'); >>>>>>> const absence = require('./absence'); const homeworks = require('./homeworks'); <<<<<<< session.absences = (...args) => absence(session, ...args); ======= session.homeworks = (...args) => homeworks(session, ...args); >>>>>>> session.absences = (...args) => absence(session, ...args); session.homeworks = (...args) => homeworks(session, ...args);
<<<<<<< const getMenu = require('./src/fetch/menu'); ======= const getAbsence = require('./src/fetch/absence'); >>>>>>> const getMenu = require('./src/fetch/menu'); const getAbsence = require('./src/fetch/absence'); <<<<<<< fetchMenu: getMenu, ======= fetchAbsence: getAbsence, >>>>>>> fetchMenu: getMenu, fetchAbsence: getAbsence,
<<<<<<< import Combatants from 'Parser/Core/Modules/Combatants'; import Module from 'Parser/Core/Module'; import ExpandableStatisticBox from 'Main/ExpandableStatisticBox'; import { STATISTIC_ORDER } from 'Main/StatisticBox'; import { formatPercentage, formatNumber } from 'common/format'; ======= import Analyzer from 'Parser/Core/Analyzer'; >>>>>>> import Combatants from 'Parser/Core/Modules/Combatants'; import ExpandableStatisticBox from 'Main/ExpandableStatisticBox'; import { STATISTIC_ORDER } from 'Main/StatisticBox'; import { formatPercentage, formatNumber } from 'common/format'; import Analyzer from 'Parser/Core/Analyzer';
<<<<<<< ======= "developer": "MIUI-PT", "free": true, "icon": "http://romshare.deployfu.com/downloads/575/c19be5475e866406d78eff7f3486305c.png", "id": "miuiportugal", "manifest": "http://www.files.miui-pt.com/manifest/miuipt.js", "summary": "Smoothest, Fastest, Gorgeous, all the best stuff in one rom. Try and let us know your feedback." }, { >>>>>>> "developer": "CyanogenMod Nightlies", "free": true, "icon": "http://romshare.deployfu.com/downloads/541/4158e7edc75c600607f05a3b063ffba1.png", "id": "[email protected]", "manifest": "http://defy.tanguy.tk/rm/custom.js", "summary": "CyanogenMod Nightly builds. tpruvot@github" }, { "developer": "MIUI-PT", "free": true, "icon": "http://romshare.deployfu.com/downloads/575/c19be5475e866406d78eff7f3486305c.png", "id": "miuiportugal", "manifest": "http://www.files.miui-pt.com/manifest/miuipt.js", "summary": "Smoothest, Fastest, Gorgeous, all the best stuff in one rom. Try and let us know your feedback." }, { <<<<<<< }, { "developer": "CyanogenMod Nightlies", "free": true, "icon": "http://romshare.deployfu.com/downloads/541/4158e7edc75c600607f05a3b063ffba1.png", "id": "[email protected]", "manifest": "http://defy.tanguy.tk/rm/custom.js", "summary": "CyanogenMod Nightly builds. tpruvot@github" }, { "developer": "MIUI-PT", "free": true, "icon": "http://romshare.deployfu.com/downloads/575/c19be5475e866406d78eff7f3486305c.png", "id": "miuiportugal", "manifest": "http://www.files.miui-pt.com/manifest/miuipt.js", "summary": "Smoothest, Fastest, Gorgeous, all the best stuff in one rom. Try and let us know your feedback." ======= >>>>>>>
<<<<<<< if (currencyCache.userCurrency && currencyCache.userCurrency.currencyType && TimeHelper.isExpired(currencyCache.userCurrency.updated, 3600)) { resolveStoreCurrency(currencyCache.userCurrency.currencyType); ======= if (currencyCache.userCurrency && currencyCache.userCurrency.currencyType && !TimeHelper.isExpired(currencyCache.userCurrency.updated, 3600)) { self.userCurrency = currencyCache.userCurrency.currencyType; resolve(); >>>>>>> if (currencyCache.userCurrency && currencyCache.userCurrency.currencyType && !TimeHelper.isExpired(currencyCache.userCurrency.updated, 3600)) { resolveStoreCurrency(currencyCache.userCurrency.currencyType);
<<<<<<< case /^\/sharedfiles\/editguide\/?$/.test(path): Array.from(document.getElementsByName("tags[]")).forEach(tag => tag.type = "checkbox"); break; ======= case /^\/workshop\/browse/.test(path): (new WorkshopBrowseClass()); break; >>>>>>> case /^\/sharedfiles\/editguide\/?$/.test(path): Array.from(document.getElementsByName("tags[]")).forEach(tag => tag.type = "checkbox"); break; case /^\/workshop\/browse/.test(path): (new WorkshopBrowseClass()); break;
<<<<<<< // version 3.0 var storage = chrome.storage.sync; var apps; ======= // version 3.1 >>>>>>> // version 3.1 var storage = chrome.storage.sync; var apps; <<<<<<< var steamID = document.getElementsByName("abuseID")[0].value; ======= if (document.getElementById("profileBlock")) { var steamID = document.getElementsByName("abuseID")[0].value; storage.get(function(settings) { var htmlstr = '<hr>'; if (settings.profile_steamgifts === undefined) { settings.profile_steamgifts = true; chrome.storage.sync.set({'profile_steamgifts': settings.profile_steamgifts}); } if (settings.profile_steamtrades === undefined) { settings.profile_steamtrades = true; chrome.storage.sync.set({'profile_steamtrades': settings.profile_steamtrades}); } if (settings.profile_steamrep === undefined) { settings.profile_steamrep = true; chrome.storage.sync.set({'profile_steamrep': settings.profile_steamrep}); } if (settings.profile_wastedonsteam === undefined) { settings.profile_wastedonsteam = true; chrome.storage.sync.set({'profile_wastedonsteam': settings.profile_wastedonsteam}); } if (settings.profile_sapi === undefined) { settings.profile_sapi = true; chrome.storage.sync.set({'profile_sapi': settings.profile_sapi}); } if (settings.profile_backpacktf === undefined) { settings.profile_backpacktf = true; chrome.storage.sync.set({'profile_backpacktf': settings.profile_backpacktf}); } if (settings.profile_astats === undefined) { settings.profile_astats = true; chrome.storage.sync.set({'profile_astats': settings.profile_astats}); } if (settings.profile_steamgifts === true) { htmlstr += '<div class="actionItemIcon"><a href="http://www.steamgifts.com/user/id/' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/steamgifts.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://www.steamgifts.com/user/id/' + steamID + '" target="_blank">SteamGifts</a></div>'; } if (settings.profile_steamtrades === true) { htmlstr += '<div class="actionItemIcon"><a href="http://www.steamtrades.com/user/id/' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/steamtrades.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://www.steamtrades.com/user/id/' + steamID + '" target="_blank">SteamTrades</a></div>'; } if (settings.profile_steamrep === true) { htmlstr += '<div class="actionItemIcon"><a href="http://steamrep.com/profiles/' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/steamrep.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://steamrep.com/profiles/' + steamID + '" target="_blank">SteamRep</a></div>'; } if (settings.profile_wastedonsteam === true) { htmlstr += '<div class="actionItemIcon"><a href="http://wastedonsteam.com/id/' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/wastedonsteam.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://wastedonsteam.com/id/' + steamID + '" target="_blank">Wasted On Steam</a></div>'; } if (settings.profile_sapi === true) { htmlstr += '<div class="actionItemIcon"><a href="http://sapi.techieanalyst.net/?page=profile&id=' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/sapi.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://sapi.techieanalyst.net/?page=profile&id=' + steamID + '" target="_blank">sAPI</a></div>'; } if (settings.profile_backpacktf === true) { htmlstr += '<div class="actionItemIcon"><a href="http://backpack.tf/profiles/' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/backpacktf.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://backpack.tf/profiles/' + steamID + '" target="_blank">backpack.tf</a></div>'; } if (settings.profile_astats === true) { htmlstr += '<div class="actionItemIcon"><a href="http://www.achievementstats.com/index.php?action=profile&playerId=' + steamID + '" target="_blank"><img src="' + chrome.extension.getURL('img/ico/achievementstats.ico') + '" width="16" height="16" border="0" /></a></div><div class="actionItem"><a class="linkActionMinor" href="http://www.achievementstats.com/index.php?action=profile&playerId=' + steamID + '" target="_blank">Achievement Stats</a></div>'; } if (htmlstr != '<hr>') { document.getElementById("rightActionBlock").insertAdjacentHTML('beforeend', htmlstr); } }); } >>>>>>> var steamID = document.getElementsByName("abuseID")[0].value; <<<<<<< function i_dont_know_what_this_code_does() { // removes "onclick" events which Steam uses to add javascript to it's search functions var allElements, thisElement; allElements = document.evaluate("//a[contains(@onclick, 'SearchLinkClick( this ); return false;')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allElements.snapshotLength; i++) { thisElement = allElements.snapshotItem(i); if (thisElement.nodeName.toUpperCase() == 'A') { thisElement.removeAttribute('onclick'); } } } function load_app_info(node) { var appid = get_appid(node.href || $(node).find("a")[0].href) || get_appid_wishlist(node.id); if (appid) { add_info(appid).done(function(){ // Order here is important; bottom-most renders last. if (getValue(appid + "wishlisted")) highlight_wishlist(node); if (getValue(appid + "owned")) highlight_owned(node); if (getValue(appid + "inventory")) highlight_inv(node); }); } } function check_if_purchased() { // find the date a game was purchased if owned var ownedNode = $(".game_area_already_owned"); if (ownedNode.length > 0) { var appname = $(".apphub_AppName")[0].innerText; find_purchase_date(appname); } } $(document).ready(function(){ // On window load... add_enhanced_steam_options_link(); remove_install_steam_button(); i_dont_know_what_this_code_does(); /* To test: Coupons dlc_data_from_site(); add_widescreen_certification(); */ switch (window.location.host) { case "store.steampowered.com": // Load appids from inv before anything else. load_inventory().done(function() { switch (true) { case /^\/cart\/.*/.test(window.location.pathname): add_empty_cart_button(); break; case /^\/app\/.*/.test(window.location.pathname): // if (getValue(appid+"c")) display_coupon_message(appid); var appid = get_appid(window.location.host + window.location.pathname); show_pricing_history(appid); dlc_data_from_site(appid); drm_warnings(); add_metracritic_userscore(); check_if_purchased(); add_widescreen_certification(); // Doesn't work? break; case /^\/sub\/.*/.test(window.location.pathname): drm_warnings(); subscription_savings_check(); break; case /^\/account\/.*/.test(window.location.pathname): account_total_spent(); break; ======= // adds a "total spent on Steam" to the account details page storage.get(function(settings) { if (settings.showtotal === undefined) { settings.showtotal = true; storage.set({'showtotal': settings.showtotal}); } if (settings.showtotal) { if ($('.transactionRow').length != 0) { totaler = function (p, i) { if (p.innerHTML.indexOf("class=\"transactionRowEvent\">Wallet Credit</div>") < 0) { var regex = /(\d+\.\d\d+)/; price = regex.exec($(p).html()); if (price != null) { return parseFloat(price); } >>>>>>> function check_if_purchased() { // find the date a game was purchased if owned var ownedNode = $(".game_area_already_owned"); if (ownedNode.length > 0) { var appname = $(".apphub_AppName")[0].innerText; find_purchase_date(appname); } } function bind_ajax_content_highlighting() { // checks content loaded via AJAX var observer = new WebKitMutationObserver(function(mutations) { mutations.forEach(function(mutation) { for (var i = 0; i < mutation.addedNodes.length; i++) { var node = mutation.addedNodes[i]; if (node) { if (node.innerHTML) { var appid = node.innerHTML.match(/<a href="http:\/\/store.steampowered.com\/app\/(.+)\//); if (appid) { add_info(node, appid[1]); } } } } }); }); observer.observe(document, { subtree: true, childList: true }); } $(document).ready(function(){ // On window load... add_enhanced_steam_options_link(); remove_install_steam_button(); i_dont_know_what_this_code_does(); /* To test: Coupons dlc_data_from_site(); add_widescreen_certification(); */ switch (window.location.host) { case "store.steampowered.com": // Load appids from inv before anything else. load_inventory().done(function() { switch (true) { case /^\/cart\/.*/.test(window.location.pathname): add_empty_cart_button(); break; case /^\/app\/.*/.test(window.location.pathname): // if (getValue(appid+"c")) display_coupon_message(appid); var appid = get_appid(window.location.host + window.location.pathname); show_pricing_history(appid); dlc_data_from_site(appid); drm_warnings(); add_metracritic_userscore(); check_if_purchased(); add_widescreen_certification(); // Doesn't work? break; case /^\/sub\/.*/.test(window.location.pathname): drm_warnings(); subscription_savings_check(); break; case /^\/account\/.*/.test(window.location.pathname): account_total_spent(); break;
<<<<<<< const GameId = (function(){ let self = {}; function parseId(id) { ======= class GameId { static parseId(id) { >>>>>>> class GameId { static parseId(id) { <<<<<<< constructor(origin, params={}) { if (!origin) throw `Constructor requires an Origin`; this.origin = origin; this.params = params; } ======= // static origin; // this *must* be overridden static params = {}; >>>>>>> // static origin; // this *must* be overridden static params = {}; <<<<<<< getEndpoint(endpoint, query) { ======= static getEndpoint(endpoint, query) { >>>>>>> static getEndpoint(endpoint, query) { <<<<<<< CacheStorage.set(key, result.data); progressingRequests.delete(key); ======= LocalStorageCache.set(key, result.data); self._progressingRequests.delete(key); >>>>>>> CacheStorage.set(key, result.data); self._progressingRequests.delete(key); <<<<<<< _earlyAccessAppIds.promise = AugmentedSteamApi.getEndpoint("v01/earlyaccess") //.then(response => response.json().then(data => ({ 'result': data.result, 'data': data.data, 'timestamp': CacheStorage.timestamp(), }))) ======= self._earlyAccessAppIds_promise = self.getEndpoint("v01/earlyaccess") //.then(response => response.json().then(data => ({ 'result': data.result, 'data': data.data, 'timestamp': LocalStorageCache.timestamp(), }))) >>>>>>> self._earlyAccessAppIds_promise = self.getEndpoint("v01/earlyaccess") //.then(response => response.json().then(data => ({ 'result': data.result, 'data': data.data, 'timestamp': LocalStorageCache.timestamp(), }))) <<<<<<< CacheStorage.set("early_access_appids", appids); _earlyAccessAppIds.promise = null; // no request in progress ======= LocalStorageCache.set("early_access_appids", appids); self._earlyAccessAppIds_promise = null; // no request in progress >>>>>>> LocalStorageCache.set("early_access_appids", appids); self._earlyAccessAppIds_promise = null; // no request in progress <<<<<<< self.currency = async function() { let cache = CacheStorage.get('currency', 3600); if (cache) { return cache; } ======= static async currency() { let self = SteamStore; let cache = LocalStorageCache.get('currency', 3600); if (cache) return cache; >>>>>>> static async currency() { let self = SteamStore; let cache = LocalStorageCache.get('currency', 3600); if (cache) return cache; <<<<<<< self.purchase = async function({ 'params': params, }) { if (!params || !params.appName) { ======= static async purchase({ 'params': params, }) { let self = SteamStore; if (!params || !params.appName) >>>>>>> static async purchase({ 'params': params, }) { let self = SteamStore; if (!params || !params.appName) <<<<<<< let appName = clearSpecialSymbols(params.appName); let purchases = CacheStorage.get(key, 5 * 60); ======= let appName = self.clearSpecialSymbols(params.appName); let purchases = LocalStorageCache.get(key, 5 * 60); >>>>>>> let appName = self.clearSpecialSymbols(params.appName); let purchases = CacheStorage.get(key, 5 * 60); <<<<<<< CacheStorage.set("dynamicstore", dynamicstore); _dynamicstore.promise = null; // no request in progress ======= LocalStorageCache.set("dynamicstore", dynamicstore); self._dynamicstore_promise = null; // no request in progress >>>>>>> CacheStorage.set("dynamicstore", dynamicstore); self._dynamicstore_promise = null; // no request in progress <<<<<<< return _dynamicstore(); }; self.clearDynamicStore = async function() { CacheStorage.remove('dynamicstore'); _dynamicstore.promise = null; }; ======= return Steam._dynamicstore(); } static async clearDynamicStore() { LocalStorageCache.remove('dynamicstore'); Steam._dynamicstore_promise = null; } >>>>>>> return Steam._dynamicstore(); } static async clearDynamicStore() { CacheStorage.remove('dynamicstore'); Steam._dynamicstore_promise = null; }
<<<<<<< self.getAchievementBar = function(path, appid) { return Background.action("stats", { "path": path, "appid": appid }).then(response => { ======= self.getAchievementBar = function(appid) { return Background.action("stats", appid).then(response => { >>>>>>> self.getAchievementBar = function(path, appid) { return Background.action("stats", path, appid).then(response => {
<<<<<<< //get_store_session(); ======= get_store_session(); fix_menu_dropdown(); >>>>>>> //get_store_session(); fix_menu_dropdown();
<<<<<<< this.addOwnedElsewhere(); ======= this.displayViewInLibrary(); >>>>>>> this.addOwnedElsewhere(); this.displayViewInLibrary(); <<<<<<< Background.action('cards', appid) .then(result => loadBadgeContent(".es_normal_badge_progress", result), EnhancedSteam.addLoginWarning); Background.action('cards', appid, true) .then(result => loadBadgeContent(".es_foil_badge_progress", result), EnhancedSteam.addLoginWarning); ======= Background.action('cards', { 'appid': appid, } ) .then(result => loadBadgeContent(".es_normal_badge_progress", result)); Background.action('cards', { 'appid': appid, 'border': 1, } ) .then(result => loadBadgeContent(".es_foil_badge_progress", result)); >>>>>>> Background.action('cards', { 'appid': appid, } ) .then(result => loadBadgeContent(".es_normal_badge_progress", result)); Background.action('cards', { 'appid': appid, 'border': 1, } ) .then(result => loadBadgeContent(".es_foil_badge_progress", result));
<<<<<<< ======= tag_owned = $("#tag_owned").prop('checked'); show_friends_want = $("#show_friends_want").prop('checked'); tag_owned_color = $("#tag_owned_color").val(); show_friends_want_color = $("#show_friends_want_color").val(); >>>>>>> <<<<<<< ======= 'show_carousel_descriptions': show_carousel_descriptions, 'tag_owned': tag_owned, 'show_friends_want': show_friends_want, 'tag_owned_color': tag_owned_color, 'show_friends_want_color': show_friends_want_color, >>>>>>> 'show_carousel_descriptions': show_carousel_descriptions, <<<<<<< ======= if (settings.show_carousel_descriptions === undefined) { settings.show_carousel_descriptions = true; chrome.storage.sync.set({'show_carousel_descriptions': settings.show_carousel_descriptions}); } if (settings.tag_owned === undefined) { settings.tag_owned = false; chrome.storage.sync.set({'tag_owned': settings.tag_owned}); } if (settings.show_friends_want === undefined) { settings.show_friends_want = true; chrome.storage.sync.set({'show_friends_want': settings.show_friends_want}); } if (settings.tag_owned_color === undefined) { settings.tag_owned_color = "#5c7836"; chrome.storage.sync.set({'tag_owned_color': settings.tag_owned_color}); } if (settings.show_friends_want_color === undefined) { settings.show_friends_want_color = "#7E4060"; chrome.storage.sync.set({'show_friends_want_color': settings.show_friends_want_color}); } >>>>>>> if (settings.show_carousel_descriptions === undefined) { settings.show_carousel_descriptions = true; chrome.storage.sync.set({'show_carousel_descriptions': settings.show_carousel_descriptions}); } <<<<<<< ======= $("#tag_owned").attr('checked', settings.tag_owned); $("#show_friends_want").attr('checked', settings.show_friends_want); $("#tag_owned_color").attr('value', settings.tag_owned_color); $("#show_friends_want_color").attr('value', settings.show_friends_want_color); >>>>>>>
<<<<<<< case /^\/sharedfiles\/filedetails\/?$/.test(path): (new WorkshopPageClass()); ======= case /^\/sharedfiles\/.*/.test(path): (new SharedFilesPageClass()); >>>>>>> case /^\/sharedfiles\/filedetails\/?$/.test(path): (new SharedFilesPageClass());
<<<<<<< Messenger.addMessageListener("dynamicStoreReady", () => { self.highlightAndTag(parent.querySelectorAll(selector)); ======= Messenger.onMessage("dynamicStoreReady").then(() => { selectors.forEach(selector => { self.highlightAndTag(parent.querySelectorAll(selector+":not(.es_highlighted)")); }); >>>>>>> Messenger.onMessage("dynamicStoreReady").then(() => { self.highlightAndTag(parent.querySelectorAll(selector));
<<<<<<< 'sortreviewsby': "date", ======= 'sortgroupsby': "default", >>>>>>> 'sortreviewsby': "date", 'sortgroupsby': "default",
<<<<<<< } else if (oldVersion.isSameOrBefore("0.9.5")) { SyncedStorage.remove("showesbg"); ======= } else if (oldVersion.isSameOrBefore("0.9.5")) { SyncedStorage.set("hideaboutlinks", SyncedStorage.get("hideinstallsteambutton") && SyncedStorage.get("hideaboutmenu")); SyncedStorage.remove("hideinstallsteambutton"); SyncedStorage.remove("hideaboutmenu"); >>>>>>> } else if (oldVersion.isSameOrBefore("0.9.5")) { SyncedStorage.remove("showesbg"); SyncedStorage.set("hideaboutlinks", SyncedStorage.get("hideinstallsteambutton") && SyncedStorage.get("hideaboutmenu")); SyncedStorage.remove("hideinstallsteambutton"); SyncedStorage.remove("hideaboutmenu");
<<<<<<< return getStatusObject(giftsAndPasses, coupons); ======= let promises = []; if (SyncedStorage.get("highlight_inv_guestpass") || SyncedStorage.get("tag_inv_guestpass") || SyncedStorage.get("highlight_inv_gift") || SyncedStorage.get("tag_inv_gift")) { promises.push(Background.action('inventory.gifts').then(({ "gifts": x, "passes": y, }) => { gifts = new Set(x); guestpasses = new Set(y); })); } if (SyncedStorage.get("highlight_coupon") || SyncedStorage.get("tag_coupon") || SyncedStorage.get("show_coupon")) { promises.push(Background.action('inventory.coupons').then(handleCoupons)); } if (SyncedStorage.get("highlight_owned") || SyncedStorage.get("tag_owned")) { promises.push(Background.action('inventory.community').then(inv6 => inv6set = new Set(inv6))); } _promise = Promise.all(promises); return _promise; }; self.then = function(onDone, onCatch) { return self.promise().then(onDone, onCatch); }; self.getCoupon = function(subid) { return coupons && coupons[subid]; }; self.getCouponByAppId = function(appid) { if (!coupon_appids.has(appid)) return false; let subid = coupon_appids.get(appid); return self.getCoupon(subid); }; self.hasGift = function(subid) { return gifts.has(subid); }; self.hasGuestPass = function(subid) { return guestpasses.has(subid); >>>>>>> return getStatusObject(giftsAndPasses, coupons); <<<<<<< if (Currency.customCurrency != Currency.storeCurrency) { let lowest_alt = await lowest.inCurrency(Currency.storeCurrency); ======= if (Currency.customCurrency !== Currency.storeCurrency) { let lowest_alt = lowest.inCurrency(Currency.storeCurrency); >>>>>>> if (Currency.customCurrency != Currency.storeCurrency) { let lowest_alt = await lowest.inCurrency(Currency.storeCurrency); <<<<<<< // "Historical Low" if (info["lowest"]) { let historical = await new Price(info['lowest']['price'], meta['currency']).inCurrency(Currency.customCurrency); let recorded = new Date(info["lowest"]["recorded"]*1000); ======= // Historical low if (info.lowest) { hasData = true; let lowestData = info.lowest; let historical = new Price(lowestData.price, meta.currency).inCurrency(Currency.customCurrency); let recorded = new Date(info.lowest.recorded * 1000); >>>>>>> // Historical low if (info.lowest) { hasData = true; let lowestData = info.lowest; let historical = await new Price(lowestData.price, meta.currency).inCurrency(Currency.customCurrency); let recorded = new Date(info.lowest.recorded * 1000); <<<<<<< if (Currency.customCurrency != Currency.storeCurrency) { let historical_alt = await historical.inCurrency(Currency.storeCurrency); ======= if (Currency.customCurrency !== Currency.storeCurrency) { let historical_alt = historical.inCurrency(Currency.storeCurrency); >>>>>>> if (Currency.customCurrency !== Currency.storeCurrency) { let historical_alt = await historical.inCurrency(Currency.storeCurrency); <<<<<<< let chartImg = ExtensionResources.getURL("img/line_chart.png"); html = `<div class='es_lowest_price' id='es_price_${id}'><div class='gift_icon' id='es_line_chart_${id}'><img src='${chartImg}'></div>`; ======= // times bundled if (info.bundles.count > 0) { hasData = true; >>>>>>> // times bundled if (info.bundles.count > 0) { hasData = true; <<<<<<< let tierPrice = (await new Price(tier.price, meta['currency']).inCurrency(Currency.customCurrency)).toString(); ======= let tierPrice = new Price(tier.price, meta.currency).inCurrency(Currency.customCurrency).toString(); >>>>>>> let tierPrice = (await new Price(tier.price, meta.currency).inCurrency(Currency.customCurrency)).toString(); <<<<<<< purchase += (await new Price(bundlePrice, meta['currency']).inCurrency(Currency.customCurrency)).toString(); ======= purchase += new Price(bundlePrice, meta.currency).inCurrency(Currency.customCurrency).toString(); >>>>>>> purchase += (await new Price(bundlePrice, meta.currency).inCurrency(Currency.customCurrency)).toString();
<<<<<<< * Version: 1.7.0-rc.2 -- 2017-10-25T00:12:31.816Z ======= * Version: 1.7.0-rc.3 -- 2017-10-26T19:56:45.415Z >>>>>>> * Version: 1.7.0-rc.3 -- 2017-10-26T21:39:35.661Z <<<<<<< // We need the item bindings to be processed before we can do adjustments !$scope.$$phase && $scope.$digest(); ======= // We need the item bindings to be processed before we can do adjustment !$scope.$$phase && !$scope.$root.$$phase && $scope.$digest(); >>>>>>> // We need the item bindings to be processed before we can do adjustments !$scope.$$phase && !$scope.$root.$$phase && $scope.$digest(); <<<<<<< var updates = processUpdates(); ======= var updates = updateDOM(); // We need the item bindings to be processed before we can do adjustment !$scope.$$phase && !$scope.$root.$$phase && $scope.$digest(); updates.inserted.forEach(function (w) { return w.element.removeClass('ng-hide'); }); updates.prepended.forEach(function (w) { return w.element.removeClass('ng-hide'); }); >>>>>>> var updates = processUpdates();
<<<<<<< localStorage.setItem("netlifySiteURL", store.siteURL) store.init(instantiateGotrue(), true) }) ======= if (store.siteURL === null || store.siteURL === undefined) { localStorage.removeItem("netlifySiteURL"); } else { localStorage.setItem("netlifySiteURL", store.siteURL); } store.init(instantiateGotrue(), true); }); >>>>>>> if (store.siteURL === null || store.siteURL === undefined) { localStorage.removeItem("netlifySiteURL") } else { localStorage.setItem("netlifySiteURL", store.siteURL) } store.init(instantiateGotrue(), true) }) <<<<<<< const { APIUrl, logo = true } = options const controlEls = document.querySelectorAll("[data-netlify-identity-menu],[data-netlify-identity-button]") Array.prototype.slice.call(controlEls).forEach((el) => { let controls = null const mode = el.getAttribute("data-netlify-identity-menu") === null ? "button" : "menu" ======= const { APIUrl, logo = true, namePlaceholder } = options; const controlEls = document.querySelectorAll( "[data-netlify-identity-menu],[data-netlify-identity-button]" ); Array.prototype.slice.call(controlEls).forEach(el => { let controls = null; const mode = el.getAttribute("data-netlify-identity-menu") === null ? "button" : "menu"; >>>>>>> const { APIUrl, logo = true, namePlaceholder } = options const controlEls = document.querySelectorAll("[data-netlify-identity-menu],[data-netlify-identity-button]") Array.prototype.slice.call(controlEls).forEach((el) => { let controls = null const mode = el.getAttribute("data-netlify-identity-menu") === null ? "button" : "menu" <<<<<<< store.init(instantiateGotrue(APIUrl)) store.modal.logo = logo iframe = document.createElement("iframe") iframe.id = "netlify-identity-widget" ======= store.init(instantiateGotrue(APIUrl)); store.modal.logo = logo; store.setNamePlaceholder(namePlaceholder); iframe = document.createElement("iframe"); iframe.id = "netlify-identity-widget"; >>>>>>> store.init(instantiateGotrue(APIUrl)) store.modal.logo = logo store.setNamePlaceholder(namePlaceholder) iframe = document.createElement("iframe") iframe.id = "netlify-identity-widget"
<<<<<<< import zh_tw from './zh_tw.json'; ======= import gr from './gr.json'; import ms from './ms.json'; import es from './es.json'; >>>>>>> import gr from './gr.json'; import ms from './ms.json'; import es from './es.json'; import zh_tw from './zh_tw.json'; <<<<<<< zh_tw: zh_tw[0], ======= gr: gr[0], ms: ms[0], es: es[0], >>>>>>> gr: gr[0], ms: ms[0], es: es[0], zh_tw: zh_tw[0],
<<<<<<< import ko from './ko.json'; ======= import id from './id.json'; >>>>>>> import ko from './ko.json'; import id from './id.json'; <<<<<<< ko: ko[0], ======= id: id[0], >>>>>>> ko: ko[0], id: id[0],
<<<<<<< var rxPlan = loadRxTests('spec'); plan({ tests: rxPlan.totalTests }); var rx = new Rx({ defaultTypes: true }); for (coreType in Rx.CoreType) rx.registerType( Rx.CoreType[coreType] ); ======= >>>>>>> var rxPlan = loadRxTests('spec'); plan({ tests: rxPlan.totalTests }); var rx = new Rx({ defaultTypes: true }); for (coreType in Rx.CoreType) rx.registerType( Rx.CoreType[coreType] );
<<<<<<< import jQuery from "jquery"; import { isMobile } from "../utils/is-mobile"; ======= >>>>>>> import { isMobile } from "../utils/is-mobile"; <<<<<<< var self = this; var $root = jQuery(rootElement); ======= >>>>>>> <<<<<<< $root.on('click.ember', '.ember-view', function(evt, triggeringManager) { ======= var $rootElement = Ember.$(!Ember.isNone(rootElement) ? rootElement : Ember.get(this, 'rootElement')); $rootElement.on('click.ember', '.ember-view', function(evt, triggeringManager) { >>>>>>> var $rootElement = Ember.$(!Ember.isNone(rootElement) ? rootElement : Ember.get(this, 'rootElement')); $rootElement.on('click.ember', '.ember-view', function(evt, triggeringManager) { <<<<<<< // Tap events need to be converted to submit events on mobile. This is because the // click events that would ordinarily trigger default submit event get prevented // by the ghost click preventer. var submitSelector = 'button[type="submit"],input[type="submit"]'; $root.on('tap.ember-mobiletouch', submitSelector, function() { // When on mobile we get taps automatically and clicks are squashed, // so we trigger submit on tap. if (isMobile()) { jQuery(this).trigger('submit'); } }); $root.on('click.ember-mobiletouch', submitSelector, function() { // When not on mobile we seem to get a click when enter is used to submit // the form, so we rely on click to trigger submit. For actual button // clicks we could rely on tap as in the mobile case, but this doen't work // for pressing enter. if (!isMobile()) { jQuery(this).trigger('submit'); } }); // We may want to conditionally stop propagation, but I couldn't figure out // how do do this because we don't seem to have access to the {{action}} helper // options that were used to define it such as preventDefault and bubbles. $root.on('click.ember-mobiletouch', '[data-ember-action]', function(e) { ======= //prevent clicks on actions that are also links from triggering the default behavior Ember.$(rootElement).on('click.ember-mobiletouch', '[data-ember-action]', function(e) { >>>>>>> // Tap events need to be converted to submit events on mobile. This is because the // click events that would ordinarily trigger default submit event get prevented // by the ghost click preventer. var submitSelector = 'button[type="submit"],input[type="submit"]'; $rootElement.on('tap.ember-mobiletouch', submitSelector, function() { if (isMobile()) { Ember.$(this).trigger('submit'); } }); // When not on mobile we seem to get a click when enter is used to submit // the form, so we rely on click to trigger submit. For actual button // clicks we could rely on tap as in the mobile case, but this doen't work // for pressing enter. $rootElement.on('click.ember-mobiletouch', submitSelector, function() { if (!isMobile()) { Ember.$(this).trigger('submit'); } }); //prevent clicks on actions that are also links from triggering the default behavior $rootElement.on('click.ember-mobiletouch', '[data-ember-action]', function(e) {
<<<<<<< isIdempotentRequestError, exponentialDelay ======= isIdempotentRequestError, isRetryableError >>>>>>> isIdempotentRequestError, exponentialDelay isRetryableError <<<<<<< }); describe('exponentialDelay', () => { it('should return exponential retry delay', () => { function assertTime(retryNumber) { const min = (Math.pow(2, retryNumber) * 100); const max = (Math.pow(2, retryNumber * 100) * 0.2); const time = exponentialDelay(retryNumber); expect((time >= min && time <= max)).toBe(true); } [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].forEach(assertTime); }); ======= }); describe('isRetryableError(error)', () => { it('should be false for aborted requests', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNABORTED'; expect(isRetryableError(errorResponse)).toBe(false); }); it('should be true for timeouts', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; expect(isRetryableError(errorResponse)).toBe(true); }); it('should be true for a 5xx response', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; errorResponse.response = { status: 500 }; expect(isRetryableError(errorResponse)).toBe(true); }); it('should be false for a response !== 5xx', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; errorResponse.response = { status: 400 }; expect(isRetryableError(errorResponse)).toBe(false); }); >>>>>>> }); describe('exponentialDelay', () => { it('should return exponential retry delay', () => { function assertTime(retryNumber) { const min = (Math.pow(2, retryNumber) * 100); const max = (Math.pow(2, retryNumber * 100) * 0.2); const time = exponentialDelay(retryNumber); expect((time >= min && time <= max)).toBe(true); } [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].forEach(assertTime); }); }); describe('isRetryableError(error)', () => { it('should be false for aborted requests', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNABORTED'; expect(isRetryableError(errorResponse)).toBe(false); }); it('should be true for timeouts', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; expect(isRetryableError(errorResponse)).toBe(true); }); it('should be true for a 5xx response', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; errorResponse.response = { status: 500 }; expect(isRetryableError(errorResponse)).toBe(true); }); it('should be false for a response !== 5xx', () => { const errorResponse = new Error('Error response'); errorResponse.code = 'ECONNRESET'; errorResponse.response = { status: 400 }; expect(isRetryableError(errorResponse)).toBe(false); });
<<<<<<< var $stateProvider, scope, $compile, elem, log; ======= var log, scope, $compile, elem, $onInit; >>>>>>> var $stateProvider, scope, $compile, elem, log; <<<<<<< ======= beforeEach(function() { log = ''; $onInit = jasmine.createSpy('$onInit'); }); >>>>>>> <<<<<<< }, nState = { template: 'nState', controller: function ($scope, $element) { var data = $element.data('$uiView'); $scope.$on("$destroy", function() { log += 'destroy;'}); data.$animEnter.then(function() { log += "animEnter;"}); data.$animLeave.then(function() { log += "animLeave;"}); } ======= }, pState = { controller: function() { this.$onInit = $onInit; }, template: "hi", controllerAs: "vm" >>>>>>> }, nState = { template: 'nState', controller: function ($scope, $element) { var data = $element.data('$uiView'); $scope.$on("$destroy", function() { log += 'destroy;'}); data.$animEnter.then(function() { log += "animEnter;"}); data.$animLeave.then(function() { log += "animLeave;"}); } <<<<<<< .state('m', mState) .state('n', nState) ======= .state('m', { template: 'mState', controller: function($scope) { log += 'ctrl(m);'; $scope.$on('$destroy', function() { log += '$destroy(m);'; }); } }) .state('n', { template: 'nState', controller: function($scope) { log += 'ctrl(n);'; } }) .state('o', oState) .state('p', pState) >>>>>>> .state('m', mState) .state('n', nState) <<<<<<< describe('(resolved data)', function() { var _scope; function controller($scope) { _scope = $scope; } var _state = { name: 'resolve', resolve: { user: function($timeout) { return $timeout(function() { return "joeschmoe"; }, 100); } } }; it('should provide the resolved data on the $scope', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$resolve.user}}', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$resolve).toBeDefined(); expect(_scope.$resolve.user).toBe('joeschmoe') })); it('should put the resolved data on the resolveAs variable', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$$$resolve.user}}', resolveAs: '$$$resolve', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$$$resolve).toBeDefined(); expect(_scope.$$$resolve.user).toBe('joeschmoe') })); it('should put the resolved data on the controllerAs', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$ctrl.$resolve.user}}', controllerAs: '$ctrl', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$resolve).toBeDefined(); expect(_scope.$ctrl).toBeDefined(); expect(_scope.$ctrl.$resolve).toBeDefined(); expect(_scope.$ctrl.$resolve.user).toBe('joeschmoe'); })); it('should use the view-level resolveAs over the state-level resolveAs', inject(function ($state, $q, $timeout) { var views = { "$default": { controller: controller, template: '{{$$$resolve.user}}', resolveAs: '$$$resolve' } }; var state = angular.extend({}, _state, { resolveAs: 'foo', views: views }) $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$$$resolve).toBeDefined(); expect(_scope.$$$resolve.user).toBe('joeschmoe'); })); }); ======= it('should call the existing $onInit after instantiating a controller', inject(function ($state, $q) { elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo(pState); $q.flush(); expect($onInit).toHaveBeenCalled(); })); >>>>>>> describe('(resolved data)', function() { var _scope; function controller($scope) { _scope = $scope; } var _state = { name: 'resolve', resolve: { user: function($timeout) { return $timeout(function() { return "joeschmoe"; }, 100); } } }; it('should provide the resolved data on the $scope', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$resolve.user}}', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$resolve).toBeDefined(); expect(_scope.$resolve.user).toBe('joeschmoe') })); it('should put the resolved data on the resolveAs variable', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$$$resolve.user}}', resolveAs: '$$$resolve', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$$$resolve).toBeDefined(); expect(_scope.$$$resolve.user).toBe('joeschmoe') })); it('should put the resolved data on the controllerAs', inject(function ($state, $q, $timeout) { var state = angular.extend({}, _state, { template: '{{$ctrl.$resolve.user}}', controllerAs: '$ctrl', controller: controller }); $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$resolve).toBeDefined(); expect(_scope.$ctrl).toBeDefined(); expect(_scope.$ctrl.$resolve).toBeDefined(); expect(_scope.$ctrl.$resolve.user).toBe('joeschmoe'); })); it('should use the view-level resolveAs over the state-level resolveAs', inject(function ($state, $q, $timeout) { var views = { "$default": { controller: controller, template: '{{$$$resolve.user}}', resolveAs: '$$$resolve' } }; var state = angular.extend({}, _state, { resolveAs: 'foo', views: views }) $stateProvider.state(state); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('resolve'); $q.flush(); $timeout.flush(); expect(elem.text()).toBe('joeschmoe'); expect(_scope.$$$resolve).toBeDefined(); expect(_scope.$$$resolve.user).toBe('joeschmoe'); })); }); it('should call the existing $onInit after instantiating a controller', inject(function ($state, $q) { var $onInit = jasmine.createSpy(); $stateProvider.state('onInit', { controller: function() { this.$onInit = $onInit; }, template: "hi", controllerAs: "vm" }); elem.append($compile('<div><ui-view></ui-view></div>')(scope)); $state.transitionTo('onInit'); $q.flush(); expect($onInit).toHaveBeenCalled(); }));
<<<<<<< * @param {string|object} stateName The state name (absolute or relative) or state object you'd like to check. * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like ======= * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like >>>>>>> * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like <<<<<<< $state.is = function is(stateOrName, params) { var state = matcher.find(stateOrName); if (!isDefined(state)) return undefined; if ($state.$current !== state) return false; ======= $state.is = function is(stateOrName, params, options) { options = extend({ relative: $state.$current }, options || {}); var state = findState(stateOrName, options.relative); if (!isDefined(state)) { return undefined; } if ($state.$current !== state) { return false; } >>>>>>> $state.is = function is(stateOrName, params, options) { options = extend({ relative: $state.$current }, options || {}); var state = matcher.find(stateOrName, options.relative); if (!isDefined(state)) return undefined; if ($state.$current !== state) return false; <<<<<<< $state.includes = function includes(stateOrName, params) { var glob = isString(stateOrName) && GlobBuilder.fromString(stateOrName); if (glob) { if (!glob.matches($state.$current.name)) return false; ======= $state.includes = function includes(stateOrName, params, options) { options = extend({ relative: $state.$current }, options || {}); if (isString(stateOrName) && isGlob(stateOrName)) { if (!doesStateMatchGlob(stateOrName)) { return false; } >>>>>>> $state.includes = function includes(stateOrName, params) { options = extend({ relative: $state.$current }, options || {}); var glob = isString(stateOrName) && GlobBuilder.fromString(stateOrName); if (glob) { if (!glob.matches($state.$current.name)) return false; <<<<<<< * @param {string|Object=} stateOrName (absolute or relative) If provided, will only get the config for ======= * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for >>>>>>> * @param {string|Object=} stateOrName (absolute or relative) If provided, will only get the config for <<<<<<< return (matcher.find(stateOrName, context) || {}).self || null; ======= var state = findState(stateOrName, context || $state.$current); return (state && state.self) ? state.self : null; >>>>>>> return (matcher.find(stateOrName, context || $state.$current) || {}).self || null;
<<<<<<< var newScope = scope.$new(), name = getUiViewName(attrs, $element.inheritedData('$uiView')), ======= var newScope, name = currentEl && currentEl.data('$uiViewName'), >>>>>>> var newScope, name = getUiViewName(attrs, $element.inheritedData('$uiView')), <<<<<<< latestLocals = $state.$current.locals[name]; ======= newScope = scope.$new(); >>>>>>> newScope = scope.$new(); latestLocals = $state.$current.locals[name];
<<<<<<< deserialize = require("montage/core/deserializer").deserialize, ======= defaultEventManager = require("montage/core/event/event-manager").defaultEventManager, >>>>>>> deserialize = require("montage/core/deserializer").deserialize, defaultEventManager = require("montage/core/event/event-manager").defaultEventManager,
<<<<<<< /** * The scope against which rule expressions will be evaluated * @type {Scope} */ __scope: { value: null }, _scope: { get: function() { return this.__scope || new Scope(); } }, ======= >>>>>>> /** * The scope against which rule expressions will be evaluated * @type {Scope} */ __scope: { value: null }, _scope: { get: function() { return this.__scope || new Scope(); } }, <<<<<<< ======= /** * @property {Set} */ >>>>>>> /** * @property {Set} */ <<<<<<< ======= * Adds a rule to be used for mapping objects to raw data. * @param {string} targetPath - The path to assign on the target * @param {object} rule - The rule to be used when processing * the mapping. The rule must contain * the direction and path of the properties * to map. Optionally can include * a converter. */ addObjectMappingRule: { value: function (targetPath, rule) { var rawRule = {}; rawRule[targetPath] = rule; this._mapObjectMappingRules(rawRule, true); this._mapRawDataMappingRules(rawRule); } }, /** * Adds a rule to be used for mapping raw data to objects. * @param {string} targetPath - The path to assign on the target * @param {object} rule - The rule to be used when processing * the mapping. The rule must contain * the direction and path of the properties * to map. Optionally can include * a converter. */ addRawDataMappingRule: { value: function (targetPath, rule) { var rawRule = {}; rawRule[targetPath] = rule; this._mapRawDataMappingRules(rawRule, true); this._mapObjectMappingRules(rawRule); } }, /** >>>>>>> <<<<<<< var iterator = this.requisitePropertyNames.values(), parentMapping, promises, propertyName, result; if (this.requisitePropertyNames.size) { promises = []; ======= var requisitePropertyNames = this.requisitePropertyNames, iterator = requisitePropertyNames.values(), promises, propertyName, result; if (requisitePropertyNames.size) { >>>>>>> var requisitePropertyNames = this.requisitePropertyNames, iterator = requisitePropertyNames.values(), promises, propertyName, result; if (requisitePropertyNames.size) { <<<<<<< ======= _resolveProperty: { value: function (object, propertyDescriptor, rule, scope) { var result = this._parse(rule, scope), propertyName = typeof propertyDescriptor === "object" ? propertyDescriptor.name : propertyDescriptor, self = this; if (this._isAsync(result)) { result.then(function (value) { self._setObjectValueForPropertyDescriptor(object, value, propertyDescriptor); return null; }); } else { object[propertyName] = result; } return result; } }, >>>>>>> _resolveProperty: { value: function (object, propertyDescriptor, rule, scope) { var result = this._parse(rule, scope), propertyName = typeof propertyDescriptor === "object" ? propertyDescriptor.name : propertyDescriptor, self = this; if (this._isAsync(result)) { result.then(function (value) { self._setObjectValueForPropertyDescriptor(object, value, propertyDescriptor); return null; }); } else { object[propertyName] = result; } return result; } }, <<<<<<< key; while ((key = keys.next().value)) { promises.push(this.mapObjectToRawDataProperty(object, data, key)); ======= keys = Object.keys(rules), key, i, result; for (i = 0; (key = keys[i]); ++i) { result = this.mapObjectToRawDataProperty(object, data, key); if (this._isAsync(result)) { promises = promises || []; promises.push(result); } >>>>>>> key, result; while ((key = keys.next().value)) { result = this.mapObjectToRawDataProperty(object, data, key); if (this._isAsync(result)) { promises = promises || []; promises.push(result); } <<<<<<< promises = [], key; while ((key = keys.next().value)) { if (rawRequirementsToMap.has(key)) { promises.push(this.mapObjectToRawDataProperty(object, data, key)); ======= promises, key, result; for (key in rules) { if (rules.hasOwnProperty(key) && rawRequirementsToMap.has(key)) { result = this._getAndMapObjectProperty(object, data, key, propertyName); if (this._isAsync(result)) { promises = promises || []; promises.push(result); } >>>>>>> promises, key, result; while ((key = keys.next().value)) { if (rules.hasOwnProperty(key) && rawRequirementsToMap.has(key)) { result = this._getAndMapObjectProperty(object, data, key, propertyName); if (this._isAsync(result)) { promises = promises || []; promises.push(result); } <<<<<<< _isThenable: { ======= _isAsync: { >>>>>>> _isAsync: { <<<<<<< ======= >>>>>>> <<<<<<< ======= >>>>>>>
<<<<<<< iOffset, iElement, ======= iOffset = this._cachedDrawOffset, iStyle, >>>>>>> iOffset = this._cachedDrawOffset, iElement, <<<<<<< pos = this._splinePaths[pathIndex].getPositionAtTime(slide.time, pos); iElement = this._repetitionComponents[i].element.parentNode; ======= pos = this._splinePaths[pathIndex].getPositionAtTime(slide.time, pos,posParameter); iRepetitionComponentElement = this._repetitionComponents[i].element; >>>>>>> pos = this._splinePaths[pathIndex].getPositionAtTime(slide.time, pos, posParameter); iElement = this._repetitionComponents[i].element.parentNode; <<<<<<< ======= iStyle = iRepetitionComponentElement.parentNode.style; if (iStyle.opacity == 0) { iStyle.opacity = 1; } >>>>>>> <<<<<<< style = "-webkit-transform:translate3d(" + pos[0].toFixed(5) + "px," + pos[1].toFixed(5) + "px," + pos[2].toFixed(5) + "px)" + ((typeof pos3.rotateZ !== "undefined") ? "rotateZ(" + pos3.rotateZ + ")" : "") + ((typeof pos3.rotateY !== "undefined") ? "rotateY(" + pos3.rotateY + ")" : "") + ((typeof pos3.rotateX !== "undefined") ? "rotateX(" + pos3.rotateX + ")" : "") + ";"; ======= transform = "translate3d(" + pos[0] + "px," + pos[1] + "px," + pos[2] + "px) "; transform += (typeof pos3.rotateZ !== "undefined") ? "rotateZ(" + pos3.rotateZ + ") " : ""; transform += (typeof pos3.rotateY !== "undefined") ? "rotateY(" + pos3.rotateY + ") " : ""; transform += (typeof pos3.rotateX !== "undefined") ? "rotateX(" + pos3.rotateX + ") " : ""; iStyle.webkitTransform = transform; iStyle = iRepetitionComponentElement.style; >>>>>>> style = "-webkit-transform:translate3d(" + pos[0].toFixed(5) + "px," + pos[1].toFixed(5) + "px," + pos[2].toFixed(5) + "px)" + ((typeof pos3.rotateZ !== "undefined") ? "rotateZ(" + pos3.rotateZ + ")" : "") + ((typeof pos3.rotateY !== "undefined") ? "rotateY(" + pos3.rotateY + ")" : "") + ((typeof pos3.rotateX !== "undefined") ? "rotateX(" + pos3.rotateX + ")" : "") + ";"; <<<<<<< iElement.setAttribute("style", "-webkit-transform:scale3d(0,0,0);opacity:0"); ======= iStyle = iRepetitionComponentElement.parentNode.style; if (iStyle.opacity !== 0) { iStyle.opacity = 0; iStyle.webkitTransform = "scale3d(0, 0, 0)"; } >>>>>>> iElement.setAttribute("style", "-webkit-transform:scale3d(0,0,0);opacity:0");
<<<<<<< this._overridePropertyWithDefaults(deserializer, "cardinality", "cardinality"); ======= this._overridePropertyWithDefaults(deserializer, "cardinality"); >>>>>>> this._overridePropertyWithDefaults(deserializer, "cardinality"); <<<<<<< this._overridePropertyWithDefaults(deserializer, "mandatory", "mandatory"); this._overridePropertyWithDefaults(deserializer, "readOnly", "readOnly"); this._overridePropertyWithDefaults(deserializer, "denyDelete", "denyDelete"); this._overridePropertyWithDefaults(deserializer, "valueType", "valueType"); this._overridePropertyWithDefaults(deserializer, "collectionValueType", "collectionValueType"); this._overridePropertyWithDefaults(deserializer, "valueObjectPrototypeName", "valueObjectPrototypeName"); this._overridePropertyWithDefaults(deserializer, "valueObjectModuleId", "valueObjectModuleId"); this._overridePropertyWithDefaults(deserializer, "_valueDescriptorReference", "valueDescriptor", "targetBlueprint"); this._overridePropertyWithDefaults(deserializer, "enumValues", "enumValues"); this._overridePropertyWithDefaults(deserializer, "defaultValue", "defaultValue"); this._overridePropertyWithDefaults(deserializer, "helpKey", "helpKey"); this._overridePropertyWithDefaults(deserializer, "definition", "definition"); ======= >>>>>>> <<<<<<< var propertyNames = Array.prototype.slice.call(arguments).slice(2, Infinity), value, i, n; // [TJ] Prospective code // if (propertyNames.length === 0) { // propertyNames = [objectKey]; // } for (i = 0, n = propertyNames.length; i < n && !value; i++) { value = deserializer.getProperty(propertyNames[i]); ======= var propertyNames, value, i, n; if (arguments.length > 2) { propertyNames = Array.prototype.slice.call(arguments, 2, Infinity); } else { propertyNames = [objectKey]; } for (i = 0, n = propertyNames.length; i < n && !value; i++) { value = deserializer.getProperty(propertyNames[i]); >>>>>>> var propertyNames, value, i, n; if (arguments.length > 2) { propertyNames = Array.prototype.slice.call(arguments, 2, Infinity); } else { propertyNames = [objectKey]; } for (i = 0, n = propertyNames.length; i < n && !value; i++) { value = deserializer.getProperty(propertyNames[i]);
<<<<<<< /** Description TODO @function @param {Event Handler} event TODO */ ======= >>>>>>> <<<<<<< /** Description TODO @function @param {Event Handler} event TODO */ ======= >>>>>>>
<<<<<<< var resolveURI = function (env, root_schema, uri) { var components, curschema, hash_idx, name; ======= var resolveURI = function (env, schema_stack, uri) { var curschema, components, hash_idx, name; >>>>>>> var resolveURI = function (env, schema_stack, uri) { var curschema, components, hash_idx, name; <<<<<<< var checkValidity = function (env, root_schema, schema, object_stack, options) { ======= var checkValidity = function (env, schema_stack, object, name, options) { var schema = schema_stack[schema_stack.length-1]; >>>>>>> var checkValidity = function (env, schema_stack, object_stack, options) { <<<<<<< return checkValidity(env, refs[0], refs[1], object_stack, options); ======= return checkValidity(env, refs, object, name, options); >>>>>>> return checkValidity(env, schema_stack, object_stack, options); <<<<<<< objerr = checkValidity(env, root_schema, schema.allOf[i], object_stack, options); ======= objerr = checkValidity(env, schema_stack.concat(schema.allOf[i]), object, name, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.allOf[i]), object_stack, options); <<<<<<< if (!options.useCoerce && !options.useDefault && !options.removeAdditional) { if (schema.hasOwnProperty('oneOf')) { for (i = 0, len = schema.oneOf.length, count = 0; i < len; i++) { objerr = checkValidity(env, root_schema, schema.oneOf[i], object_stack, options); if (!objerr) { count = count + 1; if (count > 1) break; } else { objerrs = objerr; } } if (count > 1) return {'oneOf': true}; else if (count < 1) return objerrs; objerrs = {}; } if (schema.hasOwnProperty('anyOf')) { for (i = 0, len = schema.anyOf.length; i < len; i++) { objerr = checkValidity(env, root_schema, schema.anyOf[i], object_stack, options); if (!objerr) ======= if (schema.hasOwnProperty('oneOf')) { for (i = 0, len = schema.oneOf.length, count = 0; i < len; i++) { orig_object[name] = clone(prop); objerr = checkValidity(env, schema_stack.concat(schema.oneOf[i]), orig_object, name, options); if (!objerr) { count = count + 1; if (count > 1) >>>>>>> if (!options.useCoerce && !options.useDefault && !options.removeAdditional) { if (schema.hasOwnProperty('oneOf')) { for (i = 0, len = schema.oneOf.length, count = 0; i < len; i++) { objerr = checkValidity(env, schema_stack.concat(schema.oneOf[i]), object_stack, options); if (!objerr) { count = count + 1; if (count > 1) break; } else { objerrs = objerr; } } if (count > 1) return {'oneOf': true}; else if (count < 1) return objerrs; objerrs = {}; } if (schema.hasOwnProperty('anyOf')) { for (i = 0, len = schema.anyOf.length; i < len; i++) { objerr = checkValidity(env, schema_stack.concat(schema.anyOf[i]), object_stack, options); if (!objerr) <<<<<<< objerr = checkValidity(env, root_schema, schema.dependencies[p], object_stack, options); ======= objerr = checkValidity(env, schema_stack.concat(schema.dependencies[p]), object, name, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.dependencies[p]), object_stack, options); <<<<<<< objerr = checkValidity(env, root_schema, schema.properties[props[i]], object_stack.concat({object: prop, key: props[i]}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.properties[props[i]]), prop, props[i], options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.properties[props[i]]), object_stack.concat({object: prop, key: props[i]}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.patternProperties[p], object_stack.concat({object: prop, key: props[i]}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.patternProperties[p]), prop, props[i], options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.patternProperties[p]), object_stack.concat({object: prop, key: props[i]}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.additionalProperties, object_stack.concat({object: prop, key: props[i]}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.additionalProperties), prop, props[i], options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.additionalProperties), object_stack.concat({object: prop, key: props[i]}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.items[i], object_stack.concat({object: prop, key: i}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.items[i]), prop, i, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.items[i]), object_stack.concat({object: prop, key: i}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.additionalItems, object_stack.concat({object: prop, key: i}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.additionalItems), prop, i, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.additionalItems), object_stack.concat({object: prop, key: i}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.items, object_stack.concat({object: prop, key: i}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.items), prop, i, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.items), object_stack.concat({object: prop, key: i}), options); <<<<<<< objerr = checkValidity(env, root_schema, schema.additionalItems, object_stack.concat({object: prop, key: i}), options); ======= objerr = checkValidity(env, schema_stack.concat(schema.additionalItems), prop, i, options); >>>>>>> objerr = checkValidity(env, schema_stack.concat(schema.additionalItems), object_stack.concat({object: prop, key: i}), options); <<<<<<< errors = checkValidity(this, refs[0], refs[1], object_stack, options); ======= errors = checkValidity(this, refs, root_object, '__root__', options); >>>>>>> errors = checkValidity(this, schema_stack, object_stack, options);
<<<<<<< ======= // set up for MongoDB >>>>>>> // set up for MongoDB <<<<<<< }; module.exports = { generateSchema, createObjectType }; ======= } >>>>>>> module.exports = { generateSchema, createObjectType };
<<<<<<< // function to generate code for module exports const createModuleExports = () => { let string = ''; string += `module.exports = new GraphQLSchema({\n`; string += ` query: RootQuery,\n`; string += ` mutation: Mutation\n`; string += `});` return string; } ======= } >>>>>>> // function to generate code for module exports const createModuleExports = () => { let string = ''; string += `module.exports = new GraphQLSchema({\n`; string += ` query: RootQuery,\n`; string += ` mutation: Mutation\n`; string += `});` return string; } }
<<<<<<< /* Fetch parent entity for a domain. If domain is not in * entityMap, return 'unknown' */ function getParentEntity (urlToCheck) { if (!entityMap) { return 'unknown' } const urlToCheckParsed = tldjs.parse(urlToCheck) const parentEntity = entityMap[urlToCheckParsed.domain] if (parentEntity) { return parentEntity } else { return 'unknown' } } /* * If element hiding is enabled on current domain, send messages * to content scripts to start the process of hiding blocked ads */ function tryElementHide (requestData, tab) { if (tab.parentEntity === 'Oath') { let frameId, messageType if (requestData.type === 'sub_frame') { frameId = requestData.parentFrameId messageType = frameId === 0 ? 'blockedFrame' : 'blockedFrameAsset' } else if (requestData.frameId !== 0 && (requestData.type === 'image' || requestData.type === 'script')) { frameId = requestData.frameId messageType = 'blockedFrameAsset' } chrome.tabs.sendMessage(requestData.tabId, {type: messageType, request: requestData, mainFrameUrl: tab.url}, {frameId: frameId}) } else if (!tab.elementHidingDisabled) { chrome.tabs.sendMessage(requestData.tabId, {type: 'disable'}) tab.elementHidingDisabled = true } } function getTrackerDetails (trackerUrl, listName) { let host = utils.extractHostFromURL(trackerUrl) let parentCompany = utils.findParent(host.split('.')) || 'unknown' return { parentCompany: parentCompany, url: host, type: listName } } function checkABPParsedList (list, url, siteDomain, request) { let match = abp.matches(list, url, { domain: siteDomain, elementTypeMask: abp.elementTypes[request.type.toUpperCase()] }) return match } ======= >>>>>>> /* * If element hiding is enabled on current domain, send messages * to content scripts to start the process of hiding blocked ads */ function tryElementHide (requestData, tab) { if (tab.parentEntity === 'Oath') { let frameId, messageType if (requestData.type === 'sub_frame') { frameId = requestData.parentFrameId messageType = frameId === 0 ? 'blockedFrame' : 'blockedFrameAsset' } else if (requestData.frameId !== 0 && (requestData.type === 'image' || requestData.type === 'script')) { frameId = requestData.frameId messageType = 'blockedFrameAsset' } chrome.tabs.sendMessage(requestData.tabId, {type: messageType, request: requestData, mainFrameUrl: tab.url}, {frameId: frameId}) } else if (!tab.elementHidingDisabled) { chrome.tabs.sendMessage(requestData.tabId, {type: 'disable'}) tab.elementHidingDisabled = true } } <<<<<<< loadLists: loadLists, getParentEntity: getParentEntity, tryElementHide: tryElementHide ======= loadLists: loadLists >>>>>>> loadLists: loadLists, tryElementHide: tryElementHide
<<<<<<< // Though semi can be omitted in this case, it's definitly not a good coding style. // Two options: // 1. throw a warning // 2. do some reformat, such as replace semi with a newline? it('newline within multiline comment', function () { var src = "var a = 123;/*\n*/a++;\n" //expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) }) ======= it('newline within multiline comment', function () { var src = "var a = 123;/*\n*/a++;\n" expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) }) >>>>>>> // Though semi can be omitted in this case, it's definitly not a good coding style. // Two options: // 1. throw a warning // 2. do some reformat, such as replace semi with a newline? it('newline within multiline comment', function () { var src = "var a = 123;/*\n*/a++;\n" expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) }) <<<<<<< it('should not remove semi as empty statement of if/for/while', function () { // if var src = "if (x);\n" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x)\nelse if (x);\n" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) x\nelse;\n" expect(semi.remove(src)).to.equal(src) // while var src = "while (--x);\n" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;);\n" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj);\n" expect(semi.remove(src)).to.equal(src) }) // The better coding style for these cases should be add {} , // but I'm not sure whether it is the duty of this project it('should not add semi for only statement of if/for/while', function () { // if var src = "if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x) x\nelse if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) x\nelse\n +x" expect(semi.remove(src)).to.equal(src) // while var src = "while (x)\n +x" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;)\n +x" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj)\n +x" expect(semi.remove(src)).to.equal(src) }) it('do...while', function () { // should remove semi var src = "do { x-- } while (x);\n" expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) // should add semi var src = "do { x-- } while (x)\n+x" expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) }) it('var statement', function () { // should add semi var src = "var x\n+x" expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) }) ======= it('should not remove semi as empty statement of if/for/while', function () { // if var src = "if (x);\n" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x);else if (x);\n" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) x\nelse;\n" expect(semi.remove(src)).to.equal(src) // while var src = "while (--x);\n" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;);\n" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj);\n" expect(semi.remove(src)).to.equal(src) }) it('should not add semi for only statement of if/for/while', function () { // if var src = "if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x) x\nelse if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) x\nelse\n +x" expect(semi.remove(src)).to.equal(src) // while var src = "while (x)\n +x" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;)\n +x" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj)\n +x" expect(semi.remove(src)).to.equal(src) }) it('do...while', function () { // should remove semi var src = "do { x-- } while (x);\n" expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) // special case. do we really need this? // var src = "do { x-- } while (x)\n+x" // expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) }) // special case. do we really need this? // it('var statement', function () { // // should add semi // var src = "var x\n+x" // expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) // }) >>>>>>> it('should not remove semi as empty statement of if/for/while', function () { // if var src = "if (x);\n" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x) {} else if (x);\n" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) {}\nelse;\n" expect(semi.remove(src)).to.equal(src) // while var src = "while (--x);\n" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;);\n" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj);\n" expect(semi.remove(src)).to.equal(src) }) // The better coding style for these cases should be add {} , // but I'm not sure whether it is the duty of this project it('should not add semi for only statement of if/for/while', function () { // if var src = "if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else if var src = "if (x) x\nelse if (x)\n +x" expect(semi.remove(src)).to.equal(src) // else var src = "if (x) x\nelse\n +x" expect(semi.remove(src)).to.equal(src) // while var src = "while (x)\n +x" expect(semi.remove(src)).to.equal(src) // for var src = "for (;;)\n +x" expect(semi.remove(src)).to.equal(src) // for...in var src = "for (var key in obj)\n +x" expect(semi.remove(src)).to.equal(src) }) it('do...while', function () { // should remove semi var src = "do { x-- } while (x);\n" expect(semi.remove(src)).to.equal(src.replace(/;/g, '')) // special case. do we really need this? // var src = "do { x-- } while (x)\n+x" // expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) }) // special case. do we really need this? // it('var statement', function () { // // should add semi // var src = "var x\n+x" // expect(semi.remove(src)).to.equal(src.replace(/\n/, '\n;')) // })
<<<<<<< export default function (props) { ======= export default function(props) { let cardNameInput; >>>>>>> export default function (props) { let cardNameInput; <<<<<<< <div> <Menu noOverlay={props.noOverlay} pageWrapId="page-wrap" outerContainerId="outer-container" > <ul className="nav nav-sidebar"> {props.children.map((child, index) => ( <li key={index} className={props.currentCard === child.key ? 'active' : null} > {child} </li> ))} </ul> <div className="row"> <div className="input-group"> <input type="text" className="form-control" placeholder="Search for..." /> <span className="input-group-btn"> <button className="btn btn-default" type="button">Add</button> </span> </div> ======= <div className={props.className}> <ul className="nav nav-sidebar"> {props.children.map((child, index) => ( <li key={index} className={props.currentCard === child.key ? 'active': null } > {child} </li> ))} </ul> <div className="row"> <div className="input-group"> <input type="text" className="form-control" placeholder="Search for..." ref={element => (cardNameInput = element)} /> <span className="input-group-btn"> <button className="btn btn-default" type="button" onClick={() => { props.onCardAdd(cardNameInput.value); cardNameInput.value = ''; }} > Add </button> </span> >>>>>>> <div> <Menu noOverlay={props.noOverlay} pageWrapId="page-wrap" outerContainerId="outer-container" > <ul className="nav nav-sidebar"> {props.children.map((child, index) => ( <li key={index} className={props.currentCard === child.key ? 'active' : null} > {child} </li> ))} </ul> <div className="row"> <div className="input-group"> <input type="text" className="form-control" placeholder="Search for..." ref={element => (cardNameInput = element)} /> <span className="input-group-btn"> <button className="btn btn-default" type="button" onClick={() => { props.onCardAdd(cardNameInput.value); cardNameInput.value = ''; }} > Add </button> </span> </div>
<<<<<<< function loadLists () { var listLocation = settings.getSetting('trackerListLoc') var blockLists = settings.getSetting('blockLists') blockLists.forEach(function (listName) { load.JSONfromLocalFile(listLocation + '/' + listName, (listJSON) => { console.log(`Loaded tracker list: ${listLocation}/${listName}`) lists[listName.replace('.json', '')] = listJSON }) }) ======= function loadLists(){ var listLocation = constants.trackerListLoc var blockLists = constants.blockLists blockLists.forEach( function(listName) { load.JSONfromLocalFile(listLocation + "/" + listName, (listJSON) => { lists[listName] = listJSON }); }); >>>>>>> function loadLists(){ var listLocation = constants.trackerListLoc var blockLists = constants.blockLists blockLists.forEach( function(listName) { load.JSONfromLocalFile(listLocation + "/" + listName, (listJSON) => { console.log(`Loaded tracker list: ${listLocation}/${listName}`) lists[listName.replace('.json', '')] = listJSON }) })
<<<<<<< ======= import DiagramsHeader from '../components/icons/DiagramsHeader.js'; import { css } from "@emotion/core"; import BeatLoader from "react-spinners/BeatLoader"; const override = css` display: block; margin-top: 10px; border-color: #12b3ab; `; >>>>>>> import { css } from "@emotion/core"; import BeatLoader from "react-spinners/BeatLoader"; const override = css` display: block; margin-top: 10px; border-color: #12b3ab; `;
<<<<<<< ======= var debugRequest = false; >>>>>>> var debugRequest = false; <<<<<<< function (requestData) { let tabId = requestData.tabId; // Add ATB for DDG URLs let ddgAtbRewrite = ATB.redirectURL(requestData); if (ddgAtbRewrite) return ddgAtbRewrite; // Skip requests to background tabs if (tabId === -1) { return } let thisTab = tabManager.get(requestData); // For main_frame requests: create a new tab instance whenever we either // don't have a tab instance for this tabId or this is a new requestId. if (requestData.type === "main_frame") { if (!thisTab || (thisTab.requestId !== requestData.requestId)) { thisTab = tabManager.create(requestData); } } else { /** * Check that we have a valid tab * there is a chance this tab was closed before * we got the webrequest event */ if (!(thisTab && thisTab.url && thisTab.id)) return /** * Tracker blocking * If request is a tracker, cancel the request */ chrome.runtime.sendMessage({"updateTrackerCount": true}); var tracker = trackers.isTracker(requestData.url, thisTab.url, thisTab.id, requestData); if (tracker) { // record all tracker urls on a site even if we don't block them thisTab.site.addTracker(tracker); // record potential blocked trackers for this tab thisTab.addToTrackers(tracker); // Block the request if the site is not whitelisted if (!thisTab.site.whitelisted) { thisTab.addOrUpdateTrackersBlocked(tracker); chrome.runtime.sendMessage({"updateTrackerCount": true}); // update badge icon for any requests that come in after // the tab has finished loading if (thisTab.status === "complete") thisTab.updateBadgeIcon() console.info( utils.extractHostFromURL(thisTab.url) + " [" + tracker.parentCompany + "] " + tracker.url); if (tracker.parentCompany !== 'unknown') Companies.add(tracker.parentCompany) // tell Chrome to cancel this webrequest return {cancel: true}; } } } /** * HTTPS Everywhere rules * If an upgrade rule is found, request is upgraded from http to https */ if (!thisTab.site) return // Avoid redirect loops if (thisTab.httpsRedirects[requestData.requestId] >= 7) { console.log('HTTPS: cancel https upgrade. redirect limit exceeded for url: \n' + requestData.url) return {redirectUrl: thisTab.downgradeHttpsUpgradeRequest(requestData)} } // Fetch upgrade rule from db return new Promise ((resolve) => { const isMainFrame = requestData.type === 'main_frame' ? true : false if (https.isReady) { https.pipeRequestUrl(requestData.url, thisTab, isMainFrame).then( (url) => { if (url !== requestData.url.toLowerCase()) { console.log('HTTPS: upgrade request url to ' + url) if (isMainFrame) thisTab.upgradedHttps = true thisTab.addHttpsUpgradeRequest(url) resolve({redirectUrl: url}) } resolve() } ) } else { resolve() } }) ======= function (requestData) { let tabId = requestData.tabId; // Add ATB for DDG URLs let ddgAtbRewrite = ATB.redirectURL(requestData); if(ddgAtbRewrite) return ddgAtbRewrite; // skip requests to background tabs if(tabId === -1){ return; } let thisTab = tabManager.get(requestData); // for main_frame requests: create a new tab instance whenever we either // don't have a tab instance for this tabId or this is a new requestId. if (requestData.type === "main_frame") { if (!thisTab || (thisTab.requestId !== requestData.requestId)) { thisTab = tabManager.create(requestData); } } else { // check that we have a valid tab // there is a chance this tab was closed before // we got the webrequest event if (!(thisTab && thisTab.url && thisTab.id)) { return; } chrome.runtime.sendMessage({"updateTrackerCount": true}); var tracker = trackers.isTracker(requestData.url, thisTab.url, thisTab.id, requestData); if (tracker) { // record all tracker urls on a site even if we don't block them thisTab.site.addTracker(tracker); // record potential blocked trackers for this tab thisTab.addToTrackers(tracker); // Block the request if the site is not whitelisted if (!thisTab.site.whitelisted) { thisTab.addOrUpdateTrackersBlocked(tracker); chrome.runtime.sendMessage({"updateTrackerCount": true}); // update badge icon for any requests that come in after // the tab has finished loading if (thisTab.status === "complete") thisTab.updateBadgeIcon() console.info( utils.extractHostFromURL(thisTab.url) + " [" + tracker.parentCompany + "] " + tracker.url); if (tracker.parentCompany !== 'unknown') Companies.add(tracker.parentCompany) // for debugging specific requests. see test/tests/debugSite.js if (debugRequest && debugRequest.length) { if (debugRequest.includes(tracker.url)) { console.log("UNBLOCKED: ", tracker.url) return } } // tell Chrome to cancel this webrequest return {cancel: true}; } } } // TODO: revisit https upgrade feature... soon // upgrade to https if the site isn't whitelisted or in our list // of known broken https sites /* if (!(thisTab.site.whitelisted || httpsWhitelist[thisTab.site.domain] || thisTab.site.HTTPSwhitelisted)) { let upgradeStatus = onBeforeRequest(requestData); if (upgradeStatus && upgradeStatus.redirectUrl){ thisTab.httpsRequests.push(upgradeStatus.redirectUrl); } return upgradeStatus; } */ >>>>>>> function (requestData) { let tabId = requestData.tabId; // Add ATB for DDG URLs let ddgAtbRewrite = ATB.redirectURL(requestData); if (ddgAtbRewrite) return ddgAtbRewrite; // Skip requests to background tabs if (tabId === -1) { return } let thisTab = tabManager.get(requestData); // For main_frame requests: create a new tab instance whenever we either // don't have a tab instance for this tabId or this is a new requestId. if (requestData.type === "main_frame") { if (!thisTab || (thisTab.requestId !== requestData.requestId)) { thisTab = tabManager.create(requestData); } } else { /** * Check that we have a valid tab * there is a chance this tab was closed before * we got the webrequest event */ if (!(thisTab && thisTab.url && thisTab.id)) return /** * Tracker blocking * If request is a tracker, cancel the request */ chrome.runtime.sendMessage({"updateTrackerCount": true}); var tracker = trackers.isTracker(requestData.url, thisTab.url, thisTab.id, requestData); if (tracker) { // record all tracker urls on a site even if we don't block them thisTab.site.addTracker(tracker); // record potential blocked trackers for this tab thisTab.addToTrackers(tracker); // Block the request if the site is not whitelisted if (!thisTab.site.whitelisted) { thisTab.addOrUpdateTrackersBlocked(tracker); chrome.runtime.sendMessage({"updateTrackerCount": true}); // update badge icon for any requests that come in after // the tab has finished loading if (thisTab.status === "complete") thisTab.updateBadgeIcon() console.info( utils.extractHostFromURL(thisTab.url) + " [" + tracker.parentCompany + "] " + tracker.url); if (tracker.parentCompany !== 'unknown') Companies.add(tracker.parentCompany) // for debugging specific requests. see test/tests/debugSite.js if (debugRequest && debugRequest.length) { if (debugRequest.includes(tracker.url)) { console.log("UNBLOCKED: ", tracker.url) return } } // tell Chrome to cancel this webrequest return {cancel: true}; } } } /** * HTTPS Everywhere rules * If an upgrade rule is found, request is upgraded from http to https */ if (!thisTab.site) return // Avoid redirect loops if (thisTab.httpsRedirects[requestData.requestId] >= 7) { console.log('HTTPS: cancel https upgrade. redirect limit exceeded for url: \n' + requestData.url) return {redirectUrl: thisTab.downgradeHttpsUpgradeRequest(requestData)} } // Fetch upgrade rule from db return new Promise ((resolve) => { const isMainFrame = requestData.type === 'main_frame' ? true : false if (https.isReady) { https.pipeRequestUrl(requestData.url, thisTab, isMainFrame).then( (url) => { if (url !== requestData.url.toLowerCase()) { console.log('HTTPS: upgrade request url to ' + url) if (isMainFrame) thisTab.upgradedHttps = true thisTab.addHttpsUpgradeRequest(url) resolve({redirectUrl: url}) } resolve() } ) } else { resolve() } })
<<<<<<< win.error('An error occured while trying to get subtitles', err); ======= title = $.trim(torrent.name.replace('[rartv]', '').replace('[PublicHD]', '').replace('[ettv]', '').replace('[eztv]', '')).replace(/[\s]/g, '.'); sub_data.filename = title; win.error('An error occured while trying to get metadata and subtitles', err); >>>>>>> win.error('An error occured while trying to get metadata and subtitles', err);
<<<<<<< var trackerByParentCompany = checkTrackersWithParentCompany(blockSettings, trackerURL, currLocation); ======= // block trackers by parent company var trackerByParentCompany = checkTrackersWithParentCompany(blockSettings, host, currLocation); >>>>>>> // block trackers by parent company var trackerByParentCompany = checkTrackersWithParentCompany(blockSettings, trackerURL, currLocation); <<<<<<< function checkTrackersWithParentCompany(blockSettings, url, currLocation) { ======= function checkEasylists(url, currLocation, host, request){ let easylistBlock; settings.getSetting('easylists').some((listName) => { // lists can take a second or two to load so check that the parsed data exists if (easylists.loaded) { easylistBlock = abp.matches(easylists[listName].parsed, url, { domain: currLocation, elementTypeMaskMap: abp.elementTypes[request.type.toUpperCase()] }); } // break loop early if a list matches if(easylistBlock){ return easylistBlock = {parentCompany: "unknown", url: host, type: listName}; } }); return easylistBlock; } function checkTrackersWithParentCompany(blockSettings, host, currLocation) { >>>>>>> function checkEasylists(url, currLocation, host, request){ let easylistBlock; settings.getSetting('easylists').some((listName) => { // lists can take a second or two to load so check that the parsed data exists if (easylists.loaded) { easylistBlock = abp.matches(easylists[listName].parsed, url, { domain: currLocation, elementTypeMaskMap: abp.elementTypes[request.type.toUpperCase()] }); } // break loop early if a list matches if(easylistBlock){ return easylistBlock = {parentCompany: "unknown", url: host, type: listName}; } }); return easylistBlock; } function checkTrackersWithParentCompany(blockSettings, url, currLocation) {
<<<<<<< /* load all the things ! */ var Q = require ('q'); var fs = require('fs'); function loadLocalProviders() { var appPath = ''; var providerPath = './src/app/lib/providers/'; var files = fs.readdirSync(providerPath); return files.map (function (file) { if (! file.match(/\.js$/)) return null; if (file.match(/generic.js$/)) return null; console.log ('loading local provider', file); var q = Q.defer(); var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'lib/providers/' + file; script.onload = function () { console.log ('loaded', file) q.resolve(file); }; head.appendChild(script); return q.promise; }).filter (function (q) { return q}); } function loadNpmProviders() { var config = require('../../package.json') var packages = Object.keys(config.dependencies).filter(function (p) { return p.match(/butter-provider-/) }) return packages.map(function(p) { console.log ('loading npm provider', p); var provider = require(p) return Q(App.Providers.install(provider)) }) } function loadProviders() { return loadLocalProviders().concat(loadNpmProviders()) } App.bootstrapPromise = Q.all(loadProviders()) .then(function (values) { return _.keys(App.ProviderTypes).map(function (p) { return App.Config.getProvider(p); }); }) .then(function (provider) { console.log ('loaded', provider) }) ======= /* load all the things ! */ var Q = require ('q'); var fs = require('fs'); function loadProviders() { var appPath = ''; var providerPath = './src/app/lib/providers/'; var files = fs.readdirSync(providerPath); return files.map (function (file) { if (! file.match(/\.js$/)) return null; if (file.match(/generic.js$/)) return null; console.log ('loading', file); var q = Q.defer(); var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'lib/providers/' + file; script.onload = function () { console.log ('loaded', file) q.resolve(file); }; head.appendChild(script); return q.promise; }).filter (function (q) { return q}); } var deferred = loadProviders(); App.bootstrapPromise = Q.all(deferred) .then(function (values) { return _.keys(App.ProviderTypes).map(function (p) { return App.Config.getProvider(p); }); }) .then(function (providers) { console.log ('loaded', providers) }) >>>>>>> /* load all the things ! */ var Q = require ('q'); var fs = require('fs'); function loadLocalProviders() { var appPath = ''; var providerPath = './src/app/lib/providers/'; var files = fs.readdirSync(providerPath); return files.map (function (file) { if (! file.match(/\.js$/)) return null; if (file.match(/generic.js$/)) return null; console.log ('loading local provider', file); var q = Q.defer(); var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'lib/providers/' + file; script.onload = function () { console.log ('loaded', file) q.resolve(file); }; head.appendChild(script); return q.promise; }).filter (function (q) { return q}); } function loadNpmProviders() { var config = require('../../package.json') var packages = Object.keys(config.dependencies).filter(function (p) { return p.match(/butter-provider-/) }) return packages.map(function(p) { console.log ('loading npm provider', p); var provider = require(p) return Q(App.Providers.install(provider)) }) } function loadProviders() { return loadLocalProviders().concat(loadNpmProviders()) } App.bootstrapPromise = Q.all(loadProviders()) .then(function (values) { return _.keys(App.ProviderTypes).map(function (p) { return App.Config.getProvider(p); }); }) .then(function (providers) { console.log ('loaded', providers) })