hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1834249449ae315538416c8a6634d5130cecce1c | 457 | js | JavaScript | packages/react-jsonschema-form-to-cardscript/lib/widgets/property-list.js | exactlyaron/cardscript | 3875f567976f29f5279823755da87fe305f6a1c2 | [
"MIT"
] | null | null | null | packages/react-jsonschema-form-to-cardscript/lib/widgets/property-list.js | exactlyaron/cardscript | 3875f567976f29f5279823755da87fe305f6a1c2 | [
"MIT"
] | null | null | null | packages/react-jsonschema-form-to-cardscript/lib/widgets/property-list.js | exactlyaron/cardscript | 3875f567976f29f5279823755da87fe305f6a1c2 | [
"MIT"
] | null | null | null | const _ = require('lodash')
module.exports = class PropertyList {
constructor (options) {
this.widget = {
id: _.camelCase(options.config.header),
type: 'propertyList',
attributes: {
heading: options.config.header,
properties: options.config.properties.map(prop => {
return {
header: prop.prompt,
dataPath: prop.dataPath
}
})
}
}
}
}
| 22.85 | 60 | 0.52954 |
183481e4f6dd12c9617b4d4b9e4952d068c607c6 | 2,303 | js | JavaScript | index.js | flexiooss/hotballoon | 8d16a82f1795d73ba32acc8631a427096d6d978d | [
"Apache-2.0"
] | 5 | 2018-01-22T13:53:32.000Z | 2019-04-18T12:52:05.000Z | index.js | flexiooss/hotballoon | 8d16a82f1795d73ba32acc8631a427096d6d978d | [
"Apache-2.0"
] | 63 | 2018-06-01T06:13:11.000Z | 2022-03-22T10:10:26.000Z | index.js | flexiooss/hotballoon | 8d16a82f1795d73ba32acc8631a427096d6d978d | [
"Apache-2.0"
] | null | null | null | export {HotBalloonApplication} from './src/js/Application/HotBalloonApplication'
export {HotballoonApplicationConfig} from './src/js/Application/HotballoonApplicationConfig'
export {ApplicationBuilder} from './src/js/Application/ApplicationBuilder'
export {ViewRenderConfig} from './src/js/Application/ViewRenderConfig'
export {ExecutionConfig} from './src/js/Application/ExecutionConfig'
export {Dispatcher} from './src/js/Dispatcher/Dispatcher'
export {Component} from './src/js/Component/Component'
export {ComponentsContextHandler} from './src/js/Component/ComponentsContextHandler'
export {ActionDispatcherBuilder} from './src/js/Action/ActionDispatcherBuilder'
export {ActionSubscriber} from './src/js/Action/ActionSubscriber'
export {ActionsHandler} from './src/js/Action/ActionsHandler'
export {ViewContainersHandler} from './src/js/View/ViewContainersHandler'
export {View} from './src/js/View/View'
export {ViewContainer, ViewContainerParameters} from './src/js/View/ViewContainer'
export {ViewContainerPublicEventHandler} from './src/js/View/ViewContainerPublicEventHandler'
export {ViewPublicEventHandler} from './src/js/View/ViewPublicEventHandler'
export {ElementEventListenerConfigBuilder} from './src/js/HotballoonNodeElement/ElementEventListenerConfigBuilder'
export {UIEventBuilder} from './src/js/HotballoonNodeElement/UIEventBuilder'
export {StoresHandler} from './src/js/Store/StoresHandler'
export {PublicStoreHandler} from './src/js/Store/PublicStoreHandler'
export {ProxyStoreBuilder} from './src/js/Store/ProxyStoreBuilder'
export {OnDemandProxyStoreBuilder} from './src/js/Store/OnDemandProxyStoreBuilder'
export {InMemoryStoreBuilder} from './src/js/Store/InMemoryStoreBuilder'
export {JsStorageStoreBuilder} from './src/js/Store/JsStorageStoreBuilder'
export {e} from './src/js/HotballoonNodeElement/ElementDescription'
export {RECONCILIATION_RULES} from './flexio-nodes-reconciliation'
export {TypeCheck} from './src/js/Types/TypeCheck'
export {JobInterface} from './src/js/Job/JobInterface'
export {ExecutorWorker} from './src/js/Job/ExecutorWorker'
export {ExecutorInline} from './src/js/Job/ExecutorInline'
export {OrderedEventListenerConfigBuilder} from '@flexio-oss/js-commons-bundle/event-handler'
export {AsyncDomAccessor} from './src/js/View/DomAccessor'
| 52.340909 | 114 | 0.813287 |
1834a9a234856e9ebfeeaa26e608444f7712b195 | 458 | js | JavaScript | test/comparison-tests/instance/webpack.config.js | Remitly/ts-loader | f9b5f47236c6f298280b198300502da039797885 | [
"MIT"
] | null | null | null | test/comparison-tests/instance/webpack.config.js | Remitly/ts-loader | f9b5f47236c6f298280b198300502da039797885 | [
"MIT"
] | 91 | 2020-01-06T13:25:52.000Z | 2021-07-26T15:16:40.000Z | test/comparison-tests/instance/webpack.config.js | Remitly/ts-loader | f9b5f47236c6f298280b198300502da039797885 | [
"MIT"
] | null | null | null | module.exports = {
entry: {
a: './a.ts',
b: './b.ts'
},
output: {
filename: 'bundle.js'
},
resolve: {
extensions: ['', '.ts', '.js']
},
module: {
loaders: [
// this will fail if both files are passed through the same instance
{ test: /a\.ts$/, loader: '../../index.js' },
{ test: /b\.ts$/, loader: '../../index.js?instance=different' }
]
}
} | 24.105263 | 80 | 0.421397 |
1834ff24a13e7cce853485a2f3c4692db98a647d | 1,113 | js | JavaScript | services/status-api/test/lambdas/get.test.js | helsingborg-stad/forminput-helsingborg-io-sls-api | 3b03a08e1e53f70d76171351822806c4ff1798e0 | [
"MIT"
] | null | null | null | services/status-api/test/lambdas/get.test.js | helsingborg-stad/forminput-helsingborg-io-sls-api | 3b03a08e1e53f70d76171351822806c4ff1798e0 | [
"MIT"
] | null | null | null | services/status-api/test/lambdas/get.test.js | helsingborg-stad/forminput-helsingborg-io-sls-api | 3b03a08e1e53f70d76171351822806c4ff1798e0 | [
"MIT"
] | null | null | null | import { main } from '../../src/lambdas/get';
const oldEnvironment = { ...process.env };
afterEach(() => {
process.env = { ...oldEnvironment };
});
const mockHeaders = {
'Access-Control-Allow-Credentials': true,
'Access-Control-Allow-Origin': '*',
};
const mockJsonApi = { version: '1.0' };
it('returns the value in `message` environment variable', async () => {
const expectedMessageValue = 'My funky environment message value';
process.env.message = expectedMessageValue;
const epectedResult = {
statusCode: 200,
headers: mockHeaders,
body: JSON.stringify({
jsonapi: mockJsonApi,
data: {
message: expectedMessageValue,
},
}),
};
const result = await main();
expect(result).toEqual(epectedResult);
});
it('returns an empty string if `message` variable is not set', async () => {
const expectedResult = {
statusCode: 200,
headers: mockHeaders,
body: JSON.stringify({
jsonapi: mockJsonApi,
data: {
message: '',
},
}),
};
const result = await main();
expect(result).toEqual(expectedResult);
});
| 21.823529 | 76 | 0.626235 |
18353f9761235d652d8b0e6557510e8fec4401e6 | 43,515 | js | JavaScript | cn/002239_d.js | daodao10/chart | 216d9b2fe3ebbcf84f4f0d253baf3072e0e4ce5f | [
"MIT"
] | 1 | 2021-07-13T01:51:12.000Z | 2021-07-13T01:51:12.000Z | cn/002239_d.js | daodao10/chart | 216d9b2fe3ebbcf84f4f0d253baf3072e0e4ce5f | [
"MIT"
] | null | null | null | cn/002239_d.js | daodao10/chart | 216d9b2fe3ebbcf84f4f0d253baf3072e0e4ce5f | [
"MIT"
] | null | null | null | var data=[['20080522',1.580],
['20080523',1.416],
['20080526',1.308],
['20080527',1.315],
['20080528',1.319],
['20080529',1.285],
['20080530',1.264],
['20080602',1.291],
['20080603',1.268],
['20080604',1.231],
['20080605',1.237],
['20080606',1.259],
['20080610',1.137],
['20080611',1.105],
['20080612',1.096],
['20080613',1.047],
['20080616',1.047],
['20080617',1.053],
['20080618',1.095],
['20080619',0.978],
['20080620',0.978],
['20080623',0.934],
['20080624',0.963],
['20080625',1.012],
['20080626',1.021],
['20080627',0.933],
['20080630',0.943],
['20080701',0.941],
['20080702',0.958],
['20080703',0.987],
['20080704',0.968],
['20080707',1.011],
['20080708',1.016],
['20080709',1.059],
['20080710',1.033],
['20080711',1.010],
['20080714',1.043],
['20080715',1.053],
['20080716',1.027],
['20080717',1.098],
['20080718',1.085],
['20080721',1.120],
['20080722',1.099],
['20080723',1.076],
['20080724',1.087],
['20080725',1.071],
['20080728',1.096],
['20080729',1.110],
['20080730',1.138],
['20080731',1.098],
['20080801',1.124],
['20080804',1.087],
['20080805',1.080],
['20080806',1.093],
['20080807',1.114],
['20080808',1.079],
['20080811',0.963],
['20080812',0.894],
['20080813',0.882],
['20080814',0.860],
['20080815',0.861],
['20080818',0.776],
['20080819',0.787],
['20080820',0.859],
['20080821',0.800],
['20080822',0.763],
['20080825',0.758],
['20080826',0.694],
['20080827',0.707],
['20080828',0.694],
['20080829',0.716],
['20080901',0.694],
['20080902',0.701],
['20080903',0.708],
['20080904',0.715],
['20080905',0.691],
['20080908',0.635],
['20080909',0.644],
['20080910',0.645],
['20080911',0.631],
['20080912',0.635],
['20080916',0.607],
['20080917',0.590],
['20080918',0.548],
['20080919',0.611],
['20080922',0.633],
['20080923',0.569],
['20080924',0.580],
['20080925',0.599],
['20080926',0.606],
['20081006',0.570],
['20081007',0.576],
['20081008',0.558],
['20081009',0.554],
['20081010',0.508],
['20081013',0.504],
['20081014',0.480],
['20081015',0.471],
['20081016',0.427],
['20081017',0.442],
['20081020',0.466],
['20081021',0.470],
['20081022',0.467],
['20081023',0.458],
['20081024',0.452],
['20081027',0.409],
['20081028',0.423],
['20081029',0.434],
['20081030',0.438],
['20081031',0.431],
['20081103',0.433],
['20081104',0.427],
['20081105',0.448],
['20081106',0.450],
['20081107',0.475],
['20081110',0.516],
['20081111',0.499],
['20081112',0.518],
['20081113',0.542],
['20081114',0.560],
['20081117',0.582],
['20081118',0.517],
['20081119',0.575],
['20081120',0.603],
['20081121',0.606],
['20081124',0.569],
['20081125',0.552],
['20081126',0.550],
['20081127',0.546],
['20081201',0.585],
['20081202',0.616],
['20081203',0.653],
['20081204',0.660],
['20081205',0.686],
['20081208',0.717],
['20081209',0.691],
['20081210',0.719],
['20081211',0.675],
['20081212',0.637],
['20081215',0.689],
['20081216',0.709],
['20081217',0.701],
['20081218',0.708],
['20081219',0.729],
['20081222',0.760],
['20081223',0.687],
['20081224',0.680],
['20081225',0.680],
['20081226',0.688],
['20081229',0.667],
['20081230',0.740],
['20081231',0.715],
['20090105',0.750],
['20090106',0.760],
['20090107',0.756],
['20090108',0.777],
['20090109',0.805],
['20090112',0.808],
['20090113',0.774],
['20090114',0.823],
['20090115',0.823],
['20090116',0.806],
['20090119',0.806],
['20090120',0.810],
['20090121',0.791],
['20090122',0.814],
['20090123',0.810],
['20090202',0.836],
['20090203',0.855],
['20090204',0.857],
['20090205',0.827],
['20090206',0.862],
['20090209',0.880],
['20090210',0.920],
['20090211',0.925],
['20090212',0.936],
['20090213',0.988],
['20090216',0.989],
['20090217',0.938],
['20090218',0.961],
['20090219',1.004],
['20090220',1.019],
['20090223',1.062],
['20090224',1.073],
['20090225',1.119],
['20090226',1.028],
['20090227',0.923],
['20090302',1.022],
['20090303',1.065],
['20090304',1.136],
['20090305',1.109],
['20090306',1.152],
['20090309',1.059],
['20090310',1.114],
['20090311',1.170],
['20090312',1.132],
['20090313',1.089],
['20090316',1.102],
['20090317',1.127],
['20090318',1.129],
['20090319',1.161],
['20090320',1.123],
['20090323',1.124],
['20090324',1.158],
['20090325',1.143],
['20090326',1.171],
['20090327',1.223],
['20090330',1.257],
['20090331',1.294],
['20090401',1.272],
['20090402',1.257],
['20090403',1.302],
['20090407',1.394],
['20090408',1.317],
['20090409',1.376],
['20090410',1.479],
['20090413',1.458],
['20090414',1.525],
['20090415',1.582],
['20090416',1.563],
['20090417',1.463],
['20090420',1.503],
['20090421',1.420],
['20090422',1.315],
['20090423',1.365],
['20090424',1.328],
['20090427',1.195],
['20090428',1.322],
['20090429',1.335],
['20090430',1.348],
['20090504',1.402],
['20090505',1.406],
['20090506',1.437],
['20090507',1.419],
['20090508',1.419],
['20090511',1.442],
['20090512',1.546],
['20090513',1.495],
['20090514',1.449],
['20090515',1.465],
['20090518',1.432],
['20090519',1.431],
['20090520',1.423],
['20090521',1.361],
['20090522',1.364],
['20090525',1.387],
['20090527',1.378],
['20090601',1.385],
['20090602',1.450],
['20090603',1.544],
['20090604',1.489],
['20090605',1.470],
['20090608',1.426],
['20090609',1.378],
['20090610',1.361],
['20090611',1.375],
['20090612',1.324],
['20090615',1.339],
['20090616',1.305],
['20090617',1.314],
['20090618',1.304],
['20090619',1.327],
['20090622',1.358],
['20090623',1.358],
['20090624',1.365],
['20090625',1.416],
['20090626',1.373],
['20090629',1.339],
['20090630',1.314],
['20090701',1.329],
['20090702',1.339],
['20090703',1.358],
['20090706',1.346],
['20090707',1.365],
['20090708',1.363],
['20090709',1.395],
['20090710',1.402],
['20090713',1.402],
['20090714',1.440],
['20090715',1.477],
['20090716',1.528],
['20090717',1.489],
['20090720',1.506],
['20090721',1.419],
['20090722',1.424],
['20090723',1.446],
['20090724',1.416],
['20090727',1.424],
['20090728',1.465],
['20090729',1.348],
['20090730',1.366],
['20090731',1.399],
['20090803',1.526],
['20090804',1.637],
['20090805',1.696],
['20090806',1.688],
['20090807',1.594],
['20090810',1.628],
['20090811',1.606],
['20090812',1.472],
['20090813',1.506],
['20090814',1.416],
['20090817',1.268],
['20090818',1.276],
['20090819',1.142],
['20090820',1.174],
['20090821',1.220],
['20090824',1.239],
['20090825',1.191],
['20090826',1.278],
['20090827',1.304],
['20090828',1.249],
['20090831',1.118],
['20090901',1.122],
['20090902',1.167],
['20090903',1.290],
['20090904',1.358],
['20090907',1.324],
['20090908',1.414],
['20090909',1.458],
['20090910',1.411],
['20090911',1.416],
['20090914',1.440],
['20090915',1.414],
['20090916',1.426],
['20090917',1.491],
['20090918',1.411],
['20090921',1.414],
['20090922',1.355],
['20090923',1.372],
['20090924',1.332],
['20090925',1.315],
['20090928',1.278],
['20090929',1.229],
['20090930',1.258],
['20091009',1.305],
['20091012',1.329],
['20091013',1.344],
['20091014',1.372],
['20091015',1.382],
['20091016',1.370],
['20091019',1.414],
['20091020',1.434],
['20091021',1.417],
['20091022',1.462],
['20091023',1.465],
['20091026',1.474],
['20091027',1.416],
['20091028',1.453],
['20091029',1.400],
['20091030',1.397],
['20091102',1.441],
['20091103',1.593],
['20091104',1.623],
['20091105',1.674],
['20091106',1.667],
['20091109',1.729],
['20091110',1.703],
['20091111',1.814],
['20091112',1.814],
['20091113',1.855],
['20091116',1.866],
['20091117',1.826],
['20091118',2.014],
['20091119',2.035],
['20091120',2.101],
['20091123',2.203],
['20091124',2.139],
['20091125',2.137],
['20091126',2.088],
['20091127',1.977],
['20091130',2.037],
['20091201',2.162],
['20091202',2.144],
['20091203',2.166],
['20091204',2.108],
['20091207',2.203],
['20091208',2.288],
['20091209',2.188],
['20091210',2.169],
['20091211',2.139],
['20091214',2.264],
['20091215',2.309],
['20091216',2.336],
['20091217',2.241],
['20091221',2.130],
['20091222',2.057],
['20091223',2.118],
['20091224',2.142],
['20091225',2.118],
['20091228',2.292],
['20091229',2.288],
['20091230',2.276],
['20091231',2.266],
['20100104',2.298],
['20100105',2.307],
['20100106',2.368],
['20100107',2.241],
['20100108',2.215],
['20100111',2.332],
['20100112',2.315],
['20100113',2.266],
['20100114',2.327],
['20100115',2.361],
['20100118',2.400],
['20100119',2.407],
['20100120',2.300],
['20100121',2.130],
['20100122',2.043],
['20100125',2.052],
['20100126',1.924],
['20100127',1.872],
['20100128',1.855],
['20100129',1.894],
['20100201',1.955],
['20100202',1.904],
['20100203',1.900],
['20100204',2.089],
['20100205',2.001],
['20100208',1.929],
['20100209',1.914],
['20100210',1.955],
['20100211',1.900],
['20100212',1.914],
['20100222',1.923],
['20100223',1.878],
['20100224',1.931],
['20100225',1.986],
['20100226',1.992],
['20100301',2.003],
['20100302',2.020],
['20100303',2.110],
['20100304',1.999],
['20100305',2.003],
['20100308',2.006],
['20100309',1.999],
['20100310',1.946],
['20100311',1.894],
['20100312',1.885],
['20100315',1.861],
['20100316',1.856],
['20100317',1.926],
['20100318',1.951],
['20100319',1.982],
['20100322',1.997],
['20100323',1.979],
['20100324',2.028],
['20100325',1.953],
['20100326',1.996],
['20100329',2.014],
['20100330',2.079],
['20100331',2.106],
['20100401',2.108],
['20100402',2.057],
['20100406',2.079],
['20100407',2.137],
['20100408',2.142],
['20100409',2.195],
['20100412',2.212],
['20100413',2.212],
['20100414',2.219],
['20100415',2.186],
['20100416',2.150],
['20100419',2.023],
['20100420',2.098],
['20100421',2.135],
['20100422',2.116],
['20100423',2.067],
['20100426',2.140],
['20100427',2.086],
['20100428',2.042],
['20100429',2.003],
['20100430',1.797],
['20100504',1.815],
['20100505',1.883],
['20100506',1.902],
['20100507',1.916],
['20100510',1.934],
['20100511',1.872],
['20100512',1.899],
['20100513',1.951],
['20100514',1.912],
['20100517',1.736],
['20100518',1.649],
['20100519',1.654],
['20100520',1.582],
['20100524',1.688],
['20100525',1.734],
['20100526',1.756],
['20100527',1.785],
['20100528',1.802],
['20100531',1.727],
['20100601',1.778],
['20100602',1.831],
['20100603',1.846],
['20100604',1.851],
['20100607',1.875],
['20100608',1.875],
['20100609',1.909],
['20100610',1.914],
['20100611',1.943],
['20100617',1.946],
['20100618',1.951],
['20100621',1.992],
['20100622',1.999],
['20100623',1.999],
['20100624',2.006],
['20100625',2.004],
['20100628',1.969],
['20100629',1.977],
['20100630',1.969],
['20100701',1.967],
['20100702',2.001],
['20100705',1.972],
['20100706',1.977],
['20100707',1.982],
['20100708',1.986],
['20100709',1.974],
['20100712',2.128],
['20100713',2.003],
['20100714',1.880],
['20100715',1.783],
['20100716',1.843],
['20100719',1.841],
['20100720',1.856],
['20100721',1.844],
['20100722',1.849],
['20100723',1.848],
['20100726',1.917],
['20100727',1.877],
['20100728',1.892],
['20100729',1.875],
['20100730',1.838],
['20100802',1.882],
['20100803',1.873],
['20100804',1.853],
['20100805',1.849],
['20100806',1.872],
['20100809',1.940],
['20100810',1.877],
['20100811',1.868],
['20100812',1.824],
['20100813',1.849],
['20100816',1.885],
['20100817',1.889],
['20100818',1.926],
['20100819',1.917],
['20100820',1.946],
['20100823',2.016],
['20100824',1.974],
['20100825',1.875],
['20100826',1.883],
['20100827',1.861],
['20100830',1.899],
['20100831',1.916],
['20100901',1.875],
['20100902',1.897],
['20100903',1.883],
['20100906',1.917],
['20100907',1.943],
['20100908',1.928],
['20100909',1.885],
['20100910',1.892],
['20100913',1.911],
['20100914',1.916],
['20100915',1.948],
['20100916',1.868],
['20100917',1.849],
['20100920',1.790],
['20100921',1.775],
['20100927',1.819],
['20100928',1.770],
['20100929',1.785],
['20100930',1.790],
['20101008',1.826],
['20101011',1.819],
['20101012',1.815],
['20101013',1.826],
['20101014',1.814],
['20101015',1.839],
['20101018',1.834],
['20101019',1.841],
['20101020',1.856],
['20101021',1.824],
['20101022',1.824],
['20101025',1.844],
['20101026',1.839],
['20101027',1.843],
['20101028',1.827],
['20101029',1.844],
['20101101',1.873],
['20101102',1.855],
['20101103',1.865],
['20101104',1.883],
['20101105',1.929],
['20101108',1.974],
['20101109',1.941],
['20101110',1.951],
['20101111',1.974],
['20101112',1.797],
['20101115',1.817],
['20101116',1.739],
['20101117',1.739],
['20101118',1.756],
['20101119',1.788],
['20101122',1.824],
['20101123',1.787],
['20101124',1.841],
['20101125',1.843],
['20101126',1.797],
['20101129',1.798],
['20101130',1.732],
['20101201',1.771],
['20101202',1.882],
['20101203',1.906],
['20101206',1.948],
['20101207',1.880],
['20101208',1.800],
['20101209',1.737],
['20101210',1.776],
['20101213',1.805],
['20101214',1.804],
['20101215',1.807],
['20101216',1.858],
['20101217',1.834],
['20101220',1.787],
['20101221',1.827],
['20101222',1.788],
['20101223',1.759],
['20101224',1.773],
['20101227',1.727],
['20101228',1.633],
['20101229',1.669],
['20101230',1.666],
['20101231',1.696],
['20110104',1.705],
['20110105',1.719],
['20110106',1.695],
['20110107',1.698],
['20110110',1.649],
['20110111',1.622],
['20110112',1.666],
['20110113',1.659],
['20110114',1.667],
['20110117',1.564],
['20110118',1.569],
['20110119',1.586],
['20110120',1.503],
['20110121',1.501],
['20110124',1.460],
['20110125',1.436],
['20110126',1.528],
['20110127',1.518],
['20110128',1.514],
['20110131',1.528],
['20110201',1.521],
['20110209',1.487],
['20110210',1.520],
['20110211',1.548],
['20110214',1.610],
['20110215',1.594],
['20110216',1.661],
['20110217',1.642],
['20110218',1.639],
['20110221',1.659],
['20110222',1.661],
['20110223',1.671],
['20110224',1.628],
['20110225',1.615],
['20110228',1.650],
['20110301',1.652],
['20110302',1.644],
['20110303',1.650],
['20110304',1.684],
['20110307',1.707],
['20110308',1.698],
['20110309',1.688],
['20110310',1.684],
['20110311',1.696],
['20110314',1.730],
['20110315',1.764],
['20110316',1.747],
['20110317',1.742],
['20110318',1.746],
['20110321',1.693],
['20110322',1.684],
['20110323',1.695],
['20110324',1.705],
['20110325',1.686],
['20110328',1.684],
['20110329',1.690],
['20110330',1.659],
['20110331',1.610],
['20110401',1.627],
['20110406',1.628],
['20110407',1.615],
['20110408',1.623],
['20110411',1.705],
['20110412',1.713],
['20110413',1.730],
['20110414',1.768],
['20110415',1.822],
['20110418',1.766],
['20110419',1.708],
['20110420',1.739],
['20110421',1.708],
['20110422',1.671],
['20110425',1.673],
['20110426',1.622],
['20110427',1.611],
['20110428',1.666],
['20110429',1.630],
['20110503',1.637],
['20110504',1.584],
['20110505',1.543],
['20110506',1.538],
['20110509',1.535],
['20110510',1.545],
['20110511',1.552],
['20110512',1.525],
['20110513',1.540],
['20110516',1.560],
['20110517',1.574],
['20110518',1.564],
['20110519',1.552],
['20110520',1.503],
['20110523',1.416],
['20110524',1.397],
['20110525',1.366],
['20110526',1.353],
['20110530',1.295],
['20110531',1.322],
['20110601',1.326],
['20110602',1.281],
['20110603',1.297],
['20110607',1.321],
['20110608',1.373],
['20110609',1.339],
['20110610',1.331],
['20110613',1.309],
['20110614',1.326],
['20110615',1.326],
['20110616',1.295],
['20110617',1.293],
['20110620',1.222],
['20110621',1.229],
['20110622',1.224],
['20110623',1.239],
['20110624',1.280],
['20110627',1.307],
['20110628',1.319],
['20110629',1.276],
['20110630',1.298],
['20110701',1.314],
['20110704',1.370],
['20110705',1.424],
['20110706',1.428],
['20110707',1.411],
['20110708',1.402],
['20110711',1.385],
['20110712',1.349],
['20110713',1.378],
['20110714',1.389],
['20110715',1.404],
['20110718',1.412],
['20110719',1.397],
['20110720',1.448],
['20110721',1.475],
['20110722',1.414],
['20110725',1.310],
['20110726',1.298],
['20110727',1.314],
['20110728',1.292],
['20110729',1.298],
['20110801',1.322],
['20110802',1.317],
['20110803',1.321],
['20110804',1.334],
['20110805',1.283],
['20110808',1.169],
['20110809',1.127],
['20110810',1.142],
['20110811',1.159],
['20110812',1.176],
['20110815',1.200],
['20110816',1.188],
['20110817',1.176],
['20110818',1.154],
['20110819',1.144],
['20110822',1.147],
['20110823',1.193],
['20110824',1.195],
['20110825',1.220],
['20110826',1.227],
['20110829',1.201],
['20110830',1.195],
['20110831',1.186],
['20110901',1.178],
['20110902',1.171],
['20110905',1.171],
['20110906',1.207],
['20110907',1.331],
['20110908',1.273],
['20110909',1.271],
['20110913',1.351],
['20110914',1.361],
['20110915',1.336],
['20110916',1.312],
['20110919',1.448],
['20110920',1.501],
['20110921',1.543],
['20110922',1.508],
['20110923',1.504],
['20110926',1.511],
['20110927',1.496],
['20110928',1.569],
['20110929',1.569],
['20110930',1.581],
['20111010',1.613],
['20111011',1.616],
['20111012',1.669],
['20111013',1.676],
['20111014',1.705],
['20111017',1.727],
['20111018',1.676],
['20111019',1.647],
['20111020',1.639],
['20111021',1.625],
['20111024',1.531],
['20111025',1.690],
['20111026',1.710],
['20111027',1.700],
['20111028',1.754],
['20111031',1.749],
['20111101',1.768],
['20111102',1.766],
['20111103',1.734],
['20111104',1.722],
['20111107',1.754],
['20120105',1.574],
['20120106',1.411],
['20120109',1.377],
['20120110',1.351],
['20120111',1.310],
['20120112',1.293],
['20120113',1.159],
['20120116',1.055],
['20120117',1.130],
['20120118',1.045],
['20120119',1.060],
['20120120',1.071],
['20120130',1.084],
['20120131',1.084],
['20120201',1.144],
['20120202',1.142],
['20120206',1.164],
['20120207',1.173],
['20120208',1.191],
['20120209',1.181],
['20120210',1.196],
['20120213',1.200],
['20120214',1.184],
['20120215',1.213],
['20120216',1.242],
['20120217',1.213],
['20120220',1.224],
['20120221',1.230],
['20120222',1.249],
['20120223',1.270],
['20120224',1.288],
['20120227',1.275],
['20120228',1.253],
['20120229',1.236],
['20120301',1.244],
['20120302',1.264],
['20120305',1.253],
['20120306',1.224],
['20120307',1.224],
['20120308',1.237],
['20120309',1.259],
['20120312',1.266],
['20120313',1.288],
['20120314',1.191],
['20120315',1.140],
['20120316',1.169],
['20120319',1.196],
['20120320',1.162],
['20120321',1.283],
['20120322',1.322],
['20120323',1.344],
['20120326',1.377],
['20120327',1.518],
['20120328',1.429],
['20120329',1.492],
['20120330',1.339],
['20120405',1.389],
['20120406',1.411],
['20120409',1.475],
['20120410',1.491],
['20120411',1.462],
['20120412',1.446],
['20120413',1.423],
['20120416',1.378],
['20120417',1.392],
['20120418',1.434],
['20120419',1.475],
['20120420',1.475],
['20120423',1.382],
['20120424',1.346],
['20120425',1.363],
['20120426',1.341],
['20120427',1.304],
['20120502',1.334],
['20120503',1.349],
['20120504',1.358],
['20120507',1.344],
['20120508',1.394],
['20120509',1.368],
['20120510',1.406],
['20120511',1.440],
['20120514',1.434],
['20120515',1.399],
['20120516',1.390],
['20120517',1.394],
['20120518',1.346],
['20120521',1.402],
['20120522',1.492],
['20120523',1.496],
['20120524',1.460],
['20120525',1.486],
['20120529',1.509],
['20120530',1.492],
['20120531',1.450],
['20120601',1.474],
['20120604',1.513],
['20120605',1.669],
['20120606',1.841],
['20120607',1.795],
['20120608',1.768],
['20120611',1.703],
['20120612',1.649],
['20120613',1.678],
['20120614',1.611],
['20120615',1.647],
['20120618',1.628],
['20120619',1.678],
['20120620',1.632],
['20120621',1.521],
['20120625',1.450],
['20120626',1.438],
['20120627',1.392],
['20120628',1.329],
['20120629',1.329],
['20120702',1.346],
['20120703',1.414],
['20120704',1.397],
['20120705',1.343],
['20120706',1.394],
['20120709',1.353],
['20120710',1.270],
['20120711',1.288],
['20120712',1.341],
['20120713',1.353],
['20120716',1.263],
['20120717',1.278],
['20120718',1.319],
['20120719',1.341],
['20120720',1.321],
['20120723',1.348],
['20120724',1.338],
['20120725',1.334],
['20120726',1.288],
['20120727',1.288],
['20120730',1.154],
['20120731',1.147],
['20120801',1.162],
['20120802',1.154],
['20120803',1.186],
['20120806',1.220],
['20120807',1.348],
['20120808',1.487],
['20120809',1.640],
['20120810',1.550],
['20120813',1.474],
['20120814',1.506],
['20120815',1.457],
['20120816',1.436],
['20120817',1.409],
['20120820',1.470],
['20120821',1.470],
['20120822',1.440],
['20120823',1.433],
['20120824',1.446],
['20120827',1.484],
['20120828',1.426],
['20120829',1.397],
['20120830',1.338],
['20120831',1.344],
['20120903',1.366],
['20120904',1.366],
['20120905',1.378],
['20120906',1.407],
['20120907',1.465],
['20120910',1.472],
['20120911',1.482],
['20120912',1.472],
['20120913',1.431],
['20120914',1.463],
['20120917',1.458],
['20120918',1.416],
['20120919',1.440],
['20120920',1.474],
['20120921',1.491],
['20120924',1.463],
['20120925',1.438],
['20120926',1.436],
['20120927',1.474],
['20120928',1.531],
['20121008',1.516],
['20121009',1.571],
['20121010',1.639],
['20121011',1.652],
['20121012',1.606],
['20121015',1.601],
['20121016',1.700],
['20121017',1.700],
['20121018',1.719],
['20121019',1.737],
['20121022',1.724],
['20121023',1.657],
['20121024',1.596],
['20121025',1.654],
['20121026',1.650],
['20121029',1.667],
['20121030',1.674],
['20121031',1.657],
['20121101',1.713],
['20121102',1.717],
['20121105',1.649],
['20121106',1.564],
['20121107',1.565],
['20121108',1.528],
['20121109',1.560],
['20121112',1.571],
['20121113',1.545],
['20121114',1.554],
['20121115',1.601],
['20121116',1.593],
['20121119',1.565],
['20121120',1.562],
['20121121',1.565],
['20121122',1.513],
['20121123',1.514],
['20121126',1.499],
['20121127',1.516],
['20121128',1.508],
['20121129',1.499],
['20121228',1.654],
['20121231',1.824],
['20130104',2.011],
['20130107',2.217],
['20130108',2.128],
['20130109',2.069],
['20130110',2.062],
['20130111',2.081],
['20130114',2.105],
['20130115',2.062],
['20130116',2.038],
['20130117',1.865],
['20130118',1.906],
['20130121',1.940],
['20130122',1.917],
['20130123',1.931],
['20130124',1.951],
['20130125',1.907],
['20130128',1.907],
['20130129',1.941],
['20130130',1.899],
['20130131',1.948],
['20130201',1.979],
['20130204',1.917],
['20130205',1.948],
['20130206',1.960],
['20130207',1.969],
['20130208',1.969],
['20130218',1.919],
['20130219',1.897],
['20130220',1.917],
['20130221',1.853],
['20130222',1.900],
['20130225',1.904],
['20130226',1.887],
['20130227',1.907],
['20130228',1.926],
['20130301',1.984],
['20130304',1.999],
['20130305',2.037],
['20130306',2.013],
['20130307',1.974],
['20130308',1.982],
['20130311',1.921],
['20130312',1.883],
['20130313',1.917],
['20130314',1.883],
['20130315',1.907],
['20130318',1.865],
['20130319',1.899],
['20130320',1.929],
['20130321',1.967],
['20130322',1.957],
['20130325',1.936],
['20130326',1.866],
['20130327',1.819],
['20130328',1.724],
['20130329',1.848],
['20130401',1.885],
['20130402',1.906],
['20130403',1.863],
['20130408',1.815],
['20130409',1.805],
['20130410',1.778],
['20130411',1.856],
['20130412',1.863],
['20130415',1.836],
['20130416',1.805],
['20130417',1.819],
['20130418',1.771],
['20130419',1.768],
['20130422',1.778],
['20130423',1.751],
['20130424',1.756],
['20130425',1.666],
['20130426',1.649],
['20130502',1.698],
['20130503',1.708],
['20130506',1.720],
['20130507',1.707],
['20130508',1.679],
['20130509',1.713],
['20130510',1.742],
['20130513',1.715],
['20130514',1.695],
['20130515',1.698],
['20130516',1.717],
['20130517',1.720],
['20130520',1.742],
['20130521',1.741],
['20130522',1.776],
['20130523',1.744],
['20130524',1.742],
['20130527',1.790],
['20130528',1.787],
['20130529',1.768],
['20130530',1.853],
['20130531',1.827],
['20130603',1.851],
['20130604',1.916],
['20130605',1.914],
['20130606',1.798],
['20130607',1.725],
['20130613',1.591],
['20130614',1.605],
['20130617',1.615],
['20130618',1.593],
['20130619',1.547],
['20130620',1.477],
['20130621',1.465],
['20130624',1.616],
['20130625',1.690],
['20130626',1.773],
['20130627',1.683],
['20130628',1.622],
['20130701',1.713],
['20130702',1.698],
['20130703',1.630],
['20130704',1.679],
['20130705',1.622],
['20130708',1.465],
['20130709',1.486],
['20130710',1.545],
['20130711',1.582],
['20130712',1.542],
['20130715',1.574],
['20130716',1.620],
['20130717',1.550],
['20130718',1.548],
['20130719',1.489],
['20130722',1.521],
['20130723',1.554],
['20130724',1.548],
['20130725',1.513],
['20130726',1.492],
['20130729',1.492],
['20130730',1.645],
['20130731',1.605],
['20130801',1.611],
['20130802',1.594],
['20130805',1.610],
['20130806',1.615],
['20130807',1.635],
['20130808',1.642],
['20130809',1.691],
['20130812',1.705],
['20130813',1.691],
['20130814',1.667],
['20130815',1.656],
['20130816',1.601],
['20130819',1.639],
['20130820',1.625],
['20130821',1.674],
['20130822',1.662],
['20130823',1.630],
['20130826',1.686],
['20130827',1.684],
['20130828',1.708],
['20130829',1.671],
['20130830',1.615],
['20130902',1.630],
['20130903',1.662],
['20130904',1.657],
['20130905',1.633],
['20130906',1.637],
['20130909',1.674],
['20130910',1.664],
['20130911',1.627],
['20130912',1.625],
['20130913',1.635],
['20130916',1.630],
['20130917',1.579],
['20130918',1.611],
['20130923',1.628],
['20130924',1.613],
['20130925',1.611],
['20130926',1.571],
['20130927',1.582],
['20130930',1.598],
['20131008',1.613],
['20131009',1.625],
['20131010',1.632],
['20131011',1.656],
['20131014',1.734],
['20131015',1.810],
['20131016',1.793],
['20131017',1.844],
['20131018',1.911],
['20131022',2.106],
['20131023',2.200],
['20131024',2.305],
['20131025',2.237],
['20131028',2.195],
['20131029',2.179],
['20131030',2.288],
['20131031',2.219],
['20131101',2.064],
['20131104',1.987],
['20131105',2.052],
['20131106',2.001],
['20131107',1.967],
['20131108',2.008],
['20131111',1.967],
['20131112',2.064],
['20131113',2.021],
['20131114',1.822],
['20131115',1.836],
['20131118',1.868],
['20131119',1.856],
['20131120',1.877],
['20131121',1.858],
['20131122',1.834],
['20131125',1.821],
['20131126',1.878],
['20131127',1.919],
['20131128',1.889],
['20131129',1.878],
['20131202',1.698],
['20131203',1.722],
['20131204',1.766],
['20131205',1.736],
['20131206',1.707],
['20131209',1.747],
['20131210',1.754],
['20131211',1.739],
['20131212',1.761],
['20131213',1.798],
['20131216',1.780],
['20131217',1.875],
['20131218',1.960],
['20131219',1.894],
['20131220',1.855],
['20131223',1.958],
['20131224',1.951],
['20131225',1.926],
['20131226',2.013],
['20131227',2.060],
['20131230',2.156],
['20131231',2.091],
['20140102',2.149],
['20140103',2.285],
['20140106',2.111],
['20140107',2.045],
['20140108',2.052],
['20140109',1.923],
['20140110',1.931],
['20140113',1.958],
['20140114',2.008],
['20140115',2.020],
['20140116',2.059],
['20140117',2.045],
['20140120',2.040],
['20140121',2.091],
['20140122',2.103],
['20140123',2.116],
['20140124',2.115],
['20140127',2.116],
['20140128',2.077],
['20140129',2.167],
['20140130',2.145],
['20140207',2.145],
['20140227',1.926],
['20140228',1.771],
['20140303',1.795],
['20140304',1.778],
['20140305',1.822],
['20140306',1.887],
['20140307',1.856],
['20140310',1.761],
['20140311',1.814],
['20140312',1.882],
['20140313',1.846],
['20140314',1.826],
['20140317',1.861],
['20140318',1.860],
['20140319',1.851],
['20140320',1.790],
['20140321',1.819],
['20140324',1.819],
['20140325',1.826],
['20140326',1.853],
['20140327',1.800],
['20140328',1.727],
['20140331',1.693],
['20140401',1.744],
['20140402',1.720],
['20140403',1.734],
['20140404',1.754],
['20140408',1.775],
['20140409',1.802],
['20140410',1.798],
['20140411',1.810],
['20140414',1.783],
['20140415',1.754],
['20140416',1.766],
['20140417',1.770],
['20140418',1.766],
['20140421',1.787],
['20140422',1.831],
['20140423',1.827],
['20140424',1.821],
['20140425',1.841],
['20140428',1.652],
['20140429',1.669],
['20140430',1.727],
['20140505',1.696],
['20140506',1.683],
['20140507',1.613],
['20140508',1.594],
['20140509',1.560],
['20140512',1.596],
['20140513',1.598],
['20140514',1.622],
['20140515',1.564],
['20140516',1.582],
['20140519',1.565],
['20140520',1.576],
['20140521',1.582],
['20140522',1.601],
['20140523',1.633],
['20140526',1.630],
['20140527',1.639],
['20140528',1.637],
['20140529',1.618],
['20140530',1.596],
['20140603',1.647],
['20140604',1.673],
['20140605',1.656],
['20140606',1.671],
['20140609',1.686],
['20140610',1.696],
['20140611',1.686],
['20140612',1.664],
['20140613',1.836],
['20140616',1.851],
['20140617',1.875],
['20140618',1.861],
['20140619',1.776],
['20140620',1.853],
['20140623',1.832],
['20140624',1.853],
['20140625',1.848],
['20140626',1.863],
['20140627',1.921],
['20140630',1.900],
['20140701',1.889],
['20140702',1.880],
['20140703',1.897],
['20140704',1.892],
['20140707',1.836],
['20140708',1.856],
['20140709',1.798],
['20140710',1.831],
['20140711',1.829],
['20140714',1.834],
['20140715',1.831],
['20140716',1.798],
['20140717',1.770],
['20140718',1.753],
['20141222',1.931],
['20141223',2.128],
['20141224',2.346],
['20141225',2.585],
['20141226',2.478],
['20141229',2.314],
['20141230',2.239],
['20141231',2.235],
['20150105',2.196],
['20150106',2.210],
['20150107',2.203],
['20150108',2.142],
['20150109',2.114],
['20150112',2.167],
['20150113',2.142],
['20150114',2.035],
['20150115',2.121],
['20150116',2.185],
['20150119',2.185],
['20150120',2.303],
['20150121',2.335],
['20150122',2.478],
['20150123',2.385],
['20150126',2.410],
['20150127',2.356],
['20150128',2.431],
['20150129',2.460],
['20150130',2.364],
['20150202',2.353],
['20150203',2.414],
['20150204',2.481],
['20150205',2.424],
['20150206',2.349],
['20150209',2.292],
['20150210',2.310],
['20150211',2.299],
['20150212',2.281],
['20150213',2.406],
['20150216',2.456],
['20150217',2.424],
['20150225',2.671],
['20150226',2.653],
['20150227',2.839],
['20150302',2.924],
['20150303',2.835],
['20150304',2.842],
['20150305',2.864],
['20150306',2.803],
['20150309',2.864],
['20150310',2.892],
['20150311',2.878],
['20150312',2.799],
['20150313',2.831],
['20150316',2.885],
['20150317',3.178],
['20150318',3.324],
['20150319',3.260],
['20150320',3.260],
['20150323',3.260],
['20150324',3.392],
['20150325',3.478],
['20150326',3.278],
['20150327',3.342],
['20150330',3.389],
['20150331',3.489],
['20150401',3.674],
['20150414',4.046],
['20150415',4.453],
['20150416',4.189],
['20150417',3.971],
['20150420',4.078],
['20150421',4.099],
['20150422',4.103],
['20150423',4.442],
['20150424',4.410],
['20150427',4.364],
['20150428',4.099],
['20150429',4.078],
['20150430',4.078],
['20150504',4.456],
['20150505',4.621],
['20150506',4.739],
['20150507',4.792],
['20150508',5.206],
['20150511',5.714],
['20150512',5.721],
['20150513',5.617],
['20150514',5.817],
['20150515',6.106],
['20150518',6.110],
['20150519',6.046],
['20150520',6.021],
['20150521',6.317],
['20150522',6.506],
['20160105',5.853],
['20160106',5.264],
['20160107',4.735],
['20160108',4.946],
['20160111',4.449],
['20160112',4.035],
['20160113',4.160],
['20160114',4.581],
['20160115',4.760],
['20160118',4.696],
['20160119',4.767],
['20160120',4.414],
['20160121',4.271],
['20160122',4.306],
['20160125',4.260],
['20160126',3.985],
['20160127',3.785],
['20160128',3.406],
['20160129',3.628],
['20160201',3.603],
['20160202',3.739],
['20160203',3.664],
['20160204',3.739],
['20160205',4.071],
['20160215',3.949],
['20160216',4.103],
['20160217',4.121],
['20160218',4.071],
['20160219',4.010],
['20160222',4.053],
['20160223',3.989],
['20160224',4.106],
['20160225',3.764],
['20160226',3.767],
['20160229',3.599],
['20160301',3.628],
['20160302',3.835],
['20160303',3.785],
['20160304',3.631],
['20160307',3.699],
['20160308',3.689],
['20160309',3.639],
['20160310',3.585],
['20160311',3.614],
['20160314',3.721],
['20160315',3.614],
['20160316',3.578],
['20160317',3.642],
['20160318',3.785],
['20160321',4.167],
['20160322',4.074],
['20160323',4.089],
['20160324',4.024],
['20160325',3.996],
['20160328',3.914],
['20160329',3.724],
['20160330',3.999],
['20160331',4.403],
['20160401',4.517],
['20160405',4.803],
['20160406',4.706],
['20160407',4.849],
['20160408',4.706],
['20160411',4.781],
['20160412',4.724],
['20160413',4.853],
['20160414',4.860],
['20160422',4.564],
['20160425',4.399],
['20160426',4.467],
['20160427',4.403],
['20160428',4.317],
['20160429',4.474],
['20160503',4.564],
['20160504',4.753],
['20160505',4.728],
['20160506',4.464],
['20160509',4.124],
['20160510',4.131],
['20160511',4.210],
['20160512',4.342],
['20160513',4.303],
['20160516',4.421],
['20160517',4.253],
['20160518',4.024],
['20160519',4.031],
['20160520',4.089],
['20160523',4.360],
['20160524',4.553],
['20160525',4.571],
['20160526',4.589],
['20160527',4.542],
['20160530',4.481],
['20160531',4.721],
['20160601',4.885],
['20160602',4.881],
['20160603',4.949],
['20160606',4.981],
['20160607',4.910],
['20160608',4.974],
['20160613',4.856],
['20160614',4.839],
['20160615',5.328],
['20160616',5.631],
['20160617',5.685],
['20160620',5.635],
['20160621',5.664],
['20160622',5.714],
['20160623',5.674],
['20160624',5.742],
['20160627',5.849],
['20160628',6.039],
['20160629',5.824],
['20160630',5.717],
['20160701',5.767],
['20160704',5.756],
['20160705',5.821],
['20160706',5.831],
['20160707',6.035],
['20160708',5.967],
['20160711',5.921],
['20160712',5.860],
['20160713',5.742],
['20160714',5.796],
['20160715',5.660],
['20160718',5.689],
['20160719',5.742],
['20160720',5.756],
['20160721',5.731],
['20160722',5.556],
['20160725',5.528],
['20160726',5.685],
['20160727',5.649],
['20160728',5.539],
['20160729',5.681],
['20160801',5.574],
['20160802',5.564],
['20160803',5.528],
['20160804',5.410],
['20160805',5.421],
['20160808',5.478],
['20160809',5.767],
['20160810',5.771],
['20160811',5.678],
['20160812',5.856],
['20160815',5.967],
['20160816',5.928],
['20160817',5.928],
['20160818',5.928],
['20160819',5.889],
['20160822',5.699],
['20160823',6.053],
['20160824',5.828],
['20160825',5.721],
['20160826',5.731],
['20160829',5.624],
['20160830',5.635],
['20160831',5.635],
['20160901',5.578],
['20160902',5.606],
['20160905',5.731],
['20160906',5.739],
['20160907',5.874],
['20160908',5.839],
['20160909',5.767],
['20160912',5.499],
['20160913',5.549],
['20160914',5.496],
['20160919',5.464],
['20160920',5.464],
['20160921',5.596],
['20160922',5.567],
['20160923',5.521],
['20160926',5.392],
['20160927',5.460],
['20160928',5.435],
['20160929',5.421],
['20160930',5.446],
['20161010',5.589],
['20161011',5.631],
['20161012',5.742],
['20161013',5.631],
['20161014',5.610],
['20161017',5.567],
['20170207',5.924],
['20170208',5.374],
['20170209',5.260],
['20170210',5.060],
['20170213',4.971],
['20170214',4.953],
['20170215',4.910],
['20170216',4.849],
['20170217',4.706],
['20170220',4.731],
['20170221',4.792],
['20170222',4.728],
['20170223',4.699],
['20170224',4.721],
['20170227',4.821],
['20170228',5.024],
['20170301',5.006],
['20170302',4.921],
['20170303',5.006],
['20170306',5.028],
['20170307',5.039],
['20170308',4.985],
['20170309',4.899],
['20170310',4.967],
['20170313',5.010],
['20170314',4.960],
['20170315',4.953],
['20170316',4.996],
['20170317',4.999],
['20170320',5.010],
['20170321',5.067],
['20170322',4.996],
['20170323',4.978],
['20170324',4.953],
['20170327',4.928],
['20170328',4.996],
['20170329',4.914],
['20170330',4.728],
['20170331',4.753],
['20170405',4.928],
['20170406',5.006],
['20170407',4.971],
['20170410',4.824],
['20170411',4.903],
['20170412',4.924],
['20170413',4.956],
['20170414',4.881],
['20170417',4.796],
['20170418',4.746],
['20170419',4.774],
['20170420',4.739],
['20170421',4.739],
['20170424',4.492],
['20170425',4.478],
['20170426',4.531],
['20170427',4.396],
['20170428',4.360],
['20170502',4.274],
['20170503',4.435],
['20170504',4.389],
['20170505',4.424],
['20170508',4.353],
['20170509',4.367],
['20170510',4.256],
['20170511',4.074],
['20170512',4.089],
['20170515',4.031],
['20170516',4.085],
['20170517',4.131],
['20170518',4.053],
['20170519',4.131],
['20170522',4.096],
['20170523',4.067],
['20170524',4.106],
['20170525',4.135],
['20170526',4.135],
['20170531',4.135],
['20170601',4.064],
['20170602',4.081],
['20170605',4.121],
['20170606',4.149],
['20170607',4.317],
['20170608',4.335],
['20170609',4.356],
['20170612',4.360],
['20170613',4.517],
['20170614',4.496],
['20170615',4.614],
['20170616',4.599],
['20170619',4.517],
['20170620',4.505],
['20170621',4.405],
['20170622',4.195],
['20170623',4.235],
['20170626',4.285],
['20170627',4.275],
['20170628',4.265],
['20170629',4.285],
['20170630',4.315],
['20170703',4.495],
['20170704',4.525],
['20170705',4.535],
['20170706',4.535],
['20170707',4.495],
['20170710',4.405],
['20170711',4.355],
['20170712',4.295],
['20170713',4.285],
['20170714',4.275],
['20170717',4.085],
['20170718',4.085],
['20170719',4.135],
['20170720',4.115],
['20170721',4.065],
['20170724',4.045],
['20170725',4.225],
['20170726',4.195],
['20170727',4.195],
['20170728',4.185],
['20170731',4.185],
['20170801',4.445],
['20170802',4.305],
['20170803',4.235],
['20170804',4.265],
['20170807',4.195],
['20170808',4.225],
['20170809',4.215],
['20170810',4.145],
['20170811',4.135],
['20170814',4.175],
['20170815',4.175],
['20170816',4.175],
['20170817',4.185],
['20170818',4.165],
['20170821',4.185],
['20170822',4.165],
['20170823',4.135],
['20170824',4.095],
['20170825',4.125],
['20170828',4.095],
['20170829',4.085],
['20170830',4.105],
['20170831',4.075],
['20170901',4.085],
['20170904',4.065],
['20170905',4.065],
['20170906',4.085],
['20170907',4.025],
['20170908',3.995],
['20170911',4.395],
['20170912',4.835],
['20170913',5.325],
['20170914',5.585],
['20170915',5.185],
['20170918',5.175],
['20170919',5.235],
['20170920',5.295],
['20170921',5.145],
['20170922',5.015],
['20170925',4.705],
['20170926',4.725],
['20170927',4.785],
['20170928',4.755],
['20170929',4.735],
['20171009',4.855],
['20171010',4.805],
['20171011',4.675],
['20171012',4.685],
['20171013',4.655],
['20171016',4.485],
['20171017',4.505],
['20171018',4.385],
['20171019',4.365],
['20171020',4.435],
['20171023',4.405],
['20171024',4.345],
['20171025',4.375],
['20171026',4.325],
['20171027',4.195],
['20171030',4.035],
['20171031',4.085],
['20171101',4.085],
['20171102',4.045],
['20171103',4.055],
['20171106',4.085],
['20171107',4.055],
['20171108',4.115],
['20171109',4.155],
['20171110',4.085],
['20171113',4.035],
['20171114',4.035],
['20171115',4.005],
['20171116',4.005],
['20171117',3.865],
['20171120',3.855],
['20171121',3.765],
['20171122',4.145],
['20171123',4.205],
['20171124',4.105],
['20171127',3.985],
['20171128',3.985],
['20171129',3.965],
['20171130',3.875],
['20171201',3.895],
['20171204',3.815],
['20171205',3.695],
['20171206',3.745],
['20171207',3.795],
['20171208',3.945],
['20171211',3.955],
['20171212',3.945],
['20171213',3.945],
['20171214',4.015],
['20171215',3.945],
['20171218',3.985],
['20171219',3.965],
['20171220',3.965],
['20171221',3.965],
['20171222',3.995],
['20171225',3.975],
['20171226',4.015],
['20171227',4.045],
['20171228',4.025],
['20171229',4.025],
['20180102',4.035],
['20180103',4.075],
['20180104',4.095],
['20180105',4.055],
['20180108',4.035],
['20180109',4.005],
['20180110',3.935],
['20180111',3.955],
['20180112',3.915],
['20180115',3.845],
['20180116',3.855],
['20180117',3.835],
['20180118',3.825],
['20180119',3.825],
['20180122',3.825],
['20180123',3.835],
['20180124',3.825],
['20180125',3.875],
['20180126',3.895],
['20180129',3.835],
['20180130',3.815],
['20180131',3.715],
['20180201',3.625],
['20180202',3.785],
['20180205',3.775],
['20180206',3.675],
['20180207',3.695],
['20180208',3.685],
['20180209',3.575],
['20180212',3.625],
['20180213',3.625],
['20180214',3.615],
['20180222',3.665],
['20180223',3.675],
['20180226',3.705],
['20180227',3.685],
['20180228',3.655],
['20180301',3.805],
['20180302',3.725],
['20180305',3.735],
['20180306',3.785],
['20180307',3.725],
['20180308',3.735],
['20180309',3.755],
['20180312',3.835],
['20180313',3.785],
['20180314',3.845],
['20180315',3.765],
['20180316',3.795],
['20180319',3.825],
['20180320',3.805],
['20180321',3.765],
['20180322',3.725],
['20180323',3.415],
['20180326',3.455],
['20180327',3.555],
['20180328',3.515],
['20180329',3.535],
['20180330',3.615],
['20180831',3.260],
['20180903',2.930],
['20180904',2.640],
['20180905',2.610],
['20180906',2.440],
['20180907',2.500],
['20180910',2.400],
['20180911',2.340],
['20180912',2.280],
['20180913',2.300],
['20180914',2.530],
['20180917',2.650],
['20180918',2.550],
['20180919',2.490],
['20180920',2.420],
['20180921',2.450],
['20180925',2.450],
['20180926',2.440],
['20180927',2.350],
['20180928',2.380],
['20181008',2.280],
['20181009',2.280],
['20181010',2.300],
['20181011',2.070],
['20181012',2.010],
['20181015',1.960],
['20181016',1.940],
['20181017',1.960],
['20181018',1.830],
['20181019',1.840],
['20181022',1.940],
['20181023',1.970],
['20181024',1.970],
['20181025',1.960],
['20181026',2.020],
['20181029',1.970],
['20181030',2.010],
['20181031',2.030],
['20181101',2.040],
['20181102',2.090],
['20181105',2.130],
['20181106',2.160],
['20181107',2.150],
['20181108',2.160],
['20181109',2.170],
['20181112',2.390],
['20181113',2.440],
['20181114',2.400],
['20181115',2.390],
['20181116',2.380],
['20181119',2.340],
['20181120',2.220],
['20181121',2.280],
['20181122',2.430],
['20181123',2.260],
['20181126',2.220],
['20181127',2.220],
['20181128',2.260],
['20181129',2.180],
['20181130',2.220],
['20181203',2.320],
['20181204',2.380],
['20181205',2.330],
['20181206',2.260],
['20181207',2.260],
['20181210',2.230],
['20181211',2.240],
['20181212',2.350],
['20181213',2.320],
['20181214',2.200],
['20181217',2.210],
['20181218',2.220],
['20181219',2.200],
['20181220',2.190],
['20181221',2.130],
['20181224',2.140],
['20181225',2.060],
['20181226',2.020],
['20181227',1.990],
['20181228',2.000],
['20190102',1.980],
['20190103',1.990],
['20190104',2.040],
['20190107',2.120],
['20190108',2.160],
['20190109',2.150],
['20190110',2.120],
['20190111',2.200],
['20190114',2.190],
['20190115',2.220],
['20190116',2.190],
['20190117',2.170],
['20190118',2.160],
['20190121',2.180],
['20190122',2.130],
['20190123',2.150],
['20190124',2.160],
['20190125',2.120],
['20190128',2.080],
['20190129',2.020],
['20190130',1.980],
['20190131',1.890],
['20190201',1.990],
['20190211',2.050],
['20190212',2.080],
['20190213',2.150],
['20190214',2.140],
['20190215',2.150],
['20190218',2.220],
['20190219',2.220],
['20190220',2.260],
['20190221',2.210],
['20190222',2.280],
['20190225',2.410],
['20190226',2.490],
['20190227',2.590],
['20190228',2.510],
['20190301',2.490],
['20190304',2.540],
['20190305',2.790],
['20190306',2.900],
['20190307',3.050],
['20190308',2.870],
['20190311',2.990],
['20190312',3.040],
['20190313',2.890],
['20190314',2.720],
['20190315',2.750],
['20190318',2.810],
['20190319',2.790],
['20190320',2.730],
['20190321',2.730],
['20190322',2.650],
['20190325',2.670],
['20190326',2.540],
['20190327',2.560],
['20190328',2.480],
['20190329',2.560],
['20190401',2.660],
['20190402',2.640],
['20190403',2.660],
['20190404',2.710],
['20190408',2.660],
['20190409',2.690],
['20190410',2.770],
['20190411',2.740],
['20190412',2.710],
['20190415',2.630],
['20190416',2.680],
['20190417',2.800],
['20190418',2.750],
['20190419',2.860],
['20190422',2.780],
['20190423',2.650],
['20190424',2.700],
['20190425',2.500],
['20190426',2.400],
['20190429',2.280],
['20190430',2.330],
['20190506',2.110],
['20190507',2.150],
['20190508',2.160],
['20190509',2.130],
['20190510',2.210],
['20190513',2.160],
['20190514',2.130],
['20190515',2.170],
['20190516',2.200],
['20190517',2.090],
['20190520',2.050],
['20190521',2.070],
['20190522',2.030],
['20190523',1.980],
['20190524',1.990],
['20190527',2.030],
['20190528',2.040],
['20190529',2.030],
['20190530',2.010],
['20190531',2.000],
['20190603',2.040],
['20190604',2.010],
['20190605',1.990],
['20190606',1.900],
['20190610',1.900],
['20190611',1.980],
['20190612',1.970],
['20190613',2.010],
['20190614',1.950],
['20190617',1.930],
['20190618',1.930],
['20190619',1.960],
['20190620',1.970],
['20190621',2.030],
['20190624',2.020],
['20190625',1.990],
['20190626',1.980],
['20190627',1.970]];
var source='wstock.net'; | 20.006897 | 29 | 0.600092 |
18354dd692d72c1a8d6c30d2a6f6ac2d0c706c77 | 5,659 | js | JavaScript | src/website/packages/charts/examples/continents/Index.js | jbecknell/react-timeseries-charts | 69a91d8776f762dec6c50e76eff2ead0ddbac9f3 | [
"BSD-3-Clause-LBNL"
] | 806 | 2015-09-11T05:49:45.000Z | 2022-03-26T13:44:30.000Z | src/website/packages/charts/examples/continents/Index.js | jbecknell/react-timeseries-charts | 69a91d8776f762dec6c50e76eff2ead0ddbac9f3 | [
"BSD-3-Clause-LBNL"
] | 387 | 2015-10-01T20:45:58.000Z | 2022-03-02T23:31:11.000Z | src/website/packages/charts/examples/continents/Index.js | jbecknell/react-timeseries-charts | 69a91d8776f762dec6c50e76eff2ead0ddbac9f3 | [
"BSD-3-Clause-LBNL"
] | 311 | 2016-01-19T14:35:29.000Z | 2022-03-18T13:36:42.000Z | /**
* Copyright (c) 2015, The Regents of the University of California,
* through Lawrence Berkeley National Laboratory (subject to receipt
* of any required approvals from the U.S. Dept. of Energy).
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint max-len:0 */
import React from "react";
import _ from "underscore";
import Select from "react-select";
import colorbrewer from "colorbrewer";
// Pond
import { TimeSeries } from "pondjs";
// Imports from the charts library
import ChartContainer from "../../../../../components/ChartContainer";
import ChartRow from "../../../../../components/ChartRow";
import Charts from "../../../../../components/Charts";
import YAxis from "../../../../../components/YAxis";
import AreaChart from "../../../../../components/AreaChart";
import Legend from "../../../../../components/Legend";
import Resizable from "../../../../../components/Resizable";
import styler from "../../../../../js/styler";
import continents_docs from "./continents_docs.md";
import continents_thumbnail from "./continents_thumbnail.png";
// Data
const rawData = require("./stacked.json");
const numPoints = rawData[0].values.length;
const columnNames = rawData.map(d => d.key);
//
// Process out data into a TimeSeries
//
const name = "series";
const columns = ["time", ...columnNames];
const points = [];
for (let i = 0; i < numPoints; i++) {
const t = rawData[0].values[i][0];
const point = [t];
_.each(rawData, d => {
point.push(d.values[i][1]);
});
points.push(point);
}
const series = new TimeSeries({ name, columns, points });
//
// Style
//
/*
Alternative custom color list
const customColorsList = [
"#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c",
"#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5",
"#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f",
"#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5"
];
const styler = styler(columnNames.map((c, i) => ({
key: c,
color: customColorsList[i]
})));
*/
//
// Build area chart style
//
class continents extends React.Component {
state = {
highlight: null,
selection: null,
scheme: "Paired"
};
handleSchemeChange = ({ value }) => {
this.setState({ scheme: value });
};
render() {
const cols = { up: columnNames, down: [] };
const min = 0;
const max = 130;
const axisType = "linear";
const interpolationType = "curveBasis";
const options = Object.keys(colorbrewer).map(c => ({ value: c, label: c }));
const style = styler(columnNames, this.state.scheme);
const legendCategories = columnNames.map(d => ({ key: d, label: d }));
return (
<div>
<div className="row">
<div className="col-md-3">
<Select
name="form-field-name"
value={this.state.scheme}
options={options}
clearable={false}
onChange={this.handleSchemeChange}
/>
</div>
<div className="col-md-9">
<Legend categories={legendCategories} style={style} type="dot" />
</div>
</div>
<hr />
<div className="row">
<div className="col-md-12">
<Resizable>
<ChartContainer
timeRange={series.range()}
onBackgroundClick={() => this.setState({ selection: null })}
>
<ChartRow height="350">
<YAxis
id="value"
min={min}
max={max}
width="60"
type={axisType}
/>
<Charts>
<AreaChart
axis="value"
style={style}
series={series}
columns={cols}
fillOpacity={0.4}
interpolation={interpolationType}
highlight={this.state.highlight}
onHighlightChange={highlight =>
this.setState({ highlight })
}
selection={this.state.selection}
onSelectionChange={selection =>
this.setState({ selection })
}
/>
</Charts>
</ChartRow>
</ChartContainer>
</Resizable>
</div>
</div>
</div>
);
}
}
// Export example
export default { continents, continents_docs, continents_thumbnail };
| 34.506098 | 92 | 0.444071 |
1836d1cda3708704da00abbd20f20486a5d792ec | 8,664 | js | JavaScript | public/javascripts/admin/status.js | daybreak/daybreak | 29f78f0b253c68680c580a020cec082782873183 | [
"MIT"
] | 2 | 2019-07-14T09:29:59.000Z | 2020-06-02T01:54:00.000Z | vendor/radiant/public/javascripts/admin/status.js | daybreak/daybreak | 29f78f0b253c68680c580a020cec082782873183 | [
"MIT"
] | null | null | null | vendor/radiant/public/javascripts/admin/status.js | daybreak/daybreak | 29f78f0b253c68680c580a020cec082782873183 | [
"MIT"
] | null | null | null | /*
* status.js
*
* dependencies: prototype.js, effects.js, lowpro.js
*
* --------------------------------------------------------------------------
*
* Allows you to display a status message when submiting a form. To use,
* simply add the following to application.js:
*
* Event.addBehavior({'form': Status.FormBehavior()});
*
* And then add an "onsubmit_status" to each form that you want to display
* a status message on submit for:
*
* <form onsubmit_status="Saving changes" ...>
*
* Some code taken from popup.js.
*
* For more information, see:
*
* http://wiseheartdesign.com/articles/2009/12/16/statusjs-work-well-with-messages/
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2008-2009, John W. Long
* Portions copyright (c) 2008, Five Points Solutions, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
var Status = {
CornerThickness: 12,
SpinnerImage: '/images/status_spinner.gif',
SpinnerImageWidth: 32,
SpinnerImageHeight: 33,
BackgroundImage: '/images/status_background.png',
TopLeftImage: '/images/status_top_left.png',
TopRightImage: '/images/status_top_right.png',
BottomLeftImage: '/images/status_bottom_left.png',
BottomRightImage: '/images/status_bottom_right.png',
MessageFontFamily: '"Trebuchet MS", Verdana, Arial, Helvetica, sans-serif',
MessageFontSize: '14px',
MessageColor: '#e5e5e5',
Modal: false,
ModalOverlayColor: 'white',
ModalOverlayOpacity: 0.4
};
Status.window = function() {
if (!this.statusWindow) this.statusWindow = new Status.Window();
return this.statusWindow;
}
Status.BackgroundImages = function() {
return $A([
Status.SpinnerImage,
Status.BackgroundImage,
Status.TopLeftImage,
Status.TopRightImage,
Status.BottomLeftImage,
Status.BottomRightImage
]);
}
Status.preloadImages = function() {
if (!Status.imagesPreloaded) {
Status.BackgroundImages().each(function(src) {
var image = new Image();
image.src = src;
});
Status.preloadedImages = true;
}
}
Status.FormBehavior = Behavior.create({
initialize: function() {
var attr = this.element.attributes['data-onsubmit_status']
if (attr) this.status = attr.value;
if (this.status) this.element.observe('submit', function() { showStatus(this.status) }.bind(this));
}
});
Status.LinkBehavior = Behavior.create({
initialize: function() {
var attr = this.element.attributes['data-onclick_status']
if (attr) this.status = attr.value;
if (this.status) this.element.observe('click', function() { showStatus(this.status) }.bind(this));
}
});
Status.Window = Class.create({
initialize: function() {
Status.preloadImages();
this.buildWindow();
},
buildWindow: function() {
this.element = $table({'class': 'status_window', style: 'display: none; position: absolute; border-collapse: collapse; padding: 0px; margin: 0px; z-index: 10000'});
var tbody = $tbody();
this.element.insert(tbody)
var top_row = $tr();
top_row.insert($td({style: 'background: url(' + Status.TopLeftImage + '); height: ' + Status.CornerThickness + 'px; width: ' + Status.CornerThickness + 'px; padding: 0px'}));
top_row.insert($td({style: 'background: url(' + Status.BackgroundImage + '); height: ' + Status.CornerThickness + 'px; padding: 0px'}))
top_row.insert($td({style: 'background: url(' + Status.TopRightImage + '); height: ' + Status.CornerThickness + 'px; width: ' + Status.CornerThickness + 'px; padding: 0px'}));
tbody.insert(top_row);
var content_row = $tr();
content_row.insert($td({style: 'background: url(' + Status.BackgroundImage + '); width: ' + Status.CornerThickness + 'px; padding: 0px'}, ''));
this.content = $td({'class': 'status_content', style: 'background: url(' + Status.BackgroundImage + '); padding: 0px ' + Status.CornerThickness + 'px'});
content_row.insert(this.content);
content_row.insert($td({style: 'background: url(' + Status.BackgroundImage + '); width: ' + Status.CornerThickness + 'px; padding: 0px'}, ''));
tbody.insert(content_row);
var bottom_row = $tr();
bottom_row.insert($td({style: 'background: url(' + Status.BottomLeftImage + '); height: ' + Status.CornerThickness + 'px; width: ' + Status.CornerThickness + 'px; padding: 0px'}));
bottom_row.insert($td({style: 'background: url(' + Status.BackgroundImage + '); height: ' + Status.CornerThickness + 'px; padding: 0px'}))
bottom_row.insert($td({style: 'background: url(' + Status.BottomRightImage + '); height: ' + Status.CornerThickness + 'px; width: ' + Status.CornerThickness + 'px; padding: 0px'}));
tbody.insert(bottom_row);
this.spinner = $img({src: Status.SpinnerImage, width: Status.SpinnerImageWidth, height: Status.SpinnerImageHeight, alt: ''});
this.status = $div({'class': 'status_message', style: 'color: ' + Status.MessageColor + '; font-family: ' + Status.MessageFontFamily + '; font-size: ' + Status.MessageFontSize});
var table = $table({border: 0, cellpadding: 0, cellspacing: 0, style: 'table-layout: auto'},
$tbody(
$tr(
$td({style: 'width: ' + Status.SpinnerImageWidth + 'px'}, this.spinner),
$td({style: 'padding-left: ' + Status.CornerThickness + 'px'}, this.status)
)
)
);
this.content.insert(table);
var body = $$('body').first();
body.insert(this.element);
},
setStatus: function(value) {
this.status.update(value)
},
getStatus: function() {
return this.status.innerHTML();
},
show: function(modal) {
this.centerWindowInView();
if (modal || Status.Modal) this._showModalOverlay();
this.element.show();
},
hide: function() {
this._hideModalOverlay();
this.element.hide();
},
toggle: function() {
if (this.visible()) {
this.hide();
} else {
this.show();
}
},
visible: function() {
return this.element.visible();
},
centerWindowInView: function() {
var offsets = document.viewport.getScrollOffsets();
this.element.setStyle({
left: parseInt(offsets.left + (document.viewport.getWidth() - this.element.getWidth()) / 2) + 'px',
top: parseInt(offsets.top + (document.viewport.getHeight() - this.element.getHeight()) / 2.2) + 'px'
});
},
_showModalOverlay: function() {
if (!this.overlay) {
this.overlay = $div({style: 'position: absolute; background-color: ' + Status.ModalOverlayColor + '; top: 0px; left: 0px; z-index: 100;'});
this.overlay.setStyle('position: fixed');
this.overlay.setOpacity(Status.ModalOverlayOpacity);
document.body.insert(this.overlay);
}
this.overlay.setStyle('height: ' + document.viewport.getHeight() + 'px; width: ' + document.viewport.getWidth() + 'px;');
this.overlay.show();
},
_hideModalOverlay: function() {
if (this.overlay) this.overlay.hide();
}
});
Event.observe(document, 'dom:loaded', function() {
Status.preloadImages();
});
// Sets the status to string
function setStatus(string) {
Status.window().setStatus(string);
if (Status.window().visible()) Status.window().centerWindowInView();
}
// Sets the status to string and shows the status window. If modal is passed
// as true a white transparent div that covers the entire page is positioned
// under the status window causing a diming effect and preventing stray mouse
// clicks.
function showStatus(string, modal) {
setStatus(string);
Status.window().show(modal);
}
// Hides the status window
function hideStatus() {
Status.window().hide();
}
| 37.025641 | 185 | 0.661588 |
1836fc82a49a1d92b00616bec8d777321037aef9 | 581 | js | JavaScript | src/store.js | chaintex/TomoSwap | 3f828c23cd933096012391e951d3a40832f6c7f0 | [
"MIT"
] | 3 | 2019-03-13T04:32:44.000Z | 2019-07-01T10:04:28.000Z | src/store.js | chaintex/TomoSwap | 3f828c23cd933096012391e951d3a40832f6c7f0 | [
"MIT"
] | 9 | 2019-03-18T15:28:56.000Z | 2019-11-11T06:35:27.000Z | src/store.js | chaintex/TomoSwap | 3f828c23cd933096012391e951d3a40832f6c7f0 | [
"MIT"
] | 4 | 2019-03-13T04:24:04.000Z | 2019-07-10T08:05:22.000Z | import { compose, applyMiddleware, createStore } from "redux"
import createSagaMiddleware from 'redux-saga'
import { logger } from 'redux-logger';
import reducer from './reducers';
import rootSaga from './sagas';
import EnvConfig from './config/env'
const sagaMiddleware = createSagaMiddleware();
var middlewareArray = [sagaMiddleware];
if (EnvConfig.IS_TESTNET) {
middlewareArray.push(logger);
}
const middleware = applyMiddleware(
...middlewareArray
);
const store = createStore(reducer, undefined, compose(middleware));
sagaMiddleware.run(rootSaga);
export { store } | 23.24 | 67 | 0.760757 |
183784c4888f868809b28678c1445688c4e47221 | 996 | js | JavaScript | app/containers/Level5/Container.js | georgegillams/screen-reader-adventures | d5f2526badfcd42e87a0a3bf243513fdf3bc814b | [
"MIT"
] | 2 | 2019-05-17T15:51:05.000Z | 2019-09-18T09:07:18.000Z | app/containers/Level5/Container.js | georgegillams/screen-reader-adventures | d5f2526badfcd42e87a0a3bf243513fdf3bc814b | [
"MIT"
] | 82 | 2019-09-02T18:06:57.000Z | 2020-05-29T10:49:22.000Z | app/containers/Level5/Container.js | georgegillams/screen-reader-adventures | d5f2526badfcd42e87a0a3bf243513fdf3bc814b | [
"MIT"
] | null | null | null | import React from 'react';
import LevelWrapper from 'components/Levels';
import { getCopy } from 'helpers/copyHelpers';
import { generateLevelDefinition } from 'helpers/gameLogic';
import { cssModules } from 'gg-components/helpers/cssModules';
import STYLES from '../pages.scss';
const getClassName = cssModules(STYLES);
const Container = props => {
const levelDefinition = generateLevelDefinition([
['s'],
['l'],
['h'],
['l'],
['h'],
['l'],
['h'],
['l'],
['h'],
['g'],
]);
// TODO Move to helpers
const squareFromGameState = (gameState, x, y) => {
if (gameState && gameState[x] && gameState[x][y]) {
return gameState[x][y];
}
return null;
};
return (
<LevelWrapper
levelNumber={5}
description={getCopy('level5Description')}
level={levelDefinition}
startSpace={{ x: 0, y: 0 }}
oilSpills={[{ x: -2, y: 2, width: 5, height: 5 }]}
{...props}
/>
);
};
export default Container;
| 21.652174 | 62 | 0.586345 |
18384782da72e88537d2664148e315620bb08135 | 157 | js | JavaScript | docs/html/search/variables_7.js | rickkas7/DeviceNameHelperRK | 8bc2b9dd0191312165e96d2232b08dd9974bba9b | [
"MIT"
] | 2 | 2021-02-18T07:11:32.000Z | 2021-11-16T11:39:03.000Z | docs/html/search/variables_7.js | rickkas7/DeviceNameHelperRK | 8bc2b9dd0191312165e96d2232b08dd9974bba9b | [
"MIT"
] | null | null | null | docs/html/search/variables_7.js | rickkas7/DeviceNameHelperRK | 8bc2b9dd0191312165e96d2232b08dd9974bba9b | [
"MIT"
] | null | null | null | var searchData=
[
['lastcheck_108',['lastCheck',['../struct_device_name_helper_data.html#a26b7c1ddf2836254b370346303c7f0f3',1,'DeviceNameHelperData']]]
];
| 31.4 | 135 | 0.783439 |
1838d91819cbbafc675466ac9ab3d8320fa1d5d0 | 2,120 | js | JavaScript | client/src/store/modules/users.js | czytelny/arij | d79341e3a014e5b193b78280e44fb7ac36b63b56 | [
"MIT"
] | 3 | 2016-09-26T17:57:30.000Z | 2017-02-01T23:29:10.000Z | client/src/store/modules/users.js | czytelny/arij | d79341e3a014e5b193b78280e44fb7ac36b63b56 | [
"MIT"
] | 15 | 2016-11-02T19:27:26.000Z | 2017-03-24T12:41:27.000Z | client/src/store/modules/users.js | czytelny/arij | d79341e3a014e5b193b78280e44fb7ac36b63b56 | [
"MIT"
] | null | null | null | import axios from 'axios';
import randomColor from 'random-material-color'
import {
SET_NEW_USER, SET_NEW_USER_AVATAR,
SHUFFLE_NEW_USER_AVATAR_COLOR,
RESET_NEW_USER, SET_LOGGED_USER, SET_USERS, SET_USER_PREVIEW
} from '../mutation-types';
import {
FETCH_LOGGED_USER, FETCH_USERS,
SAVE_USER, FETCH_USER_PREVIEW
} from '../action-types'
function initialUserState() {
return {
email: '',
name: '',
password: '',
passwordConfirm: '',
projects: [],
roles: [],
avatar: {
color: randomColor.getColor(),
}
}
}
function initialLoggedUser() {
return {
name: 'Anonymous',
email: 'Anonymous',
roles: []
}
}
export default {
state: {
all: [],
preview: {},
newUser: initialUserState(),
logged: initialLoggedUser()
},
mutations: {
[SET_LOGGED_USER](state, user) {
state.logged = user;
},
[SET_USERS](state, users) {
state.all = users;
},
[SET_USER_PREVIEW](state, user) {
state.preview = user;
},
[SET_NEW_USER](state, value) {
Object.assign(state.newUser, value);
},
[SET_NEW_USER_AVATAR](state, value) {
Object.assign(state.newUser.avatar, value);
},
[SHUFFLE_NEW_USER_AVATAR_COLOR](state) {
state.newUser.avatar.color = randomColor.getColor();
},
[RESET_NEW_USER](state) {
state.newUser = initialUserState();
},
},
actions: {
[FETCH_LOGGED_USER]({commit}) {
return axios
.get('/api/activeUser/')
.then(({data}) => {
commit(SET_LOGGED_USER, data);
})
},
[FETCH_USERS]({commit}) {
return axios
.get('/api/users/')
.then(({data}) => {
commit(SET_USERS, data);
})
},
[FETCH_USER_PREVIEW]({commit}, userId) {
return axios
.get(`/api/users/preview/${userId}`)
.then(({data}) => {
commit(SET_USER_PREVIEW, data);
})
},
[SAVE_USER]({commit}, userToSave) {
return axios
.post('/api/users/', userToSave)
.then(() => {
commit(RESET_NEW_USER);
})
},
}
}
| 21.85567 | 62 | 0.571226 |
18398e6fb927dc89815a9ee22fb70dfa0e2e88d0 | 65 | js | JavaScript | jest.setup.js | TamirHen/kaizen-task | 0a60c6b8f8ef653d1da6f8d03303cf4ea463da0e | [
"MIT"
] | null | null | null | jest.setup.js | TamirHen/kaizen-task | 0a60c6b8f8ef653d1da6f8d03303cf4ea463da0e | [
"MIT"
] | null | null | null | jest.setup.js | TamirHen/kaizen-task | 0a60c6b8f8ef653d1da6f8d03303cf4ea463da0e | [
"MIT"
] | null | null | null |
// mock console.log for all tests
global.console.log = jest.fn() | 21.666667 | 33 | 0.723077 |
1839a6963155165871af99488512e03529f8cfbc | 1,981 | js | JavaScript | webapp/src/scenes/HomePage/components/SimpleRideCard/index.js | DrCesar/UberG | 400d18f584a03ff7da1ea8c9413835ccea7e4c7a | [
"MIT"
] | null | null | null | webapp/src/scenes/HomePage/components/SimpleRideCard/index.js | DrCesar/UberG | 400d18f584a03ff7da1ea8c9413835ccea7e4c7a | [
"MIT"
] | null | null | null | webapp/src/scenes/HomePage/components/SimpleRideCard/index.js | DrCesar/UberG | 400d18f584a03ff7da1ea8c9413835ccea7e4c7a | [
"MIT"
] | null | null | null |
import React, { Component } from 'react';
import { Card, Image, Feed, Header, Label } from 'semantic-ui-react';
import { withRouter, Redirect } from 'react-router-dom';
class RideCard extends Component {
handleRideClick = (evt) => {
this.props.handleRideClick(this.props);
}
handleUserClick = (evt) => {
this.props.handleUserClick(this.props);
}
render() {
return (
<Card fluid onClick={this.handleRideClick}>
<Card.Content >
<Image onClick={this.handleUserClick} circular floated='left' size='mini' src={this.props.avatar} />
<Card.Header><Header style={{ marginTop: '1%' }} >{this.props.name}</Header></Card.Header>
</Card.Content>
<Card.Content >
<Feed>
<Feed.Event>
<Feed.Content>
<Feed.Summary>
<Label> Origin: </Label> {this.props.origin}
</Feed.Summary>
</Feed.Content>
</Feed.Event>
<Feed.Event>
<Feed.Content>
<Feed.Summary>
<Label> Destiny: </Label> {this.props.destiny}
</Feed.Summary>
</Feed.Content>
</Feed.Event>
<Feed.Event>
<Feed.Content>
<Feed.Summary>
<Label> Date: </Label> {this.props.date.toString()}
</Feed.Summary>
</Feed.Content>
</Feed.Event>
</Feed>
</Card.Content>
</Card>
);
}
}
export default RideCard;
| 33.016667 | 120 | 0.401817 |
183a093ada35acabe10f4385f0465fd0dd01188c | 3,341 | js | JavaScript | src/directives/formBuilderOptionKey.js | BigBadOwl/ngFormBuilder | a84721098dce765e041cc0bf4433bb91c6a9ecdb | [
"MIT"
] | 1 | 2021-01-03T19:48:41.000Z | 2021-01-03T19:48:41.000Z | src/directives/formBuilderOptionKey.js | BigBadOwl/ngFormBuilder | a84721098dce765e041cc0bf4433bb91c6a9ecdb | [
"MIT"
] | null | null | null | src/directives/formBuilderOptionKey.js | BigBadOwl/ngFormBuilder | a84721098dce765e041cc0bf4433bb91c6a9ecdb | [
"MIT"
] | null | null | null | /**
* A directive for a field to edit a component's key.
*/
module.exports = function() {
return {
restrict: 'E',
replace: true,
template: function() {
return '<div class="form-group" ng-class="{\'has-warning\': shouldWarnAboutEmbedding()}">' +
'<label for="key" class="control-label" form-builder-tooltip="The name of this field in the API endpoint.">Property Name</label>' +
'<input type="text" class="form-control" id="key" name="key" ng-model="component.key" valid-api-key value="{{ component.key }}" ' +
'ng-disabled="component.source" ng-blur="onBlur()">' +
'<p ng-if="shouldWarnAboutEmbedding()" class="help-block"><span class="glyphicon glyphicon-exclamation-sign"></span> ' +
'Using a dot in your Property Name will link this field to a field from a Resource. Doing this manually is not recommended because you will experience unexpected behavior if the Resource field is not found. If you wish to embed a Resource field in your form, use a component from the corresponding Resource Components category on the left.' +
'</p>' +
'</div>';
},
controller: ['$scope', 'FormioUtils', function($scope, FormioUtils) {
var suffixRegex = /(\d+)$/;
// Prebuild a list of existing components.
var existingComponents = {};
FormioUtils.eachComponent($scope.form.components, function(component) {
// Don't add to existing components if current component or if it is new. (New could mean same as another item).
if (component.key && ($scope.component.key !== component.key || $scope.component.isNew)) {
existingComponents[component.key] = component;
}
});
var keyExists = function(component) {
if (existingComponents.hasOwnProperty(component.key)) {
return true;
}
return false;
};
var iterateKey = function(componentKey) {
if (componentKey.match(suffixRegex)) {
componentKey = componentKey.replace(suffixRegex, function(suffix) {
return Number(suffix) + 1;
});
}
else {
componentKey += '1';
}
return componentKey;
};
// Appends a number to a component.key to keep it unique
var uniquify = function() {
if (!$scope.component.key) {
return;
}
while (keyExists($scope.component)) {
$scope.component.key = iterateKey($scope.component.key);
}
};
$scope.$watch('component.key', uniquify);
$scope.onBlur = function() {
$scope.component.lockKey = true;
// If they try to input an empty key, refill it with default and let uniquify
// make it unique
if (!$scope.component.key && $scope.formComponents[$scope.component.type].settings.key) {
$scope.component.key = $scope.formComponents[$scope.component.type].settings.key;
$scope.component.lockKey = false; // Also unlock key
uniquify();
}
};
$scope.shouldWarnAboutEmbedding = function() {
if (!$scope.component || !$scope.component.key) {
return false;
}
return !$scope.component.source && $scope.component.key.indexOf('.') !== -1;
};
}]
};
};
| 40.743902 | 360 | 0.600419 |
183a9b2d38f57d7059b8ee8e6467832e5931e298 | 1,002 | js | JavaScript | src/models/History.js | MisterFixx/core | 410b21088588095acf6638aa89b7a1bf95ede1aa | [
"MIT"
] | 1 | 2021-06-13T00:29:21.000Z | 2021-06-13T00:29:21.000Z | src/models/History.js | eyes-0nly/core | 61e9fc70630d53073a5b758a19a9767c90dc2756 | [
"MIT"
] | null | null | null | src/models/History.js | eyes-0nly/core | 61e9fc70630d53073a5b758a19a9767c90dc2756 | [
"MIT"
] | null | null | null | 'use strict';
const mongoose = require('mongoose');
const { Schema } = mongoose;
const { Types } = mongoose.Schema;
const listOfUsers = [{ type: Types.ObjectId, ref: 'User' }];
const schema = new Schema({
user: {
type: Types.ObjectId, ref: 'User', required: true, index: true,
},
playlist: { type: Types.ObjectId, ref: 'Playlist' },
item: { type: Types.ObjectId, ref: 'PlaylistItem' },
media: {
media: { type: Types.ObjectId, ref: 'Media', required: true },
artist: {
type: String,
index: true,
set: (artist) => artist.normalize('NFKC'),
},
title: {
type: String,
index: true,
set: (title) => title.normalize('NFKC'),
},
start: { type: Number, default: 0 },
end: { type: Number, default: 0 },
},
playedAt: { type: Date, default: Date.now, index: true },
upvotes: listOfUsers,
downvotes: listOfUsers,
favorites: listOfUsers,
}, {
collection: 'historyentries',
minimize: false,
});
module.exports = schema;
| 24.439024 | 67 | 0.606786 |
183bb6aa157efa027d724d50192686115e59299f | 2,535 | js | JavaScript | docs/search/functions_c.js | vinihcampos/tiara | edffbbcb52edd1578fe5577713596f41c8af7589 | [
"MIT"
] | 2 | 2019-04-09T22:28:47.000Z | 2021-05-07T21:49:28.000Z | docs/search/functions_c.js | Vinihcampos/tiara | edffbbcb52edd1578fe5577713596f41c8af7589 | [
"MIT"
] | null | null | null | docs/search/functions_c.js | Vinihcampos/tiara | edffbbcb52edd1578fe5577713596f41c8af7589 | [
"MIT"
] | null | null | null | var searchData=
[
['parent',['Parent',['../classtinyxml2_1_1XMLNode.html#ae0f62bc186c56c2e0483ebd52dbfbe34',1,'tinyxml2::XMLNode']]],
['parse',['Parse',['../classtinyxml2_1_1XMLDocument.html#a1819bd34f540a7304c105a6232d25a1f',1,'tinyxml2::XMLDocument']]],
['previoussibling',['PreviousSibling',['../classtinyxml2_1_1XMLNode.html#aac667c513d445f8b783e1e15ef9d3551',1,'tinyxml2::XMLNode::PreviousSibling()'],['../classtinyxml2_1_1XMLHandle.html#a428374e756f4db4cbc287fec64eae02c',1,'tinyxml2::XMLHandle::PreviousSibling()']]],
['previoussiblingelement',['PreviousSiblingElement',['../classtinyxml2_1_1XMLNode.html#a872936cae46fb473eb47fec99129fc70',1,'tinyxml2::XMLNode::PreviousSiblingElement()'],['../classtinyxml2_1_1XMLHandle.html#a786957e498039554ed334cdc36612a7e',1,'tinyxml2::XMLHandle::PreviousSiblingElement()']]],
['print',['Print',['../classtinyxml2_1_1XMLDocument.html#a867cf5fa3e3ff6ae4847a8b7ee8ec083',1,'tinyxml2::XMLDocument']]],
['printerror',['PrintError',['../classtinyxml2_1_1XMLDocument.html#a1d033945b42e125d933d6231e4571552',1,'tinyxml2::XMLDocument']]],
['printspace',['PrintSpace',['../classtinyxml2_1_1XMLPrinter.html#a01148e2ebe6776e38c5a3e41bc5feb74',1,'tinyxml2::XMLPrinter']]],
['pushattribute',['PushAttribute',['../classtinyxml2_1_1XMLPrinter.html#a9a4e2c9348b42e147629d5a99f4af3f0',1,'tinyxml2::XMLPrinter']]],
['pushcomment',['PushComment',['../classtinyxml2_1_1XMLPrinter.html#afc8416814219591c2fd5656e0c233140',1,'tinyxml2::XMLPrinter']]],
['pushheader',['PushHeader',['../classtinyxml2_1_1XMLPrinter.html#a178c608ce8476043d5d6513819cde903',1,'tinyxml2::XMLPrinter']]],
['pushtext',['PushText',['../classtinyxml2_1_1XMLPrinter.html#a1cc16a9362df4332012cb13cff6441b3',1,'tinyxml2::XMLPrinter::PushText(const char *text, bool cdata=false)'],['../classtinyxml2_1_1XMLPrinter.html#a3e0d4d78de25d4cf081009e1431cea7e',1,'tinyxml2::XMLPrinter::PushText(int value)'],['../classtinyxml2_1_1XMLPrinter.html#a661fb50e7e0a4918d2d259cb0fae647e',1,'tinyxml2::XMLPrinter::PushText(unsigned value)'],['../classtinyxml2_1_1XMLPrinter.html#a96b0a0bfe105154a0a6c37d725258f0a',1,'tinyxml2::XMLPrinter::PushText(int64_t value)'],['../classtinyxml2_1_1XMLPrinter.html#a4390e5fa1ed05189a8686647345ab29f',1,'tinyxml2::XMLPrinter::PushText(bool value)'],['../classtinyxml2_1_1XMLPrinter.html#a1dbb1390e829d0673af66b9cd1928bd7',1,'tinyxml2::XMLPrinter::PushText(float value)'],['../classtinyxml2_1_1XMLPrinter.html#aa715302dfc09473c77c853cbd5431965',1,'tinyxml2::XMLPrinter::PushText(double value)']]]
];
| 169 | 907 | 0.798422 |
183d2d1d0db6aca554c4c05e2448d8b28d328f44 | 4,336 | js | JavaScript | pages/documents/[_id]/edit.js | ray-cj-huang/nextjs-test | d2e3a6992c7bfae2fe7c49460ee0bc90f47f9943 | [
"MIT"
] | null | null | null | pages/documents/[_id]/edit.js | ray-cj-huang/nextjs-test | d2e3a6992c7bfae2fe7c49460ee0bc90f47f9943 | [
"MIT"
] | null | null | null | pages/documents/[_id]/edit.js | ray-cj-huang/nextjs-test | d2e3a6992c7bfae2fe7c49460ee0bc90f47f9943 | [
"MIT"
] | null | null | null | import React, { useState, useEffect } from "react";
import { useRouter } from "next/router";
import { useQuery, useMutation } from "@apollo/client";
import { document as documentQuery } from "../../../graphql/queries/Documents.gql";
import {
updateDocument as updateDocumentMutation,
deleteDocument as deleteDocumentMutation,
} from "../../../graphql/mutations/Documents.gql";
import authenticatedRoute from "../../../components/AuthenticatedRoute";
import ValidatedForm from "../../../components/ValidatedForm";
import handleApolloResponse from "../../../lib/handleApolloResponse";
import pong from "../../../lib/pong";
import StyledEditDocument from "./edit.css";
const EditDocument = () => {
const router = useRouter();
const documentId = router.query && router.query._id;
const [title, setTitle] = useState("");
const [content, setContent] = useState("");
const { data } = useQuery(documentQuery, { variables: { documentId } });
const [updateDocument] = useMutation(updateDocumentMutation);
const [deleteDocument] = useMutation(deleteDocumentMutation);
useEffect(() => {
if (data && data.document) {
setTitle(data.document && data.document.title);
setContent(data.document && data.document.content);
}
}, [data]);
const handleUpdateDocument = () => {
updateDocument({
variables: {
documentId: router.query && router.query._id,
document: {
title,
content,
},
},
})
.then((response) => {
return handleApolloResponse({
queryName: "updateDocument",
response,
onSuccess: (data) => {
router.push(`/documents/${data._id}`);
},
onError: (error) => {
pong.danger(error);
},
});
})
.catch((error) => {
console.log({ error });
});
};
const handleDeleteDocument = (event) => {
if (confirm("Are you sure? This is permanent!")) {
deleteDocument({
variables: {
documentId: router.query && router.query._id,
},
})
.then(({ error, data }) => {
if (error) {
console.log(error);
}
router.push(`/documents`);
})
.catch((error) => {
console.log({ error });
});
}
};
return (
<StyledEditDocument>
<ValidatedForm
rules={{
title: {
required: true,
},
content: {
required: true,
},
}}
messages={{
title: {
required: "Title is required.",
},
content: {
required: "Content is required.",
},
}}
onSubmit={handleUpdateDocument}
>
<form>
<div className="row">
<div className="col-xs-12">
<div className="mb-3">
<label className="form-label">Document Title</label>
<input
className="form-control"
type="text"
name="title"
value={title}
onChange={(event) => setTitle(event.target.value)}
placeholder="Document Title"
/>
</div>
</div>
</div>
<div className="row">
<div className="col-xs-12">
<div className="mb-4">
<label className="form-label">Document Content</label>
<textarea
className="form-control"
name="content"
value={content}
onChange={(event) => setContent(event.target.value)}
placeholder="Document Content"
/>
</div>
</div>
</div>
<footer>
<button type="submit" className="btn btn-primary">
Update Document
</button>
<button
type="button"
className="btn btn-danger ms-auto"
onClick={handleDeleteDocument}
>
Delete
</button>
</footer>
</form>
</ValidatedForm>
</StyledEditDocument>
);
};
EditDocument.propTypes = {};
export default authenticatedRoute(EditDocument);
| 28.715232 | 83 | 0.509225 |
183dc3bd172005ecff3d4f60afbd9d4231147d3f | 2,450 | js | JavaScript | app/js/settings.js | ProgrammerKid/SuperFly | 0d38bb8016ae004d3d75826da00d9edd27d774da | [
"Apache-2.0"
] | null | null | null | app/js/settings.js | ProgrammerKid/SuperFly | 0d38bb8016ae004d3d75826da00d9edd27d774da | [
"Apache-2.0"
] | null | null | null | app/js/settings.js | ProgrammerKid/SuperFly | 0d38bb8016ae004d3d75826da00d9edd27d774da | [
"Apache-2.0"
] | null | null | null | var image_cache = [];
var curr_image = 0;
var slideshow_running = 0;
var music;
var currProfile = localStorage.getItem("profile_queue");
function showHide(id) {
if(document.getElementById(id).hidden === true)
document.getElementById(id).hidden = false;
else
document.getElementById(id).hidden = true;
}
function saveProfile() {
var name = localStorage.getItem("profile_queue");
var profile = JSON.parse(localStorage.getItem(name + "(profile)"));
var brightness = document.getElementById("bg-dimmer").value;
var bordercolor = document.getElementById("border-color").value;
var borderwidth = document.getElementById("border-width").value;
var songfile = document.getElementById("song-file").value;
//we also need to save the images, otherwise they will all be removed
var images = profile.images;
var newProf = {}; //the new profile
newProf.name = name;
newProf.brightness = brightness;
newProf.bordercolor = bordercolor;
newProf.borderwidth = borderwidth;
newProf.songfile = songfile;
newProf.images = images;
localStorage.setItem(name + "(profile)", JSON.stringify(newProf));
//go back home
window.location = "index.html";
}
function loadProfile() {
var name = currProfile;
currProfile = name;
var profile = JSON.parse(localStorage.getItem(name + "(profile)"));
var brightness = profile.brightness;
var bordercolor = profile.bordercolor;
var borderwidth = profile.borderwidth;
var songfile = profile.songfile;
document.getElementById("bg-dimmer").value = brightness;
document.getElementById("border-color").value = bordercolor;
document.getElementById("border-width").value = borderwidth;
document.getElementById("song-file").value = songfile;
}
function deleteProfile() {
var name = document.getElementById("delete-profile-name").value;
var request = confirm("Are you sure you want to delete " + name + ". This action cannot be reversed");
if(request !== true) return 0; //if user exits prompt, then it doesn't show up as false, which is why we say anything but true, then exit
var profiles = JSON.parse(localStorage.getItem("profiles"));
// start/end splice
var splice1 = profiles.indexOf(name);
var splice2 = splice1 + 1;
profiles.splice(splice1, splice2);
localStorage.setItem("profiles", JSON.stringify(profiles));
localStorage.setItem(name + "(profile)", undefined);
}
$(document).ready(function() {
loadProfile();
});
| 33.561644 | 138 | 0.720408 |
183e564321e3d16a3a6bea2af18cd3bc13e2294c | 6,017 | js | JavaScript | ui/node_modules/gulp-ng-annotate/node_modules/ng-annotate/ng-annotate.js | Ramanujakalyan/Inherit | 360771aaf29e5e4033e7574c20aae3ffde3e0b90 | [
"Unlicense"
] | 1 | 2015-05-15T05:39:14.000Z | 2015-05-15T05:39:14.000Z | ui/node_modules/gulp-ng-annotate/node_modules/ng-annotate/ng-annotate.js | Ramanujakalyan/Inherit | 360771aaf29e5e4033e7574c20aae3ffde3e0b90 | [
"Unlicense"
] | null | null | null | ui/node_modules/gulp-ng-annotate/node_modules/ng-annotate/ng-annotate.js | Ramanujakalyan/Inherit | 360771aaf29e5e4033e7574c20aae3ffde3e0b90 | [
"Unlicense"
] | null | null | null | // ng-annotate.js
// MIT licensed, see LICENSE file
// Copyright (c) 2013-2015 Olov Lassus <olov.lassus@gmail.com>
"use strict";
const t0 = Date.now();
const fs = require("fs");
const fmt = require("simple-fmt");
const tryor = require("tryor");
const ngAnnotate = require("./ng-annotate-main");
const version = require("./package.json").version;
const optimist = require("optimist")
.usage("ng-annotate v" + version + "\n\nUsage: ng-annotate OPTIONS <file>\n\n" +
"provide - instead of <file> to read from stdin\n" +
"use -a and -r together to remove and add (rebuild) annotations in one go")
.options("a", {
alias: "add",
boolean: true,
describe: "add dependency injection annotations where non-existing",
})
.options("r", {
alias: "remove",
boolean: true,
describe: "remove all existing dependency injection annotations",
})
.options("o", {
describe: "write output to <file>. output is written to stdout by default",
})
.options("sourcemap", {
boolean: true,
describe: "generate an inline sourcemap"
})
.options("sourceroot", {
describe: "set the sourceRoot property of the generated sourcemap"
})
.options("single_quotes", {
boolean: true,
describe: "use single quotes (') instead of double quotes (\")",
})
.options("regexp", {
describe: "detect short form myMod.controller(...) iff myMod matches regexp",
})
.options("rename", {
describe: "rename declarations and annotated references\n" +
"oldname1 newname1 oldname2 newname2 ...",
default: ""
})
.options("plugin", {
describe: "use plugin with path (experimental)",
})
.options("stats", {
boolean: true,
describe: "print statistics on stderr (experimental)",
});
const argv = optimist.argv;
function exit(msg) {
if (msg) {
process.stderr.write(msg);
process.stderr.write("\n");
}
process.exit(-1);
}
// validate options
if (argv._.length !== 1) {
optimist.showHelp();
exit("error: no input file provided");
}
if (!argv.add && !argv.remove) {
optimist.showHelp();
exit("error: missing option --add and/or --remove");
}
const filename = argv._.shift();
(filename === "-" ? slurpStdin : slurpFile)(runAnnotate);
function slurpStdin(cb) {
let buf = "";
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(d) {
buf += d;
});
process.stdin.on("end", function() {
cb(null, buf);
});
process.stdin.resume();
}
function slurpFile(cb) {
if (!fs.existsSync(filename)) {
cb(new Error(fmt('error: file not found {0}', filename)));
}
fs.readFile(filename, cb);
}
function runAnnotate(err, src) {
if (err) {
exit(err.message);
}
src = String(src);
const config = tryor(function() {
return JSON.parse(String(fs.readFileSync("ng-annotate-config.json")));
}, {});
if (filename !== "-") {
config.inFile = filename;
}
["add", "remove", "o", "regexp", "rename", "single_quotes", "plugin", "stats"].forEach(function(opt) {
if (opt in argv) {
config[opt] = argv[opt];
}
});
if (argv.sourcemap) {
config.map = { inline: true, sourceRoot: argv.sourceroot };
if (filename !== "-") {
config.map.inFile = filename;
}
};
if (config.plugin) {
if (!Array.isArray(config.plugin)) {
config.plugin = [config.plugin];
}
config.plugin = config.plugin.map(function(path) {
const absPath = tryor(fs.realpathSync.bind(fs, path), null);
if (!absPath) {
exit(fmt('error: plugin file not found {0}', path));
}
// the require below may throw an exception on parse-error
try {
return require(absPath);
} catch (e) {
// node will already print file:line and offending line to stderr
exit(fmt("error: couldn't require(\"{0}\")", absPath));
}
});
}
const trimmedRename = config.rename && config.rename.trim();
if (trimmedRename) {
const flattenRename = trimmedRename.split(" ");
const renameArray = [];
for (let i = 0; i < flattenRename.length; i = i + 2) {
renameArray.push({
"from": flattenRename[i],
"to": flattenRename[i + 1],
});
}
config.rename = renameArray;
} else {
config.rename = null;
}
const run_t0 = Date.now();
const ret = ngAnnotate(src, config);
const run_t1 = Date.now();
if (ret.errors) {
exit(ret.errors.join("\n"));
}
const stats = ret._stats;
if (config.stats && stats) {
const t1 = Date.now();
const all = t1 - t0;
const run_parser = stats.parser_parse_t1 - stats.parser_parse_t0;
const all_parser = run_parser + (stats.parser_require_t1 - stats.parser_require_t0);
const nga_run = (run_t1 - run_t0) - run_parser;
const nga_init = all - all_parser - nga_run;
const pct = function(n) {
return Math.round(100 * n / all);
}
process.stderr.write(fmt("[{0} ms] parser: {1}, nga init: {2}, nga run: {3}\n", all, all_parser, nga_init, nga_run));
process.stderr.write(fmt("[%] parser: {0}, nga init: {1}, nga run: {2}\n", pct(all_parser), pct(nga_init), pct(nga_run)));
}
if (ret.src && config.o) {
try {
fs.writeFileSync(config.o, ret.src);
} catch (e) {
exit(e.message);
}
} else if (ret.src) {
process.stdout.write(ret.src);
}
}
| 29.935323 | 131 | 0.540469 |
183e62c5e989ed43221ab7c00fb7d6412448e6e0 | 3,191 | js | JavaScript | MadWare.Hathor.FrontEnd/src/js/components/shared/Playlist.js | zvizdo/MadWare.Hathor | 049670686fd534952cadc18c68f3a43477d1730f | [
"MIT"
] | null | null | null | MadWare.Hathor.FrontEnd/src/js/components/shared/Playlist.js | zvizdo/MadWare.Hathor | 049670686fd534952cadc18c68f3a43477d1730f | [
"MIT"
] | null | null | null | MadWare.Hathor.FrontEnd/src/js/components/shared/Playlist.js | zvizdo/MadWare.Hathor | 049670686fd534952cadc18c68f3a43477d1730f | [
"MIT"
] | null | null | null | import React from 'react'
import { canPlayVideo, isPlaylistEmpty, videoPropType } from './../../utils/playlist';
import { createSignature } from './../../utils/utils';
class Playlist extends React.Component {
onRemoveVideo(videoId) {
this.props.onPlaylistRemoveVideo(videoId);
}
onUpVoteVideo(videoId) {
this.props.onPlaylistUpVoteVideo(videoId);
}
render() {
return (
<div class="row">
<div class="col-md-12">
<div class="bs-component">
<div class="jumbotron">
<div class="bs-component">
<div class="list-group">
{!this.props.serverExists ?
(<p>Playlist with this id does not exist or was closed!</p>) : null}
{isPlaylistEmpty(this.props.serverExists, this.props.videos.length) ?
(<p>Playlist is currently empty!</p>) : null}
{this.props.videos.map( function(v,i) {
let sig = createSignature( this.props.serverId+this.props.clientId, v.id );
return (
<div key={v.id} class={"list-group-item" + (v.id === this.props.currentVideoId ? " playing" : "")}>
<div class="row-picture">
<img class="circle" src={v.thumbnail} alt="icon"/>
</div>
<div class="row-content">
<p class="list-group-item-text">{v.title}</p>
{sig !== v.secretId && !v.upVotes.find( vote => vote == sig ) ?
(<span class="upvotes">{v.upVotes.length}
<i style={{cursor: "pointer"}} class="material-icons" onClick={this.onUpVoteVideo.bind(this, v.id)}>favorite</i>
</span>) :
(<span class="upvotes">{v.upVotes.length}
<i class="material-icons">grade</i>
</span>)}
{ v.id !== this.props.currentVideoId && (sig === v.secretId || this.props.isServer) ?
(<i style={{cursor: "pointer"}} class="material-icons" onClick={this.onRemoveVideo.bind(this, v.id)}>clear</i>) : null}
{v.wasPlayed ?
(<i style={{float: "right"}} class="material-icons">check box</i>) : null}
</div>
</div>
);
}.bind(this) )}
</div>
</div>
</div>
</div>
</div>
</div>
);
}
}
Playlist.propTypes = {
serverId: React.PropTypes.string,
clientId: React.PropTypes.string,
serverExists: React.PropTypes.bool,
videos: React.PropTypes.arrayOf(videoPropType).isRequired,
currentVideoId: React.PropTypes.string,
onPlaylistRemoveVideo: React.PropTypes.func.isRequired,
onPlaylistUpVoteVideo: React.PropTypes.func.isRequired,
isServer: React.PropTypes.bool
}
Playlist.defaultProps = {
serverId: "",
clientId: "",
serverExists: true,
currentVideoId: null,
isServer: false
}
export default Playlist;
| 33.239583 | 147 | 0.512692 |
183e86bddd759234648f055da0211577e93b5f29 | 1,674 | js | JavaScript | .eslintrc.js | ams-hackers/delisp | e11d9d447d21a4d979b3c0bffde28609bf0bda6e | [
"MIT"
] | 20 | 2018-11-13T10:35:30.000Z | 2019-06-28T10:13:59.000Z | .eslintrc.js | ams-hackers/delisp | e11d9d447d21a4d979b3c0bffde28609bf0bda6e | [
"MIT"
] | 79 | 2018-12-04T22:23:35.000Z | 2019-06-27T14:09:01.000Z | .eslintrc.js | liphe/delisp | e11d9d447d21a4d979b3c0bffde28609bf0bda6e | [
"MIT"
] | 1 | 2019-03-05T22:32:20.000Z | 2019-03-05T22:32:20.000Z | module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
},
plugins: ["import", "simple-import-sort"],
settings: {
// In theory, we could remove all the import/* settings when there
// is a new release of the eslint-plugin-import plugin.
"import/extensions": [".js", ".ts"],
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
"import/resolver": {
node: {
extensions: [".js", ".ts"],
},
},
},
rules: {
"sort-keys": "off",
"simple-import-sort/sort": "error",
"quote-props": "off",
"prefer-const": [
"error",
{
destructuring: "all",
},
],
"no-restricted-globals": ["error", "process"],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/interface-name-prefix": ["error", "never"],
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/member-ordering": "off",
// Should be an error, but there is a problem with the rule.
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/array-type": ["error", { defualt: "array-simple" }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/prefer-interface": "off",
"import/no-cycle": "error",
},
};
| 32.192308 | 79 | 0.60454 |
183e89b86adaacdaaded30c352f14923a5777bbf | 4,722 | js | JavaScript | packages/minimap/lib/decoration.js | tpaclatee/atom-setup-python | 0d4038b948e69b72a0beda2620c4ce559be9dde8 | [
"MIT"
] | 3 | 2020-12-21T12:33:22.000Z | 2021-04-25T03:04:11.000Z | packages/minimap/lib/decoration.js | tpaclatee/atom-setup-python | 0d4038b948e69b72a0beda2620c4ce559be9dde8 | [
"MIT"
] | null | null | null | packages/minimap/lib/decoration.js | tpaclatee/atom-setup-python | 0d4038b948e69b72a0beda2620c4ce559be9dde8 | [
"MIT"
] | 1 | 2021-05-14T06:21:06.000Z | 2021-05-14T06:21:06.000Z | "use strict"
import { Emitter } from "atom"
let idCounter = 0
const nextId = function () {
return idCounter++
}
/**
* The `Decoration` class represents a decoration in the Minimap.
*
* It has the same API than the `Decoration` class of a text editor.
*/
export default class Decoration {
/**
* Returns `true` if the passed-in decoration properties matches the
* specified type.
*
* @param {Object} decorationProperties the decoration properties to match
* @param {string} type the decoration type to match
* @return {boolean} whether the decoration properties match the type
*/
static isType(decorationProperties, type) {
if (Array.isArray(decorationProperties.type)) {
if (decorationProperties.type.indexOf(type) >= 0) {
return true
}
return false
} else {
return type === decorationProperties.type
}
}
/**
* Creates a new decoration.
*
* @param {Marker} marker the target marker for the decoration
* @param {Minimap} minimap the Minimap where the decoration will
* be displayed
* @param {Object} properties the decoration's properties
*/
constructor(marker, minimap, properties) {
/**
* @access private
*/
this.marker = marker
/**
* @access private
*/
this.minimap = minimap
/**
* @access private
*/
this.emitter = new Emitter()
/**
* @access private
*/
this.id = nextId()
/**
* @access private
*/
this.properties = null
this.setProperties(properties)
this.properties.id = this.id
/**
* @access private
*/
this.destroyed = false
/**
* @access private
*/
this.markerDestroyDisposable = this.marker.onDidDestroy(() => {
this.destroy()
})
this.screenRange = marker.getScreenRange()
}
/**
* Destroy this marker.
*
* If you own the marker, you should use `Marker#destroy` which will destroy
* this decoration.
*/
destroy() {
if (this.destroyed) {
return
}
this.markerDestroyDisposable.dispose()
this.markerDestroyDisposable = null
this.destroyed = true
this.emitter.emit("did-destroy")
this.emitter.dispose()
}
/**
* Returns whether this decoration is destroyed or not.
*
* @return {boolean} whether this decoration is destroyed or not
*/
isDestroyed() {
return this.destroyed
}
/**
* Registers an event listener to the `did-change-properties` event.
*
* This event is triggered when the decoration update method is called.
*
* @param {function(change:Object):void} callback a function to call
* when the event is triggered
* @return {Disposable} a disposable to stop listening to the event
*/
onDidChangeProperties(callback) {
return this.emitter.on("did-change-properties", callback)
}
/**
* Registers an event listener to the `did-destroy` event.
*
* @param {function():void} callback a function to call when the event
* is triggered
* @return {Disposable} a disposable to stop listening to the event
*/
onDidDestroy(callback) {
return this.emitter.on("did-destroy", callback)
}
/**
* An id unique across all Decoration objects.
*
* @return {number} the decoration id
*/
getId() {
return this.id
}
/**
* Returns the marker associated with this Decoration.
*
* @return {Marker} the decoration's marker
*/
getMarker() {
return this.marker
}
/**
* Check if this decoration is of type `type`.
*
* @param {string|Array} type a type like `'line-number'`, `'line'`, etc.
* `type` can also be an Array of Strings, where
* it will return true if the decoration's type
* matches any in the array.
* @return {boolean} whether this decoration match the passed-in type
*/
isType(type) {
return Decoration.isType(this.properties, type)
}
/**
* Returns the Decoration's properties.
*
* @return {Object} the decoration's properties
*/
getProperties() {
return this.properties
}
/**
* Update the marker with new properties. Allows you to change the
* decoration's class.
*
* @param {Object} newProperties the new properties for the decoration
*/
setProperties(newProperties) {
if (this.destroyed) {
return
}
const oldProperties = this.properties
this.properties = newProperties
this.properties.id = this.id
this.emitter.emit("did-change-properties", { oldProperties, newProperties })
}
}
| 24.984127 | 80 | 0.615629 |
183ec75a888dbf412911a0d1b3da1d9d39d269ff | 598 | js | JavaScript | src/server/routes.js | irockmysock/traveliary | d8d3993578ef974e89a1eb98a4a8d7848fe987f1 | [
"MIT"
] | null | null | null | src/server/routes.js | irockmysock/traveliary | d8d3993578ef974e89a1eb98a4a8d7848fe987f1 | [
"MIT"
] | 2 | 2021-05-10T13:17:32.000Z | 2022-02-10T19:14:08.000Z | src/server/routes.js | irockmysock/traveliary | d8d3993578ef974e89a1eb98a4a8d7848fe987f1 | [
"MIT"
] | null | null | null | // var multer = require('multer');
// var upload = multer({ dest: './uploads/' });
module.exports = (app, db) => {
const journals = require('./controllers/journal')(db);
app.get('/journals', journals.getAll);
app.post('/journals/new', journals.addNewJournal);
app.delete('/journals/delete', journals.deleteJournal);
app.put('/journals/edit', journals.editJournal);
const entries = require('./controllers/entry')(db);
app.get('/entries', entries.getAll);
app.post('/entries/new', entries.addNewEntry);
app.delete('/journalentries/delete', entries.deleteAllJournalEntries);
};
| 35.176471 | 72 | 0.687291 |
183f0f60cd6e0dc2b73634b119d1896606eddea5 | 385 | js | JavaScript | webpack.production.js | shin-dev/trello-design | a47647b3db3a5b6d282ed13e865963cc9705724f | [
"MIT"
] | 2 | 2020-12-28T14:13:32.000Z | 2020-12-28T14:14:03.000Z | webpack.production.js | shin-dev/trello-design | a47647b3db3a5b6d282ed13e865963cc9705724f | [
"MIT"
] | 8 | 2020-08-13T01:51:36.000Z | 2021-08-31T21:41:18.000Z | webpack.production.js | shin-dev/trello-design | a47647b3db3a5b6d282ed13e865963cc9705724f | [
"MIT"
] | 1 | 2020-07-25T02:29:19.000Z | 2020-07-25T02:29:19.000Z | const WebpackZipPlugin = require('webpack-zip-plugin')
const config = require('./webpack.config')
module.exports = Object.assign({}, config, {
mode: 'production',
plugins: config.plugins.concat([
new WebpackZipPlugin({
initialFile: './dist',
endPath: './dist',
zipName: 'trello-design.zip',
frontShell: 'echo "=== WebpackZipPlugin ==="'
})
])
})
| 25.666667 | 54 | 0.631169 |
183f484ed1f7856ba65cb7f919ba0bc7fe788ab7 | 71,470 | js | JavaScript | js/libs/oj/v2.3.0/min/ojdatetimepicker.js | davidtohea88/CAGAMASLAS | 05e25a65a0b8a7e8ef4673cbd478648cff269b09 | [
"UPL-1.0"
] | 1 | 2017-10-31T14:13:58.000Z | 2017-10-31T14:13:58.000Z | js/libs/oj/v2.3.0/min/ojdatetimepicker.js | dickdral/JET-World-Dashboard | ba34d63666fb95c272f9c95eb6e18b90bba2c313 | [
"UPL-1.0"
] | 5 | 2017-03-01T04:38:07.000Z | 2017-11-24T04:27:28.000Z | js/libs/oj/v2.3.0/min/ojdatetimepicker.js | dickdral/JET-World-Dashboard | ba34d63666fb95c272f9c95eb6e18b90bba2c313 | [
"UPL-1.0"
] | null | null | null | /**
* Copyright (c) 2014, 2017, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
"use strict";
/*
Copyright 2013 jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
*/
define(["ojs/ojcore","jquery","hammerjs","ojs/ojeditablevalue","ojs/ojinputtext","ojs/ojvalidation","ojs/ojpopup","ojs/ojbutton","ojs/ojanimation"],function(a,g,b){function c(b,c){c=b.parse(c);var d=a.Na._dateTime(c,"date fullYear month hours minutes seconds".split(" "),!0),e=new Date;e.setFullYear(d.fullYear);e.setDate(d.date);e.setMonth(d.month);e.setHours(d.hours);e.setMinutes(d.minutes);e.setSeconds(d.seconds);e.setMilliseconds(0);return e}function d(a){return this.options.converter.parse(a)}
function e(b,c){var d=b.translations.dateTimeRange||{},e=[{category:"hint",entries:["min","max","inRange"]},{category:"messageDetail",entries:["rangeUnderflow","rangeOverflow"]},{category:"messageSummary",entries:["rangeUnderflow","rangeOverflow"]}],f={min:b.min,max:b.max,converter:c};if(!g.isEmptyObject(d))for(var h=0,k=e.length;h<k;h++){var n=d[e[h].category];if(n){for(var l={},u=e[h].entries,p=0,m=u.length;p<m;p++)l[u[p]]=n[u[p]];f[e[h].category]=l}}return a.za.sx(a.Ve.VALIDATOR_TYPE_DATETIMERANGE).createValidator(f)}
function f(a,b){var c=a.filter("span");b?c.addClass("oj-disabled").removeClass("oj-enabled oj-default"):c.removeClass("oj-disabled").addClass("oj-enabled oj-default")}function h(a,b,c){if(!a||b===c.length)return a;var d=b+1;return h(a[c[b]],d,c)||h(a["*"],d,c)}function k(a){return a.delegate(".oj-datepicker-prev-icon, .oj-datepicker-prev-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-next-icon, .oj-datepicker-next-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-calendar td a",
"mouseout",function(){g(this).removeClass("oj-hover")}).delegate(".oj-datepicker-prev-icon, .oj-datepicker-prev-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-next-icon, .oj-datepicker-next-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-calendar td a","mouseover",function(){g(this).addClass("oj-hover")}).delegate(".oj-datepicker-prev-icon, .oj-datepicker-prev-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-next-icon, .oj-datepicker-next-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-calendar td a",
"focus",function(){g(this).addClass("oj-focus")}).delegate(".oj-datepicker-prev-icon, .oj-datepicker-prev-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-next-icon, .oj-datepicker-next-icon .oj-clickable-icon-nocontext.oj-component-icon, .oj-datepicker-calendar td a","blur",function(){g(this).removeClass("oj-focus")})}function l(a){var b=g(a.element[0]).parent().parent();a.Gk(b)}function m(a){return"native"===a.options.renderMode&&window.cordova&&window.datePicker}function r(a){a=
a.split(":");if(4!==a.length)throw Error("timeIncrement value should be in the format of hh:mm:ss:SSS");a={hN:parseInt(a[0].substring(0),10),WN:parseInt(a[1],10),qLa:parseInt(a[2],10),jKa:parseInt(a[3],10)};var b=0,c;for(c in a)b+=a[c];if(0===b)throw Error("timeIncrement must have a non 00:00:00:000 value");return a}function t(b,c){var d=b.resolvedOptions(),e={},f="hour hour12 minute second millisecond timeFormat timeZone timeZoneName isoStrFormat dst".split(" "),h,k;h=0;for(k=f.length;h<k;h++)f[h]in
d&&("timeFormat"===f[h]&&(e.formatType="time"),e[f[h]]=d[f[h]]);if(g.isEmptyObject(e))throw Error("Empty object for creating a time picker converter");g.extend(e,c||{});return a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter(e)}function s(a,b){function c(a){e.classList.remove("oj-timepicker-wheel-item-position"+f);e.classList.add("oj-timepicker-wheel-item-position"+a);f=a;return Promise.resolve()}function d(){e.parentNode.focus()}var e,f,h=!1,k=a.getText(b);if(k){e=document.createElement("div");
e.classList.add("oj-timepicker-wheel-item");e.classList.add("oj-timepicker-wheel-item-position"+b);f=b;a.JJa(b)&&(h=!0,e.classList.add("oj-disabled"));e.vKa=c;var n=document.createElement("div");n.textContent=k;n.classList.add("oj-timepicker-wheel-item-content");e.appendChild(n);Object.defineProperty(e,"ojDisabled",{enumerable:!0,get:function(){return h},set:function(a){a!==h&&(g(e).toggleClass("oj-disabled"),h=a)}});e.addEventListener("focus",d,!1);n.addEventListener("focus",d,!1)}return e}function q(a,
c,d){function e(){if(U[L+1]){h(1);var b=U.shift();b&&G.removeChild(b);(b=s(a,L))&&G.appendChild(b);U.push(b)}}function f(){if(U[L-1]){h(-1);var b=U.pop();b&&G.removeChild(b);(b=s(a,-L))&&G.insertBefore(b,U[0]);U.unshift(b)}}function h(b){for(var c=0;c<U.length;c++){var d=U[c];d&&d.vKa(c-L-b)}G.setAttribute("aria-valuenow",a.getText(0))}function k(){U.forEach(function(a){a&&G.removeChild(a)});U=[];for(var b=-L;b<=L;b++){var c=s(a,b);c&&G.appendChild(c);U.push(c)}G.setAttribute("aria-valuenow",a.getText(0))}
function n(b){var d=b.keyCode;switch(d){case Z:a.position++;b.preventDefault();break;case O:a.position--;b.preventDefault();break;case V:a.aia=a.aia.slice(0,-1);b.preventDefault();break;default:if(47<d&&58>d||95<d&&112>d||!c&&64<d&&91>d)a.keyboardValue+=b.key}}function l(b){G.focus();b=b.center.y;var c=W.offset().top,d=W.height();b=(b-c)/d;for(c=0;4>c&&b>F[c];)c++;2!==c&&(a.position+=c-2)}function u(a){G.focus();var b=a.velocityY;T=Math.floor(b*b/R/W.height()*5);a.preventDefault()}function p(a){G.focus();
var b=a.velocityY;T=-Math.floor(b*b/R/W.height()*5);a.preventDefault()}function m(a){G.focus();P=da=a.center.y;T=X=0}function v(){G.focus();T&&(a.position+=T);X=P=da=null}function r(b){G.focus();var c=b.center.y,d=Math.round((P-c)/W.height()*5);d!==X&&Math.abs(da-c)>S&&(da=c,a.position+=d-X,X=d);b.preventDefault()}function t(b){b.deltaY&&(b.currentTarget.focus(),b.preventDefault());0>b.deltaY&&a.position++;0<b.deltaY&&a.position--}function N(){a.aia="";G.classList.add("oj-focus")}function Y(){G.classList.remove("oj-focus");
a.update()}var L=7,S=2,F=[.152,.362,.638,.848],R=.007,V=8,Z=38,O=40,G,U=[],P,da,X,T;(function(b){G=document.createElement("div");G.classList.add("oj-timepicker-wheel");b&&G.classList.add(b);G.setAttribute("id","_ojWheel"+q.RGa++);G.setAttribute("tabIndex","0");G.setAttribute("role","spinbutton");a.tx=G})(d);var W=g(G);(function(){G.uKa=e;G.tKa=f;G.cja=k;G.bja=function(){return a.linked}})();(function(){var a=new b(G);a.get("pan").set({direction:b.DIRECTION_VERTICAL});a.get("swipe").set({direction:b.DIRECTION_VERTICAL});
a.on("tap",l);a.on("swipeup",u);a.on("swipedown",p);a.on("panstart",m);a.on("panend pancancel",v);a.on("panup pandown",r);G.addEventListener("wheel",t,!1);G.addEventListener("keydown",n,!1);G.addEventListener("focus",N,!1);G.addEventListener("blur",Y,!1)})();k();return G}function p(){function a(c){try{if(da=!0,c)for(var d in c)X[d]=c[d]}finally{da=!1,b()}}function b(){if(!da){r=Math.ceil(q/v)*v;t=Math.ceil((s-1)/v)*v;if(t<r)throw Error("Invalid min and max settings with current increment: "+q+" "+
s+ +v);m<r&&(m=r);m>t&&(m=t);m=Math.round(m/v)*v;if(F){G.displayRange=12;var a=R;"auto"===a&&(a=k(v,60),a=a===v||60===a?"hoursMeridiem":"all");switch(a){case "all":O.displayMultiplier=1;O.valueMultiplier=1;O.valueRange=1440;O.linked=!0;G.displayMultiplier=60;G.valueMultiplier=1;G.valueRange=1440;G.linked=!0;U.displayMultiplier=1;U.valueMultiplier=720;U.valueRange=2;U.linked=!0;break;case "none":O.displayMultiplier=1;O.valueMultiplier=1;O.valueRange=60;O.linked=!1;G.displayMultiplier=1;G.valueMultiplier=
60;G.valueRange=12;G.linked=!1;U.displayMultiplier=1;U.valueMultiplier=720;U.valueRange=2;U.linked=!1;break;case "hoursMinutes":O.displayMultiplier=1;O.valueMultiplier=1;O.valueRange=720;O.linked=!0;G.displayMultiplier=60;G.valueMultiplier=1;G.valueRange=720;G.linked=!0;U.displayMultiplier=1;U.valueMultiplier=720;U.valueRange=2;U.linked=!1;break;case "hoursMeridiem":O.displayMultiplier=1,O.valueMultiplier=1,O.valueRange=60,O.linked=!1,G.displayMultiplier=1,G.valueMultiplier=60,G.valueRange=24,G.linked=
!0,U.displayMultiplier=1,U.valueMultiplier=720,U.valueRange=2,U.linked=!0}}else switch(G.HNa=24,a=R,"auto"===a&&(a=k(v,60),a=a===v||60===a?"none":"all"),a){case "none":case "hoursMeridiem":O.displayMultiplier=1;O.valueMultiplier=1;O.valueRange=60;O.linked=!1;G.displayMultiplier=1;G.valueMultiplier=60;G.valueRange=24;G.linked=!1;break;case "all":case "hoursMinutes":O.displayMultiplier=1,O.valueMultiplier=1,O.valueRange=1440,O.linked=!0,G.displayMultiplier=60,G.valueMultiplier=1,G.valueRange=1440,G.linked=
!0}for(a=0;a<P.length;a++)P[a].refresh()}}function c(a){a=n.exec(a);return 60*parseInt(a[1],10)+parseInt(a[2],10)}function d(a){a=Math.floor(a);var b=Math.floor(a/60);a%=60;return"T"+e(b)+":"+f(a)}function e(a){return("0"+a).slice(-2)}function f(a){return("0"+a).slice(-2)}function g(a){return a.match(/^\d+$/)?parseInt(a,10):-1}function h(a){return a.match(/^\d+$/)?(a=parseInt(a,10),0===a&&(a=-1),12===a&&(a=0),a):-1}function k(a,b){return 0===b?a:k(b,a%b)}var n=/^.*T(\d{2})(?::?(\d{2}).*$)/,l={h:function(a){return 0===
a?"12":""+a},hh:function(a){return 0===a?"12":("0"+a).slice(-2)},H:function(a){return""+a},HH:e,mm:f},p={h:h,hh:h,H:g,HH:g,mm:g},m=0,v,q=0,r=0,s=1440,t=1440,S,F,R="auto",V="",Z=["AM","PM"],O=new u(this,{valueRange:60,displayRange:60,valueMultiplier:1,displayMultiplier:1}),G=new u(this,{valueMultiplier:60,displayMultiplier:1}),U=new u(this,{valueRange:2,displayRange:2,formatter:function(a){return Z[a]},parser:function(a){a=a.toLowerCase().charAt();return"a"===a?0:"p"===a?1:-1},valueMultiplier:720,
displayMultiplier:1}),P=[O,G,U],da=!1,X=this;(function(){da=!0;Object.defineProperty(X,"increment",{enumerable:!0,get:function(){return v},set:function(a){v=Math.floor(a);b()}});X.increment=1;Object.defineProperty(X,"grouped",{enumerable:!0,get:function(){return R},set:function(a){switch(a){case "auto":case "all":case "none":case "hoursMinutes":case "hoursMeridiem":R=a;break;default:throw Error("invalid grouped value: "+a);}b()}});Object.defineProperty(X,"min",{enumerable:!0,get:function(){return q},
set:function(a){q=Math.floor(a);b()}});Object.defineProperty(X,"isoMin",{enumerable:!0,get:function(){return d(q)},set:function(a){var b=c(a);isNaN(b)?console.log("Invalid ISO min time: "+a):X.min=b}});Object.defineProperty(X,"max",{enumerable:!0,get:function(){return s-1},set:function(a){s=Math.floor(a)+1;b()}});Object.defineProperty(X,"isoMax",{enumerable:!0,get:function(){return d(s)},set:function(a){var b=c(a);isNaN(b)?console.log("Invalid ISO max time: "+a):X.max=b}});Object.defineProperty(X,
"value",{enumerable:!0,get:function(){return m},set:function(a){m=Math.floor(a);b()}});Object.defineProperty(X,"isoValue",{enumerable:!0,get:function(){return d(m)},set:function(a){var b=c(a);isNaN(b)?console.log("Invalid ISO value time: "+a):X.value=b}});Object.defineProperty(X,"format",{enumerable:!0,get:function(){return S},set:function(a){S=a;a=a.replace(/\'[^']*\'/g,"").replace(/[^hHma]*/g,"");V=a.replace(/(h|H)+/,"h").replace(/m+/,"m");var c=a.match(/([hH]+)/),c=c[1];G.formatter=l[c];G.parser=
p[c];c=a.match(/(m+)/);a=c[1];O.formatter=l[a];O.parser=p[a];F=0<=V.indexOf("a");b()}});Object.defineProperty(X,"wheelOrder",{enumerable:!0,get:function(){return V}});Object.defineProperty(X,"ampmStrings",{enumerable:!0,get:function(){return Z},set:function(a){Z=a}});da=!1})();X.yLa=a;a(null);X.bZ=function(a){switch(a){case "hour":return G;case "minute":return O;case "ampm":return F?U:null;default:console.log("Unknown wheel type: "+a)}}}function n(a){function b(a){a=a.target;if(a.bja())for(a=0;a<
f.length;a++)f[a].bja()&&f[a].classList.add("oj-active");else a.classList.add("oj-active")}function c(){for(var a=0;a<f.length;a++)f[a].classList.remove("oj-active")}function d(){for(var g;g=e.firstChild;)e.removeChild(g);f=[];var h=a.wheelOrder;g=a.bZ("hour");g=q(g,!0,"oj-timepicker-hour");var k=a.bZ("minute"),k=q(k,!0,"oj-timepicker-minute"),n;0<=h.indexOf("a")&&(n=a.bZ("ampm"),n=q(n,!1,"oj-timepicker-meridian"));for(var l=h.split(""),h=0;h<l.length;h++)switch(l[h]){case "h":f.push(g);break;case "m":f.push(k);
break;case "a":f.push(n);break;default:console.log("Unknown wheelOrder code: "+l[h])}for(h=0;h<f.length;h++)n=f[h],n.addEventListener("focus",b,!1),n.addEventListener("blur",c,!1),e.appendChild(n)}var e,f=[];e=document.createElement("div");e.classList.add("oj-timepicker-wheel-group");e.cja=d;e.addEventListener("keydown",function(a){var b=a.target;switch(a.keyCode){case 37:g(b).prev().focus();break;case 39:g(b).next().focus()}},!1);d();return e}function u(a,b){function c(a){if(a)for(var b in a)P[b]=
a[b]}function d(){var b=!1,c=a.value;P.value=g(Math.floor(c/V),v);var e=a.max,e=Math.floor(c/Z)===Math.floor(e/Z)?g(Math.floor(e/V),v)+1:v;F!==e&&(b=!0,F=e);e=a.min;c=Math.floor(c/Z)===Math.floor(e/Z)?g(Math.floor(e/V),v):0;t!==c&&(b=!0,t=c);c=a.increment;e=h(c,Z);e===Z?(t=0,F=1,b=!0):e=P.linked&&c>V?c:0===g(e,V)?e/V:1;q!==e&&(q=e,b=!0);r=Math.floor(v/q);R=4<r;P.tx&&b&&P.tx.cja()}function e(){Z=V*v;G=O*m}function f(){n.forEach(function(a){P.tx.classList.remove("oj-timepicker-wheel-spin-"+a)});var a=
Math.abs(u-p);if(0===a)U=!1;else{var b;a--;a=Math.min(a,n.length-1);b=n[a];P.tx.classList.add("oj-timepicker-wheel-spin-"+n[a]);u>p&&(p++,P.tx.uKa());u<p&&(p--,P.tx.tKa());b&&setTimeout(f.bind(P),b)}}function g(a,b){return(a%b+b)%b}function h(a,b){return 0===b?a:h(b,a%b)}function k(a,b){return Math.floor(a/Z)*Z+g(b,v)*V+g(a,V)}var n=[150,100,50,25,16],l=0,u=0,p=0,m=1,v=1,q=1,r,s="",t,F,R,V,Z,O=1,G,U=!1,P=this;(function(){Object.defineProperty(P,"position",{enumerable:!0,get:function(){return u},set:function(a){var b=
g(a,r)*q;b>=t&&b<F&&a!==u&&(P.value+=(a-u)*q)}});Object.defineProperty(P,"value",{enumerable:!0,get:function(){return l},set:function(b){b=Math.round(b/q)*q;if((R||t<=b&&b<F)&&l!==b){l=g(b,v);b=g(Math.floor(l/q),r);var c=g(P.position,r),d=b-c;R&&(b>c?c+r-b<Math.abs(d)&&(d=b-c-r):b+r-c<Math.abs(d)&&(d=b+r-c));0!==d&&(u+=d,P.tx?U||(U=!0,f.call(P)):p=u);P.linked&&(a.value=k(a.value,l))}}});Object.defineProperty(P,"increment",{enumerable:!0,get:function(){return q},set:function(a){q!==a&&(q=a,e())}});
Object.defineProperty(P,"valueMultiplier",{enumerable:!0,get:function(){return V},set:function(a){V!==a&&(V=a,e())}});Object.defineProperty(P,"valueRange",{enumerable:!0,get:function(){return v},set:function(a){v!==a&&(v=a,e())}});Object.defineProperty(P,"displayMultiplier",{enumerable:!0,get:function(){return O},set:function(a){O!==a&&(O=a,e())}});Object.defineProperty(P,"displayRange",{enumerable:!0,get:function(){return m},set:function(a){m!==a&&(m=a,e())}});Object.defineProperty(P,"keyboardValue",
{enumerable:!0,get:function(){return s},set:function(a){s=a;P.parser&&s&&(a=P.parser(s),0<=a&&(a=Math.floor(l/G)*G+g(a,m)*O+g(l,O),t<=a&&a<F&&(P.value=a)),2<=s.length?s="":setTimeout(function(){s=""},1E3))}})})();(function(){P.getText=function(a){var b,c=g(p,r)+a,c=R||0<=c&&c<r;P.formatter&&c&&(b=P.formatter(g(Math.floor(g(g(p+a,r)*q,v)/O),m)));return b};P.JJa=function(a){a=g(p+a,r)*q;return 0!==t&&a<t||F!==v&&a>=F?!0:!1};P.update=function(){a.value=k(a.value,l)};P.refresh=d;P.yLa=c})();c(b)}var v=
a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter({year:"numeric"});a.Ra("oj.ojInputDate",g.oj.inputBase,{version:"1.0.0",widgetEventPrefix:"oj",_CLASS_NAMES:"oj-inputdatetime-input",_WIDGET_CLASS_NAMES:"oj-inputdatetime-date-only oj-component oj-inputdatetime",_ELEMENT_TRIGGER_WRAPPER_CLASS_NAMES:"",_INPUT_HELPER_KEY:"inputHelp",_ATTR_CHECK:[{attr:"type",setMandatory:"text"}],_GET_INIT_OPTIONS_PROPS:[{ha:"disabled",Sd:!0},{ha:"pattern"},{ha:"title"},{ha:"placeholder"},{ha:"value",wh:d},{ha:"required",
wh:!0,Sd:!0},{ha:"readonly",option:"readOnly",Sd:!0},{ha:"min",wh:d},{ha:"max",wh:d}],UQ:"oj-inputdatetime-input-trigger",TQ:"oj-inputdatetime-calendar-icon",PP:"oj-datepicker-current-day",Vx:"oj-datepicker-days-cell-over",UH:"oj-datepicker-unselectable",S1:"oj-datepicker-desc",QB:"oj-datepicker-calendar",zna:"oj-datepicker-div",ina:"oj-datepicker-inline",aQ:" oj-inputdatetime-input-container",jna:" oj-inputdatetime-inline",fs:"selection",ds:"cancelled",AH:"tab",Eg:"close",lna:"enabled",eQ:"disabled",
options:{datePicker:{footerLayout:"",changeMonth:"select",changeYear:"select",currentMonthPos:0,daysOutsideMonth:"hidden",numberOfMonths:1,showOn:"focus",stepMonths:"numberOfMonths",stepBigMonths:12,weekDisplay:"none",yearRange:"c-10:c+10"},converter:a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter({day:"2-digit",month:"2-digit",year:"2-digit"}),keyboardEdit:"enabled",max:void 0,min:void 0,pickerAttributes:null,renderMode:"jet",dayFormatter:null},sH:function(){this.Sl=this.xf=null;this.Uo=this.qn=
this.PD=this.ew=!1;this.Xv=4;this.Ml=this.Wh=this.Pk=this.Mj=this.sq=0;this.RC={};this.LK=null;var b=this.element[0].nodeName.toLowerCase();this.bf="div"===b||"span"===b;this.Qc=k(g("\x3cdiv id\x3d'"+this.Rm(this.zna)+"' role\x3d'region' aria-describedby\x3d'"+this.Rm(this.S1)+"' class\x3d'oj-datepicker-content'\x3e\x3c/div\x3e"));g("body").append(this.Qc);if(this.bf)this._WIDGET_CLASS_NAMES+=this.jna,this._CLASS_NAMES="";else{this._ELEMENT_TRIGGER_WRAPPER_CLASS_NAMES+=this.aQ;var c=this;this.SK=
this.Qc.ojPopup({initialFocus:"none",modality:"modeless",open:function(){"image"===c.options.datePicker.showOn&&c.Qc.find(".oj-datepicker-calendar").focus()},rootAttributes:{"class":"oj-datepicker-popup"}});(b=this.options.pickerAttributes)&&a.Fe.nO(this.SK.ojPopup("widget"),b)}},_ComponentCreate:function(){this.sH();var a=this._super();this.options.dayMetaData&&(this.options.dayFormatter=function(a){return function(b){return h(a,0,[b.fullYear,b.month,b.date])}}(this.options.dayMetaData));if(this.options.value){var b=
this.oc().format(this.options.value);this.wc(b,{})}this.pL(this.en());this.bf?(this.element.append(this.Qc),this.element.addClass(this.ina),this.Qc.css("display","block")):(this.dw(),this.kR());this.Dz();l(this);return a},Nh:function(){var a=this._superApply(arguments);this.y6(this.options.disabled);return a},_setOption:function(b,c,d){var e=null;if("value"===b)return c||(c=null),e=this._super(b,c,d),this.pL(c),this.Ok()&&this.li(!(this.bf&&this.wf&&this.wf[0]===document.activeElement)),e;if("dayMetaData"===
b)this._setOption("dayFormatter",function(a){return h(c,0,[a.fullYear,a.month,a.date])},d);else return e=this._super(b,c,d),"disabled"===b?this.y6(c):"max"===b||"min"===b?(this.RC[a.Ve.VALIDATOR_TYPE_DATETIMERANGE]=this.ZJ("min"),this.Px()):"readOnly"===b?(this.dw(),c&&this._hide(this.Eg)):"keyboardEdit"===b?this.dw():"dayFormatter"===b?(this.RC[a.Ve.VALIDATOR_TYPE_DATERESTRICTION]=this.ZJ("dayFormatter"),this.Px()):"converter"===b&&(this.LK=null),"datePicker"===b&&"currentMonthPos"===d.subkey&&this.pL(this.en()),
d={max:!0,min:!0,dayFormatter:!0,datePicker:!0,translations:!0},this.Ok()&&b in d&&this.li(),e},dw:function(){this.element.prop("readOnly",!(!this.options.readOnly&&!this.hV()))},hV:function(){return this.options.keyboardEdit===this.eQ},C1:function(){return this.xf},_destroy:function(){var a=this._super(),b=g(this.element[0]).parent().parent();this.AQ(b);this.element.off("focus touchstart");this.bk.off("touchstart");this.xf&&this.xf.remove();this.bf&&(this.element.removeProp("disabled"),this.element.removeProp("readonly"));
this.Qc.remove();return a},Ok:function(){return this.bf||this.SK.ojPopup("isOpen")||this.Uo},ZQ:function(){this.Sl=this._superApply(arguments);this.Sl.attr({role:"combobox","aria-haspopup":"true",tabindex:"-1"})},MV:function(){var a=this.options.datePicker.showOn;this.ew?(this.ew=!1,this.Sl.focus()):"focus"===a?this.show():this.Ok()&&this._hide(this.Eg)},EH:function(){if("focus"===this.options.datePicker.showOn)if(this.Ok())this.qn=!0,this._hide(this.Eg);else{var a=this.element[0]===document.activeElement;
this.show();this.ew=!0;a&&this.Sl.focus()}},kR:function(){var a=this.options.datePicker.showOn,b=g("\x3cspan\x3e").addClass(this.UQ),c=g("\x3cspan title\x3d'"+this.gT()+"'/\x3e").addClass(this.TQ+" oj-clickable-icon-nocontext oj-component-icon");b.append(c);this.element.on("focus",g.proxy(this.MV,this));this.element.on("touchstart",g.proxy(this.EH,this));var d=this;this.bk.on("touchstart",function(){d.PD=!0});"image"===a&&(c.css("display","block"),this.Pg?(this.element.css("border-top-left-radius",
0),this.element.css("border-bottom-left-radius",0)):(this.element.css("border-top-right-radius",0),this.element.css("border-bottom-right-radius",0)));c.on("click",function(){d.Ok()?d._hide(d.Eg):(d.show(),d.Qc.find(".oj-datepicker-calendar").focus());return!1});this.We(c);this.Gk(c);this.xf=b;this.element.after(b)},bta:function(a){var b;b=!1;var c=g.ui.keyCode,d=this.Pg;if(this.Ok())switch(a.keyCode){case 84:a.altKey&&a.ctrlKey&&(this.Qc.find(".oj-datepicker-current").focus(),b=!0);break;case c.SPACE:case c.ENTER:return b=
g("td."+this.Vx,this.Qc),b[0]&&this.Oca(this.Mj,this.Wh,b[0],a),a.preventDefault(),a.stopPropagation(),!1;case c.ESCAPE:this._hide(this.ds);b=!0;break;case c.PAGE_UP:a.ctrlKey&&a.altKey?this.xc(-this.options.datePicker.stepBigMonths,"M",!0):a.altKey?this.xc(-1,"Y",!0):this.xc(-this.Os(),"M",!0);b=!0;break;case c.PAGE_DOWN:a.ctrlKey&&a.altKey?this.xc(+this.options.datePicker.stepBigMonths,"M",!0):a.altKey?this.xc(1,"Y",!0):this.xc(+this.Os(),"M",!0);b=!0;break;case c.END:this.sq=this.gn(this.Wh,this.Mj);
this.li(!0);b=!0;break;case c.HOME:this.sq=1;this.li(!0);b=!0;break;case c.LEFT:this.xc(d?1:-1,"D",!0);a.originalEvent.altKey&&this.xc(a.ctrlKey?-this.options.datePicker.stepBigMonths:-this.Os(),"M",!0);b=!0;break;case c.UP:this.xc(-7,"D",!0);b=!0;break;case c.RIGHT:this.xc(d?-1:1,"D",!0);a.originalEvent.altKey&&this.xc(a.ctrlKey?+this.options.datePicker.stepBigMonths:+this.Os(),"M",!0);b=!0;break;case c.DOWN:this.xc(7,"D",!0),b=!0}else a.keyCode===c.HOME&&a.ctrlKey&&(this.show(),b=!0);b&&(a.preventDefault(),
a.stopPropagation())},eta:function(a){var b;b=!1;var c=g.ui.keyCode,d=this.Pg;if(this.Ok())switch(a.keyCode){case 84:a.altKey&&a.ctrlKey&&(this.Qc.find(".oj-datepicker-current").focus(),b=!0);break;case c.SPACE:case c.ENTER:return b=g("td."+this.Vx,this.Qc),b[0]&&this.mL(b[0],"M"),a.preventDefault(),a.stopPropagation(),!1;case c.ESCAPE:this.hide();b=!0;break;case c.PAGE_UP:a.ctrlKey&&a.altKey?this.xc(-this.options.datePicker.stepBigMonths,"M",!0,"month"):a.altKey?this.xc(-1,"Y",!0,"month"):this.xc(-this.Os(),
"M",!0,"month");b=!0;break;case c.PAGE_DOWN:a.ctrlKey&&a.altKey?this.xc(+this.options.datePicker.stepBigMonths,"M",!0,"month"):a.altKey?this.xc(1,"Y",!0,"month"):this.xc(+this.Os(),"M",!0,"month");b=!0;break;case c.END:this.Mj=11;this.li(!0,"month");b=!0;break;case c.HOME:this.Mj=0;this.li(!0,"month");b=!0;break;case c.LEFT:this.xc(d?1:-1,"M",!0,"month");b=!0;break;case c.UP:this.xc(-3,"M",!0,"month");b=!0;break;case c.RIGHT:this.xc(d?-1:1,"M",!0,"month");b=!0;break;case c.DOWN:this.xc(3,"M",!0,"month"),
b=!0}else a.keyCode===c.HOME&&a.ctrlKey&&(this.show(),b=!0);b&&(a.preventDefault(),a.stopPropagation())},gta:function(a){var b;b=!1;var c=g.ui.keyCode,d=this.Pg;if(this.Ok())switch(a.keyCode){case 84:a.altKey&&a.ctrlKey&&(this.Qc.find(".oj-datepicker-current").focus(),b=!0);break;case c.SPACE:case c.ENTER:return b=g("td."+this.Vx,this.Qc),b[0]&&this.mL(b[0],"Y"),a.preventDefault(),a.stopPropagation(),!1;case c.ESCAPE:this.hide();b=!0;break;case c.PAGE_UP:a.altKey&&this.xc(-1,"Y",!0,"year");b=!0;break;
case c.PAGE_DOWN:a.altKey&&this.xc(1,"Y",!0,"year");b=!0;break;case c.END:this.Wh=10*Math.floor(this.Wh/10)+9;this.li(!0,"year");b=!0;break;case c.HOME:this.Wh=10*Math.floor(this.Wh/10);this.li(!0,"year");b=!0;break;case c.LEFT:this.xc(d?1:-1,"Y",!0,"year");b=!0;break;case c.UP:this.xc(-3,"Y",!0,"year");b=!0;break;case c.RIGHT:this.xc(d?-1:1,"Y",!0,"year");b=!0;break;case c.DOWN:this.xc(3,"Y",!0,"year"),b=!0}else a.keyCode===c.HOME&&a.ctrlKey&&(this.show(),b=!0);b&&(a.preventDefault(),a.stopPropagation())},
li:function(b,c,d){this.Xv=4;var e;e="year"===c?this.iua():"month"===c?this.gua():this.fua();e.html="\x3cdiv class\x3d'oj-datepicker-wrapper'\x3e"+e.html+"\x3c/div\x3e";this.uq=c;if(d){var f=this.Qc.children().first();f.css({position:"absolute",left:0,top:0});this.Qc.prepend(e.html);var g=this.Qc.children().first();d="previous"==d?"end":"start";a.$.ym(g[0],"open",{effect:"slideIn",direction:d});var h=this;a.$.ym(f[0],"close",{effect:"slideOut",direction:d,persist:"all"}).then(function(){f&&f.remove();
h.uda(b,c,e.vM)})}else this.Qc.empty().append(e.html),this.uda(b,c,e.vM)},uda:function(a,b,c){var d=g("button",this.Qc);0<d.length&&(1===d.length&&g(d[0]).addClass("oj-datepicker-single-button"),g.each(d,function(a,b){g(b).ojButton()}));this.eqa();c&&this.Qc.find(".oj-datepicker-calendar").attr("aria-activedescendant",c);c=this.IJ();var d=c[1],e=275;this.Qc.removeClass("oj-datepicker-multi-2 oj-datepicker-multi-3 oj-datepicker-multi-4").width("");if("year"===b||"month"===b)this.Qc.removeClass("oj-datepicker-multi");
else{c=this.IJ();d=c[1];if(1<d){b=this.Qc.find(".oj-datepicker-calendar");var f=b.find("tbody a"),f=parseFloat(f.css("width"));b=parseFloat(b.css("margin-left"));isNaN(f)||isNaN(b)||(e=f*("number"===this.options.datePicker.weekDisplay?8:7)+2*b);this.Qc.addClass("oj-datepicker-multi-"+d).css("width",e*d+(this.bf?2:0)+"px")}this.Qc[(1!==c[0]||1!==c[1]?"add":"remove")+"Class"]("oj-datepicker-multi")}this.Ok()&&this.element.is(":visible")&&!this.element.is(":disabled")&&(a?(b=this.Qc.find(".oj-datepicker-calendar"),
b[0]!==document.activeElement&&g(b[0]).focus()):this.bf||this.element[0]===document.activeElement||this.element.focus())},xc:function(a,b,c,d,e){this.options.disabled||(this.h4(a+("M"===b?this.options.datePicker.currentMonthPos:0),b),this.li(c,d,e))},gwa:function(){var a=new Date;this.sq=a.getDate();this.Pk=this.Mj=a.getMonth();this.Ml=this.Wh=a.getFullYear();this.xc(null,null,!0,"day")},mL:function(b,c){var d,e=a.Na,f=this.en();if(d=b.getAttribute("data-year"))this.Wh=this.Ml=d=parseInt(d,10);"M"===
c?(this.Mj=this.Pk=d=parseInt(b.getAttribute("data-month"),10),e._dateTime(f,{fullYear:this.Wh,month:this.Mj})):e._dateTime(f,{fullYear:this.Wh});g("#"+this.Rm(this.QB)).html(this.Dj(this.options.monthWide[this.Pk])+" "+v.format(a.Na.dateToLocalIso(new Date(this.Ml,this.Pk,1))));this.xc(0,0,!0,"M"===c?"day":this.hFa)},Oca:function(b,c,d){g(d).hasClass(this.UH)||this.options.disabled||(this.sq=g("a",d).html(),this.Mj=b,this.Wh=c,b=a.Na,c=this.options.value,d=new Date(this.Wh,this.Mj,this.sq),c=c?b._dateTime(c,
{fullYear:d.getFullYear(),month:d.getMonth(),date:d.getDate()}):b.dateToLocalIso(d),this.BDa(c,{}),this._hide(this.fs))},BDa:function(a,b){var c=this.oc().format(a);this.Hl(c);this.wc(c,b)},L7:function(){return a.Na.dateToLocalIso(this.Xva())},pL:function(b){b=a.Na._dateTime(b||this.L7(),["fullYear","month","date"],!0);this.sq=b.date;this.Pk=this.Mj=b.month;this.Ml=this.Wh=b.fullYear;this.h4()},Os:function(){var a=this.options.datePicker.stepMonths;return g.isNumeric(a)?a:this.options.datePicker.numberOfMonths},
ID:function(a){return!this.options.disabled&&("click"===a.type||"keydown"===a.type&&32===a.keyCode)},n9:function(a){"year"===this.uq?this.xc(-10,"Y",!0,"year","previous"):"month"===this.uq?this.xc(-1,"Y",!0,"month","previous"):this.xc(-a,"M",!0,"day","previous")},m9:function(a){"year"===this.uq?this.xc(10,"Y",!0,"year","next"):"month"===this.uq?this.xc(1,"Y",!0,"month","next"):this.xc(+a,"M",!0,"day","next")},eqa:function(){var b=this.Os(),c=this;this.Qc.find("[data-handler]").map(function(){g(this).bind(this.getAttribute("data-event"),
{prev:function(a){if(c.ID(a))return c.n9(b),!1},next:function(a){if(c.ID(a))return c.m9(b),!1},today:function(a){if(c.ID(a))return c.gwa(),!1},selectDay:function(a){c.Oca(+this.getAttribute("data-month"),+this.getAttribute("data-year"),this,a);return!1},selectMonth:function(){c.mL(this,"M");return!1},selectYear:function(){c.mL(this,"Y");return!1},calendarKey:function(a){"year"===c.uq?c.gta(a):"month"===c.uq?c.eta(a):c.bta(a)},selectMonthHeader:function(a){if(c.ID(a))return"month"===c.uq?c.li(!0,"day"):
c.li(!0,"month"),!1},selectYearHeader:function(a){if(c.ID(a))return"year"===c.uq?c.li(!0,"day"):(c.hFa=c.uq,c.li(!0,"year")),!1}}[this.getAttribute("data-handler")])});this.Qc.find(".oj-datepicker-calendar").map(function(){a.D.TN({element:g(this),applyHighlight:!0})});var d=this.Qc.find(".oj-datepicker-header a, .oj-datepicker-buttonpane a");this.We(d);this.Gk(d)},Dz:function(){if(a.D.jf()){var c=this,d=this.Os(),e=this.Pg;this.Qc.rj({recognizers:[[b.Swipe,{direction:b.DIRECTION_HORIZONTAL}]]}).on(e?
"swiperight":"swipeleft",function(){c.m9(d);return!1}).on(e?"swipeleft":"swiperight",function(){c.n9(d);return!1})}},Ho:function(b){if(b=this.options[b]){var c=this.en();b=a.Na._minMaxIsoString(b,c)}return b},dD:function(a,b,c,d,e){var f,g=this.Pg;f=this.Dj(this.F("prevText"));d=d?"\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-datepicker-prev-icon oj-enabled oj-default oj-component-icon oj-clickable-icon-nocontext' data-handler\x3d'prev' data-event\x3d'click keydown' title\x3d'"+f+"'\x3e\x3c/a\x3e":
"\x3ca class\x3d'oj-datepicker-prev-icon oj-disabled oj-component-icon oj-clickable-icon-nocontext' title\x3d'"+f+"'\x3e\x3c/a\x3e";f=this.Dj(this.F("nextText"));f=e?"\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-datepicker-next-icon oj-enabled oj-default oj-component-icon oj-clickable-icon-nocontext' data-handler\x3d'next' data-event\x3d'click keydown' title\x3d'"+f+"'\x3e\x3c/a\x3e":"\x3ca class\x3d'oj-datepicker-next-icon oj-disabled oj-component-icon oj-clickable-icon-nocontext' title\x3d'"+
f+"'\x3e\x3c/a\x3e";e="\x3cdiv class\x3d'oj-datepicker-header"+(this.options.disabled?" oj-disabled ":" oj-enabled oj-default ")+"'\x3e";e+=/all|left/.test(c)?g?f:d:"";e+=/all|right/.test(c)?g?d:f:"";e+=this.hua(a,b);return e+"\x3c/div\x3e"},cD:function(a,b){var c="",d=this.Dj(this.F("currentText")),e="\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-datepicker-current oj-priority-secondary "+(this.options.disabled?"oj-disabled' disabled":"oj-enabled'")+" data-handler\x3d'today' data-event\x3d'click keydown'\x3e"+
d+"\x3c/a\x3e";if(1<a.length){d=0;e=[{index:a.indexOf("today"),content:this.vK(b)?e:""}];for(e.sort(function(a,b){return a.index-b.index});d<e.length&&0>e[d].index;)d++;for(;d<e.length;)c+=e[d++].content;0<c.length&&(c="\x3cdiv class\x3d'oj-datepicker-buttonpane'\x3e"+c+"\x3c/div\x3e")}return c},fua:function(){var b,c,d=a.Na;b=["date","month","fullYear"];c=this.oc();var e,f,g=this.options.dayWide,h=this.options.dayNarrow,k=this.options.firstDayOfWeek,n,l,u,p,m,v,q,r,s,t="",S,F,R,V,Z,O,G,U,P,da=new Date,
da=new Date(da.getFullYear(),da.getMonth(),da.getDate()),X=this.Pg;e=this.options.datePicker.footerLayout;var T=this.IJ(),W=this.options.datePicker.currentMonthPos,ia=this.options.dayFormatter;P=null;var ga=1!==T[0]||1!==T[1];f=this.Ho("min");var ca;n=this.Ho("max");var aa,W=this.Pk-W,ba=this.Ml,fa=new Date(this.Wh,this.Mj,this.sq);l=this.en();var ha=d._dateTime(l,b,!0),oa=ha.fullYear,ta=ha.date,ha=ha.month,ua=new Date(oa,ha,ta),ma=this.options.disabled,xa=this.Dj(this.F("weekText"));f&&(f=c.parse(f),
ca=d._dateTime(f,b,!0));n&&(n=c.parse(n),aa=d._dateTime(n,b,!0));d._clearTime(l);0>W&&(W+=12,ba--);if(ca)for(b=new Date(ca.fullYear,ca.month,ca.date),aa&&0>c.we(n,f)&&(b=new Date(aa.fullYear,aa.month,aa.date));new Date(ba,W,this.gn(ba,W))<b;)W++,11<W&&(W=0,ba++);if(aa)for(b=new Date(aa.fullYear,aa.month-T[0]*T[1]+1,aa.date),ca&&0>c.we(n,f)&&(b=new Date(ca.fullYear,ca.month,ca.date));new Date(ba,W,1)>b;)W--,0>W&&(W=11,ba--);this.Pk=W;this.Ml=ba;c=this.b5(-1,ba,W)&&!ma;b=this.b5(1,ba,W)&&!ma;e=this.cD(e,
da);f=this.options.datePicker.weekDisplay;n=this.options.datePicker.daysOutsideMonth;l="";u="all";for(p=0;p<T[0];p++){m="";this.Xv=4;for(v=0;v<T[1];v++){u=0===p?"all":"";F="";if(ga){F+="\x3cdiv class\x3d'oj-datepicker-group";if(1<T[1])switch(v){case 0:F+=" oj-datepicker-group-first";u=0===p?X?"right":"left":"";break;case T[1]-1:F+=" oj-datepicker-group-last";u=0===p?X?"left":"right":"";break;default:F+=" oj-datepicker-group-middle",u=""}F+="'\x3e"}F+=this.dD(W,ba,u,c,b);F+="\x3ctable class\x3d'oj-datepicker-calendar"+
("number"===f?" oj-datepicker-weekdisplay":"")+(ma?" oj-disabled ":" oj-enabled oj-default ")+"' tabindex\x3d-1 data-handler\x3d'calendarKey' data-event\x3d'keydown' aria-readonly\x3d'true' role\x3d'grid' aria-labelledby\x3d'"+this.Rm(this.QB)+"'\x3e\x3cthead role\x3d'presentation'\x3e\x3ctr role\x3d'row'\x3e";R="number"===f?"\x3cth class\x3d'oj-datepicker-week-col'\x3e"+this.Dj(this.F("weekHeader"))+"\x3c/th\x3e":"";for(u=0;7>u;u++)V=(u+parseInt(k,10))%7,R+="\x3cth role\x3d'columnheader' aria-label\x3d'"+
g[V]+"'"+(5<=(u+k+6)%7?" class\x3d'oj-datepicker-week-end'":"")+"\x3e\x3cspan title\x3d'"+g[V]+"'\x3e"+h[V]+"\x3c/span\x3e\x3c/th\x3e";F+=R+"\x3c/tr\x3e\x3c/thead\x3e\x3ctbody role\x3d'presentation'\x3e";R=this.gn(ba,W);ba===oa&&W===ha&&(ta=Math.min(ta,R));u=(this.Vua(ba,W)-k+7)%7;R=Math.ceil((u+R)/7);this.Xv=R=ga?this.Xv>R?this.Xv:R:R;V=new Date(ba,W,1-u);for(Z=0;Z<R;Z++){F+="\x3ctr role\x3d'row'\x3e";u=this.oc().vt(d.dateToLocalIso(V));O="none"===f?"":"\x3ctd class\x3d'oj-datepicker-week-col' role\x3d'rowheader' aria-label\x3d'"+
xa+" "+u+"'\x3e"+u+"\x3c/td\x3e";for(u=0;7>u;u++){U=V.getMonth()!==W;q=V.getTime()===ua.getTime();r="oj-dp-"+this.uuid+"-"+Z+"-"+u+"-"+p+"-"+v;(s=V.getTime()===fa.getTime()&&W===this.Mj)?(t=r,S=" "+this.Vx):S="";G=[!0,""];P=V.getFullYear();var ea=V.getMonth(),Aa=V.getDate();ia&&(P=ia({fullYear:P,month:ea+1,date:Aa}))&&(G=[!P.disabled,P.className||""],P.tooltip&&G.push(P.tooltip));ea=V.getTime()===ua.getTime();P=U&&"selectable"!==n||!G[0]||this.bBa(V,ca,aa);O+="\x3ctd role\x3d'gridcell' aria-disabled\x3d'"+
!!P+"' aria-selected\x3d'"+q+"' id\x3d'"+r+"' class\x3d'"+(5<=(u+k+6)%7?" oj-datepicker-week-end":"")+(U?" oj-datepicker-other-month":"")+S+(P||ma?" "+this.UH+" oj-disabled":" oj-enabled ")+(U&&"hidden"===n?"":" "+G[1]+(q?" "+this.PP:"")+(V.getTime()===da.getTime()?" oj-datepicker-today":""))+"'"+(U&&"hidden"===n||!G[2]?"":" title\x3d'"+G[2].replace(/'/g,"\x26#39;")+"'")+(P?"":" data-handler\x3d'selectDay' data-event\x3d'click' data-month\x3d'"+V.getMonth()+"' data-year\x3d'"+V.getFullYear()+"'")+
"\x3e"+(U&&"hidden"===n?"\x26#xa0;":P||ma?"\x3cspan class\x3d'oj-disabled'\x3e"+V.getDate()+"\x3c/span\x3e":"\x3ca role\x3d'button' class\x3d'oj-enabled"+(ea?" oj-selected":"")+(U?" oj-priority-secondary":"")+"' "+(s?"":"tabindex\x3d'-1' ")+" href\x3d'#'\x3e"+V.getDate()+"\x3c/a\x3e")+"\x3c/td\x3e";V.setDate(V.getDate()+1)}F+=O+"\x3c/tr\x3e"}W++;11<W&&(W=0,ba++);F+="\x3c/tbody\x3e\x3c/table\x3e"+(ga?"\x3c/div\x3e"+(0<T[0]&&v===T[1]-1?"\x3cdiv class\x3d'oj-datepicker-row-break'\x3e\x3c/div\x3e":""):
"");m+=F}l+=m}return{html:l+e,vM:t}},hua:function(b,c){var d=this.options.datePicker.changeMonth,e=this.options.datePicker.changeYear,f=a.$a.Tha()?"before":"after",g="\x3cdiv class\x3d'oj-datepicker-title' role\x3d'header'\x3e",h="",k=a.Na,n=this.options.monthWide,l=this.options.disabled;n&&(h="none"===d?h+("\x3cspan class\x3d'oj-datepicker-month'\x3e"+n[b]+"\x3c/span\x3e"):h+("\x3ca role\x3d'button' href\x3d'#' data-handler\x3d'selectMonthHeader' data-event\x3d'click keydown' class\x3d'oj-datepicker-month "+
(l?"oj-disabled' disabled":"oj-enabled'")+"\x3e")+(n[b]+"\x3c/a\x3e"),"before"===f&&(g+=h+("select"!==d||"select"!==e?"\x26#xa0;":"")));this.Pka||(this.Pka="","none"===e?g+="\x3cspan class\x3d'oj-datepicker-year'\x3e"+v.format(k.dateToLocalIso(new Date(c,b,1)))+"\x3c/span\x3e":(g=g+("\x3ca role\x3d'button' href\x3d'#' data-handler\x3d'selectYearHeader' data-event\x3d'click keydown' class\x3d'oj-datepicker-year "+(l?"oj-disabled' disabled":"oj-enabled'")+"\x3e")+(v.format(k.dateToLocalIso(new Date(c,
b,1)))+"\x3c/a\x3e"),this.Pka=null));n&&"after"===f&&(g+=("select"!==d||"select"!==e?"\x26#xa0;":"")+h);g+="\x3cspan class\x3d'oj-helper-hidden-accessible' id\x3d'"+this.Rm(this.QB)+"'\x3e";g+=(n?n[b]+" ":"")+v.format(k.dateToLocalIso(new Date(c,b,1)))+"\x3c/span\x3e";g+="\x3cspan class\x3d'oj-helper-hidden-accessible' id\x3d'"+this.Rm(this.S1)+"'\x3e"+this.Dj(this.F("datePicker"))+"\x3c/span\x3e";return g+="\x3c/div\x3e"},h4:function(a,b){var c=this.Ml+("Y"===b?a:0),d=this.Pk+("M"===b?a:0),e=Math.min(this.sq,
this.gn(c,d))+("D"===b?a:0),c=new Date(c,d,e);this.sq=c.getDate();this.Pk=this.Mj=c.getMonth();this.Ml=this.Wh=c.getFullYear()},gua:function(){var b,c,d;b=a.Na;var e=["date","month","fullYear"];c=this.oc();var f,g=this.options.monthAbbreviated,h,k,n,l,u,p="",m,v,q=new Date;f=new Date(q.getFullYear(),q.getMonth(),q.getDate());h=this.options.datePicker.footerLayout;d=this.Ho("min");var r;m=this.Ho("max");var s;k=this.Pk;var q=this.Ml,t=this.en(),S=b._dateTime(t,e,!0);n=S.fullYear;l=S.date;u=S.month;
var S=new Date(n,u,l),F=this.options.disabled;d&&(d=c.parse(d),r=b._dateTime(d,e,!0));m&&(m=c.parse(m),s=b._dateTime(m,e,!0));b._clearTime(t);0>k&&(k+=12,q--);if(r)for(b=new Date(r.fullYear,r.month,r.date),s&&0>c.we(m,d)&&(b=new Date(s.fullYear,s.month,s.date));new Date(q,k,this.gn(q,k))<b;)k++,11<k&&(k=0,q++);if(s)for(b=new Date(s.fullYear,s.month,s.date),r&&0>c.we(m,d)&&(b=new Date(r.fullYear,r.month,r.date));new Date(q,k,1)>b;)k--,0>k&&(k=11,q--);this.Pk=k;this.Ml=q;c=this.c5(-1,q)&&!F;d=this.c5(1,
q)&&!F;f=this.cD(h,f);h="";this.Xv=4;c=""+this.dD(k,q,"all",c,d);c+="\x3ctable class\x3d'oj-datepicker-calendar oj-datepicker-monthview"+(F?" oj-disabled ":" oj-enabled oj-default ")+"' tabindex\x3d-1 data-handler\x3d'calendarKey' data-event\x3d'keydown' aria-readonly\x3d'true' role\x3d'grid' aria-labelledby\x3d'"+this.Rm(this.QB)+"'\x3e";c+="\x3ctbody role\x3d'presentation'\x3e";d=this.gn(q,k);q===n&&k===u&&Math.min(l,d);m=new Date(q,0,1);for(b=0;4>b;b++){c+="\x3ctr role\x3d'row'\x3e";e="";for(k=
0;3>k;k++){t=3*b+k;n=m.getMonth()===S.getMonth();l="oj-dp-"+this.uuid+"-"+b+"-"+k+"-0-0";(u=t===this.Mj)?(p=l,d=" "+this.Vx):d="";var R=m.getMonth()===S.getMonth();v=s&&s.fullYear===q;v=!((!r||r.fullYear!==q||t>=r.month)&&(!v||t<=s.month));e+="\x3ctd role\x3d'gridcell' aria-disabled\x3d'"+!!v+"' aria-selected\x3d'"+n+"' id\x3d'"+l+"' class\x3d'"+d+(v||F?" "+this.UH+" oj-disabled":" oj-enabled ")+(n?" "+this.PP:"")+"'"+(v?"":" data-handler\x3d'selectMonth' data-event\x3d'click' data-month\x3d'"+m.getMonth()+
"' data-year\x3d'"+m.getFullYear()+"'")+"\x3e"+(v||F?"\x3cspan class\x3d'oj-disabled'\x3e"+g[t]+"\x3c/span\x3e":"\x3ca role\x3d'button' class\x3d'oj-enabled"+(R?" oj-selected":"")+"' "+(u?"":"tabindex\x3d'-1' ")+" href\x3d'#'\x3e"+g[t]+"\x3c/a\x3e")+"\x3c/td\x3e";m.setMonth(m.getMonth()+1)}c+=e+"\x3c/tr\x3e"}h+=c+"\x3c/tbody\x3e\x3c/table\x3e";return{html:h+f,vM:p}},iua:function(){var b,c,d,e=a.Na;b=["date","month","fullYear"];c=this.oc();var f,g,h,k,n,l,u="",p,m,q,r=new Date;f=new Date(r.getFullYear(),
r.getMonth(),r.getDate());g=this.options.datePicker.footerLayout;d=this.Ho("min");var s;m=this.Ho("max");r=this.Pk;k=this.Ml;var t=this.en(),L=e._dateTime(t,b,!0);n=L.fullYear;l=L.date;p=L.month;var L=new Date(n,p,l),S=this.options.disabled;d&&(d=c.parse(d),s=e._dateTime(d,b,!0));m&&(m=c.parse(m),h=e._dateTime(m,b,!0));e._clearTime(t);0>r&&(r+=12,k--);if(s)for(b=new Date(s.fullYear,s.month,s.date),h&&0>c.we(m,d)&&(b=new Date(h.fullYear,h.month,h.date));new Date(k,r,this.gn(k,r))<b;)r++,11<r&&(r=0,
k++);if(h)for(b=new Date(h.fullYear,h.month,h.date),s&&0>c.we(m,d)&&(b=new Date(s.fullYear,s.month,s.date));new Date(k,r,1)>b;)r--,0>r&&(r=11,k--);this.Pk=r;this.Ml=k;c=this.a5(-1,k)&&!S;d=this.a5(1,k)&&!S;f=this.cD(g,f);g="";this.Xv=4;c=""+this.dD(r,k,"all",c,d);c+="\x3ctable class\x3d'oj-datepicker-calendar oj-datepicker-yearview"+(S?" oj-disabled ":" oj-enabled oj-default ")+"' tabindex\x3d-1 data-handler\x3d'calendarKey' data-event\x3d'keydown' aria-readonly\x3d'true' role\x3d'grid' aria-labelledby\x3d'"+
this.Rm(this.QB)+"'\x3e";c+="\x3ctbody role\x3d'presentation'\x3e";d=this.gn(k,r);k===n&&r===p&&Math.min(l,d);s=this.ewa(k,s,h);t=10*Math.floor(k/10);d=new Date(t,r,1);for(m=0;4>m;m++){c+="\x3ctr role\x3d'row'\x3e";b="";for(h=0;3>h&&(3!=m||1!=h);h++){q=t+3*m+h;k=d.getFullYear()===L.getFullYear();n="oj-dp-"+this.uuid+"-"+m+"-"+h+"-0-0";(l=q===this.Wh)?(u=n,p=" "+this.Vx):p="";var F=d.getFullYear()===L.getFullYear(),R=v.format(e.dateToLocalIso(new Date(q,r,1)));q=q<s.startYear||q>s.endYear;b+="\x3ctd role\x3d'gridcell' aria-disabled\x3d'"+
!!q+"' aria-selected\x3d'"+k+"' id\x3d'"+n+"' class\x3d'"+p+(q||S?" "+this.UH+" oj-disabled":" oj-enabled ")+(k?" "+this.PP:"")+"'"+(q?"":" data-handler\x3d'selectYear' data-event\x3d'click' data-month\x3d'"+d.getMonth()+"' data-year\x3d'"+d.getFullYear()+"'")+"\x3e"+(q||S?"\x3cspan class\x3d'oj-disabled'\x3e"+R+"\x3c/span\x3e":"\x3ca role\x3d'button' class\x3d'oj-enabled"+(F?" oj-selected":"")+"' "+(l?"":"tabindex\x3d'-1' ")+" href\x3d'#'\x3e"+R+"\x3c/a\x3e")+"\x3c/td\x3e";d.setFullYear(d.getFullYear()+
1)}c+=b+"\x3c/tr\x3e"}g+=c+"\x3c/tbody\x3e\x3c/table\x3e";return{html:g+f,vM:u}},ewa:function(a,b,c){var d,e,f,g;d=this.options.datePicker.yearRange.split(":");e=(new Date).getFullYear();f=function(b){b=b.match(/c[+\-].*/)?a+parseInt(b.substring(1),10):b.match(/[+\-].*/)?e+parseInt(b,10):parseInt(b,10);return isNaN(b)?e:b};g=f(d[0]);d=Math.max(g,f(d[1]||""));g=b?Math.max(g,b.fullYear):g;d=c?Math.min(d,c.fullYear):d;return{startYear:g,endYear:d}},IJ:function(){var a=this.options.datePicker.numberOfMonths,
a="string"===typeof a?parseInt(a,10):a;return null==a?[1,1]:"number"===typeof a?[1,a]:a},gn:function(a,b){return 32-(new Date(a,b,32)).getDate()},Vua:function(a,b){return(new Date(a,b,1)).getDay()},b5:function(a,b,c){var d=this.IJ();b=new Date(b,c+(0>a?a:d[0]*d[1]),1);0>a&&b.setDate(this.gn(b.getFullYear(),b.getMonth()));return this.vK(b)},c5:function(a,b){var c;0>a?(c=new Date(b+a,12,1),c.setDate(this.gn(c.getFullYear(),c.getMonth()))):c=new Date(b+a,1,1);return this.vK(c)},a5:function(a,b){var c;
c=10*Math.floor(b/10);0>a?(c=new Date(c+9+10*a,12,1),c.setDate(this.gn(c.getFullYear(),c.getMonth()))):c=new Date(c+10*a,1,1);return this.vK(c)},bBa:function(a,b,c){b=b?new Date(b.fullYear,b.month,b.date):null;c=c?new Date(c.fullYear,c.month,c.date):null;return null!==b&&a<b||null!==c&&a>c},vK:function(b){var c,d,e=a.Na,f=this.oc(),g,h,k=this.Ho("min"),n=null,l=this.Ho("max"),u=null;if(c=this.options.datePicker.yearRange)c=c.split(":"),d=(new Date).getFullYear(),n=parseInt(c[0],10),u=parseInt(c[1],
10),c[0].match(/[+\-].*/)&&(n+=d),c[1].match(/[+\-].*/)&&(u+=d);k&&(k=f.parse(k),g=e._dateTime(k,["fullYear","month","date"],!0),g=new Date(g.fullYear,g.month,g.date));l&&(l=f.parse(l),e=e._dateTime(l,["fullYear","month","date"],!0),h=new Date(e.fullYear,e.month,e.date));return(!g||b.getTime()>=g.getTime())&&(!h||b.getTime()<=h.getTime())&&(!n||b.getFullYear()>=n)&&(!u||b.getFullYear()<=u)},gT:function(){return this.Dj(this.F("tooltipCalendar"+(this.options.disabled?"Disabled":"")))},y6:function(a){this.xf&&
(f(this.xf.children(),a),this.xf.find("."+this.TQ).attr("title",this.gT()));a&&this._hide(this.Eg);this.bf&&this.li()},IP:function(){this.bf||this._superApply(arguments)},LV:function(a){this.bf||this._superApply(arguments)},OK:function(a){if(!this.bf){this._superApply(arguments);var b=g.ui.keyCode,c=!1;if(this.Ok())switch(a.keyCode){case b.TAB:this._hide(this.AH);break;case b.ESCAPE:this._hide(this.ds);c=!0;break;case b.UP:case b.DOWN:this.Qc.find(".oj-datepicker-calendar").focus(),c=!0}else switch(a.keyCode){case b.UP:case b.DOWN:this.wc(this.Si(),
a),this.show(),c=!0}if(c)return a.preventDefault(),a.stopPropagation(),!1}},Hl:function(a){this.bf||this._superApply(arguments);this.pL(this.en());this.Ok()&&this.li(!(this.bf&&this.wf&&this.wf[0]===document.activeElement))},oc:function(){return this.options.converter?this._superApply(arguments):g.oj.ojInputDate.prototype.options.converter},Zx:function(){return this.options.value||""},_GetDefaultStyleClass:function(){return"oj-inputdate"},WB:function(){var b=this._superApply(arguments);if(null!=this.options.min||
null!=this.options.max)this.RC[a.Ve.VALIDATOR_TYPE_DATETIMERANGE]=this.ZJ("min");null!=this.options.dayFormatter&&(this.RC[a.Ve.VALIDATOR_TYPE_DATERESTRICTION]=this.ZJ("dayFormatter"));return g.extend(this.RC,b)},Gj:function(){this._hide(this.Eg);this._superApply(arguments)},Vm:function(){this._hide(this.Eg);this._superApply(arguments)},ZJ:function(b){var c=null;"min"===b||"max"===b?c=e(this.options,this.oc()):"dayFormatter"===b&&(b={dayFormatter:this.options.dayFormatter,converter:this.oc()},g.extend(b,
this.options.translations.dateRestriction||{}),c=a.za.sx(a.Ve.VALIDATOR_TYPE_DATERESTRICTION).createValidator(b));return c},Xva:function(){var a=new Date;a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},en:function(){return this.options.value||this.L7()},getNodeBySubId:function(a){var b=null,c=a&&a.subId,d=this.Qc;if(c)switch(c){case "oj-datepicker-content":b=d[0];break;case "oj-inputdatetime-calendar-icon":b=g(".oj-inputdatetime-calendar-icon",this.xf)[0];break;case "oj-datepicker-prev-icon":b=
g(".oj-datepicker-prev-icon",d)[0];break;case "oj-datepicker-next-icon":b=g(".oj-datepicker-next-icon",d)[0];break;case "oj-datepicker-month":b=g(".oj-datepicker-month",d)[0];break;case "oj-datepicker-year":b=g(".oj-datepicker-year",d)[0];break;case "oj-datepicker-current":b=g(".oj-datepicker-current",d)[0];break;case "oj-inputdatetime-date-input":b=this.bf?null:this.element[0];break;default:b=null}return b||this._superApply(arguments)},getSubIdByNode:function(a){var b=this.Qc,c=null,d=[{selector:".oj-inputdatetime-calendar-icon",
ele:this.xf},{selector:".oj-datepicker-prev-icon",ele:b},{selector:".oj-datepicker-next-icon",ele:b},{selector:".oj-datepicker-month",ele:b},{selector:".oj-datepicker-year",ele:b},{selector:".oj-datepicker-current",ele:b}];if(a===b[0])return"oj-datepicker-content";if(!this.bf&&a===this.element[0])return"oj-inputdatetime-date-input";for(var b=0,e=d.length;b<e;b++){var f=d[b],h=g(f.selector,f.ele);if(1===h.length&&h[0]===a){c=f.selector.substr(1);break}}return c||this._superApply(arguments)},hide:function(){return this._hide(this.Eg)},
_hide:function(a){m(this)||!this.Ok()||this.bf||(this.SK.ojPopup("close"),this.Vo(a));return this},Vo:function(){this.PD&&"focus"===this.options.datePicker.showOn?this.Sl.focus():("focus"===this.options.datePicker.showOn&&(this.qn=!0),this.element.focus())},refresh:function(){this.xf&&this.xf.find("."+this.TQ).attr("title",this.gT());return this._superApply(arguments)||this},show:function(){if(!(this.Ok()||this.options.disabled||this.options.readOnly))if(this.qn)this.qn=!1;else{if(m(this)){this.element.blur();
var a={};a.date=c(this.v8(),this.en());a.mode="date";return this.m3(a)}return this.AEa()}},v8:function(){if(null===this.LK){var b=this.oc().resolvedOptions(),c={};g.extend(c,b,{isoStrFormat:"offset"});this.LK=a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter(c)}return this.LK},m3:function(b){var d=this.Ho("min"),e=this.Ho("max"),f=this.v8();d&&(b.minDate=c(f,d).valueOf());e&&(b.maxDate=c(f,d).valueOf());var h=this;h.Uo=!0;window.datePicker.show(b,g.proxy(this.U2,this),function(b){h.Uo=!1;b.startsWith("cancel")?
h.Vo(h.ds):a.t.log("Error: native date or time picker failed: "+b)})},U2:function(b){this.Uo=!1;b&&(b=a.Na._dateTime(this.en(),{month:b.getMonth(),date:b.getDate(),fullYear:b.getFullYear()}),b=this.oc().format(b),this.wc(b,{}));this.Vo(this.fs)},AEa:function(){var b=this.Pg;this.Qc.empty();this.li();b=a.Ed.ml({my:"start top",at:"start bottom",of:this.element,collision:"flipfit flipfit"},b);this.SK.ojPopup("open",this.element.parent(),b);return this}});a.Components.Wn({ojInputDate:{firstDayOfWeek:a.Components.Ne(function(){return a.$a.uF()}),
dayWide:a.Components.Ne(function(){return a.$a.rF("wide")}),dayNarrow:a.Components.Ne(function(){return a.$a.rF("narrow")}),monthWide:a.Components.Ne(function(){return a.$a.wF("wide")}),monthAbbreviated:a.Components.Ne(function(){return a.$a.wF("abbreviated")}),datePicker:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||{}).datePicker}),renderMode:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||{}).renderMode}),keyboardEdit:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||
{}).keyboardEdit})}});a.Ra("oj.ojInputTime",g.oj.inputBase,{version:"1.0.0",widgetEventPrefix:"oj",_CLASS_NAMES:"oj-inputdatetime-input",_WIDGET_CLASS_NAMES:"oj-inputdatetime-time-only oj-component oj-inputdatetime",aQ:"oj-inputdatetime-input-container",_ELEMENT_TRIGGER_WRAPPER_CLASS_NAMES:"",_INPUT_HELPER_KEY:"inputHelp",_ATTR_CHECK:[{attr:"type",setMandatory:"text"}],_GET_INIT_OPTIONS_PROPS:[{ha:"disabled",Sd:!0},{ha:"pattern"},{ha:"title"},{ha:"placeholder"},{ha:"value",wh:d},{ha:"required",wh:!0,
Sd:!0},{ha:"readonly",option:"readOnly",Sd:!0},{ha:"min",wh:d},{ha:"max",wh:d}],B3:"ojInputTime",UQ:"oj-inputdatetime-input-trigger",VQ:"oj-inputdatetime-time-icon",fs:"selection",ds:"cancelled",AH:"tab",Eg:"close",lna:"enabled",eQ:"disabled",options:{converter:a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter({hour:"2-digit",hour12:!0,minute:"2-digit"}),keyboardEdit:"enabled",max:void 0,min:void 0,datePickerComp:null,pickerAttributes:null,renderMode:"jet",timePicker:{footerLayout:"",timeIncrement:"00:30:00:00",
showOn:"focus"}},Yf:function(b,c){this._super(b,c);null===this.options.datePickerComp&&a.Fe.Cp(this._GET_INIT_OPTIONS_PROPS,c,this)},So:function(){return a.fa.temporarilyEnableWheelStyleTimePickerForJet22},sH:function(){this.fX={};this.Xh=this.options.datePickerComp;this.Sl=null;this.Uo=this.qn=this.PD=this.ew=!1;this.FL=null;var b=this.options.pickerAttributes,c=this;this.So()?(this.Zk=g("\x3cdiv id\x3d'"+this.Rm(this.B3)+"' class\x3d'oj-timepicker-content' style\x3d'display:none'\x3e\x3c/div\x3e"),
g("body").append(this.Zk),this.UK=this.Zk.ojPopup({initialFocus:"none",rootAttributes:{"class":"oj-timepicker-popup"},chrome:"default",modality:"modeless",open:function(){},beforeClose:function(){}}),b&&a.Fe.nO(this.UK.ojPopup("widget"),b)):(this.ef=g("\x3cdiv id\x3d'"+this.Rm(this.B3)+"' class\x3d'oj-listbox-drop' style\x3d'display:none'\x3e\x3c/div\x3e"),g("body").append(this.ef),this.TK=this.ef.ojPopup({initialFocus:"none",rootAttributes:{"class":"datetimepicker-dropdown"},chrome:"none",modality:"modeless",
open:function(){var a=g("[aria-selected]",c.ef);1===a.length&&c.SR(a.parent(),!0);"image"!==c.options.timePicker.showOn&&c.Tk()||g("ul",c.ef).focus()},beforeClose:function(){c.kea=g("ul",c.ef).scrollTop()}}),b&&a.Fe.nO(this.TK.ojPopup("widget"),b));this.Tk()&&(this._ELEMENT_TRIGGER_WRAPPER_CLASS_NAMES+=this.aQ)},nt:function(){return(this.So()?this.UK.ojPopup("isOpen"):this.TK.ojPopup("isOpen"))||this.Uo},_ComponentCreate:function(){this.sH();var a=this._superApply(arguments);if(this.Uj()&&!this.J$())this._CLASS_NAMES=
"";else{if(this.options.value){var b=this.oc().format(this.options.value);this.wc(b,{})}l(this)}this.dw();this.kR();return a},Nh:function(){var a=this._superApply(arguments);f(this.xf.children(),this.options.disabled);return a},_setOption:function(b,c,d){var g=null,h;if("value"===b)return c||(c=null),g=this._super(b,c,d),this.So()?this.FI():this.iJ(),g;"timePicker"===b&&this.So()&&void 0===c.footerLayout&&(h=this.options.timePicker.footerLayout);g=this._superApply(arguments);h&&(this.options.timePicker.footerLayout=
h);"disabled"===b?(c&&this._hide(this.Eg),this.xf.find("."+this.VQ).attr("title",this.bU()),f(this.xf.children(),c)):"max"!==b&&"min"!==b||this.Uj()?"readOnly"===b?(this.dw(),c&&this._hide(this.Eg)):"keyboardEdit"===b?this.dw():"converter"===b&&(this.FL=null):(this.fX[a.Ve.VALIDATOR_TYPE_DATETIMERANGE]=e(this.options,this.oc()),this.Px());b in{max:!0,min:!0,converter:!0,timePicker:!0}&&(this.So()?this.FI():this.iJ());return g},_destroy:function(){var a=this._super();this.Tk()&&(this.element.off("focus touchstart"),
this.bk.off("touchstart"));this.xf&&this.xf.remove();this.ef&&this.ef.remove();this.Zk&&this.Zk.remove();return a},dw:function(){this.element.prop("readOnly",!(!this.options.readOnly&&!this.hV()))},hV:function(){return this.options.keyboardEdit===this.eQ},IP:function(){this.Tk()&&this._superApply(arguments)},OK:function(a){if(this.Tk()){this._superApply(arguments);var b=g.ui.keyCode,c=!1;if(this.nt())switch(a.keyCode){case b.TAB:this._hide(this.AH);break;case b.ESCAPE:this._hide(this.ds);c=!0;break;
case b.UP:case b.DOWN:this.So()?this.Zk.focus():g("ul",this.ef).focus(),c=!0}else switch(a.keyCode){case b.UP:case b.DOWN:this.wc(this.Si(),a),this.show(),c=!0}if(c||a.keyCode===b.ENTER)return a.preventDefault(),a.stopPropagation(),!1}},bU:function(){return this.Dj(this.F("tooltipTime"+(this.options.disabled?"Disabled":"")))},ZQ:function(){this.Sl=this._superApply(arguments);this.Sl.attr({role:"combobox","aria-haspopup":"true",tabindex:"-1"})},MV:function(){var a=this.options.timePicker.showOn;this.ew?
(this.ew=!1,this.Sl.focus()):"focus"===a?this.show():this.nt()&&this._hide(this.Eg)},EH:function(){if("focus"===this.options.timePicker.showOn)if(this.nt())this.qn=!0,this._hide(this.Eg);else{var a=this.element[0]===document.activeElement;this.show();this.ew=!0;a&&this.Sl.focus()}},kR:function(){var a=this.options.timePicker.showOn,b=this.Tk(),c=b?g("\x3cspan\x3e").addClass(this.UQ):g("+ span",this.element),d=g("\x3cspan title\x3d'"+this.bU()+"'/\x3e").addClass(this.VQ+" oj-clickable-icon-nocontext oj-component-icon"),
e=this;b&&(this.element.on("focus",g.proxy(this.MV,this)),this.element.on("touchstart",g.proxy(this.EH,this)));(this.Tk()?this.bk:this.Xh.widget.bk).on("touchstart",function(){e.PD=!0});"image"===a&&(d.css("display","block"),this.Pg?(this.element.css("border-top-left-radius",0),this.element.css("border-bottom-left-radius",0)):(this.element.css("border-top-right-radius",0),this.element.css("border-bottom-right-radius",0)));if(b||!m(this))c.append(d),d.on("click",function(){e.nt()?e._hide(e.Eg):(e.show(),
g("ul",e.ef).focus())}),this.We(d),this.Gk(d);this.xf=c;b&&this.element.after(c)},QAa:function(a,b,c){var d=this.oc();return b&&0>d.we(a,b)||c&&0<d.we(a,c)},Zh:function(){return this.Uj()?this.Xh.widget.dha():this.options.value},iJ:function(){var b=this.Zh(),c,d=this.oc(),e=g("\x3cul class\x3d'oj-listbox-results' tabindex\x3d'-1' role\x3d'listbox'\x3e\x3c/ul\x3e"),f=b?d.format(b):"";c=[];b?this.Uj()||(b=d.parse(f)):(c=new Date,c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0),b=a.Na.dateToLocalIso(c));
c=this.Wva(b);f=f||c[0].value;this.ef.empty();b=0;for(d=c.length;b<d;b++){var h=c[b].value,k=c[b].minMaxRange,n=g("\x3cli class\x3d'oj-listbox-result "+(k?"oj-disabled":"")+"' role\x3d'presentation'\x3e"),l=this.uuid+"_sel"+b,k=g("\x3cdiv class\x3d'oj-listbox-result-label' "+(k?"aria-disabled ":"")+"data-value\x3d'"+h+"' role\x3d'option' id\x3d'"+l+"'\x3e"+c[b].label+"\x3c/li\x3e");f===h&&(k.attr("aria-selected","true"),n.addClass("oj-hover"),e.attr("aria-activedescendant",l));n.append(k);e.append(n)}this.ef.append(e);
g(".oj-listbox-result",e).on("mousemove",function(){var a=g(this);a.hasClass("oj-disabled")||(g(".oj-hover",e).removeClass("oj-hover"),a.addClass("oj-hover"),e.attr("aria-activedescendant",a.children()[0].id))});var u=this;e.on("click",function(a){var b=g(a.target);b.hasClass("oj-disabled")||void 0!==b.attr("aria-disabled")||u.xba(a)}).on("keydown",function(a){u.dFa(a)});g("ul",this.ef).one("focus",function(){var a=g("[aria-selected]",u.ef);1===a.length&&u.SR(g(a))})},b9:function(){null===this.FL&&
(this.FL=t(this.oc(),{isoStrFormat:"offset"}));return this.FL},Wva:function(b){var c=[],d=this.oc(),e=a.Na,f="",f=this.Uj(),g=new Date,h=f?this.Xh.widget.options.min:this.options.min,k=f?this.Xh.widget.options.max:this.options.max,n=r(this.options.timePicker.timeIncrement),h=h?e._minMaxIsoString(h,this.Zh()):h,k=k?e._minMaxIsoString(k,this.Zh()):k;g.setDate(1);g.setHours(0);g.setMinutes(0);g.setSeconds(0);g.setMilliseconds(0);var l=new Date(g);l.setDate(2);b=this.b9().parse(b);b=e._clearTime(b);do f=
this.Dj(d.format(b)),c.push({label:f,value:f,minMaxRange:this.QAa(b,h,k)}),g.setHours(g.getHours()+n.hN),g.setMinutes(g.getMinutes()+n.WN),g.setSeconds(g.getSeconds()+n.qLa),g.setMilliseconds(g.getMilliseconds()+n.jKa),b=e._dateTime(b,{hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()});while(g.getDate()!==l.getDate());return c},dFa:function(a){if(this.nt()){var b=g.ui.keyCode,c=!1;switch(a.keyCode){case b.TAB:this._hide(this.AH);break;case b.ESCAPE:this._hide(this.ds);
c=!0;break;case b.UP:this.rba(a,"prev");c=!0;break;case b.DOWN:this.rba(a,"next");c=!0;break;case b.ENTER:this.xba(a),c=!0}if(c)return a.preventDefault(),a.stopPropagation(),!1}},rba:function(a,b){var c=g(".oj-hover",this.ef),d=g("ul",this.ef),e=null;1===c.length?(e=c[b](),1===e.length&&c.removeClass("oj-hover")):e=g(d.children()[0]);e&&1===e.length&&(e.addClass("oj-hover"),d.attr("aria-activedescendant",e.children()[0].id),this.SR(e))},xba:function(a){var b=this.ef,c=g("[aria-selected]",b),d=g("ul",
b),b=g(".oj-hover div",b);1===b.length&&(1===c.length&&(c.removeAttr("aria-selected"),c.parent().removeClass("oj-hover")),b.attr("aria-selected","true"),b.parent().addClass("oj-hover"),this._hide(this.fs),this.Hl(b.attr("data-value")),this.wc(b.attr("data-value"),a),d.attr("aria-activedescendant",b[0].id),this.Uj()&&this.Xh.widget._hide(this.fs))},LV:function(a){this.Tk()&&this._superApply(arguments)},show:function(){if(!(this.nt()||this.options.disabled||this.options.readOnly))if(this.qn)this.qn=
!1;else return m(this)?(this.element.blur(),this.EEa()):this.So()?this.JEa():this.BEa()},EEa:function(){var b={},d=this.b9(),e=c(d,this.Zh());b.date=e;b.mode="time";e=r(this.options.timePicker.timeIncrement);b.minuteInterval=0===e.hN?e.WN:1;var f=this.Uj()?this.Xh.widget.options.min:this.options.min,e=this.Uj()?this.Xh.widget.options.max:this.options.max;f&&(f=c(d,a.Na._minMaxIsoString(f,this.Zh())),b.minDate=f.valueOf());e&&(d=c(d,a.Na._minMaxIsoString(e,this.Zh())),b.maxDate=d.valueOf());var g=
this;this.Uo=!0;window.datePicker.show(b,function(b){g.Uo=!1;b&&(b=a.Na._dateTime(g.Zh(),{hours:b.getHours(),minutes:b.getMinutes(),seconds:b.getSeconds()}),b=g.oc().format(b),g.wc(b,{}));g.Vo(g.fs)},function(b){g.Uo=!1;b.startsWith("cancel")?g.Vo(g.ds):a.t.log("Error: native time picker failed: "+b)})},BEa:function(){this.Uj()&&this.Xh.widget._hide(this.Eg);this.iJ();var b=this.ef,c=this.TK;b.width(this.element.parent().width());b.css({position:"relative"});var d=a.Ed.ml({my:"start top",at:"start bottom",
of:this.element,collision:"flipfit flipfit"},this.Pg);c.ojPopup("open",this.element.parent(),d);b.find("[aria-selected]").parent().addClass("oj-hover")},hide:function(){return this._hide(this.Eg)},_hide:function(a){!m(this)&&this.nt()&&(this.So()?this.UK.ojPopup("close"):this.TK.ojPopup("close"),this.Vo(a));return this},Vo:function(){this.PD&&"focus"===this.options.timePicker.showOn?(this.Tk()?this.Sl:this.Xh.widget.Sl).focus():("focus"===this.options.timePicker.showOn&&(this.Tk()?this.qn=!0:this.Xh.widget.qn=
!0),this.element.focus())},refresh:function(){this.xf&&this.xf.find("."+this.VQ).attr("title",this.bU());return this._superApply(arguments)||this},Hl:function(a){this.Tk()&&this._superApply(arguments);this.nt()&&(this.So()?this.FI():this.iJ())},wc:function(b,c,d){if(this.Uj()){this._super(b,null,d);try{var e=this.oc(),f=e.parse(b),g=a.Na,h=this.Xh.widget,k=h.dha()||g.dateToLocalIso(new Date);if(!f||0!==e.we(k,f)){var n=g._copyTimeOver(f||g.dateToLocalIso(new Date),k);h.VLa(n,c)}}catch(l){}}else this._superApply(arguments)},
UB:function(){return this.Tk()},Tk:function(){return!this.Uj()||this.J$()},_GetDefaultStyleClass:function(){return"oj-inputtime"},Zx:function(){return this.options.value||""},WB:function(){var b=this._superApply(arguments);null==this.options.min&&null==this.options.max||this.Uj()||(this.fX[a.Ve.VALIDATOR_TYPE_DATETIMERANGE]=e(this.options,this.oc()));return g.extend(this.fX,b)},oc:function(){return this.options.converter?this._superApply(arguments):g.oj.ojInputTime.prototype.options.converter},SR:function(a,
b){var c=a.parent();b&&this.kea&&g(c).scrollTop(this.kea);var d=g(c).scrollTop(),e=d+g(c).height(),f=a[0].offsetTop,h=f+g(a).height();f<d?g(c).scrollTop(f):h>e&&g(c).scrollTop(h-g(c).height())},Uj:function(){return null!==this.Xh},J$:function(){return this.Xh.inline},Gj:function(){this._hide(this.Eg);this._superApply(arguments)},Vm:function(){this._hide(this.Eg);this._superApply(arguments)},AMa:function(a){return a?g.contains((this.So()?this.Zk:this.ef)[0],a):!1},dD:function(){var a=this.Dj(this.F("cancelText")),
a="\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-enabled oj-default oj-timepicker-cancel-button' title\x3d'"+a+"'\x3e"+a+"\x3c/a\x3e",b=this.Dj(this.F("okText")),c="\x3cdiv class\x3d'oj-timepicker-header"+(this.options.disabled?" oj-disabled ":" oj-enabled oj-default ")+"'\x3e",c=c+a+("\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-enabled oj-default oj-timepicker-ok-button' title\x3d'"+b+"'\x3e"+b+"\x3c/a\x3e");return c+="\x3c/div\x3e"},cD:function(a,b){var c="",d="\x3ca role\x3d'button' href\x3d'#' class\x3d'oj-timepicker-now oj-priority-secondary oj-enabled'\x3e"+
this.Dj(this.F("currentTimeText"))+"\x3c/a\x3e";if(a&&1<a.length){var e=0,d=[{index:a.indexOf("now"),content:b?d:""}];for(d.sort(function(a,b){return a.index-b.index});e<d.length&&0>d[e].index;)e++;for(;e<d.length;)c+=d[e++].content;0<c.length&&(c="\x3cdiv class\x3d'oj-timepicker-footer'\x3e"+c+"\x3c/div\x3e")}return c},e8:function(b,c,d){b=(c=(c=(c=this.Uj()?this.Xh.widget.options[c]:this.options[c])?a.Na._minMaxIsoString(c,this.Zh()):c)?b.parse(c):c)?a.Na._clearTime(c):null;d&&b&&d.substring(0,
d.indexOf("T"))!==b.substring(0,b.indexOf("T"))&&(c=null);return c},eva:function(b){var c=this.Zh();c||(c=new Date,c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0),c=a.Na.dateToLocalIso(c));return c=b.parse(c)},kua:function(){var b=a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter({pattern:"a"});return[b.format("2016-01-01T01:00:00Z"),b.format("2016-01-01T13:00:00Z")]},FI:function(){var b=this.Zk;b.empty();var c=this.oc(),d=c.resolvedOptions();"zulu"===d.yZ&&(d.yZ="offset",c=
a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter(d),d=c.resolvedOptions());var e=a.Na,f=this.Zh(),h=new Date;f||(f=a.Na.dateToLocalIso(h));var f=c.parse(f),f=e._clearTime(f),e=this.e8(c,"min",f),f=this.e8(c,"max",f),k=this.options.timePicker.footerLayout,l=this.lea=new p;(d=d.pattern||d.patternFromOptions)&&(l.format=d);l.ampmStrings=this.kua();if(d=this.options.timePicker.timeIncrement)d=r(d),l.increment=60*d.hN+d.WN;l.isoValue=this.eva(c);e&&(l.isoMin=e);f&&(l.isoMax=f);b.append(g(this.dD(b)));
this.Kea=g(n(l));b.append(this.Kea);b.append(g(this.cD(k,h)));b.find(".oj-timepicker-hour").attr("aria-label",this.F("hourWheelLabel"));b.find(".oj-timepicker-minute").attr("aria-label",this.F("minuteWheelLabel"));b.find(".oj-timepicker-meridian").attr("aria-label",this.F("ampmWheelLabel"));this.Zk.append(b)},JEa:function(){this.Uj()&&this.Xh.widget.hide();var b=this,c=this.UK;this.FI();this.Zk.find(".oj-timepicker-cancel-button").on("click",function(a){a.preventDefault();c.ojPopup("close");b.Vo(b.ds)});
this.Zk.find(".oj-timepicker-ok-button").on("click",function(a){b.wc(b.lea.isoValue,a);a.preventDefault();c.ojPopup("close");b.Vo(b.fs)});this.Zk.find(".oj-timepicker-now").on("click",function(c){var d=a.Na.dateToLocalIso(new Date),d=b.oc().parse(d);b.lea.isoValue=d;c.preventDefault()});var d=a.Ed.ml({my:"start top",at:"start bottom",of:this.element,collision:"flipfit flipfit"},this.Pg);c.ojPopup("open",this.element.parent(),d);this.Kea.children().first().focus()},getNodeBySubId:function(a){var b=
null,c=a&&a.subId,d=this.Zk;if(c)switch(c){case "oj-listbox-drop":b=this.ef?this.ef[0]:null;break;case "oj-inputdatetime-time-icon":b=g(".oj-inputdatetime-time-icon",this.xf)[0];break;case "oj-inputdatetime-time-input":b=this.element[0];break;case "oj-timepicker-content":b=d?d[0]:null;break;case "oj-timepicker-cancel-button":b=g(".oj-timepicker-cancel-button",d)[0];break;case "oj-timepicker-ok-button":b=g(".oj-timepicker-ok-button",d)[0];break;case "oj-timepicker-hour":b=g(".oj-timepicker-hour",d)[0];
break;case "oj-timepicker-minute":b=g(".oj-timepicker-minute",d)[0];break;case "oj-timepicker-meridian":b=g(".oj-timepicker-meridian",d)[0];break;case "oj-timepicker-now":b=g(".oj-timepicker-now",d)[0];break;default:b=null}return b||this._superApply(arguments)},getSubIdByNode:function(a){var b=g(".oj-inputdatetime-time-icon",this.xf),c=null,d=this.Zk,e=[{selector:".oj-timepicker-cancel-button",ele:d},{selector:".oj-timepicker-ok-button",ele:d},{selector:".oj-timepicker-hour",ele:d},{selector:".oj-timepicker-minute",
ele:d},{selector:".oj-timepicker-meridian",ele:d},{selector:".oj-timepicker-now",ele:d}];if(this.ef&&a===this.ef[0])c="oj-listbox-drop";else if(a===b[0])c="oj-inputdatetime-time-icon";else if(a===this.element[0])c="oj-inputdatetime-time-input";else if(d&&a===d[0])c="oj-timepicker-content";else for(b=0;b<e.length;b++){var d=e[b],f=g(d.selector,d.ele);if(1===f.length&&f[0]===a){c=d.selector.substr(1);break}}return c||this._superApply(arguments)},widget:function(){return this.Tk()?this._super():this.Xh.widget.widget()}});
a.Components.Wn({ojInputTime:{renderMode:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||{}).renderMode}),keyboardEdit:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||{}).keyboardEdit}),timePicker:a.Components.Ne(function(){return(a.Wc.De("oj-inputdatetime-option-defaults")||{}).timePicker})}});q.RGa=0;a.Ra("oj.ojInputDateTime",g.oj.ojInputDate,{version:"1.0.0",widgetEventPrefix:"oj",_WIDGET_CLASS_NAMES:"oj-inputdatetime-date-time oj-component oj-inputdatetime",
_INPUT_HELPER_KEY:"inputHelpBoth",options:{converter:a.za.dj(a.Hi.CONVERTER_TYPE_DATETIME).createConverter({day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",hour12:!0,minute:"2-digit"}),renderMode:"jet",timePicker:{timeIncrement:"00:30:00:00",showOn:"focus"}},sH:function(){this._super();this.Pz=this.element;this.VK=this.TE=this.wf=null},_ComponentCreate:function(){var a=this._super(),b=this.a9(this.oc());if(null===b)throw Error("Please use ojInputDate if you do not have time portion");
if(this.bf){var c=g("\x3cinput type\x3d'text'\x3e");c.insertAfter(this.element);this.Pz=c}for(var c="title placeholder disabled required readOnly keyboardEdit pickerAttributes".split(" "),d={},e=0,f=c.length;e<f;e++)d[c[e]]=this.options[c[e]];this.wf=this.Pz.ojInputTime(g.extend(d,{converter:b,displayOptions:{converterHint:"none",title:"none",messages:this.options.displayOptions.messages},value:this.options.value,timePicker:this.options.timePicker,datePickerComp:{widget:this,inline:this.bf}}));return a},
_setOption:function(a,b,c){var d=this._superApply(arguments);"value"===a&&(this.VK=this.options.value);this.wf&&(a in{disabled:!0,readOnly:!0,keyboardEdit:!0}?this.wf.ojInputTime("option",a,b):"timePicker"===a?this.wf.ojInputTime("option","timePicker.timeIncrement",b.timeIncrement):"converter"===a&&(this.TE=null,this.wf.ojInputTime("option",a,this.a9(this.oc()))));return d},_destroy:function(){var a=this._super();this.wf.ojInputTime("destroy");this.bf&&this.Pz.remove();return a},EH:function(){"focus"===
this.options.datePicker.showOn&&g(this.wf.ojInputTime("getNodeBySubId",{subId:"oj-listbox-drop"})).is(":visible")?(this.wf.ojInputTime("hide"),this.qn=!0,this.element.focus()):this._super()},a9:function(a){return null!==this.TE?this.TE:this.TE=t(a)},VLa:function(a,b){var c=this.oc().format(a);this.Hl(c);this.wc(c,b)},dha:function(){if(this.isValid())return this.options.value;if(this.VK)try{return this.oc().parse(this.VK)}catch(a){return this.options.value}else return null},wc:function(a,b,c){this._superApply(arguments);
this.VK=a},OK:function(a){var b=g.ui.keyCode,c=!1;switch(a.keyCode){case b.UP:case b.DOWN:a.shiftKey&&(this.wc(this.Si(),a),this.wf.ojInputTime("show"),c=!0)}return c?(a.preventDefault(),a.stopPropagation(),!1):this._superApply(arguments)},show:function(){m(this)||this.wf.ojInputTime("hide");return this._super()},m3:function(a){a.mode="datetime";var b=r(this.options.timePicker.timeIncrement);a.YNa=0===b.hN?b.WN:1;return this._super(a)},U2:function(b){this.Uo=!1;b&&(b=a.Na._dateTime(this.en(),{month:b.getMonth(),
date:b.getDate(),fullYear:b.getFullYear(),hours:b.getHours(),minutes:b.getMinutes(),seconds:b.getSeconds()}),b=this.oc().format(b),this.wc(b,{}));this.Vo(this.fs)},showTimePicker:function(){this.hide();return this.wf.ojInputTime("show")},hideTimePicker:function(){return this.wf.ojInputTime("hide")},refresh:function(){var a=this._superApply(arguments)||this;this.wf.ojInputTime("refresh");return a},getNodeBySubId:function(a){var b=a&&a.subId,c=null;b&&("oj-listbox-drop"===b||"oj-inputdatetime-time-icon"===
b?c=this.wf.ojInputTime("getNodeBySubId",a):"oj-inputdatetime-date-input"===b&&(c=this.bf?this.Pz[0]:this.element[0]));return c||this._superApply(arguments)},getSubIdByNode:function(a){var b=null;this.bf?a===this.Pz[0]&&(b="oj-inputdatetime-date-input"):a===this.element[0]&&(b="oj-inputdatetime-date-input");return b||this.wf.ojInputTime("getSubIdByNode",a)||this._superApply(arguments)},oc:function(){return this.options.converter?this._superApply(arguments):g.oj.ojInputDateTime.prototype.options.converter},
Gj:function(){this.wf&&this.hideTimePicker();this._superApply(arguments)},Vm:function(){this.wf&&this.hideTimePicker();this._superApply(arguments)},_GetMessagingLauncherElement:function(){return this.bf?this.Pz:this._super()},_GetDefaultStyleClass:function(){return"oj-inputdatetime"},oH:function(){return"oj-ojInputDate"}});a.Components.Xa("ojInputTime","inputBase",{properties:{converter:{},keyboardEdit:{type:"string"},max:{},min:{},pickerAttributes:{type:"Object"},placeholder:{},renderMode:{type:"string"},
timePicker:{type:"Object"},validators:{type:"Array"},value:{type:"string",writeback:!0}},methods:{getNodeBySubId:{},getSubIdByNode:{},hide:{},refresh:{},show:{},widget:{}},extension:{_hasWrapper:!0,_innerElement:"input",_widgetName:"ojInputTime"}});a.Components.register("oj-input-time",a.Components.getMetadata("ojInputTime"));(function(){a.Components.Xa("ojInputDate","inputBase",{properties:{converter:{},datePicker:{type:"Object"},dayFormatter:{},dayMetaData:{},keyboardEdit:{type:"string"},max:{},
min:{},pickerAttributes:{type:"Object"},placeholder:{},renderMode:{type:"string"},validators:{type:"Array"},value:{type:"string",writeback:!0}},methods:{getNodeBySubId:{},getSubIdByNode:{},hide:{},refresh:{},show:{}},extension:{_hasWrapper:!0,_innerElement:"input",_widgetName:"ojInputDate"}});a.Components.register("oj-input-date",a.Components.getMetadata("ojInputDate"));var b=a.Uc.yf({},a.Components.getMetadata("ojInputDate"),void 0,!0);b.extension._innerElement="div";a.Components.register("oj-date-picker",
b)})();(function(){a.Components.Xa("ojInputDateTime","ojInputDate",{properties:{converter:{},max:{},min:{},renderMode:{type:"string"},timePicker:{type:"Object"},validators:{type:"Array"},value:{type:"string",writeback:!0}},methods:{getNodeBySubId:{},getSubIdByNode:{},hideTimePicker:{},show:{},showTimePicker:{}},extension:{_hasWrapper:!0,_innerElement:"input",_widgetName:"ojInputDateTime"}});a.Components.register("oj-input-date-time",a.Components.getMetadata("ojInputDateTime"));var b=a.Uc.yf({},a.Components.getMetadata("ojInputDateTime"),
void 0,!0);b.extension._innerElement="div";a.Components.register("oj-date-time-picker",b)})()}); | 479.66443 | 586 | 0.691367 |
183f99d17f486b92d56fb126de43322ef75f2c7d | 673 | js | JavaScript | ACAP_linux/3rd/OpenMesh/Documentation/search/functions_10.js | shubhMaheshwari/Automatic-Unpaired-Shape-Deformation-Transfer | 8c9afe017769f9554706bcd267b6861c4c144999 | [
"MIT"
] | 216 | 2018-09-09T11:53:56.000Z | 2022-03-19T13:41:35.000Z | 3rd/OpenMesh/Documentation/search/functions_10.js | IGLICT/Sampling_code | 213bbd1366276d904937c527ec0c6f5137bf3ad6 | [
"MIT"
] | 13 | 2018-10-23T08:29:09.000Z | 2021-09-08T06:45:34.000Z | ACAP_linux/3rd/OpenMesh/Documentation/search/functions_10.js | shubhMaheshwari/Automatic-Unpaired-Shape-Deformation-Transfer | 8c9afe017769f9554706bcd267b6861c4c144999 | [
"MIT"
] | 41 | 2018-09-13T08:50:41.000Z | 2022-02-23T00:33:54.000Z | var searchData=
[
['qt_5fread_5ffilters',['qt_read_filters',['../a01942.html#a5a5b7314f7fcd4ac01374c2482e30661',1,'OpenMesh::IO::_IOManager_']]],
['qt_5fwrite_5ffilters',['qt_write_filters',['../a01942.html#a39f74c9e6c8e32ab44432bc0abc6676f',1,'OpenMesh::IO::_IOManager_']]],
['quadrict',['QuadricT',['../a01902.html#aa4dd04f39435110361e4088cc376618a',1,'OpenMesh::Geometry::QuadricT::QuadricT(Scalar _a, Scalar _b, Scalar _c, Scalar _d, Scalar _e, Scalar _f, Scalar _g, Scalar _h, Scalar _i, Scalar _j)'],['../a01902.html#ae6a410e0bd234af03477f8466d0b45d3',1,'OpenMesh::Geometry::QuadricT::QuadricT(Scalar _a=0.0, Scalar _b=0.0, Scalar _c=0.0, Scalar _d=0.0)']]]
];
| 96.142857 | 389 | 0.744428 |
1840c954c01ced408acc51c7fefed2e4c6f6ba3b | 373 | js | JavaScript | src/routes.js | Grobim/formation-angular-extia-101-project | 10842f9cd49c09e219eebb7ca2d6164b0de8f1b9 | [
"MIT"
] | null | null | null | src/routes.js | Grobim/formation-angular-extia-101-project | 10842f9cd49c09e219eebb7ca2d6164b0de8f1b9 | [
"MIT"
] | null | null | null | src/routes.js | Grobim/formation-angular-extia-101-project | 10842f9cd49c09e219eebb7ca2d6164b0de8f1b9 | [
"MIT"
] | null | null | null | (function() {
angular
.module('app')
.config(routesConfig);
/** @ngInject */
function routesConfig($stateProvider, $urlRouterProvider, $locationProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
$urlRouterProvider.otherwise('/');
$stateProvider
.state('app', {
url: '/',
template: '<app></app>'
});
}
})();
| 20.722222 | 80 | 0.587131 |
1840ece0e7f969a0a3029488cff8432e173c59de | 22,108 | js | JavaScript | include/cjdns/contrib/http/text/javascript/d3/d3.geom.js | coyotama/fennec | bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb | [
"WTFPL"
] | 2 | 2016-02-04T05:43:18.000Z | 2016-09-12T05:44:19.000Z | include/cjdns/contrib/http/text/javascript/d3/d3.geom.js | coyotama/fennec | bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb | [
"WTFPL"
] | null | null | null | include/cjdns/contrib/http/text/javascript/d3/d3.geom.js | coyotama/fennec | bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb | [
"WTFPL"
] | null | null | null | // See d3.LICENSE.txt for license.
(function(){d3.geom = {};
/**
* Computes a contour for a given input grid function using the <a
* href="http://en.wikipedia.org/wiki/Marching_squares">marching
* squares</a> algorithm. Returns the contour polygon as an array of points.
*
* @param grid a two-input function(x, y) that returns true for values
* inside the contour and false for values outside the contour.
* @param start an optional starting point [x, y] on the grid.
* @returns polygon [[x1, y1], [x2, y2], …]
*/
d3.geom.contour = function(grid, start) {
var s = start || d3_geom_contourStart(grid), // starting point
c = [], // contour polygon
x = s[0], // current x position
y = s[1], // current y position
dx = 0, // next x direction
dy = 0, // next y direction
pdx = NaN, // previous x direction
pdy = NaN, // previous y direction
i = 0;
do {
// determine marching squares index
i = 0;
if (grid(x-1, y-1)) i += 1;
if (grid(x, y-1)) i += 2;
if (grid(x-1, y )) i += 4;
if (grid(x, y )) i += 8;
// determine next direction
if (i === 6) {
dx = pdy === -1 ? -1 : 1;
dy = 0;
} else if (i === 9) {
dx = 0;
dy = pdx === 1 ? -1 : 1;
} else {
dx = d3_geom_contourDx[i];
dy = d3_geom_contourDy[i];
}
// update contour polygon
if (dx != pdx && dy != pdy) {
c.push([x, y]);
pdx = dx;
pdy = dy;
}
x += dx;
y += dy;
} while (s[0] != x || s[1] != y);
return c;
};
// lookup tables for marching directions
var d3_geom_contourDx = [1, 0, 1, 1,-1, 0,-1, 1,0, 0,0,0,-1, 0,-1,NaN],
d3_geom_contourDy = [0,-1, 0, 0, 0,-1, 0, 0,1,-1,1,1, 0,-1, 0,NaN];
function d3_geom_contourStart(grid) {
var x = 0,
y = 0;
// search for a starting point; begin at origin
// and proceed along outward-expanding diagonals
while (true) {
if (grid(x,y)) {
return [x,y];
}
if (x === 0) {
x = y + 1;
y = 0;
} else {
x = x - 1;
y = y + 1;
}
}
}
/**
* Computes the 2D convex hull of a set of points using Graham's scanning
* algorithm. The algorithm has been implemented as described in Cormen,
* Leiserson, and Rivest's Introduction to Algorithms. The running time of
* this algorithm is O(n log n), where n is the number of input points.
*
* @param vertices [[x1, y1], [x2, y2], …]
* @returns polygon [[x1, y1], [x2, y2], …]
*/
d3.geom.hull = function(vertices) {
if (vertices.length < 3) return [];
var len = vertices.length,
plen = len - 1,
points = [],
stack = [],
i, j, h = 0, x1, y1, x2, y2, u, v, a, sp;
// find the starting ref point: leftmost point with the minimum y coord
for (i=1; i<len; ++i) {
if (vertices[i][1] < vertices[h][1]) {
h = i;
} else if (vertices[i][1] == vertices[h][1]) {
h = (vertices[i][0] < vertices[h][0] ? i : h);
}
}
// calculate polar angles from ref point and sort
for (i=0; i<len; ++i) {
if (i === h) continue;
y1 = vertices[i][1] - vertices[h][1];
x1 = vertices[i][0] - vertices[h][0];
points.push({angle: Math.atan2(y1, x1), index: i});
}
points.sort(function(a, b) { return a.angle - b.angle; });
// toss out duplicate angles
a = points[0].angle;
v = points[0].index;
u = 0;
for (i=1; i<plen; ++i) {
j = points[i].index;
if (a == points[i].angle) {
// keep angle for point most distant from the reference
x1 = vertices[v][0] - vertices[h][0];
y1 = vertices[v][1] - vertices[h][1];
x2 = vertices[j][0] - vertices[h][0];
y2 = vertices[j][1] - vertices[h][1];
if ((x1*x1 + y1*y1) >= (x2*x2 + y2*y2)) {
points[i].index = -1;
} else {
points[u].index = -1;
a = points[i].angle;
u = i;
v = j;
}
} else {
a = points[i].angle;
u = i;
v = j;
}
}
// initialize the stack
stack.push(h);
for (i=0, j=0; i<2; ++j) {
if (points[j].index !== -1) {
stack.push(points[j].index);
i++;
}
}
sp = stack.length;
// do graham's scan
for (; j<plen; ++j) {
if (points[j].index === -1) continue; // skip tossed out points
while (!d3_geom_hullCCW(stack[sp-2], stack[sp-1], points[j].index, vertices)) {
--sp;
}
stack[sp++] = points[j].index;
}
// construct the hull
var poly = [];
for (i=0; i<sp; ++i) {
poly.push(vertices[stack[i]]);
}
return poly;
}
// are three points in counter-clockwise order?
function d3_geom_hullCCW(i1, i2, i3, v) {
var t, a, b, c, d, e, f;
t = v[i1]; a = t[0]; b = t[1];
t = v[i2]; c = t[0]; d = t[1];
t = v[i3]; e = t[0]; f = t[1];
return ((f-b)*(c-a) - (d-b)*(e-a)) > 0;
}
// Note: requires coordinates to be counterclockwise and convex!
d3.geom.polygon = function(coordinates) {
coordinates.area = function() {
var i = 0,
n = coordinates.length,
a = coordinates[n - 1][0] * coordinates[0][1],
b = coordinates[n - 1][1] * coordinates[0][0];
while (++i < n) {
a += coordinates[i - 1][0] * coordinates[i][1];
b += coordinates[i - 1][1] * coordinates[i][0];
}
return (b - a) * .5;
};
coordinates.centroid = function(k) {
var i = -1,
n = coordinates.length,
x = 0,
y = 0,
a,
b = coordinates[n - 1],
c;
if (!arguments.length) k = -1 / (6 * coordinates.area());
while (++i < n) {
a = b;
b = coordinates[i];
c = a[0] * b[1] - b[0] * a[1];
x += (a[0] + b[0]) * c;
y += (a[1] + b[1]) * c;
}
return [x * k, y * k];
};
// The Sutherland-Hodgman clipping algorithm.
coordinates.clip = function(subject) {
var input,
i = -1,
n = coordinates.length,
j,
m,
a = coordinates[n - 1],
b,
c,
d;
while (++i < n) {
input = subject.slice();
subject.length = 0;
b = coordinates[i];
c = input[(m = input.length) - 1];
j = -1;
while (++j < m) {
d = input[j];
if (d3_geom_polygonInside(d, a, b)) {
if (!d3_geom_polygonInside(c, a, b)) {
subject.push(d3_geom_polygonIntersect(c, d, a, b));
}
subject.push(d);
} else if (d3_geom_polygonInside(c, a, b)) {
subject.push(d3_geom_polygonIntersect(c, d, a, b));
}
c = d;
}
a = b;
}
return subject;
};
return coordinates;
};
function d3_geom_polygonInside(p, a, b) {
return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
}
// Intersect two infinite lines cd and ab.
function d3_geom_polygonIntersect(c, d, a, b) {
var x1 = c[0], x2 = d[0], x3 = a[0], x4 = b[0],
y1 = c[1], y2 = d[1], y3 = a[1], y4 = b[1],
x13 = x1 - x3,
x21 = x2 - x1,
x43 = x4 - x3,
y13 = y1 - y3,
y21 = y2 - y1,
y43 = y4 - y3,
ua = (x43 * y13 - y43 * x13) / (y43 * x21 - x43 * y21);
return [x1 + ua * x21, y1 + ua * y21];
}
// Adapted from Nicolas Garcia Belmonte's JIT implementation:
// http://blog.thejit.org/2010/02/12/voronoi-tessellation/
// http://blog.thejit.org/assets/voronoijs/voronoi.js
// See lib/jit/LICENSE for details.
// Notes:
//
// This implementation does not clip the returned polygons, so if you want to
// clip them to a particular shape you will need to do that either in SVG or by
// post-processing with d3.geom.polygon's clip method.
//
// If any vertices are coincident or have NaN positions, the behavior of this
// method is undefined. Most likely invalid polygons will be returned. You
// should filter invalid points, and consolidate coincident points, before
// computing the tessellation.
/**
* @param vertices [[x1, y1], [x2, y2], …]
* @returns polygons [[[x1, y1], [x2, y2], …], …]
*/
d3.geom.voronoi = function(vertices) {
var polygons = vertices.map(function() { return []; });
d3_voronoi_tessellate(vertices, function(e) {
var s1,
s2,
x1,
x2,
y1,
y2;
if (e.a === 1 && e.b >= 0) {
s1 = e.ep.r;
s2 = e.ep.l;
} else {
s1 = e.ep.l;
s2 = e.ep.r;
}
if (e.a === 1) {
y1 = s1 ? s1.y : -1e6;
x1 = e.c - e.b * y1;
y2 = s2 ? s2.y : 1e6;
x2 = e.c - e.b * y2;
} else {
x1 = s1 ? s1.x : -1e6;
y1 = e.c - e.a * x1;
x2 = s2 ? s2.x : 1e6;
y2 = e.c - e.a * x2;
}
var v1 = [x1, y1],
v2 = [x2, y2];
polygons[e.region.l.index].push(v1, v2);
polygons[e.region.r.index].push(v1, v2);
});
// Reconnect the polygon segments into counterclockwise loops.
return polygons.map(function(polygon, i) {
var cx = vertices[i][0],
cy = vertices[i][1];
polygon.forEach(function(v) {
v.angle = Math.atan2(v[0] - cx, v[1] - cy);
});
return polygon.sort(function(a, b) {
return a.angle - b.angle;
}).filter(function(d, i) {
return !i || (d.angle - polygon[i - 1].angle > 1e-10);
});
});
};
var d3_voronoi_opposite = {"l": "r", "r": "l"};
function d3_voronoi_tessellate(vertices, callback) {
var Sites = {
list: vertices
.map(function(v, i) {
return {
index: i,
x: v[0],
y: v[1]
};
})
.sort(function(a, b) {
return a.y < b.y ? -1
: a.y > b.y ? 1
: a.x < b.x ? -1
: a.x > b.x ? 1
: 0;
}),
bottomSite: null
};
var EdgeList = {
list: [],
leftEnd: null,
rightEnd: null,
init: function() {
EdgeList.leftEnd = EdgeList.createHalfEdge(null, "l");
EdgeList.rightEnd = EdgeList.createHalfEdge(null, "l");
EdgeList.leftEnd.r = EdgeList.rightEnd;
EdgeList.rightEnd.l = EdgeList.leftEnd;
EdgeList.list.unshift(EdgeList.leftEnd, EdgeList.rightEnd);
},
createHalfEdge: function(edge, side) {
return {
edge: edge,
side: side,
vertex: null,
"l": null,
"r": null
};
},
insert: function(lb, he) {
he.l = lb;
he.r = lb.r;
lb.r.l = he;
lb.r = he;
},
leftBound: function(p) {
var he = EdgeList.leftEnd;
do {
he = he.r;
} while (he != EdgeList.rightEnd && Geom.rightOf(he, p));
he = he.l;
return he;
},
del: function(he) {
he.l.r = he.r;
he.r.l = he.l;
he.edge = null;
},
right: function(he) {
return he.r;
},
left: function(he) {
return he.l;
},
leftRegion: function(he) {
return he.edge == null
? Sites.bottomSite
: he.edge.region[he.side];
},
rightRegion: function(he) {
return he.edge == null
? Sites.bottomSite
: he.edge.region[d3_voronoi_opposite[he.side]];
}
};
var Geom = {
bisect: function(s1, s2) {
var newEdge = {
region: {"l": s1, "r": s2},
ep: {"l": null, "r": null}
};
var dx = s2.x - s1.x,
dy = s2.y - s1.y,
adx = dx > 0 ? dx : -dx,
ady = dy > 0 ? dy : -dy;
newEdge.c = s1.x * dx + s1.y * dy
+ (dx * dx + dy * dy) * .5;
if (adx > ady) {
newEdge.a = 1;
newEdge.b = dy / dx;
newEdge.c /= dx;
} else {
newEdge.b = 1;
newEdge.a = dx / dy;
newEdge.c /= dy;
}
return newEdge;
},
intersect: function(el1, el2) {
var e1 = el1.edge,
e2 = el2.edge;
if (!e1 || !e2 || (e1.region.r == e2.region.r)) {
return null;
}
var d = (e1.a * e2.b) - (e1.b * e2.a);
if (Math.abs(d) < 1e-10) {
return null;
}
var xint = (e1.c * e2.b - e2.c * e1.b) / d,
yint = (e2.c * e1.a - e1.c * e2.a) / d,
e1r = e1.region.r,
e2r = e2.region.r,
el,
e;
if ((e1r.y < e2r.y) ||
(e1r.y == e2r.y && e1r.x < e2r.x)) {
el = el1;
e = e1;
} else {
el = el2;
e = e2;
}
var rightOfSite = (xint >= e.region.r.x);
if ((rightOfSite && (el.side === "l")) ||
(!rightOfSite && (el.side === "r"))) {
return null;
}
return {
x: xint,
y: yint
};
},
rightOf: function(he, p) {
var e = he.edge,
topsite = e.region.r,
rightOfSite = (p.x > topsite.x);
if (rightOfSite && (he.side === "l")) {
return 1;
}
if (!rightOfSite && (he.side === "r")) {
return 0;
}
if (e.a === 1) {
var dyp = p.y - topsite.y,
dxp = p.x - topsite.x,
fast = 0,
above = 0;
if ((!rightOfSite && (e.b < 0)) ||
(rightOfSite && (e.b >= 0))) {
above = fast = (dyp >= e.b * dxp);
} else {
above = ((p.x + p.y * e.b) > e.c);
if (e.b < 0) {
above = !above;
}
if (!above) {
fast = 1;
}
}
if (!fast) {
var dxs = topsite.x - e.region.l.x;
above = (e.b * (dxp * dxp - dyp * dyp)) <
(dxs * dyp * (1 + 2 * dxp / dxs + e.b * e.b));
if (e.b < 0) {
above = !above;
}
}
} else /* e.b == 1 */ {
var yl = e.c - e.a * p.x,
t1 = p.y - yl,
t2 = p.x - topsite.x,
t3 = yl - topsite.y;
above = (t1 * t1) > (t2 * t2 + t3 * t3);
}
return he.side === "l" ? above : !above;
},
endPoint: function(edge, side, site) {
edge.ep[side] = site;
if (!edge.ep[d3_voronoi_opposite[side]]) return;
callback(edge);
},
distance: function(s, t) {
var dx = s.x - t.x,
dy = s.y - t.y;
return Math.sqrt(dx * dx + dy * dy);
}
};
var EventQueue = {
list: [],
insert: function(he, site, offset) {
he.vertex = site;
he.ystar = site.y + offset;
for (var i=0, list=EventQueue.list, l=list.length; i<l; i++) {
var next = list[i];
if (he.ystar > next.ystar ||
(he.ystar == next.ystar &&
site.x > next.vertex.x)) {
continue;
} else {
break;
}
}
list.splice(i, 0, he);
},
del: function(he) {
for (var i=0, ls=EventQueue.list, l=ls.length; i<l && (ls[i] != he); ++i) {}
ls.splice(i, 1);
},
empty: function() { return EventQueue.list.length === 0; },
nextEvent: function(he) {
for (var i=0, ls=EventQueue.list, l=ls.length; i<l; ++i) {
if (ls[i] == he) return ls[i+1];
}
return null;
},
min: function() {
var elem = EventQueue.list[0];
return {
x: elem.vertex.x,
y: elem.ystar
};
},
extractMin: function() {
return EventQueue.list.shift();
}
};
EdgeList.init();
Sites.bottomSite = Sites.list.shift();
var newSite = Sites.list.shift(), newIntStar;
var lbnd, rbnd, llbnd, rrbnd, bisector;
var bot, top, temp, p, v;
var e, pm;
while (true) {
if (!EventQueue.empty()) {
newIntStar = EventQueue.min();
}
if (newSite && (EventQueue.empty()
|| newSite.y < newIntStar.y
|| (newSite.y == newIntStar.y
&& newSite.x < newIntStar.x))) { //new site is smallest
lbnd = EdgeList.leftBound(newSite);
rbnd = EdgeList.right(lbnd);
bot = EdgeList.rightRegion(lbnd);
e = Geom.bisect(bot, newSite);
bisector = EdgeList.createHalfEdge(e, "l");
EdgeList.insert(lbnd, bisector);
p = Geom.intersect(lbnd, bisector);
if (p) {
EventQueue.del(lbnd);
EventQueue.insert(lbnd, p, Geom.distance(p, newSite));
}
lbnd = bisector;
bisector = EdgeList.createHalfEdge(e, "r");
EdgeList.insert(lbnd, bisector);
p = Geom.intersect(bisector, rbnd);
if (p) {
EventQueue.insert(bisector, p, Geom.distance(p, newSite));
}
newSite = Sites.list.shift();
} else if (!EventQueue.empty()) { //intersection is smallest
lbnd = EventQueue.extractMin();
llbnd = EdgeList.left(lbnd);
rbnd = EdgeList.right(lbnd);
rrbnd = EdgeList.right(rbnd);
bot = EdgeList.leftRegion(lbnd);
top = EdgeList.rightRegion(rbnd);
v = lbnd.vertex;
Geom.endPoint(lbnd.edge, lbnd.side, v);
Geom.endPoint(rbnd.edge, rbnd.side, v);
EdgeList.del(lbnd);
EventQueue.del(rbnd);
EdgeList.del(rbnd);
pm = "l";
if (bot.y > top.y) {
temp = bot;
bot = top;
top = temp;
pm = "r";
}
e = Geom.bisect(bot, top);
bisector = EdgeList.createHalfEdge(e, pm);
EdgeList.insert(llbnd, bisector);
Geom.endPoint(e, d3_voronoi_opposite[pm], v);
p = Geom.intersect(llbnd, bisector);
if (p) {
EventQueue.del(llbnd);
EventQueue.insert(llbnd, p, Geom.distance(p, bot));
}
p = Geom.intersect(bisector, rrbnd);
if (p) {
EventQueue.insert(bisector, p, Geom.distance(p, bot));
}
} else {
break;
}
}//end while
for (lbnd = EdgeList.right(EdgeList.leftEnd);
lbnd != EdgeList.rightEnd;
lbnd = EdgeList.right(lbnd)) {
callback(lbnd.edge);
}
}
/**
* @param vertices [[x1, y1], [x2, y2], …]
* @returns triangles [[[x1, y1], [x2, y2], [x3, y3]], …]
*/
d3.geom.delaunay = function(vertices) {
var edges = vertices.map(function() { return []; }),
triangles = [];
// Use the Voronoi tessellation to determine Delaunay edges.
d3_voronoi_tessellate(vertices, function(e) {
edges[e.region.l.index].push(vertices[e.region.r.index]);
});
// Reconnect the edges into counterclockwise triangles.
edges.forEach(function(edge, i) {
var v = vertices[i],
cx = v[0],
cy = v[1];
edge.forEach(function(v) {
v.angle = Math.atan2(v[0] - cx, v[1] - cy);
});
edge.sort(function(a, b) {
return a.angle - b.angle;
});
for (var j = 0, m = edge.length - 1; j < m; j++) {
triangles.push([v, edge[j], edge[j + 1]]);
}
});
return triangles;
};
// Constructs a new quadtree for the specified array of points. A quadtree is a
// two-dimensional recursive spatial subdivision. This implementation uses
// square partitions, dividing each square into four equally-sized squares. Each
// point exists in a unique node; if multiple points are in the same position,
// some points may be stored on internal nodes rather than leaf nodes. Quadtrees
// can be used to accelerate various spatial operations, such as the Barnes-Hut
// approximation for computing n-body forces, or collision detection.
d3.geom.quadtree = function(points, x1, y1, x2, y2) {
var p,
i = -1,
n = points.length;
// Type conversion for deprecated API.
if (n && isNaN(points[0].x)) points = points.map(d3_geom_quadtreePoint);
// Allow bounds to be specified explicitly.
if (arguments.length < 5) {
if (arguments.length === 3) {
y2 = x2 = y1;
y1 = x1;
} else {
x1 = y1 = Infinity;
x2 = y2 = -Infinity;
// Compute bounds.
while (++i < n) {
p = points[i];
if (p.x < x1) x1 = p.x;
if (p.y < y1) y1 = p.y;
if (p.x > x2) x2 = p.x;
if (p.y > y2) y2 = p.y;
}
// Squarify the bounds.
var dx = x2 - x1,
dy = y2 - y1;
if (dx > dy) y2 = y1 + dx;
else x2 = x1 + dy;
}
}
// Recursively inserts the specified point p at the node n or one of its
// descendants. The bounds are defined by [x1, x2] and [y1, y2].
function insert(n, p, x1, y1, x2, y2) {
if (isNaN(p.x) || isNaN(p.y)) return; // ignore invalid points
if (n.leaf) {
var v = n.point;
if (v) {
// If the point at this leaf node is at the same position as the new
// point we are adding, we leave the point associated with the
// internal node while adding the new point to a child node. This
// avoids infinite recursion.
if ((Math.abs(v.x - p.x) + Math.abs(v.y - p.y)) < .01) {
insertChild(n, p, x1, y1, x2, y2);
} else {
n.point = null;
insertChild(n, v, x1, y1, x2, y2);
insertChild(n, p, x1, y1, x2, y2);
}
} else {
n.point = p;
}
} else {
insertChild(n, p, x1, y1, x2, y2);
}
}
// Recursively inserts the specified point p into a descendant of node n. The
// bounds are defined by [x1, x2] and [y1, y2].
function insertChild(n, p, x1, y1, x2, y2) {
// Compute the split point, and the quadrant in which to insert p.
var sx = (x1 + x2) * .5,
sy = (y1 + y2) * .5,
right = p.x >= sx,
bottom = p.y >= sy,
i = (bottom << 1) + right;
// Recursively insert into the child node.
n.leaf = false;
n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
// Update the bounds as we recurse.
if (right) x1 = sx; else x2 = sx;
if (bottom) y1 = sy; else y2 = sy;
insert(n, p, x1, y1, x2, y2);
}
// Create the root node.
var root = d3_geom_quadtreeNode();
root.add = function(p) {
insert(root, p, x1, y1, x2, y2);
};
root.visit = function(f) {
d3_geom_quadtreeVisit(f, root, x1, y1, x2, y2);
};
// Insert all points.
points.forEach(root.add);
return root;
};
function d3_geom_quadtreeNode() {
return {
leaf: true,
nodes: [],
point: null
};
}
function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
if (!f(node, x1, y1, x2, y2)) {
var sx = (x1 + x2) * .5,
sy = (y1 + y2) * .5,
children = node.nodes;
if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
}
}
function d3_geom_quadtreePoint(p) {
return {
x: p[0],
y: p[1]
};
}
})();
| 26.413381 | 83 | 0.510765 |
18410278f12abd68871ae0ce02085399bf680d06 | 71 | js | JavaScript | dpd/resources/users/get.js | InfoCompass/backend | ea8f0cf20f951fbe8bdd692871404772668a8357 | [
"MIT"
] | null | null | null | dpd/resources/users/get.js | InfoCompass/backend | ea8f0cf20f951fbe8bdd692871404772668a8357 | [
"MIT"
] | 6 | 2018-01-25T12:54:31.000Z | 2022-03-23T04:17:20.000Z | dpd/resources/users/get.js | InfoCompass/backend | ea8f0cf20f951fbe8bdd692871404772668a8357 | [
"MIT"
] | 1 | 2017-11-06T05:02:04.000Z | 2017-11-06T05:02:04.000Z | cancelUnless(internal || me && (me.id == this.id), "Unauthorized", 401) | 71 | 71 | 0.661972 |
184147678e56af433e24b3eed535d7b53be20a23 | 2,063 | js | JavaScript | src/todos.js | kbjude/todo-list | 2ff4c9056926e0271ccb12bd7b8483f58db99ad4 | [
"MIT"
] | 5 | 2020-10-23T20:53:56.000Z | 2021-06-15T09:52:22.000Z | src/todos.js | kbjude/todo-list | 2ff4c9056926e0271ccb12bd7b8483f58db99ad4 | [
"MIT"
] | 1 | 2020-10-15T21:54:37.000Z | 2020-10-15T21:54:37.000Z | src/todos.js | kbjude/todo-list | 2ff4c9056926e0271ccb12bd7b8483f58db99ad4 | [
"MIT"
] | 1 | 2021-06-28T17:37:57.000Z | 2021-06-28T17:37:57.000Z | import domManipulation from './helpers';
const todos = (() => {
const todo = (title, description, dueDate, priority, notes) => {
const getTitle = () => title;
const getDescription = () => description;
const getDueDate = () => dueDate;
const getPriority = () => priority;
const getNotes = () => notes;
const getAll = () => [title, description, dueDate, priority, notes];
const setTitle = (todoTitle) => {
title = todoTitle;
};
const setDescription = (todoDescription) => {
description = todoDescription;
};
const setDueDate = (todoDueDate) => {
dueDate = todoDueDate;
};
const setPriority = (todoPriority) => {
priority = todoPriority;
};
const setNotes = (todoNotes) => {
notes = todoNotes;
};
return {
getTitle,
getDescription,
getDueDate,
getPriority,
getNotes,
getAll,
setTitle,
setDescription,
setDueDate,
setPriority,
setNotes,
};
};
const clearTodoContainer = () => {
const todoSection = domManipulation.getHtmlElement({ byId: 'todo-section' });
const cardsContainer = domManipulation.getHtmlElement({ byQueryClass: '.cards-container' });
cardsContainer.remove();
domManipulation.createHtmlElement({ tag: 'div', parentElement: todoSection, arrayClassNames: ['cards-container'] });
};
const setPriorityColor = (newToDoPriority, cardTitle, priorityClass = null) => {
switch (newToDoPriority) {
case 'High':
if (priorityClass !== null) {
domManipulation.removeClasses(cardTitle, [priorityClass[1]]);
}
domManipulation.addClasses(cardTitle, ['priority-high']);
break;
case 'Mid':
domManipulation.addClasses(cardTitle, ['priority-mid']);
break;
case 'Low':
domManipulation.addClasses(cardTitle, ['priority-low']);
break;
default:
break;
}
};
return {
todo,
clearTodoContainer,
setPriorityColor,
};
})();
export default todos; | 25.7875 | 120 | 0.606883 |
1841ada183fbdfa190692b142de798727a83dfe1 | 1,218 | js | JavaScript | playground.js | pannous/schism | 0fb7ee56df7ec8ffbfaff976cc787c346ed57761 | [
"Apache-2.0"
] | null | null | null | playground.js | pannous/schism | 0fb7ee56df7ec8ffbfaff976cc787c346ed57761 | [
"Apache-2.0"
] | null | null | null | playground.js | pannous/schism | 0fb7ee56df7ec8ffbfaff976cc787c346ed57761 | [
"Apache-2.0"
] | null | null | null | //
// Copyright 2018 Google LLC
import * as Schism from './rt/rt.js';
import filesystem from './rt/filesystem-null.js';
async function compileSchism() {
const schism_bytes = await fetch('schism-stage0.wasm', { credentials: 'include' });
const engine = new Schism.Engine({ filesystem });
const schism = await engine.loadWasmModule(await schism_bytes.arrayBuffer());
console.info('Loading Schism Complete');
return { schism, engine };
}
const compiler = compileSchism();
async function compileAndRun() {
const src = document.getElementById('src').value;
console.info(`Compiling program: '${src}'`);
const { schism, engine } = await compiler;
engine.setCurrentInputPortChars(src);
engine.output_data.length = 0;
schism.call('compile-stdin->stdout');
const bytes = new Uint8Array(engine.output_data);
engine.output_data.length = 0;
console.info("Compilation complete, executing program");
const mod = await engine.loadWasmModule(bytes);
engine.setCurrentInputPort('');
const result = mod.call('main');
document.getElementById('result').innerHTML = "" + result;
console.info("Done");
}
document.getElementById('go').addEventListener('click', () => {
compileAndRun();
});
| 28.325581 | 85 | 0.711823 |
1842294ca28f0160b81644844355e9c2592bfaa9 | 2,131 | es6 | JavaScript | modules/angular2/src/reflection/reflection_capabilities.es6 | AliMD/Angular2 | 85211f0a6bf5101bc2a1e4bee2d1b6e3cb328842 | [
"Apache-2.0"
] | null | null | null | modules/angular2/src/reflection/reflection_capabilities.es6 | AliMD/Angular2 | 85211f0a6bf5101bc2a1e4bee2d1b6e3cb328842 | [
"Apache-2.0"
] | null | null | null | modules/angular2/src/reflection/reflection_capabilities.es6 | AliMD/Angular2 | 85211f0a6bf5101bc2a1e4bee2d1b6e3cb328842 | [
"Apache-2.0"
] | 1 | 2022-02-28T06:21:18.000Z | 2022-02-28T06:21:18.000Z | import {Type, isPresent} from 'angular2/src/facade/lang';
import {List, ListWrapper} from 'angular2/src/facade/collection';
import {GetterFn, SetterFn, MethodFn} from './types';
export class ReflectionCapabilities {
factory(type:Type):Function {
switch (type.length) {
case 0:
return function(){return new type();};
case 1:
return function(a1){return new type(a1);};
case 2:
return function(a1, a2){return new type(a1, a2);};
case 3:
return function(a1, a2, a3){return new type(a1, a2, a3);};
case 4:
return function(a1, a2, a3, a4){return new type(a1, a2, a3, a4);};
case 5:
return function(a1, a2, a3, a4, a5){return new type(a1, a2, a3, a4, a5);};
case 6:
return function(a1, a2, a3, a4, a5, a6){return new type(a1, a2, a3, a4, a5, a6);};
case 7:
return function(a1, a2, a3, a4, a5, a6, a7){return new type(a1, a2, a3, a4, a5, a6, a7);};
case 8:
return function(a1, a2, a3, a4, a5, a6, a7, a8){return new type(a1, a2, a3, a4, a5, a6, a7, a8);};
case 9:
return function(a1, a2, a3, a4, a5, a6, a7, a8, a9){return new type(a1, a2, a3, a4, a5, a6, a7, a8, a9);};
case 10:
return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10){return new type(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);};
};
throw new Error("Factory cannot take more than 10 arguments");
}
parameters(typeOfFunc):List<List> {
return isPresent(typeOfFunc.parameters) ?
typeOfFunc.parameters :
ListWrapper.createFixedSize(typeOfFunc.length);
}
annotations(typeOfFunc):List {
return isPresent(typeOfFunc.annotations) ? typeOfFunc.annotations : [];
}
getter(name:string):GetterFn {
return new Function('o', 'return o.' + name + ';');
}
setter(name:string):SetterFn {
return new Function('o', 'v', 'return o.' + name + ' = v;');
}
method(name:string):MethodFn {
var method = `o.${name}`;
return new Function('o', 'args',
`if (!${method}) throw new Error('"${name}" is undefined');` +
`return ${method}.apply(o, args);`);
}
} | 36.118644 | 124 | 0.593149 |
1842eb79d07a1343e1a6319c8ffb5d6cc659fdc8 | 1,196 | js | JavaScript | src/loader/tests/specs/sync/sync-spec.js | q946401639/kissy | be636012583decfee28a38b1c804f842537f5ace | [
"MIT"
] | 1 | 2015-05-07T07:24:05.000Z | 2015-05-07T07:24:05.000Z | src/loader/tests/specs/sync/sync-spec.js | q946401639/kissy | be636012583decfee28a38b1c804f842537f5ace | [
"MIT"
] | null | null | null | src/loader/tests/specs/sync/sync-spec.js | q946401639/kissy | be636012583decfee28a38b1c804f842537f5ace | [
"MIT"
] | null | null | null | // --no-module-wrap--
var run = function (combine) {
if (1) {
// for performance, disabled async loading
return;
}
describe('allow sync loading ' + (combine ? 'at combo mode' : ''), function () {
beforeEach(function () {
KISSY.config('combine', !!combine);
});
afterEach(function () {
KISSY.clearLoader();
});
it('default to async', function () {
KISSY.add('test-sync', function () {
return 1;
});
var t;
KISSY.use('test-sync', function (S, x) {
t = x;
});
expect(t).toBe(undefined);
waits(50);
runs(function () {
expect(t).toBe(1);
});
});
it('can be sync', function () {
KISSY.add('test-sync', function () {
return 1;
});
var t;
KISSY.use('test-sync', {
success: function (S, x) {
t = x;
},
sync: 1
});
expect(t).toBe(1);
});
});
};
run();
run(1);
| 20.271186 | 84 | 0.378763 |
18449de1a319da5ab69923a8497b381cebbdd990 | 31,931 | js | JavaScript | dist/esm-es5/ion-searchbar.entry.js | MEDGRUPOGIT/med-components | ae0e262ffbf7ccecd878c5df399382f7b9547e04 | [
"MIT"
] | null | null | null | dist/esm-es5/ion-searchbar.entry.js | MEDGRUPOGIT/med-components | ae0e262ffbf7ccecd878c5df399382f7b9547e04 | [
"MIT"
] | null | null | null | dist/esm-es5/ion-searchbar.entry.js | MEDGRUPOGIT/med-components | ae0e262ffbf7ccecd878c5df399382f7b9547e04 | [
"MIT"
] | null | null | null | import{__awaiter,__generator}from"tslib";import{r as registerInstance,e as createEvent,j as forceUpdate,h,H as Host,i as getElement}from"./index-70672e81.js";import{c as config,b as getIonMode}from"./ionic-global-4bc7e399.js";import{f as debounceEvent,r as raf}from"./helpers-dd7e4b7b.js";import{g as generateMedColor}from"./med-theme-83c28ab9.js";var searchbarIosCss=".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-ios::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);stroke:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-searchbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-ios{height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-ios{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-ios{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-ios{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:30px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{-webkit-transition:all 300ms ease;transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:-100%;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:all 300ms ease;transition:all 300ms ease;opacity:0;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{-webkit-transition-duration:0ms;transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}.sc-ion-searchbar-ios-h{--color:hsl(var(--med-color-neutral-10));--background:hsl(var(--med-color-neutral-2));--border-radius:var(--med-border-radius-sm);--icon-color:hsl(var(--med-color-neutral-10));--cancel-button-color:hsl(var(--med-color-brand-3));--placeholder-opacity:1;--padding-left:30px;--clear-button-color:hsl(var(--med-color-neutral-5));--icon-size:24px;--padding-left-icon:0;--spacing:var(--med-spacing-inset-xs);padding:var(--spacing);height:45px}.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{-webkit-padding-start:calc(var(--padding-left) + var(--med-spacing-inline-nano)) !important;padding-inline-start:calc(var(--padding-left) + var(--med-spacing-inline-nano)) !important;font-size:var(--med-font-size-xs);font-weight:var(--med-font-weight-regular);line-height:var(--med-line-height-compressed)}.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{width:var(--icon-size);stroke:var(--icon-color)}.sc-ion-searchbar-ios-h .searchbar-input-container.sc-ion-searchbar-ios.sc-ion-searchbar-ios{height:45px}.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios.sc-ion-searchbar-ios{-webkit-margin-start:var(--padding-left-icon);margin-inline-start:var(--padding-left-icon)}.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios.sc-ion-searchbar-ios{width:45px}.med-color.sc-ion-searchbar-ios-h{--color:hsl(var(--med-color-contrast-fixed));--background:hsl(var(--med-color-3));--icon-color:hsl(var(--med-color-3));--cancel-button-color:hsl(var(--med-color-3))}.med-color-neutral.sc-ion-searchbar-ios-h{--color:hsl(var(--med-color-neutral-contrast));--background:hsl(var(--med-color-neutral));--icon-color:hsl(var(--med-color-neutral));--cancel-button-color:hsl(var(--med-color-neutral))}.med-color-feedback.sc-ion-searchbar-ios-h{--color:hsl(var(--med-color-feedback-contrast));--background:hsl(var(--med-color-feedback));--icon-color:hsl(var(--med-color-feedback));--cancel-button-color:hsl(var(--med-color-feedback))}";var mdSearchbarIosCss=".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);stroke:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-md{height:36px}.searchbar-search-icon.sc-ion-searchbar-md{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-md{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-md{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-md{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-md{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-md{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{padding-left:30px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-animated.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-animated.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,.searchbar-animated.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{-webkit-transition:all 300ms ease;transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{margin-right:-100%;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:all 300ms ease;transition:all 300ms ease;opacity:0;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,.searchbar-no-animate.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,.searchbar-no-animate.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{-webkit-transition-duration:0ms;transition-duration:0ms}.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-md-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-md-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-md-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-md,ion-toolbar.ion-color .sc-ion-searchbar-md-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-md{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,ion-toolbar.ion-color .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-md-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-md,ion-toolbar.ion-color .sc-ion-searchbar-md-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-md{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-md-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-md,ion-toolbar.ion-color .sc-ion-searchbar-md-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-md{color:currentColor;opacity:0.5}.sc-ion-searchbar-md-h{--color:hsl(var(--med-color-neutral-10));--background:hsl(var(--med-color-neutral-2));--border-radius:var(--med-border-radius-sm);--icon-color:hsl(var(--med-color-neutral-10));--cancel-button-color:hsl(var(--med-color-brand-3));--placeholder-opacity:1;--padding-left:30px;--clear-button-color:hsl(var(--med-color-neutral-5));--icon-size:24px;--padding-left-icon:0;--spacing:var(--med-spacing-inset-xs);padding:var(--spacing);height:45px}.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{-webkit-padding-start:calc(var(--padding-left) + var(--med-spacing-inline-nano)) !important;padding-inline-start:calc(var(--padding-left) + var(--med-spacing-inline-nano)) !important;font-size:var(--med-font-size-xs);font-weight:var(--med-font-weight-regular);line-height:var(--med-line-height-compressed)}.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{width:var(--icon-size);stroke:var(--icon-color)}.sc-ion-searchbar-md-h .searchbar-input-container.sc-ion-searchbar-ios.sc-ion-searchbar-md{height:45px}.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-ios.sc-ion-searchbar-md{-webkit-margin-start:var(--padding-left-icon);margin-inline-start:var(--padding-left-icon)}.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-ios.sc-ion-searchbar-md{width:45px}.med-color.sc-ion-searchbar-md-h{--color:hsl(var(--med-color-contrast-fixed));--background:hsl(var(--med-color-3));--icon-color:hsl(var(--med-color-3));--cancel-button-color:hsl(var(--med-color-3))}.med-color-neutral.sc-ion-searchbar-md-h{--color:hsl(var(--med-color-neutral-contrast));--background:hsl(var(--med-color-neutral));--icon-color:hsl(var(--med-color-neutral));--cancel-button-color:hsl(var(--med-color-neutral))}.med-color-feedback.sc-ion-searchbar-md-h{--color:hsl(var(--med-color-feedback-contrast));--background:hsl(var(--med-color-feedback));--icon-color:hsl(var(--med-color-feedback));--cancel-button-color:hsl(var(--med-color-feedback))}";var Searchbar=function(){function r(r){var a=this;registerInstance(this,r);this.ionInput=createEvent(this,"ionInput",7);this.ionChange=createEvent(this,"ionChange",7);this.ionCancel=createEvent(this,"ionCancel",7);this.ionClear=createEvent(this,"ionClear",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionStyle=createEvent(this,"ionStyle",7);this.isCancelVisible=false;this.shouldAlignLeft=true;this.focused=false;this.noAnimate=true;this.animated=false;this.autocomplete="off";this.autocorrect="off";this.cancelButtonIcon=config.get("backButtonIcon","arrow-back-sharp");this.cancelButtonText="Cancel";this.debounce=250;this.disabled=false;this.placeholder="Pesquisar";this.showCancelButton="never";this.showClearButton="focus";this.spellcheck=false;this.type="search";this.value="";this.onClearInput=function(r,o){a.ionClear.emit();if(r){r.preventDefault();r.stopPropagation()}setTimeout((function(){var r=a.getValue();if(r!==""){a.value="";a.ionInput.emit();if(o&&!a.focused){a.setFocus()}}}),16*4)};this.onCancelSearchbar=function(r){if(r){r.preventDefault();r.stopPropagation()}a.ionCancel.emit();a.onClearInput();if(a.nativeInput){a.nativeInput.blur()}};this.onInput=function(r){var o=r.target;if(o){a.value=o.value}a.ionInput.emit(r)};this.onBlur=function(){a.focused=false;a.ionBlur.emit();a.positionElements()};this.onFocus=function(){a.focused=true;a.ionFocus.emit();a.positionElements()}}r.prototype.debounceChanged=function(){this.ionChange=debounceEvent(this.ionChange,this.debounce)};r.prototype.valueChanged=function(){var r=this.nativeInput;var a=this.getValue();if(r&&r.value!==a){r.value=a}this.ionChange.emit({value:a})};r.prototype.showCancelButtonChanged=function(){var r=this;requestAnimationFrame((function(){r.positionElements();forceUpdate(r)}))};r.prototype.connectedCallback=function(){this.emitStyle()};r.prototype.componentDidLoad=function(){var r=this;this.positionElements();this.debounceChanged();setTimeout((function(){r.noAnimate=false}),300)};r.prototype.emitStyle=function(){this.ionStyle.emit({searchbar:true})};r.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){if(this.nativeInput){this.nativeInput.focus()}return[2]}))}))};r.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};r.prototype.positionElements=function(){var r=this.getValue();var a=this.shouldAlignLeft;var o=getIonMode(this);var e=!this.animated||r.trim()!==""||!!this.focused;this.shouldAlignLeft=e;if(o!=="ios"){return}if(a!==e){this.positionPlaceholder()}if(this.animated){this.positionCancelButton()}};r.prototype.positionPlaceholder=function(){var r=this.nativeInput;if(!r){return}var a=document.dir==="rtl";var o=(this.el.shadowRoot||this.el).querySelector(".searchbar-search-icon");if(this.shouldAlignLeft){r.removeAttribute("style");o.removeAttribute("style")}else{var e=document;var n=e.createElement("span");n.innerText=this.placeholder||"";e.body.appendChild(n);raf((function(){var e=n.offsetWidth;n.remove();var i="calc(50% - "+e/2+"px)";var t="calc(50% - "+(e/2+30)+"px)";if(a){r.style.paddingRight=i;o.style.marginRight=t}else{r.style.paddingLeft=i;o.style.marginLeft=t}}))}};r.prototype.positionCancelButton=function(){var r=document.dir==="rtl";var a=(this.el.shadowRoot||this.el).querySelector(".searchbar-cancel-button");var o=this.shouldShowCancelButton();if(a&&o!==this.isCancelVisible){var e=a.style;this.isCancelVisible=o;if(o){if(r){e.marginLeft="0"}else{e.marginRight="0"}}else{var n=a.offsetWidth;if(n>0){if(r){e.marginLeft=-n+"px"}else{e.marginRight=-n+"px"}}}}};r.prototype.getValue=function(){return this.value||""};r.prototype.hasValue=function(){return this.getValue()!==""};r.prototype.shouldShowCancelButton=function(){if(this.showCancelButton==="never"||this.showCancelButton==="focus"&&!this.focused){return false}return true};r.prototype.shouldShowClearButton=function(){if(this.showClearButton==="never"||this.showClearButton==="focus"&&!this.focused){return false}return true};r.prototype.render=function(){var r;var a=this;var o=this.cancelButtonText;var e=this.animated&&config.getBoolean("animated",true);var n=getIonMode(this);var i=this.clearIcon||(n==="ios"?"close-circle":"close-sharp");var t=this.searchIcon||(n==="ios"?"search-outline":"search-sharp");var s=this.shouldShowCancelButton();var c=this.showCancelButton!=="never"&&h("button",{"aria-label":o,"aria-hidden":s?undefined:"true",type:"button",tabIndex:n==="ios"&&!s?-1:undefined,onMouseDown:this.onCancelSearchbar,onTouchStart:this.onCancelSearchbar,class:"searchbar-cancel-button"},h("div",{"aria-hidden":"true"},n==="md"?h("ion-icon",{class:"med-icon","aria-hidden":"true",mode:n,icon:this.cancelButtonIcon,lazy:false}):o));var l=this.dsColor;return h(Host,{role:"search","aria-disabled":this.disabled?"true":null,class:generateMedColor(l,(r={},r[n]=true,r["searchbar-animated"]=e,r["searchbar-disabled"]=this.disabled,r["searchbar-no-animate"]=e&&this.noAnimate,r["searchbar-has-value"]=this.hasValue(),r["searchbar-left-aligned"]=this.shouldAlignLeft,r["searchbar-has-focus"]=this.focused,r["searchbar-should-show-clear"]=this.shouldShowClearButton(),r["searchbar-should-show-cancel"]=this.shouldShowCancelButton(),r))},h("div",{class:"searchbar-input-container"},h("input",{"aria-label":"search text",disabled:this.disabled,ref:function(r){return a.nativeInput=r},class:"searchbar-input",inputMode:this.inputmode,enterKeyHint:this.enterkeyhint,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,placeholder:this.placeholder,type:this.type,value:this.getValue(),autoComplete:this.autocomplete,autoCorrect:this.autocorrect,spellcheck:this.spellcheck}),n==="md"&&c,h("ion-icon",{"aria-hidden":"true",mode:n,icon:t,lazy:false,class:"med-icon searchbar-search-icon"}),h("ion-button",{"ds-name":"tertiary","aria-label":"reset",type:"button","no-blur":true,class:"searchbar-clear-button",onMouseDown:function(r){return a.onClearInput(r,true)},onTouchStart:function(r){return a.onClearInput(r,true)}},h("ion-icon",{slot:"icon-only",name:"med-fechar","aria-hidden":"true",mode:n,icon:i,lazy:false,class:"med-icon searchbar-clear-icon"}))),n==="ios"&&c)};Object.defineProperty(r.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(r,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"],showCancelButton:["showCancelButtonChanged"]}},enumerable:false,configurable:true});return r}();Searchbar.style={ios:searchbarIosCss,md:mdSearchbarIosCss};export{Searchbar as ion_searchbar}; | 31,931 | 31,931 | 0.781435 |
1844a5b0ebf210a450d4b69831e5e99bf425b3f7 | 59 | js | JavaScript | src/pages/playerList/history/index.js | zoe-lin-1961/demo | 722cfa12a38e9959a255f6546e9ed703aec5f8f6 | [
"MIT"
] | null | null | null | src/pages/playerList/history/index.js | zoe-lin-1961/demo | 722cfa12a38e9959a255f6546e9ed703aec5f8f6 | [
"MIT"
] | null | null | null | src/pages/playerList/history/index.js | zoe-lin-1961/demo | 722cfa12a38e9959a255f6546e9ed703aec5f8f6 | [
"MIT"
] | null | null | null | import history from './history.vue'
export default history | 29.5 | 36 | 0.79661 |
18454fefb064830e776ec36e5a9cfe139a987e24 | 283 | js | JavaScript | packages/zhouhaifei-react-scripts/react-dev-utils/ignoredFiles.js | air-supply94/zhouhaifei-react-scripts-test | 9a748f5e6268b5a9a9dc66be4156744c91be5d42 | [
"MIT"
] | null | null | null | packages/zhouhaifei-react-scripts/react-dev-utils/ignoredFiles.js | air-supply94/zhouhaifei-react-scripts-test | 9a748f5e6268b5a9a9dc66be4156744c91be5d42 | [
"MIT"
] | null | null | null | packages/zhouhaifei-react-scripts/react-dev-utils/ignoredFiles.js | air-supply94/zhouhaifei-react-scripts-test | 9a748f5e6268b5a9a9dc66be4156744c91be5d42 | [
"MIT"
] | null | null | null | 'use strict';
const path = require('path');
const escape = require('escape-string-regexp');
module.exports = function ignoredFiles(appSrc) {
return new RegExp(
`^(?!${escape(
path.normalize(`${appSrc}/`).replace(/[\\]+/g, '/')
)}).+/node_modules/`,
'g'
);
};
| 20.214286 | 57 | 0.583039 |
1845a1567035ca0cdee0d96ed6f53ac75cb70265 | 380 | js | JavaScript | force-app/main/default/lwc/navToHelloTab/navToHelloTab.js | abhinav1144/lwc-recipes | 3366766c97cef97f77dc6b73b42f33acf6661081 | [
"CC0-1.0"
] | 1,700 | 2018-12-13T13:40:42.000Z | 2022-03-31T10:42:48.000Z | force-app/main/default/lwc/navToHelloTab/navToHelloTab.js | ceciquin/lwc-recipes | f455221825ca6b397ef1acf8428124d715689089 | [
"CC0-1.0"
] | 495 | 2018-12-13T17:40:16.000Z | 2022-03-20T11:41:09.000Z | force-app/main/default/lwc/navToHelloTab/navToHelloTab.js | ceciquin/lwc-recipes | f455221825ca6b397ef1acf8428124d715689089 | [
"CC0-1.0"
] | 2,191 | 2018-12-13T17:48:47.000Z | 2022-03-31T22:40:15.000Z | import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class NavToHelloTab extends NavigationMixin(LightningElement) {
navigateToHelloTab() {
this[NavigationMixin.Navigate]({
type: 'standard__navItemPage',
attributes: {
apiName: 'Hello'
}
});
}
}
| 27.142857 | 78 | 0.615789 |
1845c4efd6cee518a2db43a7f683ba66dd6bbbbe | 367 | js | JavaScript | front-end/src/components/User/dinerplist.js | Build-Week-FoodTruck-Trackr1/Front-End | a898d1ecbcdef6cdac95ccccc66234e7496795d3 | [
"MIT"
] | 1 | 2021-02-18T22:10:00.000Z | 2021-02-18T22:10:00.000Z | front-end/src/components/User/dinerplist.js | Build-Week-FoodTruck-Trackr1/Front-End | a898d1ecbcdef6cdac95ccccc66234e7496795d3 | [
"MIT"
] | 3 | 2020-01-09T06:03:41.000Z | 2021-10-06T09:00:09.000Z | front-end/src/components/User/dinerplist.js | Build-Week-FoodTruck-Trackr1/Front-End | a898d1ecbcdef6cdac95ccccc66234e7496795d3 | [
"MIT"
] | 3 | 2019-12-18T04:12:08.000Z | 2020-01-12T16:46:03.000Z | import React from "react";
const dinerplist = props => {
return (
<div className="Truck-list">
{props.truck_List.map(truck => (
<div className="build" key={truck.id}>
<h2>{truck.name}</h2>
<p>{truck.cusine}</p>
<p>{truck.customerRatingAvg}</p>
</div>
))}
</div>
);
};
export default dinerplist; | 21.588235 | 46 | 0.53406 |
18461803f0aae90456d3128914a3de53e7eae7b1 | 424 | js | JavaScript | web/src/utils/token.js | ZhouLingchao/scaffold | 4546fdc217ac54dd2599e5c6810e855235572322 | [
"MIT"
] | null | null | null | web/src/utils/token.js | ZhouLingchao/scaffold | 4546fdc217ac54dd2599e5c6810e855235572322 | [
"MIT"
] | null | null | null | web/src/utils/token.js | ZhouLingchao/scaffold | 4546fdc217ac54dd2599e5c6810e855235572322 | [
"MIT"
] | null | null | null | // 使用localStorage存储cookie,使用后端判断cookie是否过期
const key = JWT_TOKEN_KEY; // eslint-disable-line
export function getToken() {
return localStorage.getItem(key);
}
export function setToken(token) {
return localStorage.setItem(key, token);
}
export function getItem(itemKey) {
return localStorage.getItem(key + itemKey);
}
export function setItem(itemKey, itemValue) {
return localStorage.setItem(itemKey, itemValue);
} | 23.555556 | 50 | 0.771226 |
18475a7bdf40e95e83c22cbd7d006841c4fb0fdb | 2,345 | js | JavaScript | tasks/support/karma.conf.js | capacitorjs/gulp-capacitorjs-common | 4baca8e85a1aa75c21419169ad074fd3d1616da3 | [
"CC0-1.0"
] | null | null | null | tasks/support/karma.conf.js | capacitorjs/gulp-capacitorjs-common | 4baca8e85a1aa75c21419169ad074fd3d1616da3 | [
"CC0-1.0"
] | null | null | null | tasks/support/karma.conf.js | capacitorjs/gulp-capacitorjs-common | 4baca8e85a1aa75c21419169ad074fd3d1616da3 | [
"CC0-1.0"
] | null | null | null | 'use strict';
var cloneDeep = require('lodash.clonedeep');
var isparta = require('isparta');
module.exports = function (config) {
var karmaConf = {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai-as-promised', 'sinon', 'sinon-chai', 'chai'],
// list of files / patterns to load in the browser
files: [
config.commonGulpdir + '/node_modules/babel-core/browser-polyfill.js',
config.test.in
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha', 'growl', 'coverage'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],
customLaunchers: {
CHROME_TRAVIS_CI: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
coverageReporter: {
// configure the reporter to use isparta for JavaScript coverage
instrumenters: {isparta: isparta},
instrumenter: {}
}
};
karmaConf.preprocessors[config.test.in] = ['webpack', 'sourcemap'];
var dev = !!config.args.dev;
karmaConf.autoWatch = dev;
karmaConf.singleRun = !dev;
var webpack = cloneDeep(config.webpack);
if (!dev) {
webpack.module.preLoaders.push({
test: /(\.js)$/,
exclude: /(spec|node_modules)\//,
loader: 'isparta-instrumenter-loader'
});
} else {
webpack.devtool = 'inline-source-map';
}
if (config.CI) {
karmaConf.browsers = ['CHROME_TRAVIS_CI'];
}
karmaConf.webpack = webpack;
karmaConf.coverageReporter.instrumenter[config.src.in] = 'isparta';
return karmaConf;
};
| 27.267442 | 120 | 0.652026 |
1847eb6bff1f97269c84aae52ddc735e8883de67 | 3,398 | js | JavaScript | src/components/deletePatch.js | jmwalsh91/crypTonesFEDev | db83d10854074f40d521e4831cf022eb54d7434b | [
"Apache-2.0"
] | null | null | null | src/components/deletePatch.js | jmwalsh91/crypTonesFEDev | db83d10854074f40d521e4831cf022eb54d7434b | [
"Apache-2.0"
] | null | null | null | src/components/deletePatch.js | jmwalsh91/crypTonesFEDev | db83d10854074f40d521e4831cf022eb54d7434b | [
"Apache-2.0"
] | null | null | null |
import React from "react";
import { useState, useContext, useRef } from "react";
import { UserContext } from "./userContext";
import { axiosUser } from "./axiosinstances";
import { IconButton, Button } from "@mui/material";
import EditIcon from '@mui/icons-material/Edit';
import SendIcon from '@mui/icons-material/Send';
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
import { Typography } from "@mui/material";
import { Dialog, DialogTitle, DialogContent, TextField, Paper, DialogActions} from "@mui/material"
import DeleteForeverIcon from '@mui/icons-material/DeleteForever';
export function DeletePatchButton(props) {
console.log(props)
const [ open, setOpen ] = useState(false);
const { user, setUser } = useContext(UserContext)
const nameRef = useRef(null)
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
const handleDeleteClose = () => {
handleClose()
}
function handleClickSubmitDelete() {
console.log(props)
axiosUser.delete('/patch/delete/' + props.patchId)
.then((res, err) => {
if (err) {
throw err
}
if (!err) {
console.log(res.data)
handleClose()
return (res.data)
}
})
.catch(err => console.log(err))
}
return (
<div>
<IconButton
size="large"
aria-label="delete patch"
aria-controls="menu-appbar"
aria-haspopup="true"
onClick={handleOpen}
color="secondary"
label="Delete"
//make sure to handle close!
>
<DeleteForeverIcon/>
<Typography variant="body2"> Delete Patch</Typography>
</IconButton>
<Dialog open={open} onClose={handleClose} elevation={24}>
<Paper variant="elevation" elevation={24}>
<DialogTitle color="primary">Delete</DialogTitle>
<DialogContent color="secondary">
<Typography variant="h6" color="primary">Are you sure you want to delete?</Typography>
<DialogActions sx={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between'
}}>
<IconButton
size="large"
aria-label="close"
aria-controls="close"
aria-haspopup="true"
onClick={handleClose}
color="secondary"
label="Close">
<ArrowBackIosIcon/>
<Typography variant="body2"> No, close. </Typography>
</IconButton>
<IconButton
size="large"
aria-label="submit name"
aria-controls="close delete"
onClick={handleClickSubmitDelete}
color="warning"
label="Submit">
<DeleteForeverIcon/>
<Typography variant="body2"> Yes, delete. </Typography>
</IconButton>
</DialogActions>
</DialogContent>
</Paper>
</Dialog>
</div>
)
} | 32.673077 | 106 | 0.513832 |
184896e0022c340093af8d76763b6120677b40bb | 2,268 | js | JavaScript | mindmeld-ui/src/recognition/google-asr.js | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 580 | 2019-03-24T20:59:09.000Z | 2022-03-23T17:06:43.000Z | mindmeld-ui/src/recognition/google-asr.js | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 199 | 2019-04-30T18:15:46.000Z | 2022-03-22T17:11:33.000Z | mindmeld-ui/src/recognition/google-asr.js | Embodimentgeniuslm3/mindmeld | 042d4ed5400cd1cf8ea1f025eea732359ef68720 | [
"Apache-2.0"
] | 164 | 2019-04-25T08:27:28.000Z | 2022-03-23T12:44:33.000Z | import axios from 'axios';
import Recorder from './recorder';
export default class GoogleAsr {
constructor(config) {
config = {
maxTranscripts: 1,
key: '',
...config,
};
this._maxTranscripts = Math.max(config.maxTranscripts - 1, 0);
this._key = config.key;
this._recognizing = false;
this._recorder = new Recorder();
this._recorder.on(Recorder.ON_ERROR, this._onError.bind(this));
this._recorder.on(Recorder.ON_DATA, this._onDataReady.bind(this));
}
start() {
if (this._recognizing) {
return;
}
this._recorder.start();
this._recognizing = true;
}
stop() {
this._recognizing = false;
this._recorder.stop();
}
recognize() {
return new Promise((resolve, reject) => {
this._recognizeCallback = (transcripts) => {
this._recognizeCallback = this._recognizeCallbackError = null;
resolve(transcripts);
};
this._recognizeCallbackError = (error) => {
this._recognizeCallback = this._recognizeCallbackError = null;
reject(error);
};
this.start();
});
}
set maxTranscripts(_maxTranscripts) {
this._maxTranscripts = _maxTranscripts;
}
set key(_key) {
this._key = _key;
}
_onDataReady(data) {
request(data, {
maxAlternatives: this._maxTranscripts
}, this._key).then((result) => {
let transcripts = result.data.results[0].alternatives.map((alt) => {
return {
transcript: alt.transcript,
confidence: alt.confidence,
};
});
this._recognizeCallback && this._recognizeCallback(transcripts);
}).catch((error) => {
this._onError();
this._recognizeCallbackError && this._recognizeCallbackError(error);
}).finally(() => {
this._recognizing = false;
});
}
_onError() {
this._recognizing = false;
}
}
export const request = (data, config, key) => {
const requestData = data.split(',').slice(-1)[0];
return axios({
method: 'post',
url: 'https://speech.googleapis.com/v1/speech:recognize',
data: {
audio: {
content: requestData,
},
config: {
languageCode: 'en-US',
...config,
}
},
params: {
key,
}
});
};
| 22.235294 | 74 | 0.593034 |
18492be80da2a0d827de4d2891d6f86ae9435bcc | 8,207 | js | JavaScript | src/components/layout/Sidebar.js | sanyamason/ferdi | 999fc4be6a777728cc8753419ae05d2808d6284c | [
"Apache-2.0"
] | null | null | null | src/components/layout/Sidebar.js | sanyamason/ferdi | 999fc4be6a777728cc8753419ae05d2808d6284c | [
"Apache-2.0"
] | null | null | null | src/components/layout/Sidebar.js | sanyamason/ferdi | 999fc4be6a777728cc8753419ae05d2808d6284c | [
"Apache-2.0"
] | null | null | null | import { Component } from 'react';
import PropTypes from 'prop-types';
import ReactTooltip from 'react-tooltip';
import { defineMessages, injectIntl } from 'react-intl';
import { inject, observer } from 'mobx-react';
import { Link } from 'react-router';
import Tabbar from '../services/tabs/Tabbar';
import {
settingsShortcutKey,
lockFerdiShortcutKey,
todosToggleShortcutKey,
workspaceToggleShortcutKey,
addNewServiceShortcutKey,
muteFerdiShortcutKey,
} from '../../environment';
import { todosStore } from '../../features/todos';
import { todoActions } from '../../features/todos/actions';
import AppStore from '../../stores/AppStore';
import SettingsStore from '../../stores/SettingsStore';
import globalMessages from '../../i18n/globalMessages';
const messages = defineMessages({
addNewService: {
id: 'sidebar.addNewService',
defaultMessage: 'Add new service',
},
mute: {
id: 'sidebar.muteApp',
defaultMessage: 'Disable notifications & audio',
},
unmute: {
id: 'sidebar.unmuteApp',
defaultMessage: 'Enable notifications & audio',
},
openWorkspaceDrawer: {
id: 'sidebar.openWorkspaceDrawer',
defaultMessage: 'Open workspace drawer',
},
closeWorkspaceDrawer: {
id: 'sidebar.closeWorkspaceDrawer',
defaultMessage: 'Close workspace drawer',
},
openTodosDrawer: {
id: 'sidebar.openTodosDrawer',
defaultMessage: 'Open Ferdi Todos',
},
closeTodosDrawer: {
id: 'sidebar.closeTodosDrawer',
defaultMessage: 'Close Ferdi Todos',
},
lockFerdi: {
id: 'sidebar.lockFerdi',
defaultMessage: 'Lock Ferdi',
},
});
@inject('stores', 'actions')
@observer
class Sidebar extends Component {
static propTypes = {
openSettings: PropTypes.func.isRequired,
closeSettings: PropTypes.func.isRequired,
setActive: PropTypes.func.isRequired,
reorder: PropTypes.func.isRequired,
reload: PropTypes.func.isRequired,
toggleNotifications: PropTypes.func.isRequired,
toggleAudio: PropTypes.func.isRequired,
toggleDarkMode: PropTypes.func.isRequired,
showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired,
showServiceNameSetting: PropTypes.bool.isRequired,
showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired,
deleteService: PropTypes.func.isRequired,
updateService: PropTypes.func.isRequired,
hibernateService: PropTypes.func.isRequired,
wakeUpService: PropTypes.func.isRequired,
toggleMuteApp: PropTypes.func.isRequired,
isAppMuted: PropTypes.bool.isRequired,
isWorkspaceDrawerOpen: PropTypes.bool.isRequired,
toggleWorkspaceDrawer: PropTypes.func.isRequired,
isTodosServiceActive: PropTypes.bool.isRequired,
stores: PropTypes.shape({
app: PropTypes.instanceOf(AppStore).isRequired,
settings: PropTypes.instanceOf(SettingsStore).isRequired,
}).isRequired,
actions: PropTypes.shape({
settings: PropTypes.instanceOf(SettingsStore).isRequired,
}).isRequired,
};
state = {
tooltipEnabled: true,
};
componentDidUpdate() {
ReactTooltip.rebuild();
}
enableToolTip() {
this.setState({ tooltipEnabled: true });
}
disableToolTip() {
this.setState({ tooltipEnabled: false });
}
updateToolTip() {
this.disableToolTip();
setTimeout(this.enableToolTip.bind(this));
}
render() {
const {
openSettings,
toggleMuteApp,
isAppMuted,
isWorkspaceDrawerOpen,
toggleWorkspaceDrawer,
stores,
actions,
isTodosServiceActive,
} = this.props;
const { intl } = this.props;
const todosToggleMessage = todosStore.isTodosPanelVisible
? messages.closeTodosDrawer
: messages.openTodosDrawer;
const workspaceToggleMessage = isWorkspaceDrawerOpen
? messages.closeWorkspaceDrawer
: messages.openWorkspaceDrawer;
const isLoggedIn = Boolean(localStorage.getItem('authToken'));
return (
<div className="sidebar">
<Tabbar
{...this.props}
enableToolTip={() => this.enableToolTip()}
disableToolTip={() => this.disableToolTip()}
useVerticalStyle={stores.settings.all.app.useVerticalStyle}
/>
{isLoggedIn ? (
<>
{stores.settings.all.app.lockingFeatureEnabled ? (
<button
type="button"
className="sidebar__button"
onClick={() => {
actions.settings.update({
type: 'app',
data: {
locked: true,
},
});
}}
data-tip={`${intl.formatMessage(
messages.lockFerdi,
)} (${lockFerdiShortcutKey(false)})`}
>
<i className="mdi mdi-lock" />
</button>
) : null}
{todosStore.isFeatureEnabledByUser ? (
<button
type="button"
onClick={() => {
todoActions.toggleTodosPanel();
this.updateToolTip();
}}
disabled={isTodosServiceActive}
className={`sidebar__button sidebar__button--todos ${
todosStore.isTodosPanelVisible ? 'is-active' : ''
}`}
data-tip={`${intl.formatMessage(
todosToggleMessage,
)} (${todosToggleShortcutKey(false)})`}
>
<i className="mdi mdi-check-all" />
</button>
) : null}
<button
type="button"
onClick={() => {
toggleWorkspaceDrawer();
this.updateToolTip();
}}
className={`sidebar__button sidebar__button--workspaces ${
isWorkspaceDrawerOpen ? 'is-active' : ''
}`}
data-tip={`${intl.formatMessage(
workspaceToggleMessage,
)} (${workspaceToggleShortcutKey(false)})`}
>
<i className="mdi mdi-view-grid" />
</button>
<button
type="button"
onClick={() => {
toggleMuteApp();
this.updateToolTip();
}}
className={`sidebar__button sidebar__button--audio ${
isAppMuted ? 'is-muted' : ''
}`}
data-tip={`${intl.formatMessage(
isAppMuted ? messages.unmute : messages.mute,
)} (${muteFerdiShortcutKey(false)})`}
>
<i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} />
</button>
<button
type="button"
onClick={() => openSettings({ path: 'recipes' })}
className="sidebar__button sidebar__button--new-service"
data-tip={`${intl.formatMessage(
messages.addNewService,
)} (${addNewServiceShortcutKey(false)})`}
>
<i className="mdi mdi-plus-box" />
</button>
</>
) : (
<Link
to="/auth/welcome"
className="sidebar__button sidebar__button--new-service"
data-tip="Login"
>
<i className="mdi mdi-login-variant" />
</Link>
)}
<button
type="button"
onClick={() => openSettings({ path: 'app' })}
className="sidebar__button sidebar__button--settings"
data-tip={`${intl.formatMessage(
globalMessages.settings,
)} (${settingsShortcutKey(false)})`}
>
<i className="mdi mdi-cog" />
{(this.props.stores.app.updateStatus ===
this.props.stores.app.updateStatusTypes.AVAILABLE ||
this.props.stores.app.updateStatus ===
this.props.stores.app.updateStatusTypes.DOWNLOADED) && (
<span className="update-available">•</span>
)}
</button>
{this.state.tooltipEnabled && (
<ReactTooltip place="right" type="dark" effect="solid" />
)}
</div>
);
}
}
export default injectIntl(Sidebar);
| 32.184314 | 73 | 0.577312 |
1849823c9f3a475730bf54cc8f275551dc145601 | 1,041 | js | JavaScript | _includes/portal/js/views/entity/account.js | ez470/ez470.github.io | 58c2ed561ebb4f422e47c9eb347fd491cf1783e0 | [
"Apache-2.0"
] | null | null | null | _includes/portal/js/views/entity/account.js | ez470/ez470.github.io | 58c2ed561ebb4f422e47c9eb347fd491cf1783e0 | [
"Apache-2.0"
] | 14 | 2015-03-19T15:43:42.000Z | 2015-07-30T18:31:40.000Z | _includes/portal/js/views/entity/account.js | ez470/ez470.github.io | 58c2ed561ebb4f422e47c9eb347fd491cf1783e0 | [
"Apache-2.0"
] | null | null | null | var Backbone = require('backbone');
var _ = require('underscore');
var EntitySearch = require('../../collections/entities');
var AccountRowView = require('./account-row');
module.exports = Backbone.View.extend({
template: require('../../templates/entity/account.jst'),
attachToTemplate: false,
events: {
'click #entity-search': 'entitySearch'
},
initialize: function() {
this.entityCollection = new EntitySearch();
this.listenTo(this.entityCollection, 'add', this.addRow);
this.listenTo(this.entityCollection, 'remove', this.removeSubViewForModel);
},
addRow: function(model) {
this.addSubView({
view: new AccountRowView({model:model, user: this.model}),
selector: 'tbody'
});
},
entitySearch: function(e) {
e.preventDefault();
this.model.set('zipCode', this.$('#zipCode').val());
this.entityCollection
.fetch({
data: {
zipCode: this.model.get('zipCode')
}
})
.done(function(){
this.trigger('resize');
}.bind(this));
}
});
| 23.659091 | 79 | 0.634966 |
1849e4c506802cf21c8bd0827293d07a6fd62099 | 1,641 | js | JavaScript | node_modules/fixed-data-table/internal/getVendorPrefixedName.js | nikhil-ahuja/Express-React | 8cb38f008fd02cf7cf35942a65ec3092d5ee57a1 | [
"Apache-2.0"
] | 319 | 2016-03-01T01:46:45.000Z | 2021-11-16T17:55:28.000Z | node_modules/fixed-data-table/internal/getVendorPrefixedName.js | nikhil-ahuja/Express-React | 8cb38f008fd02cf7cf35942a65ec3092d5ee57a1 | [
"Apache-2.0"
] | 41 | 2015-02-16T18:52:18.000Z | 2016-02-29T22:58:34.000Z | node_modules/fixed-data-table/internal/getVendorPrefixedName.js | nikhil-ahuja/Express-React | 8cb38f008fd02cf7cf35942a65ec3092d5ee57a1 | [
"Apache-2.0"
] | 32 | 2016-03-03T17:03:17.000Z | 2021-11-16T17:56:08.000Z | /**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getVendorPrefixedName
* @typechecks
*/
'use strict';
var ExecutionEnvironment = require('./ExecutionEnvironment');
var camelize = require('./camelize');
var invariant = require('./invariant');
var memoized = {};
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
var prefixRegex = new RegExp('^(' + prefixes.join('|') + ')');
var testStyle = ExecutionEnvironment.canUseDOM ? document.createElement('div').style : {};
function getWithPrefix(name) {
for (var i = 0; i < prefixes.length; i++) {
var prefixedName = prefixes[i] + name;
if (prefixedName in testStyle) {
return prefixedName;
}
}
return null;
}
/**
* @param {string} property Name of a css property to check for.
* @return {?string} property name supported in the browser, or null if not
* supported.
*/
function getVendorPrefixedName(property) {
var name = camelize(property);
if (memoized[name] === undefined) {
var capitalizedName = name.charAt(0).toUpperCase() + name.slice(1);
if (prefixRegex.test(capitalizedName)) {
invariant(false, 'getVendorPrefixedName must only be called with unprefixed' + 'CSS property names. It was called with %s', property);
}
memoized[name] = name in testStyle ? name : getWithPrefix(capitalizedName);
}
return memoized[name];
}
module.exports = getVendorPrefixedName; | 31.557692 | 140 | 0.694089 |
184b0cb2c9afa6483917920ac7138f85b2aa1ec6 | 236 | js | JavaScript | migrations/1635245467-dancers.js | jecihume/pair-up | e1412ad3793404f138eaa95b9eceb4e58964f644 | [
"Apache-2.0"
] | 2 | 2021-11-16T22:20:02.000Z | 2021-11-17T08:55:46.000Z | migrations/1635245467-dancers.js | jecihume/pair-up | e1412ad3793404f138eaa95b9eceb4e58964f644 | [
"Apache-2.0"
] | null | null | null | migrations/1635245467-dancers.js | jecihume/pair-up | e1412ad3793404f138eaa95b9eceb4e58964f644 | [
"Apache-2.0"
] | null | null | null | exports.up = async function up(sql) {
await sql`
CREATE TABLE dancers (
id integer PRIMARY KEY,
role_id integer references roles (id)
);
`;
};
exports.down = async function down(sql) {
await sql`
DROP TABLE dancers;
`;
};
| 15.733333 | 41 | 0.669492 |
184b4b4c71edc429f6bbeb1c1f16eedc377bd13c | 152 | js | JavaScript | src/api/server/index.js | STBGFC/tournament-app | 79b4186b80330176a567b329dc9bb106c19778e7 | [
"MIT"
] | 1 | 2016-02-18T00:30:06.000Z | 2016-02-18T00:30:06.000Z | src/api/server/index.js | STBGFC/tournament-app | 79b4186b80330176a567b329dc9bb106c19778e7 | [
"MIT"
] | 78 | 2015-08-24T20:32:14.000Z | 2019-05-02T16:24:36.000Z | src/api/server/index.js | STBGFC/tournament-app | 79b4186b80330176a567b329dc9bb106c19778e7 | [
"MIT"
] | 2 | 2015-08-24T20:28:49.000Z | 2018-03-28T10:43:14.000Z | import axios from 'axios'
export default {
async fetchResults () {
const response = await axios.get('/results');
return response.data;
}
}
| 16.888889 | 49 | 0.664474 |
184b7e32a2e972ffd11673add537061463766338 | 877 | js | JavaScript | app/scripts/services/Message.js | bumgardnera07/bloc-chat1 | aaa574b9507c7e7b69404b63418206540e50ce07 | [
"Apache-2.0"
] | null | null | null | app/scripts/services/Message.js | bumgardnera07/bloc-chat1 | aaa574b9507c7e7b69404b63418206540e50ce07 | [
"Apache-2.0"
] | null | null | null | app/scripts/services/Message.js | bumgardnera07/bloc-chat1 | aaa574b9507c7e7b69404b63418206540e50ce07 | [
"Apache-2.0"
] | null | null | null | (function() {
function Message($firebaseArray, $cookies, $filter, Room) {
var Message = {};
var ref = firebase.database().ref().child('messages');
var messages = $firebaseArray(ref);
var currenttime = $filter('date')(new Date(),'hh:mm:ss');
Message.all =messages;
Message.currentRoom = Room.currentRoom;
Message.getByRoomId = function(roomId) {
Message.currentMessages = $firebaseArray(ref.orderByChild('roomId').equalTo(roomId));
};
Message.send = function(newMessage) {
messages.$add({
content: newMessage,
roomId: Room.currentRoom.$id,
sentAt: currenttime,
username: $cookies.get('blocChatCurrentUser'),
})
};
return Message;
}
angular
.module('blocChat1')
.factory('Message', ['$firebaseArray', '$cookies', '$filter', 'Room', Message]);
})();
| 25.794118 | 91 | 0.612315 |
184bb08eb4946904ed78738b7590638cb79a79dd | 85 | js | JavaScript | .umirc.js | at358683106/hooks | 8eae32f0ef024452dd44347186f6d25027c5a58a | [
"MIT"
] | 1 | 2021-02-23T05:35:10.000Z | 2021-02-23T05:35:10.000Z | .umirc.js | X-W-beep/hooks | 8eae32f0ef024452dd44347186f6d25027c5a58a | [
"MIT"
] | null | null | null | .umirc.js | X-W-beep/hooks | 8eae32f0ef024452dd44347186f6d25027c5a58a | [
"MIT"
] | 1 | 2021-06-30T09:34:44.000Z | 2021-06-30T09:34:44.000Z | export default {
doc: {
title: 'Shi Heng Hooks',
include: ['src'],
},
};
| 12.142857 | 28 | 0.505882 |
184c3fb8b5a96ada10af4d9e03f261b1b7dd3e9b | 5,290 | js | JavaScript | app/javascript/components/Sidebar.js | cindywu/poster | 2560db7a7d69e64ea52788cf7d45aa7b78f08aab | [
"Apache-2.0",
"MIT"
] | null | null | null | app/javascript/components/Sidebar.js | cindywu/poster | 2560db7a7d69e64ea52788cf7d45aa7b78f08aab | [
"Apache-2.0",
"MIT"
] | null | null | null | app/javascript/components/Sidebar.js | cindywu/poster | 2560db7a7d69e64ea52788cf7d45aa7b78f08aab | [
"Apache-2.0",
"MIT"
] | null | null | null | import React, { useEffect, useRef, useState, useCallback } from 'react'
import { EditorView } from 'prosemirror-view'
import { EditorState } from 'prosemirror-state'
import { math } from './editor-config/math'
import { useEventListener } from '../utils/eventListener'
export function Sidebar(props) {
const OFFSET = '30'
let pageHeight = document.getElementById('root').scrollHeight
let citations = document.getElementsByClassName('citations')[0]
let backlinks = document.getElementsByClassName('backlinks')[0]
if (citations) {
pageHeight = pageHeight - citations.offsetHeight
}
if (backlinks) {
pageHeight = pageHeight - backlinks.offsetHeight
}
const vpHeight = window.innerHeight
const viewHost = useRef()
const view = useRef(null)
const [portalTop, setPortalTop] = useState('0px')
const [editorContainerHeight, setEditorContainerHeight] = useState(0)
const [sidebarEditorTop, setSidebarEditorTop] = useState(0)
const [portalHeight, setPortalHeight] = useState(0)
const [visible, setVisible] = useState(true)
const [sticky, setSticky] = useState(false)
const [mastheadHeight, setMastheadHeight] = useState(0)
const calculateEditorPosition = useCallback(
(sticky, vp, ech) => {
let calcTop
if (vp < ech) {
calcTop = Math.floor((window.scrollY / pageHeight) * -100 - 100)
} else {
calcTop = 'auto'
}
return sticky ? calcTop : 'auto'
},
[pageHeight]
)
const reposition = useCallback(
(vpHeight) => {
setSticky(window.scrollY >= mastheadHeight ? true : false)
let ech
if (viewHost.current) {
ech = viewHost.current.clientHeight
}
setEditorContainerHeight(vpHeight > ech ? ech : vpHeight * 0.8)
setSidebarEditorTop(calculateEditorPosition(sticky, vpHeight, ech))
let pHeight = (vpHeight / pageHeight) * ech
setPortalHeight(pHeight)
},
[mastheadHeight, calculateEditorPosition, sticky, pageHeight]
)
// initial render
useEffect(() => {
view.current = new EditorView(viewHost.current, {
state: EditorState.create({
plugins: [math()],
...props.options,
}),
editable: function (state) {
return false
},
})
if (viewHost.current) {
let editorHeight = viewHost.current.clientHeight
let pHeight = (vpHeight / pageHeight) * editorHeight
setPortalHeight(pHeight)
const mh = document.getElementsByClassName('masthead')[0]
setMastheadHeight(mh.offsetHeight + mh.offsetTop)
}
return () => view.current.destroy()
}, [pageHeight, props, visible, vpHeight])
// every render
useEffect(() => {
reposition(vpHeight)
}, [props, vpHeight, sticky, pageHeight, mastheadHeight, reposition])
// on scroll
const scrollHandler = useCallback(() => {
reposition(vpHeight)
setPortalTop(Math.floor((window.scrollY / pageHeight) * 100) + '%')
}, [pageHeight, reposition, vpHeight])
useEventListener('resize', scrollHandler)
useEventListener('scroll', scrollHandler)
const clickHandler = (e) => {
const coord = (eventCoord) => {
return (
((eventCoord - Math.floor(portalHeight * 0.5)) /
editorContainerHeight) *
pageHeight
)
}
const scrollToCoords = (event) => {
window.scrollTo({
left: coord(event.layerX),
top: coord(event.layerY),
behavior: 'smooth',
})
}
scrollToCoords(e)
}
useEventListener('mousedown', clickHandler, viewHost.current)
let container = {
position: 'sticky',
top: sticky ? OFFSET + 'px' : 'auto',
height: '100%',
width: '110px',
}
let toggleIconStyle = {
position: sticky ? 'sticky' : 'relative',
top: sticky ? '4px' : '24px',
outline: 'none',
}
let editorContainerStyle = {
position: sticky ? 'sticky' : 'relative',
top: '30px',
height: editorContainerHeight + 'px',
width: '120px',
overflow: 'hidden',
}
let sidebarEditorStyle = {
position: 'relative',
top: sticky ? sidebarEditorTop + 'px' : 'auto',
display: visible ? 'block' : 'none',
width: '110px',
background: 'white',
transition: 'all 0.15s linear',
}
let sidebarPortalStyle = {
position: 'absolute',
top: portalTop,
height: portalHeight + 'px',
width: '110px',
zIndex: 33,
background: 'rgba(0,0,0,0.1)',
display: visible ? 'block' : 'none',
cursor: 'move !important',
transition: 'all 0.2s linear',
pointerEvents: 'none',
}
return (
<div id="sidebarContainer" style={container}>
<i
id="sidebarToggle"
style={toggleIconStyle}
className={visible ? 'fa fa-caret-down' : 'fa fa-caret-down rotate'}
onClick={() => setVisible(!visible)}
onKeyDown={() => setVisible(!visible)}
aria-checked={visible}
role="switch"
tabIndex={0}
/>
{visible && (
<div className="sidebarEditorContainer" style={editorContainerStyle}>
<div
id="sidebarEditor"
ref={viewHost}
style={sidebarEditorStyle}
className="animated fadeIn"
/>
<div className="sidebarPortal" style={sidebarPortalStyle} />
</div>
)}
</div>
)
}
| 27.989418 | 77 | 0.625709 |
184c5801d1c758f5c9c066b982a063fc14af2b2f | 74,022 | js | JavaScript | node_modules/@vuedx/analyze/dist/index.esm.js | Aquariuslife/dapTest2 | 67b46631c58df3859cd2ad0bcf3632e785c03a71 | [
"MIT"
] | null | null | null | node_modules/@vuedx/analyze/dist/index.esm.js | Aquariuslife/dapTest2 | 67b46631c58df3859cd2ad0bcf3632e785c03a71 | [
"MIT"
] | null | null | null | node_modules/@vuedx/analyze/dist/index.esm.js | Aquariuslife/dapTest2 | 67b46631c58df3859cd2ad0bcf3632e785c03a71 | [
"MIT"
] | null | null | null | import { parse } from '@vuedx/compiler-sfc';
import Path from 'path';
import { parse as parse$1 } from '@babel/parser';
import traverse, { NodePath } from '@babel/traverse';
import T, { traverseFast, isIdentifier, isExportSpecifier, isObjectProperty, isObjectExpression, isStringLiteral, cloneNode, isTSTypeAliasDeclaration, isTSInterfaceDeclaration, isBooleanLiteral, isObjectPattern, isBlockStatement, isReturnStatement, isObjectMember, identifier, isExpressionStatement, isArrowFunctionExpression, isFunctionExpression, isStatement, expressionStatement, isMemberExpression, returnStatement, arrowFunctionExpression, blockStatement, functionExpression } from '@babel/types';
import generate from '@babel/generator';
import { parse as parse$2 } from '@vuedx/compiler-tsx';
import { traverse as traverse$1, isSimpleExpressionNode, isDirectiveNode } from '@vuedx/template-ast-types';
import micromatch from 'micromatch';
function isNotNull(value) {
return value != null;
}
const cacheStringFunction = (fn) => {
const cache = Object.create(null);
return ((str) => {
const hit = cache[str];
return hit !== null && hit !== void 0 ? hit : (cache[str] = fn(str));
});
};
const camelizeRE = /[^A-Za-z0-9]+([A-Za-z0-9])/g;
const camelize = cacheStringFunction((str) => {
return uncapitalize(str.replace(camelizeRE, (_, c) => typeof c === 'string' ? c.toUpperCase() : ''));
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction((str) => {
return camelize(str).replace(hyphenateRE, '-$1').toLowerCase();
});
const capitalize = cacheStringFunction((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
const uncapitalize = cacheStringFunction((str) => {
return str.charAt(0).toLowerCase() + str.slice(1);
});
const pascalCase = cacheStringFunction((str) => capitalize(camelize(str)));
const kebabCase = hyphenate;
function isKebabCase(str) {
return str.includes('-');
}
function isPascalCase(str) {
return /^[A-Z][A-Za-z0-9]*$/.test(str);
}
function getComponentName(fileName) {
return pascalCase(Path.posix.basename(fileName).replace(/\.(vue|ts|tsx|js|jsx)$/, ''));
}
function getComponentNameAliases(fileNameOrComponentName) {
const name = Path.posix
.basename(fileNameOrComponentName)
.replace(/\.(vue|ts|tsx|js|jsx)$/, '');
return isKebabCase(name)
? [kebabCase(name)]
: [kebabCase(name), pascalCase(name)];
}
function createComponentInfoFactory(fileName) {
const component = {
name: getComponentName(fileName),
aliases: getComponentNameAliases(fileName),
fileName,
description: '',
tags: [],
props: [],
emits: [],
components: [],
errors: [],
identifierSource: {},
};
const factory = {
addError(message, loc) {
component.errors.push({ message, loc });
return factory;
},
addIdentifier(id, name, loc) {
// TODO: Add error handling here
component.identifierSource[id] = { name, loc };
},
addProp(name, options = {}) {
const index = component.props.findIndex((prop) => prop.name === name);
if (options.loc != null) {
factory.addIdentifier(name, 'props', options.loc);
}
if (index >= 0) {
const prop = component.props[index];
Object.assign(prop, { name, ...options });
}
else {
component.props.push({
name,
tags: [],
description: '',
required: false,
type: [{ kind: 'expression', imports: [], expression: 'any' }],
defaultValue: null,
loc: null,
...options,
});
}
return factory;
},
addEmit(name, options = {}) {
const index = component.emits.findIndex((emit) => emit.name === name);
if (index >= 0) {
const emit = component.emits[index];
if (options.isInferred === true) {
if (options.loc != null) {
options.references = emit.references;
options.references.push(options.loc);
}
if (options.type != null) {
const expressions = new Set(options.type.map((type) => type.kind === 'expression' ? type.expression : ''));
emit.type.forEach((type) => {
var _a;
if (type.kind === 'expression') {
if (!expressions.has(type.kind)) {
(_a = options.type) === null || _a === void 0 ? void 0 : _a.push(type);
}
}
});
}
}
Object.assign(emit, { name, ...options });
}
else {
component.emits.push({
name,
tags: [],
description: '',
type: [
{
kind: 'expression',
imports: [],
expression: '(event?: any) => void',
},
],
loc: null,
references: options.isInferred === true && options.loc != null
? [options.loc]
: [],
isInferred: false,
isDynamic: false,
...options,
});
}
return factory;
},
addLocalComponent(name, source, loc = null, kind = 'script') {
const aliases = isPascalCase(name) ? [name, kebabCase(name)] : [name];
component.components.push({ name, aliases, kind, source, loc });
return factory;
},
addOption(name, address) {
if (name === '') {
component.options = {
properties: {},
...component.options,
...address,
};
}
else {
if (component.options == null)
throw new Error('Cannot set option location without setting options');
component.options.properties[name] = address;
}
return factory;
},
addSetup(name, address) {
if (name === '') {
component.fnSetupOption = {
...address,
};
}
else {
if (component.fnSetupOption == null)
throw new Error('Cannot set setup params location without setting setup');
component.fnSetupOption[name] = address;
}
return factory;
},
addScriptSetup(name, address) {
if (component.scriptSetup == null) {
component.scriptSetup = {};
}
component.scriptSetup[name] = address;
return factory;
},
info() {
return component;
},
};
return factory;
}
const parsers = {
sfc: {
sourceMap: false,
pad: 'space',
},
babel: {
sourceType: 'module',
plugins: [
'bigInt',
'optionalChaining',
'optionalCatchBinding',
'nullishCoalescingOperator',
'objectRestSpread',
],
},
};
function createAnalyzer(plugins, options = {}) {
function createContext(fileName, content, localOptions) {
const { descriptor } = parse(content, {
...parsers.sfc,
...options.sfc,
...localOptions,
filename: fileName,
});
return {
fileName,
component: createComponentInfoFactory(fileName),
descriptor,
plugins,
parsers: {
sfc: { ...parsers.sfc, ...options.sfc, ...localOptions },
babel: { ...parsers.babel, ...options.babel },
},
};
}
function analyze(content, fileName = 'anonymous.vue') {
const context = createContext(fileName, content, {});
processSFC(context);
return context.component.info();
}
function analyzeBlockText(content, fileName = 'anonymous.vue') {
const context = createContext(fileName, content, {});
processSFC(context);
return context.component.info();
}
function analyzeScript(content, fileName = 'anonymous.js', mode = 'script') {
const ext = Path.posix.extname(fileName);
return analyzeBlockText(`<script lang="${ext.substr(1)}" ${mode === 'scriptSetup' ? 'setup' : ''}>${content}</script>`, fileName.substr(0, fileName.length - ext.length) + '.vue');
}
function analyzeTemplate(content, fileName = 'anonymous.html') {
const ext = Path.posix.extname(fileName);
return analyzeBlockText(`<template>${content}</template>`, fileName.substr(0, fileName.length - ext.length) + '.vue');
}
return { analyze, analyzeScript, analyzeTemplate };
}
function processSFC(context) {
const { script, scriptSetup, template, styles, customBlocks, } = context.descriptor;
function call(block) {
const kind = block.type;
context.plugins.forEach(({ blocks }) => {
if (blocks != null && kind in blocks) {
blocks[kind](block, context);
}
});
}
if (scriptSetup != null)
call(scriptSetup);
else if (script != null)
call(script);
if (template != null)
call(template);
styles.forEach(call);
customBlocks.forEach((block) => call(block));
}
function createPlugin(options) {
return options;
}
function createSourceRange(context, node) {
if (node.start == null || node.end == null || node.loc == null) {
return {
source: '',
start: { offset: 0, line: 0, column: 0 },
end: { offset: 0, line: 0, column: 0 },
};
}
else {
const source = 'source' in context ? context.source : context.descriptor.source;
return {
source: source.substring(node.start, node.end),
start: {
offset: node.start,
line: node.loc.start.line,
column: node.loc.start.column,
},
end: {
offset: node.end,
line: node.loc.end.line,
column: node.loc.end.column,
},
};
}
}
const ScriptBlockAnalyzer = createPlugin({
blocks: {
script: (block, ctx) => {
if (block.src == null) {
try {
processScript(createScriptContext(block.content, ctx, block));
}
catch (error) {
console.error(error);
}
}
},
},
});
function createScriptContext(content, context, block) {
const script = block !== null && block !== void 0 ? block : {
type: 'script',
content: content,
setup: false,
attrs: {},
// TODO: Create loc object as if javascript file.
loc: {
start: { offset: 0, line: 1, column: 1 },
end: { offset: 0, line: 1, column: 1 },
source: content,
},
};
const { ast } = parseJS(context, content, script.lang === 'ts');
return {
...context,
mode: script.setup != null ? 'setup' : 'module',
ast: ast,
source: content,
block: script,
};
}
function parseJS(context, content, enableTS, offset = 0) {
var _a, _b;
let result;
if (context.parsers.typescript != null) {
result = context.parsers.typescript(context.fileName, content, {
language: enableTS ? 'ts' : 'js',
});
}
else {
const plugins = (_b = (_a = context.parsers.babel.plugins) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
if (enableTS && !plugins.includes('typescript')) {
plugins.push('typescript');
}
const ast = parse$1(content, {
...context.parsers.babel,
plugins: Array.from(new Set(plugins)),
ranges: true,
// @ts-expect-error
errorRecovery: true,
});
result = { ast };
}
if (offset !== 0 && Number.isInteger(offset)) {
traverseFast(result.ast, (node) => {
const n = node;
n.start += offset;
n.end += offset;
});
}
return result;
}
function processScript(context) {
var _a, _b;
// @ts-expect-error
if (((_b = (_a = context.ast.errors) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {
// @ts-expect-error
context.ast.errors.forEach((error) => context.component.addError(error.message, {
...error.loc,
offset: error.pos,
}));
return;
}
const enterHandlers = context.plugins
.map((plugin) => {
if (plugin.babel != null) {
if (typeof plugin.babel === 'function') {
return plugin.babel;
}
else if ('enter' in plugin.babel) {
return plugin.babel.enter;
}
}
})
.filter(isNotNull);
const exitHandlers = context.plugins
.map((plugin) => {
if (plugin.babel != null && 'exit' in plugin.babel) {
return plugin.babel.exit;
}
})
.filter(isNotNull);
const setupHandlers = context.plugins
.map((plugin) => plugin.setup)
.filter(isNotNull)
.flat();
const optionsHandlers = context.plugins
.map((plugin) => (Array.isArray(plugin.options) ? plugin.options : null))
.filter(isNotNull)
.flat();
const optionsByNameHandlers = context.plugins
.map((plugin) => (Array.isArray(plugin.options) ? null : plugin.options))
.filter(isNotNull);
const declarationHandlers = context.plugins
.map((plugin) => plugin.declaration)
.filter(isNotNull)
.flat();
function call(fns, node) {
fns.forEach((fn) => {
try {
fn(node, context);
}
catch (error) {
console.error(error);
// TODO: Handle error.
}
});
}
function processOptions(options$) {
const properties$ = options$.get('properties');
context.component.addOption('', {
loc: createSourceRange(context, options$.node),
});
properties$.forEach((property$) => {
if (property$.isObjectMember()) {
const { key } = property$.node;
if (isIdentifier(key)) {
const name = key.name;
context.component.addOption(name, {
loc: createSourceRange(context, property$.isObjectProperty()
? property$.node.value
: property$.node),
});
optionsByNameHandlers.forEach((options) => {
const fn = options[name];
if (fn != null) {
try {
fn(property$, context);
}
catch (error) {
console.error(error);
// TODO: Handler error.
}
}
});
if (name === 'setup') {
if (property$.isObjectMethod()) {
context.component.addSetup('', {
loc: createSourceRange(context, property$.node),
});
call(setupHandlers, property$);
}
else if (property$.isObjectProperty()) {
const value$ = property$.get('value');
if (value$.isFunctionExpression() ||
value$.isArrowFunctionExpression()) {
context.component.addSetup('', {
loc: createSourceRange(context, value$.node),
});
call(setupHandlers, value$);
}
}
}
}
}
});
}
traverse(context.ast, {
enter(path) {
call(enterHandlers, path);
},
exit(path) {
call(exitHandlers, path);
},
CallExpression(path) {
const callee$ = path.get('callee');
const args$ = path.get('arguments');
if (callee$.isIdentifier()) {
const options$ = args$[0];
if (callee$.node.name === 'defineProps') {
context.component.addScriptSetup('defineProps', {
loc: createSourceRange(context, path.node),
});
optionsByNameHandlers.forEach((handlers) => {
const fn = handlers.props;
if (fn != null) {
try {
fn(options$, context);
}
catch (error) {
console.error(error);
// TODO: Handle error
}
}
});
}
else if (callee$.node.name === 'defineEmit') {
context.component.addScriptSetup('defineEmit', {
loc: createSourceRange(context, path.node),
});
optionsByNameHandlers.forEach((handlers) => {
const fn = handlers.emits;
if (fn != null) {
try {
fn(options$, context);
}
catch (error) {
console.error(error);
// TODO: Handle error
}
}
});
}
}
},
ExportDefaultDeclaration(path) {
const d$ = path.get('declaration');
/**
* Matches:
* export default {}
*/
if (d$.isObjectExpression()) {
const declaration$ = d$;
call(declarationHandlers, declaration$);
call(optionsHandlers, declaration$);
processOptions(declaration$);
}
else if (d$.isCallExpression()) {
const declaration$ = d$;
/**
* Matches:
* export default fn(...)
*/
const { callee } = declaration$.node;
const args$ = declaration$.get('arguments');
const options$ = (Array.isArray(args$)
? args$[0]
: args$);
/**
* Matches:
* export default defineComponent(...)
*/
if (isIdentifier(callee) && callee.name === 'defineComponent') {
if (options$.isObjectExpression()) {
/**
* Matches:
* export default defineComponent({ ... })
*/
call(declarationHandlers, declaration$);
call(optionsHandlers, options$);
processOptions(options$);
}
else if (options$.isArrowFunctionExpression() ||
options$.isFunctionExpression()) {
context.component.addSetup('', {
loc: createSourceRange(context, options$.node),
});
/**
* Matches:
* export default defineComponent(() => {...})
* export default defineComponent(function setup() {...})
*/
call(setupHandlers, options$);
}
}
}
},
});
}
const ScriptIdentifierSourceAnalyzer = createPlugin({
babel(node$, context) {
if (context.mode !== 'setup')
return;
const node = node$.node;
if (T.isProgram(node)) {
const register = (node, kind) => {
if (T.isIdentifier(node)) {
context.component.addIdentifier(node.name, `scriptSetup:${kind}`, createSourceRange(context, node));
}
else if (T.isObjectPattern(node)) {
node.properties.forEach((property) => {
if (T.isObjectProperty(property)) {
register(property.key, kind);
}
else {
register(property.argument, kind);
}
});
}
else if (T.isArrayPattern(node)) {
node.elements.forEach((element) => {
if (T.isRestElement(element)) {
register(element.argument, kind);
}
else if (T.isAssignmentPattern(element)) {
register(element.left, kind);
}
else if (element != null) {
register(element, kind);
}
});
}
else if (T.isMemberExpression(node)) {
register(node.object, kind);
}
};
const processStatement = (statement) => {
if (T.isLabeledStatement(statement)) {
if (statement.label.name === 'ref') {
if (T.isExpressionStatement(statement.body)) {
if (T.isAssignmentExpression(statement.body.expression)) {
register(statement.body.expression.left, 'refLabel');
}
}
}
}
else if (T.isVariableDeclaration(statement)) {
statement.declarations.forEach(({ id }) => {
register(id, 'value');
});
}
else if (T.isFunctionDeclaration(statement)) {
if (statement.id != null) {
register(statement.id, 'function');
}
}
};
node.body.forEach(processStatement);
}
},
options: {
data(property$, context) {
setIdentifiersSource(property$.node, 'data', context);
},
setup(property$, context) {
setIdentifiersSource(property$.node, 'setup', context);
},
computed(property$, context) {
setIdentifiersSource(property$.node, 'computed', context);
},
methods(property$, context) {
setIdentifiersSource(property$.node, 'methods', context);
},
inject(property$, context) {
setIdentifiersSource(property$.node, 'inject', context, [
'object',
'array',
]);
},
},
});
function setIdentifiersSource(node, source, context, allowedTypes = ['object']) {
const register = (obj) => {
if (allowedTypes.includes('object') && T.isObjectExpression(obj)) {
obj.properties.forEach((property) => {
if (T.isObjectMember(property)) {
if (T.isIdentifier(property.key)) {
context.component.addIdentifier(property.key.name, source, createSourceRange(context, property.key));
}
}
});
}
else if (allowedTypes.includes('array') && T.isArrayExpression(obj)) {
obj.elements.forEach((element) => {
if (T.isStringLiteral(element)) {
context.component.addIdentifier(element.value, source, createSourceRange(context, element));
}
});
}
};
if (T.isObjectProperty(node)) {
if (T.isObjectExpression(node.value) || T.isArrayExpression(node.value)) {
register(node.value);
}
else if (T.isFunctionExpression(node.value) ||
T.isArrowFunctionExpression(node.value)) {
register(getReturnExpression(node.value));
}
}
else {
register(getReturnExpression(node));
}
}
function getReturnExpression(node) {
var _a, _b;
if (T.isBlockStatement(node.body)) {
return ((_b = (_a = node.body.body.find((node) => T.isReturnStatement(node))) === null || _a === void 0 ? void 0 : _a.argument) !== null && _b !== void 0 ? _b : undefined);
}
else if (T.isExpression(node.body)) {
return node.body;
}
}
const ComponentsOptionAnalyzer = createPlugin({
babel: (path$, ctx) => {
var _a;
if (path$.isExportNamedDeclaration()) {
const node = path$.node;
if (((_a = node.source) === null || _a === void 0 ? void 0 : _a.value.endsWith('.vue')) === true) {
const specifier = node.specifiers.find((specifier) => isExportSpecifier(specifier) &&
isIdentifier(specifier.local) &&
specifier.local.name === 'default');
if (specifier != null) {
const name = getComponentName$1(specifier.exported);
ctx.component.addLocalComponent(name, {
moduleName: node.source.value,
localName: name,
loc: createSourceRange(ctx, node),
}, createSourceRange(ctx, node));
}
}
}
},
options: {
components: (path$, ctx) => {
const property = path$.node;
if (isObjectProperty(property)) {
const { value: components } = property;
if (isObjectExpression(components)) {
components.properties.forEach((declaration) => {
if (isObjectProperty(declaration)) {
const name = getComponentName$1(declaration.key);
if (name != null) {
if (isIdentifier(declaration.value)) {
const info = resolveComponentInformation(path$.scope.getBinding(declaration.value.name), ctx);
if (info != null) {
ctx.component.addLocalComponent(name, info, createSourceRange(ctx, declaration));
}
}
}
}
});
}
}
},
},
});
function getComponentName$1(key) {
if (isIdentifier(key))
return key.name;
if (isStringLiteral(key))
return key.value;
}
function resolveComponentInformation(binding, context) {
if (binding == null)
return;
switch (binding.kind) {
case 'module':
{
const path$ = binding.path;
if (path$.isImportDefaultSpecifier()) {
const node = path$.node;
const parent = path$.parent;
return {
moduleName: parent.source.value,
localName: node.local.name,
loc: createSourceRange(context, parent),
};
}
else if (path$.isImportSpecifier()) {
const node = path$.node;
const parent = path$.parent;
return {
moduleName: parent.source.value,
exportName: isStringLiteral(node.imported)
? node.imported.value
: node.imported.name,
localName: node.local.name,
loc: createSourceRange(context, parent),
};
}
}
break;
}
}
function getTypeAnnotation(node$, context) {
try {
const imports = [];
const identifiers = {};
const processed = new Set();
const collect = (name$) => {
const name = name$.node.name;
if (processed.has(name))
return;
const source = getIdentifierSource(name$, context);
const inline = source.filter((item) => typeof item === 'string');
processed.add(name);
if (inline.length > 0)
identifiers[name] = inline;
source.forEach((item) => {
if (typeof item === 'object') {
imports.push(item);
}
});
};
traverse(node$.node, {
TSTypeReference(type$) {
const typeName$ = type$.get('typeName');
if (typeName$.isIdentifier()) {
collect(typeName$);
}
else if (typeName$.isTSQualifiedName()) {
const left$ = typeName$.get('left');
if (left$.isIdentifier()) {
collect(left$);
}
}
},
}, node$.scope, null, node$.parentPath);
const node = cloneNode(node$.isTSInterfaceDeclaration()
? node$.node.body
: node$.node.typeAnnotation);
const knownImports = new Set(imports.map((i) => i.localName));
traverseFast(node, (node) => {
if (isIdentifier(node) && !knownImports.has(node.name)) {
const identifier = identifiers[node.name];
if (identifier != null) {
if (identifier.length === 1) {
node.name = `(${identifier[0]})`;
}
else if (identifier.length > 1) {
node.name = `(${identifier.map((id) => `(${id})`).join(' & ')})`;
}
}
}
});
// TODO: Inline unresolved identifiers, before generating.
const type = stringifyBabelNode(node);
return { type, imports };
}
catch (error) {
console.error(error);
return { type: 'any', imports: [] };
}
}
function stringifyBabelNode(node) {
return generate(node, {
sourceMaps: false,
concise: true,
}).code;
}
function getIdentifierSource(name$, context) {
const name = name$.node.name;
const binding = name$.scope.getBinding(name);
const result = [];
if (binding != null) {
const node$ = binding.path;
if (node$.isImportDefaultSpecifier() || node$.isImportSpecifier()) {
const parent$ = node$.parentPath;
const statement = parent$.node;
const moduleName = statement.source.value;
const localName = name;
const importSource = { moduleName, localName };
if (node$.isImportDefaultSpecifier()) {
result.push(importSource);
}
else if (node$.isImportSpecifier()) {
const imported$ = node$.get('imported');
importSource.exportName = imported$.isIdentifier()
? imported$.node.name
: imported$.isStringLiteral()
? imported$.node.value
: undefined; // Should not ever happen.
result.push(importSource);
}
}
}
else if ('ast' in context) {
traverse(context.ast, {
ExportNamedDeclaration(statement$) {
if (context.mode !== 'setup') {
const statement = statement$.node;
if (statement.specifiers.length > 0) {
const specifier = statement.specifiers.find((specifier) => isExportSpecifier(specifier) &&
(isIdentifier(specifier.exported)
? specifier.exported.name === name
: specifier.exported.value === name));
if (specifier != null) {
result.push({
moduleName: context.fileName,
localName: name,
exportName: name,
});
}
}
else if (isTSTypeAliasDeclaration(statement.declaration) ||
isTSInterfaceDeclaration(statement.declaration)) {
if (statement.declaration.id.name === name) {
result.push({
moduleName: context.fileName,
localName: name,
exportName: name,
});
}
}
}
},
TSTypeAliasDeclaration(statement$) {
if (statement$.node.id.name === name) {
if (statement$.node.typeParameters == null) {
// No generics.
const raw = getTypeAnnotation(statement$, context);
result.push(raw.type, ...raw.imports);
}
}
},
TSInterfaceDeclaration(statement$) {
if (statement$.node.id.name === name) {
if (statement$.node.typeParameters == null) {
// No generics
const raw = getTypeAnnotation(statement$, context);
result.push(raw.type, ...raw.imports);
}
// TODO: Handle extends
}
},
});
}
return result;
}
function inferType(node$) {
if (node$.isStringLiteral()) {
return 'string';
}
else if (node$.isNumericLiteral()) {
return 'number';
}
else if (node$.isBooleanLiteral()) {
return 'boolean';
}
else if (node$.isArrayExpression()) {
const elements$ = node$.get('elements');
return `[${elements$.map(inferType).join(',')}]`;
}
else {
return 'any';
}
}
const EmitsOptionsAnalyzer = createPlugin({
options: {
emits(node$, context) {
const emits$ = node$.isObjectProperty()
? node$.get('value')
: node$;
if (emits$.isObjectExpression()) {
const properties$ = emits$.get('properties');
properties$.forEach((property$) => {
const key$ = property$.get('key');
if (key$.isIdentifier()) {
const name = key$.node.name;
context.component.addEmit(name, {
loc: createSourceRange(context, property$.node),
});
if (property$.isObjectMethod()) {
const params$ = property$.get('params');
const type = getTypeInfo(params$, context);
if (type != null)
context.component.addEmit(name, { type });
}
else if (property$.isObjectProperty()) {
const value$ = property$.get('value');
if (value$.isFunctionExpression() ||
value$.isArrowFunctionExpression()) {
const params$ = value$.get('params');
const type = getTypeInfo(params$, context);
if (type != null)
context.component.addEmit(name, { type });
}
}
}
});
}
else if (emits$.isArrayExpression()) {
emits$.node.elements.forEach((element) => {
if (isStringLiteral(element)) {
context.component.addEmit(element.value, {
loc: createSourceRange(context, element),
});
}
});
}
},
},
});
const ImplicitEmitsAnalyzer = createPlugin({
options: [
(node$, context) => {
if (context.mode === 'setup')
return; // No $emit() in <script setup>
if (node$.get('properties').some((property$) => {
if (property$.isObjectProperty()) {
const key$ = property$.get('key');
if (key$.isIdentifier()) {
return key$.node.name === 'emits';
}
}
})) {
return; // emits option is defined
}
processInferredEmits(node$, context);
},
],
templateExpression: (node$, context) => {
var _a, _b;
const info = context.component.info(); // script is already processed at this point
if (((_a = info.options) === null || _a === void 0 ? void 0 : _a.properties.emits) != null)
return; // Explicit emits
if (((_b = info.scriptSetup) === null || _b === void 0 ? void 0 : _b.defineEmit) != null)
return; // Explicit emits
processInferredEmits(node$, context, true);
},
});
function processInferredEmits(node$, context, inTemplate = false) {
const { node, scope, parentPath } = node$ instanceof NodePath ? node$ : { node: node$ };
traverse(node, {
CallExpression(node$) {
const callee$ = node$.get('callee');
const args$ = node$.get('arguments');
if (args$.length === 0)
return;
if (callee$.isMemberExpression()) {
const object$ = callee$.get('object');
const property$ = callee$.get('property');
if (object$.isThisExpression() &&
property$.isIdentifier() &&
property$.node.name === '$emit') ;
else {
return;
}
}
else if (inTemplate &&
callee$.isIdentifier() &&
callee$.node.name === '$emit') ;
else {
return;
}
const event$ = args$.shift();
const type = getTypeInfo(args$, context, false);
if (event$.isStringLiteral()) {
const name = event$.node.value;
context.component.addEmit(name, {
loc: createSourceRange(context, node$.node),
type,
isInferred: true,
});
}
else {
const name = stringifyBabelNode(event$.node);
context.component.addEmit(name, {
loc: createSourceRange(context, node$.node),
type,
isInferred: true,
isDynamic: true,
});
}
},
}, scope, null, parentPath);
}
function getTypeInfo(params$, context, inFunctionParams = true) {
if (params$.length === 0) {
return [{ kind: 'expression', imports: [], expression: '() => void' }];
}
else {
const imports = [];
const types = params$.map((param$, index) => {
let type = 'any';
if ('sourceFile' in context && context.sourceFile != null) ;
const name = inFunctionParams && param$.isIdentifier()
? param$.node.name
: `arg${index}`;
const optional = param$.node.optional === true ? '?' : '';
if (param$.has('typeAnnotation')) {
const result = param$.isTSAsExpression()
? getTypeAnnotation(param$, context)
: getTypeAnnotation(param$.get('typeAnnotation'), context);
type = result.type;
imports.push(...result.imports);
}
else if (!inFunctionParams) {
type = inferType(param$);
}
return `${name}${optional}: ${type}`;
});
const imported = new Set();
return [
{
kind: 'expression',
imports: imports.filter((source) => {
try {
return !imported.has(source.localName);
}
finally {
imported.add(source.localName);
}
}),
expression: `(${types.join(', ')}) => void`,
},
];
}
}
const PropsOptionsAnalyzer = createPlugin({
options: {
props(property$, context) {
const props$ = property$.isObjectProperty()
? property$.get('value')
: property$;
if (props$.isObjectExpression()) {
props$.get('properties').forEach((property$) => {
if (property$.isObjectProperty()) {
const key$ = property$.get('key');
const value$ = property$.get('value');
if (key$.isIdentifier()) {
const name = key$.node.name;
context.component.addProp(name, {
loc: createSourceRange(context, property$.node),
});
if (value$.isIdentifier()) {
const type = getTypeInfo$1(value$);
if (type != null)
context.component.addProp(name, { type });
}
else if (value$.isArrayExpression()) {
const type = getTypeInfo$1(value$);
if (type != null)
context.component.addProp(name, { type });
}
else if (value$.isObjectExpression()) {
const options = toObjectExpressionMap(value$);
const info = {};
if (options.required != null) {
const node = options.required.node;
info.required =
isObjectProperty(node) &&
isBooleanLiteral(node.value) &&
node.value.value;
}
if (options.type != null) {
info.type = getTypeInfo$1(options.type.get('value'));
}
context.component.addProp(name, info);
}
}
}
});
}
else if (props$.isArrayExpression()) {
props$.node.elements.forEach((element) => {
if (isStringLiteral(element)) {
context.component.addProp(element.value, {
loc: createSourceRange(context, element),
});
}
});
}
},
},
});
function getTypeInfo$1(path$) {
if (path$.isIdentifier()) {
switch (path$.node.name) {
case 'String':
return [{ kind: 'string' }];
case 'Number':
return [{ kind: 'number' }];
case 'Boolean':
return [{ kind: 'boolean' }];
case 'Object':
case 'Symbol':
return [
{
kind: 'expression',
imports: [],
expression: path$.node.name.toLowerCase(),
},
];
case 'Array':
return [{ kind: 'expression', imports: [], expression: 'any[]' }];
}
}
else if (path$.isArrayExpression()) {
return path$.get('elements')
.filter((element$) => element$.isIdentifier())
.map(getTypeInfo$1)
.filter(isNotNull)
.flat();
}
else if (path$.isTSAsExpression()) {
return [
{
kind: 'expression',
imports: [],
expression: generate(path$.node.typeAnnotation, { sourceMaps: false })
.code,
},
];
}
}
function toObjectExpressionMap(path$) {
const map = {};
if (path$.isObjectExpression()) {
path$.get('properties').forEach((property$) => {
if (property$.isObjectMember()) {
const key = property$.node.key;
if (isIdentifier(key)) {
map[key.name] = property$;
}
}
});
}
return map;
}
const SetupOptionsAnalyzer = createPlugin({
setup: [
(node$, context) => {
const { node } = node$;
const [props, setupContext] = node.params;
if (props != null) {
let rest;
const identifiers = [];
if (isObjectPattern(props)) {
props.properties.forEach((prop) => {
if (isObjectProperty(prop)) {
if (isIdentifier(prop.value)) {
identifiers.push(prop.value.name);
}
}
else {
if (isIdentifier(prop.argument)) {
rest = prop.argument.name;
}
}
});
}
else if (isIdentifier(props)) {
rest = props.name;
}
context.component.addSetup('props', {
identifiers,
rest,
loc: createSourceRange(context, props),
});
}
if (setupContext != null) {
let rest;
const identifiers = {};
if (isObjectPattern(setupContext)) {
setupContext.properties.forEach((prop) => {
if (isObjectProperty(prop)) {
if (isIdentifier(prop.value) && isIdentifier(prop.key)) {
identifiers[prop.key.name] =
prop.value.name;
}
}
else {
if (isIdentifier(prop.argument)) {
rest = prop.argument.name;
}
}
});
}
else if (isIdentifier(setupContext)) {
rest = setupContext.name;
}
context.component.addSetup('context', {
identifiers,
rest,
loc: createSourceRange(context, setupContext),
});
}
const addSetupSources = (node) => {
node.properties.forEach((property) => {
if (isObjectMember(property)) {
if (isIdentifier(property.key)) {
context.component.addIdentifier(property.key.name, 'setup', createSourceRange(context, property.key));
}
else if (isStringLiteral(property.key)) {
context.component.addIdentifier(property.key.value, 'setup', createSourceRange(context, property.key));
}
}
});
};
if (isBlockStatement(node.body)) {
const returnStatement = node.body.body.find((statement) => isReturnStatement(statement));
if ((returnStatement === null || returnStatement === void 0 ? void 0 : returnStatement.argument) != null) {
context.component.addSetup('return', {
loc: createSourceRange(context, returnStatement.argument),
});
if (isObjectExpression(returnStatement.argument)) {
addSetupSources(returnStatement.argument);
}
}
}
else {
context.component.addSetup('return', {
loc: createSourceRange(context, node.body),
});
if (isObjectExpression(node.body)) {
addSetupSources(node.body);
}
}
},
],
});
const TemplateBlockAnalyzer = createPlugin({
blocks: {
template: (block, ctx) => {
if (block.src == null) {
const ast = parse$2(block.content, {
onError(error) {
if (error.loc != null) {
ctx.component.addError(error.message, error.loc.start);
}
},
});
const templateExpressionFns = ctx.plugins
.map((plugin) => plugin.templateExpression)
.filter(Boolean);
traverse$1(ast, (node, ancestors) => {
if (isSimpleExpressionNode(node)) {
if (node.isStatic)
return;
if (templateExpressionFns.length === 0)
return;
const parent = ancestors[ancestors.length - 1];
const offset = block.loc.start.offset + node.loc.start.offset;
const source = `${node.content}`;
if (isDirectiveNode(parent)) {
if (parent.exp === node) {
if (parent.name === 'for') {
return;
}
}
}
const { ast } = parseJS(ctx, source, false, offset);
templateExpressionFns.forEach((fn) => {
if (fn != null) {
try {
fn(ast, ctx);
}
catch (error) {
console.error(error);
}
}
});
}
});
}
},
},
});
function toVeturData(components) {
const data = { tags: {}, attributes: {} };
components.forEach((component) => {
const name = kebabCase(component.name);
data.tags[name] = {
description: component.description,
attributes: [],
};
component.props.forEach((prop) => {
const propName = kebabCase(prop.name);
data.tags[name].attributes.push(propName);
data.attributes[`${name}/${propName}`] = {
description: prop.description,
type: prop.type
.map((type) => type.kind === 'expression' ? type.expression : type.kind)
.join('|'),
};
});
});
return data;
}
function toWebTypes(name, version, components) {
const data = {
framework: 'vue',
name,
version,
contributions: {
'types-syntax': 'typescript',
'description-markup': 'markdown',
tags: [],
attributes: [],
},
};
components.forEach((component) => {
var _a, _b;
const tag = {
name: component.name,
aliases: component.aliases,
description: component.description,
attributes: [],
events: [],
slots: [],
'vue-model': [],
source: {
file: component.fileName,
offset: (_b = (_a = component.options) === null || _a === void 0 ? void 0 : _a.loc.start.offset) !== null && _b !== void 0 ? _b : 0,
},
};
const emits = new Set();
component.emits.forEach((emit) => {
emits.add(emit.name);
tag.events.push({
name: emit.name,
description: emit.description,
arguments: [],
});
});
component.props.forEach((prop) => {
tag.attributes.push({
name: prop.name,
description: prop.description,
required: prop.required,
default: stringifyDefaultValue(prop.defaultValue),
value: toValue(prop.type, prop.required),
});
if (emits.has(`onUpdate:${prop.name}`)) {
tag['vue-model'].push({
prop: prop.name,
event: `onUpdate:${prop.name}`,
});
}
});
// TODO: Get slots
data.contributions.tags.push(tag);
});
return data;
}
function toValue(typeInfo, isRequired) {
if (typeInfo.length === 0) {
return { kind: 'no-value' };
}
else if (typeInfo.length === 1) {
const info = typeInfo[0];
switch (info.kind) {
case 'string':
case 'number':
case 'boolean':
return { kind: info.kind, required: isRequired };
case 'enum':
return { kind: info.kind, items: info.values, required: isRequired };
}
}
return {
kind: 'expression',
type: typeInfo.map((type) => {
if (type.kind === 'enum') {
return type.values.join('|');
}
else if (type.kind === 'expression') {
return {
imports: type.imports.map((imp) => stringifyImportSource(imp)),
expression: type.expression,
};
}
else {
return type.kind;
}
}),
required: isRequired,
};
}
function stringifyImportSource(imp) {
return imp.exportName != null
? `import { ${imp.exportName !== imp.localName
? `${imp.exportName} as ${imp.localName}`
: `${imp.localName}`} } from '${imp.moduleName}`
: `import ${imp.localName} from ${imp.moduleName}`;
}
function stringifyDefaultValue(info) {
if (info == null)
return;
if (info.kind === 'value')
return info.value;
if (info.kind === 'function')
return info.expression;
return (info.imports.map((imp) => stringifyImportSource(imp)).join('\n') +
'\n' +
info.expression);
}
function getComponentFromFile(fileName) {
if (fileName.endsWith('.vue') || fileName.endsWith('.tsx')) {
const name = getComponentName(fileName);
return [
{
name,
aliases: getComponentNameAliases(fileName),
source: {
moduleName: fileName,
localName: name,
},
},
];
}
return [];
}
function getComponentsFromPackageJSON(rootDir, pkg, require) {
const components = [];
components.push(...getComponentsFromVuePackage(getPackageJSON(require, rootDir, 'vue').version));
const packages = Array.from(new Set([
...Object.keys(pkg.devDependencies),
...Object.keys(pkg.dependencies),
]));
packages.forEach((packageName) => {
if (packageName === 'vue') ;
else if (packageName === 'vue-router') {
components.push(...getComponentsFromVueRouterPackage(getPackageJSON(require, rootDir, 'vue-router').version));
}
else {
components.push(...getComponentsFromPackage(require, rootDir, packageName));
}
});
return components;
}
function getPackageJSON(require, rootDir, packageName) {
try {
return requireFileFromPackage(require, packageName, 'package.json', rootDir);
}
catch (error) {
console.error(error);
return { name: packageName, version: 'latest' };
}
}
const getPathsCache = new Map();
function getPaths(dir) {
if (getPathsCache.has(dir)) {
return getPathsCache.get(dir);
}
const paths = [];
while (dir !== Path.posix.dirname(dir)) {
paths.push(`${dir}/node_modules`);
dir = Path.posix.dirname(dir);
}
getPathsCache.set(dir, paths);
return paths;
}
function requireFileFromPackage(require, packageName, fileName, rootDir) {
const paths = getPaths(rootDir);
const req = Path.posix.resolve(`/${packageName}`, fileName).substr(1);
return require(require.resolve(req, { paths }));
}
function getComponentsFromVuePackage(version) {
const components = [];
components.push({
name: 'Component',
aliases: ['component', 'Component'],
source: {
moduleName: 'vue',
localName: 'Component',
exportName: 'Component',
},
}, {
name: 'KeepAlive',
aliases: ['keep-alive', 'KeepAlive'],
source: {
moduleName: 'vue',
localName: 'KeepAlive',
exportName: 'KeepAlive',
},
}, {
name: 'Transition',
aliases: ['transition', 'Transition'],
source: {
moduleName: 'vue',
localName: 'Transition',
exportName: 'Transition',
},
}, {
name: 'TransitionGroup',
aliases: ['transition-group', 'TransitionGroup'],
source: {
moduleName: 'vue',
localName: 'TransitionGroup',
exportName: 'TransitionGroup',
},
});
if (version.startsWith('3.') || version === 'latest') {
components.push({
name: 'Suspense',
aliases: ['suspense', 'Suspense'],
source: {
moduleName: 'vue',
localName: 'Suspense',
exportName: 'Suspense',
},
}, {
name: 'Teleport',
aliases: ['teleport', 'Teleport'],
source: {
moduleName: 'vue',
localName: 'Teleport',
exportName: 'Teleport',
},
});
}
return components;
}
function getComponentsFromVueRouterPackage(version) {
const components = [];
components.push({
name: 'RouterLink',
aliases: ['router-link', 'RouterLink'],
source: {
moduleName: 'vue-router',
localName: 'RouterLink',
exportName: 'RouterLink',
},
}, {
name: 'RouterView',
aliases: ['router-view', 'RouterView'],
source: {
moduleName: 'vue-router',
localName: 'RouterView',
exportName: 'RouterView',
},
});
return components;
}
const getComponentsFromPackageCache = new Map();
function getComponentsFromPackage(require, rootDir, packageName) {
var _a, _b, _c, _d;
const pkg = getPackageJSON(require, rootDir, packageName);
const key = `${rootDir}:${packageName}@${pkg.version}`;
if (getComponentsFromPackageCache.has(key)) {
return getComponentsFromPackageCache.get(key);
}
const components = [];
if (pkg['web-types'] != null) {
try {
const info = requireFileFromPackage(require, packageName, pkg['web-types'], rootDir);
(_c = (_b = (_a = info.contributions) === null || _a === void 0 ? void 0 : _a.html) === null || _b === void 0 ? void 0 : _b.tags) === null || _c === void 0 ? void 0 : _c.forEach((tag) => {
var _a, _b;
const componentName = getComponentName(tag.name);
components.push({
name: componentName,
aliases: getComponentNameAliases(tag.name),
source: {
moduleName: packageName,
localName: componentName,
exportName: ((_a = tag.source) === null || _a === void 0 ? void 0 : _a.symbol) != null && ((_b = tag.source) === null || _b === void 0 ? void 0 : _b.symbol) !== 'default'
? tag.source.symbol
: undefined,
},
});
});
}
catch (error) {
console.error(error);
}
}
else if (((_d = pkg.vetur) === null || _d === void 0 ? void 0 : _d.tags) != null) {
try {
const info = requireFileFromPackage(require, packageName, pkg.vetur.tags, rootDir);
Object.keys(info).forEach((tag) => {
const componentName = getComponentName(tag);
components.push({
name: componentName,
aliases: getComponentNameAliases(tag),
source: {
moduleName: packageName,
localName: componentName,
exportName: componentName,
},
});
});
}
catch (error) {
console.error(error);
}
}
getComponentsFromPackageCache.set(key, components);
return components;
}
function deepDefaults(a, b) {
Object.keys(b).forEach((key) => {
const valueA = a[key];
const valueB = b[key];
if (valueB === undefined)
return;
if (valueA == null || Array.isArray(valueB)) {
a[key] = valueB;
}
else if (typeof valueA === 'object' && typeof valueB === 'object') {
a[key] = deepDefaults(valueA, valueB);
}
else {
a[key] = valueB;
}
});
return a;
}
const DEFAULT_CONFIG = {
globalComponents: [],
preferences: {
componentsDirectories: ['src/components'],
script: { mode: 'normal', language: 'js' },
style: { language: 'css' },
template: {
directiveSyntax: 'shorthand',
propCase: 'camel',
tagCase: 'auto',
},
},
};
class VueProject {
constructor(rootDir, packageFile, packageJSON, requireModule = require) {
this.rootDir = rootDir;
this.packageFile = packageFile;
this.requireModule = requireModule;
this.isDirty = true;
this._globalComponents = [];
this._externalComponents = [];
this._projectComponents = new Map();
this._fileNames = [];
this._version = '3.0.0';
this._config = deepDefaults({}, DEFAULT_CONFIG);
this.packageJSON = { dependencies: {}, devDependencies: {}, ...packageJSON };
this.loadVueVersion();
}
get config() {
return this._config;
}
get version() {
return this._version;
}
setConfig(config) {
this._config = deepDefaults(this._config, config);
}
markDirty() {
this.isDirty = true;
}
loadGlobalComponents() {
this._externalComponents = getComponentsFromPackageJSON(this.rootDir, this.packageJSON, this.requireModule);
const KnownGlobalPackageRE = /^(vue|vue-router)$/;
this._globalComponents = this._externalComponents.filter((component) => KnownGlobalPackageRE.test(component.source.moduleName));
}
reloadIfNeeded() {
if (this.isDirty) {
this.loadVueVersion();
this.loadGlobalComponents();
this.refresh();
this.isDirty = false;
}
}
loadVueVersion() {
var _a;
this._version = (_a = getPackageJSON(this.requireModule, this.rootDir, 'vue').version) !== null && _a !== void 0 ? _a : '3.0.0';
}
setFileNames(fileNames) {
const newLocalComponents = new Map();
this._fileNames = fileNames;
fileNames.forEach((fileName) => {
var _a;
if (fileName.endsWith('.vue')) {
newLocalComponents.set(fileName, (_a = this._projectComponents.get(fileName)) !== null && _a !== void 0 ? _a : getComponentFromFile(fileName));
}
});
this._projectComponents = newLocalComponents;
}
get vueFileNames() {
this.reloadIfNeeded();
return Array.from(this._projectComponents.keys());
}
get fileNames() {
return this._fileNames;
}
// TODO: Cache this.
get components() {
this.reloadIfNeeded();
return [
this._globalComponents,
this._externalComponents,
...this._projectComponents.values(),
].flat(2);
}
get globalComponents() {
this.reloadIfNeeded();
return this._globalComponents;
}
}
class ConfiguredVueProject extends VueProject {
constructor(rootDir, packageFile, packageJSON, configFile, config, requireModule = require) {
super(rootDir, packageFile, packageJSON, requireModule);
this.configFile = configFile;
this.kind = 'configured';
this.setConfig(config);
}
setFileNames(fileNames) {
super.setFileNames(fileNames);
this.markDirty();
}
refresh() {
this.config.globalComponents.forEach((option) => {
var _a, _b;
if (typeof option === 'string') {
if (option in this.packageJSON.dependencies ||
option in this.packageJSON.devDependencies) {
this._globalComponents.push(...((_a = this._projectComponents.get(option)) !== null && _a !== void 0 ? _a : getComponentsFromPackage(this.requireModule, this.rootDir, option)));
}
else if (option.includes('*') || option.includes('{')) {
micromatch.match(this._fileNames, option).forEach((fileName) => {
var _a;
this._globalComponents.push(...((_a = this._projectComponents.get(fileName)) !== null && _a !== void 0 ? _a : getComponentFromFile(fileName)));
});
}
else {
const fileName = Path.posix.resolve(Path.posix.dirname(this.configFile), option);
this._globalComponents.push(...((_b = this._projectComponents.get(fileName)) !== null && _b !== void 0 ? _b : getComponentFromFile(fileName)));
}
}
else {
Object.entries(option).forEach(([name, config]) => {
const componentName = getComponentName(name);
const id = typeof config === 'string' ? config : config.moduleName;
const moduleName = id in this.packageJSON.dependencies ||
id in this.packageJSON.devDependencies
? id
: Path.posix.resolve(Path.posix.dirname(this.configFile), id);
this._globalComponents.push({
name: componentName,
aliases: getComponentNameAliases(name),
source: {
moduleName: moduleName,
exportName: typeof config !== 'string' ? config.exportName : undefined,
localName: componentName,
},
});
});
}
});
}
}
class InferredVueProject extends VueProject {
constructor() {
super(...arguments);
this.kind = 'inferred';
}
refresh() { }
}
function transformToFunction(content, options = {
kind: 'expression',
args: [],
}) {
const ast = parse$1(content, {
sourceType: 'module',
plugins: [
'bigInt',
'optionalChaining',
'optionalCatchBinding',
'nullishCoalescingOperator',
'objectRestSpread',
],
ranges: true,
// @ts-expect-error
errorRecovery: true,
});
const params = options.args.map((id) => identifier(id));
if (options.kind === 'statement') {
if (ast.program.body.length === 1) {
const statement = ast.program.body[0];
if (isExpressionStatement(statement)) {
const node = statement.expression;
if (isArrowFunctionExpression(node) || isFunctionExpression(node)) {
params.push(...node.params);
ast.program.body = isStatement(node.body)
? [node.body]
: [expressionStatement(node.body)];
}
}
}
}
if (options.rewrite != null) {
const processed = new Set();
const knownIdentifiers = new Set(options.args);
const rewrite = options.rewrite;
params.forEach((node) => traverseFast(node, (node) => {
if (isIdentifier(node)) {
knownIdentifiers.add(node.name);
}
}));
traverseFast(ast, (node) => {
if (isMemberExpression(node)) {
processed.add(node.property);
}
else if (isIdentifier(node) &&
!processed.has(node) &&
!knownIdentifiers.has(node.name)) {
processed.add(node);
if ('context' in rewrite) {
node.name = `${rewrite.context}.${node.name}`;
}
else if ('refs' in rewrite) {
if (rewrite.refs.includes(node.name)) {
node.name = `${node.name}.value`;
}
else if (rewrite.props.includes(node.name)) {
node.name = `${rewrite.identifiers.props}.${node.name}`;
}
else if (node.name === '$props') {
node.name = rewrite.identifiers.props;
}
else if (node.name === '$emit') {
node.name = rewrite.identifiers.emit;
}
else if (node.name === '$attrs') {
node.name = rewrite.identifiers.attrs;
}
else if (node.name === '$slots') {
node.name = rewrite.identifiers.slots;
}
}
}
});
}
const statements = ast.program.body.slice(0, -1);
const [lastStatement] = ast.program.body.slice(-1);
if (lastStatement != null) {
if (options.kind === 'expression') {
if (isExpressionStatement(lastStatement)) {
statements.push(returnStatement(lastStatement.expression));
}
else {
statements.push(lastStatement);
}
}
else {
statements.push(lastStatement);
}
}
if (options.name == null) {
const code = generate(arrowFunctionExpression(params, blockStatement(statements))).code;
if (params.length === 1 && isIdentifier(params[0])) {
return code.replace(params[0].name, `(${params[0].name})`);
}
return code;
}
else {
return generate(functionExpression(identifier(options.name), params, blockStatement(statements))).code.replace(/^function anonymous/, 'function ');
}
}
function createFullAnalyzer(plugins = [], options = {}) {
plugins.push(ScriptBlockAnalyzer, TemplateBlockAnalyzer, ComponentsOptionAnalyzer, EmitsOptionsAnalyzer, PropsOptionsAnalyzer, SetupOptionsAnalyzer, ScriptIdentifierSourceAnalyzer);
return createAnalyzer(plugins, options);
}
export { ComponentsOptionAnalyzer, ConfiguredVueProject, EmitsOptionsAnalyzer, ImplicitEmitsAnalyzer, InferredVueProject, PropsOptionsAnalyzer, ScriptBlockAnalyzer, ScriptIdentifierSourceAnalyzer, SetupOptionsAnalyzer, TemplateBlockAnalyzer, VueProject, createAnalyzer, createFullAnalyzer, createSourceRange, toVeturData, toWebTypes, transformToFunction };
//# sourceMappingURL=index.esm.js.map
| 37.689409 | 502 | 0.461741 |
184c5da0e5ec009ead314a157f933c55046bc96f | 666 | js | JavaScript | node_modules/rxjs/internal/observable/defer.js | GenaAiv/portfolio-website | 66e5f5f012b73fe41879a824f231e8798fb7b5f8 | [
"MIT"
] | null | null | null | node_modules/rxjs/internal/observable/defer.js | GenaAiv/portfolio-website | 66e5f5f012b73fe41879a824f231e8798fb7b5f8 | [
"MIT"
] | null | null | null | node_modules/rxjs/internal/observable/defer.js | GenaAiv/portfolio-website | 66e5f5f012b73fe41879a824f231e8798fb7b5f8 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var from_1 = require("./from");
var empty_1 = require("./empty");
function defer(observableFactory) {
return new Observable_1.Observable(function (subscriber) {
var input;
try {
input = observableFactory();
}
catch (err) {
subscriber.error(err);
return undefined;
}
var source = input ? from_1.from(input) : empty_1.empty();
return source.subscribe(subscriber);
});
}
exports.defer = defer;
//# sourceMappingURL=defer.js.map | 31.714286 | 67 | 0.596096 |
184c6dbee88481b52a429975b6b895c146ae131c | 480 | js | JavaScript | commands/Dev/GuildLeave.js | LockBlock-dev/LockBot | c06fcf6fe6e604fd87a32f5c08554ff699157d59 | [
"MIT"
] | 4 | 2020-12-29T12:45:11.000Z | 2021-08-20T17:55:34.000Z | commands/Dev/GuildLeave.js | LockBlock-dev/LockBot | c06fcf6fe6e604fd87a32f5c08554ff699157d59 | [
"MIT"
] | 1 | 2021-04-24T11:04:10.000Z | 2021-04-24T11:04:10.000Z | commands/Dev/GuildLeave.js | LockBlock-dev/LockBot | c06fcf6fe6e604fd87a32f5c08554ff699157d59 | [
"MIT"
] | 3 | 2021-01-17T20:23:46.000Z | 2021-08-31T05:57:03.000Z | const { COMMANDS } = require("../../core/constants.js")
require('dotenv').config()
module.exports.run = async (bot, message, args, lang) => {
message.delete()
const guild = bot.guilds.cache.get(args[0])
if (!guild) return message.channel.send(bot.error("The bot isn't in the guild with this ID.", message.author.id, lang))
guild.leave()
.then(message.channel.send("The bot isn't longer in this guild !"))
}
module.exports.help = COMMANDS.DEV.GUILDLEAVE | 26.666667 | 123 | 0.672917 |
184ccc4aee7e6536e2c52b8debe4d7fa5e7adff0 | 214 | js | JavaScript | test/js/data/dupes/set2/file2.js | asinghal/codecritic | cf97e8bbfef63373c25a31a182b67cd6763142e9 | [
"MIT"
] | 1 | 2015-09-26T15:08:41.000Z | 2015-09-26T15:08:41.000Z | test/js/data/dupes/set2/file2.js | asinghal/codecritic | cf97e8bbfef63373c25a31a182b67cd6763142e9 | [
"MIT"
] | null | null | null | test/js/data/dupes/set2/file2.js | asinghal/codecritic | cf97e8bbfef63373c25a31a182b67cd6763142e9 | [
"MIT"
] | 1 | 2015-06-01T07:53:37.000Z | 2015-06-01T07:53:37.000Z | /* jslint node: true */
'use strict';
function sumFunction(aVar, bVar) {
var x = 15,
y = 20,
result = {};
result.sum = x + y;
result.diff = x - y;
result.msg = 'a message here';
return result;
}
| 16.461538 | 34 | 0.565421 |
184ccf953892276ba4d23c32d88cef03d0837373 | 760 | js | JavaScript | src/components/crypto/Chart/Chart.js | gionasdev/crypto-tracker-chart | 25158d94ed5acde2fdf172c5cbe2f340b0a7fa4a | [
"MIT"
] | null | null | null | src/components/crypto/Chart/Chart.js | gionasdev/crypto-tracker-chart | 25158d94ed5acde2fdf172c5cbe2f340b0a7fa4a | [
"MIT"
] | null | null | null | src/components/crypto/Chart/Chart.js | gionasdev/crypto-tracker-chart | 25158d94ed5acde2fdf172c5cbe2f340b0a7fa4a | [
"MIT"
] | null | null | null | import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
const Chart = ({data}) => {
return (
<div style={{ width: '100%', height: '80vh', backgroundColor: 'white', borderRadius: '25px', padding: '10px' }}>
<ResponsiveContainer>
<AreaChart
data={data}
margin={{
top: 10,
right: 30,
left: 0,
bottom: 0,
}}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="name" />
<YAxis />
<Tooltip />
<Area type="monotone" dataKey="uv" stroke="#8884d8" fill="#8884d8" />
</AreaChart>
</ResponsiveContainer>
</div>
);
};
export default Chart;
| 26.206897 | 116 | 0.517105 |
184d4bce63aaf227c6ad07958a30b213c14809ef | 1,880 | js | JavaScript | src/lib/vector2d.js | phillyDesignr/CherryBomb | 9f135208fc6c44f1ef3ce6cfa7085fe45d4c505b | [
"MIT"
] | null | null | null | src/lib/vector2d.js | phillyDesignr/CherryBomb | 9f135208fc6c44f1ef3ce6cfa7085fe45d4c505b | [
"MIT"
] | 1 | 2021-05-11T10:21:55.000Z | 2021-05-11T10:21:55.000Z | src/lib/vector2d.js | phillyDesignr/CherryBomb | 9f135208fc6c44f1ef3ce6cfa7085fe45d4c505b | [
"MIT"
] | null | null | null | export default class Vector2d {
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
add(v2d) {
this.x += v2d.x;
this.y += v2d.y;
return this;
}
sub(v2d) {
this.x -= v2d.x;
this.y -= v2d.y;
return this;
}
mult(n) {
this.x *= n;
this.y *= n;
return this;
}
div(n) {
this.x /= n;
this.y /= n;
return this;
}
mag() {
return Math.sqrt(this.x * this.x + this.y * this.y);
}
normalize() {
const m = this.mag();
if (m !== 0) {
this.div(m);
}
return this;
}
limit(h, l) {
const high = h || null,
low = l || null;
if (high && this.mag() > high) {
this.normalize();
this.mult(high);
}
if (low && this.mag() < low) {
this.normalize();
this.mult(low);
}
return this;
}
zero() {
this.x = 0;
this.y = 0;
return this;
}
copy() {
return new Vector2d(this.x, this.y);
}
rotate(angle) {
const nx = this.x * Math.cos(angle) - this.y * Math.sin(angle);
const ny = this.x * Math.sin(angle) + this.y * Math.cos(angle);
this.x = nx;
this.y = ny;
return this;
}
rotateDeg(deg) {
return this.rotate(Vector2d.deg2rad(deg));
}
heading() {
return Math.atan2(this.y, this.x);
}
angleBetween(v2d) {
return Math.atan2(v2d.y - this.y, v2d.x - this.x);
}
angleTo(v2d, angleOffset = 0) {
return Math.atan2(v2d.y - this.y, v2d.x - this.x) + angleOffset;
}
dot(v2d) {
return this.x * (v2d.x || 0) + this.y * (v2d.y || 0);
}
lerpTo(v2d, t) {
const lx = Vector2d.lerp(this.x, v2d.x, t);
const ly = Vector2d.lerp(this.y, v2d.y, t);
return new Vector2d(lx, ly);
}
static lerp(a, b, t) {
return a + (b - a) * t;
}
static rad2deg(rad) {
return rad * (180 / Math.PI);
}
static deg2rad(deg) {
return deg / (180 / Math.PI);
}
}
| 20 | 68 | 0.506915 |
184dc75b58db7cf4456523759552752934cb271f | 4,326 | js | JavaScript | lib/third_party/tracing/extras/importer/gzip_importer.js | tkadlec/node-big-rig | 221a0097ff603fa63488e5961a1a12bc8fa37286 | [
"Apache-2.0"
] | 441 | 2015-11-05T22:37:17.000Z | 2017-09-15T19:43:39.000Z | lib/third_party/tracing/extras/importer/gzip_importer.js | tkadlec/node-big-rig | 221a0097ff603fa63488e5961a1a12bc8fa37286 | [
"Apache-2.0"
] | 16 | 2015-11-09T10:56:52.000Z | 2016-10-25T17:16:07.000Z | lib/third_party/tracing/extras/importer/gzip_importer.js | tkadlec/node-big-rig | 221a0097ff603fa63488e5961a1a12bc8fa37286 | [
"Apache-2.0"
] | 21 | 2015-11-08T07:07:24.000Z | 2017-06-05T17:36:33.000Z | /**
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
**/
require("./jszip.js");
require("../../importer/importer.js");
require("../../model/model.js");
'use strict';
/**
* @fileoverview GzipImporter inflates gzip compressed data and passes it along
* to an actual importer.
*/
global.tr.exportTo('tr.e.importer', function() {
var GZIP_MEMBER_HEADER_ID_SIZE = 3;
var GZIP_HEADER_ID1 = 0x1f;
var GZIP_HEADER_ID2 = 0x8b;
var GZIP_DEFLATE_COMPRESSION = 8;
function GzipImporter(model, eventData) {
// Normalize the data into an Uint8Array.
if (typeof(eventData) === 'string' || eventData instanceof String) {
eventData = JSZip.utils.transformTo('uint8array', eventData);
} else if (eventData instanceof ArrayBuffer) {
eventData = new Uint8Array(eventData);
} else
throw new Error('Unknown gzip data format');
this.model_ = model;
this.gzipData_ = eventData;
}
/**
* @param {eventData} Possibly gzip compressed data as a string or an
* ArrayBuffer.
* @return {boolean} Whether obj looks like gzip compressed data.
*/
GzipImporter.canImport = function(eventData) {
var header;
if (eventData instanceof ArrayBuffer)
header = new Uint8Array(eventData.slice(0, GZIP_MEMBER_HEADER_ID_SIZE));
else if (typeof(eventData) === 'string' || eventData instanceof String) {
header = eventData.substring(0, GZIP_MEMBER_HEADER_ID_SIZE);
// Convert the string to a byteArray for correct value comparison.
header = JSZip.utils.transformTo('uint8array', header);
} else
return false;
return header[0] == GZIP_HEADER_ID1 &&
header[1] == GZIP_HEADER_ID2 &&
header[2] == GZIP_DEFLATE_COMPRESSION;
};
/**
* Inflates (decompresses) the data stored in the given gzip bitstream.
* @return {string} Inflated data.
*/
GzipImporter.inflateGzipData_ = function(data) {
var position = 0;
function getByte() {
if (position >= data.length)
throw new Error('Unexpected end of gzip data');
return data[position++];
}
function getWord() {
var low = getByte();
var high = getByte();
return (high << 8) + low;
}
function skipBytes(amount) {
position += amount;
}
function skipZeroTerminatedString() {
while (getByte() != 0) {}
}
var id1 = getByte();
var id2 = getByte();
if (id1 !== GZIP_HEADER_ID1 || id2 !== GZIP_HEADER_ID2)
throw new Error('Not gzip data');
var compression_method = getByte();
if (compression_method !== GZIP_DEFLATE_COMPRESSION)
throw new Error('Unsupported compression method: ' + compression_method);
var flags = getByte();
var have_header_crc = flags & (1 << 1);
var have_extra_fields = flags & (1 << 2);
var have_file_name = flags & (1 << 3);
var have_comment = flags & (1 << 4);
// Skip modification time, extra flags and OS.
skipBytes(4 + 1 + 1);
// Skip remaining fields before compressed data.
if (have_extra_fields) {
var bytes_to_skip = getWord();
skipBytes(bytes_to_skip);
}
if (have_file_name)
skipZeroTerminatedString();
if (have_comment)
skipZeroTerminatedString();
if (have_header_crc)
getWord();
// Inflate the data using jszip.
var inflated_data =
JSZip.compressions['DEFLATE'].uncompress(data.subarray(position));
return JSZip.utils.transformTo('string', inflated_data);
},
GzipImporter.prototype = {
__proto__: tr.importer.Importer.prototype,
/**
* Called by the Model to check whether the importer just encapsulates
* the actual trace data which needs to be imported by another importer.
*/
isTraceDataContainer: function() {
return true;
},
/**
* Called by the Model to extract subtraces from the event data. The
* subtraces are passed on to other importers that can recognize them.
*/
extractSubtraces: function() {
var eventData = GzipImporter.inflateGzipData_(this.gzipData_);
return eventData ? [eventData] : [];
}
};
tr.importer.Importer.register(GzipImporter);
return {
GzipImporter: GzipImporter
};
});
| 30.041667 | 79 | 0.655802 |
184ec67a39448104fa132630fe64743c84da46e1 | 1,428 | js | JavaScript | gulpfile.js | moumen-soliman/browser-bug-search | 18f8e7da80b63d7eac36fbc597b83a02d1727c22 | [
"Apache-2.0"
] | 120 | 2016-09-19T18:28:24.000Z | 2021-12-03T22:02:17.000Z | gulpfile.js | mrthomas108/browser-bug-search | d83806f63e121023c0a42e68e925768a025c58ba | [
"Apache-2.0"
] | 25 | 2016-09-19T18:46:40.000Z | 2021-08-04T03:52:00.000Z | gulpfile.js | mrthomas108/browser-bug-search | d83806f63e121023c0a42e68e925768a025c58ba | [
"Apache-2.0"
] | 41 | 2016-09-19T18:28:29.000Z | 2022-01-25T06:42:18.000Z | const gulp = require('gulp');
const gulpLoadPlugins = require('gulp-load-plugins');
const closure = require('google-closure-compiler-js').gulp();
const $ = gulpLoadPlugins();
function license() {
return $.license('Apache', {
organization: 'Copyright (c) 2016 Google Inc. All rights reserved.',
tiny: true
});
}
function uglifyJS() {
return $.uglify({preserveComments: 'some'});
}
gulp.task('vulcanize', function() {
return gulp.src([
'deps.html'
])
.pipe($.vulcanize({
stripComments: true,
inlineScripts: true,
inlineCss: true
}))
.pipe($.rename({suffix: '.vulcanized'}))
.pipe($.crisper({scriptInHead: true})) // Separate HTML and JS. CSP friendly.
// .pipe($.if('*.html', minifyHtml())) // Minify HTML output.
// .pipe($.if('*.html', cssslam.gulp())) // Minify CSS in HTML output.
.pipe($.if('*.js', uglifyJS())) // Minify JS in HTML output.
// .pipe($.if('*.js', license())) // Add license to top.
.pipe(gulp.dest('./'));
});
gulp.task('script', function() {
return gulp.src([
'./js/app.js'
])
.pipe(closure({
compilationLevel: 'SIMPLE',
warningLevel: 'DEFAULT',
languageIn: 'ECMASCRIPT6_STRICT',
languageOut: 'ECMASCRIPT5',
jsOutputFile: 'app.min.js',
createSourceMap: true
}))
.pipe(license()) // Add license to top.
.pipe(gulp.dest('./js'));
});
gulp.task('default', ['script', 'vulcanize'], function() {
});
| 25.963636 | 79 | 0.612045 |
184f14d98905daa3be9fdfb6c6e59f5805f7e747 | 1,473 | js | JavaScript | client/src/components/EmojiPicker.js | Hayder7Aly/VChat-App | 7a5fec23974ab01e487962a135c2474f8a583e5e | [
"MIT"
] | 30 | 2021-04-28T13:30:07.000Z | 2022-03-30T03:22:54.000Z | client/src/components/EmojiPicker.js | Hayder7Aly/VChat-App | 7a5fec23974ab01e487962a135c2474f8a583e5e | [
"MIT"
] | null | null | null | client/src/components/EmojiPicker.js | Hayder7Aly/VChat-App | 7a5fec23974ab01e487962a135c2474f8a583e5e | [
"MIT"
] | 7 | 2021-04-28T13:30:22.000Z | 2021-12-25T02:59:07.000Z | import { useState } from 'react';
import { Popover, Button, IconButton } from '@material-ui/core';
import { useEmojiPanelStyles } from '../styles/muiStyles';
import InsertEmoticonIcon from '@material-ui/icons/InsertEmoticon';
const EmojiPicker = ({ handleEmojiAdd, isModal }) => {
const classes = useEmojiPanelStyles();
const [anchorEl, setAnchorEl] = useState(null);
const emojis = ['😂', '😭', '❤️', '🤣', '😍', '😌', '🔥', '🤔', '😫', '🙄'];
return (
<div>
<IconButton
size="small"
color={anchorEl ? 'primary' : 'default'}
onClick={(e) => setAnchorEl(e.currentTarget)}
>
<InsertEmoticonIcon fontSize={isModal ? 'default' : 'large'} />
</IconButton>
<Popover
open={Boolean(anchorEl)}
anchorEl={anchorEl}
onClose={() => setAnchorEl(false)}
anchorOrigin={{
vertical: 'top',
horizontal: 'center',
}}
transformOrigin={{
vertical: 'bottom',
horizontal: isModal ? 'right' : 'left',
}}
elevation={1}
>
<div className={classes.emojiWrapper}>
{emojis.map((emoji) => (
<Button
onClick={() => handleEmojiAdd(emoji)}
className={classes.emojiBtn}
key={emoji}
color="primary"
>
{emoji}
</Button>
))}
</div>
</Popover>
</div>
);
};
export default EmojiPicker;
| 28.326923 | 71 | 0.520706 |
184f1912409aea55c26ce0a0863afa23269df7ac | 762 | js | JavaScript | PC/jsPDF-master/main_plugins.js | PGYangel/wheel_bank | 21508419fd50b9caf676a59c7246c203285de621 | [
"BSD-3-Clause"
] | 3 | 2018-11-02T10:37:21.000Z | 2018-11-07T02:13:17.000Z | PC/jsPDF-master/main_plugins.js | PGYangel/wheel_bank | 21508419fd50b9caf676a59c7246c203285de621 | [
"BSD-3-Clause"
] | 39 | 2019-11-06T10:41:59.000Z | 2022-02-27T03:21:01.000Z | PC/jsPDF-master/main_plugins.js | PGYangel/wheel_bank | 21508419fd50b9caf676a59c7246c203285de621 | [
"BSD-3-Clause"
] | 2 | 2020-12-25T06:47:46.000Z | 2021-08-14T02:56:13.000Z | import './plugins/acroform';
import './plugins/addhtml';
import './plugins/addimage';
import './plugins/annotations';
import './plugins/arabic';
import './plugins/autoprint';
import './plugins/canvas';
import './plugins/cell';
import './plugins/context2d';
import './plugins/from_html';
import './plugins/javascript';
import './plugins/outline';
import './plugins/png_support';
import './plugins/gif_support';
import './plugins/bmp_support';
import './plugins/setlanguage';
import './plugins/split_text_to_size';
import './plugins/standard_fonts_metrics';
import './plugins/ttfsupport';
import './plugins/svg';
import './plugins/total_pages';
import './plugins/viewerpreferences';
import './plugins/xmp_metadata';
import './plugins/utf8';
import './plugins/vfs'; | 30.48 | 42 | 0.738845 |
184f9daa9b1d6c6c19c1c86a23f54c51903b5fa4 | 1,169 | js | JavaScript | src/icons/RiftsIcon.js | QuatZo/swstats-fe | e13346df58b19b057ae982330fe37d630222490b | [
"Apache-2.0"
] | null | null | null | src/icons/RiftsIcon.js | QuatZo/swstats-fe | e13346df58b19b057ae982330fe37d630222490b | [
"Apache-2.0"
] | null | null | null | src/icons/RiftsIcon.js | QuatZo/swstats-fe | e13346df58b19b057ae982330fe37d630222490b | [
"Apache-2.0"
] | null | null | null | import SvgIcon from '@material-ui/core/SvgIcon';
export default function RiftsIcon(props) {
return (
<SvgIcon {...props}>
<path
d="M 16.402344 14.695312
L 16.402344 14.679688
C 16.050781 14.316406 15.671875 13.949219 15.21875 13.597656
C 18.285156 12.628906 20 10.292969 20 7.015625
C 20 4.0625 18.441406 1.574219 16.035156 0.648438
C 14.882812 0.210938 13.140625 0 10.691406 0
L 1.664062 0
L 1.664062 24
L 7.484375 24
L 7.484375 14.527344
C 9.207031 14.527344 9.121094 14.804688 9.734375 15.46875
C 10.453125 16.253906 12.878906 20.085938 15.402344 24
L 22.335938 24
C 19.484375 19.242188 17.429688 15.824219 16.402344 14.695312 Z
M 7.484375 5.21875
C 8.714844 5.214844 11.8125 5.195312 12.367188 5.273438
C 13.476562 5.46875 14.039062 6.144531 14.039062 7.296875
C 14.039062 8.3125 13.617188 9 12.816406 9.28125
C 11.910156 9.605469 8.761719 9.507812 7.484375 9.507812 Z
M 7.484375 5.21875 "
/>
</SvgIcon>
);
} | 38.966667 | 74 | 0.585971 |
184fab609cc2a462043330ce556aca84bd7040f9 | 24,040 | js | JavaScript | node_modules/nodegit/lib/nodegit.js | hsleonis/ngMaker | 7b2d8a8969bbfdf224e344e1df959d7115ba5301 | [
"MIT"
] | 2 | 2016-08-12T06:30:45.000Z | 2016-08-17T20:18:06.000Z | node_modules/nodegit/lib/nodegit.js | hsleonis/ngMaker | 7b2d8a8969bbfdf224e344e1df959d7115ba5301 | [
"MIT"
] | null | null | null | node_modules/nodegit/lib/nodegit.js | hsleonis/ngMaker | 7b2d8a8969bbfdf224e344e1df959d7115ba5301 | [
"MIT"
] | null | null | null | var Promise = require("nodegit-promise");
var promisify = require("promisify-node");
var rawApi;
// Attempt to load the production release first, if it fails fall back to the
// debug release.
try {
rawApi = require("../build/Release/nodegit.node");
}
catch (ex) {
/* istanbul ignore next */
if (ex.code !== "MODULE_NOT_FOUND") {
throw ex;
}
rawApi = require("../build/Debug/nodegit.node");
}
// Native methods do not return an identifiable function, so we
// have to override them here
/* jshint ignore:start */
var _AnnotatedCommit = rawApi.AnnotatedCommit;
var _AnnotatedCommit_fromFetchhead = _AnnotatedCommit.fromFetchhead;
_AnnotatedCommit.fromFetchhead = promisify(_AnnotatedCommit_fromFetchhead);
var _AnnotatedCommit_fromRef = _AnnotatedCommit.fromRef;
_AnnotatedCommit.fromRef = promisify(_AnnotatedCommit_fromRef);
var _AnnotatedCommit_fromRevspec = _AnnotatedCommit.fromRevspec;
_AnnotatedCommit.fromRevspec = promisify(_AnnotatedCommit_fromRevspec);
var _AnnotatedCommit_lookup = _AnnotatedCommit.lookup;
_AnnotatedCommit.lookup = promisify(_AnnotatedCommit_lookup);
var _Attr = rawApi.Attr;
var _Attr_get = _Attr.get;
_Attr.get = promisify(_Attr_get);
var _Blame = rawApi.Blame;
var _Blame_buffer = _Blame.prototype.buffer;
_Blame.prototype.buffer = promisify(_Blame_buffer);
var _Blame_file = _Blame.file;
_Blame.file = promisify(_Blame_file);
var _Blob = rawApi.Blob;
var _Blob_lookup = _Blob.lookup;
_Blob.lookup = promisify(_Blob_lookup);
var _Blob_lookupPrefix = _Blob.lookupPrefix;
_Blob.lookupPrefix = promisify(_Blob_lookupPrefix);
var _Branch = rawApi.Branch;
var _Branch_create = _Branch.create;
_Branch.create = promisify(_Branch_create);
var _Branch_iteratorNew = _Branch.iteratorNew;
_Branch.iteratorNew = promisify(_Branch_iteratorNew);
var _Branch_lookup = _Branch.lookup;
_Branch.lookup = promisify(_Branch_lookup);
var _Branch_move = _Branch.move;
_Branch.move = promisify(_Branch_move);
var _Branch_name = _Branch.name;
_Branch.name = promisify(_Branch_name);
var _Buf = rawApi.Buf;
var _Buf_grow = _Buf.prototype.grow;
_Buf.prototype.grow = promisify(_Buf_grow);
var _Buf_set = _Buf.prototype.set;
_Buf.prototype.set = promisify(_Buf_set);
var _Checkout = rawApi.Checkout;
var _Checkout_head = _Checkout.head;
_Checkout.head = promisify(_Checkout_head);
var _Checkout_index = _Checkout.index;
_Checkout.index = promisify(_Checkout_index);
var _Checkout_tree = _Checkout.tree;
_Checkout.tree = promisify(_Checkout_tree);
var _Cherrypick = rawApi.Cherrypick;
var _Cherrypick_cherrypick = _Cherrypick.cherrypick;
_Cherrypick.cherrypick = promisify(_Cherrypick_cherrypick);
var _Cherrypick_commit = _Cherrypick.commit;
_Cherrypick.commit = promisify(_Cherrypick_commit);
var _Clone = rawApi.Clone;
var _Clone_clone = _Clone.clone;
_Clone.clone = promisify(_Clone_clone);
var _Commit = rawApi.Commit;
var _Commit_headerField = _Commit.prototype.headerField;
_Commit.prototype.headerField = promisify(_Commit_headerField);
var _Commit_lookup = _Commit.lookup;
_Commit.lookup = promisify(_Commit_lookup);
var _Commit_lookupPrefix = _Commit.lookupPrefix;
_Commit.lookupPrefix = promisify(_Commit_lookupPrefix);
var _Commit_nthGenAncestor = _Commit.prototype.nthGenAncestor;
_Commit.prototype.nthGenAncestor = promisify(_Commit_nthGenAncestor);
var _Commit_parent = _Commit.prototype.parent;
_Commit.prototype.parent = promisify(_Commit_parent);
var _Config = rawApi.Config;
var _Config_getStringBuf = _Config.prototype.getStringBuf;
_Config.prototype.getStringBuf = promisify(_Config_getStringBuf);
var _Config_openDefault = _Config.openDefault;
_Config.openDefault = promisify(_Config_openDefault);
var _Config_setString = _Config.prototype.setString;
_Config.prototype.setString = promisify(_Config_setString);
var _Config_snapshot = _Config.prototype.snapshot;
_Config.prototype.snapshot = promisify(_Config_snapshot);
var _Cred = rawApi.Cred;
var _Cred_sshKeyMemoryNew = _Cred.sshKeyMemoryNew;
_Cred.sshKeyMemoryNew = promisify(_Cred_sshKeyMemoryNew);
var _Cred_usernameNew = _Cred.usernameNew;
_Cred.usernameNew = promisify(_Cred_usernameNew);
var _Diff = rawApi.Diff;
var _Diff_blobToBuffer = _Diff.blobToBuffer;
_Diff.blobToBuffer = promisify(_Diff_blobToBuffer);
var _Diff_findSimilar = _Diff.prototype.findSimilar;
_Diff.prototype.findSimilar = promisify(_Diff_findSimilar);
var _Diff_getPerfdata = _Diff.prototype.getPerfdata;
_Diff.prototype.getPerfdata = promisify(_Diff_getPerfdata);
var _Diff_indexToWorkdir = _Diff.indexToWorkdir;
_Diff.indexToWorkdir = promisify(_Diff_indexToWorkdir);
var _Diff_treeToIndex = _Diff.treeToIndex;
_Diff.treeToIndex = promisify(_Diff_treeToIndex);
var _Diff_treeToTree = _Diff.treeToTree;
_Diff.treeToTree = promisify(_Diff_treeToTree);
var _Diff_treeToWorkdir = _Diff.treeToWorkdir;
_Diff.treeToWorkdir = promisify(_Diff_treeToWorkdir);
var _Diff_treeToWorkdirWithIndex = _Diff.treeToWorkdirWithIndex;
_Diff.treeToWorkdirWithIndex = promisify(_Diff_treeToWorkdirWithIndex);
var _Fetch = rawApi.Fetch;
var _Filter = rawApi.Filter;
var _Filter_listNew = _Filter.listNew;
_Filter.listNew = promisify(_Filter_listNew);
var _Giterr = rawApi.Giterr;
var _Graph = rawApi.Graph;
var _Graph_aheadBehind = _Graph.aheadBehind;
_Graph.aheadBehind = promisify(_Graph_aheadBehind);
var _Hashsig = rawApi.Hashsig;
var _Hashsig_create = _Hashsig.create;
_Hashsig.create = promisify(_Hashsig_create);
var _Hashsig_createFromFile = _Hashsig.createFromFile;
_Hashsig.createFromFile = promisify(_Hashsig_createFromFile);
var _Ignore = rawApi.Ignore;
var _Index = rawApi.Index;
var _Index_addAll = _Index.prototype.addAll;
_Index.prototype.addAll = promisify(_Index_addAll);
var _Index_conflictGet = _Index.prototype.conflictGet;
_Index.prototype.conflictGet = promisify(_Index_conflictGet);
var _Index_open = _Index.open;
_Index.open = promisify(_Index_open);
var _Index_removeAll = _Index.prototype.removeAll;
_Index.prototype.removeAll = promisify(_Index_removeAll);
var _Index_updateAll = _Index.prototype.updateAll;
_Index.prototype.updateAll = promisify(_Index_updateAll);
var _Index_writeTree = _Index.prototype.writeTree;
_Index.prototype.writeTree = promisify(_Index_writeTree);
var _Index_writeTreeTo = _Index.prototype.writeTreeTo;
_Index.prototype.writeTreeTo = promisify(_Index_writeTreeTo);
var _Indexer = rawApi.Indexer;
var _Libgit2 = rawApi.Libgit2;
var _Merge = rawApi.Merge;
var _Merge_base = _Merge.base;
_Merge.base = promisify(_Merge_base);
var _Merge_bases = _Merge.bases;
_Merge.bases = promisify(_Merge_bases);
var _Merge_commits = _Merge.commits;
_Merge.commits = promisify(_Merge_commits);
var _Merge_trees = _Merge.trees;
_Merge.trees = promisify(_Merge_trees);
var _Note = rawApi.Note;
var _Note_create = _Note.create;
_Note.create = promisify(_Note_create);
var _Note_foreach = _Note.foreach;
_Note.foreach = promisify(_Note_foreach);
var _Note_iteratorNew = _Note.iteratorNew;
_Note.iteratorNew = promisify(_Note_iteratorNew);
var _Note_read = _Note.read;
_Note.read = promisify(_Note_read);
var _Note_remove = _Note.remove;
_Note.remove = promisify(_Note_remove);
var _Object = rawApi.Object;
var _Object_dup = _Object.prototype.dup;
_Object.prototype.dup = promisify(_Object_dup);
var _Object_lookup = _Object.lookup;
_Object.lookup = promisify(_Object_lookup);
var _Object_lookupByPath = _Object.prototype.lookupByPath;
_Object.prototype.lookupByPath = promisify(_Object_lookupByPath);
var _Object_lookupPrefix = _Object.lookupPrefix;
_Object.lookupPrefix = promisify(_Object_lookupPrefix);
var _Object_peel = _Object.prototype.peel;
_Object.prototype.peel = promisify(_Object_peel);
var _Object_shortId = _Object.prototype.shortId;
_Object.prototype.shortId = promisify(_Object_shortId);
var _Odb = rawApi.Odb;
var _Odb_open = _Odb.open;
_Odb.open = promisify(_Odb_open);
var _Odb_read = _Odb.prototype.read;
_Odb.prototype.read = promisify(_Odb_read);
var _Odb_write = _Odb.prototype.write;
_Odb.prototype.write = promisify(_Odb_write);
var _OdbObject = rawApi.OdbObject;
var _OdbObject_dup = _OdbObject.prototype.dup;
_OdbObject.prototype.dup = promisify(_OdbObject_dup);
var _Oid = rawApi.Oid;
var _Oidarray = rawApi.Oidarray;
var _Openssl = rawApi.Openssl;
var _Packbuilder = rawApi.Packbuilder;
var _Patch = rawApi.Patch;
var _Patch_fromBlobAndBuffer = _Patch.fromBlobAndBuffer;
_Patch.fromBlobAndBuffer = promisify(_Patch_fromBlobAndBuffer);
var _Patch_fromBlobs = _Patch.fromBlobs;
_Patch.fromBlobs = promisify(_Patch_fromBlobs);
var _Patch_fromDiff = _Patch.fromDiff;
_Patch.fromDiff = promisify(_Patch_fromDiff);
var _Patch_getHunk = _Patch.prototype.getHunk;
_Patch.prototype.getHunk = promisify(_Patch_getHunk);
var _Patch_getLineInHunk = _Patch.prototype.getLineInHunk;
_Patch.prototype.getLineInHunk = promisify(_Patch_getLineInHunk);
var _Pathspec = rawApi.Pathspec;
var _Pathspec_matchDiff = _Pathspec.prototype.matchDiff;
_Pathspec.prototype.matchDiff = promisify(_Pathspec_matchDiff);
var _Pathspec_matchIndex = _Pathspec.prototype.matchIndex;
_Pathspec.prototype.matchIndex = promisify(_Pathspec_matchIndex);
var _Pathspec_matchTree = _Pathspec.prototype.matchTree;
_Pathspec.prototype.matchTree = promisify(_Pathspec_matchTree);
var _Pathspec_matchWorkdir = _Pathspec.prototype.matchWorkdir;
_Pathspec.prototype.matchWorkdir = promisify(_Pathspec_matchWorkdir);
var _Push = rawApi.Push;
var _Rebase = rawApi.Rebase;
var _Rebase_init = _Rebase.init;
_Rebase.init = promisify(_Rebase_init);
var _Rebase_next = _Rebase.prototype.next;
_Rebase.prototype.next = promisify(_Rebase_next);
var _Rebase_open = _Rebase.open;
_Rebase.open = promisify(_Rebase_open);
var _Refdb = rawApi.Refdb;
var _Refdb_open = _Refdb.open;
_Refdb.open = promisify(_Refdb_open);
var _Reference = rawApi.Reference;
var _Reference_create = _Reference.create;
_Reference.create = promisify(_Reference_create);
var _Reference_createMatching = _Reference.createMatching;
_Reference.createMatching = promisify(_Reference_createMatching);
var _Reference_dwim = _Reference.dwim;
_Reference.dwim = promisify(_Reference_dwim);
var _Reference_list = _Reference.list;
_Reference.list = promisify(_Reference_list);
var _Reference_lookup = _Reference.lookup;
_Reference.lookup = promisify(_Reference_lookup);
var _Reference_nameToId = _Reference.nameToId;
_Reference.nameToId = promisify(_Reference_nameToId);
var _Reference_peel = _Reference.prototype.peel;
_Reference.prototype.peel = promisify(_Reference_peel);
var _Reference_rename = _Reference.prototype.rename;
_Reference.prototype.rename = promisify(_Reference_rename);
var _Reference_resolve = _Reference.prototype.resolve;
_Reference.prototype.resolve = promisify(_Reference_resolve);
var _Reference_setTarget = _Reference.prototype.setTarget;
_Reference.prototype.setTarget = promisify(_Reference_setTarget);
var _Reference_symbolicCreate = _Reference.symbolicCreate;
_Reference.symbolicCreate = promisify(_Reference_symbolicCreate);
var _Reference_symbolicCreateMatching = _Reference.symbolicCreateMatching;
_Reference.symbolicCreateMatching = promisify(_Reference_symbolicCreateMatching);
var _Reference_symbolicSetTarget = _Reference.prototype.symbolicSetTarget;
_Reference.prototype.symbolicSetTarget = promisify(_Reference_symbolicSetTarget);
var _Reflog = rawApi.Reflog;
var _Reflog_read = _Reflog.read;
_Reflog.read = promisify(_Reflog_read);
var _Refspec = rawApi.Refspec;
var _Remote = rawApi.Remote;
var _Remote_connect = _Remote.prototype.connect;
_Remote.prototype.connect = promisify(_Remote_connect);
var _Remote_createAnonymous = _Remote.createAnonymous;
_Remote.createAnonymous = promisify(_Remote_createAnonymous);
var _Remote_createWithFetchspec = _Remote.createWithFetchspec;
_Remote.createWithFetchspec = promisify(_Remote_createWithFetchspec);
var _Remote_delete = _Remote.delete;
_Remote.delete = promisify(_Remote_delete);
var _Remote_disconnect = _Remote.prototype.disconnect;
_Remote.prototype.disconnect = promisify(_Remote_disconnect);
var _Remote_download = _Remote.prototype.download;
_Remote.prototype.download = promisify(_Remote_download);
var _Remote_dup = _Remote.prototype.dup;
_Remote.prototype.dup = promisify(_Remote_dup);
var _Remote_fetch = _Remote.prototype.fetch;
_Remote.prototype.fetch = promisify(_Remote_fetch);
var _Remote_getFetchRefspecs = _Remote.prototype.getFetchRefspecs;
_Remote.prototype.getFetchRefspecs = promisify(_Remote_getFetchRefspecs);
var _Remote_getPushRefspecs = _Remote.prototype.getPushRefspecs;
_Remote.prototype.getPushRefspecs = promisify(_Remote_getPushRefspecs);
var _Remote_list = _Remote.list;
_Remote.list = promisify(_Remote_list);
var _Remote_lookup = _Remote.lookup;
_Remote.lookup = promisify(_Remote_lookup);
var _Remote_push = _Remote.prototype.push;
_Remote.prototype.push = promisify(_Remote_push);
var _Repository = rawApi.Repository;
var _Repository_config = _Repository.prototype.config;
_Repository.prototype.config = promisify(_Repository_config);
var _Repository_configSnapshot = _Repository.prototype.configSnapshot;
_Repository.prototype.configSnapshot = promisify(_Repository_configSnapshot);
var _Repository_discover = _Repository.discover;
_Repository.discover = promisify(_Repository_discover);
var _Repository_fetchheadForeach = _Repository.prototype.fetchheadForeach;
_Repository.prototype.fetchheadForeach = promisify(_Repository_fetchheadForeach);
var _Repository_head = _Repository.prototype.head;
_Repository.prototype.head = promisify(_Repository_head);
var _Repository_index = _Repository.prototype.index;
_Repository.prototype.index = promisify(_Repository_index);
var _Repository_init = _Repository.init;
_Repository.init = promisify(_Repository_init);
var _Repository_initExt = _Repository.initExt;
_Repository.initExt = promisify(_Repository_initExt);
var _Repository_odb = _Repository.prototype.odb;
_Repository.prototype.odb = promisify(_Repository_odb);
var _Repository_open = _Repository.open;
_Repository.open = promisify(_Repository_open);
var _Repository_openBare = _Repository.openBare;
_Repository.openBare = promisify(_Repository_openBare);
var _Repository_openExt = _Repository.openExt;
_Repository.openExt = promisify(_Repository_openExt);
var _Repository_refdb = _Repository.prototype.refdb;
_Repository.prototype.refdb = promisify(_Repository_refdb);
var _Repository_setHead = _Repository.prototype.setHead;
_Repository.prototype.setHead = promisify(_Repository_setHead);
var _Repository_wrapOdb = _Repository.wrapOdb;
_Repository.wrapOdb = promisify(_Repository_wrapOdb);
var _Reset = rawApi.Reset;
var _Reset_reset = _Reset.reset;
_Reset.reset = promisify(_Reset_reset);
var _Reset_default = _Reset.default;
_Reset.default = promisify(_Reset_default);
var _Revert = rawApi.Revert;
var _Revert_commit = _Revert.commit;
_Revert.commit = promisify(_Revert_commit);
var _Revparse = rawApi.Revparse;
var _Revparse_single = _Revparse.single;
_Revparse.single = promisify(_Revparse_single);
var _Revwalk = rawApi.Revwalk;
var _Revwalk_next = _Revwalk.prototype.next;
_Revwalk.prototype.next = promisify(_Revwalk_next);
var _Signature = rawApi.Signature;
var _Signature_dup = _Signature.prototype.dup;
_Signature.prototype.dup = promisify(_Signature_dup);
var _Stash = rawApi.Stash;
var _Stash_apply = _Stash.apply;
_Stash.apply = promisify(_Stash_apply);
var _Stash_drop = _Stash.drop;
_Stash.drop = promisify(_Stash_drop);
var _Stash_foreach = _Stash.foreach;
_Stash.foreach = promisify(_Stash_foreach);
var _Stash_pop = _Stash.pop;
_Stash.pop = promisify(_Stash_pop);
var _Stash_save = _Stash.save;
_Stash.save = promisify(_Stash_save);
var _Status = rawApi.Status;
var _Status_foreach = _Status.foreach;
_Status.foreach = promisify(_Status_foreach);
var _Status_foreachExt = _Status.foreachExt;
_Status.foreachExt = promisify(_Status_foreachExt);
var _StatusList = rawApi.StatusList;
var _StatusList_getPerfdata = _StatusList.prototype.getPerfdata;
_StatusList.prototype.getPerfdata = promisify(_StatusList_getPerfdata);
var _StatusList_create = _StatusList.create;
_StatusList.create = promisify(_StatusList_create);
var _Strarray = rawApi.Strarray;
var _Submodule = rawApi.Submodule;
var _Submodule_addSetup = _Submodule.addSetup;
_Submodule.addSetup = promisify(_Submodule_addSetup);
var _Submodule_lookup = _Submodule.lookup;
_Submodule.lookup = promisify(_Submodule_lookup);
var _Submodule_repoInit = _Submodule.prototype.repoInit;
_Submodule.prototype.repoInit = promisify(_Submodule_repoInit);
var _Submodule_resolveUrl = _Submodule.resolveUrl;
_Submodule.resolveUrl = promisify(_Submodule_resolveUrl);
var _Tag = rawApi.Tag;
var _Tag_annotationCreate = _Tag.annotationCreate;
_Tag.annotationCreate = promisify(_Tag_annotationCreate);
var _Tag_create = _Tag.create;
_Tag.create = promisify(_Tag_create);
var _Tag_createLightweight = _Tag.createLightweight;
_Tag.createLightweight = promisify(_Tag_createLightweight);
var _Tag_delete = _Tag.delete;
_Tag.delete = promisify(_Tag_delete);
var _Tag_list = _Tag.list;
_Tag.list = promisify(_Tag_list);
var _Tag_lookup = _Tag.lookup;
_Tag.lookup = promisify(_Tag_lookup);
var _Tag_lookupPrefix = _Tag.lookupPrefix;
_Tag.lookupPrefix = promisify(_Tag_lookupPrefix);
var _Transport = rawApi.Transport;
var _Transport_sshWithPaths = _Transport.sshWithPaths;
_Transport.sshWithPaths = promisify(_Transport_sshWithPaths);
var _Tree = rawApi.Tree;
var _Tree_entryByPath = _Tree.prototype.entryByPath;
_Tree.prototype.entryByPath = promisify(_Tree_entryByPath);
var _Tree_lookup = _Tree.lookup;
_Tree.lookup = promisify(_Tree_lookup);
var _Tree_lookupPrefix = _Tree.lookupPrefix;
_Tree.lookupPrefix = promisify(_Tree_lookupPrefix);
var _Treebuilder = rawApi.Treebuilder;
var _Treebuilder_insert = _Treebuilder.prototype.insert;
_Treebuilder.prototype.insert = promisify(_Treebuilder_insert);
var _Treebuilder_create = _Treebuilder.create;
_Treebuilder.create = promisify(_Treebuilder_create);
/* jshint ignore:end */
// Set the exports prototype to the raw API.
exports.__proto__ = rawApi;
var importExtension = function(name) {
try {
require("./" + name);
}
catch (unhandledException) {
if (unhandledException.code != "MODULE_NOT_FOUND") {
throw unhandledException;
}
}
};
// Load up utils
rawApi.Utils = {};
require("./utils/lookup_wrapper");
require("./utils/normalize_options");
require("./utils/shallow_clone");
// Load up extra types;
require("./convenient_line");
require("./convenient_hunk");
require("./convenient_patch");
require("./status_file");
require("./enums.js");
// Import extensions
importExtension("annotated_commit");
importExtension("attr");
importExtension("blame");
importExtension("blame_hunk");
importExtension("blame_options");
importExtension("blob");
importExtension("branch");
importExtension("branch_iterator");
importExtension("buf");
importExtension("cert");
importExtension("cert_hostkey");
importExtension("cert_x509");
importExtension("checkout");
importExtension("checkout_options");
importExtension("cherrypick");
importExtension("cherrypick_options");
importExtension("clone");
importExtension("clone_options");
importExtension("commit");
importExtension("config");
importExtension("config_entry");
importExtension("config_entry");
importExtension("cred");
importExtension("cred_default");
importExtension("cred_username");
importExtension("cred_userpass_payload");
importExtension("cvar_map");
importExtension("describe_format_options");
importExtension("describe_options");
importExtension("diff");
importExtension("diff_binary");
importExtension("diff_binary_file");
importExtension("diff_delta");
importExtension("diff_file");
importExtension("diff_find_options");
importExtension("diff_hunk");
importExtension("diff_line");
importExtension("diff_options");
importExtension("diff_options");
importExtension("diff_perfdata");
importExtension("diff_perfdata");
importExtension("diff_stats");
importExtension("error");
importExtension("fetch");
importExtension("fetch_options");
importExtension("fetch_options");
importExtension("filter");
importExtension("filter");
importExtension("filter_list");
importExtension("giterr");
importExtension("graph");
importExtension("hashsig");
importExtension("ignore");
importExtension("index");
importExtension("index_conflict_iterator");
importExtension("index_entry");
importExtension("index_time");
importExtension("indexer");
importExtension("libgit2");
importExtension("mempack");
importExtension("merge");
importExtension("merge_file_input");
importExtension("merge_file_options");
importExtension("merge_file_result");
importExtension("merge_options");
importExtension("merge_options");
importExtension("merge_result");
importExtension("message");
importExtension("note");
importExtension("note_iterator");
importExtension("object");
importExtension("odb");
importExtension("odb_object");
importExtension("oid");
importExtension("oid_shorten");
importExtension("oidarray");
importExtension("openssl");
importExtension("packbuilder");
importExtension("patch");
importExtension("pathspec");
importExtension("pathspec_match_list");
importExtension("push");
importExtension("push_options");
importExtension("push_update");
importExtension("rebase");
importExtension("rebase_operation");
importExtension("rebase_options");
importExtension("refdb");
importExtension("reference");
importExtension("reflog");
importExtension("reflog_entry");
importExtension("refspec");
importExtension("remote");
importExtension("remote_callbacks");
importExtension("remote_callbacks");
importExtension("repository");
importExtension("repository_init_options");
importExtension("reset");
importExtension("revert");
importExtension("revert_options");
importExtension("revparse");
importExtension("revwalk");
importExtension("signature");
importExtension("smart");
importExtension("stash");
importExtension("stash_apply_options");
importExtension("status");
importExtension("status_entry");
importExtension("status_list");
importExtension("status_options");
importExtension("strarray");
importExtension("submodule");
importExtension("submodule_update_options");
importExtension("tag");
importExtension("time");
importExtension("trace");
importExtension("transaction");
importExtension("transfer_progress");
importExtension("transport");
importExtension("tree");
importExtension("tree_entry");
importExtension("treebuilder");
importExtension("writestream");
/* jshint ignore:start */
// Inherit directly from the original Cherrypick object.
_Cherrypick.cherrypick.__proto__ =
_Cherrypick;
// Ensure we're using the correct prototype.
_Cherrypick.cherrypick.prototype =
_Cherrypick.prototype;
// Assign the function as the root
rawApi.Cherrypick =
_Cherrypick.cherrypick;
// Inherit directly from the original Clone object.
_Clone.clone.__proto__ =
_Clone;
// Ensure we're using the correct prototype.
_Clone.clone.prototype =
_Clone.prototype;
// Assign the function as the root
rawApi.Clone =
_Clone.clone;
// Inherit directly from the original Merge object.
_Merge.merge.__proto__ =
_Merge;
// Ensure we're using the correct prototype.
_Merge.merge.prototype =
_Merge.prototype;
// Assign the function as the root
rawApi.Merge =
_Merge.merge;
// Inherit directly from the original Reset object.
_Reset.reset.__proto__ =
_Reset;
// Ensure we're using the correct prototype.
_Reset.reset.prototype =
_Reset.prototype;
// Assign the function as the root
rawApi.Reset =
_Reset.reset;
// Inherit directly from the original Revert object.
_Revert.revert.__proto__ =
_Revert;
// Ensure we're using the correct prototype.
_Revert.revert.prototype =
_Revert.prototype;
// Assign the function as the root
rawApi.Revert =
_Revert.revert;
/* jshint ignore:end */
// Wrap asynchronous methods to return promises.
promisify(exports);
// Set version.
exports.version = require("../package").version;
// Expose Promise implementation.
exports.Promise = Promise;
// Initialize libgit2.
exports.Libgit2.init(); | 29.281364 | 81 | 0.809651 |
185072022e9504798799f8af8b40ddbcc731125a | 1,202 | js | JavaScript | middlewares/errors.js | z4o4z/events-aggregator-backend | 6c3038567739023491ea2712d83728d301137188 | [
"MIT"
] | 1 | 2018-10-29T07:32:11.000Z | 2018-10-29T07:32:11.000Z | middlewares/errors.js | z4o4z/events-aggregator-backend | 6c3038567739023491ea2712d83728d301137188 | [
"MIT"
] | null | null | null | middlewares/errors.js | z4o4z/events-aggregator-backend | 6c3038567739023491ea2712d83728d301137188 | [
"MIT"
] | null | null | null | const logger = require('../helpers/get-logger')(__filename);
const { ERROR_CODES, ERROR_MESSAGES } = require('../constants');
const errors = () => async (ctx, next) => {
try {
await next();
} catch (err) {
let { code, message } = err;
const { status, payload } = err;
ctx.status = status || 400;
if (ctx.errors && ctx.errors.length) {
logger.debug('errors - path=%s, state=%j, errors=%j', ctx.path, ctx.state, ctx.errors);
code = ERROR_CODES.REQUEST_VALIDATION_ERROR;
message = ctx.errors.reduce((errs, error) => Object.assign(errs, error), {});
} else if (status && status < 500) {
logger.info(
'errors - path=%s, state=%j, message=%s, payload=%j',
ctx.path,
ctx.state,
message,
payload
);
} else {
logger.error(
'errors - path=%s, state=%j, message=%s, stack=%s',
ctx.path,
ctx.state,
message,
err.stack
);
code = ERROR_CODES.SERVER_ERROR;
message = process.env.NODE_ENV === 'production' ? ERROR_MESSAGES.SERVER_ERROR : message;
ctx.status = 500;
}
ctx.body = { code, message };
}
};
module.exports = errors;
| 25.574468 | 94 | 0.56406 |
1851a67d74ee7e63786c6a4ded5ca5b94f0fe3ed | 515 | js | JavaScript | assets/ckeditor/plugins/easyimage/lang/ro.js | yusrilfahmialfaizi/runsystemdms | d0f7cd83dc8eb2d0b7cccde92f314e7a48cc98ac | [
"MIT"
] | null | null | null | assets/ckeditor/plugins/easyimage/lang/ro.js | yusrilfahmialfaizi/runsystemdms | d0f7cd83dc8eb2d0b7cccde92f314e7a48cc98ac | [
"MIT"
] | null | null | null | assets/ckeditor/plugins/easyimage/lang/ro.js | yusrilfahmialfaizi/runsystemdms | d0f7cd83dc8eb2d0b7cccde92f314e7a48cc98ac | [
"MIT"
] | null | null | null | /**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'easyimage', 'ro', {
commands: {
fullImage: 'Imagine mărime întreagă',
sideImage: 'Imagine laterală',
altText: 'Modificați textul alternativ al imaginii',
upload: 'Upload Image' // MISSING
},
uploadFailed: 'Imaginea dumneavoastră se poate să nu se fi încărcat datorită unei erori de rețea.'
} );
| 34.333333 | 99 | 0.724272 |
1851dadb36975934d9f6dc95c370ec6f1df06ef8 | 647 | js | JavaScript | .original/nonslax/20210519/public/js/chrome/settings.js | skynode-integration/skynode-jsbin | e7f823aeab49bd9cb4632d50a904247caa356ed7 | [
"MIT"
] | null | null | null | .original/nonslax/20210519/public/js/chrome/settings.js | skynode-integration/skynode-jsbin | e7f823aeab49bd9cb4632d50a904247caa356ed7 | [
"MIT"
] | 7 | 2020-09-08T04:29:40.000Z | 2021-08-31T06:52:52.000Z | .original/nonslax/20210519/public/js/chrome/settings.js | skynode-integration/skynode-jsbin | e7f823aeab49bd9cb4632d50a904247caa356ed7 | [
"MIT"
] | null | null | null | /*global jsbin, $*/
var settings = {
save: function (callback) {
localStorage.setItem('settings', JSON.stringify(jsbin.settings));
if (!callback) {
callback = function () {};
}
$.ajax({
url: '/account/editor',
type: 'POST',
dataType: 'json',
data: {
settings: localStorage.settings,
_csrf: jsbin.state.token
},
success: function () {
if (console && console.log) {
console.log('settings saved');
}
callback(true);
},
error: function (xhr, status) {
callback(false);
}
});
}
}; | 22.310345 | 70 | 0.489954 |
185229fb0b6000a20492805ef60b44498a173b3e | 60 | js | JavaScript | src/redux/actions/indicesIndexDataActions.js | danawalab/dsearch-console | a18464f684dff29664e771017fbb238da0ac2583 | [
"Apache-2.0"
] | 3 | 2021-02-27T07:24:20.000Z | 2022-03-01T12:25:14.000Z | src/redux/actions/indicesIndexDataActions.js | danawalab/dsearch-console | a18464f684dff29664e771017fbb238da0ac2583 | [
"Apache-2.0"
] | 1 | 2021-01-07T09:49:00.000Z | 2021-01-07T09:49:00.000Z | src/redux/actions/indicesIndexDataActions.js | danawalab/dsearch-console | a18464f684dff29664e771017fbb238da0ac2583 | [
"Apache-2.0"
] | null | null | null | import Client from '~/Client'
const client = new Client()
| 12 | 29 | 0.7 |
185273b955959c21a3b954b845c0fe469d87d3b7 | 1,672 | js | JavaScript | scripts/components/ItemEmploymentHistory.js | smartface/sample-self-service | a563ec84685efa872d85dad9ce226d6b8f41cf1a | [
"MIT"
] | 7 | 2016-12-11T06:56:17.000Z | 2019-06-05T20:41:26.000Z | scripts/components/ItemEmploymentHistory.js | smartface/sample-self-service | a563ec84685efa872d85dad9ce226d6b8f41cf1a | [
"MIT"
] | 1 | 2018-07-11T08:33:02.000Z | 2018-07-11T08:33:02.000Z | scripts/components/ItemEmploymentHistory.js | smartface/sample-self-service | a563ec84685efa872d85dad9ce226d6b8f41cf1a | [
"MIT"
] | 11 | 2016-12-13T19:27:57.000Z | 2019-05-07T07:10:04.000Z | /*global lang*/
const extend = require('js-base/core/extend');
const ItemEmploymentHistory = require('library/ItemEmploymentHistory');
var startID = 512;
const ItemEmploymentHistory_ = extend(ItemEmploymentHistory)(
//constructor
function(_super, props, pageName){
//delete ItemEmploymentHistory.defaults.width;
_super(this, props || ItemEmploymentHistory.defaults );
this.pageName = pageName;
this.row1.title.text = lang["pgEmploymentHistory.jobTitle"];
this.row2.title.text = lang["pgEmploymentHistory.payroll"];
this.row3.title.text = lang["pgEmploymentHistory.manager"];
this.row4.title.text = lang["pgEmploymentHistory.grade"];
this.row5.title.text = lang["pgEmploymentHistory.startDate"];
this.row6.title.text = lang["pgEmploymentHistory.endDate"];
var _employment;
startID = 512;
setIDs(this);
Object.defineProperties(this, {
'employment': {
get: function() {
return _employment;
},
set: function(value) {
_employment = value;
invalidate(this);
}
}
});
}
);
function invalidate(item)
{
item.headerTitle.text = item.employment.companyName;
item.row1.value.text = item.employment.jobTitle;
item.row2.value.text = item.employment.payroll;
item.row3.value.text = item.employment.manager;
item.row4.value.text = item.employment.grade;
item.row5.value.text = item.employment.startDate;
item.row6.value.text = item.employment.endDate;
}
function setIDs(item){
var keys = Object.keys(item.children);
keys.forEach( key => {
item.children[key].id = ++startID;
if(item.children[key].children){
setIDs(item.children[key]);
}
});
}
module && (module.exports = ItemEmploymentHistory_);
| 28.827586 | 71 | 0.722488 |
18528bcbee59bd0a41a929aa7dcc9747f006a168 | 2,248 | js | JavaScript | src/Sulu/Bundle/AdminBundle/Resources/js/containers/Link/tests/registries/LinkTypeRegistry.test.js | mavuio/sulu | ee6e61de48f20d1514e4f2bf9fc49401a5882000 | [
"MIT"
] | 742 | 2016-04-01T12:29:52.000Z | 2022-03-31T15:23:06.000Z | src/Sulu/Bundle/AdminBundle/Resources/js/containers/Link/tests/registries/LinkTypeRegistry.test.js | mavuio/sulu | ee6e61de48f20d1514e4f2bf9fc49401a5882000 | [
"MIT"
] | 2,872 | 2016-03-30T13:40:10.000Z | 2022-03-31T14:48:35.000Z | src/Sulu/Bundle/AdminBundle/Resources/js/containers/Link/tests/registries/LinkTypeRegistry.test.js | mavuio/sulu | ee6e61de48f20d1514e4f2bf9fc49401a5882000 | [
"MIT"
] | 426 | 2016-04-04T06:38:49.000Z | 2022-03-29T03:53:05.000Z | // @flow
import React from 'react';
import linkTypeRegistry from '../../registries/linkTypeRegistry';
beforeEach(() => {
linkTypeRegistry.clear();
});
test('Clear all information from linkTypeRegistry', () => {
const Component = () => (<div />);
linkTypeRegistry.add('test1', Component, 'Test1');
expect(Object.keys(linkTypeRegistry.titles)).toHaveLength(1);
expect(Object.keys(linkTypeRegistry.overlays)).toHaveLength(1);
expect(Object.keys(linkTypeRegistry.options)).toHaveLength(1);
linkTypeRegistry.clear();
expect(Object.keys(linkTypeRegistry.titles)).toHaveLength(0);
expect(Object.keys(linkTypeRegistry.overlays)).toHaveLength(0);
expect(Object.keys(linkTypeRegistry.options)).toHaveLength(0);
});
test('Add internal link type to LinkTypeRegistry', () => {
const Component = () => (<div />);
const options = {
displayProperties: ['title'],
emptyText: 'empty',
icon: 'icon',
listAdapter: 'listAdapter',
overlayTitle: 'overlayTitle',
resourceKey: 'resourceKey',
};
linkTypeRegistry.add('test1', Component, 'Test1', options);
linkTypeRegistry.add('test2', Component, 'Test2');
expect(linkTypeRegistry.getTitle('test1')).toBe('Test1');
expect(linkTypeRegistry.getOverlay('test1')).toBe(Component);
expect(linkTypeRegistry.getOptions('test1')).toBe(options);
expect(linkTypeRegistry.getTitle('test2')).toBe('Test2');
expect(linkTypeRegistry.getOverlay('test2')).toBe(Component);
expect(linkTypeRegistry.getOptions('test2')).toBe(undefined);
});
test('Add internal link type with existing key should throw', () => {
const Component = () => (<div />);
linkTypeRegistry.add('test1', Component, 'Test1');
expect(() => linkTypeRegistry.add('test1', Component, 'test1 react component')).toThrow(/test1/);
});
test('Get internal link title of not existing key', () => {
expect(() => linkTypeRegistry.getTitle('XXX')).toThrow();
});
test('Get internal link overlay of not existing key', () => {
expect(() => linkTypeRegistry.getOverlay('XXX')).toThrow();
});
test('Get internal link options of not existing key', () => {
expect(() => linkTypeRegistry.getOptions('XXX')).toThrow();
});
| 35.125 | 101 | 0.672153 |
1852bb151ba08abb1ff40a7acd61de9bb19af87b | 1,637 | js | JavaScript | src/logic/calculate.js | kelvin8773/my-calculator | 6e0cf4e078f06ba0cc860da3f7cf0845dd4ea315 | [
"MIT"
] | 1 | 2020-02-22T14:07:46.000Z | 2020-02-22T14:07:46.000Z | src/logic/calculate.js | kelvin8773/my-calculator | 6e0cf4e078f06ba0cc860da3f7cf0845dd4ea315 | [
"MIT"
] | 5 | 2021-03-10T06:54:58.000Z | 2022-02-26T23:20:03.000Z | src/logic/calculate.js | kelvin8773/my-calculator | 6e0cf4e078f06ba0cc860da3f7cf0845dd4ea315 | [
"MIT"
] | null | null | null | import Operate from './operate';
import Num from '../utilities/num';
import {
DIGITS,
OPERATIONS,
OTHER_BUTTON,
} from '../utilities/constants';
const Calculate = (data, buttonName) => {
let {
next, operation, total, finish,
} = data;
let [numOne, numTwo] = next ? next.split(' ') : [];
try {
if (DIGITS.includes(buttonName)) {
if (numTwo || operation) {
numTwo = numTwo ? Num.updateDigits(numTwo, buttonName) : buttonName;
} else {
numOne = numOne ? Num.updateDigits(numOne, buttonName) : buttonName;
}
} else if (OPERATIONS.includes(buttonName)) {
if (numOne || numTwo) operation = buttonName;
} else if (OTHER_BUTTON.includes(buttonName)) {
switch (buttonName) {
case 'AC':
numOne = null;
numTwo = null;
operation = null;
total = null;
break;
case '+/-':
if (numTwo) {
numTwo = Num.updateSign(numTwo);
} else {
numOne = Num.updateSign(numOne);
}
break;
case '%':
if (numTwo) {
numTwo = Num.updatePercent(numTwo);
} else {
numOne = Num.updatePercent(numOne);
}
break;
case '=':
finish = true;
break;
default:
}
}
if (!numTwo) {
total = numOne;
} else {
total = Operate(numOne, numTwo, operation);
}
} catch (e) {
total = ' ~Invalid Input~ ';
}
next = [numOne, numTwo].join(' ');
return {
operation,
next,
total,
finish,
};
};
export default Calculate;
| 22.736111 | 76 | 0.516188 |
1852eb5f555d3f8f5c9c8c404f230c28973a0c23 | 551 | js | JavaScript | web-react/src/components/atoms/InitialPayment.js | euonymus-prod/estate | 90e2a03cf428e91416dfd050d001159637e5faae | [
"Apache-2.0"
] | null | null | null | web-react/src/components/atoms/InitialPayment.js | euonymus-prod/estate | 90e2a03cf428e91416dfd050d001159637e5faae | [
"Apache-2.0"
] | null | null | null | web-react/src/components/atoms/InitialPayment.js | euonymus-prod/estate | 90e2a03cf428e91416dfd050d001159637e5faae | [
"Apache-2.0"
] | null | null | null | import PropTypes from 'prop-types'
import InitialFee from './InitialFee'
import MonthlyFee from './MonthlyFee'
import FreeRent from './FreeRent'
export default function InitialPayment({ contract, forPrint }) {
const initialFee = InitialFee({ contract })
const monthlyFee = MonthlyFee({ contract })
const freeRent = FreeRent({ contract })
let ret = initialFee + monthlyFee - freeRent
if (forPrint) {
ret = ret.toLocaleString()
}
return ret
}
InitialPayment.propTypes = {
contract: PropTypes.object,
forPrint: PropTypes.bool,
}
| 25.045455 | 64 | 0.725953 |
18530ad7f5e24ef8a636abc4f72958baaf697488 | 697 | js | JavaScript | src/index.js | artdecocode/mondo-bongo | 57e65525bcca2c1c7a2139a32e8cf95d22dc212a | [
"MIT"
] | 1 | 2019-02-07T08:42:24.000Z | 2019-02-07T08:42:24.000Z | src/index.js | artdecocode/mondo-bongo | 57e65525bcca2c1c7a2139a32e8cf95d22dc212a | [
"MIT"
] | null | null | null | src/index.js | artdecocode/mondo-bongo | 57e65525bcca2c1c7a2139a32e8cf95d22dc212a | [
"MIT"
] | null | null | null | import { debuglog } from 'util'
const LOG = debuglog('mondo-bongo')
/**
* The Lightweight MongoDB Interface.
* @param {Config} [config] Options for the program.
* @param {boolean} [config.shouldRun=true] A boolean option. Default `true`.
* @param {string} config.text A text to return.
*/
export default async function mondoBongo(config = {}) {
const {
shouldRun = true,
text,
} = config
if (!shouldRun) return
LOG('mondo-bongo called with %s', text)
return text
}
/* documentary types/index.xml */
/**
* @typedef {Object} Config Options for the program.
* @prop {boolean} [shouldRun=true] A boolean option. Default `true`.
* @prop {string} text A text to return.
*/
| 25.814815 | 77 | 0.672884 |
185348204677fb22b7b26151c366a4794c14fe1f | 2,861 | js | JavaScript | portfolio/node_modules/@sanity/base/lib/__legacy/@sanity/components/progress/ProgressCircle.js | cpesar/my-portfolio | 448f04a72060de5f44800ecd2a079dff453b2e8a | [
"MIT"
] | null | null | null | portfolio/node_modules/@sanity/base/lib/__legacy/@sanity/components/progress/ProgressCircle.js | cpesar/my-portfolio | 448f04a72060de5f44800ecd2a079dff453b2e8a | [
"MIT"
] | null | null | null | portfolio/node_modules/@sanity/base/lib/__legacy/@sanity/components/progress/ProgressCircle.js | cpesar/my-portfolio | 448f04a72060de5f44800ecd2a079dff453b2e8a | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _circleStyle = _interopRequireDefault(require("part:@sanity/components/progress/circle-style"));
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// @todo: remove the following line when part imports has been removed from this file
///<reference types="@sanity/types/parts" />
var radiusFactor = 1.3;
class ProgressCircle extends _react.default.PureComponent {
render() {
var _this$props = this.props,
_this$props$percent = _this$props.percent,
percent = _this$props$percent === void 0 ? 0 : _this$props$percent,
text = _this$props.text,
style = _this$props.style,
showPercent = _this$props.showPercent,
isComplete = _this$props.isComplete;
var radius = 50;
var strokeWidth = 10;
var width = radius * 2;
var height = radius * 2;
var viewBox = "0 0 ".concat(width, " ").concat(height);
var dashArray = radius * Math.PI * 2;
var dashOffset = dashArray - dashArray * percent / 100;
return /*#__PURE__*/_react.default.createElement("div", {
className: isComplete ? _circleStyle.default.completed : _circleStyle.default.unCompleted,
style: style
}, /*#__PURE__*/_react.default.createElement("svg", {
className: _circleStyle.default.svg,
width: width,
height: height,
viewBox: viewBox
}, /*#__PURE__*/_react.default.createElement("circle", {
className: _circleStyle.default.background,
cx: radius,
cy: radius,
r: radius - strokeWidth,
strokeWidth: "".concat(strokeWidth, "px")
}), /*#__PURE__*/_react.default.createElement("circle", {
className: _circleStyle.default.foreground,
cx: radius,
cy: radius,
r: radius - strokeWidth,
strokeWidth: "".concat(strokeWidth, "px"),
style: {
strokeDasharray: dashArray,
strokeDashoffset: dashOffset
}
}), /*#__PURE__*/_react.default.createElement("circle", {
className: _circleStyle.default.activeCircle,
cx: radius,
cy: radius,
r: radius - 1,
style: {
strokeDasharray: Math.PI,
strokeDashoffset: Math.PI
}
}), showPercent && /*#__PURE__*/_react.default.createElement("text", {
className: _circleStyle.default.percent,
x: radius,
y: text ? radius - 5 : radius,
dy: ".4em",
textAnchor: "middle"
}, "".concat(Math.round(percent), "%")), text && /*#__PURE__*/_react.default.createElement("text", {
className: _circleStyle.default.status,
x: radius,
y: radius * radiusFactor - 5,
dy: ".4em",
textAnchor: "middle"
}, text)));
}
}
exports.default = ProgressCircle; | 34.059524 | 104 | 0.641384 |
18536044fc67de0c6cd1f60d739d58d8ecce2de5 | 283 | js | JavaScript | public/master/admin2/hasnain.js | winasismahendra/ppp | 58f65a385a7a62ef6e6a42b71226c880dfc84bf2 | [
"MIT"
] | null | null | null | public/master/admin2/hasnain.js | winasismahendra/ppp | 58f65a385a7a62ef6e6a42b71226c880dfc84bf2 | [
"MIT"
] | null | null | null | public/master/admin2/hasnain.js | winasismahendra/ppp | 58f65a385a7a62ef6e6a42b71226c880dfc84bf2 | [
"MIT"
] | null | null | null | $(document).ready(function() {
$(".btn-success").click(function(){
var html = $(".clone").html();
$(".increment").after(html);
});
$("body").on("click",".btn-danger",function(){
$(this).parents(".control-group").remove();
});
}); | 23.583333 | 53 | 0.477032 |
1853882c4a0ed3f5f9ef22472db894f7f91fbb8b | 1,854 | js | JavaScript | foxxy/foxx/datasets/models/pages.js | fadlee/fasty | 608f23f265a583044a9faf91944b7c70e5471f7e | [
"MIT"
] | 158 | 2019-05-27T19:19:11.000Z | 2022-03-25T19:23:14.000Z | foxxy/foxx/datasets/models/pages.js | fadlee/fasty | 608f23f265a583044a9faf91944b7c70e5471f7e | [
"MIT"
] | 13 | 2019-06-07T16:52:00.000Z | 2021-11-18T20:35:32.000Z | foxxy/foxx/datasets/models/pages.js | fadlee/fasty | 608f23f265a583044a9faf91944b7c70e5471f7e | [
"MIT"
] | 12 | 2019-08-20T12:11:26.000Z | 2022-03-25T19:37:49.000Z | const model = function () {
return {
model: [
{ r: true, c: "3-4", n: "name", t: "string", j: "joi.string().required()", l: "Name", tr: true },
{ r: false, c: "1-4", n: "layout_id", t: "list", j: "joi.string().required()", l: "Layout", d: "FOR doc in layouts RETURN [doc._id, doc.name]" },
{ r: true, c: "1-1", n: "slug", t: "string", j: "joi.string().required()", l: "Slug", tr: true },
{ r: true, c: "1-1", n: "raw_html", t: "code:html", j: "joi.any()", l: "HTML", tr: true },
{ r: true, c: "1-1", n: "html", t: "html", j: "joi.any()", l: "Content", tr: true },
{ r: true, c: "1-1", n: "description", t: "text", j: "joi.any()", l: "Description", tr: true },
{ r: true, c: "1-1", n: "og_title", t: "string", j: "joi.any()", l: "og:title", tr: true },
{ r: true, c: "1-1", n: "og_img", t: "string", j: "joi.any()", l: "og:img", tr: true },
{ r: true, c: "1-1", n: "og_type", t: "string", j: "joi.any()", l: "og:type", tr: true },
{ r: true, c: "1-1", n: "canonical", t: "string", j: "joi.any()", l: "Canonical URL", tr: true },
{ r: true, c: "1-1", n: "og_aql", t: "code:aql", j: "joi.any()", l: "og:aql", tr: true },
{ r: true, c: "1-2", n: "ba_login", t: "string", j: "joi.any()", l: "Basic Auth : Username" },
{ r: false, c: "1-2", n: "ba_pass", t: "string", j: "joi.any()", l: "Basic Auth : Password" }
],
collection: "pages",
singular: "page",
columns: [
{ name: "name", tr: true },
{ name: "slug", tr: true },
{ name: "online", toggle: true, values: { true: "online", false: "offline" } },
{ name: "published_at" },
],
roles: {
read: ['editor', 'developer', 'admin'],
write: ['editor', 'developer', 'admin']
},
act_as_tree: true,
sort: "SORT doc.name[@lang] ASC"
}
}
module.exports = model | 52.971429 | 151 | 0.484898 |
1281ee263f3bf92ca9ed9483af46033ed4f24988 | 1,130 | js | JavaScript | src/ui/public/agg_response/geo_json/_tooltip_formatter.js | HowookJeong/kibana | 5628ac3052e7e907787508f337af055c3702d637 | [
"Apache-2.0"
] | null | null | null | src/ui/public/agg_response/geo_json/_tooltip_formatter.js | HowookJeong/kibana | 5628ac3052e7e907787508f337af055c3702d637 | [
"Apache-2.0"
] | null | null | null | src/ui/public/agg_response/geo_json/_tooltip_formatter.js | HowookJeong/kibana | 5628ac3052e7e907787508f337af055c3702d637 | [
"Apache-2.0"
] | null | null | null | import $ from 'jquery';
import _ from 'lodash';
import { fieldFormats } from 'ui/registry/field_formats';
export function TileMapTooltipFormatterProvider($compile, $rootScope) {
const $tooltipScope = $rootScope.$new();
const $el = $('<div>').html(require('ui/agg_response/geo_json/_tooltip.html'));
$compile($el)($tooltipScope);
return function tooltipFormatter(feature) {
if (!feature) return '';
const value = feature.properties.value;
const acr = feature.properties.aggConfigResult;
const vis = acr.aggConfig.vis;
const metricAgg = acr.aggConfig;
let geoFormat = _.get(vis.getAggConfig(), 'byTypeName.geohash_grid[0].format');
if (!geoFormat) geoFormat = fieldFormats.getDefaultInstance('geo_point');
$tooltipScope.details = [
{
label: metricAgg.makeLabel(),
value: metricAgg.fieldFormatter()(value)
},
{
label: 'Latitude',
value: feature.geometry.coordinates[1]
},
{
label: 'Longitude',
value: feature.geometry.coordinates[0]
}
];
$tooltipScope.$apply();
return $el.html();
};
}
| 26.27907 | 83 | 0.646903 |
12828950151f75946992cf411632a51ae731ee13 | 2,252 | js | JavaScript | src/components/elements/LandingPartners.js | GolosChain/golos.io | d7e1f766f6a25ba9808dd9039ae742ebcc677f06 | [
"MIT"
] | 5 | 2016-09-12T22:48:49.000Z | 2019-06-01T14:29:51.000Z | src/components/elements/LandingPartners.js | GolosChain/golos.io | d7e1f766f6a25ba9808dd9039ae742ebcc677f06 | [
"MIT"
] | 363 | 2016-09-15T14:23:06.000Z | 2021-12-09T01:09:15.000Z | src/components/elements/LandingPartners.js | GolosChain/golos.io | d7e1f766f6a25ba9808dd9039ae742ebcc677f06 | [
"MIT"
] | 7 | 2016-09-26T18:27:43.000Z | 2020-10-29T19:14:01.000Z | import React from 'react';
export default class LandingPartners extends React.Component {
render() {
return (
<section className="Partners">
<div className="row text-center">
<div className="small-12 columns">
<h2 id="partners">Партнеры</h2>
</div>
</div>
<div className="row text-center Partners__logos align-center align-middle">
<div className="small-6 medium-3 columns">
<a href="https://explorer.golos.io/" target="blank">
<img src="../../static/images/landing/l7.jpg" alt="Golos Explorer" />
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="https://kuna.com.ua/" target="blank">
<img
className="Partners__kuna-logo"
src="../../static/images/landing/kuna.png"
alt="Kuna"
/>
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="https://forklog.com/" target="blank">
<img
className="Partners__forklog-logo"
src="../../static/images/landing/forklog-logo.svg"
alt="Forklog"
/>
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="http://steepshot.io/" target="blank">
<img src="../../static/images/landing/l8.jpg" alt="Steepshot" />
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="https://goldvoice.club/" target="blank">
<img src="../../static/images/landing/l9.jpg" alt="GoldVoice" />
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="https://golos.today/" target="blank">
<img src="../../static/images/landing/l16.jpg" alt="Golos Today" />
</a>
</div>
<div className="small-6 medium-3 columns">
<a href="https://cpeda.space/" target="blank">
<img src="../../static/images/landing/l12.jpg" alt="CPEDA.SPACE" />
</a>
</div>
</div>
<hr />
</section>
);
}
}
| 36.322581 | 83 | 0.489343 |
1282def90b3679785c5f55c98f834c1bc545bb33 | 1,360 | js | JavaScript | test/ava.test.js | mick-whats/boilerPlate-node-coffee-ava | aca86a3ea1a2f2caebb066505a3840e9a63bf687 | [
"MIT"
] | null | null | null | test/ava.test.js | mick-whats/boilerPlate-node-coffee-ava | aca86a3ea1a2f2caebb066505a3840e9a63bf687 | [
"MIT"
] | null | null | null | test/ava.test.js | mick-whats/boilerPlate-node-coffee-ava | aca86a3ea1a2f2caebb066505a3840e9a63bf687 | [
"MIT"
] | null | null | null | // Generated by CoffeeScript 2.3.1
(function() {
var _, assert, sleep, start, test;
assert = require('assert');
_ = require('xza').lodash;
({test} = require('ava'));
sleep = function(date, ms = 100) {
return new Promise(function(resolve, reject) {
return setTimeout(function() {
return resolve(new Date() - date);
}, ms);
});
};
start = null;
test.serial.before(function(t) {
return start = new Date();
});
test('lodash', function(t) {
return t.is(_.sizeof({
a: 1
}), '10 B');
});
test('test_1', async function(t) {
var now;
now = (await sleep(start));
t.log(now);
return t.pass();
});
test('test_2', async function(t) {
var now;
now = (await sleep(start));
t.log(now);
return t.pass();
});
test('test_3', async function(t) {
var now;
now = (await sleep(start));
t.log(now);
return t.pass();
});
test.serial('test_4', async function(t) {
var now;
now = (await sleep(start));
t.log(now);
return t.pass();
});
test.serial('test_5', async function(t) {
var now;
now = (await sleep(start, 500));
t.log(now);
return t.pass();
});
test.serial('test_6', async function(t) {
var now;
now = (await sleep(start, 1000));
t.log(now);
return t.pass();
});
}).call(this);
| 18.378378 | 50 | 0.542647 |
12840dbef69a698abcb40033961640d329c7ecdb | 21,366 | js | JavaScript | www/pages-ebodyparts-ebodyparts-module-es5.js | vnot01/SixPack-v1 | bc8a1ed00252aedb89e23928fd8316e442a0895e | [
"MIT"
] | null | null | null | www/pages-ebodyparts-ebodyparts-module-es5.js | vnot01/SixPack-v1 | bc8a1ed00252aedb89e23928fd8316e442a0895e | [
"MIT"
] | null | null | null | www/pages-ebodyparts-ebodyparts-module-es5.js | vnot01/SixPack-v1 | bc8a1ed00252aedb89e23928fd8316e442a0895e | [
"MIT"
] | null | null | null | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pages-ebodyparts-ebodyparts-module"],{
/***/ "./node_modules/raw-loader/index.js!./src/app/pages/ebodyparts/ebodyparts.page.html":
/*!*********************************************************************************!*\
!*** ./node_modules/raw-loader!./src/app/pages/ebodyparts/ebodyparts.page.html ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<ion-header class=\"lightheader\" no-border>\n <ion-toolbar mode=\"ios\">\n <ion-title class=\"ion-text-capitalize\">\n {{title}}\n </ion-title>\n <ion-buttons slot=\"start\">\n <app-backbutton color=\"dark\"></app-backbutton>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n\n<ion-content>\n \n<app-loading *ngIf=\"isLoading\"></app-loading>\n \n <app-empty *ngIf=\"exercises.length === 0\" [title]=\"strings.ST140\"></app-empty>\n\n <ion-list lines=\"none\" class=\"ion-padding-top\">\n\n <ion-item *ngFor=\"let item of exercises\" [routerLink]=\"['/edetails', item.exercise_id]\">\n <ion-avatar slot=\"start\">\n <img [src]=\"item.exercise_image | image\">\n </ion-avatar>\n <ion-label>{{item.exercise_title}}</ion-label>\n </ion-item>\n\n </ion-list>\n\n</ion-content>\n"
/***/ }),
/***/ "./src/app/pages/ebodyparts/ebodyparts-routing.module.ts":
/*!***************************************************************!*\
!*** ./src/app/pages/ebodyparts/ebodyparts-routing.module.ts ***!
\***************************************************************/
/*! exports provided: EbodypartsPageRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EbodypartsPageRoutingModule", function() { return EbodypartsPageRoutingModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _ebodyparts_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ebodyparts.page */ "./src/app/pages/ebodyparts/ebodyparts.page.ts");
var routes = [
{
path: '',
component: _ebodyparts_page__WEBPACK_IMPORTED_MODULE_3__["EbodypartsPage"]
}
];
var EbodypartsPageRoutingModule = /** @class */ (function () {
function EbodypartsPageRoutingModule() {
}
EbodypartsPageRoutingModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes)],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]],
})
], EbodypartsPageRoutingModule);
return EbodypartsPageRoutingModule;
}());
/***/ }),
/***/ "./src/app/pages/ebodyparts/ebodyparts.module.ts":
/*!*******************************************************!*\
!*** ./src/app/pages/ebodyparts/ebodyparts.module.ts ***!
\*******************************************************/
/*! exports provided: EbodypartsPageModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EbodypartsPageModule", function() { return EbodypartsPageModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/dist/fesm5.js");
/* harmony import */ var _ebodyparts_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ebodyparts-routing.module */ "./src/app/pages/ebodyparts/ebodyparts-routing.module.ts");
/* harmony import */ var _ebodyparts_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ebodyparts.page */ "./src/app/pages/ebodyparts/ebodyparts.page.ts");
/* harmony import */ var _pipes_pipes_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../pipes/pipes.module */ "./src/app/pipes/pipes.module.ts");
/* harmony import */ var _components_components_module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/components.module */ "./src/app/components/components.module.ts");
var EbodypartsPageModule = /** @class */ (function () {
function EbodypartsPageModule() {
}
EbodypartsPageModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
_angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"],
_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_7__["PipesModule"],
_components_components_module__WEBPACK_IMPORTED_MODULE_8__["ComponentsModule"],
_ebodyparts_routing_module__WEBPACK_IMPORTED_MODULE_5__["EbodypartsPageRoutingModule"]
],
declarations: [_ebodyparts_page__WEBPACK_IMPORTED_MODULE_6__["EbodypartsPage"]]
})
], EbodypartsPageModule);
return EbodypartsPageModule;
}());
/***/ }),
/***/ "./src/app/pages/ebodyparts/ebodyparts.page.scss":
/*!*******************************************************!*\
!*** ./src/app/pages/ebodyparts/ebodyparts.page.scss ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "ion-avatar {\n width: 100% !important;\n height: 100% !important;\n max-width: 124px !important;\n max-height: 124px !important;\n border-radius: 0; }\n\nion-avatar img {\n border-radius: 0; }\n\nion-item ion-label {\n padding-left: 0px;\n font-weight: bold;\n text-transform: uppercase;\n font-size: 13px;\n white-space: normal !important; }\n\nion-item {\n border-bottom: 1px solid #eee !important; }\n\nion-item {\n --background-focused:#fff !important;\n --background-activated:#fff !important;\n --detail-icon-color: var(--ion-color-primary);\n --detail-icon-opacity: 1; }\n\nion-item:last-child {\n border-bottom: none !important; }\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcGFnZXMvZWJvZHlwYXJ0cy9EOlxcLURFVlxcfklPTklDXFwxU2l4UGFjay12MVxcU2l4UGFjay12MS9zcmNcXGFwcFxccGFnZXNcXGVib2R5cGFydHNcXGVib2R5cGFydHMucGFnZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0ksc0JBQXFCO0VBQ3JCLHVCQUF3QjtFQUN4QiwyQkFBMkI7RUFDM0IsNEJBQTRCO0VBQzVCLGdCQUFnQixFQUFBOztBQUVwQjtFQUNJLGdCQUFnQixFQUFBOztBQUlwQjtFQUNJLGlCQUFpQjtFQUNqQixpQkFBaUI7RUFDakIseUJBQXlCO0VBQ3pCLGVBQWU7RUFDZiw4QkFBOEIsRUFBQTs7QUFHbEM7RUFDSSx3Q0FBd0MsRUFBQTs7QUFHNUM7RUFDSSxvQ0FBcUI7RUFDckIsc0NBQXVCO0VBQ3ZCLDZDQUFvQjtFQUNwQix3QkFBc0IsRUFBQTs7QUFHMUI7RUFDSSw4QkFBOEIsRUFBQSIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL2Vib2R5cGFydHMvZWJvZHlwYXJ0cy5wYWdlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyJpb24tYXZhdGFyICB7ICAgICBcbiAgICB3aWR0aDoxMDAlICFpbXBvcnRhbnQ7ICBcbiAgICBoZWlnaHQgOiAxMDAlICFpbXBvcnRhbnQ7ICBcbiAgICBtYXgtd2lkdGg6IDEyNHB4ICFpbXBvcnRhbnQ7XG4gICAgbWF4LWhlaWdodDogMTI0cHggIWltcG9ydGFudDtcbiAgICBib3JkZXItcmFkaXVzOiAwO1xuICAgIH1cbmlvbi1hdmF0YXIgaW1ne1xuICAgIGJvcmRlci1yYWRpdXM6IDA7XG5cbn1cblxuaW9uLWl0ZW0gaW9uLWxhYmVse1xuICAgIHBhZGRpbmctbGVmdDogMHB4O1xuICAgIGZvbnQtd2VpZ2h0OiBib2xkO1xuICAgIHRleHQtdHJhbnNmb3JtOiB1cHBlcmNhc2U7XG4gICAgZm9udC1zaXplOiAxM3B4O1xuICAgIHdoaXRlLXNwYWNlOiBub3JtYWwgIWltcG9ydGFudDtcbn1cblxuaW9uLWl0ZW17XG4gICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICNlZWUgIWltcG9ydGFudDtcbn1cblxuaW9uLWl0ZW17XG4gICAgLS1iYWNrZ3JvdW5kLWZvY3VzZWQ6I2ZmZiAhaW1wb3J0YW50O1xuICAgIC0tYmFja2dyb3VuZC1hY3RpdmF0ZWQ6I2ZmZiAhaW1wb3J0YW50O1xuICAgIC0tZGV0YWlsLWljb24tY29sb3I6IHZhcigtLWlvbi1jb2xvci1wcmltYXJ5KTtcbiAgICAtLWRldGFpbC1pY29uLW9wYWNpdHk6IDE7XG4gfVxuXG5pb24taXRlbTpsYXN0LWNoaWxke1xuICAgIGJvcmRlci1ib3R0b206IG5vbmUgIWltcG9ydGFudDtcbn0iXX0= */"
/***/ }),
/***/ "./src/app/pages/ebodyparts/ebodyparts.page.ts":
/*!*****************************************************!*\
!*** ./src/app/pages/ebodyparts/ebodyparts.page.ts ***!
\*****************************************************/
/*! exports provided: EbodypartsPage */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EbodypartsPage", function() { return EbodypartsPage; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _services_data_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/data.service */ "./src/app/services/data.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/dist/fesm5.js");
/* harmony import */ var _config_strings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../config/strings */ "./src/app/config/strings.ts");
/* harmony import */ var _services_admob_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../services/admob.service */ "./src/app/services/admob.service.ts");
var EbodypartsPage = /** @class */ (function () {
function EbodypartsPage(dataService, router, route, plt, admob) {
this.dataService = dataService;
this.router = router;
this.route = route;
this.plt = plt;
this.admob = admob;
this.strings = _config_strings__WEBPACK_IMPORTED_MODULE_5__["strings"];
this.exercises = [];
this.isLoading = false;
}
EbodypartsPage.prototype.ngOnInit = function () {
this.admob.BannerAd();
};
// tslint:disable-next-line: use-lifecycle-interface
EbodypartsPage.prototype.ngOnDestroy = function () {
this.admob.HideBannerAd();
};
EbodypartsPage.prototype.ionViewWillEnter = function () {
return tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"](this, void 0, void 0, function () {
var _this = this;
return tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"](this, function (_a) {
this.isLoading = true;
this.route.params.subscribe(function (data) {
_this.id = data.id;
_this.title = data.title;
_this.getExercises();
if (!_this.id) {
_this.goBack();
}
});
return [2 /*return*/];
});
});
};
EbodypartsPage.prototype.goBack = function () {
this.router.navigate(['/home']);
};
EbodypartsPage.prototype.getExercises = function () {
var _this = this;
this.dataService.getDataExercisesByBodypart(this.id)
.subscribe(function (resp) {
_this.exercises = resp;
_this.isLoading = false;
});
};
EbodypartsPage.ctorParameters = function () { return [
{ type: _services_data_service__WEBPACK_IMPORTED_MODULE_2__["DataService"] },
{ type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] },
{ type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"] },
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_4__["Platform"] },
{ type: _services_admob_service__WEBPACK_IMPORTED_MODULE_6__["AdmobService"] }
]; };
EbodypartsPage = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: 'app-ebodyparts',
template: __webpack_require__(/*! raw-loader!./ebodyparts.page.html */ "./node_modules/raw-loader/index.js!./src/app/pages/ebodyparts/ebodyparts.page.html"),
styles: [__webpack_require__(/*! ./ebodyparts.page.scss */ "./src/app/pages/ebodyparts/ebodyparts.page.scss")]
}),
tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [_services_data_service__WEBPACK_IMPORTED_MODULE_2__["DataService"],
_angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"],
_angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_4__["Platform"],
_services_admob_service__WEBPACK_IMPORTED_MODULE_6__["AdmobService"]])
], EbodypartsPage);
return EbodypartsPage;
}());
/***/ }),
/***/ "./src/app/services/data.service.ts":
/*!******************************************!*\
!*** ./src/app/services/data.service.ts ***!
\******************************************/
/*! exports provided: DataService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataService", function() { return DataService; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config/config */ "./src/app/config/config.ts");
var Url = _config_config__WEBPACK_IMPORTED_MODULE_3__["config"].Url;
var DataService = /** @class */ (function () {
function DataService(http) {
this.http = http;
this.page = 0;
}
DataService.prototype.ejectQuery = function (query) {
console.log(query);
query = Url + query;
console.log(query);
console.log(Url);
console.log(query);
return this.http.get(query);
};
DataService.prototype.getDataStrings = function () {
var query = this.ejectQuery('/json/data_strings.php');
console.log(query);
return this.ejectQuery('/json/data_strings.php');
};
DataService.prototype.getDataMotivation = function () {
var query = this.ejectQuery('/json/data_quotes.php');
console.log(query);
return this.ejectQuery('/json/data_quotes.php');
};
DataService.prototype.getDataFeaturedDiets = function () {
var query = this.ejectQuery('/json/data_diets.php?featured=1');
console.log(query);
return this.ejectQuery('/json/data_diets.php?featured=1');
};
DataService.prototype.getDataCategories = function () {
var query = this.ejectQuery('/json/data_categories.php');
console.log(query);
return this.ejectQuery('/json/data_categories.php');
};
DataService.prototype.getDataGoals = function () {
var query = this.ejectQuery('/json/data_goals.php');
console.log(query);
return this.ejectQuery('/json/data_goals.php');
};
DataService.prototype.getDataLevels = function () {
var query = this.ejectQuery('/json/data_levels.php');
console.log(query);
return this.ejectQuery('/json/data_levels.php');
};
DataService.prototype.getDataTags = function () {
var query = this.ejectQuery('/json/data_tags.php');
console.log(query);
return this.ejectQuery('/json/data_tags.php');
};
DataService.prototype.getDataEquipments = function () {
var query = this.ejectQuery('/json/data_equipments.php');
console.log(query);
return this.ejectQuery('/json/data_equipments.php');
};
DataService.prototype.getDataBodyparts = function () {
var query = this.ejectQuery('/json/data_bodyparts.php');
console.log(query);
return this.ejectQuery('/json/data_bodyparts.php');
};
DataService.prototype.getDataFeaturedPosts = function () {
var query = this.ejectQuery('/json/data_posts.php?featured=1');
console.log(query);
return this.ejectQuery('/json/data_posts.php?featured=1');
};
DataService.prototype.getDataRecentPosts = function (limit) {
var query = this.ejectQuery("/json/data_posts.php?limit=" + limit);
console.log(query);
return this.ejectQuery("/json/data_posts.php?limit=" + limit);
};
DataService.prototype.getDataWorkoutsByGoal = function (id) {
var query = this.ejectQuery("/json/data_workouts.php?goal=" + id);
console.log(query);
return this.ejectQuery("/json/data_workouts.php?goal=" + id);
};
DataService.prototype.getDataWorkoutsByLevel = function (id) {
var query = this.ejectQuery("/json/data_workouts.php?level=" + id);
console.log(query);
return this.ejectQuery("/json/data_workouts.php?level=" + id);
};
DataService.prototype.getDataExercisesByBodypart = function (id) {
var query = this.ejectQuery("/json/data_bodypart.php?id=" + id);
console.log(query);
return this.ejectQuery("/json/data_bodypart.php?id=" + id);
};
DataService.prototype.getDataExercisesByEquipment = function (id) {
var query = this.ejectQuery("/json/data_equipment.php?id=" + id);
console.log(query);
return this.ejectQuery("/json/data_equipment.php?id=" + id);
};
DataService.prototype.getDataDietsByCategory = function (id) {
var query = this.ejectQuery("/json/data_diets.php?category=" + id);
console.log(query);
return this.ejectQuery("/json/data_diets.php?category=" + id);
};
DataService.prototype.getDataPostsByTag = function (id) {
var query = this.ejectQuery("/json/data_posts.php?tag=" + id);
console.log(query);
return this.ejectQuery("/json/data_posts.php?tag=" + id);
};
DataService.prototype.getDataExerciseById = function (id) {
var query = this.ejectQuery("/json/data_exercises.php?id=" + id + "&limit=1");
console.log(query);
return this.ejectQuery("/json/data_exercises.php?id=" + id + "&limit=1");
};
DataService.prototype.getDataWorkoutById = function (id) {
var query = this.ejectQuery("/json/data_workouts.php?id=" + id + "&limit=1");
console.log(query);
return this.ejectQuery("/json/data_workouts.php?id=" + id + "&limit=1");
};
DataService.prototype.getDataDietById = function (id) {
var query = this.ejectQuery("/json/data_diets.php?id=" + id + "&limit=1");
console.log(query);
return this.ejectQuery("/json/data_diets.php?id=" + id + "&limit=1");
};
DataService.prototype.getDataPostById = function (id) {
var query = this.ejectQuery("/json/data_posts.php?id=" + id + "&limit=1");
console.log(query);
return this.ejectQuery("/json/data_posts.php?id=" + id + "&limit=1");
};
DataService.prototype.getDataWorkoutExercisesByDay = function (id, day) {
var query = this.ejectQuery("/json/data_days.php?id=" + id + "&day=" + day);
console.log(query);
return this.ejectQuery("/json/data_days.php?id=" + id + "&day=" + day);
};
DataService.ctorParameters = function () { return [
{ type: _angular_common_http__WEBPACK_IMPORTED_MODULE_2__["HttpClient"] }
]; };
DataService = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
providedIn: 'root'
}),
tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_2__["HttpClient"]])
], DataService);
return DataService;
}());
/***/ })
}]);
//# sourceMappingURL=pages-ebodyparts-ebodyparts-module-es5.js.map | 57.590296 | 2,375 | 0.68038 |
12847e4da50746e150f2a84e4d38f9439f5821dd | 316 | js | JavaScript | .history/src/app/pages/todo/Todo.reducers_20200928224013.js | corioste/training_todo_react_redux | a3ff636d6ab07b6ccdfa266d2985588468255552 | [
"MIT"
] | null | null | null | .history/src/app/pages/todo/Todo.reducers_20200928224013.js | corioste/training_todo_react_redux | a3ff636d6ab07b6ccdfa266d2985588468255552 | [
"MIT"
] | null | null | null | .history/src/app/pages/todo/Todo.reducers_20200928224013.js | corioste/training_todo_react_redux | a3ff636d6ab07b6ccdfa266d2985588468255552 | [
"MIT"
] | null | null | null | import { READ_TODO } from "./Todo.types"
const initialState = {
todos: [],
}
function todos(state = initialState , action = null){
if(action.type == READ_TODO){
return {
...state,
todos: action.payload
}
}
return state;
}
export default todos; | 15.047619 | 53 | 0.53481 |
12849e05a044cd5372401afebecb6f38a460a53d | 274 | js | JavaScript | malls/PYG-MALL/pinyougou-parent/pinyougou-seckill-web/src/main/webapp/js/service/payService.js | zhaoq0103/zhaoq0103.github.io | d03680fd106b7a7813af7d25595c11337051c7c0 | [
"MIT"
] | null | null | null | malls/PYG-MALL/pinyougou-parent/pinyougou-seckill-web/src/main/webapp/js/service/payService.js | zhaoq0103/zhaoq0103.github.io | d03680fd106b7a7813af7d25595c11337051c7c0 | [
"MIT"
] | 2 | 2022-01-12T23:04:05.000Z | 2022-01-12T23:04:38.000Z | malls/PYG-MALL/pinyougou-parent/pinyougou-seckill-web/src/main/webapp/js/service/payService.js | zhaoq0103/zhaoq0103.github.io | d03680fd106b7a7813af7d25595c11337051c7c0 | [
"MIT"
] | null | null | null | app.service('payService',function($http){
//本地支付
this.createNative=function(){
return $http.get('pay/createNative.do');
}
//查询支付状态
this.queryPayStatus=function(out_trade_no){
return $http.get('pay/queryPayStatus.do?out_trade_no='+out_trade_no);
}
}); | 22.833333 | 72 | 0.693431 |
128535a129a1383832818885878bf79276043a73 | 790 | js | JavaScript | client/src/routes.js | qewew91/link-shortener | 720801898e53ac77088e673925ad9fdba3f7b6c5 | [
"MIT"
] | null | null | null | client/src/routes.js | qewew91/link-shortener | 720801898e53ac77088e673925ad9fdba3f7b6c5 | [
"MIT"
] | null | null | null | client/src/routes.js | qewew91/link-shortener | 720801898e53ac77088e673925ad9fdba3f7b6c5 | [
"MIT"
] | null | null | null | import React from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'
import {LinksPage} from './pages/LinksPage'
import {CreatePage} from './pages/CreatePage'
import {DetailPage} from './pages/DetailPage'
import {AuthPage} from './pages/AuthPage'
export const useRoutes = isAuthenticated => {
if (isAuthenticated) {
return (
<Switch>
<Route path="/links" exact>
<LinksPage />
</Route>
<Route path="/create" exact>
<CreatePage />
</Route>
<Route path="/detail/:id">
<DetailPage />
</Route>
<Redirect to="/create"/>
</Switch>
)
}
return (
<Switch>
<Route path="/" exact>
<AuthPage />
</Route>
<Redirect to="/" />
</Switch>
)
}
| 23.235294 | 58 | 0.55443 |
1285e5954ca485bcedb38ba24b5e9faa108139e1 | 693 | js | JavaScript | src/evaluate-by-operator/operator/add.js | Subtletree/formula-parser | 8f72fb793f790e665ced6b422f3bf1f5422f8c66 | [
"MIT"
] | 1 | 2018-10-11T15:46:59.000Z | 2018-10-11T15:46:59.000Z | src/evaluate-by-operator/operator/add.js | Subtletree/formula-parser | 8f72fb793f790e665ced6b422f3bf1f5422f8c66 | [
"MIT"
] | null | null | null | src/evaluate-by-operator/operator/add.js | Subtletree/formula-parser | 8f72fb793f790e665ced6b422f3bf1f5422f8c66 | [
"MIT"
] | 1 | 2018-10-15T15:37:47.000Z | 2018-10-15T15:37:47.000Z | import {toNumber} from './../../helper/number';
import {ERROR_VALUE} from './../../error';
import {undefinedCell} from './../../helper/undefined-cell';
import Decimal from 'decimal.js';
export const SYMBOL = '+';
export default function func(first, ...rest) {
try {
first = undefinedCell(first);
for (var i = 0; i < rest.length; i++) {
rest[i] = undefinedCell(rest[i]);
}
const result = rest.reduce((acc, value) => {
return (new Decimal(acc)).plus(new Decimal(value)).toNumber();
}, first);
if (isNaN(result)) {
throw Error(ERROR_VALUE);
}
return result;
} catch (error) {
throw Error(ERROR_VALUE);
}
};
func.SYMBOL = SYMBOL;
| 22.354839 | 68 | 0.601732 |
12861d9fd3d6cf4dd3e9f86cbdabf5e43267825a | 37,717 | js | JavaScript | assets/src/js/composer.js | kwizer15/SonataPageBundle | f2b96bb5ce9c3e7d85d3d00b34207f7c11cbb725 | [
"MIT"
] | null | null | null | assets/src/js/composer.js | kwizer15/SonataPageBundle | f2b96bb5ce9c3e7d85d3d00b34207f7c11cbb725 | [
"MIT"
] | null | null | null | assets/src/js/composer.js | kwizer15/SonataPageBundle | f2b96bb5ce9c3e7d85d3d00b34207f7c11cbb725 | [
"MIT"
] | null | null | null | /**
* PageComposer plugin.
*/
(function ($, global) {
/**
* PageComposer class.
*
* @constructor
*/
var PageComposer = function (pageId, options) {
var settings = options || {};
this.pageId = pageId;
this.$container = $('.page-composer');
this.$dynamicArea = $('.page-composer__dyn-content');
this.$pagePreview = $('.page-composer__page-preview');
this.$containerPreviews = this.$pagePreview.find('.page-composer__page-preview__container');
this.routes = $.extend({}, settings.routes || {});
this.translations = $.extend({}, settings.translations || {});
this.csrfTokens = $.extend({}, settings.csrfTokens || {});
this.bindPagePreviewHandlers();
this.bindOrphansHandlers();
// attach event listeners
var self = this,
$this = $(this);
$this.on('containerclick', function (e) {
self.loadContainer(e.$container);
});
$this.on('containerloaded', this.handleContainerLoaded);
$this.on('blockcreated', this.handleBlockCreated);
$this.on('blockremoved', this.handleBlockRemoved);
$this.on('blockcreateformloaded', this.handleBlockCreateFormLoaded);
$this.on('blockpositionsupdate', this.handleBlockPositionsUpdate);
$this.on('blockeditformloaded', this.handleBlockEditFormLoaded);
$this.on('blockparentswitched', this.handleBlockParentSwitched);
};
/**
* Apply all Admin required functions.
*
* @param $context
*/
function applyAdmin($context) {
if (typeof global.admin != 'undefined') {
return;
}
Admin.shared_setup($context);
}
PageComposer.prototype = {
/**
* Translates given label.
*
* @param {String} label
* @return {String}
*/
translate: function (label) {
if (this.translations[label]) {
return this.translations[label];
}
return label;
},
/**
* @param id
* @param parameters
* @returns {*}
*/
getRouteUrl: function (id, parameters) {
if (!this.routes[id]) {
throw new Error('Route "' + id + '" does not exist');
}
var url = this.routes[id];
for (var paramKey in parameters) {
url = url.replace(new RegExp(paramKey), parameters[paramKey]);
}
return url;
},
/**
* Check if the given form element name attribute match specific type.
* Used because form element names are 'hashes' (s5311aef39e552[name]).
*
* @param name
* @param type
* @returns {boolean}
*/
isFormControlTypeByName: function (name, type) {
if (typeof name != 'undefined') {
var position = name.length,
search = '[' + type + ']',
lastIndex = name.lastIndexOf(search),
position = position - search.length;
return lastIndex !== -1 && lastIndex === position;
}
return false;
},
/**
* Called when a child block has been created.
* The event has the following properties:
*
* $childBlock The child container dom element
* parentId The parent block id
* blockId The child block id
* blockName The block name
* blockType The block type
*
* @param event
*/
handleBlockCreated: function (event) {
var self = this;
$.ajax({
url: this.getRouteUrl('block_preview', { 'BLOCK_ID': event.blockId }),
type: 'GET',
success: function (resp) {
var $content = $(resp);
event.$childBlock.replaceWith($content);
self.controlChildBlock($content);
// refresh parent block child count
var newChildCount = self.getContainerChildCountFromList(event.parentId);
if (newChildCount !== null) {
self.updateChildCount(event.parentId, newChildCount);
}
},
error: function () {
self.containerNotification('composer_preview_error', 'error', true);
}
});
},
/**
* Remove given block.
*
* @param event
*/
handleBlockRemoved: function (event) {
// refresh parent block child count
var newChildCount = this.getContainerChildCountFromList(event.parentId);
if (newChildCount !== null) {
this.updateChildCount(event.parentId, newChildCount);
}
},
/**
* Display notification for current block container.
*
* @param message
* @param type
* @param persist
*/
containerNotification: function (message, type, persist) {
var $notice = this.$dynamicArea.find('.page-composer__container__view__notice');
if ($notice.length === 1) {
if (this.containerNotificationTimer) {
clearTimeout(this.containerNotificationTimer);
}
$notice.removeClass('persist success error');
if (type) {
$notice.addClass(type);
}
$notice.text(this.translate(message));
$notice.show();
if (persist !== true) {
this.containerNotificationTimer = setTimeout(function () {
$notice.hide().empty();
}, 2000);
} else {
var $close = $('<span class="close-notice">x</span>');
$close.on('click', function () {
$notice.hide().empty();
});
$notice.addClass('persist');
$notice.append($close);
}
}
},
/**
* Save block positions.
* event.disposition contains positions data:
*
* [
* { id: 126, page_id: 2, parent_id: 18, position: 0 },
* { id: 21, page_id: 2, parent_id: 18, position: 1 },
* ...
* ]
*
* @param event
*/
handleBlockPositionsUpdate: function (event) {
var self = this;
this.containerNotification('composer_update_saving');
$.ajax({
url: this.getRouteUrl('save_blocks_positions'),
type: 'POST',
data: { disposition: event.disposition },
success: function (resp) {
if (resp.result && resp.result === 'ok') {
self.containerNotification('composer_update_saved', 'success');
}
},
error: function () {
self.containerNotification('composer_update_error', 'error', true);
}
});
},
/**
* Called when a block parent has changed (typically on drag n' drop).
* The event has the following properties:
*
* previousParentId
* newParentId
* blockId
*
* @param event
*/
handleBlockParentSwitched: function (event) {
var $previousParentPreview = $('.block-preview-' + event.previousParentId),
$oldChildCountIndicator = $previousParentPreview.find('.child-count'),
oldChildCount = parseInt($oldChildCountIndicator.text().trim(), 10),
$newParentPreview = $('.block-preview-' + event.newParentId),
$newChildCountIndicator = $newParentPreview.find('.child-count'),
newChildCount = parseInt($newChildCountIndicator.text().trim(), 10);
this.updateChildCount(event.previousParentId, oldChildCount - 1);
this.updateChildCount(event.newParentId, newChildCount + 1);
},
/**
* Compute child count for the given block container id.
*
* @param containerId
* @returns {number}
*/
getContainerChildCountFromList: function (containerId) {
var $blockView = this.$dynamicArea.find('.block-view-' + containerId);
if ($blockView.length === 0) {
return null;
}
var $children = $blockView.find('.page-composer__container__child'),
childCount = 0;
$children.each(function () {
var $child = $(this),
blockId = $child.attr('data-block-id');
if (typeof blockId != 'undefined') {
childCount++;
}
});
return childCount;
},
/**
* Update child count for the given container block id.
*
* @param blockId
* @param count
*/
updateChildCount: function (blockId, count) {
var $previewCount = $('.block-preview-' + blockId),
$viewCount = $('.block-view-' + blockId);
if ($previewCount.length > 0) {
$previewCount.find('.child-count').text(count);
}
if ($viewCount.length > 0) {
$viewCount.find('.page-composer__container__child-count span').text(count);
}
},
/**
* Handler called when block creation form is received.
* Makes the form handled through ajax.
*
* @param containerId
* @param blockType
*/
handleBlockCreateFormLoaded: function (event) {
var self = this,
$containerChildren = this.$dynamicArea.find('.page-composer__container__children'),
$container = this.$dynamicArea.find('.page-composer__container__main-edition-area');
if (event.container) {
var $childBlock = event.container,
$childContent = $childBlock.find('.page-composer__container__child__content');
$childContent.html(event.response);
} else {
var $childBlock = $(['<li class="page-composer__container__child">',
'<a class="page-composer__container__child__edit">',
'<h4 class="page-composer__container__child__name">',
'<input type="text" class="page-composer__container__child__name__input">',
'</h4>',
'</a>',
'<div class="page-composer__container__child__right">',
'<span class="badge">' + event.blockTypeLabel + '</span>',
'</div>',
'<div class="page-composer__container__child__content">',
'</div>',
'</li>'].join('')),
$childContent = $childBlock.find('.page-composer__container__child__content');
$childContent.append(event.response);
$containerChildren.append($childBlock);
$childContent.show();
}
var $form = $childBlock.find('form'),
formAction = $form.attr('action'),
formMethod = $form.attr('method'),
$formControls = $form.find('input, select, textarea'),
$formActions = $form.find('.form-actions'),
$childName = this.$dynamicArea.find('.page-composer__container__child__name'),
$nameFormControl,
$parentFormControl,
$positionFormControl;
applyAdmin($form);
$(document).scrollTo($childBlock, 200);
$container.show();
// scan form elements to find name/parent/position,
// then set value according to current container and hide it.
$formControls.each(function () {
var $formControl = $(this),
formControlName = $formControl.attr('name');
if (self.isFormControlTypeByName(formControlName, 'name')) {
$nameFormControl = $formControl;
$childName.find('.page-composer__container__child__name__input').bind("propertychange keyup input paste", function (e) {
$nameFormControl.val($(this).val());
});
} else if (self.isFormControlTypeByName(formControlName, 'parent')) {
$parentFormControl = $formControl;
$parentFormControl.val(event.containerId);
$parentFormControl.parent().parent().hide();
} else if (self.isFormControlTypeByName(formControlName, 'position')) {
$positionFormControl = $formControl;
$positionFormControl.val($containerChildren.find('> *').length - 1);
$positionFormControl.closest('.form-group').hide();
}
});
$formActions.each(function () {
var $formAction = $(this),
$cancelButton = $('<span class="btn btn-warning">' + self.translate('cancel') + '</span>');
$cancelButton.on('click', function (e) {
e.preventDefault();
$childBlock.remove();
$(document).scrollTo(self.$dynamicArea, 200);
});
$formAction.append($cancelButton);
});
// hook into the form submit event.
$form.on('submit', function (e) {
e.preventDefault();
var blockName = $nameFormControl.val();
if (blockName === '') {
blockName = event.blockType;
}
$.ajax({
url: formAction + '&' + $.param({'composer': 1}),
data: $form.serialize(),
type: formMethod,
headers: {
Accept: 'text/html, application/xhtml+xml;'
},
success: function (resp) {
if (resp.result && resp.result === 'ok' && resp.objectId) {
var createdEvent = $.Event('blockcreated');
createdEvent.$childBlock = $childBlock;
createdEvent.parentId = event.containerId;
createdEvent.blockId = resp.objectId;
createdEvent.blockName = blockName;
createdEvent.blockType = event.blockType;
$(self).trigger(createdEvent);
} else {
var loadedEvent = $.Event('blockcreateformloaded');
loadedEvent.response = resp;
loadedEvent.containerId = event.containerId;
loadedEvent.blockType = event.blockType;
loadedEvent.container = $childBlock;
$(self).trigger(loadedEvent);
applyAdmin($childContent);
}
}
});
return false;
});
},
/**
* Toggle a child block using '--expanded' class check.
*
* @param $childBlock
*/
toggleChildBlock: function ($childBlock) {
var expandedClass = 'page-composer__container__child--expanded',
$children = this.$dynamicArea.find('.page-composer__container__child'),
$childName = $childBlock.find('.page-composer__container__child__name'),
$nameInput = $childName.find('.page-composer__container__child__name__input');
if ($childBlock.hasClass(expandedClass)) {
$childBlock.removeClass(expandedClass);
if ($childName.has('.page-composer__container__child__name__input')) {
$childName.html($nameInput.val());
}
} else {
$children.not($childBlock).removeClass(expandedClass);
$childBlock.addClass(expandedClass);
}
},
/**
* Called when a block edit form has been loaded.
*
* @param event
*/
handleBlockEditFormLoaded: function (event) {
var self = this,
$title = event.$block.find('.page-composer__container__child__edit h4'),
$container = event.$block.find('.page-composer__container__child__content'),
$loader = event.$block.find('.page-composer__container__child__loader'),
$form = $container.find('form'),
url = $form.attr('action'),
method = $form.attr('method'),
blockType = event.$block.find('.page-composer__container__child__edit small').text().trim(),
$nameFormControl,
$positionFormControl;
$form.find('input').each(function () {
var $formControl = $(this),
formControlName = $formControl.attr('name');
if (self.isFormControlTypeByName(formControlName, 'name')) {
$nameFormControl = $formControl;
$title.html('<input type="text" class="page-composer__container__child__name__input" value="' + $title.text().trim() + '">');
$input = $title.find('input');
$input.bind("propertychange keyup input paste", function (e) {
$nameFormControl.val($input.val());
});
$input.on('click', function (e) {
e.stopPropagation();
e.preventDefault();
});
} else if (self.isFormControlTypeByName(formControlName, 'position')) {
$positionFormControl = $formControl;
$positionFormControl.closest('.form-group').hide();
}
});
$form.on('submit', function (e) {
e.preventDefault();
$loader.show();
$.ajax({
url: url,
data: $form.serialize(),
type: method,
headers: {
Accept: 'text/html, application/xhtml+xml;'
},
success: function (resp) {
$loader.hide();
if (resp.result && resp.result === 'ok') {
if (typeof $nameFormControl != 'undefined') {
$title.text($nameFormControl.val() !== '' ? $nameFormControl.val() : blockType);
}
event.$block.removeClass('page-composer__container__child--expanded');
$container.empty();
} else {
$container.html(resp);
var editFormEvent = $.Event('blockeditformloaded');
editFormEvent.$block = event.$block;
$(self).trigger(editFormEvent);
applyAdmin($container);
}
}
});
return false;
});
},
/**
* Takes control of a container child block.
*
* @param $childBlock
*/
controlChildBlock: function ($childBlock) {
var self = this,
$container = $childBlock.find('.page-composer__container__child__content'),
$loader = $childBlock.find('.page-composer__container__child__loader'),
$edit = $childBlock.find('.page-composer__container__child__edit'),
editUrl = $edit.attr('href'),
$remove = $childBlock.find('.page-composer__container__child__remove'),
$removeButton = $remove.find('a'),
$switchEnabled = $childBlock.find('.page-composer__container__child__switch-enabled'),
$switchLblEnbl = $switchEnabled.attr('data-label-enable'),
$switchLblDsbl = $switchEnabled.attr('data-label-disable'),
$switchButton = $switchEnabled.find('a'),
$switchBtnIcon = $switchButton.find('i'),
$switchLabel = $childBlock.find('.page-composer__container__child__enabled'),
$switchLblSm = $switchLabel.find('small'),
$switchLblIcon = $switchLabel.find('i'),
switchUrl = $switchButton.attr('href'),
enabled = parseInt($childBlock.attr('data-block-enabled'), 2);
$edit.click(function (e) {
e.preventDefault();
// edit form already loaded, just toggle
if ($container.find('form').length > 0) {
self.toggleChildBlock($childBlock);
return;
}
// load edit form, then toggle
$loader.show();
$.ajax({
url: editUrl,
success: function (resp) {
$container.html(resp);
var editFormEvent = $.Event('blockeditformloaded');
editFormEvent.$block = $childBlock;
$(self).trigger(editFormEvent);
applyAdmin($container);
$loader.hide();
self.toggleChildBlock($childBlock);
}
});
});
$switchButton.on('click', function (e) {
e.preventDefault();
$.ajax({
url: switchUrl,
type: 'POST',
data: {
'_sonata_csrf_token': self.csrfTokens.switchEnabled,
'value': !enabled
},
success: function (resp) {
$childBlock.attr('data-block-enabled', enabled ? "0" : "1");
enabled = !enabled;
$switchButton.toggleClass('bg-yellow bg-green');
$switchBtnIcon.toggleClass('fa-toggle-off fa-toggle-on');
if (enabled) {
$switchButton.html($switchLblDsbl);
} else {
$switchButton.html($switchLblEnbl);
}
$switchLblSm.toggleClass('bg-yellow bg-green');
$switchLblIcon.toggleClass('fa-times fa-check');
if ($childBlock.has('form')) {
var $form = $childBlock.find('form'),
$inputs = $form.find('input');
$inputs.each(function () {
var $formControl = $(this),
formControlName = $formControl.attr('name');
if (self.isFormControlTypeByName(formControlName, 'enabled')) {
$formControl.val(parseInt(!enabled));
}
});
}
},
error: function () {
self.containerNotification('composer_status_error', 'error', true);
}
});
});
$removeButton.on('click', function (e) {
e.preventDefault();
self.confirmRemoveContainer($childBlock);
});
},
/**
* Shows a confirm dialog for a child removal request
*
* @param $childBlock
*/
confirmRemoveContainer: function($childBlock) {
var self = this,
$remove = $childBlock.find('.page-composer__container__child__remove'),
$removeButton = $remove.find('a'),
$removeDialog = $childBlock.find('.page-composer__container__child__remove__dialog'),
removeUrl = $removeButton.attr('href'),
parentId = parseInt($childBlock.attr('data-parent-block-id'), 10);
if ($removeDialog.length == 0) {
$removeDialog = $(['<div class="modal fade page-composer__container__child__remove__dialog" tabindex="-1" role="dialog">',
'<div class="modal-dialog" role="document">',
'<div class="modal-content">',
'<div class="modal-header">',
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>',
'<h4 class="modal-title">' + this.translate('composer_remove_confirm') + '</h4>',
'</div>',
'<div class="modal-body">',
'</div>',
'<div class="modal-footer">',
'<button type="button" class="btn btn-default" data-dismiss="modal">' + this.translate('cancel') + '</button>',
'<button type="button" class="btn btn-primary">' + this.translate('yes') + '</button>',
'</div>',
'</div>',
'</div>',
'</div>'].join(''));
$childBlock.append($removeDialog);
}
var $removeYes = $removeDialog.find('.btn-primary');
$removeYes.on('click', function (e) {
$.ajax({
url: removeUrl,
type: 'POST',
data: {
'_method': 'DELETE',
'_sonata_csrf_token': self.csrfTokens.remove
},
success: function (resp) {
if (resp.result && resp.result === 'ok') {
$childBlock.remove();
var removedEvent = $.Event('blockremoved');
removedEvent.parentId = parentId;
$(self).trigger(removedEvent);
}
}
});
$removeDialog.modal('hide');
// Sometimes, there is a bug and the modal backdrop didn't fade out, so we have to force it
if ($('.modal-backdrop').length != 0) {
$('.modal-backdrop').hide();
}
});
$removeDialog.modal('show')
},
/**
* Handler called when a container block has been loaded.
*
* @param event
*/
handleContainerLoaded: function (event) {
var self = this,
$childrenContainer = this.$dynamicArea.find('.page-composer__container__children'),
$children = this.$dynamicArea.find('.page-composer__container__child'),
$blockTypeSelector = this.$dynamicArea.find('.page-composer__block-type-selector'),
$blockTypeSelectorLoader = $blockTypeSelector.find('.page-composer__block-type-selector__loader'),
$blockTypeSelectorSelect = $blockTypeSelector.find('select'),
$blockTypeSelectorButton = $blockTypeSelector.find('.page-composer__block-type-selector__confirm'),
blockTypeSelectorUrl = $blockTypeSelectorButton.attr('href');
applyAdmin(this.$dynamicArea);
// Load the block creation form trough ajax.
$blockTypeSelectorButton.on('click', function (e) {
e.preventDefault();
$blockTypeSelectorLoader.css('display', 'inline-block');
var blockType = $blockTypeSelectorSelect.val(),
blockTypeLabel = $blockTypeSelectorSelect.find('option:selected').text().trim();
$.ajax({
url: blockTypeSelectorUrl,
data: {
type: blockType
},
success: function (resp) {
$blockTypeSelectorLoader.hide();
$(self).trigger($.Event('blockcreateformloaded', {
response: resp,
containerId: event.containerId,
blockType: blockType,
blockTypeLabel: blockTypeLabel
}));
}
});
});
// makes the container block children sortables.
$childrenContainer.sortable({
revert: true,
cursor: 'move',
revertDuration: 200,
delay: 200,
helper: function (event, element) {
var $element = $(element),
name = $element.find('.page-composer__container__child__edit h4').text().trim(),
type = $element.find('.page-composer__container__child__edit small').text().trim();
$element.removeClass('page-composer__container__child--expanded');
return $('<div class="page-composer__container__child__helper">' +
'<h4>' + name + '</h4>' +
'</div>');
},
update: function (event, ui) {
var newPositions = [];
$childrenContainer.find('.page-composer__container__child').each(function (position) {
var $child = $(this),
parentId = $child.attr('data-parent-block-id'),
childId = $child.attr('data-block-id');
// pending block creation has an undefined child id
if (typeof childId != 'undefined') {
newPositions.push({
'id': parseInt(childId, 10),
'position': position,
'parent_id': parseInt(parentId, 10),
'page_id': self.pageId
});
}
});
if (newPositions.length > 0) {
var updateEvent = $.Event('blockpositionsupdate');
updateEvent.disposition = newPositions;
$(self).trigger(updateEvent);
}
}
});
$children
.each(function () {
self.controlChildBlock($(this));
});
},
/**
* Bind click handlers to template layout preview blocks.
*/
bindPagePreviewHandlers: function () {
var self = this;
this.$containerPreviews
.each(function () {
var $container = $(this);
$container.on('click', function (e) {
e.preventDefault();
var event = $.Event('containerclick');
event.$container = $container;
$(self).trigger(event);
});
})
.droppable({
hoverClass: 'hover',
tolerance: 'pointer',
revert: true,
connectToSortable: '.page-composer__container__children',
accept: function (source) {
// NEXT_MAJOR: Remove the 'data-block-whitelist'
var blockAllowlist = $(this).attr('data-block-allowlist') || $(this).attr('data-block-whitelist');
if (blockAllowlist === '') {
return true;
}
blockAllowlist = blockAllowlist.split(',');
var sourceBlockType = $(source).attr('data-block-type');
return blockAllowlist.indexOf(sourceBlockType) !== -1;
},
drop: function (event, ui) {
var droppedBlockId = ui.draggable.attr('data-block-id');
if (typeof droppedBlockId != 'undefined') {
ui.helper.remove();
var $container = $(this),
parentId = parseInt(ui.draggable.attr('data-parent-block-id'), 10),
containerId = parseInt($container.attr('data-block-id'), 10);
droppedBlockId = parseInt(droppedBlockId, 10);
if (parentId !== containerId) {
// play animation on drop, remove class on animation end to be able to re-apply
$container.addClass('dropped');
$container.on('webkitAnimationEnd oanimationend msAnimationEnd animationend', function (e) {
$container.removeClass('dropped');
});
$.ajax({
url: self.getRouteUrl('block_switch_parent'),
data: {
block_id: droppedBlockId,
parent_id: containerId
},
success: function (resp) {
if (resp.result && resp.result === 'ok') {
ui.draggable.remove();
var switchedEvent = $.Event('blockparentswitched');
switchedEvent.previousParentId = parentId;
switchedEvent.newParentId = containerId;
switchedEvent.blockId = droppedBlockId;
$(self).trigger(switchedEvent);
}
}
});
}
}
}
})
;
if (this.$containerPreviews.length > 0) {
this.loadContainer(this.$containerPreviews.eq(0));
}
},
bindOrphansHandlers: function () {
var self = this;
this.$container.find('.page-composer__orphan-container').each(function () {
var $container = $(this);
$container.on('click', function (e) {
e.preventDefault();
var event = $.Event('containerclick');
event.$container = $container;
$(self).trigger(event);
});
});
},
/**
* Loads the container detailed view trough ajax.
*
* @param $container
*/
loadContainer: function ($container) {
var url = $container.attr('href'),
containerId = $container.attr('data-block-id'),
self = this;
this.$dynamicArea.empty();
this.$containerPreviews.removeClass('active');
this.$container.find('.page-composer__orphan-container').removeClass('active');
$container.addClass('active');
$.ajax({
url: url,
success: function (resp) {
self.$dynamicArea.html(resp);
$(document).scrollTo(self.$dynamicArea, 200, {
offset: { top: -100 }
});
var event = $.Event('containerloaded');
event.containerId = containerId;
$(self).trigger(event);
}
});
}
};
global.PageComposer = PageComposer;
// auto-initialize plugin
$(function () {
$('[data-page-composer]').each(function () {
var attr = $(this).data('page-composer');
new PageComposer(attr.pageId, attr);
});
});
})(jQuery, window);
| 41.492849 | 155 | 0.455816 |
1286ba3dde045e4cae40e9c5638be1b1e07283cc | 2,835 | js | JavaScript | numbas_lti/static/attempt_scorm_listing.js | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 6 | 2016-12-12T14:41:33.000Z | 2021-04-18T01:04:23.000Z | numbas_lti/static/attempt_scorm_listing.js | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 206 | 2016-08-24T13:53:07.000Z | 2022-03-31T09:14:43.000Z | numbas_lti/static/attempt_scorm_listing.js | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 13 | 2016-10-23T04:53:30.000Z | 2022-02-17T09:25:00.000Z | var DateTime = luxon.DateTime;
function DataModel(elements) {
this.all_elements = ko.observableArray([]);
this.keys = [];
this.elements = {}
elements.forEach(this.add_element,this);
this.query = ko.observable('');
this.most_recent_only = ko.observable(true);
this.show_elements = ko.pureComputed(function() {
this.all_elements();
var query = this.query().toLowerCase();
var re = new RegExp(query);
var keys = this.keys.filter(re.test,re);
keys.sort();
var out = [];
var most_recent = this.most_recent_only();
keys.forEach(function(key) {
var sorted_elements = this.elements[key].sort(function(a,b) {
var at = a.time;
var bt = b.time;
var ac = a.counter;
var bc = b.counter;
// sort by time and then counter
return at>bt ? -1 : bt>at ? 1 : ac>bc ? -1 : bc>ac ? 1 : 0;
});
if(most_recent) {
sorted_elements = sorted_elements.slice(0,1);
}
out.push({key:key,elements:sorted_elements});
},this);
return out;
},this);
}
DataModel.prototype = {
add_element: function(element) {
var key = element.key
element.time = DateTime.fromISO(element.time);
element.time_string = element.time.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS);
if(this.elements[key]) {
this.elements[key].push(element);
} else {
this.keys.push(key);
this.elements[key] = [element];
}
this.all_elements.push(element);
},
listen_for_changes: function(url) {
var dm = this;
var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws";
var socket = this.socket = new RobustWebSocket(ws_scheme + '://' + window.location.host + url);
socket.onmessage = function(e) {
var element = JSON.parse(e.data);
dm.add_element(element);
}
}
}
function filter_rows(query) {
var re = new RegExp(query);
query = query.toLowerCase();
var rows = document.querySelectorAll('#initial-data tr');
Array.prototype.map.apply(rows,[function(row) {
var key = row.getAttribute('data-key');
row.classList.toggle('hidden',!re.test(key));
}]);
}
document.querySelector('.search').addEventListener('click',function(e) {
if(!e.target.classList.contains('quick-query')) {
return;
}
dm.query(e.target.getAttribute('data-query'));
});
var scorm_json = document.getElementById('scorm-elements').textContent;
var elements = JSON.parse(scorm_json);
var dm = new DataModel(elements);
dm.listen_for_changes(listener_url);
ko.options.deferUpdates = true;
ko.applyBindings(dm);
| 31.5 | 103 | 0.589065 |
1286e1a4d627969389695ad2ff93f5b543b913fe | 313 | js | JavaScript | templates/project/api/http/apiOutput.test.js | hfcorriez/node-fly | 6d0417e429e81b56a0c14b70e7b6144ac80714db | [
"Unlicense"
] | null | null | null | templates/project/api/http/apiOutput.test.js | hfcorriez/node-fly | 6d0417e429e81b56a0c14b70e7b6144ac80714db | [
"Unlicense"
] | null | null | null | templates/project/api/http/apiOutput.test.js | hfcorriez/node-fly | 6d0417e429e81b56a0c14b70e7b6144ac80714db | [
"Unlicense"
] | null | null | null | const assert = require('assert')
module.exports = {
tests: [
{
name: 'Check code === 0',
event: {
method: 'post',
body: { code: 0 }
},
test (result) {
assert.ok(typeof result === 'object')
assert.strictEqual(result.body.ok, true)
}
}
]
}
| 17.388889 | 48 | 0.476038 |
1287343381c4c8515c223da033f84f9f2d23668e | 5,802 | js | JavaScript | app/main/libs/Sqlite.js | LikeNeko/L2dPetForMac | 21e2e90d54931ccd617d57eb1f2c03d3e1916de1 | [
"CC0-1.0"
] | 53 | 2020-07-25T13:36:21.000Z | 2022-03-12T16:54:01.000Z | app/main/libs/Sqlite.js | LikeNeko/L2dPetForMac | 21e2e90d54931ccd617d57eb1f2c03d3e1916de1 | [
"CC0-1.0"
] | 22 | 2020-07-30T04:19:15.000Z | 2022-03-30T12:15:23.000Z | app/main/libs/Sqlite.js | LikeNeko/L2dPetForMac | 21e2e90d54931ccd617d57eb1f2c03d3e1916de1 | [
"CC0-1.0"
] | 11 | 2020-08-07T22:31:25.000Z | 2022-02-07T10:31:55.000Z | let sqlite = require('sqlite3').verbose();
// async created () {
// const db = Sqlite.getInstance()
// await db.connect('./database/tabletSign.db')
// await db.run('CREATE TABLE IF NOT EXISTS test(a int, b char)')
// await db.run(`INSERT INTO test VALUES(10, 'abcd')`)
// const response = await db.all('SELECT * FROM test')
// db.close()
// }
class Sqlite {
db
exist
static instance;
constructor() {
}
// 连接数据库
connect(path) {
return new Promise((resolve, reject) => {
this.db = new sqlite.Database(path, (err) => {
if (err === null) {
resolve(err)
} else {
reject(err)
}
})
this.db.configure("busyTimeout", 3000);
})
}
// 运行sql
run(sql, params) {
return new Promise((resolve, reject) => {
this.db.run(sql, params, (err) => {
if (err === null) {
resolve(err)
} else {
reject(err)
}
})
})
}
// 运行多条sql
exec(sql) {
return new Promise((resolve, reject) => {
this.db.exec(sql, (err) => {
if (err === null) {
resolve(err)
} else {
reject(err)
}
})
})
}
// 查询一条数据
get(sql, params) {
return new Promise((resolve, reject) => {
this.db.get(sql, params, (err, data) => {
if (err) {
reject(err)
} else {
resolve(data)
}
})
})
}
// 查询所有数据
all(sql, params) {
return new Promise((resolve, reject) => {
this.db.all(sql, params, (err, data) => {
if (err) {
reject(err)
} else {
resolve(data)
}
})
})
}
create(sql) {
let that = this;
that.db.serialize(function () {
that.db.run(sql, function (err) {
if (null != err) {
console.log(err);
return 0;
}
});
});
};
/// tilesData format; [[level, column, row, content], [level, column, row, content]]
insertAll(sql, objects) {
let that = this
this.db.serialize(function () {
let stmt = that.db.prepare(sql);
for (let i = 0; i < objects.length; ++i) {
stmt.run(objects[i]);
}
stmt.finalize();
});
};
call_query(sql, callback) {
let that = this;
this.db.all(sql, function (err, rows) {
if (null != err) {
console.log(err);
return;
}
if (that.debug) {
console.log(sql)
}
/// deal query data.
if (callback) {
callback(rows);
}
});
};
query(sql) {
return new Promise((resolve, reject) => {
try {
return this.call_query(sql, (data) => {
resolve(data)
})
} catch (e) {
reject(e)
}
})
}
execute(sql) {
let that = this;
return new Promise(function (resolve, reject) {
that.db.run(sql, function (err) {
if (null != err) {
console.log(err);
reject();
}
if (that.debug) {
console.log(sql)
resolve()
}
});
})
};
// 关闭数据库
close() {
this.db.close()
}
// 单例
static getInstance() {
if (this.instance){
return this.instance;
}else{
let ins= new Sqlite();
this.instance = ins;
return ins;
}
}
}
Promise.prototype.done = function(data){
if (typeof data == 'function'){
data();
}
}
String.prototype.sql_query = function (db) {
return new Promise((resolve, reject) => {
try {
db.call_query(this.trim(), (data) => {
resolve(data)
})
} catch (e) {
reject(e)
}
})
}
String.prototype.sql_format = function () {
let formatted = this;
for (let prop in arguments[0]) {
let regexp = new RegExp('\\{' + prop + '\\}', 'gi');
formatted = formatted.replace(regexp, arguments[0][prop]);
}
return formatted;
};
Number.prototype.db_time_to_unix = function () {
return (this / 1000000 - 11644473600)
}
Number.prototype.db_time_format = function (formats) {
// formats格式包括
// 1. Y-m-d
// 2. Y-m-d H:i:s
// 3. Y年m月d日
// 4. Y年m月d日 H时i分
formats = formats || 'Y-m-d';
let timestamp = this * 1000
let zero = function (value) {
if (value < 10) {
return '0' + value;
}
return value;
};
let myDate = timestamp ? new Date(timestamp) : new Date();
let year = myDate.getFullYear();
let month = zero(myDate.getMonth() + 1);
let day = zero(myDate.getDate());
let hour = zero(myDate.getHours());
let minite = zero(myDate.getMinutes());
let second = zero(myDate.getSeconds());
return formats.replace(/Y|m|d|H|i|s/ig, function (matches) {
return ({
Y: year,
m: month,
d: day,
H: hour,
i: minite,
s: second
})[matches];
});
};
// export SqliteDB.
module.exports = {
Sqlite
} | 23.876543 | 88 | 0.422613 |
12877b5c7d41258d12e09e7e98ce3d12a4152aa3 | 20,899 | js | JavaScript | doc_root/resources/sap_library/sap/ui/ux3/DataSet-dbg.js | zaveryukha/openui5_demo | 1e6db992b0d68d482ee480662ad027ad9f3dbeb5 | [
"MIT"
] | null | null | null | doc_root/resources/sap_library/sap/ui/ux3/DataSet-dbg.js | zaveryukha/openui5_demo | 1e6db992b0d68d482ee480662ad027ad9f3dbeb5 | [
"MIT"
] | null | null | null | doc_root/resources/sap_library/sap/ui/ux3/DataSet-dbg.js | zaveryukha/openui5_demo | 1e6db992b0d68d482ee480662ad027ad9f3dbeb5 | [
"MIT"
] | null | null | null | /*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2016 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides control sap.ui.ux3.DataSet.
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Control', 'sap/ui/core/ResizeHandler', './library'],
function(jQuery, Control, ResizeHandler, library) {
"use strict";
/**
* Constructor for a new DataSet.
*
* @param {string} [sId] id for the new control, generated automatically if no id is given
* @param {object} [mSettings] initial settings for the new control
*
* @class
* DataSet
* @extends sap.ui.core.Control
* @version 1.36.6
*
* @constructor
* @public
* @alias sap.ui.ux3.DataSet
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
*/
var DataSet = Control.extend("sap.ui.ux3.DataSet", /** @lends sap.ui.ux3.DataSet.prototype */ { metadata : {
library : "sap.ui.ux3",
properties : {
/**
* show Toolbar
*/
showToolbar : {type : "boolean", group : "Misc", defaultValue : true},
/**
* show filter
*/
showFilter : {type : "boolean", group : "Misc", defaultValue : true},
/**
* Show/hide SearchField in Toolbar
*/
showSearchField : {type : "boolean", group : "Misc", defaultValue : true},
/**
* Selection mode of the DataSet
*/
multiSelect : {type : "boolean", group : "Behavior", defaultValue : false}
},
aggregations : {
/**
* Aggregation of DataSetItems
*/
items : {type : "sap.ui.ux3.DataSetItem", multiple : true, singularName : "item", bindable : "bindable"},
/**
* views
*/
views : {type : "sap.ui.ux3.DataSetView", multiple : true, singularName : "view"},
/**
* Filter control (e.g. a FacetFilter) for the DataSet
*/
filter : {type : "sap.ui.core.Control", multiple : true, singularName : "filter"},
/**
* Internally managed by Dataset
*/
_viewSwitches : {type : "sap.ui.core.Control", multiple : true, singularName : "_viewSwitch", visibility : "hidden"},
/**
* A Toolbar, internally managed by Dataset
*/
_toolbar : {type : "sap.ui.commons.Toolbar", multiple : false, visibility : "hidden"}
},
associations : {
/**
* Selected view of the Dataset
*/
selectedView : {type : "sap.ui.ux3.DataSetView", multiple : false}
},
events : {
/**
* selection Changed
*/
selectionChanged : {
parameters : {
/**
* Old lead selected index
*/
oldLeadSelectedIndex : {type : "int"},
/**
* New lead selected index
*/
newLeadSelectedIndex : {type : "int"}
}
},
/**
* Event which is fired when the user triggers a search
*/
search : {
parameters : {
/**
* The search query
*/
query : {type : "string"}
}
}
}
}});
DataSet.prototype.init = function() {
var that = this, oToolbar;
//each DS needs a selectionModel for its items
jQuery.sap.require("sap.ui.model.SelectionModel");
this.selectionModel = new sap.ui.model.SelectionModel(sap.ui.model.SelectionModel.SINGLE_SELECTION);
// init toolbar
this._oSegBut = new sap.ui.commons.SegmentedButton();
this._oSegBut.attachSelect(function(oEvent){that.press(oEvent);}, that);
this._oSegBut.show = false;
this._oSearchField = new sap.ui.commons.SearchField(this.getId() + "-searchValue");
this._oSearchField.setShowListExpander(false);
this._oSearchField.setEnableListSuggest(false);
this._oSearchField.setEnableFilterMode(true);
this._oSearchField.setEnableClear(true);
this._oSearchField.show = false;
that = this;
this._oSearchField.attachSearch(function(oEvent) {
that.fireSearch(oEvent.getParameters());
});
this.selectionModel.attachSelectionChanged(function(oEvent){
var oldSelectedIndex, newSelectedIndex;
var mParameters = oEvent.getParameters();
if (mParameters) {
newSelectedIndex = mParameters.leadIndex;
oldSelectedIndex = mParameters.oldIndex;
}
that.fireSelectionChanged({
oldLeadSelectedIndex: oldSelectedIndex,
newLeadSelectedIndex: newSelectedIndex
});
jQuery.sap.log.debug("Selection Change fired");
});
oToolbar = new sap.ui.commons.Toolbar();
this._setToolbar(oToolbar);
this._iShiftStart = null;
};
DataSet.prototype.exit = function() {
this._oSegBut.destroy();
this._oSearchField.destroy();
this.destroyAggregation("_toolbar");
};
DataSet.prototype._prepareToolbar = function() {
var iViewCount = this.getViews().length,
oToolbar = this._getToolbar();
if (iViewCount > 1 && this._oSegBut.show == false) {
oToolbar.insertItem(this._oSegBut,0);
this._oSegBut.show = true;
} else if (iViewCount <= 1 && this._oSegBut.show) {
oToolbar.removeItem(this._oSegBut);
this._oSegBut.show = false;
}
if (this.getShowSearchField() && this._oSearchField.show == false) {
oToolbar.insertRightItem(this._oSearchField,oToolbar.getRightItems().length);
this._oSearchField.show = true;
} else if (!this.getShowSearchField() && this._oSearchField.show == true) {
oToolbar.removeRightItem(this._oSearchField);
this._oSearchField.show = false;
}
};
/**
* Press handler for the view selection buttons
*
* @param {sap.ui.base.Event} oEvent Press event
* @private
*/
DataSet.prototype.press = function(oEvent,iSelectedViewIndex) {
var oButtonID = oEvent.getParameters().selectedButtonId,
viewId = oButtonID.substring(oButtonID.lastIndexOf('-') + 1),
oldView = sap.ui.getCore().byId(this.getSelectedView());
oldView.exitView(this.getItems());
this.setSelectedView(viewId);
};
/**
* Fire filter event
*
* @private
*/
DataSet.prototype.filter = function() {
this.fireFilter({
filterValue : this.getFilterValue()
});
};
/**
* Fire sort event
*
* @private
*/
DataSet.prototype.sort = function() {
this.fireSort();
};
/**
* adds selection interval to array of selected items.
*
* @private
*/
DataSet.prototype.addSelectionInterval = function(iIndexFrom, iIndexTo) {
this.selectionModel.addSelectionInterval(iIndexFrom, iIndexTo);
return this;
};
/**
* sets selection interval to array of selected items.
*
* @private
*/
DataSet.prototype.setSelectionInterval = function(iIndexFrom, iIndexTo) {
this.selectionModel.setSelectionInterval(iIndexFrom, iIndexTo);
return this;
};
/**
* removes selection interval from array of selected items
*
* @private
*/
DataSet.prototype.removeSelectionInterval = function(iIndexFrom, iIndexTo) {
this.selectionModel.removeSelectionInterval(iIndexFrom, iIndexTo);
return this;
};
/** use this function to retrieve the lead selected index
*
* @public
*/
DataSet.prototype.getSelectedIndex = function() {
return this.selectionModel.getLeadSelectedIndex();
};
/** use this function to retrieve all selected indices if multiple select is enabled
*
* @public
*/
DataSet.prototype.getSelectedIndices = function(){
return this.selectionModel.getSelectedIndices() || [];
};
/** clears dataset from all previous selections
*
* @public
*/
DataSet.prototype.clearSelection = function() {
this.selectionModel.clearSelection();
return this;
};
/**
* Selection handler for the DataSetItem selection event.
*
* @param {string} sItemId Id of the selected DataSetItem
* @private
*/
DataSet.prototype.selectItem = function(oEvent) {
var oParams = oEvent.getParameters(),
sItemId = oEvent.getParameters().itemId,
oItem = sap.ui.getCore().byId(sItemId),
aItems = this.getItems(),
iIndex = jQuery.inArray(oItem,aItems),
oldSelectedIndex = this.getLeadSelection();
if (!this.getMultiSelect()) {
if (oldSelectedIndex == iIndex && !oParams.shift) {
this.setLeadSelection( -1);
} else {
this.setLeadSelection(iIndex);
}
this._iShiftStart = null;
} else {
if (oParams.ctrl) {
if (!this.isSelectedIndex(iIndex)) {
this.addSelectionInterval(iIndex, iIndex);
} else {
this.removeSelectionInterval(iIndex, iIndex);
}
if (this._iShiftStart >= 0) {
this._iShiftStart = iIndex;
}
}
if (oParams.shift) {
if (!this._iShiftStart && this._iShiftStart !== 0) {
this._iShiftStart = oldSelectedIndex;
}
if (this._iShiftStart >= 0 && oParams.ctrl) {
this.addSelectionInterval(this._iShiftStart, iIndex);
} else if (this._iShiftStart >= 0 & !oParams.ctrl) {
this.setSelectionInterval(this._iShiftStart, iIndex);
} else {
this.setLeadSelection(iIndex);
this._iShiftStart = iIndex;
}
}
if (!oParams.shift && !oParams.ctrl) {
if (oldSelectedIndex == iIndex && iIndex != this._iShiftStart) {
this.setLeadSelection( -1);
} else {
this.setLeadSelection(iIndex);
}
this._iShiftStart = null;
}
}
};
/**
* Prepare rendering: Calls init end exit hooks on the selected view instance. Necessary to keep the view
* consistent to the DataSet state.
*
* @param {string} sItemId Id of the selected DataSetItem
* @private
*/
DataSet.prototype.prepareRendering = function() {
var oView, iViewCount = this.getViews().length;
if (iViewCount == 0) {
return;
}
this._prepareToolbar();
if (this._bDirty) {
oView = sap.ui.getCore().byId(this.getSelectedView());
if (oView.exitView) {
oView.exitView(this.getItems());
}
if (oView.initView) {
oView.initView(this.getItems());
}
this._bDirty = false;
}
};
//*** Selection Model methods ***
/**
* Returns the LeadSelection index
*
* @param {string} sItemId Id of the selected DataSetItem
* @return {int} selected index
* @protected
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
DataSet.prototype.getLeadSelection = function() {
return this.selectionModel.getLeadSelectedIndex();
};
/**
* Set the LeadSelection index
*
* @param {int} iIIndex set LeadSelection index
* @type void
* @protected
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
DataSet.prototype.setLeadSelection = function(iIndex) {
this.selectionModel.setLeadSelectedIndex(iIndex);
};
/**
* Returns true if iIndex is selected
*
* @param {int} iIndex index of selection
* @return {boolean} index selected true/false
* @protected
*/
DataSet.prototype.isSelectedIndex = function(iIndex) {
return (this.selectionModel.isSelectedIndex(iIndex));
};
/**
* Returns id of selected Item from given index
*
* @param {int} iIndex index of selection
* @return {string} id of selected item
* @protected
*/
DataSet.prototype.getSelectedItemId = function(iIndex) {
return this.getItems()[iIndex].getId();
};
/**
* Creates a view switch button
*
* @param {object} oView View
* @param {int} iIndex Index of view
* @return {object} viewSwitch instance
* @protected
*/
DataSet.prototype.createViewSwitch = function(oView, iIndex) {
var oViewSwitch;
if (oView.getIcon()) {
oViewSwitch = new sap.ui.commons.Button({
id : this.getId() + "-view-" + oView.getId(),
lite: true,
icon:oView.getIcon(),
iconHovered: oView.getIconHovered(),
iconSelected: oView.getIconSelected()
});
} else if (oView.getName()) {
oViewSwitch = new sap.ui.commons.Button({
id : this.getId() + "-view-" + oView.getId(),
text : oView.getName(),
lite: true
});
} else {
oViewSwitch = new sap.ui.commons.Button({
id : this.getId() + "-view-" + oView.getId(),
text : oView.getId(),
lite: true
});
}
oViewSwitch._viewIndex = iIndex;
//oViewSwitch.attachPress(function(oEvent){that.press(oEvent,iIndex);}, that);
return oViewSwitch;
};
/**
* Rerendering of the Toolbar
*
* @protected
*/
DataSet.prototype._rerenderToolbar = function() {
var $content = this.$("toolbar");
this._prepareToolbar();
if ($content.length > 0) {
var rm = sap.ui.getCore().createRenderManager();
sap.ui.ux3.DataSetRenderer.renderToolbar(rm, this);
rm.flush($content[0]);
rm.destroy();
}
};
/**
* Rerendering of the FilterArea
*
* @protected
*/
DataSet.prototype._rerenderFilter = function() {
var $content = this.$("filter");
if ($content.length > 0) {
var rm = sap.ui.getCore().createRenderManager();
sap.ui.ux3.DataSetRenderer.renderFilterArea(rm, this);
rm.flush($content[0]);
if (this.getShowFilter()) {
$content.removeClass("noPadding");
} else {
$content.addClass("noPadding");
}
rm.destroy();
}
};
//*** override API methods ***
/**
* setter for multi selection mode
* @param {boolean}
* bMode true for multi mode, false for single mode
* @public
*/
DataSet.prototype.setMultiSelect = function(bMode) {
this.clearSelection();
if (!bMode) {
this.setProperty("multiSelect", false);
if (!!this.selectionModel) {
this.selectionModel.setSelectionMode(sap.ui.model.SelectionModel.SINGLE_SELECTION);
}
} else {
this.setProperty("multiSelect", true);
if (!!this.selectionModel) {
this.selectionModel.setSelectionMode(sap.ui.model.SelectionModel.MULTI_SELECTION);
}
}
return this;
};
DataSet.prototype.removeItem = function(oItem) {
var result = this.removeAggregation("items", oItem, true);
if (result) {
result.detachSelected(this.selectItem,this);
result.destroyAggregation("_template",true);
this._bDirty = true;
}
return result;
};
DataSet.prototype.removeAllItems = function() {
var aItems = this.getItems(), result;
jQuery.each(aItems,function(i,oItem) {
oItem.destroyAggregation("_template",true);
oItem.detachSelected(this.selectItem,this);
});
result = this.removeAllAggregation("items");
this._bDirty = true;
return result;
};
DataSet.prototype.destroyItems = function() {
var result = this.destroyAggregation("items");
this._bDirty = true;
return result;
};
DataSet.prototype.addItem = function(oItem) {
this.addAggregation("items", oItem, true);
oItem.attachSelected(this.selectItem,this);
this._bDirty = true;
return this;
};
DataSet.prototype.insertItem = function(oItem, iIndex) {
this.insertAggregation("items", oItem, iIndex, true);
oItem.attachSelected(this.selectItem,this);
this._bDirty = true;
return this;
};
DataSet.prototype.setFilterValue = function(sFilterValue) {
this.setProperty("filterValue",sFilterValue, true);
return this;
};
DataSet.prototype.getFilterValue = function() {
return this.getProperty("filterValue");
};
DataSet.prototype.insertView = function(oView, iIndex) {
var oViewSwitch = this.createViewSwitch(oView,iIndex,true);
if (!this.getSelectedView()) {
this.setSelectedView(oView);
}
this.insertAggregation("views", oView, iIndex);
this._oSegBut.insertButton(oViewSwitch,iIndex);
this._rerenderToolbar();
return this;
};
DataSet.prototype.addView = function(oView) {
var iIndex = this.getViews().length,
oViewSwitch = this.createViewSwitch(oView,iIndex);
if (!this.getSelectedView()) {
this.setSelectedView(oView);
}
this.addAggregation("views", oView, true);
this._oSegBut.addButton(oViewSwitch);
this._rerenderToolbar();
return this;
};
DataSet.prototype.removeView = function(oView) {
var result = this.removeAggregation("views", oView, true);
if (result) {
if (this.getSelectedView() == result.getId()) {
this.setSelectedView(this.getViews()[0]);
this._bDirty = true;
result.invalidate();
} else {
this._rerenderToolbar();
}
this._oSegBut.removeButton(this.getId() + "-view-" + result.getId()).destroy();
}
return result;
};
DataSet.prototype.destroyViews = function() {
this._oSegBut.destroyButtons();
this.destroyAggregation("views");
return this;
};
DataSet.prototype.removeAllViews = function() {
var result = this.removeAllAggregation("views");
this._oSegBut.destroyButtons();
return result;
};
DataSet.prototype.setEnableSorting = function(bEnableSorting) {
//suppress rerendering ofDataSet. Rerender only the toolbar.
this.setProperty("enableSorting", bEnableSorting, true);
this._rerenderToolbar();
return this;
};
DataSet.prototype.setEnableFiltering = function(bEnableFiltering) {
//suppress rerendering ofDataSet. Rerender only the toolbar.
this.setProperty("enableFiltering", bEnableFiltering, true);
this._rerenderToolbar();
return this;
};
DataSet.prototype.setSelectedView = function(vView) {
var oldSelectedView = this.getSelectedView();
this.setAssociation("selectedView", vView);
if (oldSelectedView != this.getSelectedView()) {
this._bDirty = true;
}
if (this.getId() + "-view-" + this.getSelectedView() !== this._oSegBut.getSelectedButton()) {
this._oSegBut.setSelectedButton(this.getId() + "-view-" + this.getSelectedView());
}
return this;
};
/**
* add a toolbarItem to the toolbar
*
* @param {sap.ui.commons.ToolbarItem} oOToolbarItem
* ToolbarItem
* @type void
* @public
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
DataSet.prototype.addToolbarItem = function(oToolbarItem) {
this._getToolbar().addItem(oToolbarItem);
this._rerenderToolbar();
};
/**
* remove a toolbarItem to the toolbar
*
* @param {sap.ui.commons.ToolbarItem} oOToolbarItem
* @type void
* @public
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
DataSet.prototype.removeToolbarItem = function(oToolbarItem) {
this._getToolbar().removeItem(oToolbarItem);
this._rerenderToolbar();
};
DataSet.prototype.setShowToolbar = function(bShow) {
this.setProperty("showToolbar",bShow, true);
this._rerenderToolbar();
};
DataSet.prototype.setShowFilter = function(bShow) {
this.setProperty("showFilter",bShow, true);
this._rerenderFilter();
};
DataSet.prototype.setShowSearchField = function(bShow) {
this.setProperty("showSearchField",bShow, true);
this._rerenderToolbar();
};
/**
* @private
*/
DataSet.prototype._setToolbar = function(oToolbar) {
this.setAggregation("_toolbar",oToolbar,true);
this._rerenderToolbar();
};
/**
* @private
*/
DataSet.prototype._getToolbar = function() {
return this.getAggregation("_toolbar");
};
DataSet.prototype.refreshItems = function() {
var oBinding = this.getBinding("items"),
oSelectedView = sap.ui.getCore().byId(this.getSelectedView());
oBinding.bUseExtendedChangeDetection = true;
if (oSelectedView && oSelectedView.getItemCount && oSelectedView.getItemCount()) {
var iItemCount = Math.max(oSelectedView.getItemCount(),this.getItems().length);
if (iItemCount) {
oBinding.getContexts(0, iItemCount);
} else {
oBinding.getContexts();
}
} else {
oBinding.getContexts();
}
};
DataSet.prototype.updateItems = function(sChangeReason) {
var oBindingInfo = this.mBindingInfos["items"],
oAggregationInfo = this.getMetadata().getAggregation("items"),
oSelectedView = sap.ui.getCore().byId(this.getSelectedView()),
oBinding = oBindingInfo.binding,
fnFactory = oBindingInfo.factory,
oClone,
aItems,
oItem,
iIndex,
that = this,
aContexts = [];
oBinding.bUseExtendedChangeDetection = true;
if (oSelectedView && oSelectedView.getItemCount && oSelectedView.getItemCount()) {
var iItemCount = Math.max(oSelectedView.getItemCount(),this.getItems().length);
if (iItemCount) {
aContexts = oBinding.getContexts(0, iItemCount);
} else {
aContexts = oBinding.getContexts();
}
} else {
aContexts = oBinding.getContexts();
}
if (aContexts.diff && sChangeReason) {
var aDiff = aContexts.diff;
for (var i = 0; i < aDiff.length; i++) {
aItems = this.getItems();
iIndex = aDiff[i].index;
if (aDiff[i].type === "delete") {
oItem = aItems[iIndex];
aDiff[i].item = oItem;
this.removeItem(oItem);
} else if (aContexts.diff[i].type === "insert") {
oItem = fnFactory("", aContexts[iIndex]);
oItem.setBindingContext(aContexts[iIndex], oBindingInfo.model);
aDiff[i].item = oItem;
this.insertItem(oItem, iIndex);
}
}
if (oSelectedView && oSelectedView.updateView) {
oSelectedView.updateView(aDiff);
}
} else {
this[oAggregationInfo._sDestructor]();
jQuery.each(aContexts, function(iIndex, oContext) {
var sId = that.getId() + "-" + iIndex;
oClone = fnFactory(sId, oContext);
oClone.setBindingContext(oContext, oBindingInfo.model);
that[oAggregationInfo._sMutator](oClone);
});
}
// update context on all items after applying diff
aItems = this.getItems();
for (var i = 0, l = aContexts.length; i < l; i++) {
aItems[i].setBindingContext(aContexts[i], oBindingInfo.model);
}
};
return DataSet;
}, /* bExport= */ true);
| 27.106355 | 120 | 0.676683 |
1287ca5a9d33461ba9518ad57ea6a4fadf7670a6 | 1,243 | js | JavaScript | src/services/UserService.js | mhamzabcs/Express-MVCS-Boilerplate | 78de9b92c20d1c1c3bd4d5239f364170e2518e22 | [
"Apache-2.0"
] | null | null | null | src/services/UserService.js | mhamzabcs/Express-MVCS-Boilerplate | 78de9b92c20d1c1c3bd4d5239f364170e2518e22 | [
"Apache-2.0"
] | null | null | null | src/services/UserService.js | mhamzabcs/Express-MVCS-Boilerplate | 78de9b92c20d1c1c3bd4d5239f364170e2518e22 | [
"Apache-2.0"
] | null | null | null | const Model = require('../models/User'),
BaseService = require('../services/BaseService');
class UserService extends BaseService {
constructor() {
super(Model);
}
get(id) {
return Model.find({ _id: id }, { "password": 0, "phoneNumber": 0 }).lean();
}
// //Overriding BaseService Method
add(body) {
let user = new Model(body);
return user.validate()
.then(function() {
return Model.findOne({ email: body.email }).lean()
.then(resp => {
if (resp) {
return Promise.reject({ message: 'User with this email already exists' })
} else {
return Model.hashPassword(user.password)
.then(resp => {
user.password = resp;
return user.save();
})
.catch(err => console.log(err))
}
})
})
.catch(err => {
return Promise.reject(err);
})
}
}
module.exports = new UserService(); | 31.871795 | 101 | 0.412711 |
12888a8c86bd5e126a965f7d33fb51680b9ad4da | 552 | js | JavaScript | canvas.js | gorajski/manglebrot | c7c995c3e3d66ef55b399fed5f55ade160072c73 | [
"MIT"
] | null | null | null | canvas.js | gorajski/manglebrot | c7c995c3e3d66ef55b399fed5f55ade160072c73 | [
"MIT"
] | null | null | null | canvas.js | gorajski/manglebrot | c7c995c3e3d66ef55b399fed5f55ade160072c73 | [
"MIT"
] | null | null | null | let canvas = document.querySelector('canvas')
canvas.width = innerWidth;
canvas.height = innerHeight;
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
drawFrame()
})
window.addEventListener('mousedown', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
drawFrame()
})
requestAnimationFrame(drawFrame)
let scene = new Scene(canvas)
function drawFrame() {
let c = canvas.getContext('2d')
c.clearRect(0, 0, innerWidth, innerHeight)
scene.draw()
} | 20.444444 | 45 | 0.728261 |
12897bfdb22afe2ad40ebe65d5548bd088a1b5d7 | 484 | js | JavaScript | src/api/bigScreen/index.js | yuguo97/Ant-Vue-Node | 801f4e8d5142f071e9038adeae86c83017c45212 | [
"MIT"
] | 1 | 2020-07-28T07:11:06.000Z | 2020-07-28T07:11:06.000Z | src/api/bigScreen/index.js | kuiguo1991/ygVueTraining | 801f4e8d5142f071e9038adeae86c83017c45212 | [
"MIT"
] | 11 | 2020-07-17T15:24:43.000Z | 2020-09-11T06:53:59.000Z | src/api/bigScreen/index.js | kuiguo1991/ygVueTraining | 801f4e8d5142f071e9038adeae86c83017c45212 | [
"MIT"
] | null | null | null | /*
* @Author: your name
* @Date: 2020-09-16 10:13:51
* @LastEditTime: 2020-09-16 18:11:53
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \github\element-ui-node\src\api\bigScreen\index.js
*/
import request from "@/utils/request";
const bigScreenApi = {
getJsonMap: data => {
return request({
url: `/JSON/getJson`,
method: "get",
data
});
}
};
export default bigScreenApi;
| 22 | 64 | 0.603306 |
1289d0e5055b02765de0d05a1f0c09338096d8c9 | 5,813 | js | JavaScript | www/pages-shelter-manage-animals-manage-animals-module.js | hannahmestes/shelterConnect | 44be930544ab96590e5cf0356a0ba07a9687746a | [
"MIT"
] | 1 | 2019-02-23T05:19:58.000Z | 2019-02-23T05:19:58.000Z | www/pages-shelter-manage-animals-manage-animals-module.js | hannahmestes/shelterConnect | 44be930544ab96590e5cf0356a0ba07a9687746a | [
"MIT"
] | 15 | 2019-03-29T19:31:48.000Z | 2019-05-04T20:45:40.000Z | www/pages-shelter-manage-animals-manage-animals-module.js | hannahmestes/shelter-connect | 44be930544ab96590e5cf0356a0ba07a9687746a | [
"MIT"
] | null | null | null | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pages-shelter-manage-animals-manage-animals-module"],{
/***/ "./src/app/pages/shelter/manage-animals/manage-animals.module.ts":
/*!***********************************************************************!*\
!*** ./src/app/pages/shelter/manage-animals/manage-animals.module.ts ***!
\***********************************************************************/
/*! exports provided: ManageAnimalsPageModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManageAnimalsPageModule", function() { return ManageAnimalsPageModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/dist/fesm5.js");
/* harmony import */ var _manage_animals_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./manage-animals.page */ "./src/app/pages/shelter/manage-animals/manage-animals.page.ts");
var routes = [
{
path: '',
component: _manage_animals_page__WEBPACK_IMPORTED_MODULE_6__["ManageAnimalsPage"]
}
];
var ManageAnimalsPageModule = /** @class */ (function () {
function ManageAnimalsPageModule() {
}
ManageAnimalsPageModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
_angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_5__["IonicModule"],
_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(routes)
],
declarations: [_manage_animals_page__WEBPACK_IMPORTED_MODULE_6__["ManageAnimalsPage"]]
})
], ManageAnimalsPageModule);
return ManageAnimalsPageModule;
}());
/***/ }),
/***/ "./src/app/pages/shelter/manage-animals/manage-animals.page.html":
/*!***********************************************************************!*\
!*** ./src/app/pages/shelter/manage-animals/manage-animals.page.html ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<ion-header>\n <ion-toolbar>\n <ion-title>manage-animals</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content padding>\n\n</ion-content>\n"
/***/ }),
/***/ "./src/app/pages/shelter/manage-animals/manage-animals.page.scss":
/*!***********************************************************************!*\
!*** ./src/app/pages/shelter/manage-animals/manage-animals.page.scss ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL3NoZWx0ZXIvbWFuYWdlLWFuaW1hbHMvbWFuYWdlLWFuaW1hbHMucGFnZS5zY3NzIn0= */"
/***/ }),
/***/ "./src/app/pages/shelter/manage-animals/manage-animals.page.ts":
/*!*********************************************************************!*\
!*** ./src/app/pages/shelter/manage-animals/manage-animals.page.ts ***!
\*********************************************************************/
/*! exports provided: ManageAnimalsPage */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManageAnimalsPage", function() { return ManageAnimalsPage; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
var ManageAnimalsPage = /** @class */ (function () {
function ManageAnimalsPage() {
}
ManageAnimalsPage.prototype.ngOnInit = function () {
};
ManageAnimalsPage = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: 'app-manage-animals',
template: __webpack_require__(/*! ./manage-animals.page.html */ "./src/app/pages/shelter/manage-animals/manage-animals.page.html"),
styles: [__webpack_require__(/*! ./manage-animals.page.scss */ "./src/app/pages/shelter/manage-animals/manage-animals.page.scss")]
}),
tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [])
], ManageAnimalsPage);
return ManageAnimalsPage;
}());
/***/ })
}]);
//# sourceMappingURL=pages-shelter-manage-animals-manage-animals-module.js.map | 52.369369 | 238 | 0.649062 |
1289fa7a192288e3eb3644604792ba9fc011c0db | 5,441 | js | JavaScript | example2/script.js | yaragd/lecture3 | 7a21dd18e537a12db49c994b3d372a86e34d713d | [
"Unlicense"
] | null | null | null | example2/script.js | yaragd/lecture3 | 7a21dd18e537a12db49c994b3d372a86e34d713d | [
"Unlicense"
] | null | null | null | example2/script.js | yaragd/lecture3 | 7a21dd18e537a12db49c994b3d372a86e34d713d | [
"Unlicense"
] | null | null | null | import * as THREE from 'https://cdn.jsdelivr.net/npm/three@0.124.0/build/three.module.js'
import { OrbitControls } from 'https://cdn.jsdelivr.net/npm/three@0.124.0/examples/jsm/controls/OrbitControls.js'
import { Rhino3dmLoader } from 'https://cdn.jsdelivr.net/npm/three@0.124.0/examples/jsm/loaders/3DMLoader.js'
import rhino3dm from 'https://cdn.jsdelivr.net/npm/rhino3dm@0.15.0-beta/rhino3dm.module.js'
import { RhinoCompute } from 'https://cdn.jsdelivr.net/npm/compute-rhino3d@0.13.0-beta/compute.rhino3d.module.js'
// reference the definition
const definitionName = 'rnd_node2.gh'
// listen for slider change events
const count_slider = document.getElementById( 'count' )
count_slider.addEventListener( 'input', onSliderChange, false )
const radius_slider = document.getElementById( 'radius' )
radius_slider.addEventListener( 'input', onSliderChange, false )
const downloadButton = document.getElementById("downloadButton")
downloadButton.onclick = download
// set up loader for converting the results to threejs
const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/rhino3dm@0.15.0-beta/' )
// create a few variables to store a reference to the rhino3dm library and to the loaded definition
let rhino, definition, doc
rhino3dm().then(async m => {
rhino = m
// local
//RhinoCompute.url = 'http://localhost:8081/' // Rhino.Compute server url
// remote
RhinoCompute.url = 'https://macad2021.compute.rhino3d.com/'
RhinoCompute.apiKey = getApiKey() // needed when calling a remote RhinoCompute server
// source a .gh/.ghx file in the same directory
let url = definitionName
let res = await fetch(url)
let buffer = await res.arrayBuffer()
definition = new Uint8Array(buffer)
init()
compute()
animate()
})
async function compute() {
// collect data
// get slider values
let count = document.getElementById('count').valueAsNumber
let radius = document.getElementById('radius').valueAsNumber
// format data
let param1 = new RhinoCompute.Grasshopper.DataTree('RH_IN:radius')
param1.append([0], [radius])
let param2 = new RhinoCompute.Grasshopper.DataTree('RH_IN:count')
param2.append([0], [count])
// Add all params to an array
let trees = []
trees.push(param1)
trees.push(param2)
// Call RhinoCompute
const res = await RhinoCompute.Grasshopper.evaluateDefinition(definition, trees)
console.log(res)
collectResults(res.values)
}
function collectResults(values) {
// clear doc
if( doc !== undefined)
doc.delete()
// clear objects from scene
scene.traverse(child => {
if (!child.isLight) {
scene.remove(child)
}
})
console.log(values)
doc = new rhino.File3dm()
for ( let i = 0; i < values.length; i ++ ) {
const list = values[i].InnerTree['{ 0; }']
for( let j = 0; j < list.length; j ++) {
const data = JSON.parse(values[i].InnerTree['{ 0; }'][j].data)
const rhinoObject = rhino.CommonObject.decode(data)
doc.objects().add(rhinoObject, null)
}
}
const buffer = new Uint8Array(doc.toByteArray()).buffer
loader.parse( buffer, function ( object )
{
scene.add( object )
// hide spinner
document.getElementById('loader').style.display = 'none'
// enable download button
downloadButton.disabled = false
})
}
function onSliderChange() {
// show spinner
document.getElementById('loader').style.display = 'block'
// disable download button
downloadButton.disabled = true
compute()
}
function getApiKey() {
let auth = null
auth = localStorage['compute_api_key']
if (auth == null) {
auth = window.prompt('RhinoCompute Server API Key')
if (auth != null) {
localStorage.setItem('compute_api_key', auth)
}
}
return auth
}
// download button handler
function download () {
let buffer = doc.toByteArray()
saveByteArray("node.3dm", buffer)
}
function saveByteArray ( fileName, byte ) {
let blob = new Blob([byte], {type: "application/octect-stream"})
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.click()
}
// BOILERPLATE //
// declare variables to store scene, camera, and renderer
let scene, camera, renderer
function init() {
// create a scene and a camera
scene = new THREE.Scene()
scene.background = new THREE.Color(1, 1, 1)
camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
camera.position.z = - 30
// create the renderer and add it to the html
renderer = new THREE.WebGLRenderer({ antialias: true })
renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)
// add some controls to orbit the camera
const controls = new OrbitControls(camera, renderer.domElement)
// add a directional light
const directionalLight = new THREE.DirectionalLight( 0xffffff )
directionalLight.intensity = 2
scene.add( directionalLight )
const ambientLight = new THREE.AmbientLight()
scene.add( ambientLight )
}
// function to continuously render the scene
function animate() {
requestAnimationFrame(animate)
renderer.render(scene, camera)
}
| 27.902564 | 113 | 0.678184 |
128a365ac7dc05c28279c0dc2bf0d84d6bbd4450 | 4,899 | js | JavaScript | node_modules/@rxweb/reactive-form-validators/esm2015/util/object-maker.js | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | null | null | null | node_modules/@rxweb/reactive-form-validators/esm2015/util/object-maker.js | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | 1 | 2022-03-02T09:39:09.000Z | 2022-03-02T09:39:09.000Z | node_modules/@rxweb/reactive-form-validators/esm2015/util/object-maker.js | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | null | null | null | import { ReactiveFormConfig } from "./reactive-form-config";
export class ObjectMaker {
static toJson(key, config, values) {
let message = config ? config.message : null;
let messageKey = undefined;
if (!message && config && config.messageKey)
messageKey = config.messageKey;
let messageText = (message) ? message : (ReactiveFormConfig && ReactiveFormConfig.json && ReactiveFormConfig.json.validationMessage && ReactiveFormConfig.json.validationMessage[messageKey || key]) ? ReactiveFormConfig.json.validationMessage[messageKey || key] : '';
values.forEach((t, index) => {
messageText = messageText.replace(`{{${index}}}`, t);
});
let jObject = {};
jObject[key] = {
message: messageText, refValues: values
};
return jObject;
}
static null() {
return null;
}
static getPasswordMessage() {
let messageKey = "password";
return (ReactiveFormConfig && ReactiveFormConfig.json && ReactiveFormConfig.json.validationMessage && ReactiveFormConfig.json.validationMessage[messageKey]) ? ReactiveFormConfig.json.validationMessage[messageKey] : '';
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JqZWN0LW1ha2VyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHJ4d2ViL3JlYWN0aXZlLWZvcm0tdmFsaWRhdG9ycy8iLCJzb3VyY2VzIjpbInV0aWwvb2JqZWN0LW1ha2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTVELE1BQU0sT0FBTyxXQUFXO0lBQ3BCLE1BQU0sQ0FBQyxNQUFNLENBQUMsR0FBVyxFQUFFLE1BQVUsRUFBRSxNQUFXO1FBQzlDLElBQUksT0FBTyxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDO1FBQzdDLElBQUksVUFBVSxHQUFHLFNBQVMsQ0FBQztRQUMzQixJQUFHLENBQUMsT0FBTyxJQUFJLE1BQU0sSUFBSSxNQUFNLENBQUMsVUFBVTtZQUN0QyxVQUFVLEdBQUcsTUFBTSxDQUFDLFVBQVUsQ0FBQztRQUNuQyxJQUFJLFdBQVcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsa0JBQWtCLElBQUksa0JBQWtCLENBQUMsSUFBSSxJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxpQkFBaUIsSUFBSSxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLENBQUMsVUFBVSxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLGtCQUFrQixDQUFDLElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxVQUFVLElBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQztRQUN4USxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFLEtBQUssRUFBQyxFQUFFO1lBQ3ZCLFdBQVcsR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDLEtBQUssS0FBSyxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDekQsQ0FBQyxDQUFDLENBQUM7UUFDSCxJQUFJLE9BQU8sR0FBRyxFQUFFLENBQUM7UUFDakIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHO1lBQ1gsT0FBTyxFQUFFLFdBQVcsRUFBRSxTQUFTLEVBQUUsTUFBTTtTQUMxQyxDQUFDO1FBQ0YsT0FBTyxPQUFPLENBQUM7SUFDbkIsQ0FBQztJQUNELE1BQU0sQ0FBQyxJQUFJO1FBQ1AsT0FBTyxJQUFJLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxrQkFBa0I7UUFDckIsSUFBSSxVQUFVLEdBQUcsVUFBVSxDQUFDO1FBQzVCLE9BQU8sQ0FBQyxrQkFBa0IsSUFBSSxrQkFBa0IsQ0FBQyxJQUFJLElBQUksa0JBQWtCLENBQUMsSUFBSSxDQUFDLGlCQUFpQixJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQTtJQUM3TixDQUFDO0NBQ0oiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBSZWFjdGl2ZUZvcm1Db25maWcgfSBmcm9tIFwiLi9yZWFjdGl2ZS1mb3JtLWNvbmZpZ1wiO1xyXG5cclxuZXhwb3J0IGNsYXNzIE9iamVjdE1ha2Vye1xyXG4gICAgc3RhdGljIHRvSnNvbihrZXk6IHN0cmluZywgY29uZmlnOmFueSwgdmFsdWVzOiBhbnkpIHtcclxuICAgICAgICBsZXQgbWVzc2FnZSA9IGNvbmZpZyA/IGNvbmZpZy5tZXNzYWdlIDogbnVsbDtcclxuICAgICAgICBsZXQgbWVzc2FnZUtleSA9IHVuZGVmaW5lZDtcclxuICAgICAgICBpZighbWVzc2FnZSAmJiBjb25maWcgJiYgY29uZmlnLm1lc3NhZ2VLZXkpXHJcbiAgICAgICAgICAgIG1lc3NhZ2VLZXkgPSBjb25maWcubWVzc2FnZUtleTtcclxuICAgICAgICBsZXQgbWVzc2FnZVRleHQgPSAobWVzc2FnZSkgPyBtZXNzYWdlIDogKFJlYWN0aXZlRm9ybUNvbmZpZyAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbiAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZSAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZVttZXNzYWdlS2V5IHx8IGtleV0pPyBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZVttZXNzYWdlS2V5IHx8IGtleV0gOiAnJztcclxuICAgICAgICB2YWx1ZXMuZm9yRWFjaCgodCAsaW5kZXgpPT4ge1xyXG4gICAgICAgICAgICBtZXNzYWdlVGV4dCA9IG1lc3NhZ2VUZXh0LnJlcGxhY2UoYHt7JHtpbmRleH19fWAsIHQpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGxldCBqT2JqZWN0ID0ge307XHJcbiAgICAgICAgak9iamVjdFtrZXldID0ge1xyXG4gICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlVGV4dCwgcmVmVmFsdWVzOiB2YWx1ZXNcclxuICAgICAgICB9O1xyXG4gICAgICAgIHJldHVybiBqT2JqZWN0O1xyXG4gICAgfVxyXG4gICAgc3RhdGljIG51bGwoKSB7XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9XHJcblxyXG4gICAgc3RhdGljIGdldFBhc3N3b3JkTWVzc2FnZSgpIHtcclxuICAgICAgICBsZXQgbWVzc2FnZUtleSA9IFwicGFzc3dvcmRcIjtcclxuICAgICAgICByZXR1cm4gKFJlYWN0aXZlRm9ybUNvbmZpZyAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbiAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZSAmJiBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZVttZXNzYWdlS2V5XSkgPyBSZWFjdGl2ZUZvcm1Db25maWcuanNvbi52YWxpZGF0aW9uTWVzc2FnZVttZXNzYWdlS2V5XSA6ICcnXHJcbiAgICB9XHJcbn1cclxuIl19 | 188.423077 | 3,670 | 0.907532 |
128a3bd52b86118b0f8e0670350a2f7608215d21 | 258 | js | JavaScript | frontend/actions/index.js | jreinert/coinslip | f4811caea21b52a5d5ad717b75151e57506cb89a | [
"MIT"
] | null | null | null | frontend/actions/index.js | jreinert/coinslip | f4811caea21b52a5d5ad717b75151e57506cb89a | [
"MIT"
] | null | null | null | frontend/actions/index.js | jreinert/coinslip | f4811caea21b52a5d5ad717b75151e57506cb89a | [
"MIT"
] | null | null | null | import { createActions } from 'redux-actions'
import SLIP from './slip'
import UI from './ui'
import REDEEM_REQUEST from './redeem-request'
export const LOCATION_CHANGE = '@@router/LOCATION_CHANGE'
export default createActions({ SLIP, REDEEM_REQUEST, UI })
| 32.25 | 58 | 0.763566 |
128a4906dbe819499ca1a051992f67b81b2ffa12 | 4,584 | js | JavaScript | src/components/member/payment/banksComponent.js | asteriskiry/jasenrekisteri-frontend | 95742cab1c9f2bdc3a3b92959ccc9e12ff6c1ac5 | [
"MIT"
] | 1 | 2021-05-10T22:20:10.000Z | 2021-05-10T22:20:10.000Z | src/components/member/payment/banksComponent.js | asteriskiry/jasenrekisteri-frontend | 95742cab1c9f2bdc3a3b92959ccc9e12ff6c1ac5 | [
"MIT"
] | 6 | 2019-10-08T15:20:38.000Z | 2021-10-05T15:46:14.000Z | src/components/member/payment/banksComponent.js | asteriskiry/jasenrekisteri-frontend | 95742cab1c9f2bdc3a3b92959ccc9e12ff6c1ac5 | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import PreloaderComponent from '../../commons/preloader/preloaderComponent';
import ImageLoader from '../../commons/imageLoader/imageLoaderComponent';
import api from '../../../utils/api';
import './Banks.css';
import { Button, Card, Row, Col, Alert } from 'react-bootstrap';
class BanksComponent extends Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
id: this.props.memberId,
success: null,
message: null,
banks: null,
firstName: this.props.firstName,
lastName: this.props.lastName,
hometown: this.props.hometown,
email: this.props.email,
productId: this.props.productId,
};
}
render() {
const { isLoading, banks, message, success } = this.state;
if (isLoading === true) {
return <PreloaderComponent size="small" />;
}
if (message && !success) {
return (
<div className="container">
<Alert variant={!success ? 'danger' : 'success'}>
{message}
</Alert>
</div>
);
}
return (
<div className="container">
<Card>
<Card.Body>
<Card.Title>Valitse maksutapa</Card.Title>
<Row>
{banks.map(function(provider) {
return (
<Col lg={3} md={4} sm={4} xs={6} key={provider.name}>
<form
key={provider.name}
method="POST"
action={provider.url}
>
{provider.parameters.map(function(
param
) {
return (
<input
key={param.name}
type="hidden"
name={param.name}
value={param.value}
/>
);
})}
<Button
type="submit"
variant="light"
>
<ImageLoader
src={provider.icon}
alt={provider.name}
/>
</Button>
</form>
</Col>
);
})}
</Row>
<Card.Link className="btn btn-success" href="/">Peruuta</Card.Link>
</Card.Body>
</Card>
</div>
);
}
async componentDidMount() {
const data = {
memberId: this.state.id,
productId: this.props.productId,
};
try {
const response = await api.post('/pay/', data, {
headers: {
'Content-Type': 'application/json',
},
});
this.setState({
...this.state,
...{
isLoading: false,
banks: response.data,
message: response.data.message,
success: response.data.success,
},
});
} catch (e) {
this.setState({
...this.state,
...{
success: false,
message: 'Pyyntö tietojen päivittämiselle epäonnistui.',
isLoading: false,
},
});
}
}
}
export default BanksComponent;
| 35.8125 | 91 | 0.321553 |
128a98b50f8dbfedf51ca335e9f2cae2cac03e2f | 824 | js | JavaScript | src/components/__test__/Card.test.js | TaufikAkbar7/FindFriendApp | 4dea4c025dbf737ce1d9312104df886ef22750e6 | [
"MIT"
] | null | null | null | src/components/__test__/Card.test.js | TaufikAkbar7/FindFriendApp | 4dea4c025dbf737ce1d9312104df886ef22750e6 | [
"MIT"
] | null | null | null | src/components/__test__/Card.test.js | TaufikAkbar7/FindFriendApp | 4dea4c025dbf737ce1d9312104df886ef22750e6 | [
"MIT"
] | null | null | null | const { render, screen } = require("@testing-library/react");
import Card from '../Card';
const dummy = {
picture: {
large: 'https://randomuser.me/api/portraits/men/21.jpg'
},
name: {
first: 'john',
last: 'doe'
},
phone: 2221,
location: {
country: 'England'
}
}
describe('Test Component Card', () => {
it('should display card when client hit endpoint API', () => {
render(<Card data={dummy}/>)
// check aria-label img
expect(screen.getByRole('img', { name: 'person image' }));
// check name
expect(screen.getByRole('heading', { name: /john doe/i}));
// check phone
expect(screen.getByText(/2221/i));
// check country
expect(screen.getByText(/England/i));
})
})
| 22.888889 | 66 | 0.533981 |
128ac2211f98da11ebde3deb807301da75a1f0d9 | 1,507 | js | JavaScript | test/test-unpackSequelizeConfig.js | KTH/kth-node-configuration | 418ba11cedfdced139eb0da328b3ccc4c9a119d8 | [
"MIT"
] | 1 | 2020-07-24T20:09:12.000Z | 2020-07-24T20:09:12.000Z | test/test-unpackSequelizeConfig.js | KTH/kth-node-configuration | 418ba11cedfdced139eb0da328b3ccc4c9a119d8 | [
"MIT"
] | 3 | 2017-10-05T08:09:00.000Z | 2020-09-27T20:50:13.000Z | test/test-unpackSequelizeConfig.js | KTH/kth-node-configuration | 418ba11cedfdced139eb0da328b3ccc4c9a119d8 | [
"MIT"
] | null | null | null | /* eslint-disable no-unused-expressions */
/* eslint-env mocha */
'use strict'
const expect = require('chai').expect
const unpackSequelizeConfig = require('../lib/unpackSequelizeConfig')
const testURI = 'sqlite://path/to/my/db/database.sqlite'
const failProtocol = 'smurf://path/to/my/db/database.sqlite'
describe('unpackSequelizeConfig', () => {
it('can decode a Sequelize config from fallback URI', () => {
const obj = unpackSequelizeConfig('no-env-exists', undefined, testURI)
expect(obj.dialect).to.equal('sqlite')
expect(obj.storage).to.not.be.null
})
it('can decode a Sequelize config from env var', () => {
process.env.TEST_ENV_NOW_HERE = testURI
const obj = unpackSequelizeConfig('TEST_ENV_NOW_HERE')
expect(obj.dialect).to.equal('sqlite')
expect(obj.storage).to.not.be.null
})
it('can override pool config', () => {
process.env.TEST_ENV_NOW_HERE = testURI
const obj = unpackSequelizeConfig('TEST_ENV_NOW_HERE', undefined, undefined, {
pool: { max: 1 }
})
expect(obj.pool.max).to.equal(1)
})
it('should fetch password', () => {
process.env.PWD = 'mypassword'
const obj = unpackSequelizeConfig('no-env-exists', 'PWD', testURI)
expect(obj.password).to.equal('mypassword')
})
it('should not accept wrong protocol', () => {
let theErr
try {
unpackSequelizeConfig('no-env-exists', undefined, failProtocol)
} catch (err) {
theErr = err
}
expect(theErr).not.to.equal(undefined)
})
})
| 30.14 | 82 | 0.668879 |
128b72cbaf73e9e5aea7685a5ec1f39eda91e6a5 | 7,562 | js | JavaScript | apps/roadm/src/main/resources/app/view/roadmPort/roadmPort.js | tohotforice/onos-sdwsn | 6b5a63695a1efe11c6ff089c917a9c3cc6ef0322 | [
"Apache-2.0"
] | 3 | 2017-05-24T01:14:09.000Z | 2018-07-23T10:07:29.000Z | apps/roadm/src/main/resources/app/view/roadmPort/roadmPort.js | tohotforice/onos-sdwsn | 6b5a63695a1efe11c6ff089c917a9c3cc6ef0322 | [
"Apache-2.0"
] | null | null | null | apps/roadm/src/main/resources/app/view/roadmPort/roadmPort.js | tohotforice/onos-sdwsn | 6b5a63695a1efe11c6ff089c917a9c3cc6ef0322 | [
"Apache-2.0"
] | 8 | 2016-11-08T21:32:18.000Z | 2021-07-29T13:58:04.000Z | // js for roadm port table view
(function () {
'use strict';
var SET_TARGET_POWER_REQ = "roadmSetTargetPowerRequest";
var SET_TARGET_POWER_RESP = "roadmSetTargetPowerResponse";
var SHOW_ITEMS_REQ = "roadmShowPortItemsRequest";
var SHOW_ITEMS_RESP = "roadmShowPortItemsResponse";
var SET_OPS_MODE_REQ = "roadmSetOpsModeRequest";
var SET_OPS_MODE_RESP = "roadmSetOpsModeResponse";
// injected references
var $log, $scope, $location, fs, tbs, wss, ns;
var portCbTable = {};
function setPortPower(port, targetVal, cb) {
var id = port.id;
portCbTable[id] = cb;
wss.sendEvent(SET_TARGET_POWER_REQ,
{
devId: $scope.devId,
id: port.id,
targetPower: targetVal
});
}
function portPowerCb(data) {
portCbTable[data.id](data.valid, data.message);
}
function queryShowItems() {
wss.sendEvent(SHOW_ITEMS_REQ,
{
devId: $scope.devId,
});
}
function showItemsCb(data) {
$scope.showTargetPower = data.showTargetPower;
$scope.showServiceState = data.showServiceState;
$scope.showFlowIcon = data.showFlowIcon;
$scope.$apply();
}
function changeOpsMode() {
wss.sendEvent(SET_OPS_MODE_REQ,
{
devId: $scope.devId,
index: $scope.opsModeType.index
});
}
function changeOpsModeCb(data) {
$scope.changeModeFail = !data.valid;
if ($scope.changeModeFail) {
$scope.changeModeFailMsg = data.message;
}
$scope.$apply();
}
// check if value is an integer
function isInteger(val) {
var INTEGER_REGEXP = /^\-?\d+$/;
if (INTEGER_REGEXP.test(val)) {
return true;
}
return false;
}
angular.module('ovRoadmPort', [])
.controller('OvRoadmPortCtrl',
['$log', '$scope', '$location',
'FnService', 'TableBuilderService', 'WebSocketService', 'NavService',
function (_$log_, _$scope_, _$location_, _fs_, _tbs_, _wss_, _ns_) {
var params;
$log = _$log_;
$scope = _$scope_;
$location = _$location_;
fs = _fs_;
tbs = _tbs_;
wss = _wss_;
ns = _ns_;
$scope.deviceTip = 'Show device table';
$scope.flowTip = 'Show flow view for this device';
$scope.portTip = 'Show port view for this device';
$scope.opsModeTypes = [
{index: 0, type: "Auto"},
{index: 1, type: "Primary"},
{index: 2, type: "Secondary"}
];
$scope.opsModeType = $scope.opsModeTypes[0];//auto mode
var handlers = {};
handlers[SET_TARGET_POWER_RESP] = portPowerCb;
handlers[SHOW_ITEMS_RESP] = showItemsCb;
handlers[SET_OPS_MODE_RESP] = changeOpsModeCb;
wss.bindHandlers(handlers);
params = $location.search();
if (params.hasOwnProperty('devId')) {
$scope.devId = params['devId'];
}
tbs.buildTable({
scope: $scope,
tag: 'roadmPort',
query: params
});
$scope.setPortPower = setPortPower;
$scope.queryShowItems = queryShowItems;
$scope.changeOpsMode = changeOpsMode;
$scope.setTargetPower = function (port, targetVal) {
wss.sendEvent(SET_TARGET_POWER_REQ,
{
devId: $scope.devId,
id: port.id,
targetPower: targetVal
});
$log.debug('Got a click on:', port);
}
$scope.nav = function (path) {
if ($scope.devId) {
ns.navTo(path, { devId: $scope.devId });
}
};
$scope.$on('$destroy', function () {
wss.unbindHandlers(handlers);
});
$log.log('OvRoadmPortCtrl has been created');
}])
.directive('roadmPower', ['WebSocketService', function() {
var retTemplate =
'<span class="target-power" ng-show="!editMode" ng-click="enableEdit()">{{currItem.targetPower}}</span>' +
'<form ng-show="editMode" name="form" novalidate>' +
'<input type="number" name="formVal" ng-model="formVal">' +
'<button type="submit" ng-click="send()">Set</button>' +
'<button type="button" ng-click="cancel()">Cancel</button>' +
'<span class="input-error" ng-show="showError">{{errorMessage}}</span>' +
'</form>';
return {
restrict: 'A',
scope: {
currItem: '=roadmPower',
roadmSetPower: '&'
},
template: retTemplate,
link: function ($scope, $element) {
$scope.editMode = false;
$scope.showError = false;
$scope.errorMessage = "Invalid target power";
},
controller: function($scope, $timeout) {
$scope.enableEdit = function() {
if ($scope.currItem.hasTargetPower === "true" && $scope.editMode === false) {
// Ensure that the entry being edited remains the same even
// if the table entries are shifted around.
$scope.targetItem = $scope.currItem;
// Ensure the value seen in the field remains the same
$scope.formVal = parseInt($scope.currItem.targetPower);
$scope.editMode = true;
$timeout(function () {
$scope.$apply()
});
}
};
// Callback for server-side validation. Displays the error message
// if the input is invalid.
$scope.sendCb = function(valid, message) {
if (valid) {
// check if it's still pointing to the same item
// reordering the entries may change the binding
if ($scope.currItem.id === $scope.targetItem.id) {
// update the ui to display the new attenuation value
$scope.currItem.targetPower = $scope.formVal;
}
$scope.cancel();
} else {
$scope.errorMessage = message;
$scope.showError = true;
}
$timeout(function () {
$scope.$apply()
});
}
$scope.send = function() {
// check input is an integer
if (!isInteger($scope.formVal)) {
$scope.sendCb(false, "Target power must be an integer");
return;
}
$scope.roadmSetPower({port: $scope.targetItem, targetVal: $scope.formVal, cb: $scope.sendCb});
};
$scope.cancel = function() {
$scope.editMode = false;
$scope.showError = false;
}
}
};
}]);
}());
| 35.669811 | 118 | 0.480957 |
128b994ffa63f4d257317632f272ed49f5a8208d | 1,459 | js | JavaScript | assets/sap/ui/unified/CalendarMonthIntervalRenderer.js | jekyll-openui5/jekyll-openui5 | 159bfa9a764e0f60278774690fc9b01afcaf47ca | [
"Apache-2.0"
] | null | null | null | assets/sap/ui/unified/CalendarMonthIntervalRenderer.js | jekyll-openui5/jekyll-openui5 | 159bfa9a764e0f60278774690fc9b01afcaf47ca | [
"Apache-2.0"
] | null | null | null | assets/sap/ui/unified/CalendarMonthIntervalRenderer.js | jekyll-openui5/jekyll-openui5 | 159bfa9a764e0f60278774690fc9b01afcaf47ca | [
"Apache-2.0"
] | null | null | null | /*!
* OpenUI5
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define([],function(){"use strict";var C={apiVersion:2};C.render=function(r,c){var i=c.getId();var t=c.getTooltip_AsString();r.openStart("div",c);r.class("sapUiCal");r.class("sapUiCalInt");r.class("sapUiCalMonthInt");if(c._getShowItemHeader()){r.class("sapUiCalIntHead");}var a=sap.ui.getCore().getLibraryResourceBundle("sap.ui.unified");var A={labelledby:{value:"",append:false}};if(c._bPoupupMode){A["role"]="dialog";}r.accessibilityState(c,A);if(t){r.attr('title',t);}var w=c.getWidth();if(w&&w!=''){r.style("width",w);}r.openEnd();var h=c.getAggregation("header");r.renderControl(h);r.openStart("div",i+"-content");r.class("sapUiCalContent");r.openEnd();r.renderControl(c.getAggregation(c.getProperty("_currentPicker")));r.close("div");r.openStart("button",i+"-cancel");r.class("sapUiCalCancel");r.attr("tabindex","-1");r.openEnd();r.text(a.getText("CALENDAR_CANCEL"));r.close("button");r.openStart("div",i+"-end");r.attr("tabindex","0");r.style("width","0");r.style("height","0");r.style("position","absolute");r.style("right","0");r.style("bottom","0");r.openEnd();r.close("div");if(c.getPickerPopup()){r.openStart("div",i+"-contentOver");r.class("sapUiCalContentOver");if(!c._oPopup||!c._oPopup.isOpen()){r.style("display","none");}r.openEnd();r.close("div");}r.close("div");};return C;},true);
| 208.428571 | 1,307 | 0.69294 |
128bef332a725a69db61f8aa3b4807850e45805b | 3,015 | js | JavaScript | test/switch.test.js | suzydp/botml | 440eb5804ad615110d6e123840c6a8374ef73a84 | [
"MIT"
] | null | null | null | test/switch.test.js | suzydp/botml | 440eb5804ad615110d6e123840c6a8374ef73a84 | [
"MIT"
] | null | null | null | test/switch.test.js | suzydp/botml | 440eb5804ad615110d6e123840c6a8374ef73a84 | [
"MIT"
] | null | null | null | const { runDialogueTests } = require('./base')
runDialogueTests('switch', [{
file: 'switch.bot',
tests: [
{
label: 'switch:word-->first-case-->checkpoint-->fourth-case',
autostart: true,
expectedDialogue: `
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> meh
< So you feel bad huh
< howdy?
> ok
< Hmm, just ok? Okay then...
`
}, {
label: 'switch:word-->second-case-->workflow',
autostart: true,
expectedDialogue: `
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> good
< Oh, it is not bad ;)
< Maybe it is more than good?
> excelent
< Much better!
`
}, {
label: 'switch:word-->default-case',
autostart: true,
expectedDialogue: `
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> great
< Nice! Let's continue then...
< Bye my friend!
`
}, {
label: 'switch:code-->default-case-->workflow-->switch:word-->default-case',
expectedDialogue: `
> start email workflow
< Your email please?
> type@codename.co
< Cool. We'll reach you over at type@codename.co
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> great
< Nice! Let's continue then...
< Bye my friend!
`
}, {
label: 'switch:code-->first-case-->checkpoint-->default-case-->workflow-->switch:word-->first-case-->checkpoint-->second-case-->workflow',
expectedDialogue: `
> start email workflow
< Your email please?
> typecodename.co
< This email typecodename.co seems not legit!
< Your email please?
> type@codename.co
< Cool. We'll reach you over at type@codename.co
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> meh
< So you feel bad huh
< howdy?
> good
< Oh, it is not bad ;)
< Maybe it is more than good?
> excelent
< Much better!
`
}, {
label: 'switch:code-->third-case-->prompt',
autostart: true,
expectedDialogue: `
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> better than ever
< Seems you really cool guy!
`
}, {
label: 'switch:code-->fifth-case-->jump-to-->default-case',
autostart: true,
expectedDialogue: `
< Hi, what is your name?
> john
< Nice to meet you john
< How are you?
< howdy?
> brilliant
< Nice! Let's continue then...
< Bye my friend!
`
}
]
}])
| 25.769231 | 144 | 0.493532 |