code
stringlengths
122
4.99k
label
int64
0
14
diff --git a/plugins/downloader/back.js b/plugins/downloader/back.js @@ -49,13 +49,14 @@ function handle(win) { ipcMain.on("add-metadata", async (event, filePath, songBuffer, currentMetadata) => { let fileBuffer = songBuffer; - - if (currentMetadata.imageSrc) { + let songMetadata; + if (currentMetadata.imageSrc) { // means metadata come from ytpl.getInfo(); currentMetadata.image = cropMaxWidth(await getImage(currentMetadata.imageSrc)); + songMetadata = { ...currentMetadata }; + } else { + songMetadata = { ...metadata, ...currentMetadata }; } - const songMetadata = { ...metadata, ...currentMetadata }; - try { const coverBuffer = songMetadata.image ? songMetadata.image.toPNG() : null; const writer = new ID3Writer(songBuffer);
4
diff --git a/components/section.js b/components/section.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types' import Container from './container' -const Section = ({title, subtitle, children, background}) => ( - <section className={`section section-${background}`}> +const Section = ({title, subtitle, children, style, background}) => ( + <section style={style} className={`section section-${background}`}> <Container> {title && <h2 className='section__title'>{title}</h2>} {subtitle && <p className='section__subtitle'>{subtitle}</p>} @@ -17,6 +17,7 @@ Section.propTypes = { title: PropTypes.string, subtitle: PropTypes.string, children: PropTypes.node, + style: PropTypes.object, background: PropTypes.oneOf([ 'white', 'grey', @@ -29,6 +30,7 @@ Section.defaultProps = { title: null, subtitle: null, children: null, + style: null, background: 'white' }
0
diff --git a/examples/material-UI-components/README.md b/examples/material-UI-components/README.md @@ -2,5 +2,5 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo You can: -- [Open this example in a new CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/material-ui-components) +- [Open this example in a new CodeSandbox](https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/material-UI-components) - `yarn` and `yarn start` to run and edit the example
1
diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js @@ -296,11 +296,20 @@ export default class ServerlessOffline { const { http, httpApi, schedule, websocket } = event if ((http || httpApi) && functionDefinition.handler) { - httpEvents.push({ + const httpEvent = { functionKey, handler: functionDefinition.handler, - http: http || { ...httpApi, isHttpApi: true }, - }) + http: http || httpApi, + } + // this is here to allow rawHttpEventDefinition to be a string + // the problem is that events defined as + // httpApi: '*' + // will not have the isHttpApi flag set. This will need to be addressed + // when adding support for HttpApi 2.0 payload types. + if (httpApi && typeof httpApi === 'object') { + httpEvent.http = { ...httpApi, isHttpApi: true } + } + httpEvents.push(httpEvent) } if (schedule) {
0
diff --git a/README.md b/README.md @@ -415,7 +415,7 @@ Supported customizable components: * `TableToolbarSelect` * `Tooltip` -For more information, please see this [example](https://github.com/gregnb/mui-datatables/examples/custom-components/index.js). Additionally, all examples can be viewed [live](https://codesandbox.io/s/github/gregnb/mui-datatables) at our CodeSandbox. +For more information, please see this [example](https://github.com/gregnb/mui-datatables/blob/master/examples/custom-components/index.js). Additionally, all examples can be viewed [live](https://codesandbox.io/s/github/gregnb/mui-datatables) at our CodeSandbox. ## Remote Data
3
diff --git a/_pages/conference.html b/_pages/conference.html @@ -31,7 +31,6 @@ permalink: /conference <h1> <a id="conf-title-href" nohref></a> <span id="twitter-box"></span> - <iframe src="https://ghbtns.com/github-btn.html?user={{ site.github_username }}&repo={{ site.github_repo }}&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe> </h1> </div> <div class="meta deadline col-xs-12">
2
diff --git a/public/resources/ts/calculate-player-stats.ts b/public/resources/ts/calculate-player-stats.ts @@ -46,16 +46,6 @@ export function getPlayerStats() { } } - // Held item stats - if (items.highest_rarity_sword) { - const bonusStats: ItemStats = helper.getStatsFromItem(items.highest_rarity_sword as unknown as Item); - - for (const [name, value] of Object.entries(bonusStats)) { - stats[name].held_item ??= 0; - stats[name].held_item += value; - } - } - // Active accessories stats for (const item of items.accessories.filter((item) => !(item as Item).isInactive)) { const bonusStats: ItemStats = helper.getStatsFromItem(item as Item);
8
diff --git a/articles/libraries/lock-ios/v1/touchid-authentication.md b/articles/libraries/lock-ios/v1/touchid-authentication.md @@ -3,11 +3,14 @@ section: libraries toc_title: Touch ID Authentication description: How to implement Touch ID authentication with Lock iOS. --- - # Lock iOS: Touch ID Authentication <%= include('../_includes/_lock-version-1') %> +::: warning +This feature is disabled for new tenants as of June 8th 2017. Any tenant created after that date won't have the necessary legacy [grant types](/clients/client-grant-types to use Touch ID. This document is offered as reference for older implementations. +::: + Lock provides passwordless authentication with TouchID for your Auth0 DB connection. To start authenticating your users with TouchID please follow those steps: 1. Add `TouchID` subspec module of **Lock** to your `Podfile` @@ -19,7 +22,9 @@ Lock provides passwordless authentication with TouchID for your Auth0 DB connect ```objc #import <Lock/Lock.h> ``` - > If your are coding in Swift, you need to import the header in your app's [Bridging Header](https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html) + ::: note + If your are coding in Swift, you need to import the header in your app's [Bridging Header](https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html). + ::: 1. Instantiate `A0TouchIDLockViewController` and register authentication callback ```objc @@ -55,8 +60,10 @@ Lock provides passwordless authentication with TouchID for your Auth0 DB connect } self.presentViewController(navController, animated: true, completion:nil) ``` - > It's mandatory to present `A0TouchIDLockViewController` embedded in a `UINavigationController`. + ::: note + It's mandatory to present `A0TouchIDLockViewController` embedded in a `UINavigationController`. + ::: -And you'll see TouchID login screen +And you'll see TouchID login screen. ![Lock Screenshot](/media/articles/libraries/lock-ios/Lock-TouchID-Screenshot.png)
0
diff --git a/test/common.js b/test/common.js -/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow*/ +/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow, jasmine*/ /* eslint no-unused-vars: "off" */ unexpected = typeof weknowhow === 'undefined' ? require('../lib/').clone() : @@ -34,3 +34,7 @@ if (typeof setImmediate !== 'function') { setTimeout(cb, 0); }; } + +if (typeof jasmine !== 'undefined') { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; +}
12
diff --git a/source/foundation/RunLoop.js b/source/foundation/RunLoop.js -/*global document, setTimeout, clearTimeout, console, window */ +/*global document, setTimeout, clearTimeout, requestAnimationFrame, + console, window */ import { Heap } from './Heap.js'; @@ -10,24 +11,6 @@ const setImmediate = return setTimeout(fn, 0); }; -const requestAnimFrame = - win.requestAnimationFrame || - win.oRequestAnimationFrame || - win.webkitRequestAnimationFrame || - win.mozRequestAnimationFrame || - win.msRequestAnimationFrame || - (function () { - let lastTime = 0; - return function (callback) { - const time = Date.now(); - const timeToNextCall = Math.max(0, 16 - (time - lastTime)); - lastTime = time; - win.setTimeout(() => { - callback(time + timeToNextCall); - }, timeToNextCall); - }; - })(); - const Timeout = function (time, period, fn, bind, doNotSchedule) { this.time = time; this.period = period; @@ -207,7 +190,7 @@ const flushAllQueues = function () { // redraw the tab name, favicon etc. if (i > 2 && !mayRedraw && !document.hidden) { if (!queues.nextFrame.length) { - requestAnimFrame(nextFrame); + requestAnimationFrame(nextFrame); } return; } @@ -351,7 +334,7 @@ const invokeInNextEventLoop = function (fn, bind, allowDups) { */ const invokeInNextFrame = function (fn, bind, allowDups) { if (!_queues.nextFrame.length) { - requestAnimFrame(nextFrame); + requestAnimationFrame(nextFrame); } return queueFn('nextFrame', fn, bind, allowDups); };
2
diff --git a/js/unix_formatting.js b/js/unix_formatting.js var new_position = settings.position; var position = new_position; var result; - input = input.replace(/\r\n\x1b\[1A/g, ''); + var ansi_re = /(\x1B\[[0-9;]*[A-Za-z])/g; + var cursor_re = /(.*)\r?\n\x1b\[1A\x1b\[([0-9]+)C/g; + // move up and right we need to delete what's after in previous line + input = input.replace(cursor_re, function(_, line, n) { + n = parseInt(n, 10); + var parts = line.split(ansi_re).filter(Boolean); + var result = []; + for (var i = 0; i < parts.length; ++i) { + if (parts[i].match(ansi_re)) { + result.push(parts[i]); + } else { + var len = parts[i].length; + if (len >= n) { + result.push(parts[i].substring(0, n)); + break; + } else { + result.push(parts[i]); + } + n -= len; + } + } + return result.join(''); + }); + // move right is just repate space input = input.replace(/\x1b\[([0-9]+)C/g, function(_, num) { return new Array(+num + 1).join(' '); }); - var splitted = input.split(/(\x1B\[[0-9;]*[A-Za-z])/g); + var splitted = input.split(ansi_re); if (splitted.length === 1) { if (settings.unixFormattingEscapeBrackets) { result = $.terminal.escape_formatting(input);
9
diff --git a/src/article/converter/r2t/jats2internal.js b/src/article/converter/r2t/jats2internal.js @@ -223,7 +223,7 @@ function _populateAwards (doc, jats) { function _populateArticleRecord (doc, jats, jatsImporter) { let articleMetaEl = jats.find('article > front > article-meta') let articleRecord = doc.get('article-record') - articleRecord.assign({ + Object.assign(articleRecord, { elocationId: getText(articleMetaEl, 'elocation-id'), fpage: getText(articleMetaEl, 'fpage'), lpage: getText(articleMetaEl, 'lpage'), @@ -233,7 +233,7 @@ function _populateArticleRecord (doc, jats, jatsImporter) { }) let issueTitleEl = findChild(articleMetaEl, 'issue-title') if (issueTitleEl) { - articleRecord.set('issue-title', jatsImporter.annotatedText(issueTitleEl, [articleRecord.id, 'issue-title'])) + articleRecord['issue-title'] = jatsImporter.annotatedText(issueTitleEl, [articleRecord.id, 'issue-title']) } // Import permission if present const permissionsEl = articleMetaEl.find('permissions') @@ -243,9 +243,7 @@ function _populateArticleRecord (doc, jats, jatsImporter) { let permission = jatsImporter.convertElement(permissionsEl) // ATTENTION: so that the document model is correct we need to use // the Document API to set the permission id - articleRecord.assign({ - permission: permission.id - }) + articleRecord.permission = permission.id } const articleDateEls = articleMetaEl.findAll('history > date, pub-date') @@ -255,7 +253,7 @@ function _populateArticleRecord (doc, jats, jatsImporter) { const date = _extractDate(dateEl) dates[date.type] = date.value }) - articleRecord.assign(dates) + Object.assign(articleRecord, dates) } } @@ -317,7 +315,7 @@ function _populateTitle (doc, jats, jatsImporter) { let title = doc.get('title') let titleEl = jats.find('article > front > article-meta > title-group > article-title') if (titleEl) { - doc.set(title.getPath(), jatsImporter.annotatedText(titleEl, title.getPath())) + title.content = jatsImporter.annotatedText(titleEl, title.getPath()) } // translations let titleTranslations = jats.findAll('article > front > article-meta > title-group > trans-title-group > trans-title') @@ -325,16 +323,15 @@ function _populateTitle (doc, jats, jatsImporter) { let group = transTitleEl.parentNode let language = group.attr('xml:lang') let translation = doc.create({ type: 'text-translation', id: transTitleEl.id, language }) - doc.set(translation.getPath(), jatsImporter.annotatedText(transTitleEl, translation.getPath())) + translation.content = jatsImporter.annotatedText(transTitleEl, translation.getPath()) return translation.id }) - title.assign({ - translations: translationIds - }) + title.translations = translationIds } function _populateAbstract (doc, jats, jatsImporter) { let $$ = jats.createElement.bind(jats) + let abstract = doc.get('abstract') // ATTENTION: JATS can have multiple abstracts // ATM we only take the first, loosing the others let abstractEls = jats.findAll('article > front > article-meta > abstract') @@ -347,7 +344,6 @@ function _populateAbstract (doc, jats, jatsImporter) { if (abstractEl.getChildCount() === 0) { abstractEl.append($$('p')) } - let abstract = doc.get('abstract') abstractEl.children.forEach(el => { abstract.append(jatsImporter.convertElement(el)) }) @@ -367,7 +363,7 @@ function _populateAbstract (doc, jats, jatsImporter) { }) return translation.id }) - doc.set(['abstract', 'translations'], translationIds) + abstract.translations = translationIds } function _populateBody (doc, jats, jatsImporter) {
4
diff --git a/contribs/gmf/less/desktoplayertree.less b/contribs/gmf/less/desktoplayertree.less @@ -94,10 +94,6 @@ gmf-layertree { display: none; } - .gmf-layertree-name { - white-space: nowrap; - } - // leave space for the drag handle .gmf-layertree-depth-1 a.gmf-layertree-expand-node.fa { margin-left: @half-app-margin;
11
diff --git a/packages/docs/docs/docs/writing_contracts.md b/packages/docs/docs/docs/writing_contracts.md @@ -168,16 +168,16 @@ $ TOKEN=$(zos create TokenContract) $ zos create MyContract --init --args $TOKEN ``` -An advanced alternative, if you need to create upgradeable contracts on the fly, is to keep an instance of your ZeppelinOS `App` in your contracts. The [`App`](api_application_BaseApp.md) is a contract that acts as the entrypoint for your ZeppelinOS project, which has references to your logic implementations, and can create new contract instances: +An advanced alternative, if you need to create upgradeable contracts on the fly, is to keep an instance of your ZeppelinOS `App` in your contracts. The [`App`](api_application_App.md) is a contract that acts as the entrypoint for your ZeppelinOS project, which has references to your logic implementations, and can create new contract instances: ```solidity import "zos-lib/contracts/Initializable.sol"; -import "zos-lib/contracts/application/BaseApp.sol"; +import "zos-lib/contracts/application/App.sol"; contract MyContract is Initializable { - BaseApp private app; + App private app; - function initialize(BaseApp _app) initializer public { + function initialize(App _app) initializer public { app = _app; }
14
diff --git a/src/renderer/page/subscriptions/view.jsx b/src/renderer/page/subscriptions/view.jsx @@ -78,6 +78,7 @@ export default class extends React.PureComponent<Props> { return ( <Page notContained loading={isFetchingSubscriptions}> + <HiddenNsfwClaims uris={subscriptionUris} /> {!subscriptions.length && ( <div className="page__empty"> {__("It looks like you aren't subscribed to any channels yet.")} @@ -87,7 +88,6 @@ export default class extends React.PureComponent<Props> { </div> )} {!!claimList.length && <FileList hideFilter sortByHeight fileInfos={claimList} />} - <HiddenNsfwClaims uris={subscriptionUris} /> </Page> ); }
5
diff --git a/_projects/it/pagopa.md b/_projects/it/pagopa.md @@ -37,4 +37,4 @@ Stiamo lavorando ad una revisione profonda della documentazione. Per ora, siamo - [Architettura](https://pagopa-doc-architettura.readthedocs.io/) - [Formato Messaggi XML](http://pagopa-docs-formatoxml.readthedocs.io/) - [Specifiche Attuative Pagamenti](https://pagopa-doc-specattuative.readthedocs.io/) -- [Specifiche Implementazione Web Services](https://pagopa-doc-specws.readthedocs.io/) (in arrivo) +- [Specifiche Implementazione Web Services](https://pagopa-doc-specws.readthedocs.io/)
1
diff --git a/token-metadata/0xc3dD23A0a854b4f9aE80670f528094E9Eb607CCb/metadata.json b/token-metadata/0xc3dD23A0a854b4f9aE80670f528094E9Eb607CCb/metadata.json "symbol": "TRND", "address": "0xc3dD23A0a854b4f9aE80670f528094E9Eb607CCb", "decimals": 18, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/character-controller.js b/character-controller.js @@ -56,6 +56,16 @@ class Player extends THREE.Object3D { this.grabs = [null, null]; this.wears = []; this.actions = []; + + this.actionInterpolants = { + crouch: new BiActionInterpolant(() => this.hasAction('crouch'), 0, crouchMaxTime), + }; + } + getAction(type) { + return this.actions.find(action => action.type === type); + } + hasAction(type) { + return this.actions.some(action => action.type === type); } } class LocalPlayer extends Player {
0
diff --git a/docs/_api-mocking/mock.md b/docs/_api-mocking/mock.md @@ -28,27 +28,32 @@ parameters: - Object content: More options to configure matching and responding behaviour content_markdown: |- + Alternatively a single parameter, `options`, an Object with `matcher`, `response` and other options defined, can be passed in. For complex matching (e.g. matching on headers in addition to url), there are 4 patterns to choose from: 1. Use an object as the first argument, e.g. - ```javascript + ```js + fetchMock .mock({url, headers}, response) ``` This has the advantage of keeping all the matching criteria in one place. 2. Pass in options in a third parameter e.g. - ```javascript + ```js + fetchMock .mock(url, response, {headers}) ``` This splits matching criteria between two parameters, which is arguably harder to read. However, if most of your tests only match on url, then this provides a convenient way to create a variant of an existing test. 3. Use a single object, e.g. - ```javascript + ```js + fetchMock .mock({url, response, headers}) ``` Nothing wrong with doing this, but keeping response configuration in a separate argument to the matcher config feels like a good split. 4. Use a function matcher e.g. - ```javascript + ```js + fetchMock .mock((url, options) => { // write your own logic }, response)
7
diff --git a/test/integration/offline.js b/test/integration/offline.js @@ -327,6 +327,26 @@ describe('Offline', () => { }).toObject(); done(); }); + + it('should return correctly set multiple set-cookie headers', done => { + const offline = new OfflineBuilder() + .addFunctionHTTP('fn1', { + path: 'fn1', + method: 'GET', + }, (event, context, cb) => cb(null, { + statusCode: 200, + headers: { 'set-cookie': 'foo=bar', 'set-COOKIE': 'floo=baz' }, + })).toObject(); + + offline.inject({ + method: 'GET', + url: '/fn1', + }, res => { + expect(res.headers).to.have.property('set-cookie').which.contains('foo=bar'); + expect(res.headers).to.have.property('set-cookie').which.contains('floo=baz'); + done(); + }); + }); }); context('with the stageVariables plugin', () => {
0
diff --git a/assets/js/components/ViewOnlyMenu/index.js b/assets/js/components/ViewOnlyMenu/index.js /** * External dependencies */ -import classnames from 'classnames'; import { useClickAway } from 'react-use'; /** @@ -56,20 +55,10 @@ export default function ViewOnlyMenu() { return ( <div ref={ menuWrapperRef } - className={ classnames( - 'googlesitekit-view-only-menu', - 'googlesitekit-dropdown-menu', - 'googlesitekit-dropdown-menu__icon-menu', - 'mdc-menu-surface--anchor' - ) } + className="googlesitekit-view-only-menu googlesitekit-dropdown-menu googlesitekit-dropdown-menu__icon-menu mdc-menu-surface--anchor" > <Button - className={ classnames( - 'googlesitekit-header__dropdown', - 'mdc-button--dropdown', - 'googlesitekit-border-radius-round--phone', - 'googlesitekit-button-icon' - ) } + className="googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--phone googlesitekit-button-icon" text onClick={ toggleMenu } icon={
2
diff --git a/src/components/CurrencySymbolButton.js b/src/components/CurrencySymbolButton.js @@ -18,7 +18,7 @@ const propTypes = { function CurrencySymbolButton(props) { return ( - <Tooltip text={props.translate('common.currency')}> + <Tooltip text={props.translate('iOUCurrencySelection.selectCurrency')}> <TouchableOpacity onPress={props.onCurrencyButtonPress}> <Text style={styles.iouAmountText}>{props.currencySymbol}</Text> </TouchableOpacity>
4
diff --git a/token-metadata/0x9F599410D207f3D2828a8712e5e543AC2E040382/metadata.json b/token-metadata/0x9F599410D207f3D2828a8712e5e543AC2E040382/metadata.json "symbol": "TTT", "address": "0x9F599410D207f3D2828a8712e5e543AC2E040382", "decimals": 18, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/app/mixins/cattle-transitioning-resource.js b/app/mixins/cattle-transitioning-resource.js @@ -370,12 +370,10 @@ export default Ember.Mixin.create({ if ( field.nullable ) { val = null; - if ( val !== null ) { this.set(key, val); } } } - } var len = (val ? Ember.get(val,'length') : 0);
2
diff --git a/lambda/import/index.js b/lambda/import/index.js @@ -60,7 +60,9 @@ exports.step=function(event,context,cb){ if (timestamp === "") { // only metrics and feedback items have datetime field.. This must be a qna item. obj.type=obj.type || 'qna' + if(obj.type != 'slottype') { obj.q = obj.q.map(x=>{ x = x.replace(/\\*"/g,''); return x}); + } if(obj.type==='qna'){ try {
3
diff --git a/tasks/test_syntax.js b/tasks/test_syntax.js @@ -154,6 +154,7 @@ function combineGlobs(arr) { function log(name, logs) { if(logs.length) { console.error('test-syntax error [' + name + ']'); + console.error(logs.join('\n')); EXIT_CODE = 1; } else { console.log('ok ' + name);
7
diff --git a/token-metadata/0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44/metadata.json b/token-metadata/0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44/metadata.json "symbol": "KP3R", "address": "0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44", "decimals": 18, - "dharmaVerificationStatus": "UNVERIFIED" + "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file
3
diff --git a/refs/csswg.json b/refs/csswg.json "rawDate": "2015-10", "href": "http://www.itu.int/rec/R-REC-BT.2020/en" }, - "UAX44": { - "source": "http://dev.w3.org/csswg/biblio.ref", - "authors": [ - "Mark Davis", - "Ken Whistler" - ], - "title": "Unicode Character Database", - "rawDate": "2013-09-25", - "href": "http://www.unicode.org/reports/tr44/" - }, - "UNICODE6": { - "source": "http://dev.w3.org/csswg/biblio.ref", - "authors": [ - "The Unicode Consortium" - ], - "title": "The Unicode Standard, Version 6.2.0", - "href": "http://www.unicode.org/versions/Unicode6.2.0/" - }, - "UTN22": { - "source": "http://dev.w3.org/csswg/biblio.ref", - "authors": [ - "Elika J. Etemad" - ], - "title": "Robust Vertical Text Layout", - "rawDate": "2005-04-25", - "href": "http://unicode.org/notes/tn22/" - }, - "UTR50": { - "source": "http://dev.w3.org/csswg/biblio.ref", - "title": "Unicode Properties for Vertical Text Layout", - "authors": [ - "Koji Ishii" - ], - "rawDate": "2013-08-31", - "href": "http://www.unicode.org/reports/tr50/" - }, "WINDOWS-GLYPH-PROC": { "source": "http://dev.w3.org/csswg/biblio.ref", "title": "Windows Glyph Processing",
5
diff --git a/lib/global-admin/addon/components/cluster-row/template.hbs b/lib/global-admin/addon/components/cluster-row/template.hbs {{cluster-template-revision-upgrade-notification cluster=model}} </td> <td data-title="{{dt.provider}}"> - {{#if (or model.k3sConfig.kubernetesVersion model.version.gitVersion)}} + {{#if model.version.gitVersion}} <small>{{model.displayProvider}}</small> - <p class="text-small text-muted m-0">{{or model.k3sConfig.kubernetesVersion model.version.gitVersion}}</p> + <p class="text-small text-muted m-0">{{model.version.gitVersion}}</p> {{else}} <small>{{model.displayProvider}}</small> {{/if}}
13
diff --git a/package.json b/package.json { "name": "nativescript-doctor", - "version": "0.7.0", + "version": "0.8.0", "description": "Library that helps identifying if the environment can be used for development of {N} apps.", "main": "lib/index.js", "types": "./typings/nativescript-doctor.d.ts",
12
diff --git a/articles/api-auth/tutorials/adoption/oidc-conformant.md b/articles/api-auth/tutorials/adoption/oidc-conformant.md @@ -27,7 +27,6 @@ Enabling this flag on a client will have the following effects: * The `device` parameter, originally used to obtain refresh tokens, is now considered invalid. * The legacy [resource owner endpoint](/api/authentication#database-ad-ldap-active-) is disabled. - Passwordless authentication for embedded login is implemented at this endpoint, so it will be disabled as well. - Support for OIDC-conformant passwordless authentication will be added in future releases. * The [/oauth/access_token endpoint](/api/authentication#post-oauth-access_token), used for social authentication from native mobile applications, is disabled. An OIDC-conformant alternative will be added in future releases. * The [`scope` parameter of authentication requests](/api-auth/tutorials/adoption/scope-custom-claims) will comply to the OIDC specification:
2
diff --git a/token-metadata/0xdB2F2bCCe3efa95EDA95a233aF45F3e0d4f00e2A/metadata.json b/token-metadata/0xdB2F2bCCe3efa95EDA95a233aF45F3e0d4f00e2A/metadata.json "symbol": "AGS", "address": "0xdB2F2bCCe3efa95EDA95a233aF45F3e0d4f00e2A", "decimals": 8, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/token-metadata/0x13c2B7F851E756415cF7d51d04dcF4F94A5b382E/metadata.json b/token-metadata/0x13c2B7F851E756415cF7d51d04dcF4F94A5b382E/metadata.json "symbol": "CTT", "address": "0x13c2B7F851E756415cF7d51d04dcF4F94A5b382E", "decimals": 18, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/assets/js/modules/adsense/components/dashboard/AdSenseDashboardWidget.js b/assets/js/modules/adsense/components/dashboard/AdSenseDashboardWidget.js @@ -37,7 +37,6 @@ import Alert from '../../../../components/alert'; import DashboardAdSenseTopPages from './DashboardAdSenseTopPages'; import getNoDataComponent from '../../../../components/notifications/nodata'; import getDataErrorComponent from '../../../../components/notifications/data-error'; -import ProgressBar from '../../../../components/progress-bar'; import ModuleSettingsWarning from '../../../../components/notifications/module-settings-warning'; import { getModulesData } from '../../../../util'; import HelpLink from '../../../../components/help-link'; @@ -58,7 +57,6 @@ class AdSenseDashboardWidget extends Component { this.state = { receivingData: true, error: false, - loading: true, zeroData: false, }; this.handleDataError = this.handleDataError.bind( this ); @@ -84,7 +82,6 @@ class AdSenseDashboardWidget extends Component { receivingData: false, error, errorObj, - loading: false, } ); } @@ -94,7 +91,6 @@ class AdSenseDashboardWidget extends Component { handleDataSuccess() { this.setState( { receivingData: true, - loading: false, } ); } @@ -104,7 +100,6 @@ class AdSenseDashboardWidget extends Component { handleZeroData() { this.setState( { zeroData: true, - loading: false, } ); } @@ -167,7 +162,6 @@ class AdSenseDashboardWidget extends Component { status={ moduleStatus } statusText={ moduleStatusText } /> - { loading && <ProgressBar /> } </div> { /* Data issue: on error display a notification. On missing data: display a CTA. */ } { zeroData &&
2
diff --git a/vis/js/components/Highlight.js b/vis/js/components/Highlight.js @@ -42,19 +42,12 @@ const Highlight = ({ return text; } - let queryWords = queryTerms; + let queryWords = queryTerms.map((term) => escapeRegExp(term)); if (hyphenated) { - queryWords = queryTerms.map((term) => hyphenateString(term)); + queryWords = queryTerms.map((term) => hyphenateStringSafely(term)); } - queryWords = queryWords.map( - (term) => - // this piece is copied from the legacy code - new RegExp( - "\\b(" + term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + ")\\b", - "gi" - ) - ); + queryWords = queryWords.map((term) => new RegExp(`\\b(${term})\\b`, "gi")); return ( <ExternalHighlighter @@ -86,7 +79,3 @@ const hyphenateStringSafely = (string) => { .map((char) => escapeRegExp(char)) .join("[\\u00AD]*"); }; - -const hyphenateString = (string) => { - return string.split("").join("[\\u00AD]*"); -};
1
diff --git a/src/math/matrix2.js b/src/math/matrix2.js * @memberOf me * @constructor * @param {me.Matrix2d} [mat2d] An instance of me.Matrix2d to copy from - * @param {Number[]} [arguments...] Matrix elements. See {@link me.Matrix2d.set} + * @param {Number[]} [arguments...] Matrix elements. See {@link me.Matrix2d.setTransform} */ me.Matrix2d = me.Object.extend({ /**
1
diff --git a/articles/libraries/lock/v11/api.md b/articles/libraries/lock/v11/api.md @@ -261,7 +261,7 @@ var Auth = (function() { ## resumeAuth() -If you set the [auth.autoParseHash](/libraries/lock/v11/configuration#autoparsehash-boolean-) option to `false`, you'll need to call this method to complete the authentication flow. This method is useful when you're using a client-side router that uses a `#` to handle urls (angular2 with `useHash`, or react-router with `hashHistory`). +This method can only be used when you set the [auth.autoParseHash](/libraries/lock/v11/configuration#autoparsehash-boolean-) option to `false`. You'll need to call `resumeAuth` to complete the authentication flow. This method is useful when you're using a client-side router that uses a `#` to handle urls (angular2 with `useHash`, or react-router with `hashHistory`). - **hash** {String}: The hash fragment received from the redirect. - **callback** {Function}: Will be invoked after the parse is done. Has an error (if any) as the first argument and the authentication result as the second one. If there is no hash available, both arguments will be `null`.
7
diff --git a/src/directives/formBuilder.js b/src/directives/formBuilder.js @@ -221,7 +221,7 @@ module.exports = ['debounce', function(debounce) { } } )); - }); + }, true); }); }); }
11
diff --git a/src/settings/MessageManager.js b/src/settings/MessageManager.js @@ -160,12 +160,12 @@ class MessaageManager { } async sendFileToAuthor(message, file, fileName, deleteCall) { - const msg = await message.author.send('', { file: { attachment: file, name: fileName } }); + const msg = await message.author.send('', { files: [{ attachment: file, name: fileName }] }); return this.deleteCallAndResponse(message, msg, deleteCall, false); } async sendFile(message, prepend, file, fileName, deleteCall) { - const msg = await message.channel.send(prepend || '', { file: { attachment: file, name: fileName } }); + const msg = await message.channel.send(prepend || '', { files: [{ attachment: file, name: fileName }] }); return this.deleteCallAndResponse(message, msg, deleteCall, false); }
2
diff --git a/src/consts/const_global.js b/src/consts/const_global.js @@ -244,7 +244,7 @@ consts.SETTINGS = { NODE: { - VERSION: "1.196", + VERSION: "1.197", VERSION_COMPATIBILITY: "1.174", VERSION_COMPATIBILITY_POOL_MINERS: "1.174",
13
diff --git a/core/algorithm-builder/environments/nodejs/wrapper/package.json b/core/algorithm-builder/environments/nodejs/wrapper/package.json "author": "", "license": "ISC", "dependencies": { - "@hkube/nodejs-wrapper": "^2.0.14" + "@hkube/nodejs-wrapper": "^2.0.15" }, "devDependencies": {} } \ No newline at end of file
3
diff --git a/articles/tokens/jwks.md b/articles/tokens/jwks.md @@ -18,13 +18,10 @@ When creating applications and resources servers (APIs) in Auth0, two algorithms Auth0 uses the [JWK](https://tools.ietf.org/html/rfc7517) specification to represent the cryptographic keys used for signing RS256 tokens. This specification defines two high level data structures: **JSON Web Key (JWK)** and **JSON Web Key Set (JWKS)**. Here are the definitions directly from the specification: -> **JSON Web Key (JWK)** -> -> A JSON object that represents a cryptographic key. The members of the object represent properties of the key, including its value. - -> **JSON Web Key Set (JWKS)** -> -> A JSON object that represents a set of JWKs. The JSON object MUST have a `keys` member, which is an array of JWKs. +| Item | Description | +| - | - | +| **JSON Web Key (JWK)** | A JSON object that represents a cryptographic key. The members of the object represent properties of the key, including its value. | +| **JSON Web Key Set (JWKS)** | A JSON object that represents a set of JWKs. The JSON object MUST have a `keys` member, which is an array of JWKs. | At the most basic level, the JWKS is a set of keys containing the public keys that should be used to verify any JWT issued by the authorization server. Auth0 exposes a JWKS endpoint for each tenant, which is found at `https://${account.namespace}/.well-known/jwks.json`. This endpoint will contain the JWK used to sign all Auth0 issued JWTs for this tenant.
14
diff --git a/website/contents/links.js b/website/contents/links.js @@ -3,5 +3,6 @@ export default { 'deck.gl': 'https://uber.github.io/deck.gl', 'luma.gl': 'https://uber.github.io/luma.gl', 'react-map-gl': 'https://uber.github.io/react-map-gl', - 'react-vis': 'https://uber.github.io/react-vis' + 'react-vis': 'https://uber.github.io/react-vis', + 'vis.gl': 'http://vis.gl' };
0
diff --git a/packages/typescript-imba-plugin/src/lexer/script.imba b/packages/typescript-imba-plugin/src/lexer/script.imba @@ -419,7 +419,7 @@ export default class ImbaScriptInfo flags ~= t.Value flags |= t.VarName - if tok.match("delimiter.type.prefix type") + if tok.match("delimiter.type.prefix type") or group.closest('type') flags = CompletionTypes.Type let kfilter = scope.allowedKeywordTypes
7
diff --git a/components/Discussion/enhancers.js b/components/Discussion/enhancers.js @@ -242,13 +242,14 @@ const upsertComment = (proxy, discussionId, comment, {prepend = false, subscript fragmentName: 'ConnectionNodes' }, true) const existingOptimisticComment = parentConnectionOptimistic.nodes.find(n => n.id === comment.id) + const parentConnection = proxy.readFragment({ id: dataIdFromObject(directParentConnection), fragment: fragments.connectionNodes, fragmentName: 'ConnectionNodes' }) - const existingComment = parentConnection.nodes.find(n => n.id === comment.id) + upsertDebug('existing', !!existingComment, 'optimistic', !!existingOptimisticComment) if (existingComment) { proxy.writeFragment({ @@ -270,7 +271,7 @@ const upsertComment = (proxy, discussionId, comment, {prepend = false, subscript parentConnections.forEach(connection => { const directParent = connection === directParentConnection - const pageInfo = connection.pageInfo + const pageInfo = connection.pageInfo || emptyPageInfo() const data = { ...connection, totalCount: connection.totalCount + 1, @@ -504,7 +505,10 @@ ${fragments.comment} const id = uuid() const parentId = parent ? parent.id : null - debug('submitComment', {discussionId, parentId, content, id}) + const parentIds = parent + ? [parentId].concat(parent.parentIds) + : [] + debug('submitComment', {discussionId, parentIds, content, id}) return mutate({ variables: {discussionId, parentId, id, content}, @@ -521,9 +525,7 @@ ${fragments.comment} displayAuthor: discussionDisplayAuthor, createdAt: (new Date()).toISOString(), updatedAt: (new Date()).toISOString(), - parentIds: parent - ? [parentId].concat(parent.parentIds) - : [], + parentIds, __typename: 'Comment' } },
1
diff --git a/src/data/event.js b/src/data/event.js @@ -57,8 +57,8 @@ export type EventCategory = { contrast: boolean }; -// We use a switch here, rather than a look up so that we can safely state -// that this function will always return an EventCategory. +// We use a switch here, rather than a look up so that we can ensure that +// this function will always return an EventCategory. export const getEventCategoryFromName = ( category: EventCategoryName ): EventCategory => {
0
diff --git a/packages/vue/src/components/molecules/SfGallery/SfGallery.js b/packages/vue/src/components/molecules/SfGallery/SfGallery.js @@ -58,7 +58,7 @@ export default { mounted() { // handle slider with swipe and transitions with Glide.js // https://glidejs.com/docs/ - const glide = new Glide(this.$refs.glide, this.sliderOptions); + const glide = new Glide(this.$refs.glide, {gap: 0, ...this.sliderOptions}); glide.on("run", () => { this.go(glide.index); });
12
diff --git a/game.js b/game.js @@ -18,7 +18,7 @@ import {world} from './world.js'; import {buildMaterial, highlightMaterial, selectMaterial, hoverMaterial, hoverEquipmentMaterial} from './shaders.js'; import {teleportMeshes} from './teleport.js'; import {getRenderer, sceneLowPriority, camera} from './renderer.js'; -import {downloadFile, snapPosition} from './util.js'; +import {downloadFile, snapPosition, handleDrop} from './util.js'; import {maxGrabDistance, throwReleaseTime, storageHost, minFov, maxFov} from './constants.js'; // import easing from './easing.js'; // import {VoicePack} from './voice-pack-voicer.js'; @@ -1398,6 +1398,15 @@ class GameManager extends EventTarget { localPlayer.addAction(crouchAction); } } + async handleDrop(e, index) { + const u = await handleDrop(e.dataTransfer.items[0]); + const app = await metaversefileApi.createAppAsync({ + start_url: u, + }); + world.appManager.importApp(app); + app.activate(); + // XXX set to index + } selectLoadout(index) { loadoutManager.setSelectedIndex(index); }
0
diff --git a/packages/app/src/stores/ui.tsx b/packages/app/src/stores/ui.tsx @@ -408,7 +408,7 @@ export const usePageRenameModalStatus = (status?: RenameModalStatus): SWRRespons export const usePageRenameModalOpened = (): SWRResponse<boolean, Error> => { const { data } = usePageRenameModalStatus(); - return useSWR( + return useSWRImmutable( data != null ? ['isRenameModalOpened', data] : null, () => { return data != null ? data.isOpened : false;
14
diff --git a/components/bases-locales/charte/commune.js b/components/bases-locales/charte/commune.js @@ -6,13 +6,13 @@ import {ExternalLink} from 'react-feather' import theme from '@/styles/theme' import ButtonLink from '@/components/button-link' -function Commune({name, codeCommune, picture, alt, signatureDate, charteURL}) { +function Commune({name, codeCommune, picture, height, width, alt, signatureDate, charteURL}) { const date = new Date(signatureDate).toLocaleDateString('fr-FR', {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}) return ( <div className='commune-container' onClick={event => event.stopPropagation()}> <div className='commune-infos'> - <Image src={picture} height={70} width={56} alt={alt} /> + <Image src={picture} height={height / 2} width={width / 2} alt={alt} /> <Link href={`/commune/${codeCommune}`}>{`${name} - ${codeCommune}`}</Link> </div> <div className='signature-date'>Partenaire depuis le <b>{date}</b></div> @@ -61,6 +61,8 @@ Commune.propTypes = { name: PropTypes.string.isRequired, codeCommune: PropTypes.string.isRequired, picture: PropTypes.string.isRequired, + height: PropTypes.string.isRequired, + width: PropTypes.string.isRequired, alt: PropTypes.string.isRequired, signatureDate: PropTypes.string.isRequired, charteURL: PropTypes.string
0
diff --git a/test-complete/nodejs-optic-from-views.js b/test-complete/nodejs-optic-from-views.js @@ -1033,29 +1033,25 @@ describe('Optic from views test', function(){ }, done); }); - /*it('TEST 33 - different binding types', function(done){ + it('TEST 33 - inner join with accessor plan', function(done){ const plan1 = op.fromView('opticFunctionalTest', 'detail', 'myDetail'); const plan2 = op.fromView('opticFunctionalTest', 'master', 'myMaster'); + const masterIdCol1 = plan1.col('masterId'); + const masterIdCol2 = plan2.col('id'); + const detailIdCol = plan1.col('id'); + const detailNameCol = plan1.col('name'); + const masterNameCol = plan2.col('name'); const output = - plan1.joinInner(plan2, op.on(op.viewCol('myDetail', 'masterId'), op.viewCol('myMaster', 'id')), op.eq(op.viewCol('myDetail', 'name'), op.param({name: 'detailNameVal'}))) - .select([op.viewCol('myMaster', 'id'), op.viewCol('myMaster', 'name'), op.viewCol('myDetail', 'id'), op.viewCol('myDetail', 'name')]) - .orderBy(op.desc(op.viewCol('myDetail', 'name'))) - .offsetLimit(op.param({name: 'start'}), op.param({name: 'length'})) - db.rows.query(output, { - format: 'json', - structure: 'object', - columnTypes: 'header', - complexValues: 'inline', - bindings: { - 'detailNameVal': {value: 'Detail 5', type: 'string'}, - 'start': {value: 1, type: 'integer'}, - 'length': {value: 100, type: 'integer'} - } - }) + plan1.joinInner(plan2) + .where(op.eq(masterIdCol1, masterIdCol2)) + .select([masterIdCol2, masterNameCol, detailIdCol, detailNameCol]) + .orderBy(op.desc(detailNameCol)) + .offsetLimit(1, 3) + db.rows.query(output, { format: 'json', structure: 'object', columnTypes: 'header'}) .then(function(output) { - console.log(JSON.stringify(output, null, 2)); + //console.log(JSON.stringify(output, null, 2)); expect(output.rows.length).to.equal(3); expect(output.rows[0]['myMaster.id']).to.equal(1); expect(output.rows[0]['myMaster.name']).to.equal('Master 1'); @@ -1065,6 +1061,7 @@ describe('Optic from views test', function(){ expect(output.rows[2]['myDetail.name']).to.equal('Detail 3'); done(); }, done); - });*/ + }); + });
0
diff --git a/scenes/block.scn b/scenes/block.scn "start_url": "https://avatar-models.exokit.org/model49.vrm", "dynamic": true }, - { - "position": [ - -26, - 0, - -2 - ], - "quaternion": [ - 0, - 0.7071067811865475, - 0, - 0.7071067811865475 - ], - "start_url": "https://webaverse.github.io/app/public/avatars/scillia.vrm", - "dynamic": true - }, { "position": [ 0,
2
diff --git a/articles/metadata/management-api.md b/articles/metadata/management-api.md --- -description: How to update metadata through the Auth0 Management API and Authentication API. +description: How to retrieve and update metadata through the Auth0 APIs. crews: crew-2 +toc: true --- # Metadata with Auth0 APIs ### Management API -Using Auth0's Management APIv2, you can create a user and set both their `app_metadata` and `user_metadata`. You can also update these two fields. +Using [Auth0's Management APIv2](/api/management/v2), you can create a user and set both their `app_metadata` and `user_metadata`. You can also update these two fields. ::: note The Auth0 Management APIv2 token is required to call the Auth0 Management API. [Click here to learn more about how to get a Management APIv2 Token.](/api/management/v2/tokens) @@ -33,7 +34,7 @@ To create a user with the following profile details: } ``` -you would make the following `POST` call to the Management API to create the user and set the property values: +you would make the following `POST` call to the [Create User endpoint of the Management API](/api/management/v2#!/Users/post_users), to create the user and set the property values: ```har { @@ -61,7 +62,7 @@ you would make the following `POST` call to the Management API to create the use ## Management API: Retrieve User Metadata -To retrieve the user's metadata make a `GET` request to the Management API. +To retrieve a user's metadata make a `GET` request to the [Get User endpoint of the Management API](/api/management/v2#!/Users/get_users_by_id). Assuming you created the user as shown above with the following metadata values: @@ -77,7 +78,7 @@ Assuming you created the user as shown above with the following metadata values: } ``` -Make the following `GET` request to the API: +Make the following `GET` request: ```har { @@ -108,7 +109,7 @@ Make the following `GET` request to the API: } ``` -The response will now appear as follows: +The response will be as follows: ```json { @@ -120,7 +121,7 @@ The response will now appear as follows: ## Management API: Update User Metadata -You can update a user's metadata by making the appropriate `PATCH` call to the Management API. +You can update a user's metadata by making a `PATCH` call to the [Update User endpoint of the Management API](/api/management/v2#!/Users/patch_users_by_id). Assuming you created the user as shown above with the following metadata values: @@ -146,7 +147,7 @@ To update `user_metadata` and add the user's home address as a second-level prop } ``` -you would make the following `PATCH` call to the API: +you would make the following `PATCH` call: ```har {
0
diff --git a/lib/utils/normalize-select.js b/lib/utils/normalize-select.js @@ -11,7 +11,7 @@ export default function normalizeSelect (query) { // The selection of fields for the query is limited // Get the different parts that are listed for selection - const allSelects = Array.isArray(query.select) ? query.select : query.select.split(',') + const allSelects = Array.isArray(query.select) ? query.select : query.select.split(',').map(q => q.trim()) // Move the parts into a set for easy access and deduplication const selectedSet = new Set(allSelects)
8
diff --git a/src/js/player.js b/src/js/player.js @@ -1605,7 +1605,7 @@ class MediaElementPlayer { error = document.createElement('div'), // this needs to come last so it's on top bigPlay = document.createElement('div'), - buffer = controls.querySelector(`.${t.options.classPrefix}time-buffering`) + buffer = () => controls.querySelector(`.${t.options.classPrefix}time-buffering`) ; loading.style.display = 'none'; // start out hidden @@ -1663,31 +1663,31 @@ class MediaElementPlayer { media.addEventListener('play', () => { bigPlay.style.display = 'none'; loading.style.display = 'none'; - if (buffer) { - buffer.style.display = 'none'; + if (buffer() !== null) { + buffer().style.display = 'none'; } error.style.display = 'none'; }); media.addEventListener('playing', () => { bigPlay.style.display = 'none'; loading.style.display = 'none'; - if (buffer) { - buffer.style.display = 'none'; + if (buffer() !== null) { + buffer().style.display = 'none'; } error.style.display = 'none'; }); media.addEventListener('seeking', () => { bigPlay.style.display = 'none'; loading.style.display = ''; - if (buffer) { - buffer.style.display = ''; + if (buffer() !== null) { + buffer().style.display = ''; } }); media.addEventListener('seeked', () => { bigPlay.style.display = media.paused && !IS_STOCK_ANDROID ? '' : 'none'; loading.style.display = 'none'; - if (buffer) { - buffer.style.display = ''; + if (buffer() !== null) { + buffer().style.display = ''; } }); media.addEventListener('pause', () => { @@ -1695,22 +1695,22 @@ class MediaElementPlayer { if (!IS_STOCK_ANDROID) { bigPlay.style.display = ''; } - if (buffer) { - buffer.style.display = 'none'; + if (buffer() !== null) { + buffer().style.display = 'none'; } }); media.addEventListener('waiting', () => { loading.style.display = ''; - if (buffer) { - buffer.style.display = ''; + if (buffer() !== null) { + buffer().style.display = ''; } }); // show/hide loading media.addEventListener('loadeddata', () => { loading.style.display = ''; - if (buffer) { - buffer.style.display = ''; + if (buffer() !== null) { + buffer().style.display = ''; } // Firing the 'canplay' event after a timeout which isn't getting fired on some Android 4.1 devices @@ -1727,8 +1727,8 @@ class MediaElementPlayer { }); media.addEventListener('canplay', () => { loading.style.display = 'none'; - if (buffer) { - buffer.style.display = 'none'; + if (buffer() !== null) { + buffer().style.display = 'none'; } // Clear timeout inside 'loadeddata' to prevent 'canplay' from firing twice clearTimeout(media.canplayTimeout); @@ -1739,8 +1739,8 @@ class MediaElementPlayer { t._handleError(e); loading.style.display = 'none'; bigPlay.style.display = 'none'; - if (buffer) { - buffer.style.display = 'none'; + if (buffer() !== null) { + buffer().style.display = 'none'; } if (e.message) { error.style.display = 'block';
14
diff --git a/spec/requests/password_resets_spec.rb b/spec/requests/password_resets_spec.rb # coding: UTF-8 -require_relative '../acceptance_helper' require_relative '../spec_helper_min' feature "Forgot password" do @@ -11,7 +10,6 @@ feature "Forgot password" do end before(:each) do - Capybara.current_driver = :rack_test visit login_path click_link 'Forgot?' fill_in 'email', with: @user.email
2
diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js @@ -128,8 +128,11 @@ function payIOUReport({ } fetchChatReportsByIDs([chatReportID]); - // Any report that is being paid must be open, and must be currently set as open iouReport within the - // chatReport object. Therefore, we must also update the chatReport to break this existing link. + // Each chatReport cannot have more than one open iouReport at any time. While an iouReport is open, the + // chatReport stored in Onyx must have a reference to it via the 'iouReportID' field, preventing the need + // to retrieve linked reports via the API when rendering Components. All iouReport's being paid are open + // and will be currently set as the chatReports 'iouReportID' field. Therefore when paying an iou we must + // also update the chatReport, clearing the 'iouReportID' field and breaking the existing link fetchIOUReportByIDAndUpdateChatReport(reportID, chatReportID); }) .catch((error) => {
7
diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js icon = thisData.icon, parent = option.parentNode, next = option.nextElementSibling, + previous = option.previousElementSibling, isOptgroup = parent.tagName === 'OPTGROUP', isOptgroupDisabled = isOptgroup && parent.disabled, isDisabled = option.disabled || isOptgroupDisabled, prevHiddenIndex, - showDivider = option.previousElementSibling && option.previousElementSibling.tagName === 'OPTGROUP', + showDivider = previous && previous.tagName === 'OPTGROUP', textElement, labelElement, prevHidden; data: thisData }); } else { - // if previous element is not an optgroup and hideDisabled is true - if (!showDivider && that.options.hideDisabled) { + if (that.options.hideDisabled) { + if (showDivider) { + var disabledOptions = previous.querySelectorAll('option:disabled'); + + if (disabledOptions.length === previous.children.length) showDivider = false; + } else { prevHiddenIndex = option.prevHiddenIndex; if (prevHiddenIndex !== undefined) { // select the element **before** the first hidden element in the group - prevHidden = $selectOptions[prevHiddenIndex].previousElementSibling; + prevHidden = selectOptions[prevHiddenIndex].previousElementSibling; if (prevHidden && prevHidden.tagName === 'OPTGROUP' && !prevHidden.disabled) { - var disabledOptions = 0, - prevHiddenOptions = prevHidden.childNodes.length; + var disabledOptions = prevHidden.querySelectorAll('option:disabled'); - for (var i = 0; i < prevHiddenOptions; i++) { - if (prevHidden.childNodes[i].disabled) disabledOptions++; + if (disabledOptions.length < prevHidden.children.length) showDivider = true; } - - if (disabledOptions < prevHiddenOptions) showDivider = true; } } } - if (showDivider && mainData[mainData.length - 1].type !== 'divider') { + if (showDivider && mainData.length && mainData[mainData.length - 1].type !== 'divider') { liIndex++; mainElements.push( generateOption.li(
7
diff --git a/conf/routes b/conf/routes @@ -132,4 +132,4 @@ POST /amtAssignment @controllers.Missio # Clustering and Attributes GET /runSingleUserClusteringAllUsers @controllers.AttributeController.runSingleUserClusteringAllUsers GET /userLabelsToCluster @controllers.AttributeController.getUserLabelsToCluster(userIdOrIp: String, isAnonymous: Boolean) -POST /singleUserClusteringResults @controllers.AttributeController.postSingleUserClusteringResults(userId: String, isAnonymous: Boolean) +POST /singleUserClusteringResults @controllers.AttributeController.postSingleUserClusteringResults(userIdOrIp: String, isAnonymous: Boolean)
1
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb @@ -35,7 +35,14 @@ class UsersController < ApplicationController # Send them an invitation and account activation email. email = new_user_params[:email] + begin UserMailer.account_activation(email, reset_url).deliver_now + rescue Net::SMTPAuthenticationError + render( + json: ["User was successfully created but SMTP email is not configured. Try manual password reset at #{request.base_url}#{users_password_new_path}"], + status: :internal_server_error + ) and return + end end format.html { redirect_to edit_user_path(@user), notice: "User was successfully created" }
9
diff --git a/src/scss/components/header.scss b/src/scss/components/header.scss color: $color-main-mid; display: block; padding: 0.4rem 0.6rem; + font-size: 0.72rem; @media (min-width: $viewport-sm) { + font-size: 16px; padding: 0.8rem 1rem; }
1
diff --git a/src/languages/en.js b/src/languages/en.js @@ -656,7 +656,7 @@ export default { pleaseEnterUniqueLogin: 'That user is already a member of this workspace.', genericFailureMessage: 'An error occurred inviting the user to the workspace, please try again.', systemUserError: ({email}) => `Sorry, you cannot invite ${email} to a workspace.`, - welcomeNote: ({workspaceName}) => `You have been invited to the ${workspaceName} workspace! Download the Expensify mobile app to start tracking your expenses.`, + welcomeNote: ({workspaceName}) => `You have been invited to ${workspaceName}! Download the Expensify mobile app to start tracking your expenses.`, }, editor: { nameInputLabel: 'Name',
7
diff --git a/modules/keyboard.js b/modules/keyboard.js @@ -231,12 +231,13 @@ Keyboard.DEFAULTS = { key: ' ', collapsed: true, format: { list: false }, - prefix: /^(1\.|-)$/, + prefix: /^\s*?(1\.|-)$/, handler: function(range, context) { if (this.quill.scroll.whitelist != null && !this.quill.scroll.whitelist['list']) return true; let length = context.prefix.length; + let value = context.prefix.trim().length === 1 ? 'bullet' : 'ordered' this.quill.scroll.deleteAt(range.index - length, length); - this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', Quill.sources.USER); + this.quill.formatLine(range.index - length, 1, 'list', value, Quill.sources.USER); this.quill.setSelection(range.index - length, Quill.sources.SILENT); } },
11
diff --git a/src/og/control/LayerAnimation.js b/src/og/control/LayerAnimation.js @@ -234,8 +234,7 @@ class LayerAnimation extends Control { this._playIndex++; this._timeoutStart = performance.now(); this._layersArr[this._currentIndex].setVisibility(false); - } - if (this.isIdle) { + } else if (this.isIdle) { this._playIndex++; this._timeoutStart = performance.now(); }
1
diff --git a/detox/ios/Detox/EarlGreyStatistics.m b/detox/ios/Detox/EarlGreyStatistics.m @@ -23,7 +23,7 @@ NSArray *WXClassesConformingToProtocol(Protocol* protocol) NSMutableArray* rv = [NSMutableArray new]; int numberOfClasses = objc_getClassList(NULL, 0); - Class* classList = (__bridge Class*)malloc(sizeof(Class) * numberOfClasses); + Class* classList = (__unsafe_unretained Class*)malloc(sizeof(Class) * numberOfClasses); numberOfClasses = objc_getClassList(classList, numberOfClasses); for (int idx = 0; idx < numberOfClasses; idx++) @@ -35,7 +35,7 @@ NSArray *WXClassesConformingToProtocol(Protocol* protocol) } } - free((__bridge void*)classList); + free(classList); return rv; }
1
diff --git a/package-lock.json b/package-lock.json { "name": "aws-ai-qna-bot", - "version": "4.7.1", + "version": "4.7.2", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "4.7.1", + "version": "4.7.2", "license": "SEE LICENSE IN LICENSE", "os": [ "darwin",
3
diff --git a/lib/shared/addon/components/form-versions/component.js b/lib/shared/addon/components/form-versions/component.js @@ -54,7 +54,6 @@ export default Component.extend({ initialVersion, defaultK8sVersion, applyClusterTemplate = false, - clusterTemplateCreate = false, clusterTemplateQuestions = [], } = this; @@ -70,7 +69,7 @@ export default Component.extend({ let maxVersion = maxSatisfying(versions, defaultK8sVersionRange); - if (applyClusterTemplate || clusterTemplateCreate) { + if ( applyClusterTemplate ) { var overrideMatch = ( clusterTemplateQuestions || [] ).findBy('variable', 'rancherKubernetesEngineConfig.kubernetesVersion'); if (overrideMatch) {
2
diff --git a/test/test_contract.sh b/test/test_contract.sh @@ -9,10 +9,10 @@ timestamp=$(date +%s) testaccount=testaccount$timestamp ../bin/near create_account $testaccount echo Building contract -cp ../node_modules/near-runtime-ts/tests/assembly/*.ts assembly/ yarn yarn remove near-shell yarn add ../ +cp ./node_modules/near-runtime-ts/tests/assembly/*.ts assembly/ yarn build echo Deploying contract ../bin/near deploy --accountId=$testaccount --wasmFile=out/main.wasm
1
diff --git a/react/src/base/links/SprkLink.stories.js b/react/src/base/links/SprkLink.stories.js @@ -18,12 +18,7 @@ Images that are links should not use Spark classes. }; export const defaultStory = () => ( - <SprkLink - element="a" - href="#nogo" - idString="link-1" - analyticsString="link-default" - > + <SprkLink href="#nogo" idString="link-1" analyticsString="link-default"> Default Link </SprkLink> ); @@ -34,7 +29,6 @@ defaultStory.story = { export const simple = () => ( <SprkLink - element="a" variant="simple" analyticsString="link-simple" idString="link-2" @@ -47,7 +41,6 @@ export const simple = () => ( export const iconWithTextLink = () => ( <> <SprkLink - element="a" analyticsString="link-icon" href="#nogo" variant="has-icon" @@ -63,7 +56,6 @@ export const iconWithTextLink = () => ( Back </SprkLink> <SprkLink - element="a" analyticsString="link-icon" href="#nogo" variant="has-icon" @@ -87,7 +79,6 @@ iconWithTextLink.story = { export const disabled = () => ( <SprkLink - element="a" analyticsString="link-disabled" variant="disabled" idString="link-5" @@ -99,7 +90,6 @@ export const disabled = () => ( export const disabledSimple = () => ( <SprkLink - element="a" analyticsString="link-disabled" variant="disabled" idString="link-6" @@ -117,7 +107,6 @@ disabledSimple.story = { export const disabledIconWithTextLink = () => ( <> <SprkLink - element="a" analyticsString="link-icon" href="#nogo" variant="disabled" @@ -134,7 +123,6 @@ export const disabledIconWithTextLink = () => ( Back </SprkLink> <SprkLink - element="a" analyticsString="link-icon" href="#nogo" variant="disabled"
3
diff --git a/sirepo/sim_api/jupyterhublogin.py b/sirepo/sim_api/jupyterhublogin.py @@ -61,7 +61,7 @@ def init_apis(*args, **kwargs): global cfg cfg = pkconfig.init( - user_db_root=( + user_db_root_d=( pkio.py_path(sirepo.srdb.root()).join('jupyterhub', 'user'), pkio.py_path, 'Jupyterhub user db', @@ -69,7 +69,7 @@ def init_apis(*args, **kwargs): rs_jupyter_migrate=(False, bool, 'give user option to migrate data from jupyter.radiasoft.org'), uri_root=('jupyter', str, 'the root uri of jupyterhub'), ) - pkio.mkdir_parent(cfg.user_db_root) + pkio.mkdir_parent(cfg.user_db_root_d) sirepo.auth_db.init_model(_init_model) sirepo.events.register({ 'auth_logout': _event_auth_logout, @@ -175,4 +175,4 @@ def _user_dir(user_name=None): if not user_name: user_name = unchecked_jupyterhub_user_name() assert user_name, 'must have user to get dir' - return cfg.user_db_root.join(user_name) + return cfg.user_db_root_d.join(user_name)
4
diff --git a/test/unit/helpers/vuex-setup.js b/test/unit/helpers/vuex-setup.js import Vuex from 'vuex' import VueRouter from 'vue-router' -import { shallow, createLocalVue } from 'vue-test-utils' +import { shallow, mount, createLocalVue } from 'vue-test-utils' + +import routes from 'renderer/routes' const Modules = require('renderer/vuex/modules').default const Getters = require('renderer/vuex/getters') -export default function vuexSetup (getters = {}) { +export default function vuexSetup (getters = {}, stubs = {}) { const modules = Modules({ node: require('../helpers/node_mock') }) @@ -14,24 +16,30 @@ export default function vuexSetup (getters = {}) { localVue.use(Vuex) localVue.use(VueRouter) + function init (componentConstructor, testType = shallow, stubs) { let store = new Vuex.Store({ getters: Object.assign({}, Getters, getters), modules }) store.commit('setDevMode', true) - let router = new VueRouter({}) + jest.spyOn(store, 'dispatch') jest.spyOn(store, 'commit') + let router = new VueRouter({routes}) + return { - localVue, store, router, - new: (componentConstructor, testType = shallow) => { - return testType(componentConstructor, { - localVue, store, router + wrapper: testType(componentConstructor, { + localVue, store, router, stubs }) } } -} + return { + localVue, + shallow: (componentConstructor) => init(componentConstructor, shallow), + mount: (componentConstructor, stubs) => init(componentConstructor, mount, stubs) + } +}
7
diff --git a/fastlane/Fastfile b/fastlane/Fastfile @@ -708,6 +708,14 @@ platform :android do ) end + Dir.glob(".#{release_dir}*.kt") do |item| + find_replace_string( + path_to_file: item[1..-1], + old_string: 'package com.mattermost.rnbeta', + new_string: "package #{package_id}" + ) + end + Dir.glob('../android/app/src/main/java/com/mattermost/share/*.java') do |item| find_replace_string( path_to_file: item[1..-1], @@ -723,16 +731,16 @@ platform :android do new_string: "import #{package_id}.*;" ) end - end - Dir.glob('../android/app/src/main/java/com/mattermost/newarchitecture/*.java') do |item| + Dir.glob('../android/app/src/main/java/com/mattermost/helpers/*.kt') do |item| find_replace_string( path_to_file: item[1..-1], - old_string: 'import com.mattermost.rnbeta.BuildConfig;', - new_string: "import #{package_id}.BuildConfig;" + old_string: 'import com.mattermost.rnbeta.*', + new_string: "import #{package_id}.*" ) end end + end lane :replace_assets do if ENV['REPLACE_ASSETS'] == 'true'
14
diff --git a/src/components/AddPlaidBankAccount.js b/src/components/AddPlaidBankAccount.js @@ -26,6 +26,7 @@ import * as ReimbursementAccountUtils from '../libs/ReimbursementAccountUtils'; import ReimbursementAccountForm from '../pages/ReimbursementAccount/ReimbursementAccountForm'; import getBankIcon from './Icon/BankIcons'; import Icon from './Icon'; +import variables from '../styles/variables'; const propTypes = { ...withLocalizePropTypes, @@ -182,8 +183,8 @@ class AddPlaidBankAccount extends React.Component { <View style={[styles.flexRow, styles.alignItemsCenter, styles.mb5]}> <Icon src={getBankIcon(this.state.institution.name).icon} - height={40} - width={40} + height={variables.avatarSizeNormal} + width={variables.avatarSizeNormal} /> <Text style={[styles.ml3, styles.textStrong]}>{this.state.institution.name}</Text> </View>
14
diff --git a/src/editors/object.js b/src/editors/object.js @@ -406,7 +406,7 @@ export var ObjectEditor = AbstractEditor.extend({ if (this.jsoneditor.options.display_required_only || this.options.display_required_only) { this.schema.defaultProperties = [] $each(this.schema.properties, function (k, s) { - if (self.isRequired({key: k, schema: s})) { + if (self.isRequiredObject({key: k, schema: s})) { self.schema.defaultProperties.push(k) } }) @@ -803,7 +803,7 @@ export var ObjectEditor = AbstractEditor.extend({ // the show_opt_in editor option is for backward compatibility if (this.jsoneditor.options.show_opt_in || this.options.show_opt_in) { $each(this.editors, function (key, editor) { - if (!self.isRequired(editor)) { + if (!self.isRequiredObject(editor)) { self.editors[key].deactivate() } }) @@ -1103,7 +1103,7 @@ export var ObjectEditor = AbstractEditor.extend({ this.addPropertyCheckbox(i) - if (this.isRequired(this.cached_editors[i]) && i in this.editors) { + if (this.isRequiredObject(this.cached_editors[i]) && i in this.editors) { this.addproperty_checkboxes[i].disabled = true } @@ -1150,7 +1150,7 @@ export var ObjectEditor = AbstractEditor.extend({ this.addproperty_add.disabled = false } }, - isRequired: function (editor) { + isRequiredObject: function (editor) { if (!editor) { return } @@ -1172,7 +1172,7 @@ export var ObjectEditor = AbstractEditor.extend({ self.addObjectProperty(i) editor.setValue(value[i], initial) // Otherwise, remove value unless this is the initial set or it's required - } else if (!initial && !self.isRequired(editor)) { + } else if (!initial && !self.isRequiredObject(editor)) { self.removeObjectProperty(i) // Otherwise, set the value to the default } else {
10
diff --git a/src/redux/store/store.ts b/src/redux/store/store.ts @@ -7,19 +7,9 @@ import Reactotron from '../../../reactotron-config'; import reducer from '../reducers'; const transformCacheVoteMap = createTransform( - (state) => { - if(state.votes){ - state.votes = Array.from(state.votes); - } - return state; - }, - (state) => { - console.log(state); - if(state.votes){ - state.votes = new Map(state.votes); - } - return state; - } + (inboundState:any) => ({ ...inboundState, votes : Array.from(inboundState.votes)}), + (outboundState) => ({ ...outboundState, votes:new Map(outboundState.votes)}), + {whitelist:['cache']} ); // Middleware: Redux Persist Config
7
diff --git a/src/index.js b/src/index.js @@ -731,7 +731,17 @@ class Offline { let authStrategyName = null; if (endpoint.authorizer) { let authFunctionName = endpoint.authorizer; + if (typeof authFunctionName === 'string' && authFunctionName.toUpperCase() === 'AWS_IAM') { + this.serverlessLog('WARNING: Serverless Offline does not support the AWS_IAM authorization type'); + + return null; + } if (typeof endpoint.authorizer === 'object') { + if (endpoint.authorizer.type && endpoint.authorizer.type.toUpperCase() === 'AWS_IAM') { + this.serverlessLog('WARNING: Serverless Offline does not support the AWS_IAM authorization type'); + + return null; + } if (endpoint.authorizer.arn) { this.serverlessLog(`WARNING: Serverless Offline does not support non local authorizers: ${endpoint.authorizer.arn}`);
0
diff --git a/src/components/UserHeader.js b/src/components/UserHeader.js @@ -59,7 +59,7 @@ const UserHeader = ({ <FollowButton username={handle} /> )} </div> - {(authenticated && !isSameUser) && <Popover + {!isSameUser && <Popover placement="bottom" trigger="click" content={
2
diff --git a/frontend/src/profile.js b/frontend/src/profile.js @@ -32,7 +32,19 @@ MatrixProfile.prototype.loadStoredRoom = function loadStoredRoom() { }; MatrixProfile.prototype.isProfileStored = function isProfileStored() { - return !!localStorage.getItem("user"); + const item = localStorage.getItem("user"); + + if (item) { + const user = JSON.parse(item); + + if (user.id && user.name && user.email) { + return true; + } + + this.terminate(); + } + + return false; }; MatrixProfile.prototype.terminate = function terminate() {
1
diff --git a/src/encoded/tests/test_audit_experiment.py b/src/encoded/tests/test_audit_experiment.py @@ -2275,7 +2275,6 @@ def test_audit_experiment_dnase_low_correlation(testapp, testapp.patch_json(replicate_2_1['@id'], {'library': library_2['@id']}) testapp.patch_json(base_experiment['@id'], {'status': 'released', 'date_released': '2016-01-01', - 'assay_term_id': 'OBI:0001853', 'assay_term_name': 'DNase-seq'}) res = testapp.get(base_experiment['@id'] + '@@index-data') errors = res.json['audit']
1
diff --git a/app/builtin-pages/views/bookmarks.js b/app/builtin-pages/views/bookmarks.js @@ -188,7 +188,7 @@ function onFilterBookmarks (e) { async function onTogglePinned (i) { var b = bookmarks[i] bookmarks[i].pinned = !b.pinned - await beaker.bookmarks.togglePinned(b.url, bookmarks[i].pinned) + await beaker.bookmarks.setBookmarkPinned(b.href, bookmarks[i]) render() }
4
diff --git a/articles/overview/deployment-models.md b/articles/overview/deployment-models.md @@ -62,10 +62,10 @@ The following table describes operational and feature differences between each o </tr> <tr> <th>Uptime SLA Provided</th> - <td class="success">Yes</td> - <td class="success">Yes</td> - <td class="danger">No</td> - <td class="danger">No</td> + <td>Yes</td> + <td>Yes</td> + <td>No</td> + <td>No</td> </tr> <tr> <th>Support Channels & Levels</th> @@ -139,45 +139,45 @@ The following table describes operational and feature differences between each o </tr> <tr> <th>Anomaly Detection</th> - <td class="success">Brute Force and Breached Passwords</td> - <td class="success">Brute Force</td> - <td class="success">Brute Force</td> - <td class="success">Brute Force</td> + <td>Brute Force and Breached Passwords</td> + <td>Brute Force</td> + <td>Brute Force</td> + <td>Brute Force</td> </tr> <tr> <th>Extensions</th> - <td class="success">Yes</td> - <td class="success">Yes <sup>*</sup></td> - <td class="success">Yes <sup>*</sup></td> - <td class="success">Yes <sup>*</sup></td> + <td>Yes</td> + <td>Yes <sup>*</sup></td> + <td>Yes <sup>*</sup></td> + <td>Yes <sup>*</sup></td> </tr> <tr> <th>Geolocation</th> - <td class="success">Yes</td> - <td class="success">Yes</td> - <td class="success">Yes</td> - <td class="success">Yes</td> + <td>Yes</td> + <td>Yes</td> + <td>Yes</td> + <td>Yes</td> </tr> <tr> <th>Connecting IP Address Filtering Restrictions</th> - <td class="danger">No</td> - <td class="danger">No</td> - <td class="success">Yes</td> - <td class="success">Yes</td> + <td>No</td> + <td>No</td> + <td>Yes</td> + <td>Yes</td> </tr> <tr> <th>Custom Domains</th> - <td class="danger">No</td> - <td class="success">Yes <sup>**</sup></td> - <td class="success">Yes <sup>**</sup></td> - <td class="success">Yes <sup>**</sup></td> + <td>No</td> + <td>Yes <sup>**</sup></td> + <td>Yes <sup>**</sup></td> + <td>Yes <sup>**</sup></td> </tr> <tr> <th>Shared Resources Among Multiple Customers</th> - <td class="success">Yes</td> - <td class="danger">No</td> - <td class="danger">No</td> - <td class="danger">No</td> + <td>Yes</td> + <td>No</td> + <td>No</td> + <td>No</td> </tr> <tr> <th>MFA</th>
2
diff --git a/package.json b/package.json "es6-promise": "^3.0.2", "fast-isnumeric": "^1.1.1", "font-atlas-sdf": "^1.3.3", - "gl-axes3d": "^1.2.6", "gl-contour2d": "^1.1.2", "gl-error3d": "^1.0.7", "gl-heatmap2d": "^1.0.3",
2
diff --git a/src/components/TableHeadingCellEnhancer.js b/src/components/TableHeadingCellEnhancer.js @@ -8,7 +8,7 @@ const EnhancedHeadingCell = OriginalComponent => compose( }), mapProps(({ events: { onSort }, ...props }) => ({ ...props, - onClick: combineHandlers([() => onSort({ id: props.columnId }), props.onClick]), + onClick: combineHandlers([() => onSort && onSort({ id: props.columnId }), props.onClick]), })) )(props => <OriginalComponent {...props} />);
1
diff --git a/website/adminscripts/import.py b/website/adminscripts/import.py @@ -7,6 +7,7 @@ import sys import datetime import json import xml.sax +import re if len(sys.argv) < 3: print("Usage: ./import.py [-p] PATH_TO_DICTIONARY.sqlite FILE_TO_IMPORT.xml [AUTHOR_EMAIL]") @@ -58,6 +59,7 @@ class handlerFirst(xml.sax.ContentHandler): entryCount += 1 xmldata = open(filename, 'r').read() +xmldata = re.sub(r'<\?xml[^?]*\?>', '', xmldata) try: saxParser = xml.sax.parseString("<!DOCTYPE foo SYSTEM 'x.dtd'>\n"+xmldata, handlerFirst()) xmldata = "<!DOCTYPE foo SYSTEM 'x.dtd'>\n"+xmldata
8
diff --git a/client/DeckSummary.jsx b/client/DeckSummary.jsx @@ -110,14 +110,14 @@ class DeckSummary extends React.Component { <h3>{ this.props.name }</h3> <div className='decklist'> <img className='pull-left' src={ '/img/mons/' + this.props.faction.value + '.png' } /> - { this.props.allianceFaction && this.props.allianceFaction.value !== 'none' ? <img className='pull-right' src={ '/img/mons/' + this.props.allianceFaction.value + '-sm.png' } /> : null } + { this.props.allianceFaction && this.props.allianceFaction.value !== 'none' ? <img className='pull-right' src={ '/img/mons/' + this.props.allianceFaction.value + '.png' } /> : null } <div> <h4>{ this.props.faction.name }</h4> <div ref='allianceFaction'>Alliance: { this.props.allianceFaction && this.props.allianceFaction.name ? <span> {this.props.allianceFaction.name} </span> : <span> None </span> } </div> <div ref='provinceCount'>Province deck: { this.state.provinceCount } cards</div> - <div ref='dynastyDrawCount'>Dynasty Draw deck: { this.state.dynastyDrawCount } cards</div> - <div ref='conflictDrawCount'>Conflict Draw deck: { this.state.conflictDrawCount } cards</div> + <div ref='dynastyDrawCount'>Dynasty Deck: { this.state.dynastyDrawCount } cards</div> + <div ref='conflictDrawCount'>Conflict Deck: { this.state.conflictDrawCount } cards</div> <div className={this.state.status === 'Valid' ? 'text-success' : 'text-danger'}> <span ref='popover'>{ this.state.status }</span>
1
diff --git a/src/agent/index.js b/src/agent/index.js @@ -2751,7 +2751,6 @@ function traceJava (klass, method) { const k = javaUse(klass); k[method].implementation = function (args) { const res = this[method](); - console.error(args); /* var Activity = Java.use('android.app.Activity'); Activity.onResume.implementation = function () { @@ -2759,8 +2758,16 @@ function traceJava (klass, method) { this.onResume(); */ const message = Throwable.$new().getStackTrace().map(_ => _.toString()).join('\n') + '\n'; - console.error('dt', klass); - console.error(message); + const traceMessage = { + source: 'dt', + klass: klass, + method: method, + timestamp: new Date(), + result: res, + values: args, + message: message + }; + traceLog(traceMessage); return res; }; });
4
diff --git a/src/encoded/search.py b/src/encoded/search.py @@ -1212,31 +1212,27 @@ def audit(context, request): facets.append(audit_facet) # To get list of audit categories from facets - audit_list_label = [] + audit_list_field_copy = [] audit_list_field = [] for item in facets: if item[0].rfind('audit.') > -1: audit_list_field.append(item) - audit_list_label = audit_list_field.copy() + audit_list_field_copy = audit_list_field.copy() + + # Gets just the fields from the tuples from facet data + for item in audit_list_field_copy: # for each audit label + temp = item[0] + audit_list_field[audit_list_field.index(item)] = temp #replaces list with just audit field - # Gets just the labels from the tuples and converts it into format usable by summarize buckets - for item in audit_list_label: # for each audit label - temp = item[0] # copy string to modify - audit_list_field[audit_list_field.index(item)] = temp - index = temp.find('.') # find first index of . - while index > 0: # if index exists - temp = temp[:index] + '-' + temp[(index+1):] # replace . with - - index = temp.find('.') # find repeat index of . - audit_index = audit_list_label.index(item) - audit_list_label[audit_index] = temp query['aggs'] = set_facets(facets, used_filters, principals, doc_types) # Group results in 2 dimensions - # Don't use these groupings for audit matrix x_grouping = matrix['x']['group_by'] y_groupings = audit_list_field + + # Creates a list of fields used in no audit row no_audits_groupings = ['no.audit.error', 'no.audit.not_compliant', 'no.audit.warning'] x_agg = { @@ -1246,27 +1242,8 @@ def audit(context, request): }, } aggs = {x_grouping: x_agg} - """ - for field in y_groupings: - aggs = { - "missing" + field: { - "missing": { - "field": field, - "size": 0, # no limit - }, - "aggs": aggs, - }, - } - """ - """ - for field in (y_groupings): - aggs[field] = { - "terms": { - "field": audit_list_field[y_groupings.index(field)], - "size": 0, # no limit - }, - } - """ + + # aggs query for audit category rows aggs = {'audit.ERROR.category': {'aggs': {'assay_title': {'terms': {'size': 0, 'field': 'embedded.assay_title.raw' } } @@ -1289,7 +1266,9 @@ def audit(context, request): } - + # Aggs query gets updated with no audit row. + # This is a nested query with error as top most level and warning action as innermost level. + # It allows for there to be multiple missing fields in the query. aggs.update({ "no.audit.error": { "missing": { @@ -1333,7 +1312,9 @@ def audit(context, request): }) - # if internal action data is able to be seen in facets then add it to aggs + # If internal action data is able to be seen in facets then add it to aggs for both + # a normal audit category row and to the no audits row as innermost level of nested query. + # Additionally, add it to the no_audits_groupings list to be used in summarize_no_audits later. if "audit.INTERNAL_ACTION.category" in facets[len(facets)-1]: aggs['audit.INTERNAL_ACTION.category'] = {'aggs': {'assay_title': {'terms': {'size': 0, 'field': 'embedded.assay_title.raw' } @@ -1356,6 +1337,7 @@ def audit(context, request): } } no_audits_groupings.append("no.audit.internal_action") + aggs['x'] = x_agg query['aggs']['matrix'] = { "filter": { @@ -1374,13 +1356,6 @@ def audit(context, request): result['matrix']['doc_count'] = total = aggregations['matrix']['doc_count'] result['matrix']['max_cell_doc_count'] = 0 - # Create new dictionary that contains all the audit keys from aggregations and use that as - # y_bucket below - temp_dict = {} - for item in aggregations.items(): - if item[0].rfind('audit') > -1: - temp_dict.update(item[1]) - # Format facets for results result['facets'] = format_facets( es_results, facets, used_filters, (schema,), total, principals) @@ -1498,7 +1473,8 @@ def audit(context, request): no_audits_warning_dict['buckets'] = no_audits_warning_list """ - # Replaces 'no.audits' in aggregations['matrix'] with the correctly formatted 'no.audits' data + # Replaces all audit categories in aggregations['matrix'] with the correctly formatted data + # for that specific audit category for audit in no_audits_groupings: aggregations['matrix'].pop(audit) #aggregations['matrix'].pop('no.audit.error')
0
diff --git a/js/neighborhood.js b/js/neighborhood.js @@ -181,8 +181,8 @@ enyo.kind({ items.push({ icon: {directory: "icons", icon: "system-shutdown.svg"}, colorized: false, - name: l10n.get("Shutdown"), - action: enyo.bind(this, "doShutdown"), + name: (util.getClientType() == constant.webAppType) ? l10n.get("Logoff") : l10n.get("Shutdown"), + action: (util.getClientType() == constant.webAppType) ? enyo.bind(this, "doLogoff") : enyo.bind(this, "doShutdown"), data: null }); items.push({ @@ -216,6 +216,12 @@ enyo.kind({ this.getPopup().hidePopup(); util.quitApp(); }, + doLogoff: function() { + stats.trace(constant.viewNames[app.getView()], 'click', 'logoff'); + preferences.addUserInHistory(); + util.cleanDatastore(); + util.restartApp(); + }, doRestart: function() { stats.trace(constant.viewNames[app.getView()], 'click', 'restart'); util.restartApp();
14
diff --git a/README.md b/README.md ![Imgur](http://i.imgur.com/eL73Iit.png) -![Imgur](https://i.imgur.com/iw4m3NH.jpg) +![Imgur](https://i.redd.it/8jkukgakvq801.jpg) # SpaceX Data REST API @@ -29,11 +29,11 @@ GET https://api.spacexdata.com/v2/launches/latest ```json { - "flight_number":52, - "launch_year":"2017", - "launch_date_unix":1513992443, - "launch_date_utc":"2017-12-23T01:27:23Z", - "launch_date_local":"2017-12-22T17:27:23-08:00", + "flight_number":53, + "launch_year":"2018", + "launch_date_unix":1515373200, + "launch_date_utc":"2018-01-08T01:00:00Z", + "launch_date_local":"2018-01-07T20:00:00-05:00", "rocket":{ "rocket_id":"falcon9", "rocket_name":"Falcon 9", @@ -41,57 +41,57 @@ GET https://api.spacexdata.com/v2/launches/latest "first_stage":{ "cores":[ { - "core_serial":"B1036", - "reused":true, - "land_success":false, - "landing_type":null, - "landing_vehicle":null + "core_serial":"B1043", + "reused":false, + "land_success":true, + "landing_type":"RTLS", + "landing_vehicle":"LZ-1" } ] }, "second_stage":{ "payloads":[ { - "payload_id":"Iridium NEXT 4", + "payload_id":"ZUMA", "reused":false, "customers":[ - "Iridium Communications" + "Northrop Grumman" ], "payload_type":"Satellite", - "payload_mass_kg":9600, - "payload_mass_lbs":21164.38, + "payload_mass_kg":null, + "payload_mass_lbs":null, "orbit":"LEO" } ] } }, "telemetry":{ - "flight_club":"https://www.flightclub.io/result?code=IRD4" + "flight_club":"https://www.flightclub.io/result?code=ZUMA" }, "reuse":{ - "core":true, + "core":false, "side_core1":false, "side_core2":false, "fairings":false, "capsule":false }, "launch_site":{ - "site_id":"vafb_slc_4e", - "site_name":"VAFB SLC 4E", - "site_name_long":"Vandenberg Air Force Base Space Launch Complex 4E" + "site_id":"ccafs_slc_40", + "site_name":"CCAFS SLC 40", + "site_name_long":"Cape Canaveral Air Force Station Space Launch Complex 40" }, "launch_success":true, "links":{ - "mission_patch":"https://i.imgur.com/bNwARXL.png", - "reddit_campaign":"https://www.reddit.com/r/spacex/comments/7cgts7/iridium_next_constellation_mission_4_launch/", - "reddit_launch":"https://www.reddit.com/r/spacex/comments/7li8y2/rspacex_iridium_next_4_official_launch_discussion/", + "mission_patch":"https://i.imgur.com/c5pL42B.png", + "reddit_campaign":"https://www.reddit.com/r/spacex/comments/7895bo/zuma_launch_campaign_thread/", + "reddit_launch":"https://www.reddit.com/r/spacex/comments/7oqjf0/rspacex_zuma_official_launch_discussion_updates/", "reddit_recovery":null, - "reddit_media":"https://www.reddit.com/r/spacex/comments/7litv2/rspacex_iridium4_media_thread_videos_images_gifs/", - "presskit":"http://www.spacex.com/sites/spacex/files/iridium4presskit.pdf", - "article_link":"https://spaceflightnow.com/2017/12/23/spacex-launch-dazzles-delivering-10-more-satellites-for-iridium/", - "video_link":"https://www.youtube.com/watch?v=wtdjCwo6d3Q" + "reddit_media":"https://www.reddit.com/r/spacex/comments/7orksl/rspacex_zuma_media_thread_videos_images_gifs/", + "presskit":"http://www.spacex.com/sites/spacex/files/zumapresskit.pdf", + "article_link":null, + "video_link":"https://www.youtube.com/watch?v=0PWu3BRxn60" }, - "details":"Reusing the booster first used on Iridium-2, but will be flying expendable." + "details":"Originally planned for mid-November 2017, the mission was delayed due to test results from the fairing of another customer. First-stage booster will attempt landing at LZ-1" } ```
3
diff --git a/_src/js/compare/index.jsx b/_src/js/compare/index.jsx @@ -139,45 +139,41 @@ class Compare extends React.Component { constructor (props) { super(props); this.state = { - usePct: true + changeType: 'pct', + usePct: true, }; - - this.handleRadioChange = this.handleRadioChange.bind(this); + this.updateChangeType = this.updateChangeType.bind(this) } - handleRadioChange (event) { + updateChangeType (event) { const target = event.target; this.setState({ - [event.target.name]: target.value === 'pct' + changeType: target.value, }); } render() { + const usePct = this.state.changeType === 'pct'; + return <div> <div className="row"> - <div className="col-sm-12"> + <div className="col-sm-10"> <h1>Compare <strong style={styles[0]}>{budgets[0].key} </strong> with <strong style={styles[1]}>{budgets[1].key}</strong></h1> - <div> - show change as: <label> - <input - name="usePct" - type="radio" - value="usd" - checked={!this.state.usePct} - onChange={this.handleRadioChange} /> dollars - </label> <label> - <input - name="usePct" - type="radio" - value="pct" - checked={this.state.usePct} - onChange={this.handleRadioChange} /> percentage - </label> </div> - <Total data={budgets} colors={colors} diffColors={diffColors} usePct={this.state.usePct}></Total> + <div className="col-sm-2"> + <div className="form-group"> + <label>Show changes as:</label> + <select className="form-control" id="sortControl" + value={this.state.changeType} onChange={this.updateChangeType}> + <option value="pct">percentage</option> + <option value="usd">dollars</option> + </select> + </div> </div> <div className="col-sm-12"> + <Total data={budgets} colors={colors} diffColors={diffColors} + usePct={usePct}></Total> <h2>Budget breakdowns</h2> <p>Drill down blah tk</p> </div> @@ -194,14 +190,14 @@ class Compare extends React.Component { </Nav> </div> <div className="col-sm-9"> - <Tab.Content> + <Tab.Content mountOnEnter> <Tab.Pane eventKey="spendDept"> <SpendingByDept colors={colors} diffColors={diffColors} - usePct={this.state.usePct}></SpendingByDept> + usePct={usePct}></SpendingByDept> </Tab.Pane> <Tab.Pane eventKey="spendCat"> <SpendingByCategory colors={colors} diffColors={diffColors} - usePct={this.state.usePct}></SpendingByCategory> + usePct={usePct}></SpendingByCategory> </Tab.Pane> <Tab.Pane eventKey="revDept"> rev by dept
4
diff --git a/src/screens/SponsorScreen/index.js b/src/screens/SponsorScreen/index.js @@ -19,9 +19,10 @@ type Props = { getAssetSource: FieldRef => ImageSource } & OwnProps; -const mapStateToProps = state => ({ +const mapStateToProps = (state, { navigation }): Props => ({ sponsors: selectSponsors(state), - getAssetSource: getAssetSource(id => selectAssetById(state, id)) + getAssetSource: getAssetSource(id => selectAssetById(state, id)), + navigation }); const mapDispatchToProps = {};
0
diff --git a/assets/js/modules/analytics/datastore/accounts.test.js b/assets/js/modules/analytics/datastore/accounts.test.js @@ -36,7 +36,7 @@ import * as fixtures from './__fixtures__'; describe( 'modules/analytics accounts', () => { let apiFetchSpy; - let windowLocationSpy; + let locationAssignSpy; let registry; let store; let redirect; @@ -54,9 +54,9 @@ describe( 'modules/analytics accounts', () => { registry = createTestRegistry(); store = registry.stores[ STORE_NAME ].store; apiFetchSpy = jest.spyOn( { apiFetch }, 'apiFetch' ); - windowLocationSpy = jest.spyOn( location, 'assign' ); + locationAssignSpy = jest.spyOn( location, 'assign' ); - windowLocationSpy.mockImplementation( ( location ) => { + locationAssignSpy.mockImplementation( ( location ) => { redirect = location; } ); redirect = ''; @@ -69,7 +69,7 @@ describe( 'modules/analytics accounts', () => { afterEach( () => { unsubscribeFromAll( registry ); apiFetchSpy.mockRestore(); - windowLocationSpy.mockRestore(); + locationAssignSpy.mockRestore(); } ); describe( 'actions', () => {
10
diff --git a/NewCommentsLayout.user.js b/NewCommentsLayout.user.js // @description Better comments layout for easier readability and moderation // @homepage https://github.com/samliew/SO-mod-userscripts // @author @samliew -// @version 1.2.1 +// @version 1.2.2 // // @include https://*stackoverflow.com/* // @include https://*serverfault.com/* @@ -51,10 +51,14 @@ ul.comments-list .comment-score span, .comment-copy { font-size: ${commentsFontSize}; } -.comment-copy { +.comment-body .comment-copy { display: block; margin: 0 0 2px 0; line-height: 1.2; + + font-family: Helvetica, Arial, sans-serif; + font-size: ${commentsFontSize}; + color: var(--black); } /* Minor comments UI changes */ @@ -66,7 +70,7 @@ ul.comments-list .comment-score span, margin-right: 5px; } .comment-user { - font-style: italic; + } .deleted-comment-info { float: right;
7
diff --git a/articles/extensions/index.md b/articles/extensions/index.md --- -url: /extensions -title: Auth0 Extensions +description: Extensions enable you to install applications or run commands/scripts that extend the functionality of Auth0. toc: true -description: Auth0 Extensions enable you to install applications or run commands/scripts that extend the functionality of the Auth0 base product. --- - # Auth0 Extensions Auth0 Extensions enable you to install applications (such as [Webtasks](https://webtask.io/)) or run commands/scripts that extend the functionality of the Auth0 base product. Each extension is separate from all other extensions. Auth0 defines extensions per tenant, so data is stored by the pair `tenant\extension`. -When creating extensions, you have two options: -- [building off of one of Auth0's provided extensions](#using-an-auth0-provided-extension) in the Management Portal; -- [creating and installing your own](#creating-your-own-extension). - -## Using an Auth0-Provided Extension +## Using an Extension -Auth0 provides the following pre-defined extensions, and they are available for installation via the Management Portal. They have not, however, been fully installed. To use one or more of the following apps, you must provide the required configuration information and finish installing the extensions. +Auth0 provides the following pre-defined extensions, and they are available for installation via the [Dashboard](${manage_url}). To use one or more of the following apps, you must provide the required configuration information and finish installing the extensions. -![](/media/articles/extensions/auth0-provided-extensions.png) +![Auth0 Extensions](/media/articles/extensions/auth0-provided-extensions.png) ## What types of actions can I do with extensions? @@ -67,15 +60,3 @@ Auth0 provides the following pre-defined extensions, and they are available for ### Create a SSO dashboard with multiple enterprise applications - [SSO Dashboard Extension](extensions/sso-dashboard) - -## Creating Your Own Extension - -If you would like to [create your own extension](/extensions/custom-extensions), Auth0 provides the following sample code to help you get started: - -- [Auth0 Extension Boilerplate](https://github.com/auth0/auth0-extension-boilerplate) -- [Auth0 Extension with API Boilerplate](https://github.com/auth0/auth0-extension-boilerplate-with-api) -- [Auth0 Extension with React Boilerplate](https://github.com/auth0/auth0-extension-boilerplate-with-react) - -Alternatively, you may follow the Development Instructions provided via the "New Extension" window that appears when you click on the "+ Extension" button. This allows you to create your own extension using the command line. - -For instructions on how to install your custom extension, please see [Installing a Custom Extension](/extensions/custom-extensions#installing-a-custom-extension).
2
diff --git a/articles/overview/apis.md b/articles/overview/apis.md @@ -104,4 +104,14 @@ The most secure practice, and our recommendation, is to use **RS256**. Some of t - With RS256 you can implement key rotation without having to re-deploy the API with the new secret. +::: note +You can find the Public Key you can use to verify the signature of an RS256 signed token by going to the [Clients section](${manage_url}/#/clients) of your Auth0 Dashboard. Open the *Settings* of any Client, scroll down and open *Advanced Settings*. Open the *Certificates* tab and you will find the Public Key in the **Signing Certificate** field. + +If you want to use the Public Key to verify a JWT signature on [JWT.io](https://jwt.io/), you can copy the Public Key and paste it in the *Public Key or Certificate* field under the *Verify Signature* section on the [JWT.io](https://jwt.io/) website. + +If you want to verify the signature of a token from one of your applications, it is recommended that you obtain the Public Key from your tenant's [JSON Web Key Set (JWKS)](https://auth0.com/docs/jwks). Your tenant's JWKS is `https://${account.namespace}/.well-known/jwks.json`. + +For more information ob how to do this, please refer the [Verify Access Tokens](/api-auth/tutorials/verify-access-token#verify-the-signature). +::: + For a more detailed overview of the JWT signing algorithms refer to: [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/).
0
diff --git a/src/components/auth/torus/sdk/TorusSDK.js b/src/components/auth/torus/sdk/TorusSDK.js @@ -62,6 +62,8 @@ class TorusSDK { } fetchTorusUser(response) { + const { env } = this.config + let torusUser = response let { userInfo, ...otherResponse } = torusUser @@ -82,6 +84,10 @@ class TorusSDK { torusUser = omit(torusUser, 'name') } + if ('production' !== env) { + logger.debug('Receiver torusUser:', torusUser) + } + return torusUser } }
0
diff --git a/UI/src/app/_components/tally/tally.component.ts b/UI/src/app/_components/tally/tally.component.ts @@ -28,7 +28,13 @@ export class TallyComponent { this.route.params.subscribe((params) => { if (params.deviceId) { this.currentDeviceIdx = this.socketService.devices.findIndex((d) => d.id == params.deviceId); - this.socketService.socket.emit('device_listen', this.socketService.devices[this.currentDeviceIdx!].id, 'web'); + this.socketService.socket.emit('listenerclient_connect', { + deviceId: this.socketService.devices[this.currentDeviceIdx!].id, + listenerType: "web", + canBeReassigned: true, + canBeFlashed: true, + supportsChat: true, + }); } }); });
4
diff --git a/grails-app/taglib/streama/AssetSettingTagLib.groovy b/grails-app/taglib/streama/AssetSettingTagLib.groovy @@ -16,6 +16,10 @@ class AssetSettingTagLib { def linkRelIconSetting = { attribs -> def setting = attribs['setting'] + if(!setting){ + return + } + out << '<link rel="icon" href="'+getAssetFromSetting(setting)+'" type="image/x-icon">' } @@ -27,6 +31,9 @@ class AssetSettingTagLib { def altText = "" if(alt) altText = 'alt="'+alt+'"' + if(!setting){ + return + } out << '<img class="'+classNames+'" src="'+getAssetFromSetting(setting)+'" '+altText+'>' } @@ -34,6 +41,10 @@ class AssetSettingTagLib { def setting = attribs['setting'] def selector = attribs['selector'] + if(!setting){ + return + } + out << '<style>' out << selector out << '{ background-image: url('
1
diff --git a/src/app/services/cncengine/CNCEngine.js b/src/app/services/cncengine/CNCEngine.js @@ -3,9 +3,10 @@ import rangeCheck from 'range_check'; import serialport from 'serialport'; import socketIO from 'socket.io'; import socketioJwt from 'socketio-jwt'; -import store from '../../store'; +import ensureArray from '../../lib/ensure-array'; import logger from '../../lib/logger'; import settings from '../../config/settings'; +import store from '../../store'; import config from '../configstore'; import taskRunner from '../taskrunner'; import { GrblController, SmoothieController, TinyGController } from '../../controllers'; @@ -101,7 +102,7 @@ class CNCEngine { return; } - ports = ports.concat(_.get(settings, 'cnc.ports') || []); + ports = ports.concat(ensureArray(config.get('ports', []))); const controllers = store.get('controllers', {}); const portsInUse = _(controllers)
1
diff --git a/src/traces/surface/convert.js b/src/traces/surface/convert.js @@ -115,7 +115,17 @@ var shortPrimes = [ 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, - 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 + 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, + 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, + 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, + 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, + 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, + 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, + 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, + 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, + 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, + 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999 ]; function getPow(a, b) { @@ -140,12 +150,14 @@ function getFactors(a) { function smallestDivisor(a) { var A = getFactors(a); + var result = a; for(var i = 0; i < shortPrimes.length; i++) { if(A[i] > 0) { - return shortPrimes[i]; + result = shortPrimes[i]; + break; } } - return a; + return result; } function leastCommonMultiple(a, b) { @@ -227,18 +239,18 @@ proto.estimateScale = function(width, height) { var resDst = 1 + leastCommonMultiple(xLCM, yLCM); // console.log("BEFORE: resDst=", resDst); - while(resDst < MIN_RESOLUTION) { resDst *= 2; } while(resDst > MAX_RESOLUTION) { - + resDst--; resDst /= smallestDivisor(resDst); + resDst++; - // option 2: - // resDst = MAX_RESOLUTION; + if (resDst < MIN_RESOLUTION) { + resDst = MIN_RESOLUTION; + } } - // console.log("AFTER: resDst=", resDst); var scale = resDst / resSrc;
7