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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d6f6f02d0744d47ca2c4875de0c966ff46d23321 | 3,845 | js | JavaScript | packages/cm6/lib/grammars/css-attribute.js | Monkatraz/mainframe | a5651256f359a09118851736f20fc16bc174248e | [
"MIT"
] | 2 | 2021-06-27T01:40:12.000Z | 2022-02-19T12:00:14.000Z | packages/cm6/lib/grammars/css-attribute.js | Monkatraz/mainframe | a5651256f359a09118851736f20fc16bc174248e | [
"MIT"
] | 196 | 2021-01-12T10:00:21.000Z | 2021-10-05T12:14:46.000Z | packages/cm6/lib/grammars/css-attribute.js | Monkatraz/mainframe | a5651256f359a09118851736f20fc16bc174248e | [
"MIT"
] | null | null | null | // This file was generated by lezer-generator. You probably shouldn't edit it.
import {Parser} from "lezer"
import {unitToken, identifiers} from "./css-tokens"
import {NodeProp} from "lezer"
const spec_callee = {__proto__:null,url:44, "url-prefix":44, domain:44, regexp:44}
export const parser = Parser.deserialize({
version: 13,
states: "&rOYQUOOOOQO'#Cb'#CbObQSO'#CaOgQSO'#C`QOQSOOOoQUO,58{O!WQUO'#CyO!cQSO,58zOOQQ'#Cd'#CdOoQUO'#CgO!kQVO'#CiO#iQUO1G.gOOQO'#Cn'#CnO#|QSO'#CmO$RQSO'#CqOOQQ'#DP'#DPOOQO,59e,59eOOQO-E6w-E6wO$WQSO,59ROOQQ,59T,59TO$`QUO'#CxOoQUO,59VOoQUO'#CxO%WQUO7+$ROOQO7+$R7+$RO%hQUO'#CoOOQQ,59X,59XO%oQWO,59]OOQQ1G.m1G.mOOQQ1G.q1G.qO%wQUO,59dOOQQ-E6v-E6vOOQO<<Gm<<GmO&oQUO'#CvO'aQUO'#DRO'kQSO,59ZO'pQSO1G.wOOQQ-E6t-E6tOoQUO'#CwO'uQSO,59mOOQQ1G.u1G.uOOQQ7+$c7+$cO'}QUO,59cOOQO-E6u-E6u",
stateData: "(^~OrOSQOS~OpPOnSP~OVTO~OiUOnSX~OYXO[_O^_Of^Oo[OpWOtYO~OpPOimXnmX~OiUOnSa~OPcOY]X[]X^]X`]Xd]Xf]Xh]Xi]Xn]Xo]Xp]Xt]XX]X~O`eOdfOhhOiTinTi~PoOYiO~OYkO~OXlO`eO~O`eOYlX[lX^lXdlXflXhlXilXnlXolXplXtlX~OdfOhpOiTqnTq~PoOXuP~PoO^tOgtO~O`eOYla[la^ladlaflahlailanlaolaplatla~O`eOXjXYjX[jX^jXdjXfjXojXpjXtjX~OdvOXuX~PoOXxO~OXyO~OdvOXua~OXkadka~PoOtgg`~",
goto: "#xvPPPPwz!QP!UPP!UP!UP!UP!U!b!nP!UPPPP!q!{#R#XPPPPP#_P#uRSOQROR`UTQOUe_TXZefgirvze]TXZefgirvzRj]QriSurzRzvQwrR{wQgZRogQVRRaVQZTQbXSdZgQmeQnfXqirvzRsi",
nodeNames: "⚠ Unit Comment StyleSheet Block Declaration PropertyName : ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee ArgList , CallLiteral CallTag ParenthesizedContent Important ;",
maxTerm: 37,
nodeProps: [
[NodeProp.openedBy, 9,"("],
[NodeProp.closedBy, 10,")"]
],
skippedNodes: [0,2],
repeatNodeCount: 4,
tokenData: ":`~RuOX#fX^#z^p#fpq#zqr'Qrs*lst+^tw#fwx0qxy1^yz1iz{1n{|1y|}6_}!O1y!O!P6j!P!Q6y!Q![9T![!]9x!]!^:T!^#y#f#y#z#z#z$f#f$f$g#z$g#BY#f#BY#BZ#z#BZ$IS#f$IS$I_#z$I_$I|#f$I|$JO#z$JO$JT#f$JT$JU#z$JU$KV#f$KV$KW#z$KW&FU#f&FU&FV#z&FV~#fQ#iQOy#oz~#oQ#tQgQOy#oz~#o~$Pfr~OX#oX^%e^p#opq%eqy#oz#y#o#y#z%e#z$f#o$f$g%e$g#BY#o#BY#BZ%e#BZ$IS#o$IS$I_%e$I_$I|#o$I|$JO%e$JO$JT#o$JT$JU%e$JU$KV#o$KV$KW%e$KW&FU#o&FU&FV%e&FV~#o~%lfr~gQOX#oX^%e^p#opq%eqy#oz#y#o#y#z%e#z$f#o$f$g%e$g#BY#o#BY#BZ%e#BZ$IS#o$IS$I_%e$I_$I|#o$I|$JO%e$JO$JT#o$JT$JU%e$JU$KV#o$KV$KW%e$KW&FU#o&FU&FV%e&FV~#oR'TSOy#oz#]#o#]#^'a#^~#oR'fSgQOy#oz#a#o#a#b'r#b~#oR'wSgQOy#oz#d#o#d#e(T#e~#oR(YSgQOy#oz#c#o#c#d(f#d~#oR(kSgQOy#oz#f#o#f#g(w#g~#oR(|SgQOy#oz#h#o#h#i)Y#i~#oR)_SgQOy#oz#T#o#T#U)k#U~#oR)pSgQOy#oz#b#o#b#c)|#c~#oR*RSgQOy#oz#h#o#h#i*_#i~#oR*fQhPgQOy#oz~#o~*oUOY*lZr*lrs+Rs#O*l#O#P+W#P~*l~+WO^~~+ZPO~*lR+aWOy#oz!Q#o!Q![+y![!c#o!c!i+y!i#T#o#T#Z+y#Z~#oR,OWgQOy#oz!Q#o!Q![,h![!c#o!c!i,h!i#T#o#T#Z,h#Z~#oR,mWgQOy#oz!Q#o!Q![-V![!c#o!c!i-V!i#T#o#T#Z-V#Z~#oR-^W[PgQOy#oz!Q#o!Q![-v![!c#o!c!i-v!i#T#o#T#Z-v#Z~#oR-}W[PgQOy#oz!Q#o!Q![.g![!c#o!c!i.g!i#T#o#T#Z.g#Z~#oR.lWgQOy#oz!Q#o!Q![/U![!c#o!c!i/U!i#T#o#T#Z/U#Z~#oR/]W[PgQOy#oz!Q#o!Q![/u![!c#o!c!i/u!i#T#o#T#Z/u#Z~#oR/zWgQOy#oz!Q#o!Q![0d![!c#o!c!i0d!i#T#o#T#Z0d#Z~#oR0kQ[PgQOy#oz~#o~0tUOY0qZw0qwx+Rx#O0q#O#P1W#P~0q~1ZPO~0qR1cQYPOy#oz~#o~1nOX~R1sQ`POy#oz~#oR2OU`POy#oz!O#o!O!P2b!P!Q#o!Q![4w![~#oR2gSgQOy#oz!Q#o!Q![2s![~#oR2zWtPgQOy#oz!Q#o!Q![2s![!g#o!g!h3d!h#X#o#X#Y3d#Y~#oR3iWgQOy#oz{#o{|4R|}#o}!O4R!O!Q#o!Q![4d![~#oR4WSgQOy#oz!Q#o!Q![4d![~#oR4kStPgQOy#oz!Q#o!Q![4d![~#oR5OYtPgQOy#oz!O#o!O!P5n!P!Q#o!Q![4w![!g#o!g!h3d!h#X#o#X#Y3d#Y~#oR5uWtPgQOy#oz!Q#o!Q![5n![!g#o!g!h3d!h#X#o#X#Y3d#Y~#oR6dQdPOy#oz~#oR6mSOy#oz!Q#o!Q![2s![~#o~7OR`POy#oz{7X{~#o~7^SgQOy7Xyz7jz{8_{~7X~7mROz7jz{7v{~7j~7yTOz7jz{7v{!P7j!P!Q8Y!Q~7j~8_OQ~~8dUgQOy7Xyz7jz{8_{!P7X!P!Q8v!Q~7X~8}QQ~gQOy#oz~#oR9YYtPOy#oz!O#o!O!P5n!P!Q#o!Q![4w![!g#o!g!h3d!h#X#o#X#Y3d#Y~#oR9}QVPOy#oz~#oR:YQiPOy#oz~#o",
tokenizers: [unitToken, identifiers, 0, 1],
topRules: {"StyleSheet":[0,3]},
specialized: [{term: 31, get: value => spec_callee[value] || -1}],
tokenPrec: 331
})
| 153.8 | 1,951 | 0.674642 |
d6f752a0f6587cb8cb091c8c7ac409f572e54b42 | 474 | js | JavaScript | frontend/src/tests/unit/Table.test.js | zehguilherme/avaliacao-2sow | a2254e4cdb82ef82bf9d0b1c827569cdf5ba8f77 | [
"MIT"
] | null | null | null | frontend/src/tests/unit/Table.test.js | zehguilherme/avaliacao-2sow | a2254e4cdb82ef82bf9d0b1c827569cdf5ba8f77 | [
"MIT"
] | 3 | 2021-05-21T17:09:16.000Z | 2022-02-19T04:02:44.000Z | frontend/src/tests/unit/Table.test.js | zehguilherme/avaliacao-2sow | a2254e4cdb82ef82bf9d0b1c827569cdf5ba8f77 | [
"MIT"
] | null | null | null | import React from 'react';
import { fireEvent, render, waitForElement } from '@testing-library/react';
import Table from '../../components/Table';
describe('Testes para a tabela de listagem de usuários', () => {
it('Deve renderizar a tabela com todos os itens', async () => {
const { getByTestId } = render(<Table />);
// buscar input de filtragem por nome
const filterInput = await waitForElement(
() => getByTestId('filterInput')
)
});
});
| 24.947368 | 75 | 0.651899 |
d6f837b27db76e9e08245f905da522c9846af6e6 | 1,723 | js | JavaScript | docs/search/functions_b.js | ComplicatedPhenomenon/C_practice | 03838005638a3dd9d3deef86c5944b58db278d98 | [
"MIT"
] | null | null | null | docs/search/functions_b.js | ComplicatedPhenomenon/C_practice | 03838005638a3dd9d3deef86c5944b58db278d98 | [
"MIT"
] | null | null | null | docs/search/functions_b.js | ComplicatedPhenomenon/C_practice | 03838005638a3dd9d3deef86c5944b58db278d98 | [
"MIT"
] | null | null | null | var searchData=
[
['newavltreenode_378',['newAVLTreeNode',['../tree_8c.html#a56433eb4b0d27fe9f8e1ad0ce4ae9cf6',1,'newAVLTreeNode(int val): tree.c'],['../tree_8h.html#a56433eb4b0d27fe9f8e1ad0ce4ae9cf6',1,'newAVLTreeNode(int val): tree.c']]],
['newnode_379',['newNode',['../AVL_8cpp.html#a770da11603a821bfd0fa82ac18ab9be6',1,'newNode(int key): AVL.cpp'],['../levelOrderTraversal__2_8cpp.html#a88fca17b6631a0dfb62b48288fa533ef',1,'newNode(int val): levelOrderTraversal_2.cpp'],['../tree_8c.html#a88fca17b6631a0dfb62b48288fa533ef',1,'newNode(int val): tree.c'],['../tree_8cpp.html#a88fca17b6631a0dfb62b48288fa533ef',1,'newNode(int val): tree.cpp'],['../tree_8h.html#a88fca17b6631a0dfb62b48288fa533ef',1,'newNode(int val): AVL.cpp'],['../LeetCode_2LinkedList_2singleLinkedList_8c.html#aa73f59e66a5bf9f8ac618ccf77d28540',1,'newNode(int val): singleLinkedList.c'],['../LeetCode_2LinkedList_2singleLinkedList_8h.html#aa73f59e66a5bf9f8ac618ccf77d28540',1,'newNode(int val): AVL.cpp'],['../DataStructures_2LinkedList_2singleLinkedList_8c.html#af65c2b6af991fef47fff89f973ddfa0d',1,'newNode(int val): singleLinkedList.c'],['../DataStructures_2LinkedList_2singleLinkedList_8h.html#af65c2b6af991fef47fff89f973ddfa0d',1,'newNode(int val): AVL.cpp'],['../LRUcache_8c.html#afd8566ba31215efdbdccb6e431b57ed5',1,'newNode(int key, int value): LRUcache.c']]],
['newrbnode_380',['newRBNode',['../RBTree_8c.html#a1a69e111cd17f690cbf2044d2319fc9d',1,'RBTree.c']]],
['node_5fcreate_381',['node_create',['../demo_8c.html#a010630005a843c883f8f63a524fb2a49',1,'demo.c']]],
['node_5fdestroy_382',['node_destroy',['../demo_8c.html#abda7be3acebbe908fa12bb7b0a91e82e',1,'demo.c']]]
];
| 191.444444 | 1,149 | 0.777133 |
d6f8cdc13df4d6bd273c0bcfa660fbd26261670b | 1,093 | js | JavaScript | controllers/Producto.js | jmontes50/backend-angular | eda70dfeaa118b46dbc137edec7437dd6b28165b | [
"MIT"
] | null | null | null | controllers/Producto.js | jmontes50/backend-angular | eda70dfeaa118b46dbc137edec7437dd6b28165b | [
"MIT"
] | null | null | null | controllers/Producto.js | jmontes50/backend-angular | eda70dfeaa118b46dbc137edec7437dd6b28165b | [
"MIT"
] | null | null | null | const { getProductos, getProductoById } = require('../services/productoServices');
const productoService = require('../services/productoServices');
module.exports = {
create: async (req, res) => {
try {
const productoNuevo = await productoService.create(req.body);
res.status(201).send({
ok:true,
content:productoNuevo
})
} catch (error) {
res.status(409).send({
ok:false,
content:error
})
}
},
getProductos: async(req, res) => {
try{
const productos = await productoService.getProductos();
res.status(200).send({
ok:true,
content:productos
})
}catch(error){
res.status(404).send({
ok:false,
content:productos
})
}
},
getProductoById: async(req, res) => {
try {
const producto = await productoService.getProductoById(req.params.id);
res.status(200).send({
ok:true,
content:producto
})
} catch (error) {
res.status(404).send({
ok:false,
content:error
})
}
}
} | 23.255319 | 82 | 0.561757 |
d6f93965361b2b70a6603d9cb8e9ba672fd291b1 | 9,678 | js | JavaScript | bitrix/modules/mobile/install/templates/mobile_app/components/bitrix/voting.current/.userfield/script.js | BuildingBridge/biznet | 0e9e864be99e01bd35f4321a04736866937897b0 | [
"Unlicense"
] | 1 | 2020-10-05T04:28:40.000Z | 2020-10-05T04:28:40.000Z | bitrix/modules/mobile/install/templates/mobile_app/components/bitrix/voting.current/.userfield/script.js | shuchitamathur28/bitrix24 | fafc179382f028989a4ee4a5f97422e49b1526b4 | [
"Unlicense"
] | null | null | null | bitrix/modules/mobile/install/templates/mobile_app/components/bitrix/voting.current/.userfield/script.js | shuchitamathur28/bitrix24 | fafc179382f028989a4ee4a5f97422e49b1526b4 | [
"Unlicense"
] | null | null | null | ;(function(window){
if (BX && BX["Mobile"] && BX["Mobile"]["Vote"] && BX["Mobile"]["Vote"]["init"])
return;
BX.namespace("BX.Mobile.Vote");
var repo = {};
window.voteGetID = function() {
return 'vote' + new Date().getTime();
};
var VCLinkCloseWait = function() { return app.hidePopupLoader(); },
VCLinkShowWait = function() { return app.showPopupLoader(); },
BVoteChecker = (function(){
var d = function(params)
{
if (!params["url"])
throw "Vote error: url is empty.";
else if(!params["CID"])
throw "Vote error: id is empty.";
else if(!BX(params["controller"]))
throw "Vote error: controller is absent.";
this.CID = params["CID"];
this.voteId = params["voteId"];
this.url = params["url"];
this.controller = params["controller"];
this.form = params['form'];
this.bind();
this.period = [1, 5, 10, 30];
params["startCheck"] = parseInt(params["startCheck"]);
this.lastVote = (params["startCheck"] > 0 ? params["startCheck"] / 60 : 0);
if (this.lastVote <= 0)
this.check();
};
d.prototype = {
status : "ready",
check: function(now) {
var time = (now === true ? 0 : false), i;
if(now !== true) {
for(i = 0; i < this.period.length; i++) {
if(this.lastVote <= this.period[i]) {
time = this.period[i];
break;
}
}
}
if(time !== false)
setTimeout(BX.proxy(function() {
this.send()
}, this), time * 60 * 1000);
},
send: function() {
BX.ajax({
url: this.url.
replace(/.AJAX_RESULT=Y/g, '').
replace(/.AJAX_POST=Y/g, '').
replace(/.sessid=[^&]*/g, '').
replace(/.VOTE_ID=([\d]+)/, '').
replace(/.view_form=Y/g, '').
replace(/.view_result=Y/g, ''),
method: 'POST',
dataType: 'json',
data: {
VOTE_ID: this.voteId,
AJAX_RESULT: 'Y',
view_result: 'Y',
dataType: 'json',
sessid: BX.bitrix_sessid()
},
onsuccess: BX.proxy(function(data) {
this.start(data);
}, this),
onfailure: function(data) {
}
});
},
start: function(data) {
this.lastVote = parseInt(data["LAST_VOTE"] / 60);
this.changeData(data);
this.check();
},
changeData: function(data) {
data = data["QUESTIONS"];
var question, answer;
BX.onCustomEvent(this.controller, 'OnBeforeChangeData');
for(var q in data) {
if(data.hasOwnProperty(q)) {
question = BX.findChild(this.controller, {"attr": {"id": "question" + q}}, true);
if(question) {
for(var i in data[q]) {
if(data[q].hasOwnProperty(i)) {
answer = BX.findChild(question, {"attr": {"id": ("answer" + i)}}, true);
if(answer) {
BX.adjust(answer, {attrs: {"bx-voters-count": data[q][i]["COUNTER"]}});
BX.unbindAll(answer, "click");
if(!this.form)
BX.bind(answer, "click", voteGetUsersL);
BX.adjust(BX.findChild(answer, {
"tagName": "DIV",
"className": "bx-vote-data-percent"
}, true),
{"html": '<span>' + parseInt(data[q][i]["PERCENT"]) + '</span><span class="post-vote-color">%</span>'});
BX.adjust(BX.findChild(answer, {
"tagName": "DIV",
"className": "bx-vote-answer-bar"
}, true),
{"style": {"width": parseInt(data[q][i]["PERCENT"]) + '%'}});
}
}
}
}
}
}
BX.adjust(BX.findChild(this.controller, {"tagName": "TD", "className": "bx-vote-events-count"}, true),
{"html": '<span>' + parseInt(data["COUNTER"]) + '</span><span class="post-vote-color">%</span>'});
BX.onCustomEvent(this.controller, 'OnAfterChangeData');
},
replace: function(url, data) {
url = url.
replace(/.AJAX_RESULT=Y/g,'').
replace(/.AJAX_POST=Y/g,'').
replace(/.sessid=[^&]*/g, '').
replace(/.VOTE_ID=([\d]+)/,'').
replace(/.view_form=Y/g, '').
replace(/.view_result=Y/g, '');
this.post(url, data);
},
getXHR : function() {
this.BMAjaxWrapper = (this.BMAjaxWrapper || new MobileAjaxWrapper());
return this.BMAjaxWrapper;
},
post : function(url, data) {
if (this.status == "busy")
return;
var empty = true, i;
if (data)
{
for (i in data)
{
if (data.hasOwnProperty(i))
{
empty = false;
break;
}
}
}
if (empty)
return;
data["VOTE_ID"] = this.voteId;
data["AJAX_POST"] = "Y";
data["sessid"] = BX.bitrix_sessid();
VCLinkShowWait();
this.status = "busy";
this.postRelease = BX.proxy(function() {
VCLinkCloseWait();
this.status = "ready";
}, this);
this.getXHR().Wrap({
type: 'html',
method: 'POST',
url: url,
data: data,
processData: false,
callback: BX.proxy(function(result){
this.postRelease();
if (data && ((data == '{"status":"failed"}') || (data.status == 'failed')))
{
app.BasicAuth({
success: BX.proxy(function(){this.post(url, data)}, this),
failure: function(){ }
});
}
else
{
var ob = BX.processHTML(result, false),
res = this.node.block;
res.innerHTML = "";
res.innerHTML = ob.HTML;
BX.removeClass(res, "bx-vote-block-result");
BX.removeClass(res, "bx-vote-block-result-view");
if (ob.HTML.indexOf('<form') < 0) {
BX.addClass(res, "bx-vote-block-result");
}
BX.defer(function(){
BX.ajax.processScripts(ob.SCRIPT);
})();
}
}, this),
callback_failure : this.postRelease
});
},
node : {
revote : null,
vote : null,
results : null,
block : null
},
bind : function() {
//BX.addCustomEvent("onVoteEntityWasChanged", BX.proxy());
this.node.revote = BX('vote-revote-' + this.CID);
if (this.node.revote)
{
BX.unbindAll(this.node.revote);
BX.bind(this.node.revote, "click", BX.delegate(function(e) {
BX.eventCancelBubble(e);
this.replace(e.target.getAttribute("href"), {view_form : "Y"});
return BX.PreventDefault(e);
}, this));
}
this.node.vote = BX('vote-do-' + this.CID);
if (this.node.vote && this.form)
{
BX.unbindAll(this.node.vote);
BX.bind(this.node.vote, "click", BX.proxy(function(e) {
BX.eventCancelBubble(e);
this.replace(this.form.action, BX.ajax.prepareForm(this.form).data);
return BX.PreventDefault(e);
}, this));
}
this.node.results = BX('vote-view-' + this.CID);
this.node.block = BX.findParent(this.controller, {tagName : "DIV", className : "bx-vote-block"});
if (this.node.results)
{
BX.unbindAll(this.node.results);
BX.bind(this.node.results, "click", BX.proxy(function(e) {
BX.eventCancelBubble(e);
VCLinkShowWait();
this.node.resultsf = BX.proxy(function() {
BX.addClass(this.node.block, "bx-vote-block-result");
BX.addClass(this.node.block, "bx-vote-block-result-view");
VCLinkCloseWait();
BX.removeCustomEvent(this.controller, 'OnBeforeChangeData', this.node.resultsf);
}, this);
BX.addCustomEvent(this.controller, 'OnBeforeChangeData', this.node.resultsf);
this.node.resultsf1 = BX.proxy(function(){
BX.hide(BX("vote-view-" + this.CID));
BX.removeCustomEvent(this.controller, 'OnAfterChangeData', this.node.resultsf1);
}, this);
BX.addCustomEvent(this.controller, 'OnAfterChangeData', this.node.resultsf1);
this.lastVote = 0;
this.check(true);
return BX.PreventDefault(e);
}, this));
}
this.onPullEvent = BX.delegate(function(data) {
var params = data.params;
if (data.command == "voting" && params["VOTE_ID"] == this.voteId)
{
var res = BX.findParent(this.controller, {"className" : "bx-vote-block"});
if (res && BX.hasClass(res, "bx-vote-block-result"))
{
this.changeData(params);
}
}
}, this);
BX.addCustomEvent(window, 'onPull-vote', this.onPullEvent);
BXMobileApp.onCustomEvent('onPullExtendWatch', {id: 'VOTE_' + this.voteId}, true);
},
unbind : function() {
delete this.form;
BX.unbindAll(this.node.revote);
delete this.node.revote;
BX.unbindAll(this.node.vote);
delete this.node.vote;
BX.unbindAll(this.node.results);
delete this.node.results;
delete this.node.block;
BX.removeCustomEvent(window, 'onPull-vote', this.onPullEvent);
}
};
return d;
})(),
voteGetUsers = function(e, node) {
if (!node || !node.hasAttribute("bx-voters-count") || parseInt(node.getAttribute("bx-voters-count")) <= 0)
return false;
BX.PreventDefault(e);
var id = node.getAttribute("id").replace("answer", ""),
url = "/bitrix/templates/mobile_app/components/bitrix/voting.current/.userfield/users.php?answer_id="+id+"&sessid="+BX.bitrix_sessid();
app.openBXTable({
url: url,
TABLE_SETTINGS : {
markmode : false,
cache: false
}
});
},
voteGetUsersL = function(e) { voteGetUsers(e, this); };
BX.Mobile.Vote.init = function(params) {
params["CID"] = params["id"];
params["controller"] = BX('vote-' + params["id"]);
params["form"] = BX('vote-form-' + params["id"]);
if (repo[params["id"]])
repo[params["id"]].unbind();
repo[params["id"]] = new BVoteChecker(params);
var rows = BX.findChildren(params.controller, {"tagName" : "TR", "className" : "bx-vote-answer-item"}, true);
if (!params["form"] && rows && rows.length > 0)
{
for (var ii = 0; ii < rows.length; ii++)
{
BX.unbindAll(rows[ii]);
BX.bind(rows[ii], "click", voteGetUsersL);
}
}
};
})(window); | 29.59633 | 139 | 0.569126 |
d6faf1bb83f8cccc80d8d770e000dbc8d25a3cc0 | 1,731 | js | JavaScript | tdrs-frontend/src/components/Reports/Reports.test.js | kniz-raft/TANF-app | 27c31acbf4d04eb497c0c43e38867379f8923da7 | [
"CC0-1.0"
] | null | null | null | tdrs-frontend/src/components/Reports/Reports.test.js | kniz-raft/TANF-app | 27c31acbf4d04eb497c0c43e38867379f8923da7 | [
"CC0-1.0"
] | 15 | 2022-01-21T18:56:57.000Z | 2022-03-23T03:48:18.000Z | tdrs-frontend/src/components/Reports/Reports.test.js | ADPennington/TANF-app | c27d32d97d5d47b721c0809f9751092b37cf9e70 | [
"CC0-1.0"
] | 2 | 2020-12-03T19:01:06.000Z | 2020-12-21T17:37:21.000Z | import React from 'react'
import { mount } from 'enzyme'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import configureStore from 'redux-mock-store'
import Reports from './Reports'
import Button from '../Button'
describe('Reports', () => {
const initialState = {
reports: {
file: null,
error: null,
year: 2020,
},
}
const mockStore = configureStore([thunk])
it('should render the USWDS Select component with two options', () => {
const store = mockStore(initialState)
const wrapper = mount(
<Provider store={store}>
<Reports />
</Provider>
)
const select = wrapper.find('.usa-select')
expect(select).toExist()
const options = wrapper.find('option')
expect(options.length).toEqual(2)
})
it('should change route to `/reports/:year/upload` on click of `Begin Report` button', () => {
const store = mockStore(initialState)
const wrapper = mount(
<Provider store={store}>
<Reports />
</Provider>
)
const beginButton = wrapper.find(Button)
expect(beginButton).toExist()
beginButton.simulate('click')
expect(window.location.href.includes('/reports/2020/upload')).toBeTruthy()
})
it('should dispatch setYear when a year is selcted', () => {
const store = mockStore(initialState)
const origDispatch = store.dispatch
store.dispatch = jest.fn(origDispatch)
const wrapper = mount(
<Provider store={store}>
<Reports />
</Provider>
)
const select = wrapper.find('.usa-select')
select.simulate('change', {
target: {
value: 2021,
},
})
expect(store.dispatch).toHaveBeenCalledTimes(1)
})
})
| 23.08 | 96 | 0.628538 |
d6fb57e7c89a10a7e09fdd6b61b27a2ffb018d3a | 703 | js | JavaScript | server/model/model.js | Elko90/abcbank-cms | 1f3b57df597444b52599a43650adf0ca3d19c8bd | [
"MIT"
] | null | null | null | server/model/model.js | Elko90/abcbank-cms | 1f3b57df597444b52599a43650adf0ca3d19c8bd | [
"MIT"
] | null | null | null | server/model/model.js | Elko90/abcbank-cms | 1f3b57df597444b52599a43650adf0ca3d19c8bd | [
"MIT"
] | null | null | null | const mongoose = require('mongoose');
var schema = new mongoose.Schema({
pno:{
type: String,
required: true,
unique: true
},
fname: {
type: String,
required: true
},
lname: {
type: String,
required: true
},
dob: {
type: String,
required: true
},
city:{
type: String,
required: true,
},
accno:{
type: String,
required: true,
unique: true,
}
// TIMESTAMPS: TRUE, this is to add created date and update time in mongodb schema but somehow we didnt make it work...
})
const Userdb = mongoose.model('userdb', schema);
module.exports = Userdb; | 20.085714 | 123 | 0.536273 |
d6fbb128212ec262a171d85d3027bd0a0334fa75 | 982 | js | JavaScript | client/src/index.js | andrescastellanos09/Literature | f16b3c47b1e994540f55fc2c012df801e7c478ff | [
"MIT"
] | null | null | null | client/src/index.js | andrescastellanos09/Literature | f16b3c47b1e994540f55fc2c012df801e7c478ff | [
"MIT"
] | null | null | null | client/src/index.js | andrescastellanos09/Literature | f16b3c47b1e994540f55fc2c012df801e7c478ff | [
"MIT"
] | null | null | null | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { BrowserRouter} from 'react-router-dom'
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import createSagaMiddleware from 'redux-saga'
import mainReducer from './Reducers'
import watchFetchSearchData from './Sagas.js'
import './index.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'react-bootstrap-table/dist/react-bootstrap-table-all.min.css'
//saga middleware
const sagaMiddleware = createSagaMiddleware()
//redux store with saga middleware
const store = createStore(
mainReducer,
applyMiddleware(sagaMiddleware)
)
// activate the saga(s)
sagaMiddleware.run(watchFetchSearchData)
//fetch initial data
store.dispatch({type: 'FETCH_SEARCH_DATA', payload:{firstName: "*"}})
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>,
document.getElementById('root')
);
| 24.55 | 69 | 0.747454 |
d6fc142490b73033804ee069fbf98c13ebb63de9 | 2,353 | js | JavaScript | src/components/CalendarHours.js | jalik/react-datetime-input | efb90a59d98a16633e24dcf844f64383324a5aed | [
"MIT"
] | null | null | null | src/components/CalendarHours.js | jalik/react-datetime-input | efb90a59d98a16633e24dcf844f64383324a5aed | [
"MIT"
] | null | null | null | src/components/CalendarHours.js | jalik/react-datetime-input | efb90a59d98a16633e24dcf844f64383324a5aed | [
"MIT"
] | null | null | null | /*
* The MIT License (MIT)
* Copyright (c) 2021 Karl STEIN
*/
import { DateTime } from 'luxon';
import {
func,
string,
} from 'prop-types';
import React, {
useCallback,
useMemo,
} from 'react';
import { ACTION_SELECT_HOUR } from '../calendarReducer';
import { getNumbers } from '../lib';
import DateButton from './buttons/DateButton';
import TimeButton from './buttons/TimeButton';
import { useCalendarContext } from './CalendarProvider';
function CalendarHours(props) {
const {
currentItemClassName,
itemClassName,
onChange,
selectedItemClassName,
} = props;
const {
dispatch,
locale,
numberFormatter,
state,
} = useCalendarContext();
const { dateTime, selectedDateTime } = state;
const now = DateTime.now().setLocale(locale);
const hours = useMemo(() => getNumbers(24, 1), []);
const handleClickValue = useCallback((hour) => (
() => {
onChange(dateTime.set({ hour }));
dispatch({
type: ACTION_SELECT_HOUR,
data: { hour },
});
}
), [dateTime, dispatch, onChange]);
return (
<div className="CalendarHours">
<div className="CalendarHeader">
<DateButton />
<TimeButton />
</div>
<div className="CalendarBody">
{hours.map((hour) => {
let classes = itemClassName || '';
if (now.hour === hour
&& now.hasSame(dateTime, 'day')) {
classes += ` ${currentItemClassName}`;
}
if (selectedDateTime
&& selectedDateTime.hour === hour
&& selectedDateTime.hasSame(dateTime, 'day')) {
classes += ` ${selectedItemClassName}`;
}
return (
<button
key={hour}
className={classes}
onClick={handleClickValue(hour)}
type="button"
>
{numberFormatter.format(hour)}
</button>
);
})}
</div>
</div>
);
}
CalendarHours.propTypes = {
currentItemClassName: string,
itemClassName: string,
onChange: func.isRequired,
selectedItemClassName: string,
};
CalendarHours.defaultProps = {
currentItemClassName: 'CalendarHours-Hour-Current',
itemClassName: 'CalendarHours-Hour',
selectedItemClassName: 'CalendarHours-Hour-Selected',
};
export default CalendarHours;
| 23.767677 | 59 | 0.58946 |
d6fc9c71badf9252c76981caf6577a467a096c01 | 6,763 | js | JavaScript | src/templates/js/directives/ititlefts.js | peigong/prismatic-injector-template | 654584753bb90fef1f477c6284f881f252b96886 | [
"MIT"
] | null | null | null | src/templates/js/directives/ititlefts.js | peigong/prismatic-injector-template | 654584753bb90fef1f477c6284f881f252b96886 | [
"MIT"
] | null | null | null | src/templates/js/directives/ititlefts.js | peigong/prismatic-injector-template | 654584753bb90fef1f477c6284f881f252b96886 | [
"MIT"
] | null | null | null | uiCore.directive('ititlefts', [
'coreService',
'coreUtils',
'$timeout',
function(coreService, coreUtils, $timeout) {
return {
restrict: 'EA',
replace: true,
require: '^pid',
scope: {
param: '=param'
},
template: '<div {{param}}><imageholder cid="titleimage" ng-show="compData.JS.titleimageconfigflag" param="compData.JS.titleimageconfig"></imageholder><irichtext cid="titletext" param="compData.JS.titletextconfig"></irichtext></div>',
controller: [
'$scope',
'$element',
'$attrs',
'coreService',
'coreUtils', 'Const',
function($scope, $element, $attrs, coreService, coreUtils, Const) {
$scope.cid = $attrs.cid;
$scope.eventMap = {};
$scope.compData = {
CSS: {
"z-index": "2047483648",
position: "relative",
width: "100%",
left: "0px",
top: "0px",
right: "0px",
height: "2.4em",
"line-height": "2.4em",
"text-align": "left",
"padding-left": "2.3em",
"border-bottom-width": "1px",
"border-bottom-style": "solid",
"border-bottom-color": "rgb(214,214,214)",
background: "rgb(248,248,248)",
"-webkit-box-sizing": "border-box",
"-moz-box-sizing": "border-box",
"box-sizing": "border-box"
},
JS: {
clickable: false,
stateconfig: {
state: "0"
},
titleimageconfig: {
CSS: {},
JS: {
stateconfig: {
state: "0"
}
}
},
titletextconfig: {
CSS: {
"text-align": "left",
color: "rgb(34,34,34)",
display: "block",
"font-size": "1em",
height: "2.4em",
"line-height": "2.4em"
},
JS: {
clickable: false,
stateconfig: {
state: "0"
}
}
}
}
};
$scope.setEvents = function() {
if ($scope.compData.JS.clickable) {
var _touchstart = Const.touchEvent.start;
var _touchmove = Const.touchEvent.move;
var _touchend = Const.touchEvent.end;
var _lastYPos = 0;
var _lastXPos = 0;
var _currentYPos = 0;
var _currentXPos = 0;
$element.bind(_touchend, function(e) {
if (coreUtils.cdrUtils.canWriteUITracingCDR($scope.compData.JS.cdrConfig)) {
$scope.compData.JS['cdrData'] = {};
$scope.compData.JS.cdrData = {
'pageId': $scope.pageID,
'componentId': coreUtils.createCdrid($scope.pageID, "", 'returnback')
};
coreUtils.cdrService($scope.compData.JS.cdrConfig.uitracingcdr, $scope.compData.JS.cdrData);
}
coreService.fireEvent($scope.cid, 'click' + $scope.compData.JS.stateconfig.state);
});
}
}
;
$scope.setState = function(data) {
$scope.compData.JS.stateconfig.state = data.state;
}
;
$scope.$on($attrs['cid'] + '_handleEvent', function(event, cevent, args, deferred) {
if ($scope.eventMap[cevent]) {
$scope.eventMap[cevent](args);
if (null != deferred) {
deferred.resolve();
}
}
});
$scope.extendComponentData = function(componetData) {
$scope.compData = coreUtils.extendDeep($scope.compData, componetData);
}
;
$scope.init = function() {
coreService.registerComponentInstance($element.attr('cid'), $scope);
$scope.extendComponentData(coreService.getInitProperties($scope.cid));
$scope.applyStyle();
$scope.setEvents();
}
;
$scope.applyStyle = function() {
if (null != $scope.compData.JS.stateconfig['state' + $scope.compData.JS.stateconfig.state]) {
coreUtils.extendDeep($scope.compData.CSS, $scope.compData.JS.stateconfig['state' + $scope.compData.JS.stateconfig.state]);
}
$element.css($scope.compData.CSS);
//用于appbar有subscribeid时
// if(top.subscribeid1){
// $element.css({'padding-left':'0','left':'.7em','top':'.5em'});
// }
}
;
$scope.$watch($scope.param, function(newValue) {
if ($scope.param) {
$scope.compData = $scope.param;
$scope.applyStyle();
}
});
$scope.updateTitleText = function(titleTextData, deferred) {
$scope.compData.JS.titletextconfig.JS.textdata = titleTextData.stitle;
if (null != deferred) {
deferred.resolve();
}
}
;
$scope.eventMap['updateState'] = $scope.setState;
$scope.eventMap['updateTitleText'] = $scope.updateTitleText;
$scope.$on($attrs['cid'] + '_handleEvent', function(event, cevent, args, deferred) {
if ($scope.eventMap[cevent]) {
$scope.eventMap[cevent](args);
if (null != deferred) {
deferred.resolve();
}
}
});
}
],
link: function($scope, $element, $attrs, ctl) {
$scope.pageID = ctl.pageID;
$scope.componentType = 'ititlefts';
$scope.init();
}
};
}
]);
| 39.782353 | 241 | 0.406772 |
d6fd62658b1780942151169560761e7d40fa2f53 | 280 | js | JavaScript | src/JS/eventsData.js | msrikanth508/1day-meeting-app | 7f7ddb975df09c3ce25aca2d3e66a9ff64cd57ec | [
"MIT"
] | null | null | null | src/JS/eventsData.js | msrikanth508/1day-meeting-app | 7f7ddb975df09c3ce25aca2d3e66a9ff64cd57ec | [
"MIT"
] | null | null | null | src/JS/eventsData.js | msrikanth508/1day-meeting-app | 7f7ddb975df09c3ce25aca2d3e66a9ff64cd57ec | [
"MIT"
] | null | null | null | export default [
{ id: "New", start: 60, end: 120 },
{ id: "New 1", start: 150, end: 270 },
{ id: "New 2", start: 240, end: 300 },
{ id: "New 3", start: 200, end: 360 },
{ id: "New 4", start: 180, end: 330 },
{ id: "Discuss Project Roadmap", start: 660, end: 720 }
];
| 31.111111 | 57 | 0.528571 |
d6ff05caa24ac667cfba2ca671f79e69161fb24e | 3,313 | js | JavaScript | script.js | gllms/calvijn.tk-beta | 396dac0ca09afffe2a97aad248ebd862f1bfc292 | [
"MIT"
] | null | null | null | script.js | gllms/calvijn.tk-beta | 396dac0ca09afffe2a97aad248ebd862f1bfc292 | [
"MIT"
] | null | null | null | script.js | gllms/calvijn.tk-beta | 396dac0ca09afffe2a97aad248ebd862f1bfc292 | [
"MIT"
] | null | null | null | // Vrije dagen en vakanties
let vd1819 = [
{
title: "Rapportenvergadering Appelstraat",
date: "26-03-2019",
},
{
title: "Goede Vrijdag",
date: "19-03-2019",
},
{
title: "Tweede Paasdag",
date: "22-04-2019",
},
{
title: "Meivakantie",
from: "23-04-2019",
until: "03-05-2019"
},
{
title: "Hemelvaartsdag",
date: "30-05-2019",
},
{
title: "Vrije dag",
date: "31-05-2019",
},
{
title: "Tweede Pinksterdag",
date: "10-06-2019",
},
{
title: "Zomervakantie",
from: "08-07-2019",
until: "16-08-2019"
}
];
let vd1920 = [
{
title: "Herstvakantie",
from: "14-10-2019",
until: "18-10-2019"
},
{
title: "Dankdag Schouwen-Duivenland",
date: "06-11-2019"
},
{
title: "Dankdag Tholen",
date: "20-11-2019"
},
{
title: "Dankdag Bevelanden en Walcheren",
date: "27-11-2019"
},
{
title: "Dankdag Zeeuws-Vlaanderen",
date: "28-11-2019"
},
{
title: "Kerstvakantie",
from: "23-12-2019",
until: "03-01-2020"
},
{
title: "Bezinningsdag",
date: "06-01-2020"
},
{
title: "Biddag Tholen",
date: "26-02-2020"
},
{
title: "Voorjaarsvakantie",
from: "24-02-2020",
until: "28-02-2020"
},
{
title: "Biddag",
date: "11-03-2020"
},
{
title: "Biddag Zeeuws-Vlaanderen",
date: "12-03-2020"
},
{
title: "Goede Vrijdag",
date: "10-04-2020"
},
{
title: "Tweede Paasdag",
date: "13-04-2020"
},
{
title: "Meivakantie",
from: "20-04-2020",
until: "01-05-2020"
},
{
title: "Hemelvaartsdag",
date: "21-05-2020"
},
{
title: "Vrije dag",
date: "22-05-2020"
},
{
title: "Tweede Pinksterdag",
date: "01-06-2020"
},
{
title: "Zomervakantie",
from: "13-07-2020",
until: "21-08-2020"
},
];
// als de body is geladen
$(function () {
moment.locale('nl');
vulTabel($("#data1819"), vd1819);
vulTabel($("#data1920"), vd1920);
});
function vulTabel(el, data) {
// loop door elk element in de array
data.forEach(function (e) {
if (e.date) { // als er een datum is
if (moment(e.date, "DD-MM-YYYY").isSameOrAfter(moment().subtract(1, "days"))) { // als het nog niet gebeurd is
el.append(`<tr><td>${e.title}</td><td>${moment(e.date, "DD-MM-YYYY").format('dddd')+" "+e.date}</td></tr>`);
}
} else { // als er een from en een until is
if (moment(e.from, "DD-MM-YYYY").isSameOrAfter(moment().subtract(1, "days"))) { // als het nog niet gebeurd is
el.append(`<tr><td>${e.title}</td><td>${moment(e.from, "DD-MM-YYYY").format('dddd')+" "+e.from} t/m ${moment(e.until, "DD-MM-YYYY").format('dddd')+" "+e.until}</td></tr>`);
}
}
});
} | 23.834532 | 189 | 0.445216 |
d6ffe78cb1aef6ee710714f1ea442cb0b200e2a8 | 205 | js | JavaScript | CS465/travlr/app_server/routes/travel.js | AjaxPop/SNHUClassWork | 84c4bbf6af183849eebb45ceb323398a4dfe2fa3 | [
"MIT"
] | null | null | null | CS465/travlr/app_server/routes/travel.js | AjaxPop/SNHUClassWork | 84c4bbf6af183849eebb45ceb323398a4dfe2fa3 | [
"MIT"
] | null | null | null | CS465/travlr/app_server/routes/travel.js | AjaxPop/SNHUClassWork | 84c4bbf6af183849eebb45ceb323398a4dfe2fa3 | [
"MIT"
] | null | null | null | const express = require('express');
const router = express.Router();
const controller = require('../controllers/travel');
// GET home page
router.get('/', controller.travelList);
module.exports = router; | 25.625 | 52 | 0.721951 |
d901909723cfae6ef7a33c88cbeef5c4570bb11c | 4,302 | js | JavaScript | app/scripts/comments_parser.js | tastejs/TasteMusic | dc7cd15f3ed502880fd843af210e7cda2e17ede2 | [
"CC0-1.0"
] | 56 | 2015-01-15T08:58:14.000Z | 2021-06-15T13:39:16.000Z | app/scripts/comments_parser.js | tastejs/TasteMusic | dc7cd15f3ed502880fd843af210e7cda2e17ede2 | [
"CC0-1.0"
] | 3 | 2015-03-02T23:57:01.000Z | 2017-07-28T23:22:18.000Z | app/scripts/comments_parser.js | tastejs/TasteMusic | dc7cd15f3ed502880fd843af210e7cda2e17ede2 | [
"CC0-1.0"
] | 6 | 2016-02-13T19:52:34.000Z | 2021-06-28T22:37:49.000Z | /*jslint indent: false, global app: true */
;(function(_, window, undefined) {
'use strict';
var app = window.app;
// The result object after we're done parsing the URLs.
var result = {
htmlList: document.createElement('ol'),
array: [], // all of the links
hash: { // links in categories
'soundcloud': [],
'youtube': [],
'other': []
}
};
// Returns true if a URL matches any of the provided domain names.
var domainMatch = function(URL, domains) {
var r = false, url = URL.toLowerCase();
if (_.isString(domains)) {
return url.indexOf(domains) > 1 ? true : false;
}
_.each(domains, function(domain) {
if (url.indexOf(domain) > 1) {
r = true;
}
});
return r;
};
var item; // Creates a list-item with a link for each URL.
function buildList(url) {
item = document.createElement('li');
item.innerHTML = '<a href="'+url+'" target="_blank" class="track">' + url + '</a>';
result.htmlList.appendChild(item);
}
// Builds a hash of URLs categorized by domain names.
function buildHash(url) {
if(domainMatch(url, 'soundcloud.com')) {
result.hash['soundcloud'].push(url);
} else if(domainMatch(url, ['youtube.com', 'youtu.be'])) {
result.hash['youtube'].push(url);
} else {
result.hash['other'].push(url);
}
}
function addToCollections(url) {
buildHash(url);
buildList(url);
}
function CommentsParser(options) {
this.options = options;
// The comments in the opened issue
this.comments = null;
}
CommentsParser.prototype = {
constructor: CommentsParser,
// Parses comments from the first
// page of the paginated comments.
parse: function() {
this.getPage();
},
// Parses all comments, including the paginated ones.
parseAll: function() {
// TODO
},
getPage: function(num) {
var self = this;
var endpoint = self.options.url;
// Get paginated comments
if (num) {
endpoint += '?page=' + num;
}
// Send ajax
new app.http.get({
url: endpoint,
success: function(data, status, statusText) {
if (data && status === 200) {
self.comments = JSON.parse(data);
if (self.comments.length > 0) {
self.build();
} else {
self.options.fail('No more links are available. '+statusText);
}
}
},
error: function(xhr, status, statusText) {
self.comments = [];
self.build();
self.options.fail(status + ' ' + statusText);
}
});
},
// Collect URLs from a single chunk of string
collectUrls: function(stringChunk) {
var stringLines = [];
var words = [];
var URLs = [];
// Split on new lines
stringLines = stringChunk.split(app.regex.newline);
// Get words out of each line
_.each(_.compact(stringLines), function(line) {
words.push(line.split(app.regex.space));
});
// Collect URLs
URLs = _.chain(words)
.flatten()
.filter(function(str) {
return app.regex.weburl.test(str);
}).value();
// console.log('Before: ', string_chunk);
// console.log('\nAfter: ', URLs);
return URLs;
},
build: function() {
var self = this;
var commentUrls;
var currentLength = 0;
var commentsLength = self.comments.length;
// Collect urls from comment's body
_.each(self.comments, function(comment) {
commentUrls = self.collectUrls(comment['body']);
// Simply concat them to the result array
result.array = result.array.concat(commentUrls);
// Each URL in the comment is added to a
// collection type in the result object
_.each(commentUrls, addToCollections);
currentLength += 1;
// Are we done?
if (currentLength === commentsLength) {
self.complete();
return;
}
});
},
complete: function() {
console.log('Parsed URLs from ' + this.comments.length + ' comments!');
this.options.done(result);
}
};
window.app.CommentsParser = CommentsParser;
}(_, window)); | 23.9 | 87 | 0.564854 |
d9024804ef19d760bd182b0b73e9011635725acc | 949 | js | JavaScript | anniversary_format/nodeRunner.js | richyliu/greggdict | 4600d03bb3b5e981392a72bf6f26e941f2983da4 | [
"MIT"
] | 18 | 2020-08-15T22:58:56.000Z | 2022-03-15T07:43:45.000Z | anniversary_format/nodeRunner.js | richyliu/greggdict | 4600d03bb3b5e981392a72bf6f26e941f2983da4 | [
"MIT"
] | 5 | 2020-08-14T17:40:25.000Z | 2022-03-29T20:38:22.000Z | anniversary_format/nodeRunner.js | richyliu/greggdict | 4600d03bb3b5e981392a72bf6f26e941f2983da4 | [
"MIT"
] | 3 | 2020-11-18T13:23:03.000Z | 2021-09-15T06:24:54.000Z | const fs = require('fs/promises');
const parseData = require('./index.js');
const ignorePages = require('./ignorePages.js');
const JSON_DIR = './output';
async function main() {
let jsonFileNames = await fs.readdir(JSON_DIR);
let all = {};
for (let jsonFile of jsonFileNames) {
let rawJson = await fs.readFile(`${JSON_DIR}/${jsonFile}`);
let result = parseData(JSON.parse(rawJson));
console.log(jsonFile, result.length);
result = result.map(toSingleCoordinate);
all[jsonFile] = result;
}
await fs.writeFile('parsed.json', JSON.stringify(all));
}
// average the left bounding side from the left 2 vertices and floor the result
function toSingleCoordinate({ text, vertices }) {
let x = Math.floor((vertices[0].x + vertices[3].x) / 2);
let y = Math.floor((vertices[0].y + vertices[3].y) / 2);
return { text, x, y };
}
main()
.then(() => console.log('Done.'))
.catch(e => console.log('Error in main:', e));
| 29.65625 | 79 | 0.658588 |
d903ae20d389cc18e62282b43567bfe0fc0e0c4d | 464 | js | JavaScript | models/authModel.js | bw-expat-journal/Back-End | daa2a07c03ef96a868c88282eaee7df38fd9813c | [
"MIT"
] | null | null | null | models/authModel.js | bw-expat-journal/Back-End | daa2a07c03ef96a868c88282eaee7df38fd9813c | [
"MIT"
] | 4 | 2020-02-28T15:31:30.000Z | 2021-05-10T04:55:24.000Z | models/authModel.js | bw-expat-journal/Back-End | daa2a07c03ef96a868c88282eaee7df38fd9813c | [
"MIT"
] | null | null | null | const db = require('./dbConfig');
function find() {
return db('users').select('id', 'email');
}
function findBy(filter) {
return db('users')
.where(filter)
.first();
}
function findById(id) {
return db('users')
.where({ id })
.first();
}
function add(user) {
return db('users')
.insert(user, 'id')
.returning(['id', 'email', 'first_name', 'last_name', 'is_admin']);
}
module.exports = {
add,
find,
findBy,
findById,
};
| 14.967742 | 71 | 0.579741 |
d9058d4e72c294d0af7c98261b53fe03b2886d68 | 415 | js | JavaScript | helpers/errors.js | Cefo14/express-api-template | af99237dc1b4c4ab796dbddaec50ee9a6169c48e | [
"MIT"
] | null | null | null | helpers/errors.js | Cefo14/express-api-template | af99237dc1b4c4ab796dbddaec50ee9a6169c48e | [
"MIT"
] | null | null | null | helpers/errors.js | Cefo14/express-api-template | af99237dc1b4c4ab796dbddaec50ee9a6169c48e | [
"MIT"
] | null | null | null | /* eslint-disable max-classes-per-file */
class CustomError extends Error {
constructor(code, message) {
super();
this.code = code;
this.message = message;
}
}
class InvalidParameterError extends Error {
constructor(name) {
super();
this.code = 'INVALID_PARAMETER';
this.message = `Parameter "${name}" is invalid`;
}
}
module.exports = {
CustomError,
InvalidParameterError,
};
| 18.863636 | 52 | 0.66506 |
d905c741e8ec30a32918d6515a8498b1dcd77306 | 5,957 | js | JavaScript | public/app/ui/images/Learn React _ Codecademy_files/97.bbdb7da68a6b50d91376.chunk.js | lwross-sf/iminusler | 5a6e14f41bb72221660b7421e1af451d5f801c27 | [
"MIT"
] | null | null | null | public/app/ui/images/Learn React _ Codecademy_files/97.bbdb7da68a6b50d91376.chunk.js | lwross-sf/iminusler | 5a6e14f41bb72221660b7421e1af451d5f801c27 | [
"MIT"
] | null | null | null | public/app/ui/images/Learn React _ Codecademy_files/97.bbdb7da68a6b50d91376.chunk.js | lwross-sf/iminusler | 5a6e14f41bb72221660b7421e1af451d5f801c27 | [
"MIT"
] | null | null | null | (window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[97],{"/lCS":function(r,t,n){var e=n("gFfm"),a=n("jbM+"),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];r.exports=function updateWrapDetails(r,t){return e(o,(function(n){var e="_."+n[0];t&n[1]&&!a(r,e)&&r.push(e)})),r.sort()}},"0ADi":function(r,t,n){var e=n("heNW"),a=n("EldB"),o=n("Kz5y");r.exports=function createPartial(r,t,n,i){var u=1&t,p=a(r);return function wrapper(){for(var t=-1,a=arguments.length,c=-1,s=i.length,f=Array(s+a),l=this&&this!==o&&this instanceof wrapper?p:r;++c<s;)f[c]=i[c];for(;a--;)f[c++]=arguments[++t];return e(l,u?n:this,f)}}},"2lMS":function(r,t){var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;r.exports=function insertWrapDetails(r,t){var e=t.length;if(!e)return r;var a=e-1;return t[a]=(e>1?"& ":"")+t[a],t=t.join(e>2?", ":" "),r.replace(n,"{\n/* [wrapped with "+t+"] */\n")}},"5sOR":function(r,t,n){var e=n("N4mw"),a=n("99Ms"),o=n("T8tx");r.exports=function createRecurry(r,t,n,i,u,p,c,s,f,l){var v=8&t;t|=v?32:64,4&(t&=~(v?64:32))||(t&=-4);var h=[r,t,u,v?p:void 0,v?c:void 0,v?void 0:p,v?void 0:c,s,f,l],d=n.apply(void 0,h);return e(r)&&a(d,h),d.placeholder=i,o(d,r,t)}},"6KkN":function(r,t){var n="__lodash_placeholder__";r.exports=function replaceHolders(r,t){for(var e=-1,a=r.length,o=0,i=[];++e<a;){var u=r[e];u!==t&&u!==n||(r[e]=n,i[o++]=e)}return i}},"6T1N":function(r,t,n){var e=n("s0N+"),a=n("ieoY"),o=n("Rw8+"),i=n("a1zH"),u=n("0ADi"),p=n("KF6i"),c=n("q3TU"),s=n("99Ms"),f=n("T8tx"),l=n("Sxd8"),v=Math.max;r.exports=function createWrap(r,t,n,h,d,w,g,y){var x=2&t;if(!x&&"function"!=typeof r)throw new TypeError("Expected a function");var _=h?h.length:0;if(_||(t&=-97,h=d=void 0),g=void 0===g?g:v(l(g),0),y=void 0===y?y:l(y),_-=d?d.length:0,64&t){var M=h,A=d;h=d=void 0}var H=x?void 0:p(r),E=[r,t,n,h,d,M,A,w,g,y];if(H&&c(E,H),r=E[0],t=E[1],n=E[2],h=E[3],d=E[4],!(y=E[9]=void 0===E[9]?x?0:r.length:v(E[9]-_,0))&&24&t&&(t&=-25),t&&1!=t)N=8==t||16==t?o(r,t,y):32!=t&&33!=t||d.length?i.apply(void 0,E):u(r,t,n,h);else var N=a(r,t,n);return f((H?e:s)(N,E),r,t)}},"99Ms":function(r,t,n){var e=n("s0N+"),a=n("88Gu")(e);r.exports=a},EldB:function(r,t,n){var e=n("dTAl"),a=n("GoyQ");r.exports=function createCtor(r){return function(){var t=arguments;switch(t.length){case 0:return new r;case 1:return new r(t[0]);case 2:return new r(t[0],t[1]);case 3:return new r(t[0],t[1],t[2]);case 4:return new r(t[0],t[1],t[2],t[3]);case 5:return new r(t[0],t[1],t[2],t[3],t[4]);case 6:return new r(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new r(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=e(r.prototype),o=r.apply(n,t);return a(o)?o:n}}},MMiu:function(r,t){var n=Math.max;r.exports=function composeArgsRight(r,t,e,a){for(var o=-1,i=r.length,u=-1,p=e.length,c=-1,s=t.length,f=n(i-p,0),l=Array(f+s),v=!a;++o<f;)l[o]=r[o];for(var h=o;++c<s;)l[h+c]=t[c];for(;++u<p;)(v||o<i)&&(l[h+e[u]]=r[o++]);return l}},"Rw8+":function(r,t,n){var e=n("heNW"),a=n("EldB"),o=n("a1zH"),i=n("5sOR"),u=n("V9aw"),p=n("6KkN"),c=n("Kz5y");r.exports=function createCurry(r,t,n){var s=a(r);return function wrapper(){for(var a=arguments.length,f=Array(a),l=a,v=u(wrapper);l--;)f[l]=arguments[l];var h=a<3&&f[0]!==v&&f[a-1]!==v?[]:p(f,v);if((a-=h.length)<n)return i(r,t,o,wrapper.placeholder,void 0,f,h,void 0,void 0,n-a);var d=this&&this!==c&&this instanceof wrapper?s:r;return e(d,this,f)}}},T8tx:function(r,t,n){var e=n("ulEd"),a=n("2lMS"),o=n("wclG"),i=n("/lCS");r.exports=function setWrapToString(r,t,n){var u=t+"";return o(r,a(u,i(e(u),n)))}},V9aw:function(r,t){r.exports=function getHolder(r){return r.placeholder}},a1zH:function(r,t,n){var e=n("y4QH"),a=n("MMiu"),o=n("t2dP"),i=n("EldB"),u=n("5sOR"),p=n("V9aw"),c=n("pzgU"),s=n("6KkN"),f=n("Kz5y");r.exports=function createHybrid(r,t,n,l,v,h,d,w,g,y){var x=128&t,_=1&t,M=2&t,A=24&t,H=512&t,E=M?void 0:i(r);return function wrapper(){for(var N=arguments.length,D=Array(N),K=N;K--;)D[K]=arguments[K];if(A)var m=p(wrapper),z=o(D,m);if(l&&(D=e(D,l,v,A)),h&&(D=a(D,h,d,A)),N-=z,A&&N<y){var R=s(D,m);return u(r,t,createHybrid,wrapper.placeholder,n,D,R,w,g,y-N)}var T=_?n:this,B=M?T[r]:r;return N=D.length,w?D=c(D,w):H&&N>1&&D.reverse(),x&&g<N&&(D.length=g),this&&this!==f&&this instanceof wrapper&&(B=E||i(B)),B.apply(T,D)}}},ieoY:function(r,t,n){var e=n("EldB"),a=n("Kz5y");r.exports=function createBind(r,t,n){var o=1&t,i=e(r);return function wrapper(){var t=this&&this!==a&&this instanceof wrapper?i:r;return t.apply(o?n:this,arguments)}}},pzgU:function(r,t,n){var e=n("Q1l4"),a=n("wJg7"),o=Math.min;r.exports=function reorder(r,t){for(var n=r.length,i=o(t.length,n),u=e(r);i--;){var p=t[i];r[i]=a(p,n)?u[p]:void 0}return r}},q3TU:function(r,t,n){var e=n("y4QH"),a=n("MMiu"),o=n("6KkN"),i="__lodash_placeholder__",u=128,p=Math.min;r.exports=function mergeData(r,t){var n=r[1],c=t[1],s=n|c,f=s<131,l=c==u&&8==n||c==u&&256==n&&r[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==n;if(!f&&!l)return r;1&c&&(r[2]=t[2],s|=1&n?0:4);var v=t[3];if(v){var h=r[3];r[3]=h?e(h,v,t[4]):v,r[4]=h?o(r[3],i):t[4]}return(v=t[5])&&(h=r[5],r[5]=h?a(h,v,t[6]):v,r[6]=h?o(r[5],i):t[6]),(v=t[7])&&(r[7]=v),c&u&&(r[8]=null==r[8]?t[8]:p(r[8],t[8])),null==r[9]&&(r[9]=t[9]),r[0]=t[0],r[1]=s,r}},"s0N+":function(r,t,n){var e=n("zZ0H"),a=n("a5q3"),o=a?function(r,t){return a.set(r,t),r}:e;r.exports=o},t2dP:function(r,t){r.exports=function countHolders(r,t){for(var n=r.length,e=0;n--;)r[n]===t&&++e;return e}},ulEd:function(r,t){var n=/\{\n\/\* \[wrapped with (.+)\] \*/,e=/,? & /;r.exports=function getWrapDetails(r){var t=r.match(n);return t?t[1].split(e):[]}},y4QH:function(r,t){var n=Math.max;r.exports=function composeArgs(r,t,e,a){for(var o=-1,i=r.length,u=e.length,p=-1,c=t.length,s=n(i-u,0),f=Array(c+s),l=!a;++p<c;)f[p]=t[p];for(;++o<u;)(l||o<i)&&(f[e[o]]=r[o]);for(;s--;)f[p++]=r[o++];return f}}}]);
//# sourceMappingURL=97.bbdb7da68a6b50d91376.chunk.js.map | 2,978.5 | 5,899 | 0.601142 |
d90604fcbb84a75aa4b58e70b84af402189461fc | 911 | js | JavaScript | app/containers/TodoPage/reducer.js | roybailey/research-react-boilerplate | 5f2b11df2384b4e55c2fec5eda44ca229423e4a4 | [
"MIT"
] | null | null | null | app/containers/TodoPage/reducer.js | roybailey/research-react-boilerplate | 5f2b11df2384b4e55c2fec5eda44ca229423e4a4 | [
"MIT"
] | null | null | null | app/containers/TodoPage/reducer.js | roybailey/research-react-boilerplate | 5f2b11df2384b4e55c2fec5eda44ca229423e4a4 | [
"MIT"
] | null | null | null | /* eslint-disable no-param-reassign,default-case */
/*
* TodoReducer
*
* The reducer takes care of our data. Using actions, we can change our
* application state.
* To add a new action, add it to the switch statement in the reducer function
*
* Example:
* case YOUR_ACTION_CONSTANT:
* return state.set('yourStateVariable', true);
*/
import produce from 'immer';
import { CHANGE_CATEGORY, CHANGE_STATUS } from './constants';
// The initial state of the App
export const initialState = { category: {}, status: {} };
function todoPageReducer(state = initialState, action) {
return produce(state, draft => {
switch (action.type) {
case CHANGE_CATEGORY:
draft.category = action.category;
console.log(JSON.stringify(draft, null, 2));
break;
case CHANGE_STATUS:
draft.status = action.status;
break;
}
});
}
export default todoPageReducer;
| 26.794118 | 78 | 0.677278 |
d9061dff39d57a0a0385c8bf78f74d1ba32958ff | 224 | js | JavaScript | spec/integration/global-variables.js | Breinify/brein-api-library-node | 14d857d297424aeae86e5c4b5a32b385940a7e3d | [
"MIT"
] | 3 | 2017-04-12T21:06:06.000Z | 2018-07-11T22:08:55.000Z | spec/integration/global-variables.js | Breinify/brein-api-library-node | 14d857d297424aeae86e5c4b5a32b385940a7e3d | [
"MIT"
] | null | null | null | spec/integration/global-variables.js | Breinify/brein-api-library-node | 14d857d297424aeae86e5c4b5a32b385940a7e3d | [
"MIT"
] | null | null | null | var keys = {
'apiKeyNoSig': '41B2-F48C-156A-409A-B465-317F-A0B4-E0E8',
'apiKeySig': 'CA8A-8D28-3408-45A8-8E20-8474-06C0-8548',
'apiKeySecret': 'lmcoj4k27hbbszzyiqamhg=='
};
module.exports = {
'keys': keys
}; | 24.888889 | 61 | 0.651786 |
d9072dc9dff9f037d5a45e714598146898e93a69 | 2,222 | js | JavaScript | src/router/uris.js | zoro1989/talents-fe | d761b63a0e5071377b0616e0172ff65f25f17f6b | [
"MIT"
] | null | null | null | src/router/uris.js | zoro1989/talents-fe | d761b63a0e5071377b0616e0172ff65f25f17f6b | [
"MIT"
] | null | null | null | src/router/uris.js | zoro1989/talents-fe | d761b63a0e5071377b0616e0172ff65f25f17f6b | [
"MIT"
] | null | null | null | /**
* Created by zhulin on 2017/7/9.
*/
const uris = {
welcome: {
userinfo: '/welcome/userinfo.tkm',
updateSelf: '/welcome/updateSelf.tkm',
updatePswd: '/welcome/updatePswd.tkm'
},
user: {
logout: '/user/logout.tkm',
submitLogin: '/user/submitLogin.tkm',
subRegister: '/user/subRegister.tkm'
},
member: {
list: '/member/list.tkm',
deleteUserById: '/member/deleteUserById.tkm',
forbidUserById: '/member/forbidUserById.tkm'
},
push: {
send: '/push/send.tkm'
},
role: {
getPermissionTree: '/role/getPermissionTree.tkm',
clearRoleByUserIds: '/role/clearRoleByUserIds.tkm',
allocation: '/role/allocation.tkm',
selectRoleByUserId: '/role/selectRoleByUserId.tkm',
addRole2User: '/role/addRole2User.tkm',
index: '/role/index.tkm',
deleteRoleById: '/role/deleteRoleById.tkm',
addRole: '/role/addRole.tkm'
},
permission: {
index: '/permission/index.tkm',
allocation: '/permission/allocation.tkm',
selectPermissionById: '/permission/selectPermissionById.tkm',
addPermission2Role: '/permission/addPermission2Role.tkm',
deletePermissionById: '/permission/deletePermissionById.tkm',
addPermission: '/permission/addPermission.tkm',
clearPermissionByRoleIds: '/permission/clearPermissionByRoleIds.tkm'
},
common: {
getVCode: '/common/getVCode.tkm'
},
staff: {
index: '/staff/index.tkm',
search: '/staff/search.tkm',
selectInfoById: '/staff/selectInfoById.tkm',
save: '/staff/save.tkm',
import: '/staff/importTalents.tkm',
findLastImportTime: '/staff/findLastImportTime.tkm'
},
project: {
index: '/project/index.tkm',
deleteProjectById: '/project/deleteProjectById.tkm',
save: '/project/save.tkm',
selectProjectById: '/project/selectProjectById.tkm',
selectProjectParents: '/project/selectProjectParents.tkm',
selectChartBgData: '/project/selectChartBgData.tkm',
getChartPieData: '/project/getChartPieData.tkm'
},
dic: {
index: '/dic/index.tkm',
deleteDicById: '/dic/deleteDicById.tkm',
save: '/dic/save.tkm',
selectDicById: '/dic/selectDicById.tkm',
selectDicParents: '/dic/selectDicParents.tkm'
}
}
export default uris
| 31.295775 | 72 | 0.684518 |
d909137ed1a7101242b416939e637da9eb1f54dd | 226 | js | JavaScript | src/components/ShowingDescription.js | SyedNaqiRizvi/property-showings-manager | 7410463725394f7316eb3a4b8dff47523edb084e | [
"MIT"
] | null | null | null | src/components/ShowingDescription.js | SyedNaqiRizvi/property-showings-manager | 7410463725394f7316eb3a4b8dff47523edb084e | [
"MIT"
] | null | null | null | src/components/ShowingDescription.js | SyedNaqiRizvi/property-showings-manager | 7410463725394f7316eb3a4b8dff47523edb084e | [
"MIT"
] | null | null | null | import React from 'react';
const ShowingDescription = (props) => (
<div style={{ gridColumn: '2', gridRow: props.gridRow, margin: '.5rem' }}>
{props.label}: {props.value}
</div>
);
export default ShowingDescription;
| 22.6 | 76 | 0.663717 |
d9098cd8f55ff6fd75d03728505c56f172aaa187 | 1,911 | js | JavaScript | pages/_document.js | Voyager-Two/stimulus.plus | 6809711df759ee4aefa29235bfb386b929df126b | [
"MIT"
] | null | null | null | pages/_document.js | Voyager-Two/stimulus.plus | 6809711df759ee4aefa29235bfb386b929df126b | [
"MIT"
] | 4 | 2020-04-29T01:35:39.000Z | 2022-02-13T09:34:08.000Z | pages/_document.js | Voyager-Two/stimulus.plus | 6809711df759ee4aefa29235bfb386b929df126b | [
"MIT"
] | null | null | null | import Document, { Head, Main, NextScript } from 'next/document';
import React from 'react';
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}
render() {
const siteUrl = 'https://stimulus.plus';
const siteTitle = 'Stimulus Payment Calculator';
const siteDesc = 'Calculate what you will get from COVID-19 (Coronavirus) stimulus payments/checks.';
return (
<html>
<Head>
<meta charSet="utf-8"/>
<meta name="description" content={ siteDesc } />
<meta name="keywords"
content="stimulus calculator, stimulus payment calculator, stimulus check calculator, coronavirus stimulus calculator, coronavirus payment calculator, covid-19 payment calculator"/>
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:500,700"
rel="stylesheet"
/>
<link rel="canonical" href={ siteUrl } />
<meta property="og:type" content="website" />
<meta name="og:title" property="og:title" content={ siteTitle } />
<meta name="og:description" property="og:description" content={ siteDesc } />
<meta name="twitter:title" content={ siteTitle } />
<meta name="twitter:description" content={ siteDesc } />
</Head>
<body>
<Main />
<NextScript />
</body>
</html>
);
}
}
export default MyDocument;
| 39 | 205 | 0.526426 |
d909b282e3d53f109b394fb0cc2c2417a3d03ce5 | 1,190 | js | JavaScript | src/pages/Table/models/table.js | adoctors/umi-test | 49201e0c4c74c171a76448ca9d35ca0036808737 | [
"MIT"
] | 1 | 2020-05-30T20:31:25.000Z | 2020-05-30T20:31:25.000Z | src/pages/Table/models/table.js | adoctors/umi-test | 49201e0c4c74c171a76448ca9d35ca0036808737 | [
"MIT"
] | null | null | null | src/pages/Table/models/table.js | adoctors/umi-test | 49201e0c4c74c171a76448ca9d35ca0036808737 | [
"MIT"
] | null | null | null |
import * as tableService from '../services/table';
import {requestApi} from '../../../utils/utils'
export default {
namespace: 'table',
state: {
name:'table',
message:' from table models'
},
reducers:{},
effects:{
*fetchData({ payload, successCallback, failCallback }, { call, put }) {
const reducerName=payload.reducerName||null; // 获取对应reducerName
if(reducerName){
delete payload.reducerName;
}
const { data } = yield call(requestApi, payload);
if(reducerName){ // 如果有reducer相关逻辑
yield put({ type: reducerName, payload: data.data });
}
if (data.success) {
successCallback && successCallback(data.data);
} else {
const errMsg = data.message || data.errMsg || data.code;
failCallback && failCallback(errMsg);
}
},
*getTableData({ payload,callback }, { call, put }) {
const data = yield call(requestApi, payload);
if (callback) callback(data);
},
*getTableDataPage({ payload,callback }, { call, put }) {
const data = yield call(tableService.getTableDataPage, payload);
if (callback) callback(data);
},
}
} | 28.333333 | 75 | 0.6 |
d90bb2dba40716952045221c50d6a03252f848e6 | 1,207 | js | JavaScript | src/components/journals/NewJournalControl.js | GarlandLai/Capstone-2.0 | 8da5bf7431aa592e590d8e2fb1b152488578c80e | [
"MIT"
] | null | null | null | src/components/journals/NewJournalControl.js | GarlandLai/Capstone-2.0 | 8da5bf7431aa592e590d8e2fb1b152488578c80e | [
"MIT"
] | null | null | null | src/components/journals/NewJournalControl.js | GarlandLai/Capstone-2.0 | 8da5bf7431aa592e590d8e2fb1b152488578c80e | [
"MIT"
] | null | null | null | import React from 'react';
import FormConfirmation from './FormConfirmation';
import PromptJournal from './PromptJournal';
import PropTypes from 'prop-types';
class NewJournalControl extends React.Component {
constructor(props) {
super(props);
this.state = {
promptVisibleOnPage: false,
};
this.handleFormConfirmation = this.handleFormConfirmation.bind(this);
}
handleFormConfirmation() {
this.setState({ promptVisibleOnPage: true });
}
clearForm = () => {
document.getElementById("addForm").reset();
this.setState({ promptVisibleOnPage: false})
}
render() {
let currentlyVisibleContent = null;
if (this.state.promptVisibleOnPage) {
currentlyVisibleContent = <PromptJournal onUpdate={this.props.onUpdate} onNewEntry={this.props.onNewEntry} promptVisibleOnPage={this.state} clearForm={this.clearForm}/>;
} else {
currentlyVisibleContent = <FormConfirmation onFormConfirmation={this.handleFormConfirmation} />;
}
return (
<div>
{currentlyVisibleContent}
</div>
);
}
}
NewJournalControl.propTypes = {
onNewEntry: PropTypes.func,
onUpdate: PropTypes.func,
};
export default NewJournalControl;
| 26.23913 | 175 | 0.705882 |
d90c41c7e970c77a56478b9fb60fdbcf55a0adb7 | 1,133 | js | JavaScript | loader/loader.js | cmanlh/mui | e92fd4e2b8ef51603ce1191b701829b2418c5261 | [
"MIT"
] | null | null | null | loader/loader.js | cmanlh/mui | e92fd4e2b8ef51603ce1191b701829b2418c5261 | [
"MIT"
] | null | null | null | loader/loader.js | cmanlh/mui | e92fd4e2b8ef51603ce1191b701829b2418c5261 | [
"MIT"
] | null | null | null | /**
* @description dynamically load resources
*
* @author luhong <cmanlh@163.com>
*/
(function (global) {
const DOT_SEARCH_PATTERN = /\./g;
function Loader() { }
Loader.prototype.js = async function (url) {
await new Promise((resolve, reject) => {
var script = document.createElement("script");
script.src = url;
script.type = "text/javascript";
script.async = false;
var fun = function () {
script.removeEventListener('load', fun);
resolve();
};
script.addEventListener('load', fun);
script.addEventListener('error', function () {
var errMsg = '资源加载出错:'.concat(url);
console.error(errMsg);
reject(errMsg);
});
document.getElementsByTagName('head')[0].appendChild(script);
});
}
Loader.prototype.text = async function(url){
let response = await fetch(url);
if(response.ok){
return response.text();
}
}
global.$loader = new Loader();
}(window)); | 29.051282 | 73 | 0.52692 |
d90dc921803e3844edc2e46b64947cbe3592d17f | 1,047 | js | JavaScript | backend/web/js/backend.js | ZaChizz/Amway | 64e97ed45674ca485ff5f61a9959d55471f61008 | [
"BSD-3-Clause"
] | null | null | null | backend/web/js/backend.js | ZaChizz/Amway | 64e97ed45674ca485ff5f61a9959d55471f61008 | [
"BSD-3-Clause"
] | null | null | null | backend/web/js/backend.js | ZaChizz/Amway | 64e97ed45674ca485ff5f61a9959d55471f61008 | [
"BSD-3-Clause"
] | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$(function() {
"use strict";
/*================*/
/* 01 - VARIABLES */
/*================*/
$('#product-id_group').on('change', function(){
$('#product-id_category').empty();
var sel = $(this).val();
var cat = $('#product-id_category');
$.ajax({
url: '/backend/web/index.php?r=product%2Fajax-category',
type: "GET",
data: 'id='+sel,
success: function (data) {
cat.append("<option value>Выберите категорию....</option>");
$.each(data.category, function(k,v) {
$.each(v,function(k,v)
{
cat.append("<option value="+k+">"+v+"</option>");
});
});
}
});
})
});
| 24.348837 | 79 | 0.429799 |
d90f173f4d70c1dc279ff8160e589489e4249e2f | 61,917 | js | JavaScript | dist/demo/7-es5.147bb3e96c69175e4c31.js | NoumanMasood/tournament | 9bbba8a0edda703ddd86812b72d5cdd7cd61a33b | [
"OML",
"RSA-MD"
] | null | null | null | dist/demo/7-es5.147bb3e96c69175e4c31.js | NoumanMasood/tournament | 9bbba8a0edda703ddd86812b72d5cdd7cd61a33b | [
"OML",
"RSA-MD"
] | null | null | null | dist/demo/7-es5.147bb3e96c69175e4c31.js | NoumanMasood/tournament | 9bbba8a0edda703ddd86812b72d5cdd7cd61a33b | [
"OML",
"RSA-MD"
] | null | null | null | function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{TDBs:function(e,t,n){"use strict";n.r(t);var a=n("tyNb"),r=n("ofXK"),i=n("3Pt+"),o=n("OsiS"),b=n("ZAI4"),c=n("PBUU"),l=n("nYR2"),s=n("fXoL"),u=n("Vaw3"),d=n("JqCM"),m=n("kmnG"),f=n("qFsG"),h=n("d3UM"),g=n("gren"),p=n("bTqV"),v=n("FKr1");function V(e,t){1&e&&(s.Wb(0,"p",33),s.Ic(1,"Name is required"),s.Vb())}function _(e,t){1&e&&(s.Wb(0,"p",33),s.Ic(1,"Entry Fee is required"),s.Vb())}function W(e,t){1&e&&(s.Wb(0,"p",33),s.Ic(1,"Start Date is required"),s.Vb())}function k(e,t){if(1&e&&(s.Wb(0,"mat-option",34),s.Ic(1),s.Vb()),2&e){var n=t.$implicit;s.oc("value",n.value),s.Db(1),s.Kc(" ",n.viewValue," ")}}function w(e,t){1&e&&(s.Wb(0,"p",33),s.Ic(1,"Number of Players is required"),s.Vb())}function I(e,t){if(1&e&&s.Rb(0,"img",35),2&e){var n=s.ic();s.oc("src",n.imageSrc,s.Bc)}}function y(e,t){1&e&&(s.Wb(0,"p",33),s.Ic(1,"Banner is required"),s.Vb())}function D(e,t){1&e&&(s.Wb(0,"p",36),s.Ic(1,"banner should be 375 x 500 size"),s.Vb())}var x,M=((x=function(){function e(t,n,a,r,i){_classCallCheck(this,e),this.tournamentService=t,this.storage=n,this.formBuilder=a,this.spinner=r,this.router=i,this.tournaments=[],this.error="",this.players=[{value:"8",viewValue:"8"},{value:"9",viewValue:"9"},{value:"10",viewValue:"10"},{value:"11",viewValue:"11"},{value:"12",viewValue:"12"},{value:"13",viewValue:"13"},{value:"14",viewValue:"14"},{value:"15",viewValue:"15"},{value:"16",viewValue:"16"},{value:"17",viewValue:"17"},{value:"18",viewValue:"18"},{value:"19",viewValue:"19"},{value:"20",viewValue:"20"},{value:"21",viewValue:"21"},{value:"22",viewValue:"22"},{value:"23",viewValue:"23"},{value:"24",viewValue:"24"},{value:"25",viewValue:"25"},{value:"26",viewValue:"26"},{value:"27",viewValue:"27"},{value:"28",viewValue:"28"},{value:"29",viewValue:"29"},{value:"30",viewValue:"30"},{value:"31",viewValue:"31"},{value:"32",viewValue:"32"},{value:"33",viewValue:"33"},{value:"34",viewValue:"34"},{value:"35",viewValue:"35"},{value:"36",viewValue:"36"},{value:"37",viewValue:"37"},{value:"38",viewValue:"38"},{value:"39",viewValue:"39"},{value:"40",viewValue:"40"},{value:"41",viewValue:"41"},{value:"42",viewValue:"42"},{value:"43",viewValue:"43"},{value:"44",viewValue:"44"},{value:"45",viewValue:"45"},{value:"46",viewValue:"46"},{value:"47",viewValue:"47"},{value:"48",viewValue:"48"},{value:"49",viewValue:"49"},{value:"50",viewValue:"50"},{value:"51",viewValue:"51"},{value:"52",viewValue:"52"},{value:"53",viewValue:"53"},{value:"54",viewValue:"54"},{value:"55",viewValue:"55"},{value:"56",viewValue:"56"},{value:"57",viewValue:"57"},{value:"58",viewValue:"58"},{value:"59",viewValue:"59"},{value:"60",viewValue:"60"},{value:"61",viewValue:"61"},{value:"62",viewValue:"62"},{value:"63",viewValue:"63"},{value:"64",viewValue:"64"},{value:"65",viewValue:"65"},{value:"66",viewValue:"66"},{value:"67",viewValue:"67"},{value:"68",viewValue:"68"},{value:"69",viewValue:"69"},{value:"70",viewValue:"70"},{value:"71",viewValue:"71"},{value:"72",viewValue:"72"},{value:"73",viewValue:"73"},{value:"74",viewValue:"74"},{value:"75",viewValue:"75"},{value:"76",viewValue:"76"},{value:"77",viewValue:"77"},{value:"78",viewValue:"78"},{value:"79",viewValue:"79"},{value:"80",viewValue:"80"},{value:"81",viewValue:"81"},{value:"82",viewValue:"82"},{value:"83",viewValue:"83"},{value:"84",viewValue:"84"},{value:"85",viewValue:"85"},{value:"86",viewValue:"86"},{value:"87",viewValue:"87"},{value:"88",viewValue:"88"},{value:"89",viewValue:"89"},{value:"90",viewValue:"90"},{value:"91",viewValue:"91"},{value:"92",viewValue:"92"},{value:"93",viewValue:"93"},{value:"94",viewValue:"94"},{value:"95",viewValue:"95"},{value:"96",viewValue:"96"},{value:"97",viewValue:"97"},{value:"98",viewValue:"98"},{value:"99",viewValue:"99"},{value:"100",viewValue:"100"}]}return _createClass(e,[{key:"ngOnInit",value:function(){this.tournamentService.getItems().subscribe((function(e){console.log(e)})),this.formTournament=this.formBuilder.group({name:["",i.v.required],description:new i.e(""),entryFee:["",i.v.required],startDate:["",i.v.required],prizeMoney:new i.e(""),secondPrizeMoney:new i.e(""),thirdPrizeMoney:new i.e(""),numberOfPlayer:["",i.v.required],banner:["",i.v.required]})}},{key:"onFileSelected",value:function(e){var t=this,n=Date.now(),a=e.target.files[0],r=new FileReader;r.readAsDataURL(a),r.onload=function(){var e=new Image;e.src=r.result,t.imageSrc=r.result,e.onload=function(){var r=e.naturalHeight,i=e.naturalWidth;if(375===i||500===r){t.spinner.show();var o=t.storage.ref("RoomsImages/".concat(n));t.storage.upload("RoomsImages/".concat(n),a).snapshotChanges().pipe(Object(l.a)((function(){t.downloadURL=o.getDownloadURL(),t.downloadURL.subscribe((function(e){e&&(t.fb=e,t.formTournament.value.banner=t.fb),t.spinner.hide(),console.log(t.fb)}))}))).subscribe((function(e){e&&console.log(e)})),t.error="",console.log("Width and Height",i,r)}else t.error="photo should be 100 x 100 size"}}}},{key:"onSubmit",value:function(){console.log(this.formTournament.value),this.formTournament.markAllAsTouched(),this.formTournament.invalid||(this.router.navigateByUrl("/tournament-list"),this.formTournament.value.banner=this.fb,this.tournamentService.addTournament(this.formTournament.value).then((function(e){console.log(e)})))}}]),e}()).\u0275fac=function(e){return new(e||x)(s.Qb(c.a),s.Qb(u.a),s.Qb(i.d),s.Qb(d.b),s.Qb(a.f))},x.\u0275cmp=s.Kb({type:x,selectors:[["app-dashboard"]],decls:51,vars:10,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-11"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],[3,"formGroup"],[1,"example-full-width"],["matInput","","placeholder","Name","type","text","formControlName","name"],["style","color: red",4,"ngIf"],["matInput","","placeholder","Description","type","text","formControlName","description"],["matInput","","placeholder","Entry Fee","type","text","formControlName","entryFee"],["matInput","","type","datetime-local","placeholder","start date","formControlName","startDate"],["matInput","","placeholder","First Prize Money","type","number","formControlName","prizeMoney"],["matInput","","placeholder","Second Prize Money","type","number","formControlName","secondPrizeMoney"],["matInput","","placeholder","Third Prize Money","type","number","formControlName","thirdPrizeMoney"],["placeholder","Select Number of Players","name","numberOfPlayer","formControlName","numberOfPlayer"],[3,"value",4,"ngFor","ngForOf"],["class","example-full-width","style","height: 300px; width:300px",3,"src",4,"ngIf"],["data-provides","fileinput",1,"fileinput","fileinput-new","text-center","mt-4"],[1,"btn","btn-rose","btn-round","btn-file"],[1,"fileinput-new"],[1,"fileinput-exists"],["type","file","name","...","formControlName","banner",3,"change"],["style","color: red","class","ml-3",4,"ngIf"],["href","#pablo","data-dismiss","fileinput",1,"btn","btn-danger","btn-round","fileinput-exists"],[1,"fa","fa-times"],[1,"card-footer"],["mat-raised-button","","type","submit",1,"btn","btn-fill","btn-rose",3,"disabled","click"],[2,"color","red"],[3,"value"],[1,"example-full-width",2,"height","300px","width","300px",3,"src"],[1,"ml-3",2,"color","red"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"div",4),s.Wb(5,"div",5),s.Wb(6,"div",6),s.Wb(7,"i",7),s.Ic(8,"emoji_events"),s.Vb(),s.Vb(),s.Wb(9,"h4",8),s.Ic(10,"Add Tournament"),s.Vb(),s.Vb(),s.Wb(11,"div",9),s.Wb(12,"form",10),s.Wb(13,"mat-form-field",11),s.Rb(14,"input",12),s.Vb(),s.Gc(15,V,2,0,"p",13),s.Wb(16,"mat-form-field",11),s.Rb(17,"input",14),s.Vb(),s.Wb(18,"mat-form-field",11),s.Rb(19,"input",15),s.Vb(),s.Gc(20,_,2,0,"p",13),s.Wb(21,"mat-form-field"),s.Rb(22,"input",16),s.Vb(),s.Gc(23,W,2,0,"p",13),s.Wb(24,"mat-form-field",11),s.Rb(25,"input",17),s.Vb(),s.Wb(26,"mat-form-field",11),s.Rb(27,"input",18),s.Vb(),s.Wb(28,"mat-form-field",11),s.Rb(29,"input",19),s.Vb(),s.Wb(30,"mat-select",20),s.Gc(31,k,2,2,"mat-option",21),s.Vb(),s.Gc(32,w,2,0,"p",13),s.Gc(33,I,1,1,"img",22),s.Wb(34,"div",23),s.Wb(35,"div"),s.Wb(36,"span",24),s.Wb(37,"span",25),s.Ic(38,"Select Banner"),s.Vb(),s.Wb(39,"span",26),s.Ic(40,"Change"),s.Vb(),s.Wb(41,"input",27),s.ec("change",(function(e){return t.onFileSelected(e)})),s.Vb(),s.Vb(),s.Rb(42,"ngx-ui-loader"),s.Gc(43,y,2,0,"p",13),s.Gc(44,D,2,0,"p",28),s.Wb(45,"a",29),s.Rb(46,"i",30),s.Ic(47," Remove"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(48,"div",31),s.Wb(49,"button",32),s.ec("click",(function(e){return t.onSubmit()})),s.Ic(50,"Submit"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(12),s.oc("formGroup",t.formTournament),s.Db(3),s.oc("ngIf",t.formTournament.get("name").touched&&t.formTournament.get("name").invalid),s.Db(5),s.oc("ngIf",t.formTournament.get("entryFee").touched&&t.formTournament.get("entryFee").invalid),s.Db(3),s.oc("ngIf",t.formTournament.get("startDate").touched&&t.formTournament.get("startDate").invalid),s.Db(8),s.oc("ngForOf",t.players),s.Db(1),s.oc("ngIf",t.formTournament.get("numberOfPlayer").touched&&t.formTournament.get("numberOfPlayer").invalid),s.Db(1),s.oc("ngIf",t.imageSrc),s.Db(10),s.oc("ngIf",t.formTournament.get("banner").touched&&t.formTournament.get("banner").invalid),s.Db(1),s.oc("ngIf",t.error),s.Db(5),s.oc("disabled",!t.fb))},directives:[i.w,i.p,i.i,m.b,f.b,i.c,i.o,i.g,r.m,i.s,h.a,r.l,g.b,p.b,v.n],encapsulation:2}),x),C=n("Ouoq"),O=(n("ip79"),n("vDyb")),P=n("I/3d");function R(e,t){if(1&e){var n=s.Xb();s.Wb(0,"button",23),s.ec("click",(function(e){s.zc(n);var t=s.ic().$implicit;return s.ic().winner(t)})),s.Ic(1,"Declare Winner"),s.Vb()}}var S=function(e){return["../../user-detail",e]};function T(e,t){if(1&e&&(s.Wb(0,"div",13),s.Wb(1,"div",17),s.Wb(2,"div",18),s.Wb(3,"div",6),s.Wb(4,"i",7),s.Ic(5,"person"),s.Vb(),s.Vb(),s.Gc(6,R,2,0,"button",19),s.Wb(7,"h2",20),s.Ic(8),s.Vb(),s.Vb(),s.Wb(9,"div",21),s.Wb(10,"div",22),s.Wb(11,"i",7),s.Ic(12,"update"),s.Vb(),s.Ic(13," Just Updated "),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e){var n=t.$implicit,a=s.ic();s.Db(6),s.oc("ngIf","pending"===a.singleItem.status),s.Db(1),s.oc("routerLink",s.sc(4,S,n.id)),s.Db(1),s.Lc("",n.firstName," ",n.lastName,"")}}function N(e,t){if(1&e){var n=s.Xb();s.Wb(0,"button",24),s.ec("click",(function(e){return s.zc(n),s.ic().draw()})),s.Ic(1,"Declare As Draw"),s.Vb()}}function F(e,t){if(1&e){var n=s.Xb();s.Wb(0,"button",25),s.ec("click",(function(e){return s.zc(n),s.ic().end()})),s.Ic(1,"End Tournament"),s.Vb()}}var z,L=((z=function(){function e(t,n,a,r,i,o){_classCallCheck(this,e),this.tournamentService=t,this.userService=n,this.storage=a,this.route=r,this.messagingService=i,this.firestore=o,this.tournaments=[],this.arr=[],this.tokenArray=[],this.userWithTokenArray=[]}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.route.params.subscribe((function(t){e.matchId=t.id})),this.route.queryParams.subscribe((function(t){e.tournamentId=t.tournamentId})),this.matches=this.tournamentService.getMatches(this.tournamentId).subscribe((function(t){e.item=t.reduce((function(e,t){var n=t.payload.doc.id;return!(n in e)&&e.push(Object.assign({id:n},t.payload.doc.data())),e}),[]),console.log(e.item,"============"),e.singleItem=e.item.find((function(t){return t.id==e.matchId})),e.tournamentService.getUserMatches(e.matchId).subscribe((function(t){e.userMatches=t,e.filteredMatches=e.userMatches.filter((function(t){return t.matchId==e.matchId})),e.userService.getUsers().subscribe((function(t){e.users=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.userData=e.users.map((function(t){return e.filteredMatches.map((function(n){return t.id===n.userId&&!e.arr.some((function(e){return e.id===t.id}))&&e.arr.push(t)}))})),e.users.map((function(t){t.deviceToken&&(e.tokenArray.push(t.deviceToken),e.userWithTokenArray.push(t.id))}))}))})),e.tournamentService.getSingleMatch(e.tournamentId,e.matchId).subscribe((function(t){console.log(t),e.singleMatch=Object.assign({id:t.payload.id},t.payload.data())})),e.tournamentService.getTournaments().subscribe((function(t){e.tournament=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.singleTournament=e.tournament.find((function(t){return t.id=e.tournamentId}))}))}))}},{key:"getUser",value:function(e){var t=this;return this.tournamentService.getUser(e).subscribe((function(e){t.oneUser=Object.assign({id:e.payload.id},e.payload.data())})),this.oneUser}},{key:"end",value:function(){3===this.singleMatch.bracket&&this.tournamentService.winner(this.tournamentId,this.matchId,{endTournamentDate:Date.now()})}},{key:"winner",value:function(e){console.log(this.arr),this.looser=this.arr.find((function(t){return t.id!==e.id})),this.tournamentService.winner(this.tournamentId,this.matchId,{userId:e.id,status:"completed",winner:e.firstName}),this.tournamentService.winUser(e.id,{wins:e.wins?e.wins+1:1}),this.tournamentService.winUser(this.looser.id,{loses:this.looser.loses?this.looser.loses+1:1}),3===this.singleMatch.bracket&&this.tournamentService.winUser(e.id,{winnings:e.winnings?e.winnings+this.singleTournament.prizeMoney:this.singleTournament.prizeMoney}),this.sendNotification(),this.ngOnInit()}},{key:"draw",value:function(){var e=this;this.tournamentService.winner(this.tournamentId,this.matchId,{status:"completed"}),this.arr.map((function(t){e.tournamentService.winUser(t.id,{draws:t.draws?t.draws+1:1})}))}},{key:"sendNotification",value:function(){var e=this;this.tokenArray.map((function(t,n){e.messagingService.requestPermission(e.userWithTokenArray[n],{title:"Winner",body:"You have won the match"}),e.messagingService.receiveMessage(),e.message=e.messagingService.currentMessage,e.tournamentService.postMessages({notification:{title:"Winner",body:"You have won the match"},to:t}).subscribe((function(e){console.log(e,"llllllllllll")})),e.messagingService.updateToken(e.userWithTokenArray[n],t)}),(function(e){console.error("Unable to get permission to notify.",e)}))}},{key:"onFileSelected",value:function(e){var t=this,n=Date.now(),a=e.target.files[0],r=this.storage.ref("RoomsImages/".concat(n));this.storage.upload("RoomsImages/".concat(n),a).snapshotChanges().pipe(Object(l.a)((function(){t.downloadURL=r.getDownloadURL(),t.downloadURL.subscribe((function(e){e&&(t.fb=e),console.log(t.fb)}))}))).subscribe((function(e){e&&console.log(e)}))}},{key:"onSubmit",value:function(){console.log(this.formTournament.value),this.formTournament.value.banner="https://firebasestorage.googleapis.com/v0/b/tournament-62907.appspot.com/o/RoomsImages%2F1601405964819?alt=media&token=c903c131-4493-4daa-a7c7-ee54a35b6196",this.tournamentService.editTournament(this.singleItem.id,this.formTournament.value).then((function(e){console.log(e)}))}}]),e}()).\u0275fac=function(e){return new(e||z)(s.Qb(c.a),s.Qb(C.a),s.Qb(u.a),s.Qb(a.a),s.Qb(O.a),s.Qb(P.a))},z.\u0275cmp=s.Kb({type:z,selectors:[["app-dashboard"]],decls:45,vars:8,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-11"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],["class","col-6",4,"ngFor","ngForOf"],["mat-raised-button","","class","btn btn-danger","style","margin-left: 300px;",3,"click",4,"ngIf"],[1,"col-12","mx-4"],[1,"col-6"],[1,"col-12"],[2,"width","500px","height","200px",3,"src"],["mat-raised-button","","class","btn btn-danger",3,"click",4,"ngIf"],[1,"card","card-stats"],[1,"card-header","card-header-success","card-header-icon"],["mat-raised-button","","class","btn btn-warning",3,"click",4,"ngIf"],[1,"card-title",3,"routerLink"],[1,"card-footer"],[1,"stats"],["mat-raised-button","",1,"btn","btn-warning",3,"click"],["mat-raised-button","",1,"btn","btn-danger",2,"margin-left","300px",3,"click"],["mat-raised-button","",1,"btn","btn-danger",3,"click"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"div",4),s.Wb(5,"div",5),s.Wb(6,"div",6),s.Wb(7,"i",7),s.Ic(8,"sports_soccer"),s.Vb(),s.Vb(),s.Wb(9,"h4",8),s.Ic(10,"Match Details"),s.Vb(),s.Vb(),s.Wb(11,"div",9),s.Wb(12,"div",2),s.Gc(13,T,14,6,"div",10),s.Vb(),s.Wb(14,"div",2),s.Gc(15,N,2,0,"button",11),s.Vb(),s.Wb(16,"div",12),s.Wb(17,"div",2),s.Wb(18,"h3",13),s.Wb(19,"strong"),s.Ic(20,"Match Start Time:"),s.Vb(),s.Ic(21),s.Vb(),s.Wb(22,"h3",13),s.Wb(23,"strong"),s.Ic(24,"Match End Time:"),s.Vb(),s.Ic(25),s.Vb(),s.Vb(),s.Wb(26,"div",2),s.Wb(27,"h3",14),s.Wb(28,"strong"),s.Ic(29,"Winner:"),s.Vb(),s.Ic(30),s.Vb(),s.Vb(),s.Wb(31,"div",2),s.Wb(32,"h3",14),s.Wb(33,"strong"),s.Ic(34,"Proof 1:"),s.Vb(),s.Ic(35," \xa0"),s.Vb(),s.Rb(36,"img",15),s.Vb(),s.Wb(37,"div",2),s.Wb(38,"h3",14),s.Wb(39,"strong"),s.Ic(40,"Proof 2:"),s.Vb(),s.Ic(41," \xa0"),s.Vb(),s.Rb(42,"img",15),s.Vb(),s.Wb(43,"div",2),s.Gc(44,F,2,0,"button",16),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(13),s.oc("ngForOf",t.arr),s.Db(2),s.oc("ngIf","pending"===t.singleItem.status),s.Db(6),s.Kc(" \xa0",t.singleItem.startTime,""),s.Db(4),s.Kc(" \xa0",t.singleItem.endTime,""),s.Db(5),s.Kc(" \xa0",t.singleItem.winner,""),s.Db(6),s.pc("src",t.singleItem.proof1,s.Bc),s.Db(6),s.pc("src",t.singleItem.proof2,s.Bc),s.Db(2),s.oc("ngIf",3===t.singleItem.bracket))},directives:[r.l,r.m,a.g,p.b],encapsulation:2}),z),U=n("0IaG"),J=function(e){return["../../match-detail",e]},j=function(e){return{tournamentId:e}};function G(e,t){if(1&e&&(s.Wb(0,"div",12),s.Wb(1,"div",73),s.Wb(2,"div",74),s.Wb(3,"div",6),s.Wb(4,"i",7),s.Ic(5,"sports_soccer"),s.Vb(),s.Vb(),s.Wb(6,"h2",75),s.Ic(7),s.Vb(),s.Vb(),s.Wb(8,"div",76),s.Wb(9,"div",77),s.Wb(10,"i",7),s.Ic(11,"update"),s.Vb(),s.Ic(12," Just Updated "),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e){var n=t.$implicit,a=s.ic();s.Db(6),s.oc("routerLink",s.sc(3,J,n.id))("queryParams",s.sc(5,j,a.id)),s.Db(1),s.Kc("Match ",n.Match,"")}}function K(e,t){if(1&e&&(s.Wb(0,"div",12),s.Wb(1,"div",73),s.Wb(2,"div",74),s.Wb(3,"div",6),s.Wb(4,"i",7),s.Ic(5,"sports_soccer"),s.Vb(),s.Vb(),s.Wb(6,"h2",75),s.Ic(7),s.Vb(),s.Vb(),s.Wb(8,"div",76),s.Wb(9,"div",77),s.Wb(10,"i",7),s.Ic(11,"update"),s.Vb(),s.Ic(12," Just Updated "),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e){var n=t.$implicit,a=s.ic();s.Db(6),s.oc("routerLink",s.sc(3,J,n.id))("queryParams",s.sc(5,j,a.id)),s.Db(1),s.Kc("Match ",n.Match,"")}}var Q=function(){return["../../user-notification"]},A=function(e){return{userId:e}};function q(e,t){if(1&e&&(s.Wb(0,"tr"),s.Wb(1,"td",70),s.Ic(2),s.Vb(),s.Wb(3,"td",70),s.Ic(4),s.Vb(),s.Wb(5,"td",70),s.Ic(6),s.Vb(),s.Wb(7,"td",70),s.Ic(8),s.Vb(),s.Wb(9,"td",70),s.Ic(10),s.Vb(),s.Wb(11,"td",78),s.Wb(12,"button",79),s.Wb(13,"i",80),s.Ic(14,"notifications"),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e){var n=t.$implicit;s.Db(2),s.Jc(n.firstName),s.Db(2),s.Jc(n.lastName),s.Db(2),s.Jc(n.psnName),s.Db(2),s.Jc(n.phoneNumber),s.Db(2),s.Jc(n.email),s.Db(2),s.Gb("btn btn-success ",n[5],""),s.Db(1),s.oc("routerLink",s.rc(10,Q))("queryParams",s.sc(11,A,n.id))}}var B,Y=((B=function(){function e(t,n,a,r,i,o,b){_classCallCheck(this,e),this.tournamentService=t,this.userService=n,this.storage=a,this.messagingService=r,this.route=i,this.firestore=o,this.dialog=b,this.tournaments=[],this.userMatches=[],this.userData=[],this.tokenArray=[],this.userWithTokenArray=[]}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.formMessageUser=new i.h({title:new i.e(""),body:new i.e("")}),this.tableData1={headerRow:["First Name","Last Name","PSN Name","Phone Number","Email",""]},this.route.params.subscribe((function(t){e.id=t.id})),this.matches=this.tournamentService.getMatches(this.id).subscribe((function(t){e.match=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.pendingMatches=e.match.filter((function(e){return"pending"==e.status})),e.completeMatches=e.match.filter((function(e){return"completed"==e.status})),e.match.map((function(t){e.tournamentService.getUserMatches(t.id).subscribe((function(n){n.length>0&&e.userMatches.push(n),e.users=e.userService.getUsers().subscribe((function(n){e.users=n.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.users.map((function(n){return e.userMatches.length>0&&e.userMatches.map((function(a){return a.map((function(a){n.id==a.userId&&e.userData.push(Object.assign({match:t},n))}))}))})),e.userData.map((function(t){t.deviceToken&&(e.tokenArray.push(t.deviceToken),e.userWithTokenArray.push(t.id))})),console.log(e.tokenArray,"----------")}))}))}))})),this.tournamentService.getTournaments().subscribe((function(t){e.item=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.singleItem=e.item.find((function(t){return t.id===e.id})),console.log(e.matches)}))}},{key:"sendNotification",value:function(){var e=this;this.tokenArray.map((function(t,n){e.messagingService.requestPermission(e.userWithTokenArray[n],e.formMessageUser.value),e.messagingService.receiveMessage(),e.message=e.messagingService.currentMessage,e.tournamentService.postMessages({notification:{title:e.formMessageUser.value.title,body:e.formMessageUser.value.body},to:t}).subscribe((function(e){console.log(e,"llllllllllll")})),e.messagingService.updateToken(e.userWithTokenArray[n],t)}),(function(e){console.error("Unable to get permission to notify.",e)}))}},{key:"getUser",value:function(e){return this.userData&&this.userData.filter((function(t){return t.id==e}))}},{key:"onFileSelected",value:function(e){var t=this,n=Date.now(),a=e.target.files[0],r=this.storage.ref("RoomsImages/".concat(n));this.storage.upload("RoomsImages/".concat(n),a).snapshotChanges().pipe(Object(l.a)((function(){t.downloadURL=r.getDownloadURL(),t.downloadURL.subscribe((function(e){e&&(t.fb=e),console.log(t.fb)}))}))).subscribe((function(e){e&&console.log(e)}))}},{key:"onSubmit",value:function(){console.log(this.formTournament.value),this.formTournament.value.banner="https://firebasestorage.googleapis.com/v0/b/tournament-62907.appspot.com/o/RoomsImages%2F1601405964819?alt=media&token=c903c131-4493-4daa-a7c7-ee54a35b6196",this.tournamentService.editTournament(this.singleItem.id,this.formTournament.value).then((function(e){console.log(e)}))}}]),e}()).\u0275fac=function(e){return new(e||B)(s.Qb(c.a),s.Qb(C.a),s.Qb(u.a),s.Qb(O.a),s.Qb(a.a),s.Qb(P.a),s.Qb(U.a))},B.\u0275cmp=s.Kb({type:B,selectors:[["app-dashboard"]],decls:310,vars:36,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-11"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],[1,"col-12","mx-4"],[1,"col-12",2,"width","900px","height","250px","max-width","900px",3,"src"],[1,"col-6"],[3,"formGroup"],[1,"example-full-width"],["matInput","","placeholder","Title","type","text","formControlName","title"],["matInput","","placeholder","Body","type","text","formControlName","body"],["mat-raised-button","",1,"btn","btn-success",3,"click"],[1,"card-header"],["role","tablist",1,"nav","nav-pills","nav-pills-rose"],[1,"nav-item"],["data-toggle","tab","href","#link1","role","tablist",1,"nav-link","active"],["data-toggle","tab","href","#link2","role","tablist",1,"nav-link"],["data-toggle","tab","href","#link3","role","tablist",1,"nav-link"],["data-toggle","tab","href","#link4","role","tablist",1,"nav-link"],[1,"tab-content","tab-space"],["id","link1",1,"tab-pane","active"],["class","col-6",4,"ngFor","ngForOf"],["id","link2",1,"tab-pane"],[1,"tournament-bracket","tournament-bracket--rounded"],[1,"tournament-bracket__round","tournament-bracket__round--quarterfinals"],[1,"tournament-bracket__list"],[1,"tournament-bracket__item"],["tabindex","0",1,"tournament-bracket__match"],[1,"tournament-bracket__table"],[1,"tournament-bracket__caption"],["datetime","1998-02-18"],[1,"sr-only"],[1,"tournament-bracket__content"],[1,"tournament-bracket__team","tournament-bracket__team--winner"],[1,"tournament-bracket__country"],["title","Canada",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-ca"],[1,"tournament-bracket__score"],[1,"tournament-bracket__number"],[1,"tournament-bracket__team"],["title","Kazakhstan",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-kz"],["title","Czech Republic",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-cz"],["title","Unitede states of America",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-us"],["title","Finland",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-fi"],["title","Sweden",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-se"],["title","Russia",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-ru"],["title","Belarus",1,"tournament-bracket__code"],["aria-label","Flag",1,"tournament-bracket__flag","flag-icon","flag-icon-by"],[1,"tournament-bracket__round","tournament-bracket__round--semifinals"],["datetime","1998-02-20"],[1,"tournament-bracket__round","tournament-bracket__round--gold"],["datetime","1998-02-22"],["aria-label","Gold medal",1,"tournament-bracket__medal","tournament-bracket__medal--gold","fa","fa-trophy"],["aria-label","Silver medal",1,"tournament-bracket__medal","tournament-bracket__medal--silver","fa","fa-trophy"],["id","link3",1,"tab-pane"],["id","link4",1,"tab-pane"],[1,"table-responsive"],[1,"table"],[1,"text-center"],[1,"text-right"],[4,"ngFor","ngForOf"],[1,"card","card-stats"],[1,"card-header","card-header-success","card-header-icon"],[1,"card-title",3,"routerLink","queryParams"],[1,"card-footer"],[1,"stats"],[1,"td-actions","text-right"],["mat-raised-button","","type","button"],[1,"material-icons",3,"routerLink","queryParams"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"div",4),s.Wb(5,"div",5),s.Wb(6,"div",6),s.Wb(7,"i",7),s.Ic(8,"emoji_events"),s.Vb(),s.Vb(),s.Wb(9,"h4",8),s.Ic(10,"Tournament Details"),s.Vb(),s.Vb(),s.Wb(11,"div",9),s.Wb(12,"div",2),s.Wb(13,"div",10),s.Wb(14,"div",2),s.Rb(15,"img",11),s.Vb(),s.Wb(16,"div",2),s.Wb(17,"h3",12),s.Wb(18,"strong"),s.Ic(19,"Tournament Name:"),s.Vb(),s.Ic(20),s.Vb(),s.Wb(21,"h3",12),s.Wb(22,"strong"),s.Ic(23,"Description:"),s.Vb(),s.Ic(24),s.Vb(),s.Vb(),s.Wb(25,"div",2),s.Wb(26,"h3",12),s.Wb(27,"strong"),s.Ic(28,"Entry Fee:"),s.Vb(),s.Ic(29),s.Vb(),s.Wb(30,"h3",12),s.Wb(31,"strong"),s.Ic(32,"Start Date:"),s.Vb(),s.Ic(33),s.Vb(),s.Vb(),s.Wb(34,"div",2),s.Wb(35,"h3",12),s.Wb(36,"strong"),s.Ic(37,"First Prize Money:"),s.Vb(),s.Ic(38),s.Vb(),s.Wb(39,"h3",12),s.Wb(40,"strong"),s.Ic(41,"Second Prize Money:"),s.Vb(),s.Ic(42),s.Vb(),s.Ic(43,"> "),s.Vb(),s.Wb(44,"div",2),s.Wb(45,"h3",12),s.Wb(46,"strong"),s.Ic(47,"Third Prize Money:"),s.Vb(),s.Ic(48),s.Vb(),s.Wb(49,"h3",12),s.Wb(50,"strong"),s.Ic(51,"Number Of players:"),s.Vb(),s.Ic(52),s.Vb(),s.Vb(),s.Wb(53,"h3"),s.Ic(54,"\xa0Want to Send Notification to all users?"),s.Vb(),s.Wb(55,"form",13),s.Wb(56,"mat-form-field",14),s.Rb(57,"input",15),s.Vb(),s.Wb(58,"mat-form-field",14),s.Rb(59,"input",16),s.Vb(),s.Vb(),s.Wb(60,"button",17),s.ec("click",(function(e){return t.sendNotification()})),s.Ic(61,"Send Notification To all Users"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(62,"div",4),s.Rb(63,"div",18),s.Wb(64,"div",9),s.Wb(65,"ul",19),s.Wb(66,"li",20),s.Wb(67,"a",21),s.Ic(68," Completed Matches "),s.Vb(),s.Vb(),s.Wb(69,"li",20),s.Wb(70,"a",22),s.Ic(71," LeaderBoard "),s.Vb(),s.Vb(),s.Wb(72,"li",20),s.Wb(73,"a",23),s.Ic(74," Pending Matches "),s.Vb(),s.Vb(),s.Wb(75,"li",20),s.Wb(76,"a",24),s.Ic(77," Players "),s.Vb(),s.Vb(),s.Vb(),s.Wb(78,"div",25),s.Wb(79,"div",26),s.Wb(80,"div",2),s.Gc(81,G,13,7,"div",27),s.Vb(),s.Vb(),s.Wb(82,"div",28),s.Wb(83,"div"),s.Wb(84,"div",29),s.Wb(85,"div",30),s.Wb(86,"ul",31),s.Wb(87,"li",32),s.Wb(88,"div",33),s.Wb(89,"table",34),s.Wb(90,"caption",35),s.Wb(91,"time",36),s.Ic(92,"18 February 1998"),s.Vb(),s.Vb(),s.Wb(93,"thead",37),s.Wb(94,"tr"),s.Wb(95,"th"),s.Ic(96,"Country"),s.Vb(),s.Wb(97,"th"),s.Ic(98,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(99,"tbody",38),s.Wb(100,"tr",39),s.Wb(101,"td",40),s.Wb(102,"abbr",41),s.Ic(103),s.Vb(),s.Rb(104,"span",42),s.Vb(),s.Wb(105,"td",43),s.Wb(106,"span",44),s.Ic(107,"4"),s.Vb(),s.Vb(),s.Vb(),s.Wb(108,"tr",45),s.Wb(109,"td",40),s.Wb(110,"abbr",46),s.Ic(111),s.Vb(),s.Rb(112,"span",47),s.Vb(),s.Wb(113,"td",43),s.Wb(114,"span",44),s.Ic(115,"1"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(116,"li",32),s.Wb(117,"div",33),s.Wb(118,"table",34),s.Wb(119,"caption",35),s.Wb(120,"time",36),s.Ic(121,"18 February 1998"),s.Vb(),s.Vb(),s.Wb(122,"thead",37),s.Wb(123,"tr"),s.Wb(124,"th"),s.Ic(125,"Country"),s.Vb(),s.Wb(126,"th"),s.Ic(127,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(128,"tbody",38),s.Wb(129,"tr",39),s.Wb(130,"td",40),s.Wb(131,"abbr",48),s.Ic(132),s.Vb(),s.Rb(133,"span",49),s.Vb(),s.Wb(134,"td",43),s.Wb(135,"span",44),s.Ic(136,"4"),s.Vb(),s.Vb(),s.Vb(),s.Wb(137,"tr",45),s.Wb(138,"td",40),s.Wb(139,"abbr",50),s.Ic(140),s.Vb(),s.Rb(141,"span",51),s.Vb(),s.Wb(142,"td",43),s.Wb(143,"span",44),s.Ic(144,"1"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(145,"li",32),s.Wb(146,"div",33),s.Wb(147,"table",34),s.Wb(148,"caption",35),s.Wb(149,"time",36),s.Ic(150,"18 February 1998"),s.Vb(),s.Vb(),s.Wb(151,"thead",37),s.Wb(152,"tr"),s.Wb(153,"th"),s.Ic(154,"Country"),s.Vb(),s.Wb(155,"th"),s.Ic(156,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(157,"tbody",38),s.Wb(158,"tr",39),s.Wb(159,"td",40),s.Wb(160,"abbr",52),s.Ic(161),s.Vb(),s.Rb(162,"span",53),s.Vb(),s.Wb(163,"td",43),s.Wb(164,"span",44),s.Ic(165,"2"),s.Vb(),s.Vb(),s.Vb(),s.Wb(166,"tr",45),s.Wb(167,"td",40),s.Wb(168,"abbr",54),s.Ic(169),s.Vb(),s.Rb(170,"span",55),s.Vb(),s.Wb(171,"td",43),s.Wb(172,"span",44),s.Ic(173,"1"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(174,"li",32),s.Wb(175,"div",33),s.Wb(176,"table",34),s.Wb(177,"caption",35),s.Wb(178,"time",36),s.Ic(179,"18 February 1998"),s.Vb(),s.Vb(),s.Wb(180,"thead",37),s.Wb(181,"tr"),s.Wb(182,"th"),s.Ic(183,"Country"),s.Vb(),s.Wb(184,"th"),s.Ic(185,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(186,"tbody",38),s.Wb(187,"tr",39),s.Wb(188,"td",40),s.Wb(189,"abbr",56),s.Ic(190),s.Vb(),s.Rb(191,"span",57),s.Vb(),s.Wb(192,"td",43),s.Wb(193,"span",44),s.Ic(194,"4"),s.Vb(),s.Vb(),s.Vb(),s.Wb(195,"tr",45),s.Wb(196,"td",40),s.Wb(197,"abbr",58),s.Ic(198),s.Vb(),s.Rb(199,"span",59),s.Vb(),s.Wb(200,"td",43),s.Wb(201,"span",44),s.Ic(202,"1"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(203,"div",60),s.Wb(204,"ul",31),s.Wb(205,"li",32),s.Wb(206,"div",33),s.Wb(207,"table",34),s.Wb(208,"caption",35),s.Wb(209,"time",61),s.Ic(210,"20 February 1998"),s.Vb(),s.Vb(),s.Wb(211,"thead",37),s.Wb(212,"tr"),s.Wb(213,"th"),s.Ic(214,"Country"),s.Vb(),s.Wb(215,"th"),s.Ic(216,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(217,"tbody",38),s.Wb(218,"tr",45),s.Wb(219,"td",40),s.Rb(220,"span",42),s.Vb(),s.Wb(221,"td",43),s.Wb(222,"span",44),s.Ic(223,"1"),s.Vb(),s.Vb(),s.Vb(),s.Wb(224,"tr",39),s.Wb(225,"td",40),s.Rb(226,"span",49),s.Vb(),s.Wb(227,"td",43),s.Wb(228,"span",44),s.Ic(229,"2"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(230,"li",32),s.Wb(231,"div",33),s.Wb(232,"table",34),s.Wb(233,"caption",35),s.Wb(234,"time",61),s.Ic(235,"20 February 1998"),s.Vb(),s.Vb(),s.Wb(236,"thead",37),s.Wb(237,"tr"),s.Wb(238,"th"),s.Ic(239,"Country"),s.Vb(),s.Wb(240,"th"),s.Ic(241,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(242,"tbody",38),s.Wb(243,"tr",45),s.Wb(244,"td",40),s.Rb(245,"span",53),s.Vb(),s.Wb(246,"td",43),s.Wb(247,"span",44),s.Ic(248,"4"),s.Vb(),s.Vb(),s.Vb(),s.Wb(249,"tr",39),s.Wb(250,"td",40),s.Rb(251,"span",57),s.Vb(),s.Wb(252,"td",43),s.Wb(253,"span",44),s.Ic(254,"7"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(255,"div",62),s.Wb(256,"ul",31),s.Wb(257,"li",32),s.Wb(258,"div",33),s.Wb(259,"table",34),s.Wb(260,"caption",35),s.Wb(261,"time",63),s.Ic(262,"22 February 1998"),s.Vb(),s.Vb(),s.Wb(263,"thead",37),s.Wb(264,"tr"),s.Wb(265,"th"),s.Ic(266,"Country"),s.Vb(),s.Wb(267,"th"),s.Ic(268,"Score"),s.Vb(),s.Vb(),s.Vb(),s.Wb(269,"tbody",38),s.Wb(270,"tr",39),s.Wb(271,"td",40),s.Rb(272,"abbr",48),s.Rb(273,"span",49),s.Vb(),s.Wb(274,"td",43),s.Wb(275,"span",44),s.Ic(276,"1"),s.Vb(),s.Rb(277,"span",64),s.Vb(),s.Vb(),s.Wb(278,"tr",45),s.Wb(279,"td",40),s.Rb(280,"abbr",56),s.Rb(281,"span",57),s.Vb(),s.Wb(282,"td",43),s.Wb(283,"span",44),s.Ic(284,"0"),s.Vb(),s.Rb(285,"span",65),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(286,"div",66),s.Wb(287,"div",2),s.Gc(288,K,13,7,"div",27),s.Vb(),s.Vb(),s.Wb(289,"div",67),s.Wb(290,"div",68),s.Wb(291,"table",69),s.Wb(292,"thead"),s.Wb(293,"tr"),s.Wb(294,"th",70),s.Ic(295),s.Vb(),s.Wb(296,"th",70),s.Ic(297),s.Vb(),s.Wb(298,"th",70),s.Ic(299),s.Vb(),s.Wb(300,"th",70),s.Ic(301),s.Vb(),s.Wb(302,"th",70),s.Ic(303),s.Vb(),s.Wb(304,"th",70),s.Ic(305),s.Vb(),s.Wb(306,"th",71),s.Ic(307),s.Vb(),s.Vb(),s.Vb(),s.Wb(308,"tbody"),s.Gc(309,q,15,13,"tr",72),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(15),s.pc("src",null==t.singleItem?null:t.singleItem.banner,s.Bc),s.Db(5),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.name,""),s.Db(4),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.description,""),s.Db(5),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.entryFee,""),s.Db(4),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.startDate,""),s.Db(5),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.prizeMoney,""),s.Db(4),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.secondPrizeMoney,""),s.Db(6),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.thirdPrizeMoney,""),s.Db(4),s.Kc(" \xa0",null==t.singleItem?null:t.singleItem.numberOfPlayer,""),s.Db(3),s.oc("formGroup",t.formMessageUser),s.Db(26),s.oc("ngForOf",t.completeMatches),s.Db(22),s.Lc("",t.userData&&(null==t.userData[0]?null:t.userData[0].firstName)," ",t.userData&&(null==t.userData[0]?null:t.userData[0].lastName),""),s.Db(8),s.Lc("",t.userData&&(null==t.userData[1]?null:t.userData[1].firstName)," ",t.userData&&(null==t.userData[1]?null:t.userData[1].lastName),""),s.Db(21),s.Lc("",t.userData&&(null==t.userData[2]?null:t.userData[2].firstName)," ",t.userData&&(null==t.userData[2]?null:t.userData[2].lastName),""),s.Db(8),s.Lc("",t.userData&&(null==t.userData[3]?null:t.userData[3].firstName)," ",t.userData&&(null==t.userData[3]?null:t.userData[3].lastName),""),s.Db(21),s.Lc("",t.userData&&(null==t.userData[4]?null:t.userData[4].firstName)," ",t.userData&&(null==t.userData[4]?null:t.userData[4].lastName),""),s.Db(8),s.Lc("",t.userData&&(null==t.userData[5]?null:t.userData[5].firstName)," ",t.userData&&(null==t.userData[5]?null:t.userData[5].lastName),""),s.Db(21),s.Lc("",t.userData&&(null==t.userData[6]?null:t.userData[6].firstName)," ",t.userData&&(null==t.userData[6]?null:t.userData[6].lastName),""),s.Db(8),s.Lc("",t.userData&&(null==t.userData[7]?null:t.userData[7].firstName)," ",t.userData&&(null==t.userData[7]?null:t.userData[7].lastName),""),s.Db(90),s.oc("ngForOf",t.pendingMatches),s.Db(7),s.Jc(t.tableData1.headerRow[0]),s.Db(2),s.Jc(t.tableData1.headerRow[1]),s.Db(2),s.Jc(t.tableData1.headerRow[2]),s.Db(2),s.Jc(t.tableData1.headerRow[3]),s.Db(2),s.Jc(t.tableData1.headerRow[4]),s.Db(2),s.Jc(t.tableData1.headerRow[5]),s.Db(2),s.Jc(t.tableData1.headerRow[6]),s.Db(2),s.oc("ngForOf",t.userData))},directives:[i.w,i.p,i.i,m.b,f.b,i.c,i.o,i.g,p.b,r.l,a.g],styles:['@import"https://fonts.googleapis.com/css?family=Work+Sans:300,400,600,700&subset=latin-ext";\n@breakpoint-sm : 38em;@breakpoint-md : 52em;@breakpoint-lg : 72em;*[_ngcontent-%COMP%], [_ngcontent-%COMP%]:after, [_ngcontent-%COMP%]:before{box-sizing:border-box}html[_ngcontent-%COMP%]{font-size:15px}@media(min-width:576px){html[_ngcontent-%COMP%]{font-size:14px;font-size:15px;font-size:16px}}body[_ngcontent-%COMP%]{background-color:#f1f1f1;font-family:Work Sans,Helvetica Neue,Arial,sans-serif}.container[_ngcontent-%COMP%]{width:90%;min-width:18em;margin:20px auto}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%]{text-align:center}h1[_ngcontent-%COMP%]{font-size:2rem;font-weight:700;margin-bottom:.5em}h2[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;margin-bottom:2em}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.tournament-bracket[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media(min-width:576px){.tournament-bracket[_ngcontent-%COMP%]{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.tournament-bracket__round[_ngcontent-%COMP%]{display:block;margin-left:-3px;-webkit-box-flex:1;flex:1}.tournament-bracket__round-title[_ngcontent-%COMP%]{color:#9e9e9e;font-size:.95rem;font-weight:400;text-align:center;font-style:italic;margin-bottom:.5em}.tournament-bracket__list[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;flex-flow:row wrap;-webkit-box-pack:center;justify-content:center;height:100%;min-height:100%;border-bottom:1px dashed #e5e5e5;padding-bottom:2em;margin-bottom:2em;-webkit-transition:padding .2s ease-in-out,margin .2s ease-in-out;transition:padding .2s ease-in-out,margin .2s ease-in-out}@media(max-width:576px){.tournament-bracket__list[_ngcontent-%COMP%]{padding-bottom:1em;margin-bottom:1em}}@media(min-width:576px){.tournament-bracket__list[_ngcontent-%COMP%]{margin-bottom:0;padding-bottom:0;border-right:1px dashed #e5e5e5;border-bottom:0}}.tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__list[_ngcontent-%COMP%]{border:0}.tournament-bracket__item[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-flex:0;flex:0 1 auto;-webkit-box-pack:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:start;align-items:flex-start;position:relative;padding:2% 0;width:48%;-webkit-transition:padding .2s linear;transition:padding .2s linear}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(odd){margin-right:2%}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(2n){margin-left:2%}.tournament-bracket__item[_ngcontent-%COMP%]:after{-webkit-transition:width .2s linear;transition:width .2s linear}@media(max-width:576px){.tournament-bracket__item[_ngcontent-%COMP%]{width:100%}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(2n), .tournament-bracket__item[_ngcontent-%COMP%]:nth-child(odd){margin-left:0;margin-right:0}}@media(min-width:576px){.tournament-bracket__item[_ngcontent-%COMP%]{padding:.5em 1em;width:100%}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(2n), .tournament-bracket__item[_ngcontent-%COMP%]:nth-child(odd){margin:0}.tournament-bracket__item[_ngcontent-%COMP%]:after{position:absolute;right:0;content:"";display:block;width:1em;height:45%;border-right:2px solid #9e9e9e}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(odd):after{top:50%;border-top:2px solid #9e9e9e;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.tournament-bracket--rounded[_ngcontent-%COMP%] .tournament-bracket__item[_ngcontent-%COMP%]:nth-child(odd):after{border-top-right-radius:.6em}.tournament-bracket__item[_ngcontent-%COMP%]:nth-child(2n):after{bottom:50%;border-bottom:2px solid #9e9e9e;-webkit-transform:translateY(1px);transform:translateY(1px)}.tournament-bracket--rounded[_ngcontent-%COMP%] .tournament-bracket__item[_ngcontent-%COMP%]:nth-child(2n):after{border-bottom-right-radius:.6em}.tournament-bracket__round[_ngcontent-%COMP%]:first-child .tournament-bracket__item[_ngcontent-%COMP%]{padding-left:0}.tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__item[_ngcontent-%COMP%]{padding-right:0}.tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__item[_ngcontent-%COMP%]:after{display:none}.tournament-bracket__round[_ngcontent-%COMP%]:nth-last-child(2) .tournament-bracket__item[_ngcontent-%COMP%]:after{border-radius:0;border-right:0}}@media(min-width:576px){.tournament-bracket__item[_ngcontent-%COMP%]{padding:.5em 1.5em}.tournament-bracket__item[_ngcontent-%COMP%]:after{width:1.5em}}.tournament-bracket__match[_ngcontent-%COMP%]{display:-webkit-box;display:flex;width:100%;background-color:#fff;padding:1em;border:1px solid transparent;border-radius:.1em;box-shadow:0 2px 0 0 #e5e5e5;outline:none;cursor:pointer;-webkit-transition:padding .2s ease-in-out,border .2s linear;transition:padding .2s ease-in-out,border .2s linear}.tournament-bracket__match[_ngcontent-%COMP%]:focus{border-color:#2196f3}.tournament-bracket__match[_ngcontent-%COMP%]:after, .tournament-bracket__match[_ngcontent-%COMP%]:before{-webkit-transition:all .2s linear;transition:all .2s linear}@media(max-width:576px){.tournament-bracket__match[_ngcontent-%COMP%]{padding:.75em .5em}}@media(min-width:576px){.tournament-bracket__match[_ngcontent-%COMP%]:after, .tournament-bracket__match[_ngcontent-%COMP%]:before{position:absolute;left:0;z-index:1;content:"";display:block;width:1em;height:10%;border-left:2px solid #9e9e9e}.tournament-bracket__match[_ngcontent-%COMP%]:before{bottom:50%;border-bottom:2px solid #9e9e9e;-webkit-transform:translateY(1px);transform:translateY(1px)}.tournament-bracket--rounded[_ngcontent-%COMP%] .tournament-bracket__match[_ngcontent-%COMP%]:before{border-bottom-left-radius:.6em}.tournament-bracket__match[_ngcontent-%COMP%]:after{top:50%;border-top:2px solid #9e9e9e;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.tournament-bracket--rounded[_ngcontent-%COMP%] .tournament-bracket__match[_ngcontent-%COMP%]:after{border-top-left-radius:.6em}}@media(min-width:576px){.tournament-bracket__match[_ngcontent-%COMP%]:after, .tournament-bracket__match[_ngcontent-%COMP%]:before{width:1.5em}.tournament-bracket__match[_ngcontent-%COMP%]:before{-webkit-transform:translateY(1px);transform:translateY(1px)}.tournament-bracket__match[_ngcontent-%COMP%]:after{-webkit-transform:translateY(-1px);transform:translateY(-1px)}}.tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__match[_ngcontent-%COMP%]:after, .tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__match[_ngcontent-%COMP%]:before{border-left:0}.tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__match[_ngcontent-%COMP%]:before{border-bottom-left-radius:0}.tournament-bracket__round[_ngcontent-%COMP%]:first-child .tournament-bracket__match[_ngcontent-%COMP%]:after, .tournament-bracket__round[_ngcontent-%COMP%]:first-child .tournament-bracket__match[_ngcontent-%COMP%]:before, .tournament-bracket__round[_ngcontent-%COMP%]:last-child .tournament-bracket__match[_ngcontent-%COMP%]:after{display:none}.tournament-bracket__content[_ngcontent-%COMP%]{display:-webkit-box;display:flex}.tournament-bracket__content[_ngcontent-%COMP%]:after{content:":";width:1em;text-align:center;padding:.2em .1em}@media(min-width:576px){.tournament-bracket__content[_ngcontent-%COMP%]:after{-webkit-box-ordinal-group:2;order:1}}.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child{width:50%;-webkit-box-ordinal-group:1;order:0;text-align:right}@media(min-width:576px)and (max-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child{-webkit-box-align:end;align-items:flex-end}}.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__country[_ngcontent-%COMP%]{-webkit-box-ordinal-group:3;order:2;-webkit-box-pack:end;justify-content:flex-end}@media(min-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__country[_ngcontent-%COMP%]{-webkit-box-ordinal-group:1;order:0}}@media(min-width:576px)and (max-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__country[_ngcontent-%COMP%]{-webkit-box-orient:vertical;-webkit-box-direction:reverse;flex-direction:column-reverse;-webkit-box-align:end;align-items:flex-end}}.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__score[_ngcontent-%COMP%]{-webkit-box-ordinal-group:1;order:0}@media(min-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__score[_ngcontent-%COMP%]{-webkit-box-ordinal-group:3;order:2}}.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:last-child{width:50%;-webkit-box-ordinal-group:3;order:2;text-align:left}@media(min-width:576px)and (max-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:last-child{-webkit-box-align:start;align-items:flex-start}}@media(min-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:last-child .tournament-bracket__country[_ngcontent-%COMP%]{-webkit-box-pack:start;justify-content:flex-start}}@media(min-width:576px)and (max-width:576px){.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:last-child .tournament-bracket__country[_ngcontent-%COMP%]{-webkit-box-align:start;align-items:flex-start}}.tournament-bracket__content[_ngcontent-%COMP%] .tournament-bracket__team[_ngcontent-%COMP%]:last-child .tournament-bracket__code[_ngcontent-%COMP%]{-webkit-box-ordinal-group:2;order:1}.tournament-bracket__table[_ngcontent-%COMP%]{width:100%}.tournament-bracket__caption[_ngcontent-%COMP%]{font-size:.8rem;color:#bdbdbd;font-weight:300;padding-bottom:.75em}.tournament-bracket__team[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse;-webkit-box-pack:justify;justify-content:space-between}@media(min-width:576px){.tournament-bracket__team[_ngcontent-%COMP%]{-webkit-box-orient:vertical;-webkit-box-direction:reverse;flex-direction:column-reverse}}.tournament-bracket__country[_ngcontent-%COMP%]{font-size:.95rem;display:-webkit-box;display:flex;margin-top:.5em;-webkit-box-align:center;align-items:center}@media(max-width:576px){.tournament-bracket__country[_ngcontent-%COMP%]{margin-top:0}}@media(min-width:576px)and (max-width:576px){.tournament-bracket__country[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.tournament-bracket__country[_ngcontent-%COMP%] .tournament-bracket__code[_ngcontent-%COMP%]{margin-top:.2em}}.tournament-bracket__code[_ngcontent-%COMP%]{padding:0 .5em;color:#212121;font-weight:600;text-transform:uppercase;border:0;text-decoration:none;cursor:help;-webkit-transition:padding .2s ease-in-out;transition:padding .2s ease-in-out}@media(max-width:576px){.tournament-bracket__code[_ngcontent-%COMP%]{padding:0 .25em}}@media(min-width:576px)and (max-width:576px){.tournament-bracket__code[_ngcontent-%COMP%]{padding:0}}.tournament-bracket__score[_ngcontent-%COMP%]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.tournament-bracket__team[_ngcontent-%COMP%]:first-child .tournament-bracket__score[_ngcontent-%COMP%]{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse;padding-left:.75em}.tournament-bracket__team[_ngcontent-%COMP%]:last-child .tournament-bracket__score[_ngcontent-%COMP%]{padding-right:.75em}.tournament-bracket__number[_ngcontent-%COMP%]{display:inline-block;padding:.2em .4em;font-size:.95rem;background-color:#f5f5f5;border-bottom:.075em solid;border-color:spin(shade(#f5f5f5,10%),-10)}.tournament-bracket__team--winner[_ngcontent-%COMP%] .tournament-bracket__number[_ngcontent-%COMP%]{background-color:#fff176;border-color:spin(shade(#fff176,2%),-10)}.tournament-bracket__medal[_ngcontent-%COMP%]{padding:0 .5em}.tournament-bracket__medal--gold[_ngcontent-%COMP%]{color:gold}.tournament-bracket__medal--silver[_ngcontent-%COMP%]{color:silver}.tournament-bracket__medal--bronze[_ngcontent-%COMP%]{color:#cd7f32}']}),B);function E(e,t){if(1&e&&(s.Wb(0,"mat-option",31),s.Ic(1),s.Vb()),2&e){var n=t.$implicit;s.oc("value",n.value),s.Db(1),s.Kc(" ",n.viewValue," ")}}var $,X=(($=function(){function e(t,n,a){_classCallCheck(this,e),this.tournamentService=t,this.storage=n,this.route=a,this.tournaments=[],this.players=[{value:"0",viewValue:"0"},{value:"1",viewValue:"1"},{value:"2",viewValue:"2"},{value:"3",viewValue:"3"},{value:"4",viewValue:"4"},{value:"5",viewValue:"5"},{value:"6",viewValue:"6"}]}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.route.params.subscribe((function(t){e.id=t.id})),this.formTournament=new i.h({name:new i.e(""),description:new i.e(""),entryFee:new i.e(""),startDate:new i.e(""),prizeMoney:new i.e(""),numberOfPlayer:new i.e(""),banner:new i.e("")}),this.tournamentService.getTournaments().subscribe((function(t){e.item=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),e.singleItem=e.item.find((function(t){return t.id=e.id})),e.formTournament.patchValue({name:e.singleItem.name,description:e.singleItem.description,entryFee:e.singleItem.entryFee,startDate:e.singleItem.startDate,prizeMoney:e.singleItem.prizeMoney,numberOfPlayer:e.singleItem.numberOfPlayer,banner:e.singleItem.banner}),console.log(t)}))}},{key:"onFileSelected",value:function(e){var t=this,n=Date.now(),a=e.target.files[0],r=this.storage.ref("RoomsImages/".concat(n));this.storage.upload("RoomsImages/".concat(n),a).snapshotChanges().pipe(Object(l.a)((function(){t.downloadURL=r.getDownloadURL(),t.downloadURL.subscribe((function(e){e&&(t.fb=e),console.log(t.fb)}))}))).subscribe((function(e){e&&console.log(e)}))}},{key:"onSubmit",value:function(){console.log(this.formTournament.value),this.formTournament.value.banner="https://firebasestorage.googleapis.com/v0/b/tournament-62907.appspot.com/o/RoomsImages%2F1601405964819?alt=media&token=c903c131-4493-4daa-a7c7-ee54a35b6196",this.tournamentService.editTournament(this.singleItem.id,this.formTournament.value).then((function(e){console.log(e)}))}}]),e}()).\u0275fac=function(e){return new(e||$)(s.Qb(c.a),s.Qb(u.a),s.Qb(a.a))},$.\u0275cmp=s.Kb({type:$,selectors:[["app-dashboard"]],decls:42,vars:2,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-11"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],[3,"formGroup"],[1,"example-full-width"],["matInput","","placeholder","Name","type","text","formControlName","name"],["matInput","","placeholder","Description","type","text","formControlName","description"],["matInput","","placeholder","Entry Fee","type","text","formControlName","entryFee"],["matInput","","type","datetime-local","placeholder","start date","formControlName","startDate"],["matInput","","placeholder","Prize Money","type","number","formControlName","prizeMoney"],["placeholder","Select Number of Players","name","numberOfPlayer","formControlName","numberOfPlayer"],[3,"value",4,"ngFor","ngForOf"],["data-provides","fileinput",1,"fileinput","fileinput-new","text-center","mt-4"],[1,"fileinput-new","thumbnail"],["src","./assets/img/image_placeholder.jpg","alt","..."],[1,"fileinput-preview","fileinput-exists","thumbnail"],[1,"btn","btn-rose","btn-round","btn-file"],[1,"fileinput-new"],[1,"fileinput-exists"],["type","file","name","...","formControlName","banner",3,"change"],["href","#pablo","data-dismiss","fileinput",1,"btn","btn-danger","btn-round","fileinput-exists"],[1,"fa","fa-times"],[1,"card-footer"],["mat-raised-button","","type","submit",1,"btn","btn-fill","btn-rose",3,"click"],[3,"value"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"div",4),s.Wb(5,"div",5),s.Wb(6,"div",6),s.Wb(7,"i",7),s.Ic(8,"emoji_events"),s.Vb(),s.Vb(),s.Wb(9,"h4",8),s.Ic(10,"Edit Tournament"),s.Vb(),s.Vb(),s.Wb(11,"div",9),s.Wb(12,"form",10),s.Wb(13,"mat-form-field",11),s.Rb(14,"input",12),s.Vb(),s.Wb(15,"mat-form-field",11),s.Rb(16,"input",13),s.Vb(),s.Wb(17,"mat-form-field",11),s.Rb(18,"input",14),s.Vb(),s.Wb(19,"mat-form-field"),s.Rb(20,"input",15),s.Vb(),s.Wb(21,"mat-form-field",11),s.Rb(22,"input",16),s.Vb(),s.Wb(23,"mat-select",17),s.Gc(24,E,2,2,"mat-option",18),s.Vb(),s.Wb(25,"div",19),s.Wb(26,"div",20),s.Rb(27,"img",21),s.Vb(),s.Rb(28,"div",22),s.Wb(29,"div"),s.Wb(30,"span",23),s.Wb(31,"span",24),s.Ic(32,"Select Banner"),s.Vb(),s.Wb(33,"span",25),s.Ic(34,"Change"),s.Vb(),s.Wb(35,"input",26),s.ec("change",(function(e){return t.onFileSelected(e)})),s.Vb(),s.Vb(),s.Wb(36,"a",27),s.Rb(37,"i",28),s.Ic(38," Remove"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Wb(39,"div",29),s.Wb(40,"button",30),s.ec("click",(function(e){return t.onSubmit()})),s.Ic(41,"Submit"),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(12),s.oc("formGroup",t.formTournament),s.Db(12),s.oc("ngForOf",t.players))},directives:[i.w,i.p,i.i,m.b,f.b,i.c,i.o,i.g,i.s,h.a,r.l,p.b,v.n],encapsulation:2}),$),H=function(e){return["../tournament-detail",e]},Z=function(e){return["../tournament-edit",e]};function ee(e,t){if(1&e){var n=s.Xb();s.Wb(0,"tr"),s.Wb(1,"td",16),s.Ic(2),s.Vb(),s.Wb(3,"td",16),s.Ic(4),s.Vb(),s.Wb(5,"td",16),s.Ic(6),s.Vb(),s.Wb(7,"td",16),s.Ic(8),s.Vb(),s.Wb(9,"td",16),s.Ic(10),s.Vb(),s.Wb(11,"td",16),s.Ic(12),s.Vb(),s.Wb(13,"td",16),s.Ic(14),s.Vb(),s.Wb(15,"td",16),s.Ic(16),s.Vb(),s.Wb(17,"td",13),s.Rb(18,"img",17),s.Vb(),s.Wb(19,"td",18),s.Wb(20,"button",19),s.Wb(21,"i",20),s.Ic(22,"edit"),s.Vb(),s.Vb(),s.Wb(23,"button",19),s.Wb(24,"i",21),s.ec("click",(function(e){s.zc(n);var a=t.$implicit;return s.ic().deleteTournament(a.id)})),s.Ic(25,"close"),s.Vb(),s.Vb(),s.Vb(),s.Vb()}if(2&e){var a=t.$implicit;s.Db(1),s.oc("routerLink",s.sc(24,H,a.id)),s.Db(1),s.Jc(a.name),s.Db(1),s.oc("routerLink",s.sc(26,H,a.id)),s.Db(1),s.Jc(a.description),s.Db(1),s.oc("routerLink",s.sc(28,H,a.id)),s.Db(1),s.Jc(a.entryFee),s.Db(1),s.oc("routerLink",s.sc(30,H,a.id)),s.Db(1),s.Jc(a.prizeMoney),s.Db(1),s.oc("routerLink",s.sc(32,H,a.id)),s.Db(1),s.Jc(a.secondPrizeMoney),s.Db(1),s.oc("routerLink",s.sc(34,H,a.id)),s.Db(1),s.Jc(a.thirdPrizeMoney),s.Db(1),s.oc("routerLink",s.sc(36,H,a.id)),s.Db(1),s.Jc(a.startDate),s.Db(1),s.oc("routerLink",s.sc(38,H,a.id)),s.Db(1),s.Jc(a.numberOfPlayer),s.Db(2),s.pc("src",a.banner,s.Bc),s.Db(2),s.Gb("btn btn-success ",a[5],""),s.Db(1),s.oc("routerLink",s.sc(40,Z,a.id)),s.Db(2),s.Gb("btn btn-danger ",a[5],"")}}var te=function(e){return["../../user-detail",e]};function ne(e,t){if(1&e&&(s.Wb(0,"div",12),s.Wb(1,"div",13),s.Wb(2,"div",14),s.Wb(3,"div",6),s.Wb(4,"i",7),s.Ic(5,"person"),s.Vb(),s.Vb(),s.Wb(6,"h2",15),s.Ic(7),s.Vb(),s.Vb(),s.Wb(8,"div",16),s.Wb(9,"div",17),s.Wb(10,"i",7),s.Ic(11,"update"),s.Vb(),s.Ic(12," Just Updated "),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e){var n=t.$implicit;s.Db(6),s.oc("routerLink",s.sc(3,te,n.id)),s.Db(1),s.Lc("",n.firstName," ",n.lastName,"")}}var ae,re,ie=[{path:"",children:[{path:"dashboard",component:M},{path:"tournament-list",component:(re=function(){function e(t){_classCallCheck(this,e),this.tournamentService=t,this.tournamentList=[]}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.tableData1={headerRow:["Name","Description","Entry Fee","First Prize Money","Second Prize Money","Third Prize Money","Start Date","Number Of players","Banner",""]},this.tournamentService.getTournaments().subscribe((function(t){e.item=t.map((function(e){return Object.assign({id:e.payload.doc.id},e.payload.doc.data())})),console.log(t)}))}},{key:"deleteTournament",value:function(e){this.tournamentService.deleteTournament(e)}}]),e}(),re.\u0275fac=function(e){return new(e||re)(s.Qb(c.a))},re.\u0275cmp=s.Kb({type:re,selectors:[["app-dashboard"]],decls:36,vars:9,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-12"],["mat-raised-button","","type","button","routerLink","../dashboard",1,"btn","btn-danger","text-right",2,"left","700px"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],[1,"table-responsive"],[1,"table"],[1,"text-center"],[1,"text-right"],[4,"ngFor","ngForOf"],[1,"text-center",3,"routerLink"],[2,"width","100px","height","50px",3,"src"],[1,"td-actions","text-right"],["mat-raised-button","","type","button"],[1,"material-icons",3,"routerLink"],[1,"material-icons",3,"click"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"button",4),s.Ic(5,"Add Tournament"),s.Vb(),s.Wb(6,"div",5),s.Wb(7,"div",6),s.Wb(8,"div",7),s.Wb(9,"i",8),s.Ic(10,"emoji_events"),s.Vb(),s.Vb(),s.Wb(11,"h4",9),s.Ic(12,"Tournament List"),s.Vb(),s.Vb(),s.Wb(13,"div",10),s.Wb(14,"div",11),s.Wb(15,"table",12),s.Wb(16,"thead"),s.Wb(17,"tr"),s.Wb(18,"th",13),s.Ic(19),s.Vb(),s.Wb(20,"th",13),s.Ic(21),s.Vb(),s.Wb(22,"th",13),s.Ic(23),s.Vb(),s.Wb(24,"th",13),s.Ic(25),s.Vb(),s.Wb(26,"th",13),s.Ic(27),s.Vb(),s.Wb(28,"th",13),s.Ic(29),s.Vb(),s.Wb(30,"th",13),s.Ic(31),s.Vb(),s.Wb(32,"th",14),s.Ic(33),s.Vb(),s.Vb(),s.Vb(),s.Wb(34,"tbody"),s.Gc(35,ee,26,42,"tr",15),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(19),s.Jc(t.tableData1.headerRow[0]),s.Db(2),s.Jc(t.tableData1.headerRow[1]),s.Db(2),s.Jc(t.tableData1.headerRow[2]),s.Db(2),s.Jc(t.tableData1.headerRow[3]),s.Db(2),s.Jc(t.tableData1.headerRow[4]),s.Db(2),s.Jc(t.tableData1.headerRow[5]),s.Db(2),s.Jc(t.tableData1.headerRow[6]),s.Db(2),s.Jc(t.tableData1.headerRow[7]),s.Db(2),s.oc("ngForOf",t.item))},directives:[p.b,a.g,r.l],encapsulation:2}),re)},{path:"tournament-edit/:id",component:X},{path:"tournament-detail/:id",component:Y},{path:"match-detail/:id",component:L},{path:"user-detail/:id",component:(ae=function(){function e(t,n,a,r,i){_classCallCheck(this,e),this.tournamentService=t,this.userService=n,this.storage=a,this.route=r,this.firestore=i,this.tournaments=[]}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.route.params.subscribe((function(t){e.userId=t.id})),this.tournamentService.getUser(this.userId).subscribe((function(t){e.user=Object.assign({id:t.payload.id},t.payload.data())}))}},{key:"onFileSelected",value:function(e){var t=this,n=Date.now(),a=e.target.files[0],r=this.storage.ref("RoomsImages/".concat(n));this.storage.upload("RoomsImages/".concat(n),a).snapshotChanges().pipe(Object(l.a)((function(){t.downloadURL=r.getDownloadURL(),t.downloadURL.subscribe((function(e){e&&(t.fb=e),console.log(t.fb)}))}))).subscribe((function(e){e&&console.log(e)}))}},{key:"onSubmit",value:function(){console.log(this.formTournament.value),this.formTournament.value.banner="https://firebasestorage.googleapis.com/v0/b/tournament-62907.appspot.com/o/RoomsImages%2F1601405964819?alt=media&token=c903c131-4493-4daa-a7c7-ee54a35b6196",this.tournamentService.editTournament(this.singleItem.id,this.formTournament.value).then((function(e){console.log(e)}))}}]),e}(),ae.\u0275fac=function(e){return new(e||ae)(s.Qb(c.a),s.Qb(C.a),s.Qb(u.a),s.Qb(a.a),s.Qb(P.a))},ae.\u0275cmp=s.Kb({type:ae,selectors:[["app-dashboard"]],decls:42,vars:7,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-11"],[1,"card"],[1,"card-header","card-header-rose","card-header-icon"],[1,"card-icon"],[1,"material-icons"],[1,"card-title"],[1,"card-body"],["class","col-6",4,"ngFor","ngForOf"],[1,"col-12","mx-4"],[1,"col-6"],[1,"card","card-stats"],[1,"card-header","card-header-success","card-header-icon"],[1,"card-title",3,"routerLink"],[1,"card-footer"],[1,"stats"]],template:function(e,t){1&e&&(s.Wb(0,"div",0),s.Wb(1,"div",1),s.Wb(2,"div",2),s.Wb(3,"div",3),s.Wb(4,"div",4),s.Wb(5,"div",5),s.Wb(6,"div",6),s.Wb(7,"i",7),s.Ic(8,"person"),s.Vb(),s.Vb(),s.Wb(9,"h4",8),s.Ic(10,"Player Details"),s.Vb(),s.Vb(),s.Wb(11,"div",9),s.Wb(12,"div",2),s.Gc(13,ne,13,5,"div",10),s.Vb(),s.Wb(14,"div",11),s.Wb(15,"div",2),s.Wb(16,"h3",12),s.Wb(17,"strong"),s.Ic(18,"First Name:"),s.Vb(),s.Ic(19),s.Vb(),s.Wb(20,"h3",12),s.Wb(21,"strong"),s.Ic(22,"Last Name:"),s.Vb(),s.Ic(23),s.Vb(),s.Vb(),s.Wb(24,"div",2),s.Wb(25,"h3",12),s.Wb(26,"strong"),s.Ic(27,"Email:"),s.Vb(),s.Ic(28),s.Vb(),s.Wb(29,"h3",12),s.Wb(30,"strong"),s.Ic(31,"PSN Username:"),s.Vb(),s.Ic(32),s.Vb(),s.Vb(),s.Wb(33,"div",2),s.Wb(34,"h3",12),s.Wb(35,"strong"),s.Ic(36,"Phone Number:"),s.Vb(),s.Ic(37),s.Vb(),s.Wb(38,"h3",12),s.Wb(39,"strong"),s.Ic(40,"Password:"),s.Vb(),s.Ic(41),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb(),s.Vb()),2&e&&(s.Db(13),s.oc("ngForOf",t.userData),s.Db(6),s.Kc(" \xa0",t.user.firstName,""),s.Db(4),s.Kc(" \xa0",t.user.lastName,""),s.Db(5),s.Kc(" \xa0",t.user.email,""),s.Db(4),s.Kc(" \xa0",t.user.psnName,""),s.Db(5),s.Kc(" \xa0",t.user.phoneNumber,""),s.Db(4),s.Kc(" \xa0",t.user.password,""))},directives:[r.l,a.g],encapsulation:2}),ae)}]}];n.d(t,"DashboardModule",(function(){return be}));var oe,be=((oe=function e(){_classCallCheck(this,e)}).\u0275mod=s.Ob({type:oe}),oe.\u0275inj=s.Nb({factory:function(e){return new(e||oe)},imports:[[r.c,a.j.forChild(ie),i.j,o.a,b.b]]}),oe)},ip79:function(e,t){}}]); | 61,917 | 61,917 | 0.6797 |
d90f30123eeed7177e122bf0ba04a137546542db | 439 | js | JavaScript | commands/core.js | miezbot/botrpl2 | 3c42d4c88f5a0d6c0d92d685e9263ff881e553fd | [
"MIT"
] | 2 | 2020-08-27T20:09:14.000Z | 2021-07-19T01:25:13.000Z | commands/core.js | miezbot/botrpl2 | 3c42d4c88f5a0d6c0d92d685e9263ff881e553fd | [
"MIT"
] | null | null | null | commands/core.js | miezbot/botrpl2 | 3c42d4c88f5a0d6c0d92d685e9263ff881e553fd | [
"MIT"
] | 1 | 2020-07-29T06:23:01.000Z | 2020-07-29T06:23:01.000Z | const Discord = require('discord.js');
module.exports.run = async (bot, message, args) => {
let embed = new Discord.RichEmbed()
.setTitle("Core")
.setDescription("There are currently 2 commands in this category.")
.addField("`t!help`", "Providesa list of available commands.")
.addField("`t!info`", "Provide information about the bot.")
message.channel.send(embed)
}
module.exports.help = {
name: "core"
} | 31.357143 | 71 | 0.66287 |
d90f4d59358b072d6ab6ff7ab906da0253e4bbc8 | 1,531 | js | JavaScript | tower-defense/src/UserInput/mouse.js | stormhaul/stormhaul.github.io | a649a2f8948b24f6484f80306261e2882de0e163 | [
"MIT"
] | null | null | null | tower-defense/src/UserInput/mouse.js | stormhaul/stormhaul.github.io | a649a2f8948b24f6484f80306261e2882de0e163 | [
"MIT"
] | 4 | 2019-01-17T06:15:56.000Z | 2019-07-19T16:05:39.000Z | tower-defense/src/UserInput/mouse.js | stormhaul/stormhaul.github.io | a649a2f8948b24f6484f80306261e2882de0e163 | [
"MIT"
] | null | null | null | "use strict";
const LEFTCLICK = 1;
const MIDDLECLICK = 2;
const RIGHTCLICK = 3;
function Mouse(camera) {
let that = this;
this.clickConstants = {};
this.clickConstants[LEFTCLICK] = 1;
this.clickConstants[MIDDLECLICK] = 2;
this.clickConstants[RIGHTCLICK] = 3;
document.addEventListener("mouseup", function(e) {
switch(e.which) {
case LEFTCLICK:
console.log("left click up");
break;
case MIDDLECLICK:
console.log("middle click up");
break;
case RIGHTCLICK:
console.log("right click up");
break;
default:
console.log("Unknown mouse button: " + e.which);
}
});
document.addEventListener("mousedown", function(e) {
switch(e.which) {
case LEFTCLICK:
console.log("left click down");
break;
case MIDDLECLICK:
console.log("middle click down");
break;
case RIGHTCLICK:
console.log("right click down");
break;
default:
console.log("Unknown mouse button: " + e.which);
}
});
document.addEventListener("dblclick", function(e) {
console.log(e);
});
document.addEventListener("wheel", function(e) {
console.log(e);
camera.zoom(e.deltaY);
});
document.oncontextmenu = function() {
return false;
}
}
| 27.339286 | 64 | 0.516003 |
d90fa192593d0a3c6969f4667873a551f5a13fed | 2,022 | js | JavaScript | media/js/admin/group.js | DasLab/django-Daslab-server | 836f9df04692b3632ef98cc70dce85e3e97de66a | [
"BSD-Source-Code"
] | 1 | 2016-10-27T13:58:42.000Z | 2016-10-27T13:58:42.000Z | media/js/admin/group.js | t47io/django-Daslab-server | 872cc3d2b586bbe64e01cd1fe0fdbb31618c33b8 | [
"BSD-Source-Code"
] | 3 | 2020-02-11T23:44:05.000Z | 2021-06-10T19:13:57.000Z | media/js/admin/group.js | t47io/django-Daslab-server | 872cc3d2b586bbe64e01cd1fe0fdbb31618c33b8 | [
"BSD-Source-Code"
] | 2 | 2017-06-23T05:44:32.000Z | 2019-05-06T03:18:47.000Z | $.ajax({
url : "/admin/dash/group/",
dataType: "json",
success: function (data) {
var html = '<table class="table table-hover"><thead><tr class="active"><th class="col-lg-3 col-md-3 col-sm-3 col-xs-3"><span class="glyphicon glyphicon-th-list"></span> Group</th><th class="col-lg-9 col-md-9 col-sm-9 col-xs-9"><span class="glyphicon glyphicon-credit-card"></span> SUNet IDs</th></tr></thead><tbody><tr><td><span class="label label-violet"><span class="glyphicon glyphicon-king"></span> Administrator</span></td><td>';
for (var i = 0; i < data.admin.length; i++) {
html += '<kbd>' + data.admin[i] + '</kbd> ';
}
html += '</td></tr><tr class="active"><td><span class="label label-green"><span class="glyphicon glyphicon-queen"></span> Current Member</span></td><td>';
for (var i = 0; i < data.group.length; i++) {
html += '<kbd>' + data.group[i] + '</kbd> ';
}
html += '</td></tr><tr><td><span class="label label-info"><span class="glyphicon glyphicon-pawn"></span> Alumni Member</span></td><td>';
for (var i = 0; i < data.alumni.length; i++) {
html += '<kbd>' + data.alumni[i] + '</kbd> ';
}
html += '</td></tr><tr class="active"><td><span class="label label-orange"><span class="glyphicon glyphicon-bishop"></span> Rotation Student</span></td><td>';
for (var i = 0; i < data.roton.length; i++) {
html += '<kbd>' + data.roton[i] + '</kbd> ';
}
html += '</td></tr><tr><td><span class="label label-magenta"><span class="glyphicon glyphicon-knight"></span> Visitor</span></td><td>';
for (var i = 0; i < data.other.length; i++) {
html += '<kbd>' + data.other[i] + '</kbd> ';
}
html += '</td></tr><tr><td colspan="2" style="padding: 0px;"></td></tr></tbody></table>';
$("#changelist-form").append($(html));
}
});
| 65.225806 | 475 | 0.555885 |
d90fe9d561eb6d79ddbf7f059d94984785b85a37 | 7,466 | js | JavaScript | src/index.js | icebob/moleculer-io | 1e313e35e60a0cc7d227bbd84695fc576fd17853 | [
"MIT"
] | null | null | null | src/index.js | icebob/moleculer-io | 1e313e35e60a0cc7d227bbd84695fc576fd17853 | [
"MIT"
] | null | null | null | src/index.js | icebob/moleculer-io | 1e313e35e60a0cc7d227bbd84695fc576fd17853 | [
"MIT"
] | null | null | null | const IO = require('socket.io')
const debug = require('debug')('moleculer-io')
const _ = require('lodash')
const nanomatch = require('nanomatch')
const { ServiceNotFoundError } = require("moleculer").Errors;
const { Context } = require('moleculer')
const { BadRequestError } = require('./errors')
module.exports = {
name:'io',
settings:{
// port: 3000,
// options: {}, //socket.io options
namespaces: {
'/':{
// middlewares:[],
// packetMiddlewares:[],
events:{
'call':{
// whitelist: [],
// callOptions:{},
// before: async function(ctx, socket, args){
// debug('before hook:', args)
// },
// after:async function(ctx, socket, res){
// debug('after hook', res)
// }
}
}
}
}
},
created(){
this.handlers = {} //
let namespaces = this.settings.namespaces
for(let nsp in namespaces){
let item = namespaces[nsp]
debug('Add route:', item)
if(!this.handlers[nsp]) this.handlers[nsp] = {}
let events = item.events
for(let event in events){
let handlerItem = events[event]
if(typeof handlerItem === 'function'){ //custom handler
this.handlers[nsp][event] = handlerItem
return
}
this.handlers[nsp][event] = this.makeHandler(handlerItem)
// switch (handlerItem.type || 'call') {
// case 'call':
// this.handlers[nsp][event] = this.makeHandler(handlerItem)
// break
// case 'login':
// this.handlers[nsp][event] = this.makeLoginHandler(handlerItem)
// break
// default:
// throw new Error(`Unknow handler type: ${handlerItem.type}`)
// }
}
}
},
methods: {
initServer(srv, opts){
if ('object' == typeof srv && srv instanceof Object && !srv.listen) {
opts = srv;
srv = null;
}
opts = opts || this.settings.options
srv = srv || this.settings.port
this.io = new IO(srv, opts)
},
checkWhitelist(action, whitelist) {
return whitelist.find(mask => {
if (_.isString(mask)) {
return nanomatch.isMatch(action, mask, { unixify: false })
}
else if (_.isRegExp(mask)) {
return mask.test(action)
}
}) != null
},
async callAction(socket, action, params, opts, handlerItem){
//check whitelist
if(!_.isString(action)){
debug(`BadRequest:action is not string! action:`,action)
throw new BadRequestError()
}
if(handlerItem.whitelist && !this.checkWhitelist(action, handlerItem.whitelist)){
debug(`Service "${action}" not found`)
throw new ServiceNotFoundError(action)
}
let meta = this.getMeta(socket)
opts = _.assign({meta},opts)
debug('Call action:', action, params, opts)
const vName = this.version ? `v${this.version}.${this.name}` : this.name
const ctx = Context.create(this.broker, {name: vName + ".call"}, this.broker.nodeID, params, opts || {})
let args = { action, params, callOptions:opts }
if(handlerItem.before){
await handlerItem.before.call(this, ctx, socket, args)
}
let res = await ctx.call(args.action, args.params, args.callOptions)
if(handlerItem.after){
await handlerItem.after.call(this, ctx, socket, res)
}
socket.client.user = ctx.meta.$user
if(ctx.meta.$join){
await this.joinRooms(socket, ctx.meta.$join)
}
if(ctx.meta.$leave){
if(_.isArray(ctx.meta.$leave)){
await Promise.all(ctx.meta.$leave.map(room=>this.leaveRoom(socket, room)))
}else{
await this.leaveRoom(socket, ctx.meta.$leave)
}
}
return res
},
makeHandler:function(handlerItem){
let whitelist = handlerItem.whitelist
let opts = handlerItem.callOptions
const svc = this
debug('MakeHandler', handlerItem)
return async function(action, params, respond){
debug(`Call action: `,action)
if(_.isFunction(params)){
respond = params
params = null
}
try{
let res = await svc.callAction(this, action, params, opts, handlerItem)
if(_.isFunction(respond)) respond(null, res)
}catch(err){
debug('Call action error:',err)
if(_.isFunction(respond)) svc.onError(err, respond)
}
}
},
// makeLoginHandler:function(handlerItem){
// let handler = this.makeHandler(handlerItem)
// return async function(action, params, respond){
// let socket = this
// handler.call(socket, action, params, (err, res)=>{
// if(err) return respond(err)
// socket.client.user = res
// respond(err,res)
// })
// }
// },
getMeta(socket){
let meta = {
$user: socket.client.user,
$rooms: Object.keys(socket.rooms)
}
debug('getMeta', meta)
return meta
},
onError(err, respond){
debug('onError',err)
const errObj = _.pick(err, ["name", "message", "code", "type", "data"]);
return respond(errObj)
},
joinRooms(socket, rooms){
debug(`socket ${socket.id} join room:`, rooms)
return new Promise(function(resolve, reject) {
socket.join(rooms,err=>{
if(err){
reject(err)
} else {
resolve()
}
})
})
},
leaveRoom(socket, room){
return new Promise(function(resolve, reject) {
socket.leave(room,err=>{
if(err){
reject(err)
} else {
resolve()
}
})
})
},
},
started(){
if(!this.io){
this.initServer()
}
let namespaces = this.settings.namespaces
for(let nsp in namespaces){
let item = namespaces[nsp]
let namespace = this.io.of(nsp)
if(item.middlewares){ //Server middlewares
for(let middleware of item.middlewares){
namespace.use(middleware)
}
}
let handlers = this.handlers[nsp]
namespace.on('connection', socket=>{
this.logger.info(`(nsp:'${nsp}') Client connected:`,socket.id)
if(item.packetMiddlewares){ //socketmiddlewares
for(let middleware of item.packetMiddlewares){
socket.use(middleware)
}
}
for(let eventName in handlers){
debug('Attach event:', eventName)
socket.on(eventName, handlers[eventName])
}
})
}
},
actions: {
broadcast:{
params:{
event: { type:'string' },
namespace:{ type:'string', optional:true},
args: { type:'array',optional:true},
volatile: { type: 'boolean',optional:true},
local: { type:'boolean',optional:true},
rooms: { type:'array', items: 'string',optional:true}
},
async handler(ctx){
let namespace = this.io
if(ctx.params.namespace){
namespace = namespace.of(ctx.params.namespace)
}
if(ctx.params.volate) namespace = namespace.volate
if(ctx.params.local) namespace = namespace.local
if(ctx.params.rooms){
for(let room of ctx.params.rooms){
namespace = namespace.to(room)
}
}
namespace.emit(event,...ctx.params.args)
}
}
}
}
| 31.108333 | 110 | 0.553442 |
d910da780257af62f00079ec08077d3468070ad6 | 293 | js | JavaScript | src/api/safety/pxTroubleshoot.js | Morke-Mhr/jxlq | d2be6312e0e9e43d89b05cf9f2c9e6572b4e55a3 | [
"MIT"
] | null | null | null | src/api/safety/pxTroubleshoot.js | Morke-Mhr/jxlq | d2be6312e0e9e43d89b05cf9f2c9e6572b4e55a3 | [
"MIT"
] | null | null | null | src/api/safety/pxTroubleshoot.js | Morke-Mhr/jxlq | d2be6312e0e9e43d89b05cf9f2c9e6572b4e55a3 | [
"MIT"
] | null | null | null | import request from '@/utils/request'
import store from '@/store'
const serviceName = store.state.serviceName.safetyEdu
// 培训统计
export function getStudyData(value) {
return request({
url: serviceName + `/trainDemand/trainStatisticsList?queryYear=${value}`,
method: 'get'
})
}
| 18.3125 | 77 | 0.716724 |
d911b7ef4fff49a96908a7bf778a772b67017223 | 10,457 | js | JavaScript | app-assets/js/myApp.js | anugool/she | 47f98ca6277985e7448fc5b1003c80c9a601ec10 | [
"MIT"
] | null | null | null | app-assets/js/myApp.js | anugool/she | 47f98ca6277985e7448fc5b1003c80c9a601ec10 | [
"MIT"
] | null | null | null | app-assets/js/myApp.js | anugool/she | 47f98ca6277985e7448fc5b1003c80c9a601ec10 | [
"MIT"
] | null | null | null | var app = angular.module("myApp", ['ngRoute']);
app.run(function ($location, $rootScope, $route) {
$rootScope.$on('$locationChangeStart', function () {
var nextPath = $location.path(),
nextRoute = $route.routes[nextPath];
//$log.info(nextRoute);
if (nextRoute && nextRoute.auth && !sessionStorage.id) {
$location.path("/");
} /*else if (sessionStorage.id !== undefined && $location.path() == "/") {
$location.path("/quiz");
}*/ else if (sessionStorage.id !== undefined && $location.path() == "/quiz" && sessionStorage.status !== "no_package") {
$location.path("/account");
} else if (sessionStorage.id !== undefined && $location.path() == "/login") {
$location.path("/quiz");
} else if (sessionStorage.id !== undefined && $location.path() !== "/quiz" && sessionStorage.status == "no_package") {
$location.path("/quiz");
}
});
});
app.controller("myCtrl", function ($scope, $timeout, $http, $window, $location) {
$scope.province = ["กระบี่", "กรุงเทพมหานคร", "กาญจนบุรี", "กาฬสินธุ์", "กำแพงเพชร", "ขอนแก่น", "จันทบุรี", "ฉะเชิงเทรา", "ชลบุรี", "ชัยนาท", "ชัยภูมิ", "ชุมพร", "เชียงราย", "เชียงใหม่", "ตรัง", "ตราด", "ตาก", "นครนายก", "นครปฐม", "นครพนม", "นครราชสีมา", "นครศรีธรรมราช", "นครสวรรค์", "นนทบุรี", "นราธิวาส", "น่าน", "บุรีรัมย์", "ปทุมธานี", "ประจวบคีรีขันธ์", "ปราจีนบุรี", "ปัตตานี", "พะเยา", "พังงา", "พัทลุง", "พิจิตร", "พิษณุโลก", "เพชรบุรี", "เพชรบูรณ์", "แพร่", "ภูเก็ต", "มหาสารคาม", "มุกดาหาร", "แม่ฮ่องสอน", "ยโสธร", "ยะลา", "ร้อยเอ็ด", "ระนอง", "ระยอง", "ราชบุรี", "ลพบุรี", "ลำปาง", "ลำพูน", "เลย", "ศรีสะเกษ", "สกลนคร", "สงขลา", "สตูล", "สมุทรปราการ", "สมุทรสงคราม", "สมุทรสาคร", "สระแก้ว", "สระบุรี", "สิงห์บุรี", "สุโขทัย", "สุพรรณบุรี", "สุราษฎร์ธานี", "สุรินทร์", "หนองคาย", "หนองบัวลำภู", "อยุธยา", "อ่างทอง", "อำนาจเจริญ", "อุดรธานี", "อุตรดิตถ์", "อุทัยธานี", "อุบลราชธานี"];
$scope.message = ""
$scope.updateProfile = function () {
$scope.dataquiz2 = []
$scope.dataquiz2.push({
cs_id: sessionStorage.id,
firstName: $scope.get_detail_cus.cs_fname,
lastName: $scope.get_detail_cus.cs_lname,
age: $scope.get_detail_cus.cs_age,
sex: $scope.sex.name,
tel: $scope.get_detail_cus.cs_tel,
houseno: $scope.get_detail_cus.cs_house_no,
vaillageorbuilding: $scope.get_detail_cus.cs_buliding,
alleyway: $scope.get_detail_cus.cs_soi,
road: $scope.get_detail_cus.cs_road,
subdistric: $scope.get_detail_cus.cs_sub_district,
distric: $scope.get_detail_cus.cs_district,
provinceTh: $scope.get_detail_cus.cs_province,
postcode: $scope.get_detail_cus.cs_zipcode,
budget: $scope.budget.name,
});
sessionStorage.setItem('fname', $scope.get_detail_cus.cs_fname);
console.log($scope.dataquiz2)
$http({
method: "post",
url: base_url + 'home/update_cs',
data: $scope.dataquiz2,
}).then(function (response) {
if (response.data == "true") {
$scope.fnamenav = sessionStorage.fname;
swal({
title: 'แก้ไขข้อมูลสำเร็จ',
confirmButtonText: 'ตกลง'
}).then((result) => {
if (result.value) {
$window.location.href = base_url;
}
})
} else {
swal({
title: 'แก้ไขข้อมูลไม่สำเร็จ',
type: 'warning',
confirmButtonText: 'ตกลง'
})
}
}, function (response) {
console.error(response);
});
}
$scope.checknavbar = function () {
console.log(sessionStorage.id)
console.log(sessionStorage.status)
$scope.headerQuiz = true;
$scope.headerAccount = true;
}
$scope.getProfile = function () {
console.log(sessionStorage.id)
$http({
method: "post",
data: sessionStorage.id,
url: base_url + 'Managecustomer/fontdetailcustomer',
}).then(function (response) {
console.log("sssss", response.data.get_detail_cus.cs_gender)
$scope.get_detail_cus = response.data.get_detail_cus
$scope.get_skin_cus = response.data.get_skin_cus
$scope.get_makeup_cus = response.data.get_makeup_cus
$scope.sex = {
name: response.data.get_detail_cus.cs_gender
};
$scope.budget = {
name: response.data.get_detail_cus.cs_budget
};
console.log($scope.get_detail_cus)
console.log($scope.get_skin_cus)
console.log($scope.get_makeup_cus)
}, function (response) {
console.error(response);
});
}
$scope.getPackage = function () {
$scope.allPackage = []
$http({
method: "GET",
url: base_url + 'Package/getall',
}).then(function (response) {
console.log(response.data)
$scope.allPackage = response.data
});
}
$scope.packageid = 0;
$scope.packagename = "";
$scope.packageprice = 0;
$scope.packagevat = 0;
$scope.totalprice = 0;
$scope.codefree = "";
$scope.discount = "ไม่ได้รับส่วนลด";
$scope.CheckPackageFree = function (CodeFreeCheck) {
$scope.code = []
$scope.code.push({
code: CodeFreeCheck,
});
console.log("66666", $scope.code)
$http({
method: "post",
url: base_url + 'Promotioncode/submit_code',
data: $scope.code,
}).then(function (response) {
console.log("asassa", response)
if (response.data == "true") {
$scope.totalprice = 0;
$scope.discount = "ได้รับส่วนลด";
$scope.codefree = CodeFreeCheck;
swal({
type: 'success',
title: 'คุณได้รับส่วนลดแล้ว',
})
} else {
swal({
title: 'รหัสคูปองส่วนลดไม่ถูกต้อง',
type: 'error',
confirmButtonText: 'ตกลง'
})
}
}, function (response) {
console.error("error", response);
});
}
$scope.totalprice = 0
$scope.CheckPackage = function (event, package_name, package_price, package_des) {
$scope.packageid = event.target.value;
$scope.packagename = package_name;
$scope.packageprice = package_price;
$scope.packagevat = Math.ceil(package_price * 0.07);
$scope.totalprice = parseInt(package_price, 10) + parseInt($scope.packagevat, 10)
}
$scope.Payment = "โอนเงินผ่านธนาคาร"
$scope.today = new Date();
$scope.addpackageCS = function (Payment) {
$scope.datapackage = []
$scope.datapackage.push({
cs_id: sessionStorage.id,
package_id: $scope.packageid,
firstName: $scope.get_detail_cus.cs_fname,
lastName: $scope.get_detail_cus.cs_lname,
email: $scope.get_detail_cus.cs_email,
houseno: $scope.get_detail_cus.cs_house_no,
vaillageorbuilding: $scope.get_detail_cus.cs_buliding,
alleyway: $scope.get_detail_cus.cs_soi,
road: $scope.get_detail_cus.cs_road,
subdistric: $scope.get_detail_cus.cs_sub_district,
distric: $scope.get_detail_cus.cs_district,
provinceTh: $scope.get_detail_cus.cs_province,
postcode: $scope.get_detail_cus.cs_zipcode,
payment: Payment,
totalprice: $scope.totalprice,
codefree: $scope.codefree
})
console.log($scope.datapackage)
if ($scope.discount == "ได้รับส่วนลด") {
$http({
method: "post",
url: base_url + 'order/insert_free',
data: $scope.datapackage,
}).then(function (response) {
console.log(response.data)
});
} else if ($scope.discount == "ไม่ได้รับส่วนลด") {
console.log("ไม่ได้รับส่วนลด")
$http({
method: "post",
url: base_url + 'order/insert_nofree',
data: $scope.datapackage,
}).then(function (response) {
console.log(response.data)
});
}
}
$scope.View1 = true;
$scope.loginview = function () {
console.log("loginview")
console.log("viewregister")
$location.path("/login");
$scope.View1 = true
$scope.View3 = false
}
$scope.viewregister = function () {
console.log("viewregister")
$location.path("/login");
$scope.View3 = true
$scope.View1 = false
}
$scope.checkmunu = function () {
if ($location.path() == "/" && sessionStorage.id == undefined && $location.url() !== "/#slider") {
swal({
imageUrl: 'app-assets/images/Asset.png',
imageAlt: 'Custom image',
customClass: 'swal-wide',
confirmButtonColor: '#fdc50c',
confirmButtonText: 'สมัครสมาชิก',
animation: true,
showCloseButton: true,
}).then((result) => {
if (result.value) {
$window.location.href = base_url + '#!/login';
}
})
}
//console.log(sessionStorage.id)
if (sessionStorage.id == undefined) {
$scope.loginmenu = false
$scope.logoutmenu = true
} else {
$scope.loginmenu = true
$scope.logoutmenu = false
}
}
$scope.orderaccount = function () {
console.log(sessionStorage.id)
$http({
method: "post",
url: base_url + 'Myaccount/getaccountorder',
data: sessionStorage.id,
}).then(function (response) {
console.log("Get order account", response.data)
$scope.order_fullname = response.data[0].cs_fname + " " + response.data[0].cs_lname
$scope.order_tel = response.data[0].cs_tel
$scope.order_no = response.data[0].order_no
$scope.order_id = response.data[0].order_id
});
}
$scope.confirm_payment = function (order_fullname, order_tel, order_no, order_pay, order_date, order_time, imagename) {
$scope.data_confirm = []
$scope.data_confirm.push({
cs_id: sessionStorage.id,
order_id: $scope.order_id,
order_fullname: order_fullname,
order_tel: order_tel,
order_no: order_no,
order_pay: order_pay,
order_date: order_date,
order_time: order_time,
order_image: imagename,
bank_id: "1",
})
console.log($scope.data_confirm)
$http({
method: "post",
url: base_url + 'payment/insert_payment',
data: $scope.data_confirm
}).then(function (response) {
console.log(response.data)
swal({
title: 'ขอบคุณสำหรับการชำระเงิน รอตรวจสอบข้อมูลใน Email ของท่าน',
confirmButtonText: 'ตกลง'
})
});
}
$scope.uploadFile = function (order_fullname, order_tel, order_no, order_pay, order_date, order_time, files) {
var form_data = new FormData();
angular.forEach(files, function (file) {
form_data.append('file', file);
});
console.log("6666", form_data)
$http.post(base_url + 'payment/uploads_slips',
form_data,
{
transformRequest: angular.identity,
headers: { 'Content-Type': undefined, 'Process-Data': false }
}).then(function (response) {
console.log(response.data.slips);
if (response.data == false) {
console.log("error")
} else {
imagename = response.data.slips
$scope.confirm_payment(order_fullname, order_tel, order_no, order_pay, order_date, order_time, imagename)
}
});
}
});
app.directive("fileInput", function ($parse) {
return {
link: function ($scope, element, attrs) {
element.on("change", function (event) {
var files = event.target.files;
//console.log(files[0].name);
$parse(attrs.fileInput).assign($scope, element[0].files);
$scope.$apply();
});
}
}
});
| 30.755882 | 895 | 0.650091 |
d91219df73551c8860e0eaa74f51fd654dede36a | 446 | js | JavaScript | assets/lecture-01/examples/example-1/js/app.js | nbilalis/WMNWA-2110-React | 57f9fd46273847ff32a15063eee29a218af24b7c | [
"MIT"
] | null | null | null | assets/lecture-01/examples/example-1/js/app.js | nbilalis/WMNWA-2110-React | 57f9fd46273847ff32a15063eee29a218af24b7c | [
"MIT"
] | null | null | null | assets/lecture-01/examples/example-1/js/app.js | nbilalis/WMNWA-2110-React | 57f9fd46273847ff32a15063eee29a218af24b7c | [
"MIT"
] | null | null | null | // Create & render some elements
// React.createElement(element, properties, child(ren))
const h1 = React.createElement('h1', { id: 'main-title', key: 'h1' }, 'Hello, humans!');
const h2 = React.createElement('h2', { className: 'secondary-title', key: 'h2' }, 'Greetings from React!');
// Log them to study their structure
console.log({h1, h2});
// Render them inside the 'root' div
ReactDOM.render([h1, h2], document.getElementById('root'));
| 37.166667 | 107 | 0.686099 |
d9124385d561cc67c93637d0185824d6e83e2a55 | 307 | js | JavaScript | packages/utils/src/index.test.js | ncarrascoglb/hig | 71478dfb22e55690d0aea755f0af29d7d0538174 | [
"Apache-2.0"
] | null | null | null | packages/utils/src/index.test.js | ncarrascoglb/hig | 71478dfb22e55690d0aea755f0af29d7d0538174 | [
"Apache-2.0"
] | null | null | null | packages/utils/src/index.test.js | ncarrascoglb/hig | 71478dfb22e55690d0aea755f0af29d7d0538174 | [
"Apache-2.0"
] | 1 | 2018-09-20T22:51:59.000Z | 2018-09-20T22:51:59.000Z | import * as index from ".";
describe("utils/index", () => {
it(`exports combineEventHandlers`, () => {
expect(index).toHaveProperty("combineEventHandlers", expect.any(Function));
});
it(`exports generateId`, () => {
expect(index).toHaveProperty("generateId", expect.any(Function));
});
});
| 27.909091 | 79 | 0.641694 |
d9127d135b04014e613b406bcd8efa57af2d3f9b | 16,703 | js | JavaScript | www/registration-registration-module.js | habibulla4455/ChatApp | d6123690dcf37b4702425c5ca36a0ef24d2e5382 | [
"MIT"
] | 1 | 2019-04-04T14:12:10.000Z | 2019-04-04T14:12:10.000Z | www/registration-registration-module.js | habibulla4455/ChatApp | d6123690dcf37b4702425c5ca36a0ef24d2e5382 | [
"MIT"
] | null | null | null | www/registration-registration-module.js | habibulla4455/ChatApp | d6123690dcf37b4702425c5ca36a0ef24d2e5382 | [
"MIT"
] | null | null | null | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["registration-registration-module"],{
/***/ "./src/app/landing-page/registration/registration-routing.module.ts":
/*!**************************************************************************!*\
!*** ./src/app/landing-page/registration/registration-routing.module.ts ***!
\**************************************************************************/
/*! exports provided: RegistrationRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegistrationRoutingModule", function() { return RegistrationRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _registration_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./registration.component */ "./src/app/landing-page/registration/registration.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var routes = [
{ path: '', component: _registration_component__WEBPACK_IMPORTED_MODULE_2__["RegistrationComponent"] }
];
var RegistrationRoutingModule = /** @class */ (function () {
function RegistrationRoutingModule() {
}
RegistrationRoutingModule = __decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(routes)],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
})
], RegistrationRoutingModule);
return RegistrationRoutingModule;
}());
/***/ }),
/***/ "./src/app/landing-page/registration/registration.component.html":
/*!***********************************************************************!*\
!*** ./src/app/landing-page/registration/registration.component.html ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div id=\"container\">\n\n <mat-card>\n <mat-card-content>\n\n <div>\n <p id=\"header\">Registration</p>\n </div>\n\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"signupForm\">\n <mat-form-field color=\"accent\">\n <mat-label>Email</mat-label>\n <input matInput type=\"text\" formControlName=\"email\">\n <mat-error *ngIf=\"signupForm.get('email').invalid\">\n <mat-error *ngIf=\"email.required\">This is required.</mat-error>\n <mat-error *ngIf=\"email.pattern\">Not a valid email address.</mat-error>\n </mat-error>\n </mat-form-field>\n <mat-form-field color=\"accent\">\n <mat-label>Password</mat-label>\n <input matInput type=\"password\" formControlName=\"password\">\n <mat-error *ngIf=\"signupForm.get('password').invalid\">\n <mat-error *ngIf=\"password.required\">This is required.</mat-error>\n <mat-error *ngIf=\"password.minlength\">Password too short.</mat-error>\n </mat-error>\n </mat-form-field>\n <mat-form-field color=\"accent\">\n <mat-label>Confirm assword</mat-label>\n <input matInput type=\"password\" formControlName=\"confirm\">\n <mat-error *ngIf=\"signupForm.get('confirm').invalid\">\n <mat-error *ngIf=\"confirm.isNotMatched\">Password not matched.</mat-error>\n </mat-error>\n </mat-form-field>\n <mat-form-field color=\"accent\">\n <mat-label>Display name</mat-label>\n <input matInput type=\"text\" formControlName=\"display\">\n <mat-error *ngIf=\"signupForm.get('display').invalid\">\n <mat-error *ngIf=\"display.required\">This is required.</mat-error>\n <mat-error *ngIf=\"display.minlength\">Display name too short.</mat-error>\n <mat-error *ngIf=\"display.containsAlpha && !display.containsNone\">Must contain atleast 1 lowercase character.</mat-error>\n </mat-error>\n </mat-form-field>\n\n <button mat-raised-button>CREATE ACCOUNT</button>\n </form>\n\n </mat-card-content>\n <mat-card-footer *ngIf=\"isSigningin\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-footer>\n </mat-card>\n\n</div>\n"
/***/ }),
/***/ "./src/app/landing-page/registration/registration.component.scss":
/*!***********************************************************************!*\
!*** ./src/app/landing-page/registration/registration.component.scss ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "#container {\n display: flex;\n height: 100vh; }\n #container .mat-card {\n width: 80vw;\n margin: 20vh auto auto;\n padding-bottom: 0; }\n #container .mat-card #header {\n font-size: 2em;\n margin-bottom: 10px; }\n #container .mat-card .mat-form-field {\n width: 100%; }\n #container .mat-card .mat-raised-button {\n float: right;\n margin-bottom: 24px; }\n"
/***/ }),
/***/ "./src/app/landing-page/registration/registration.component.ts":
/*!*********************************************************************!*\
!*** ./src/app/landing-page/registration/registration.component.ts ***!
\*********************************************************************/
/*! exports provided: RegistrationComponent, CustomValidator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegistrationComponent", function() { return RegistrationComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomValidator", function() { return CustomValidator; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _common_core_services_firestore_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/services/firestore.service */ "./src/app/common/core/services/firestore.service.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var EMAILPATTERN = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var RegistrationComponent = /** @class */ (function () {
function RegistrationComponent(fb, firestoreService) {
this.fb = fb;
this.firestoreService = firestoreService;
// this.signupForm = fb.group({
// 'email': [ 'q@q.com', [ Validators.required, Validators.pattern(EMAILPATTERN), CustomValidator.containsNone ] ],
// 'password': [ '123123', [ Validators.required, Validators.minLength(6), CustomValidator.containsNone ] ],
// 'confirm': [ '123123', [ this.confirmCheck.bind(this), CustomValidator.containsNone ] ],
// 'display': [ 'madara', [ Validators.required, Validators.minLength(6), CustomValidator.containAlpha, CustomValidator.containsNone ] ]
// })
this.signupForm = fb.group({
'email': ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].pattern(EMAILPATTERN), CustomValidator.containsNone]],
'password': ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].minLength(6), CustomValidator.containsNone]],
'confirm': ['', [this.confirmCheck.bind(this), CustomValidator.containsNone]],
'display': ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].required, _angular_forms__WEBPACK_IMPORTED_MODULE_1__["Validators"].minLength(6), CustomValidator.containAlpha, CustomValidator.containsNone]]
});
}
RegistrationComponent.prototype.ngOnInit = function () {
var _this = this;
this.isSigningin = false;
this.current = this.signupForm.value.password;
this.signupForm.valueChanges.subscribe(function (response) {
var password = response.password;
_this.current = password;
});
};
Object.defineProperty(RegistrationComponent.prototype, "email", {
get: function () {
return this.signupForm.get('email').errors;
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegistrationComponent.prototype, "password", {
get: function () {
return this.signupForm.get('password').errors;
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegistrationComponent.prototype, "confirm", {
get: function () {
return this.signupForm.get('confirm').errors;
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegistrationComponent.prototype, "display", {
get: function () {
return this.signupForm.get('display').errors;
},
enumerable: true,
configurable: true
});
RegistrationComponent.prototype.confirmCheck = function (control) {
var condition = control.value === this.current;
return condition ? null : { isNotMatched: true };
};
RegistrationComponent.prototype.onSubmit = function () {
var _this = this;
if (this.signupForm.invalid) {
alert('Input invalid. Please try again.');
return;
}
this.isSigningin = true;
this.firestoreService.createNewUser(this.signupForm.value)
.catch(function (e) {
_this.isSigningin = false;
var email = _this.signupForm.value.email;
_this.signupForm.reset();
_this.signupForm.patchValue({ email: email });
alert(e.message);
});
};
RegistrationComponent = __decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
selector: 'app-registration',
template: __webpack_require__(/*! ./registration.component.html */ "./src/app/landing-page/registration/registration.component.html"),
styles: [__webpack_require__(/*! ./registration.component.scss */ "./src/app/landing-page/registration/registration.component.scss")]
}),
__param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormBuilder"])),
__metadata("design:paramtypes", [_angular_forms__WEBPACK_IMPORTED_MODULE_1__["FormBuilder"], _common_core_services_firestore_service__WEBPACK_IMPORTED_MODULE_2__["FirestoreService"]])
], RegistrationComponent);
return RegistrationComponent;
}());
var CustomValidator = /** @class */ (function () {
function CustomValidator() {
}
CustomValidator.containAlpha = function (control) {
var CONTAIN_LOWERCASE_REGEXP = /[a-z]/;
return CONTAIN_LOWERCASE_REGEXP.test(control.value) ? null : { containsAlpha: true };
};
CustomValidator.containsNone = function (control) {
var condition = String(control.value).length !== 0;
return condition ? null : { containsNone: true };
};
return CustomValidator;
}());
/***/ }),
/***/ "./src/app/landing-page/registration/registration.module.ts":
/*!******************************************************************!*\
!*** ./src/app/landing-page/registration/registration.module.ts ***!
\******************************************************************/
/*! exports provided: RegistrationModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegistrationModule", function() { return RegistrationModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _registration_routing_module__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./registration-routing.module */ "./src/app/landing-page/registration/registration-routing.module.ts");
/* harmony import */ var _common_core_modules_material2_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/modules/material2.module */ "./src/app/common/core/modules/material2.module.ts");
/* harmony import */ var _registration_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./registration.component */ "./src/app/landing-page/registration/registration.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var RegistrationModule = /** @class */ (function () {
function RegistrationModule() {
}
RegistrationModule = __decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"],
_angular_forms__WEBPACK_IMPORTED_MODULE_2__["ReactiveFormsModule"],
_registration_routing_module__WEBPACK_IMPORTED_MODULE_3__["RegistrationRoutingModule"],
_common_core_modules_material2_module__WEBPACK_IMPORTED_MODULE_4__["Material2Module"]
],
declarations: [
_registration_component__WEBPACK_IMPORTED_MODULE_5__["RegistrationComponent"]
],
schemas: [
_angular_core__WEBPACK_IMPORTED_MODULE_0__["CUSTOM_ELEMENTS_SCHEMA"]
]
})
], RegistrationModule);
return RegistrationModule;
}());
/***/ })
}]);
//# sourceMappingURL=registration-registration-module.js.map | 65.501961 | 2,327 | 0.638628 |
d912d2838a43ea63f0ff72cc2aa8266d93d59910 | 896 | js | JavaScript | spectrum-client/htdocs/nonphaserclient.js | rkillionaire/Urban-Pong-Spectrum | a81651cf60502e56cf40c8413b65f9c4d759db66 | [
"MIT"
] | null | null | null | spectrum-client/htdocs/nonphaserclient.js | rkillionaire/Urban-Pong-Spectrum | a81651cf60502e56cf40c8413b65f9c4d759db66 | [
"MIT"
] | null | null | null | spectrum-client/htdocs/nonphaserclient.js | rkillionaire/Urban-Pong-Spectrum | a81651cf60502e56cf40c8413b65f9c4d759db66 | [
"MIT"
] | null | null | null |
var max_color_array_length = 4
var current_color_array = []
function color_click(ev) {
let colorstr = ev.target.attributes["data-color"].value;
let colorarray = [
parseInt(colorstr.slice(0, 2), 16),
parseInt(colorstr.slice(2, 4), 16),
parseInt(colorstr.slice(4, 8), 16),
];
if (current_color_array.length < max_color_array_length) {
current_color_array.push(colorarray);
}
console.log(current_color_array);
}
function send_click(ev) {
// from client.js
sendParticularPulseMessage(current_color_array);
current_color_array.clear();
}
let colorbuttons = document.getElementsByClassName("colorbutton");
for (but of colorbuttons) {
but.style.backgroundColor = `#${but.attributes["data-color"].value}`;
but.addEventListener("click", color_click);
}
let sendbutton = document.querySelector(".sendbutton");
sendbutton.addEventListener("click", send_click);
| 25.6 | 71 | 0.734375 |
d91375720c8b1df4b26edc7f80da6877b615ae43 | 136 | js | JavaScript | app/client/routes/paths.js | brtjkzl/games-tracker | 8435c60d07f924a07262f085f9e87a2ab94d64ae | [
"MIT"
] | 1 | 2019-04-17T06:07:16.000Z | 2019-04-17T06:07:16.000Z | app/client/routes/paths.js | ChangJoo-Park/games-tracker | 8435c60d07f924a07262f085f9e87a2ab94d64ae | [
"MIT"
] | null | null | null | app/client/routes/paths.js | ChangJoo-Park/games-tracker | 8435c60d07f924a07262f085f9e87a2ab94d64ae | [
"MIT"
] | 1 | 2019-04-17T06:07:21.000Z | 2019-04-17T06:07:21.000Z | export const ROOT_PATH = "/";
export const FACEBOOK_AUTH_PATH = "/auth/facebook";
export const PRIVACY_POLICY_PATH = "/privacy-policy";
| 34 | 53 | 0.764706 |
d9140cecf06527525b82399b6a1961d2d236ddbe | 2,558 | js | JavaScript | scripts/sighash-vectors.js | timgates42/mako | 479745a626a7d14112fa135754cac1fc8f84282f | [
"MIT"
] | 522 | 2021-11-15T17:37:08.000Z | 2022-03-28T17:26:23.000Z | scripts/sighash-vectors.js | timgates42/mako | 479745a626a7d14112fa135754cac1fc8f84282f | [
"MIT"
] | 6 | 2021-11-15T19:14:09.000Z | 2021-12-21T20:06:51.000Z | scripts/sighash-vectors.js | timgates42/mako | 479745a626a7d14112fa135754cac1fc8f84282f | [
"MIT"
] | 33 | 2021-11-15T17:37:10.000Z | 2022-02-23T00:37:08.000Z | 'use strict';
const util = require('bcoin/lib/utils/util');
const TX = require('bcoin/lib/primitives/tx');
const Output = require('bcoin/lib/primitives/output');
const Outpoint = require('bcoin/lib/primitives/outpoint');
const Script = require('bcoin/lib/script/script');
const sighashTests = require('bcoin/test/data/sighash-tests.json');
function parseSighashTest(data) {
const [txHex, scriptHex, index, type, hash] = data;
const tx = TX.fromRaw(txHex, 'hex');
const script = Script.fromRaw(scriptHex, 'hex');
const expected = util.fromRev(hash);
return {
tx: tx,
script: script,
index: index,
type: type,
expected: expected,
comments: expected.toString('hex')
};
}
function toBytes(raw, pad) {
const out = [];
for (let i = 0; i < raw.length; i++) {
let ch = raw[i].toString(16);
if (ch.length < 2)
ch = '0' + ch;
ch = '0x' + ch;
out.push(ch);
if (out.length === 8) {
console.log('%s%s', pad, out.join(', ') + ',');
out.length = 0;
}
}
if (out.length > 0) {
console.log('%s%s', pad, out.join(', ') + ',');
out.length = 0;
}
}
console.log(`typedef struct test_sighash_vector_s {
const uint8_t *tx_raw;
size_t tx_len;
const uint8_t *script_raw;
size_t script_len;
size_t index;
int type;
uint8_t expected[32];
const char *comments;
} test_sighash_vector_t;
`);
const tests = [];
for (const json of sighashTests) {
if (json.length === 1)
continue;
tests.push(parseSighashTest(json));
}
for (let i = 0; i < tests.length; i++) {
const test = tests[i];
console.log('static const uint8_t test_sighash_tx_%d[] = {', i);
toBytes(test.tx.toRaw(), ' ');
console.log('};');
console.log('');
console.log('static const uint8_t test_sighash_script_%d[] = {', i);
if (test.script.code.length === 0)
console.log(' 0x00,');
else
toBytes(test.script.toRaw(), ' ');
console.log('};');
console.log('');
}
console.log('static const test_sighash_vector_t test_sighash_vectors[] = {');
for (let i = 0; i < tests.length; i++) {
const test = tests[i];
console.log(' {');
console.log(' test_sighash_tx_%d,', i);
console.log(' %d,', test.tx.getSize());
console.log(' test_sighash_script_%d,', i);
console.log(' %d,', test.script.getSize());
console.log(' %d,', test.index);
console.log(' %d,', test.type);
console.log(' {');
toBytes(test.expected, ' ');
console.log(' },');
console.log(' "%s"', test.comments);
console.log(' },');
}
console.log('};');
| 23.46789 | 77 | 0.602424 |
d914cc2c7de02fe69b9677ebdddfd0c9697b47f7 | 720 | js | JavaScript | client/src/reducers/faq.js | Naji2329/OxCoin-Official-AdminSite | 27dc5482e05a7b23940b4523e67f5d921926e243 | [
"MIT"
] | null | null | null | client/src/reducers/faq.js | Naji2329/OxCoin-Official-AdminSite | 27dc5482e05a7b23940b4523e67f5d921926e243 | [
"MIT"
] | null | null | null | client/src/reducers/faq.js | Naji2329/OxCoin-Official-AdminSite | 27dc5482e05a7b23940b4523e67f5d921926e243 | [
"MIT"
] | null | null | null | import {
GET_FAQS,
FAQ_ERROR,
ADD_FAQ,
DELETE_FAQ
} from '../actions/types';
const initialState = {
faqs: [],
faq: null,
loading: true,
error: {}
};
function faqReducer(state = initialState, action) {
const { type, payload } = action;
switch (type) {
case GET_FAQS:
return {
...state,
faqs: payload,
loading: false
};
case ADD_FAQ:
return {
...state,
faqs: [payload, ...state.faqs],
loading: false
};
case DELETE_FAQ:
return {
...state,
faqs: state.faqs.filter((faq) => faq._id !== payload),
loading: false
};
default:
return state;
}
}
export default faqReducer;
| 16.744186 | 62 | 0.536111 |
d915270cd81a2996ec57c487402593f1d6372fe5 | 2,119 | js | JavaScript | app/src/Component/LoginForm.js | JmPotato/Pobox | 58ede22476638f4f2ff9caabe41794d73ebb295c | [
"MIT"
] | null | null | null | app/src/Component/LoginForm.js | JmPotato/Pobox | 58ede22476638f4f2ff9caabe41794d73ebb295c | [
"MIT"
] | null | null | null | app/src/Component/LoginForm.js | JmPotato/Pobox | 58ede22476638f4f2ff9caabe41794d73ebb295c | [
"MIT"
] | null | null | null | import React, { Component } from "react";
import md5 from "md5";
// Bootstrap
import Button from "react-bootstrap/lib/Button";
import Col from "react-bootstrap/lib/Col";
import Alert from "react-bootstrap/lib/Alert";
import FormGroup from "react-bootstrap/lib/FormGroup";
import FormControl from "react-bootstrap/lib/FormControl";
// Custom CSS
import "./LoginFrom.css";
import Api from "../Logic/Api";
class LoginFrom extends Component {
constructor(props) {
super(props);
this.state = {
error: false
}
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(e) {
e.preventDefault();
const userinfo = {username: this.username, validation: md5(this.username + this.password)};
Api.login(userinfo).then(response => {
if (!response.ok) {
this.setState({ error: true });
return;
}
response.json().then(data => this.props.onLogin(data))
})
}
render() {
var alert;
if (this.state.error) {
alert = (
<Alert bsStyle="danger">
<strong>Error: </strong>Wrong email or password.
</Alert>
);
} else {
alert = <span></span>
}
return (
<Col md={4} mdOffset={4}>
<h3>Login</h3>
{alert}
<form id="loginForm" onSubmit={this.handleSubmit}>
<FormGroup>
<FormControl type="text" placeholder="Username" onChange={evt => this.username = evt.target.value} />
</FormGroup>
<FormGroup>
<FormControl type="password" placeholder="Password" onChange={evt => this.password = evt.target.value} />
</FormGroup>
<FormGroup>
<FormControl id="submitButton" type="submit" value="Login" />
</FormGroup>
</form>
</Col>
);
}
}
export default LoginFrom; | 29.027397 | 129 | 0.515809 |
d9159f10d037d9c1298197483aef0890284c37ff | 4,009 | js | JavaScript | src/client/App.js | RossAD/AutoCommSearch | dc015f9630edcb315f05764d724d652c576b4311 | [
"MIT"
] | null | null | null | src/client/App.js | RossAD/AutoCommSearch | dc015f9630edcb315f05764d724d652c576b4311 | [
"MIT"
] | null | null | null | src/client/App.js | RossAD/AutoCommSearch | dc015f9630edcb315f05764d724d652c576b4311 | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import './App.css';
import AutoSuggest from 'react-autosuggest';
import debounce from 'debounce';
import Header from './Header';
import Email from './Email';
import Loader from './Loading';
import isMobile from 'ismobilejs';
class App extends Component {
constructor(props) {
super(props);
this.state = {
suggestions: [],
searchTerm: '',
currApp: {},
userEmail: '',
emailSent: false,
loading: false,
}
this.handleUserEmail = this.handleUserEmail.bind(this);
this.getAppInfo = this.getAppInfo.bind(this);
this.debouncedGetAppInfo = debounce(this.getAppInfo, 1000);
this.renderSuggestion = this.renderSuggestion.bind(this);
this.getSuggestionValue = this.getSuggestionValue.bind(this);
this.sendAppEmail = this.sendAppEmail.bind(this);
}
// Functions for Auto suggest
getAppInfo() {
this.setState({loading: true});
const reqHeader = new Headers();
reqHeader.append('SearchTerm', this.state.searchTerm)
fetch('/appsuggest/', {headers: reqHeader})
.then(res => res.json())
.then(data => {
this.setState({suggestions: data, loading: false});
})
.catch((error) => {throw error})
}
renderSuggestion(suggestion) {
return (
<span>
<img
src={suggestion.artworkUrl60}
alt='app'
className='app_img'
/>
<span className='app_name'>
{suggestion.trackName}
</span>
</span>
)
}
getSuggestionValue(suggestion) {
this.setState({currApp: suggestion, emailSent: false});
return suggestion.trackName;
}
handleSearchTerm = (event, { newValue }) => (
this.setState({searchTerm: newValue})
)
onSuggestionFetchRequested = ({ value }) => (
this.debouncedGetAppInfo(value)
)
onSuggestionClearRequested = () => (
this.setState({suggestions: []})
)
// Functions for email
handleUserEmail(event) {
this.setState({userEmail: event.target.value});
}
sendAppEmail(){
this.setState({ loading: true });
const emailHeader = new Headers();
emailHeader.append('user_email', this.state.userEmail);
emailHeader.append('app_name', this.state.currApp.trackName);
emailHeader.append('app_img', this.state.currApp.artworkUrl60);
emailHeader.append('app_link', this.state.currApp.trackViewUrl);
emailHeader.append('Content-Type', 'application/json');
const emailOpt = {
method: 'POST',
headers: emailHeader,
mode: 'cors',
cache: 'default',
};
fetch('/email/', emailOpt)
.then(res => res.json())
.then(data => {
console.log('options: ', data);
const results = data.results.total_accepted_recipients;
if(results >= 1){
this.setState({
emailSent: true,
loading: false,
userEmail: "",
searchTerm: "",
}, function () {console.log(this.state.value);});
}
})
.catch((error) => {throw error})
}
render() {
const inputProps = {
placeholder: 'Type App to Search for',
onChange: this.handleSearchTerm,
value: this.state.searchTerm,
}
return (
<div className="App">
<Header
emailSent={this.state.emailSent}
/>
<div className="search_email">
<Email
handleUserEmail={this.handleUserEmail}
sendAppEmail={this.sendAppEmail}
/>
<AutoSuggest
suggestions={this.state.suggestions}
onSuggestionsFetchRequested={this.onSuggestionFetchRequested}
onSuggestionsClearRequested={this.onSuggestionClearRequested}
getSuggestionValue={this.getSuggestionValue}
focusInputOnSuggestionClick={!isMobile.any}
renderSuggestion={this.renderSuggestion}
inputProps={inputProps}
/>
</div>
<Loader loading={this.state.loading} />
</div>
);
}
}
export default App;
| 27.087838 | 73 | 0.61786 |
d9164f766b0e9ac4c5523d22632f948d45775ab5 | 3,651 | js | JavaScript | src/libs/midichain.js | FMS-Cat/vj20180817 | f626b02d1ee2d6519a0c2c3399417d1daf4e275d | [
"MIT"
] | 5 | 2018-08-17T12:49:14.000Z | 2018-08-27T13:36:51.000Z | src/libs/midichain.js | FMS-Cat/vj20180817 | f626b02d1ee2d6519a0c2c3399417d1daf4e275d | [
"MIT"
] | null | null | null | src/libs/midichain.js | FMS-Cat/vj20180817 | f626b02d1ee2d6519a0c2c3399417d1daf4e275d | [
"MIT"
] | null | null | null | const lerp = ( a, b, x ) => ( a + ( b - a ) * x );
const MidiChain = class {
constructor() {
this.params = {};
this.learning = '';
this.noteMap = {};
this.ccMap = {};
this.dom = null;
navigator.requestMIDIAccess().catch( ( error ) => {
throw new Error( error );
} ).then( ( data ) => {
const inputIter = data.inputs.values();
for ( let input = inputIter.next(); !input.done; input = inputIter.next() ) {
const value = input.value;
value.addEventListener( 'midimessage', this.__onMidiMessage.bind( this ) );
}
} );
window.addEventListener( 'wheel', ( event ) => {
if ( this.learning && this.params[ this.learning ] ) {
this.params[ this.learning ].raw = Math.min( Math.max( this.params[ this.learning ].raw - 0.001 * event.deltaY, 0.0 ), 1.0 );
this.__updateDOM();
}
} );
this.midi = ( ...args ) => this.__midi( ...args );
}
createParam( key ) {
this.params[ key ] = {
value: 0.0,
raw: 0.0,
smooth: 1E9,
listeners: []
};
this.__updateDOM();
}
attachDOM( dom ) {
this.dom = dom;
this.__updateDOM();
}
__updateDOM() {
if ( !this.dom ) { return; }
for ( let key in this.params ) {
let domParam = this.dom.querySelector( `.${ key }` );
if ( !domParam ) {
domParam = document.createElement( 'div' );
domParam.className = key;
domParam.onclick = () => {
this.learn( key );
};
// dict
let done = false;
for ( let iDom in this.dom.childNodes ) {
const el = this.dom.childNodes[ iDom ];
if ( el.className && key < el.className ) {
this.dom.insertBefore( domParam, el );
done = true;
break;
}
}
if ( !done ) {
this.dom.appendChild( domParam );
}
}
domParam.innerText = `${ key }: ${ this.params[ key ].raw.toFixed( 3 ) }`;
domParam.style.color = key === this.learning ? '#0f0' : '';
}
}
learn( key ) {
this.learning = key;
this.__updateDOM();
}
update( deltaTime ) {
const dt = deltaTime || 1.0 / 60.0;
for ( let key in this.params ) {
this.params[ key ].value = lerp(
this.params[ key ].raw,
this.params[ key ].value,
Math.exp( -dt * this.params[ key ].smooth )
);
}
}
__onMidiMessage( event ) {
let key = '';
let value = 0;
if ( event.data && event.data[ 0 ] === 128 || event.data[ 0 ] === 144 ) {
if ( this.learning ) {
this.noteMap[ event.data[ 1 ] ] = this.learning;
this.learning = '';
}
key = this.noteMap[ event.data[ 1 ] ];
value = event.data[ 0 ] === 128 ? 0.0 : event.data[ 2 ] / 127.0;
} else if ( event.data && event.data[ 0 ] === 176 ) {
if ( this.learning ) {
this.ccMap[ event.data[ 1 ] ] = this.learning;
this.learning = '';
}
key = this.ccMap[ event.data[ 1 ] ];
value = event.data[ 2 ] / 127.0;
}
if ( key ) {
this.params[ key ].raw = value;
this.params[ key ].listeners.forEach(
( listener ) => ( listener( this.params[ key ].raw ) )
);
}
this.__updateDOM();
}
__midi( key, options ) {
if ( !this.params[ key ] ) {
this.createParam( key );
}
if ( options && options.smooth ) {
this.params[ key ].smooth = options.smooth;
}
if ( options && options.listener ) {
this.params[ key ].listeners.push( options.listener );
}
return this.params[ key ].value;
}
};
export default MidiChain; | 25.006849 | 133 | 0.508354 |
d91669be7ab1e08b1a7823b4a4d8057adef62325 | 162 | js | JavaScript | articles/elements/pyramid.js | artdecoweb/www.artd.eco | 206584e03f3772655a05344ecd03cc3880e2cb2d | [
"MIT"
] | 2 | 2018-10-30T11:40:04.000Z | 2019-05-15T12:19:01.000Z | articles/elements/pyramid.js | artdecoweb/www.artd.eco | 206584e03f3772655a05344ecd03cc3880e2cb2d | [
"MIT"
] | null | null | null | articles/elements/pyramid.js | artdecoweb/www.artd.eco | 206584e03f3772655a05344ecd03cc3880e2cb2d | [
"MIT"
] | null | null | null | import { readFileSync } from 'fs'
export default function PyramidBlock() {
const f = readFileSync('articles/blocks/articles-pyramid.html', 'utf8')
return f
} | 27 | 73 | 0.734568 |
d916edbb00d2b5e4c30d9639e2085a24b212f1d3 | 49,049 | js | JavaScript | Mammothcode.BeiQin/Mammothcode.Miniprogram/unpackage/dist/dev/mp-weixin/components/base/timePicker.js | 1152250070/juzen | dc4699c6409ab183827a5fb592bb7eee3dfaa353 | [
"Apache-2.0"
] | null | null | null | Mammothcode.BeiQin/Mammothcode.Miniprogram/unpackage/dist/dev/mp-weixin/components/base/timePicker.js | 1152250070/juzen | dc4699c6409ab183827a5fb592bb7eee3dfaa353 | [
"Apache-2.0"
] | null | null | null | Mammothcode.BeiQin/Mammothcode.Miniprogram/unpackage/dist/dev/mp-weixin/components/base/timePicker.js | 1152250070/juzen | dc4699c6409ab183827a5fb592bb7eee3dfaa353 | [
"Apache-2.0"
] | null | null | null | (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["components/base/timePicker"],{
/***/ 143:
/*!************************************************************************************************************!*\
!*** D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue ***!
\************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timePicker.vue?vue&type=template&id=33ec4fb1&scoped=true& */ 144);
/* harmony import */ var _timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timePicker.vue?vue&type=script&lang=js& */ 146);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timePicker.vue?vue&type=style&index=0&id=33ec4fb1&lang=scss&scoped=true& */ 148);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 14);
var renderjs
/* normalize component */
var component = Object(_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
false,
null,
"33ec4fb1",
null,
false,
_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
renderjs
)
component.options.__file = "mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ 144:
/*!*******************************************************************************************************************************************************!*\
!*** D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=template&id=33ec4fb1&scoped=true& ***!
\*******************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./timePicker.vue?vue&type=template&id=33ec4fb1&scoped=true& */ 145);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_template_id_33ec4fb1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
/***/ }),
/***/ 145:
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=template&id=33ec4fb1&scoped=true& ***!
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
}
var recyclableRender = false
var staticRenderFns = []
render._withStripped = true
/***/ }),
/***/ 146:
/*!*************************************************************************************************************************************!*\
!*** D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=script&lang=js& ***!
\*************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./timePicker.vue?vue&type=script&lang=js& */ 147);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (_360_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ 147:
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=script&lang=js& ***!
\********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(n);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;} //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/**
* 工具函数库
*/
var DateTools = {
/**
* 获取公历节日
* @param date Date对象
*/
getHoliday: function getHoliday(date) {
var holidays = {
'0101': '元旦',
'0214': '情人',
'0308': '妇女',
'0312': '植树',
'0401': '愚人',
'0501': '劳动',
'0504': '青年',
'0601': '儿童',
'0701': '建党',
'0801': '建军',
'0903': '抗日',
'0910': '教师',
'1001': '国庆',
'1031': '万圣',
'1224': '平安',
'1225': '圣诞' };
var value = this.format(date, 'mmdd');
if (holidays[value]) return holidays[value];
return false;
},
/**
* 解析标准日期格式
* @param s 日期字符串
* @return 返回Date对象
*/
parse: function parse(s) {return new Date(s.replace(/(年|月|-)/g, '/').replace(/(日)/g, ''));},
/**
* 比较日期是否为同一天
* @param a Date对象
* @param b Date对象
* @return Boolean
*/
isSameDay: function isSameDay(a, b) {return a.getMonth() == b.getMonth() && a.getFullYear() == b.getFullYear() && a.getDate() == b.getDate();},
/**
* 格式化Date对象
* @param d 日期对象
* @param f 格式字符串
* @return 返回格式化后的字符串
*/
format: function format(d, f) {
var o = {
"m+": d.getMonth() + 1,
"d+": d.getDate(),
"h+": d.getHours(),
"i+": d.getMinutes(),
"s+": d.getSeconds(),
"q+": Math.floor((d.getMonth() + 3) / 3) };
if (/(y+)/.test(f))
f = f.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) {
if (new RegExp("(" + k + ")").test(f))
f = f.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));}
return f;
},
/**
* 用于format格式化后的反解析
* @param s 日期字符串
* @param f 格式字符串
* @return 返回Date对象
*/
inverse: function inverse(s, f) {
var o = {
"y": '',
"m": '',
"d": '',
"h": '',
"i": '',
"s": '' };
var d = new Date();
if (s.length != f.length) return d;
for (var i in f) {
if (o[f[i]] != undefined) o[f[i]] += s[i];}
if (o.y) d.setFullYear(o.y.length < 4 ? (d.getFullYear() + '').substr(0, 4 - o.y.length) + o.y : o.y);
o.m && d.setMonth(o.m - 1, 1);
o.d && d.setDate(o.d - 0);
o.h && d.setHours(o.h - 0);
o.i && d.setMinutes(o.i - 0);
o.s && d.setSeconds(o.s - 0);
return d;
},
/**
* 获取日历数组(42天)
* @param date 日期对象或日期字符串
* @param proc 处理日历(和forEach类似),传递一个数组中的item
* @return Array
*/
getCalendar: function getCalendar(date, proc) {
var it = new Date(date),
calendars = [];
it.setDate(1);
it.setDate(it.getDate() - ((it.getDay() == 0 ? 7 : it.getDay()) - 1)); //偏移量
for (var i = 0; i < 42; i++) {
var tmp = {
dateObj: new Date(it),
title: it.getDate(),
isOtherMonth: it.getMonth() < date.getMonth() || it.getMonth() > date.getMonth() };
calendars.push(Object.assign(tmp, proc ? proc(tmp) : {}));
it.setDate(it.getDate() + 1);
}
return calendars;
},
/**
* 获取日期到指定的月份1号(不改变原来的date对象)
* @param d Date对象
* @param v 指定的月份
* @return Date对象
*/
getDateToMonth: function getDateToMonth(d, v) {
var n = new Date(d);
n.setMonth(v, 1);
return n;
},
/**
* 把时间数组转为时间字符串
* @param t Array[时,分,秒]
* @param showSecinds 是否显示秒
* @return 字符串 时:分[:秒]
*/
formatTimeArray: function formatTimeArray(t, s) {
var r = _toConsumableArray(t);
if (!s) r.length = 2;
r.forEach(function (v, k) {return r[k] = ('0' + v).slice(-2);});
return r.join(':');
} };var _default =
{
props: {
//颜色
color: {
type: String,
default: '#409eff' },
//是否显示秒 针对type为datetime或time时生效
showSeconds: {
type: Boolean,
default: false },
//初始的值
value: [String, Array],
//类型date time datetime range rangetime
type: {
type: String,
default: 'range' },
//是否显示
show: {
type: Boolean,
default: false },
//初始格式
format: {
type: String,
default: '' },
//显示公历节日
showHoliday: {
type: Boolean,
default: true },
//显示提示
showTips: {
type: Boolean,
default: false },
//开始文案 针对type为范围选择时生效
beginText: {
type: String,
default: '开始' },
//结束文案 针对type为范围选择时生效
endText: {
type: String,
default: '结束' } },
data: function data() {
return {
isShow: false, //是否显示
isMultiSelect: false, //是否为多选
isContainTime: false, //是否包含时间
date: {}, //当前日期对象
weeks: ["一", "二", "三", "四", "五", "六", "日"],
title: '初始化', //标题
calendars: [[], [], []], //日历数组
calendarIndex: 1, //当前日历索引
checkeds: [], //选中的日期对象集合
showTimePicker: false, //是否显示时间选择器
timeValue: [0, 0, 0], //时间选择器的值
timeType: 'begin', //当前时间选择的类型
beginTime: [0, 0, 0], //当前所选的开始时间值
endTime: [0, 0, 0] //当前所选的结束时间值
};
},
methods: {
//设置值
setValue: function setValue(value) {var _this = this;
this.date = new Date();
this.checkeds = [];
this.isMultiSelect = this.type.indexOf('range') >= 0;
this.isContainTime = this.type.indexOf('time') >= 0;
//将字符串解析为Date对象
var parseDateStr = function parseDateStr(str) {return _this.format ? DateTools.inverse(str, _this.format) : DateTools.parse(str);};
if (value) {
if (this.isMultiSelect) {
Array.isArray(value) && value.forEach(function (dateStr, index) {
var date = parseDateStr(dateStr);
var time = [date.getHours(), date.getMinutes(), date.getSeconds()];
if (index == 0) _this.beginTime = time;else
_this.endTime = time;
_this.checkeds.push(date);
});
} else {
if (this.type == 'time') {
var date = parseDateStr('2019/1/1 ' + value);
this.beginTime = [date.getHours(), date.getMinutes(), date.getSeconds()];
this.onShowTimePicker('begin');
} else {
this.checkeds.push(parseDateStr(value));
if (this.isContainTime) this.beginTime = [
this.checkeds[0].getHours(),
this.checkeds[0].getMinutes(),
this.checkeds[0].getSeconds()];
}
}
if (this.checkeds.length) this.date = new Date(this.checkeds[0]);
} else {
if (this.isContainTime) {
this.beginTime = [this.date.getHours(), this.date.getMinutes(), this.date.getSeconds()];
if (this.isMultiSelect) this.endTime = _toConsumableArray(this.beginTime);
}
this.checkeds.push(new Date(this.date));
}
if (this.type != 'time') this.refreshCalendars(true);else
this.onShowTimePicker('begin');
},
//改变年份
onSetYear: function onSetYear(value) {
this.date.setFullYear(this.date.getFullYear() + parseInt(value));
this.refreshCalendars(true);
},
//改变月份
onSetMonth: function onSetMonth(value) {
this.date.setMonth(this.date.getMonth() + parseInt(value));
this.refreshCalendars(true);
},
//时间选择变更
onTimeChange: function onTimeChange(e) {
this.timeValue = e.detail.value;
},
//设置时间选择器的显示状态
onShowTimePicker: function onShowTimePicker(type) {
this.showTimePicker = true;
this.timeType = type;
this.timeValue = type == 'begin' ? _toConsumableArray(this.beginTime) : _toConsumableArray(this.endTime);
},
//处理日历
procCalendar: function procCalendar(item) {var _this2 = this;
//定义初始样式
item.statusStyle = {
opacity: 1,
color: item.isOtherMonth ? '#ddd' : '#000',
background: 'transparent' };
item.bgStyle = {
type: '',
background: 'transparent' };
item.dotStyle = {
opacity: 1,
background: 'transparent' };
item.tips = "";
//标记今天的日期
if (DateTools.isSameDay(new Date(), item.dateObj)) {
item.statusStyle.color = this.color;
if (item.isOtherMonth) item.statusStyle.opacity = 0.3;
}
//标记选中项
this.checkeds.forEach(function (date) {
if (DateTools.isSameDay(date, item.dateObj)) {
item.statusStyle.background = _this2.color;
item.statusStyle.color = '#fff';
item.statusStyle.opacity = 1;
if (_this2.isMultiSelect && _this2.showTips) item.tips = _this2.beginText;
}
});
//节假日或今日的日期标点
if (item.statusStyle.background != this.color) {
var holiday = this.showHoliday ? DateTools.getHoliday(item.dateObj) : false;
if (holiday || DateTools.isSameDay(new Date(), item.dateObj)) {
item.title = holiday || item.title;
item.dotStyle.background = this.color;
if (item.isOtherMonth) item.dotStyle.opacity = 0.2;
}
} else {
item.title = item.dateObj.getDate();
}
//有两个日期
if (this.checkeds.length == 2) {
if (DateTools.isSameDay(this.checkeds[0], item.dateObj)) {//开始日期
item.bgStyle.type = 'bgbegin';
}
if (DateTools.isSameDay(this.checkeds[1], item.dateObj)) {//结束日期
if (this.isMultiSelect && this.showTips) item.tips = item.bgStyle.type ? this.beginText + ' / ' + this.endText : this.endText;
if (!item.bgStyle.type) {//开始日期不等于结束日期
item.bgStyle.type = 'bgend';
} else {
item.bgStyle.type = '';
}
}
if (!item.bgStyle.type && +item.dateObj > +this.checkeds[0] && +item.dateObj < +this.checkeds[1]) {//中间的日期
item.bgStyle.type = 'bg';
item.statusStyle.color = this.color;
}
if (item.bgStyle.type) {
item.bgStyle.background = this.color;
item.dotStyle.opacity = 1;
item.statusStyle.opacity = 1;
}
}
},
//刷新日历
refreshCalendars: function refreshCalendars() {var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var date = new Date(this.date);
var before = DateTools.getDateToMonth(date, date.getMonth() - 1);
var after = DateTools.getDateToMonth(date, date.getMonth() + 1);
if (this.calendarIndex == 0) {
if (refresh) this.calendars.splice(0, 1, DateTools.getCalendar(date, this.procCalendar));
this.calendars.splice(1, 1, DateTools.getCalendar(after, this.procCalendar));
this.calendars.splice(2, 1, DateTools.getCalendar(before, this.procCalendar));
} else if (this.calendarIndex == 1) {
this.calendars.splice(0, 1, DateTools.getCalendar(before, this.procCalendar));
if (refresh) this.calendars.splice(1, 1, DateTools.getCalendar(date, this.procCalendar));
this.calendars.splice(2, 1, DateTools.getCalendar(after, this.procCalendar));
} else if (this.calendarIndex == 2) {
this.calendars.splice(0, 1, DateTools.getCalendar(after, this.procCalendar));
this.calendars.splice(1, 1, DateTools.getCalendar(before, this.procCalendar));
if (refresh) this.calendars.splice(2, 1, DateTools.getCalendar(date, this.procCalendar));
}
this.title = DateTools.format(this.date, 'yyyy年mm月');
},
//滑块切换
onSwiperChange: function onSwiperChange(e) {
this.calendarIndex = e.detail.current;
var calendar = this.calendars[this.calendarIndex];
this.date = new Date(calendar[22].dateObj); //取中间一天,保证是当前的月份
this.refreshCalendars();
},
//选中日期
onSelectDate: function onSelectDate(date) {var _this3 = this;
if (~this.type.indexOf('range') && this.checkeds.length == 2) this.checkeds = [];else
if (!~this.type.indexOf('range') && this.checkeds.length) this.checkeds = [];
this.checkeds.push(new Date(date.dateObj));
this.checkeds.sort(function (a, b) {return a - b;}); //从小到大排序
this.calendars.forEach(function (calendar) {
calendar.forEach(_this3.procCalendar); //重新处理
});
},
//时间选择取消
onCancelTime: function onCancelTime() {
this.showTimePicker = false;
this.type == 'time' && this.onCancel();
},
//时间选择确定
onConfirmTime: function onConfirmTime() {
if (this.timeType == 'begin') this.beginTime = this.timeValue;else
this.endTime = this.timeValue;
this.showTimePicker = false;
this.type == 'time' && this.onConfirm();
},
//取消
onCancel: function onCancel() {
this.$emit('cancel', false);
},
//确定
onConfirm: function onConfirm() {var _this4 = this;
var result = {
value: null,
date: null };
//定义默认格式
var defaultFormat = {
'date': 'yyyy/mm/dd',
'time': 'hh:ii' + (this.showSeconds ? ':ss' : ''),
'datetime': '' };
defaultFormat['datetime'] = defaultFormat.date + ' ' + defaultFormat.time;
var fillTime = function fillTime(date, timeArr) {
date.setHours(timeArr[0], timeArr[1]);
if (_this4.showSeconds) date.setSeconds(timeArr[2]);
};
if (this.type == 'time') {
var date = new Date();
fillTime(date, this.beginTime);
result.value = DateTools.format(date, this.format ? this.format : defaultFormat.time);
result.date = date;
} else {
if (this.isMultiSelect) {
var values = [],
dates = [];
if (this.checkeds.length < 2) return uni.showToast({
icon: 'none',
title: '请选择两个日期' });
this.checkeds.forEach(function (date, index) {
var newDate = new Date(date);
if (_this4.isContainTime) {
var time = [_this4.beginTime, _this4.endTime];
fillTime(newDate, time[index]);
}
values.push(DateTools.format(newDate, _this4.format ? _this4.format : defaultFormat[_this4.isContainTime ?
'datetime' : 'date']));
dates.push(newDate);
});
result.value = values;
result.date = dates;
} else {
var newDate = new Date(this.checkeds[0]);
if (this.isContainTime) {
newDate.setHours(this.beginTime[0], this.beginTime[1]);
if (this.showSeconds) newDate.setSeconds(this.beginTime[2]);
}
result.value = DateTools.format(newDate, this.format ? this.format : defaultFormat[this.isContainTime ?
'datetime' : 'date']);
result.date = newDate;
}
}
this.$emit('confirm', result);
} },
computed: {
BeginTitle: function BeginTitle() {
var value = '未选择';
if (this.checkeds.length) value = DateTools.format(this.checkeds[0], 'yy/mm/dd');
return value;
},
EndTitle: function EndTitle() {
var value = '未选择';
if (this.checkeds.length == 2) value = DateTools.format(this.checkeds[1], 'yy/mm/dd');
return value;
},
PickerTimeTitle: function PickerTimeTitle() {
return DateTools.formatTimeArray(this.timeValue, this.showSeconds);
},
BeginTimeTitle: function BeginTimeTitle() {
return this.BeginTitle != '未选择' ? DateTools.formatTimeArray(this.beginTime, this.showSeconds) : '';
},
EndTimeTitle: function EndTimeTitle() {
return this.EndTitle != '未选择' ? DateTools.formatTimeArray(this.endTime, this.showSeconds) : '';
} },
watch: {
show: function show(newValue, oldValue) {
newValue && this.setValue(this.value);
this.isShow = newValue;
},
value: function value(newValue, oldValue) {var _this5 = this;
setTimeout(function () {
_this5.setValue(newValue);
}, 0);
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
/***/ }),
/***/ 148:
/*!**********************************************************************************************************************************************************************!*\
!*** D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=style&index=0&id=33ec4fb1&lang=scss&scoped=true& ***!
\**********************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src??ref--8-oneOf-1-3!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../360安全浏览器下载/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./timePicker.vue?vue&type=style&index=0&id=33ec4fb1&lang=scss&scoped=true& */ 149);
/* harmony import */ var _360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (_360_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_360_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_360_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_360_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_timePicker_vue_vue_type_style_index_0_id_33ec4fb1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ 149:
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/mammothcode.2019.01/Mammothcode.OrderClass/Mammothcode.Miniprogram/components/base/timePicker.vue?vue&type=style&index=0&id=33ec4fb1&lang=scss&scoped=true& ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
if(false) { var cssReload; }
/***/ })
}]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/base/timePicker.js.map
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/base/timePicker-create-component',
{
'components/base/timePicker-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('1')['createComponent'](__webpack_require__(143))
})
},
[['components/base/timePicker-create-component']]
]);
| 67.190411 | 2,378 | 0.66034 |
d9178fbcc019e23189ac9a71f0cda9a34a2c25e9 | 645 | js | JavaScript | frontend/src/main.js | ZanMax/pdf-watermark | 3676abced59ffbad9357676a4d63093d7e927a9b | [
"MIT"
] | null | null | null | frontend/src/main.js | ZanMax/pdf-watermark | 3676abced59ffbad9357676a4d63093d7e927a9b | [
"MIT"
] | null | null | null | frontend/src/main.js | ZanMax/pdf-watermark | 3676abced59ffbad9357676a4d63093d7e927a9b | [
"MIT"
] | null | null | null | import Vue from 'vue'
import { BootstrapVue, IconsPlugin, SpinnerPlugin } from 'bootstrap-vue'
import App from './App.vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import axios from 'axios'
import titleMixin from './mixins/titleMixin'
// DEV
//const baseURL = 'http://localhost:8001';
// TEST
const baseURL = 'https://pdf.db.rv.ua';
// PROD
// const baseURL = 'https://pdf.db.rv.ua';
axios.defaults.baseURL = baseURL;
Vue.config.productionTip = false
Vue.use(BootstrapVue)
Vue.use(IconsPlugin)
Vue.use(SpinnerPlugin)
Vue.mixin(titleMixin)
new Vue({
render: h => h(App),
}).$mount('#app')
| 20.806452 | 72 | 0.717829 |
d91a662a3c513f51608d41b92bac76d598a6dc84 | 369 | js | JavaScript | node_modules/ethereum-waffle/dist/esm/ContractJSON.js | mennat1/simple-yield-farm-truffle-version | 343389152c97448a6f1d79f3737bfadb2f819614 | [
"MIT"
] | 14 | 2022-01-13T05:11:54.000Z | 2022-03-23T03:27:28.000Z | node_modules/ethereum-waffle/dist/esm/ContractJSON.js | mennat1/simple-yield-farm-truffle-version | 343389152c97448a6f1d79f3737bfadb2f819614 | [
"MIT"
] | 22 | 2021-09-16T04:33:31.000Z | 2022-02-06T17:45:51.000Z | node_modules/ethereum-waffle/dist/esm/ContractJSON.js | mennat1/simple-yield-farm-truffle-version | 343389152c97448a6f1d79f3737bfadb2f819614 | [
"MIT"
] | 10 | 2022-02-09T15:14:52.000Z | 2022-03-21T18:43:12.000Z | export const isStandard = (data) => typeof data.evm === 'object' &&
data.evm !== null &&
typeof data.evm.bytecode === 'object' &&
data.evm.bytecode !== null;
export function hasByteCode(bytecode) {
if (typeof bytecode === 'object') {
return Object.entries(bytecode.object).length !== 0;
}
return Object.entries(bytecode).length !== 0;
}
| 33.545455 | 67 | 0.623306 |
d91cac112496fc0f96b629aed33ca9db47b1d56a | 1,114 | js | JavaScript | frontend/src/components/filter.js | mgnisia/drf-gatsby-example | 68d82a8d5f62ba22bcbadd7f87e65bd198bb21c8 | [
"MIT"
] | 5 | 2020-02-13T13:20:33.000Z | 2022-03-04T11:43:52.000Z | frontend/src/components/filter.js | mgnisia/drf-gatsby-example | 68d82a8d5f62ba22bcbadd7f87e65bd198bb21c8 | [
"MIT"
] | null | null | null | frontend/src/components/filter.js | mgnisia/drf-gatsby-example | 68d82a8d5f62ba22bcbadd7f87e65bd198bb21c8 | [
"MIT"
] | 1 | 2020-02-28T20:29:36.000Z | 2020-02-28T20:29:36.000Z | import React from "react";
import { useIsAuthenticated } from "../services/auth-service";
const FilterButton = ({ text, disabled, active, onClick }) => (
<button
className={`filter-button ${active ? 'active' : ''}`}
disabled={disabled}
onClick={onClick}
>
{text}
</button>
);
const Filter = ({ activeFilter, setActiveFilter }) => {
const isAuthenticated = useIsAuthenticated();
return (
<div
style={{
display: 'flex',
justifyContent: 'space-between',
maxWidth: '300px',
paddingTop: '1.45rem',
margin: '0 auto',
}}
>
<FilterButton
text="All"
active={activeFilter === 'all'}
onClick={() => setActiveFilter('all')}
/>
<FilterButton
text="Nearby"
active={activeFilter === 'nearby'}
onClick={() => setActiveFilter('nearby')}
/>
<FilterButton
text="Favorite"
active={activeFilter === 'favorite'}
disabled={!isAuthenticated}
onClick={() => setActiveFilter('favorite')}
/>
</div>
);
};
export default Filter;
| 22.734694 | 63 | 0.555655 |
d91d1cef6988894116985c4c17f7f6b7dbbde600 | 4,003 | js | JavaScript | test/formatting/testUtils.js | stevejaxon/gignesthai | bfebb6ddbab4379854249aa9323b9094363a6d70 | [
"MIT"
] | null | null | null | test/formatting/testUtils.js | stevejaxon/gignesthai | bfebb6ddbab4379854249aa9323b9094363a6d70 | [
"MIT"
] | null | null | null | test/formatting/testUtils.js | stevejaxon/gignesthai | bfebb6ddbab4379854249aa9323b9094363a6d70 | [
"MIT"
] | null | null | null | let assert = require('chai').assert;
let utils = require('../../formatting/utils');
let web3Utils = require('web3-utils');
describe('Formatting Utils Tests', function() {
describe('Pad Left Tests', function() {
// Verification of usual behaviour
it('should return a correctly padded string when given a single character or digit', function() {
// Setup
let inputData = "1";
let expectedOutput = "0000000000000000000000000000000000000000000000000000000000000001";
// Test
let outputData = utils.FormattingUtils.padLeft(inputData);
// Verify
assert.typeOf(outputData, 'string', 'expected that a string would be returned');
assert.equal(outputData, expectedOutput, 'expected that the returned value would be correct');
});
it('should return a correctly padded string when given an already correctly padded string', function() {
// Setup
let inputData = "0000000000000000000000000000000000000000000000000000000000000001";
let expectedOutput = "0000000000000000000000000000000000000000000000000000000000000001";
// Test
let outputData = utils.FormattingUtils.padLeft(inputData);
// Verify
assert.typeOf(outputData, 'string', 'expected that a string would be returned');
assert.equal(outputData, expectedOutput, 'expected that the returned value would be correct');
});
it('should return a correctly padded string when given a valid Ethereum address', function() {
// Setup
let inputData = "0xea58befa487f21df233a344d6ed6c0354a7be320";
let expectedOutput = "00000000000000000000000xea58befa487f21df233a344d6ed6c0354a7be320";
// Test
let outputData = utils.FormattingUtils.padLeft(inputData);
// Verify
assert.typeOf(outputData, 'string', 'expected that a string would be returned');
assert.equal(outputData, expectedOutput, 'expected that the returned value would be correct');
});
// Edge cases and error handling
});
describe('Create Array Key Tests', function() {
// Verification of usual behaviour
it('should return a correctly padded and hashed string key when given an address prefixed with 0x', function() {
// Setup
let inputData = "0x9e5e939fb0a23529934c061d6ecf4c93e7893d4e";
let inputStorageIndex = 0;
let expectedKey = "0xf5db272805d238693e842e939a9eb56471e731c4431de8477ecdff18ac509c63";
// Test
let outputKey = utils.FormattingUtils.createArrayKey(inputData, inputStorageIndex);
// Verify
assert.isTrue(web3Utils.isAddress(inputData), 'expected that the input data would have been a valid address');
assert.typeOf(outputKey, 'string', 'expected that a string would be returned');
assert.equal(outputKey, expectedKey, 'expected that the returned value would be correct');
});
it('should return a correctly padded and hashed string key when given an address without prefix', function() {
// Setup
let inputData = "ea30250dd7263a4783c66463c236a2153d6b88b4";
let inputStorageIndex = 0;
let expectedKey = "0x1ba324babf1065cf08a7595ac1e628db8e2d81497ba1c96bd8424299bc108592";
// Test
let outputKey = utils.FormattingUtils.createArrayKey(inputData, inputStorageIndex);
// Verify
assert.isTrue(web3Utils.isAddress(inputData), 'expected that the input data would have been a valid address');
assert.typeOf(outputKey, 'string', 'expected that a string would be returned');
assert.equal(outputKey, expectedKey, 'expected that the returned value would be correct');
});
// Edge cases and error handling
});
}); | 46.011494 | 122 | 0.654509 |
d91d72c6a07dca80e915ff41fed896945422d7a1 | 3,576 | js | JavaScript | public/js/main.js | jasonwhite1976/picker-app | 67a0341e45c03a4c9be26555b73e3f57d1ed55b8 | [
"MIT"
] | null | null | null | public/js/main.js | jasonwhite1976/picker-app | 67a0341e45c03a4c9be26555b73e3f57d1ed55b8 | [
"MIT"
] | null | null | null | public/js/main.js | jasonwhite1976/picker-app | 67a0341e45c03a4c9be26555b73e3f57d1ed55b8 | [
"MIT"
] | null | null | null | $(document).ready(function() {
$("#delete-btn").click(function(event) {
if( !confirm('Are you sure?') )
event.preventDefault();
});
$(".delete-list-link").click(function(event) {
if( !confirm('Are you sure?') )
event.preventDefault();
});
/*
if($(".isPickedInput").val() == "0"){
$(".pick-toggle").removeClass("green-text");
$(".pick-toggle").addClass("not-got-it");
}
if($(".isPickedInput").val() == "1"){
$(".pick-toggle").addClass("green-text");
$(".pick-toggle").removeClass("not-got-it");
}
*/
/*******************************************************/
$('#addItemButton').click(addItemSubmit);
function addItemSubmit (event) {
event.preventDefault();
event.stopPropagation();
var listURL = window.location.href.split("/").pop();
console.log('listURL = ' + listURL);
var newItem = addItemForm.itemName.value;
$.ajax({
url: '/list/additem/' + listURL,
type: 'POST',
dataType: "json",
contentType: 'application/json',
data: JSON.stringify ({
name: newItem
}),
success: function() {
location.reload();
}
});
}
/*******************************************************/
$('.deleteItemForm').click(deleteItemForm);
function deleteItemForm (event) {
event.preventDefault();
event.stopPropagation();
var listURL = window.location.href.split("/").pop();
console.log('listURL = ' + listURL);
var item_id = $(this).find('.itemId').val();
console.log('_id ' + item_id);
$.ajax({
url: '/list/deleteitem/' + listURL,
type: 'POST',
dataType: "json",
contentType: 'application/json',
data: JSON.stringify ({
_id: item_id
}),
success: function() {
location.reload();
}
});
}
/*******************************************************/
// jquery selector problem - use this to target the correct element?
$(".pick-toggle").click(function(){
var hiddenField = $(this).siblings(".isPickedInput");
var val = hiddenField.val();
hiddenField.val(val === "1" ? "0" : "1");
console.log(hiddenField);
});
/*
$(".pick-toggle").click(function(event) {
var hiddenField = $('.isPickedInput');
val = hiddenField.val();
hiddenField.val(val === "1" ? "0" : "1");
});
*/
$('.updateItemForm').click(updateItemForm);
function updateItemForm (event) {
event.preventDefault();
event.stopPropagation();
var listURL = window.location.href.split("/").pop();
console.log('listURL = ' + listURL);
var itemName = $(this).find('.name').val();
var isPicked = $(this).find('.isPickedInput').val();
var item_id = $(this).find('.itemId').val();
var timeId = $(this).find('.timeStampId').val();
isPicked = parseInt(isPicked);
console.log('itemName = ' + itemName);
console.log('isPicked = ' + isPicked);
$.ajax({
url: '/list/itempicked/' + listURL,
type: 'POST',
dataType: "json",
contentType: 'application/json',
data: JSON.stringify ({
name: itemName,
picked: isPicked,
item_id: item_id
}),
success: function() {
location.reload();
}
});
}
});
| 27.72093 | 72 | 0.487136 |
d91dd0a996e4b22e0507d550a24c809ad7247166 | 10,322 | js | JavaScript | not_hidden/logviewer/data/data178.js | Mestway/mestway.github.io | ac56da117646350cd5fd8473c77d7018302e0ffd | [
"Apache-2.0"
] | null | null | null | not_hidden/logviewer/data/data178.js | Mestway/mestway.github.io | ac56da117646350cd5fd8473c77d7018302e0ffd | [
"Apache-2.0"
] | null | null | null | not_hidden/logviewer/data/data178.js | Mestway/mestway.github.io | ac56da117646350cd5fd8473c77d7018302e0ffd | [
"Apache-2.0"
] | null | null | null | data = [{"owner":"noukitus@gmail.com","date":"11\/22\/2013 10:06:55 PM","query":"select chr as [column1], pos as [column2], pos + 1 as [column3], 'cpg' as [column4], cast(ratio as float) as [column5] from [noukitus@gmail.com].[table_mix54methratio_1.txt] where context like '__cg_' and ct_count >= 5","id":"250142"},{"owner":"noukitus@gmail.com","date":"11\/22\/2013 10:20:42 PM","query":"SELECT * FROM [noukitus@gmail.com].[table_Mix54methratio_1.txt]","id":"29512"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 10:19:34 PM","query":"SELECT chr as [Column1], pos as [Column2], pos + 1 as [Column3], 'CpG' as [Column4], cast(ratio as float) as [Column5] FROM [noukitus@gmail.com].[table_Mix54methratio_1.txt] where context like '__CG_' and CT_Count >= 5","id":"29532"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 10:58:50 PM","query":"SELECT chr as seqname, 'methratio' as source, 'CpG' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute FROM [noukitus@gmail.com].[table_Mix54methratio_1.txt] where context like '__CG_' --_=single character wildcard and CT_Count > 5","id":"29534"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 10:59:34 PM","query":"select chr as seqname, 'methratio' as source, 'cpg' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute from [noukitus@gmail.com].[table_mix54methratio_1.txt] where context like '__cg_' --_=single character wildcard and ct_count > 5","id":"251133"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 11:38:22 PM","query":"select chr as seqname, 'methratio' as source, 'cpg' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute from [noukitus@gmail.com].[table_mix54methratio_1.txt] where context like '__cg_' --_=single character wildcard and ct_count > 5","id":"251186"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 9:40:28 PM","query":"SELECT chr as [Column1], pos as [Column2], pos + 1 as [Column3], 'CpG' as [Column4], cast(ratio as float) as [Column5] FROM [noukitus@gmail.com].[table_Controlmethratio_1.txt] where context like '__CG_' and CT_Count >= 5","id":"29531"},{"owner":"noukitus@gmail.com","date":"11\/25\/2013 9:40:51 PM","query":"select chr as seqname, 'methratio' as source, 'cpg' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute from [noukitus@gmail.com].[table_controlmethratio_1.txt] where context like '__cg_' --_=single character wildcard and ct_count > 5","id":"251078"},{"owner":"noukitus@gmail.com","date":"11\/27\/2013 10:56:19 PM","query":"SELECT chr as seqname, 'methratio' as source, 'CpG' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute FROM [noukitus@gmail.com].[table_Controlmethratio_1.txt] where context like '__CG_' --_=single character wildcard and CT_Count > 5","id":"29587"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 5:01:09 PM","query":"SELECT chr as [Column1], pos as [Column2], pos + 1 as [Column3], 'CpG' as [Column4], cast(ratio as float) as [Column5] FROM [mgavery@washington.edu].[Mix54methratio_final] where context like '__CG_' and CT_Count >= 5","id":"29911"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 5:10:53 PM","query":"SELECT chr as seqname, 'methratio' as source, 'CpG' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute FROM [mgavery@washington.edu].[Mix54methratio_final] where context like '__CG_' --_=single character wildcard and CT_Count > 5","id":"29918"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 5:11:37 PM","query":"select chr as seqname, 'methratio' as source, 'cpg' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute from [mgavery@washington.edu].[mix54methratio_final] where context like '__cg_' --_=single character wildcard and ct_count > 5","id":"250666"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 7:21:04 PM","query":"select * from [noukitus@gmail.com].[table_mix54intersectbedfinal.txt]","id":"250800"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 7:22:17 PM","query":"SELECT * FROM [noukitus@gmail.com].[Mix54intersectbedfinal.txt] left join [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt] on [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[Mix54intersectbedfinal.txt].[Column18]","id":"29922"},{"owner":"noukitus@gmail.com","date":"12\/18\/2013 7:23:06 PM","query":"select * from [noukitus@gmail.com].[mix54intersectbedfinal.txt] left join [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt] on [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt].[column1]=[mix54intersectbedfinal.txt].[column18]","id":"250851"},{"owner":"noukitus@gmail.com","date":"12\/19\/2013 11:02:02 PM","query":"SELECT chr as seqname, 'methratio' as source, 'CpG' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute FROM [mgavery@washington.edu].[Control37methratio.txt] where context like '__CG_' --_=single character wildcard and CT_Count > 5","id":"29959"},{"owner":"noukitus@gmail.com","date":"12\/19\/2013 11:03:43 PM","query":"select chr as seqname, 'methratio' as source, 'cpg' as feature, pos as start, pos + 1 as [end], ratio as score, strand, '.' as frame, '.' as attribute from [mgavery@washington.edu].[control37methratio.txt] where context like '__cg_' --_=single character wildcard and ct_count > 5","id":"253574"},{"owner":"noukitus@gmail.com","date":"12\/19\/2013 11:19:48 PM","query":"select * from [noukitus@gmail.com].[table_control37intersectbedfinal.txt]","id":"253667"},{"owner":"noukitus@gmail.com","date":"12\/19\/2013 11:20:44 PM","query":"SELECT * FROM [noukitus@gmail.com].[Control37intersectbedfinal.txt] left join [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt] on [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[Control37intersectbedfinal.txt].[Column18]","id":"29960"},{"owner":"noukitus@gmail.com","date":"12\/19\/2013 11:21:49 PM","query":"select * from [noukitus@gmail.com].[control37intersectbedfinal.txt] left join [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt] on [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt].[column1]=[control37intersectbedfinal.txt].[column18]","id":"253712"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 7:18:05 PM","query":"SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count FROM [mgavery@washington.edu].[Mix54methratio_final] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'","id":"29975"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 7:20:08 PM","query":"select chr as chr, pos as start, '+' as strand, cast (ct_count as float) as ct_count, cast (ratio as float) as ratio from [mgavery@washington.edu].[mix54methratio_final] where context like '__cg_' and ct_count >= 5 and ratio <> 'na'","id":"253802"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 7:44:51 PM","query":"SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count FROM [mgavery@washington.edu].[Control37methratio.txt] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'","id":"29976"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 7:45:04 PM","query":"select chr as chr, pos as start, '+' as strand, cast (ct_count as float) as ct_count, cast (ratio as float) as ratio from [mgavery@washington.edu].[control37methratio.txt] where context like '__cg_' and ct_count >= 5 and ratio <> 'na'","id":"253847"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 9:15:28 PM","query":"SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (ratio as float) as ratio FROM [mgavery@washington.edu].[Control37methratio.txt] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'","id":"29977"},{"owner":"noukitus@gmail.com","date":"12\/20\/2013 9:19:25 PM","query":"SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (ratio as float) as ratio FROM [mgavery@washington.edu].[Mix54methratio_final] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'","id":"29978"},{"owner":"noukitus@gmail.com","date":"12\/6\/2013 8:57:52 PM","query":"SELECT * FROM [noukitus@gmail.com].[table_Mix54intersectbed.txt] left join [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt] on [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[noukitus@gmail.com].[table_Mix54intersectbed.txt].[Column18]","id":"29657"},{"owner":"noukitus@gmail.com","date":"12\/6\/2013 9:03:15 PM","query":"SELECT * FROM [noukitus@gmail.com].[table_Mix54intersectbed.txt]","id":"29659"},{"owner":"noukitus@gmail.com","date":"12\/6\/2013 9:06:44 PM","query":"SELECT * FROM [noukitus@gmail.com].[table_Mix54intersectbed_3.txt] left join [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt] on [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[table_Mix54intersectbed_3.txt].[Column18]","id":"29661"},{"owner":"noukitus@gmail.com","date":"12\/6\/2013 9:12:20 PM","query":"SELECT * FROM [noukitus@gmail.com].[table_Mix54intersectbed_4.txt] left join [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt] on [mgavery@washington.edu].[TJGR_Gene_SPID_evalue_Description.txt].[Column1]=[table_Mix54intersectbed_4.txt].[Column18]","id":"29663"},{"owner":"noukitus@gmail.com","date":"12\/6\/2013 9:13:03 PM","query":"select * from [noukitus@gmail.com].[table_mix54intersectbed_4.txt] left join [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt] on [mgavery@washington.edu].[tjgr_gene_spid_evalue_description.txt].[column1]=[table_mix54intersectbed_4.txt].[column18]","id":"254235"}];
| 5,161 | 10,321 | 0.689886 |
d91e1783c034f0677bca3736b027b14dba4d3925 | 1,035 | js | JavaScript | src/components/BombBox/Alert.js | zhaolong-benhu/xianzhi-platform | f011ae936aa2d6b2b8d73374673b98bdab7a8970 | [
"MIT"
] | null | null | null | src/components/BombBox/Alert.js | zhaolong-benhu/xianzhi-platform | f011ae936aa2d6b2b8d73374673b98bdab7a8970 | [
"MIT"
] | null | null | null | src/components/BombBox/Alert.js | zhaolong-benhu/xianzhi-platform | f011ae936aa2d6b2b8d73374673b98bdab7a8970 | [
"MIT"
] | null | null | null | /**
* Created by zhaolong on 2016/10/18.
* File description:文本弹框提示
*/
'use strict'
import React,{Component,PropTypes} from 'react'
const styles = require('./Alert.scss');
import {connect} from 'react-redux';
import { push } from 'react-router-redux';
@connect(
state => ({}),{push}
)
export default class Alert extends Component{
static propTypes = {
push: PropTypes.func.isRequired
}
componentDidMount(){
let mask=document.getElementById('mask');
mask.style.display="block";
}
//点击确定世界响应
onClickedOk(){
let mask=document.getElementById('mask');
mask.style.display="none";
if(this.props.href!='/')
this.props.push(this.props.href);
}
render(){
return(
<div className={styles.bomb_box}>
<div className={styles.info}>
<div className={styles.tips} dangerouslySetInnerHTML={{__html: this.props.text}}></div>
</div>
<div className={styles.yesorno} onClick={this.onClickedOk.bind(this)}>
确定
</div>
</div>
)
}
}
| 24.642857 | 97 | 0.630918 |
d91e95a8dc7400980fd0ba93e72e0ff85df06dce | 209 | js | JavaScript | src/components/blurbmain.js | big-tent/bigger-tent | 44dd22fb83854d8e4e7f6053aa043921f790e03e | [
"MIT"
] | null | null | null | src/components/blurbmain.js | big-tent/bigger-tent | 44dd22fb83854d8e4e7f6053aa043921f790e03e | [
"MIT"
] | 7 | 2020-07-17T14:54:53.000Z | 2022-02-26T14:28:28.000Z | src/components/blurbmain.js | big-tent/bigger-tent | 44dd22fb83854d8e4e7f6053aa043921f790e03e | [
"MIT"
] | null | null | null | import React from "react"
import styled from "styled-components"
const BlurbMain = styled.div`
margin: 0 auto 3rem;
max-width: 800px;
`
export default ({ children }) => <BlurbMain>{children}</BlurbMain>
| 20.9 | 66 | 0.717703 |
d91f142b1e93df9d3d9344c9db9dc25c7efb7050 | 1,193 | js | JavaScript | src/base/arcgis_js_v4.6/esri/widgets/Print/nls/nb/Print.js | lidonghai1/vue-arcgis-element-ui | 3ea1b7079f9c060c3fd834e488c172a9289b52ac | [
"MIT"
] | 1 | 2019-06-14T09:54:36.000Z | 2019-06-14T09:54:36.000Z | src/base/arcgis_js_v4.6/esri/widgets/Print/nls/nb/Print.js | lidonghai1/vue-arcgis-element-ui | 3ea1b7079f9c060c3fd834e488c172a9289b52ac | [
"MIT"
] | null | null | null | src/base/arcgis_js_v4.6/esri/widgets/Print/nls/nb/Print.js | lidonghai1/vue-arcgis-element-ui | 3ea1b7079f9c060c3fd834e488c172a9289b52ac | [
"MIT"
] | 2 | 2019-06-14T09:54:40.000Z | 2020-04-13T14:47:30.000Z | // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.6/esri/copyright.txt for details.
//>>built
define({title:"Tittel",fileName:"Filnavn",titlePlaceHolder:"Tittel p\u00e5 fil",fileNamePlaceHolder:"Filnavn",formatDefaultOption:"Velg format",fileFormatTitle:"Filformat",layoutTitle:"Utskriftsformat",layoutDefaultOption:"Velg utskriftsformat",scale:"Angi m\u00e5lestokk",scaleLabel:"m\u00e5lestokk",reset:"tilbakestill",author:"Forfatter",copyright:"Opphavsrett",legend:"Inkluder tegnforklaring",lock:"l\u00e5s",swap:"bytt",panelToggle:"Panelveksling",advancedOptions:"Avanserte alternativer",width:"Bredde",
height:"H\u00f8yde",attribution:"Inkluder kildeinformasjon",layoutTab:"Oppsett",mapOnlyTab:"Kun kart",untitled:"uten tittel",pending:"Eksporterer",ready:"\u00c5pne",linkReady:"\u00c5pne i nytt vindu.",error:"Velg dette for \u00e5 fjerne.",sceneViewError:"Utskrift st\u00f8ttes ikke i SceneView.",serviceError:"Det virker som det har oppst\u00e5tt en feil.","export":"Eksporter",exportDescription:"Eksporter. De eksporterte filene vises nedenfor.",exportText:"Eksporterte filer",exportHint:"De eksporterte filene vises her."}); | 238.6 | 526 | 0.801341 |
d920003f6d89db2a18b5204f1ce3db1dfb039cd3 | 293 | js | JavaScript | learnyounode/10_timeserver.js | bernardomfg/nodeschool | 083d8dc7c5a55df9a5854276fbcc89e3062deb22 | [
"MIT"
] | null | null | null | learnyounode/10_timeserver.js | bernardomfg/nodeschool | 083d8dc7c5a55df9a5854276fbcc89e3062deb22 | [
"MIT"
] | null | null | null | learnyounode/10_timeserver.js | bernardomfg/nodeschool | 083d8dc7c5a55df9a5854276fbcc89e3062deb22 | [
"MIT"
] | null | null | null | var net = require('net');
var strftime = require('strftime');
var server = net.createServer(function (socket) {
data = strftime('%Y-%m-%d %H:%M\n');
socket.end(data);
});
console.log("Server is trying to listen at port: " + process.argv[2])
server.listen(Number(process.argv[2]));
| 32.555556 | 70 | 0.651877 |
d92111e3fabdb62bf0b87a4369d8e24d3c1960ca | 2,699 | js | JavaScript | build/translations/no.js | robre21/ckeditor5-build-classic | e91afcf66207a1fc27e112b67dc8e619f51bedbf | [
"MIT"
] | null | null | null | build/translations/no.js | robre21/ckeditor5-build-classic | e91afcf66207a1fc27e112b67dc8e619f51bedbf | [
"MIT"
] | null | null | null | build/translations/no.js | robre21/ckeditor5-build-classic | e91afcf66207a1fc27e112b67dc8e619f51bedbf | [
"MIT"
] | null | null | null | (function(d){d['no']=Object.assign(d['no']||{},{a:"Kan ikke laste opp fil:",b:"Verktøylinje for bilde",c:"Table toolbar",d:"Gjennomstreket",e:"Fet",f:"Sett inn bilde eller fil",g:"Kursiv",h:"Understreket",i:"Velg overskrift",j:"Overskrift",k:"Nummerert liste",l:"Punktliste",m:"Blokksitat",n:"Bilde-widget",o:"media-widget",p:"Sett inn media",q:"URL-en kan ikke være tom.",r:"Denne media-URL-en er ikke støttet.",s:"Skriv inn bildetekst",t:"Sett inn bilde",u:"Kunne ikke laste opp",v:"Sett inn tabell",w:"Overskriftkolonne",x:"Sett inn kolonne til venstre",y:"Sett inn kolonne til høyre",z:"Slett kolonne",aa:"Kolonne",ab:"Overskriftrad",ac:"Sett inn rad under",ad:"Sett inn rad over",ae:"Slett rad",af:"Rad",ag:"Slå sammen celle over",ah:"Slå sammen celle til høyre",ai:"Slå sammen celle under",aj:"Slå sammen celle til venstre",ak:"Del opp celle vertikalt",al:"Del opp celle horisontalt",am:"Slå sammen celler",an:"Bilde i full størrelse",ao:"Sidestilt bilde",ap:"Venstrejustert bilde",aq:"Midtstilt bilde",ar:"Høyrejustert bilde",as:"Anchor",at:"Laster opp fil",au:"Widget toolbar",av:"Øk innrykk",aw:"Reduser innrykk",ax:"Lenke",ay:"Venstrejuster",az:"Høyrejuster",ba:"Midtstill",bb:"Blokkjuster",bc:"Tekstjustering",bd:"Verktøylinje for tekstjustering",be:"Sett inn kodeblokk",bf:"Kunne ikke finne URL for bilde med endret størrelse.",bg:"Kunne ikke velge bilde med endret størrelse",bh:"Kunne ikke sette inn bilde på gjeldende posisjon.",bi:"Innsetting av bilde mislyktes",bj:"Unanchor",bk:"Edit anchor",bl:"Lagre",bm:"Avbryt",bn:"Anchor name",bo:"Tekstredigeringsverktøy for rik tekst",bp:"Skriftfarge",bq:"Uthevingsfarge for tekst",br:"Skrifttypefamilie",bs:"Standard",bt:"Skriftstørrelse",bu:"Veldig liten",bv:"Liten",bw:"Stor",bx:"Veldig stor",by:"Ren tekst",bz:"%0 av %1",ca:"Forrige",cb:"Neste",cc:"Verktøylinje for nedtrekksliste",cd:"Fjern farge",ce:"Dokumentfarger",cf:"Verktøylinje for redigeringsverktøy",cg:"Vis flere elementer",ch:"Svart",ci:"Svak grå",cj:"Grå",ck:"Lysegrå",cl:"Hvit",cm:"Rød",cn:"Oransje",co:"Gul",cp:"Lysegrønn",cq:"Grønn",cr:"Akvamarin",cs:"Turkis",ct:"Lyseblå",cu:"Blå",cv:"Lilla",cw:"Åpne i ny fane",cx:"Nedlastbar",cy:"Fjern lenke",cz:"Rediger lenke",da:"Åpne lenke i ny fane",db:"Denne lenken mangler en URL",dc:"Lenke-URL",dd:"Angre",de:"Gjør om",df:"Endre tekstalternativ til bildet",dg:"Paste the media URL in the input.",dh:"Tip: Paste the URL into the content to embed faster.",di:"Media-URL",dj:"Avsnitt",dk:"Overskrift 1",dl:"Overskrift 2",dm:"Overskrift 3",dn:"Overskrift 4",do:"Overskrift 5",dp:"Overskrift 6",dq:"Tekstredigeringsverktøy for rik tekst, %0",dr:"Tekstalternativ"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); | 2,699 | 2,699 | 0.735087 |
d5f8bb1865f5f858052f8e66c996f15fc5e76992 | 6,515 | js | JavaScript | src/components/BottomNavigationBot/PageInformation/index.js | kohdataan/kohdataan-frontend | 1f8e69bd8e293a33e0308d01b9de18fa860aca2a | [
"MIT"
] | 7 | 2019-04-05T07:17:57.000Z | 2019-07-04T15:26:48.000Z | src/components/BottomNavigationBot/PageInformation/index.js | kohdataan/kohdataan-frontend | 1f8e69bd8e293a33e0308d01b9de18fa860aca2a | [
"MIT"
] | 270 | 2019-04-03T13:17:52.000Z | 2022-02-28T04:05:29.000Z | src/components/BottomNavigationBot/PageInformation/index.js | kohdataan/kohdataan-frontend | 1f8e69bd8e293a33e0308d01b9de18fa860aca2a | [
"MIT"
] | 1 | 2019-05-28T12:20:12.000Z | 2019-05-28T12:20:12.000Z | import React, { memo } from 'react'
import PropTypes from 'prop-types'
import './styles.scss'
import ButtonContainer from '../../ButtonContainer'
const PageInformation = (props) => {
const { handleClick, path, direct, inChat, channelName } = props
let text = ''
let page
const regexForProfileLink = /\/profile\/[a-z0-9.-]+/i
if (regexForProfileLink.test(path)) {
page = '/member-profile'
} else if (inChat && direct) {
page = '/private-chat'
} else if (inChat && !direct) {
if (channelName === 'off-topic') {
page = '/themes'
} else if (channelName === 'town-square') {
page = '/town-square'
} else {
page = '/group-chat'
}
} else {
page = path
}
switch (page) {
case '/me':
text = `Tämä on oma profiilisi.
\nTäällä näet omat profiilitietosi. Nämä tiedot näkyvät myös muille käyttäjille.
\nTäältä pääset muokkaamaan tietojasi ja kiinnostuksen kohteitasi.
\nJos haluat muokata tietojasi tai kiinnostuksen kohteitasi, valitse "Muokkaa".`
break
case '/edit-me':
text = `Täällä voit muokata profiiliasi.
\nVoit vaihtaa oman kuvan. Kuva voi olla BMP-, JPG- tai PNG-tiedosto. Tiedoston koko voi olla enintään 50 MB.
\nVoit muuttaa nimesi ja asuinpaikkasi. Voit valita näkyykö ikäsi ja asuinpaikkasi muille käyttäjille. Voit myös muokata kuvausta, jossa kerrot itsestäsi.
\nMuista tallentaa muutokset!`
break
case '/friends':
text = `Täällä näet kaikki kaverisi.
\nTäällä näet, ovatko kaverisi lähettäneet sinulle uusia viestejä.
\nKaikki käyttäjät, joiden kanssa olet viestitellyt kahdestaan, ovat kavereitasi.
\nVoit lähettää toiselle käyttäjälle yksityisviestin hänen profiilistaan. Pääset toisen käyttäjän profiiliin ryhmän kautta, kun klikkaat ryhmässä hänen kuvakettaan.
\nJos et halua enää viestitellä kaverin kanssa, voit estää hänet. Voit laittaa eston päälle ja myöhemmin poistaa sen, kun klikkaat kaverin nimen perässä olevia pisteitä.`
break
case '/edit-interests':
text = `Täällä voit muokata kiinnostuksen kohteitasi.
\nVoit lisätä uusia tai poistaa vanhoja kiinnostuksen kohteita klikkaamalla niitä.
\nVoit valita 3-5 kohdetta.
\nMuista tallentaa muutokset!`
break
case '/':
text = `Täällä näet kaikki ryhmäsi.
\nTäällä näet uudet ryhmät, joita ehdotamme sinulle. Ehdotamme sinulle joka päivä uusia ryhmiä. Voit itse valita mihin ryhmiin liityt.
\nTäällä näet myös kaikki omat ryhmät, joihin olet jo liittynyt. Näet, onko ryhmiin tullut uusia viestejä. Pääset keskustelemaan muiden ryhmäläisten kanssa, kun klikkaat ryhmän kuvaketta.
\nVoit kuulua korkeintaan viiteen ryhmään. Jos kuulut jo viiteen ryhmään, ja haluat liittyä uuteen ryhmään, sinun täytyy ensin poistua jostain vanhasta ryhmästä.`
break
case '/group-chat':
text = `Täällä voit keskustella muiden ryhmäläisten kanssa.
\nVoit kirjoittaa ja lähettää kuvia, videoita ja ääniviestejä.
\nKun klikkaat ryhmän nimeä, näet ryhmän tiedot. Näet ryhmän jäsenet, ja milloin he ovat olleet paikalla. Näet myös, mitkä asiat ryhmän jäseniä kiinnostaa.
\nKun klikkaat ryhmän jäsenen nimeä, näet hänen profiilinsa. Profiilissa voit lähettää hänelle yksityisen viestin.
\nTäällä voit myös poistua ryhmästä. Muista, että jos poistut ryhmästä, et voi palata siihen takaisin.
\nJos et käy Kohdataan-somessa yli kuukauteen, sinut poistetaan automaattisesti kaikista pienistä keskusteluryhmistä. Kaikki tietosi, kaverisi ja viestittelysi pysyvät palvelussa. Kun tulet palveluun uudestaan, voit liittyä uusiin ryhmiin ja tutustua uusiin ihmisiin.
\nJos huomaat keskustelussa asiattoman viestin tai viestejä, voit ilmoittaa siitä valvojalle. Valvoja voi poistaa viestin. Valvoja voi tarvittaessa myös liittyä keskusteluun. Valvojalla on pääsy kaikkiin ryhmäkeskusteluihin.`
break
case '/member-profile':
text = `Tämä on toisen käyttäjän profiili.
\nTäällä näet tiedot, jotka hän haluaa kertoa itsestään muille käyttäjille.
\nJos haluat jutella käyttäjän kanssa kahdestaan, voit lähettää hänelle yksityisen viestin.
\nKäyttäjät, joiden kanssa viestittelet kahdestaan, näkyvät Kavereissasi.`
break
case '/private-chat':
text = `Täällä voit keskustella kaverisi kanssa kahdestaan.
\nVoit kirjoittaa ja lähettää kuvia, videoita ja ääniviestejä.
\nNäitä yksityisiä viestejä ei näe kukaan muu.`
break
case '/account':
text = `Täällä näet omat rekisteröitymistietosi. Nämä tiedot eivät näy muille käyttäjille.
\nTäällä voit muokata tietojasi, jos esimerkiksi sukunimesi, sähköpostisi tai puhelinnumerosi vaihtuu.
\nTäällä voit myös poistaa käyttäjätilisi kokonaan. Kun poistat käyttäjätilisi, poistamme sen palvelusta viikon päästä. Jos haluat jatkaa palvelun käyttöä, kirjaudu palveluun ennen kuin viikko on kulunut. Kun poistat käyttäjätilisi, viestisi jäävät palveluun nimettömänä.`
break
case '/themes':
text = `Täällä järjestämme kaikille avoimia, eri aiheisiin liittyviä ohjattuja keskusteluja.
\nRyhmä on auki vain keskustelujen ajan.
\nKaikki käyttäjät kuuluvat tähän ryhmään, joten ryhmään lähetetyt viestit näkyvät kaikille.
\nJos haluat lähettää valvojalle viestin, jota muut eivät näe, voit tehdä sen botin kautta.`
break
case '/town-square':
text = `Tässä ryhmässä voit jutella kaikkien muiden käyttäjien kanssa.
\nRyhmä on auki arkisin klo 9-21.
\nValvojat ovat ryhmässä arkisin 9-17.
\nKaikki käyttäjät kuuluvat tähän ryhmään, joten ryhmään lähetetyt viestit näkyvät kaikille.
\nJos haluat lähettää valvojalle viestin, jota muut eivät näe, voit tehdä sen botin kautta.`
break
default:
}
return (
<div className="page-information-container">
<div className="page-info-text-content">{text}</div>
<ButtonContainer className="button button-close" onClick={handleClick}>
Sulje
</ButtonContainer>
</div>
)
}
PageInformation.propTypes = {
handleClick: PropTypes.func.isRequired,
path: PropTypes.string,
direct: PropTypes.bool,
inChat: PropTypes.bool,
channelName: PropTypes.string,
}
PageInformation.defaultProps = {
direct: false,
inChat: false,
path: null,
channelName: null,
}
export default memo(PageInformation)
| 52.12 | 280 | 0.718035 |
d5f93364e96d2cf6c7ac1b6e03d39661e7d8ab6e | 1,153 | js | JavaScript | lib/db.js | cristhian2121/playGroundGraphQL | 78126d4ea05d83f87d2b0b1701c6185adc490781 | [
"MIT"
] | null | null | null | lib/db.js | cristhian2121/playGroundGraphQL | 78126d4ea05d83f87d2b0b1701c6185adc490781 | [
"MIT"
] | null | null | null | lib/db.js | cristhian2121/playGroundGraphQL | 78126d4ea05d83f87d2b0b1701c6185adc490781 | [
"MIT"
] | null | null | null | 'use strict'
const { MongoClient } = require('mongodb')
const {
DB_USER,
DB_PASSWD,
DB_HOST,
DB_NAME
} = process.env
const mongoUrl = `mongodb+srv://${DB_USER}:${DB_PASSWD}@${DB_HOST}/${DB_NAME}?retryWrites=true&w=majority`
let connection
async function connectDB () { // return connection
if (connection) return connection
let client
try {
client = await MongoClient.connect(mongoUrl, {
useNewUrlParser: true
})
connection = client.db(DB_NAME)
console.log("Connect successfly to mongoDb");
} catch (error) {
console.error('Could not connect to db', mongoUrl, error)
process.exit(1)
}
return connection
}
module.exports = connectDB
// [
// {
// "title": "Mi titulo",
// "teacher": "Mi profesor",
// "description": "una descripcion",
// "topic": "programcion"
// },
// {
// "title": "Mi titulo 2",
// "teacher": "Mi profesor2",
// "description": "una descripcion2",
// "topic": "programcion2"
// },
// {
// "title": "Mi titulo 3",
// "teacher": "Mi profesor3",
// "description": "una descripcion3",
// "topic": "programcion3"
// }
// ] | 20.963636 | 106 | 0.601908 |
d5f94f925e39b1c36e91080eb3bb36d5128e3fe5 | 7,251 | js | JavaScript | lib/socket.js | wangshijun/mixin-node-sdk | 34740a709e166ea7eab0423360a84bbdcd5b7767 | [
"MIT"
] | 15 | 2018-12-03T09:08:19.000Z | 2019-12-24T17:35:51.000Z | lib/socket.js | wangshijun/mixin-node-client | 34740a709e166ea7eab0423360a84bbdcd5b7767 | [
"MIT"
] | 16 | 2018-12-02T12:58:31.000Z | 2022-02-12T07:28:18.000Z | lib/socket.js | wangshijun/mixin-node-client | 34740a709e166ea7eab0423360a84bbdcd5b7767 | [
"MIT"
] | 8 | 2018-12-03T09:09:57.000Z | 2019-12-13T13:51:04.000Z | /**
* Websocket client that can reconnect on failure
*
* Please note that this file is refactored from https://github.com/virushuo/mixin-node/blob/master/ws-reconnect.js
* Debug feature is added
*
* Data Structure for Mixin WebSocket Message Object (named as `msgObj` in following context)
*
* {
* id: 'e1e850e3-2a5a-4510-a18d-20a6267a9d87',
* action: 'CREATE_MESSAGE',
* data: {
* type: 'message',
* representative_id: '',
* quote_message_id: '',
* conversation_id: '1514dd62-0127-398c-b95a-012d841de265',
* user_id: '7701e7bf-2a86-4655-982e-023564fa8945',
* message_id: '93c7dcbb-c72c-499f-bb2e-64450dcad852',
* category: 'PLAIN_TEXT',
* data: 'emhlIHNoaSBnZSBzaGE=',
* status: 'SENT',
* source: 'CREATE_MESSAGE',
* created_at: '2018-12-02T07:36:41.764171Z',
* updated_at: '2018-12-02T07:36:41.764171Z',
* },
* }
*/
const zlib = require('zlib');
const util = require('util');
const WebSocket = require('ws');
const camelcase = require('camelcase');
const interval = require('interval-promise');
const debug = require('debug')(`${require('../package.json').name}:socket`);
const { types, createMessage } = require('./message');
const BaseClient = require('./base');
class SocketClient extends BaseClient {
constructor(args) {
super(args);
const socketUrl = args.socketUrl || 'wss://blaze.mixin.one/';
const socketProtocols = args.socketProtocols || 'Mixin-Blaze-1';
this.autoStart = args.autoStart || true;
this.listPendingMessage = args.listPendingMessage || true;
this.url = socketUrl && socketUrl.indexOf('ws') === -1 ? 'ws://' + socketUrl : socketUrl;
this.protocols = socketProtocols;
this.socket = null;
this.isConnected = false;
this.reconnectTimeoutId = 0;
this.reconnectInterval = args.reconnectInterval === undefined ? 5 : args.reconnectInterval;
this.shouldAttemptReconnect = Boolean(this.reconnectInterval);
this._initMessageSenders();
if (this.autoStart) {
this.start();
}
}
start() {
const headers = {
Authorization: `Bearer ${this.getJwtToken('GET', '/', '')}`,
perMessageDeflate: false,
};
this.shouldAttemptReconnect = Boolean(this.reconnectInterval);
this.isConnected = false;
this.socket = new WebSocket(this.url, this.protocols, { headers });
this.socket.onmessage = this._onMessage.bind(this);
this.socket.onopen = this._onOpen.bind(this);
this.socket.onerror = this._onError.bind(this);
this.socket.onclose = this._onClose.bind(this);
interval(async (iteration, _) => {
debug('heartbeat check', { iteration });
try {
await this.ping();
} catch (err) {
this.socket.terminate();
this.start();
}
}, 30 * 1000);
}
destroy() {
clearTimeout(this.reconnectTimeoutId);
this.shouldAttemptReconnect = false;
this.socket.close();
}
sendRaw(message) {
debug('sendRawMessage', message);
return new Promise((resolve, reject) => {
try {
const buffer = Buffer.from(JSON.stringify(message), 'utf-8');
zlib.gzip(buffer, (_, zipped) => {
if (this.socket.readyState === WebSocket.OPEN) {
this.socket.send(zipped);
resolve();
} else {
reject(new Error('Socket connection not ready'));
}
});
} catch (err) {
reject(err);
}
});
}
_initMessageSenders() {
this.messageSenders = [];
if (typeof this.sendRaw !== 'function') {
return;
}
Object.keys(types).forEach(x => {
const key = camelcase(['send', x]);
this[key] = async (data, msgObj) => {
const message = createMessage(x, { conversationId: msgObj.data.conversation_id, [x]: data }, this.getUUID);
return this.sendRaw(message);
};
debug(`Generate message sender fn: ${key}`);
this.messageSenders.push(key);
});
}
/**
* Wrap a message handler to auto confirm message recipient after handling
* @param {*} messageId
*/
getMessageHandler(handler) {
const promised = util.promisify(handler);
return message => {
promised(message).then(result => {
if (
message.action &&
message.action !== 'ACKNOWLEDGE_MESSAGE_RECEIPT' &&
message.action !== 'LIST_PENDING_MESSAGES'
) {
return new Promise((resolve, reject) => {
this.sendRaw({
id: this.getUUID(),
action: 'ACKNOWLEDGE_MESSAGE_RECEIPT',
params: {
message_id: message.data.message_id,
status: 'READ',
},
})
.then(() => resolve(result))
.catch(reject);
});
}
return result;
});
};
}
/**
* Enable pending message fetching
*/
listPendingMessages() {
return new Promise((resolve, reject) => {
const id = this.getUUID();
this.sendRaw({ id, action: 'LIST_PENDING_MESSAGES' })
.then(() => resolve(id))
.catch(reject);
});
}
/**
* Decode message to normalized object
* @param {*} data
*/
decode(data) {
return new Promise((resolve, reject) => {
try {
zlib.gunzip(data, (err, unzipped) => {
if (err) {
return reject(err);
}
const msgObj = JSON.parse(unzipped.toString());
// TODO: decode messages automatically
if (msgObj && msgObj.action === 'CREATE_MESSAGE' && msgObj.data && msgObj.data.category === 'PLAIN_TEXT') {
msgObj.data.data = Buffer.from(msgObj.data.data, 'base64').toString('utf-8');
}
resolve(msgObj);
});
} catch (err) {
reject(err);
}
});
}
ping() {
return new Promise((resolve, reject) => {
try {
this.socket.ping();
let pong = false;
this.socket.once('pong', () => {
pong = true;
resolve();
});
setTimeout(() => {
if (!pong) {
reject(new Error('timeout'));
}
}, 5000);
} catch (err) {
reject(err);
}
});
}
_onOpen() {
this.isConnected = true;
debug('is connected');
this.emit('connect');
if (this.listPendingMessage) {
this.listPendingMessages().then(receiptId => {
debug(`List pending message: ${receiptId}`);
});
}
}
_onClose(event) {
if (this.shouldAttemptReconnect) {
this.emit('closed', event);
clearTimeout(this.reconnectTimeoutId);
this.reconnectTimeoutId = setTimeout(() => {
this.emit('reconnect');
this.start();
}, this.reconnectInterval * 1000);
} else {
this.emit('destroyed', event);
}
}
_onMessage(message) {
debug('onMessage.raw', message.data);
this.decode(message.data)
.then(decoded => {
debug('onMessage.decoded', decoded);
this.emit('message', decoded);
})
.catch(err => {
console.error('SocketClient.decodeError', err);
this.emit('error', err);
});
}
_onError(event) {
this.emit('error', event);
}
}
module.exports = SocketClient;
| 27.675573 | 117 | 0.574817 |
d5f9e63fcfcb410506aa87cb475a85878a87c32e | 481 | js | JavaScript | ReservaSala/Scripts/somenteNumero.js | reservaSala/reservasala_tcs | fa43f1363ccb6f2b25156608162e6b15dc3ffea3 | [
"MIT"
] | null | null | null | ReservaSala/Scripts/somenteNumero.js | reservaSala/reservasala_tcs | fa43f1363ccb6f2b25156608162e6b15dc3ffea3 | [
"MIT"
] | null | null | null | ReservaSala/Scripts/somenteNumero.js | reservaSala/reservasala_tcs | fa43f1363ccb6f2b25156608162e6b15dc3ffea3 | [
"MIT"
] | null | null | null | $('#somenteNumeros').keypress(function (num) {
//var er = /[^0-9.]/;
//er.lastIndex = 0;
//var campo = num;
//if (er.test(campo.value)) {
// campo.value = "";
//}
var keyCode = (num.keyCode ? num.keyCode : num.which);
if (!(keyCode > 47 && keyCode < 58)) {
num.preventDefault();
}
});
$(document).ready(function () {
$('#somenteNumeros').bind('cut copy paste', function (event) {
event.preventDefault();
});
}); | 24.05 | 66 | 0.517672 |
d5fa259adb6c70fc3a7b0d53adc7af27cdb228f5 | 582 | js | JavaScript | helpers/createClass.js | yiminghe/babel-loose-runtime | a22c0312d9df58fe81d80de39f6d713bbe2f3be9 | [
"MIT"
] | 1 | 2017-10-01T16:16:32.000Z | 2017-10-01T16:16:32.000Z | helpers/createClass.js | yiminghe/babel-loose-runtime | a22c0312d9df58fe81d80de39f6d713bbe2f3be9 | [
"MIT"
] | 2 | 2017-10-01T16:19:14.000Z | 2017-10-30T13:47:40.000Z | helpers/createClass.js | yiminghe/babel-runtime-loose | a22c0312d9df58fe81d80de39f6d713bbe2f3be9 | [
"MIT"
] | null | null | null | function defineProperties(target, props) {
props.forEach(function t(descriptor) {
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ('value' in descriptor) {
descriptor.writable = true;
}
Object.defineProperty(target, descriptor.key, descriptor);
});
}
module.exports = function createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
defineProperties(Constructor.prototype, protoProps);
}
if (staticProps) {
defineProperties(Constructor, staticProps);
}
return Constructor;
};
| 27.714286 | 77 | 0.716495 |
d5fa486042aa3022e9d1169637e6fcf23a49e3ef | 2,494 | js | JavaScript | app/scripts/views/homeMap.view.js | jdavidhermoso/quidditch-teams-browser | e53a5c936e16da97ae3583b2902097c3b352bc67 | [
"MIT"
] | null | null | null | app/scripts/views/homeMap.view.js | jdavidhermoso/quidditch-teams-browser | e53a5c936e16da97ae3583b2902097c3b352bc67 | [
"MIT"
] | null | null | null | app/scripts/views/homeMap.view.js | jdavidhermoso/quidditch-teams-browser | e53a5c936e16da97ae3583b2902097c3b352bc67 | [
"MIT"
] | null | null | null | var app = app || {};
app.HomeMapView = Backbone.View.extend({
markers: [],
markerCluster: {},
currentInfoWindow: {},
infoWindowTpl: _.template($('#map_infoWindow').html()),
map: {},
mapOptions: {
center: {
//Madrid
lat: 40.415363, lng: -3.707398
},
zoom: 6
},
el: '#qtb_home_map',
events: {},
ui: {
'search_input': '#search_input',
'results_list': '#search_form_results_list',
'last_teams_list': '#last_teams_list',
'search_button': '#search_button'
},
initialize: function () {
var view = this;
this.map = new google.maps.Map($(this.el)[0], this.mapOptions);
google.maps.event.addListenerOnce(this.map, 'tilesloaded', function() {});
this.setMapTeamsURL();
app.teamsCollection.fetch({
reset: true,
success: function () {
view.$(view.ui.last_teams_list).empty();
app.mainView.toggleSpinner(false);
app.teamsCollection.each(function (team) {
view.renderMapTeams(team);
}, this);
var options = {
imagePath: 'dist/images/markers'
};
//view.markerCluster = new MarkerClusterer(view.map, view.markers, options);
},
error: function () {
view.$(view.ui.last_teams_list).empty();
}
});
},
setMapTeamsURL: function () {
app.teamsCollection.url = app.teamsCollection.urls.mapTeamsUrl;
},
addMarker: function (teamData) {
var view = this,
marker = new google.maps.Marker({
position: {lat: parseFloat(teamData.get('lat')), lng: parseFloat(teamData.get('lng'))},
icon: this.pinSymbol("rgba(150, 1, 1, 0.8)"),
map: this.map
});
this.markers.push(marker);
marker.addListener('click', function () {
view.renderInfoWindow(teamData).open(view.map, marker);
});
},
pinSymbol: function (color) {
return {
path: 'M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30 a 2,2 0 1,1 4,0 2,2 0 1,1 -4,0',
fillColor: color,
fillOpacity: 0.8,
strokeColor: '#000',
strokeWeight: 1,
scale: 1
};
},
renderMapTeams: function (team) {
this.addMarker(team, this.map);
},
renderInfoWindow: function (team) {
if (!_.isEmpty(this.currentInfoWindow)) {
this.currentInfoWindow.close();
}
this.currentInfoWindow = new google.maps.InfoWindow({
content: this.infoWindowTpl(team.toJSON())
});
return this.currentInfoWindow;
}
});
| 25.71134 | 127 | 0.593825 |
d5fa7d23a6ec5d4847d5f4c188d52f54e3ddf309 | 3,316 | js | JavaScript | src/components/StoriesComponent.js | codeclassifiers/storiesfeedapp | c87b59aab56806530d45dadf7eeb5ca2be6263a3 | [
"MIT"
] | 4 | 2021-09-17T16:35:02.000Z | 2022-01-07T13:52:39.000Z | src/components/StoriesComponent.js | codeclassifiers/storiesfeedapp | c87b59aab56806530d45dadf7eeb5ca2be6263a3 | [
"MIT"
] | null | null | null | src/components/StoriesComponent.js | codeclassifiers/storiesfeedapp | c87b59aab56806530d45dadf7eeb5ca2be6263a3 | [
"MIT"
] | 2 | 2021-09-18T04:41:27.000Z | 2021-09-24T15:18:05.000Z | import React, { useState } from "react";
import Stories from "react-insta-stories";
import { useRouteMatch, useHistory } from "react-router-dom";
import StoriesData from "../dataSource/storiesData";
import Fade from "react-reveal/Fade";
import "./StoriesComponent.css";
export default function StoriesSection() {
const [loading, setLoading] = useState(true);
const match = useRouteMatch();
const history = useHistory();
function redirectToHome() {
history.push("/");
}
function renderLoading() {
return (
<div className="flex justify-center items-center">
<svg class="loader animate-spin"></svg>
</div>
);
}
function getStoriesObject() {
const category = match.params.categoryName;
const stories = StoriesData[category].map((item) => {
if (item.type === "imageCaptionPost") {
return {
content: (props) => (
<div className="story-container bg-black w-screen h-screen flex items-start justify-center">
<div
className="w-full h-full bg-black max-w-screen-md flex items-center justify-center flex-col bg-center bg-no-repeat"
style={{ backgroundImage: `url(${item.image})` }}
>
<div
className="mt-12 caption text-5xl font-bold"
style={{ color: item.captionColor }}
>
<span>{item.caption}</span>
</div>
</div>
</div>
),
};
} else if (item.type === "titleImageTextPost") {
return {
content: (props) => (
<div
className="story-container h-screen w-screen bg-center bg-no-repeat bg-black text-white font-bold flex items-start justify-center"
style={{ backgroundColor: item.bgColor }}
>
<div className="max-w-screen-md flex items-center justify-center flex-col">
<div className="mt-10 text-x">
<span>{item.title}</span>
</div>
<div className="flex flex justify-center items-center mt-2 text-story-image-container">
<div style={{ display: loading ? "block" : "none" }}>
{renderLoading()}
</div>
<div style={{ display: loading ? "none" : "block" }}>
<img
src={item.image}
alt="stories"
className="h-6/12"
onLoad={() => setLoading(false)}
/>
</div>
</div>
<div className="mt-6 caption text-lg text-left mx-3 max-w-screen-md">
<span className="whitespace-pre-wrap">{item.text}</span>
</div>
</div>
</div>
),
};
} else {
return null;
}
});
return stories;
}
return (
<div className="stories-container w-screen h-screen">
<Fade right>
<Stories
stories={getStoriesObject()}
defaultInterval={5000}
width={"100%"}
height="100vh"
onAllStoriesEnd={redirectToHome}
onStoryEnd={() => setLoading(true)}
/>
</Fade>
</div>
);
}
| 35.276596 | 144 | 0.512967 |
d5fc081820123a51c8bf18e5feb21d77d2ea354b | 2,113 | js | JavaScript | public/js/player.js | labelcarrote/anonball | b566627c0bb34e824afb9659c637ccab9994c2e7 | [
"MIT"
] | null | null | null | public/js/player.js | labelcarrote/anonball | b566627c0bb34e824afb9659c637ccab9994c2e7 | [
"MIT"
] | null | null | null | public/js/player.js | labelcarrote/anonball | b566627c0bb34e824afb9659c637ccab9994c2e7 | [
"MIT"
] | null | null | null | class Player{
constructor(gm){
this.gm = gm;
this.pose = null;
this.anonbar = null;
this.sumotrunk = null;
// ---- KEYPOINTS
// Id Part
// 0 nose
// 1 leftEye
// 2 rightEye
// 3 leftEar
// 4 rightEar
// 5 leftShoulder
// 6 rightShoulder
// 7 leftElbow
// 8 rightElbow
// 9 leftWrist
// 10 rightWrist
// 11 leftHip
// 12 rightHip
// 13 leftKnee
// 14 rightKnee
// 15 leftAnkle
// 16 rightAnkle
this.MAX_KEYPOINTS = 17;
this.POSE_PROBABILITY_THRESHOLD = 0.75;
}
update(pose){
this.pose = pose;
// anonbar
let nose = pose.keypoints[0];
let left_eye = pose.keypoints[1];
let right_eye = pose.keypoints[2];
if(this.anonbar !== null){
this.anonbar.update(left_eye,right_eye,nose);
}else{
this.anonbar = new AnonBar(this.gm, left_eye, right_eye, nose);
}
// sumotrunk
let left_hip = pose.keypoints[11];
let right_hip = pose.keypoints[12];
if(this.sumotrunk !== null){
this.sumotrunk.update(left_hip,right_hip);
}else{
this.sumotrunk = new SumoTrunk(this.gm, left_hip, right_hip);
}
}
draw(){
if(this.anonbar !== null)
this.anonbar.draw();
if(this.sumotrunk !== null)
this.sumotrunk.draw();
if(this.pose !== null){
this.drawKeypoints();
// // body connections
// let skeleton = this.pose.keypoints;
// stroke(255, 0, 0);
// fill(255, 0, 0);
// for (let j = 0; j < skeleton.length; j++) {
// let partA_position = skeleton[j].position;
// let partB_position = skeleton[j].position;
// line(partA_position.x, partA_position.y, partB_position.x, partB_position.y);
// }
}
}
drawKeypoints() {
fill(255, 0, 0);
noStroke();
let keypoints_limit = Math.min(this.MAX_KEYPOINTS,this.pose.keypoints.length)
for (let j = 0; j < keypoints_limit; j++) {
let keypoint = this.pose.keypoints[j];
if (keypoint.score > this.POSE_PROBABILITY_THRESHOLD) {
ellipse(keypoint.position.x, keypoint.position.y, 10, 10);
}
}
}
} | 24.287356 | 84 | 0.592996 |
d5fcd9363de43b73018ab9ec604812c98f8abbff | 1,081 | js | JavaScript | document-rh-route.js | IssamGu/Application-Rh-for-a-society | 86eedad5cfdc18d8a928614a1cb42085fba89fe5 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:08:02.000Z | 2022-03-07T10:08:02.000Z | document-rh-route.js | IssamGu/Application-Rh-for-a-society | 86eedad5cfdc18d8a928614a1cb42085fba89fe5 | [
"Apache-2.0"
] | null | null | null | document-rh-route.js | IssamGu/Application-Rh-for-a-society | 86eedad5cfdc18d8a928614a1cb42085fba89fe5 | [
"Apache-2.0"
] | null | null | null | var express = require('express');
var router = express.Router();
const document_rh_controller = require('../controllers/document-rh-controller');
const requireAuth = require('../middleware/requireAuth');
const requireLogin = require('../middleware/requireLogin');
/** ask for a human resource document */
router.post('/api/ask-for-document', requireAuth, document_rh_controller.ask_document)
/** get my asked documents */
router.get('/api/get-my-documents', requireAuth, document_rh_controller.get_my_documents)
/** Responsable: generate the asked document */
router.put('/api/generate-document/:id', requireAuth ,document_rh_controller.generate_document)
/** Responsable: Get employee demands */
router.get('/api/get-all-demands', requireAuth ,document_rh_controller.get_all_demands)
/** Responsable: Delete one document */
router.delete('/api/delete-document/:id', requireAuth , document_rh_controller.delete_document)
/** get not treated demands */
router.get('/api/get-non-treated', requireAuth, document_rh_controller.get_nonTreatedDocuments)
module.exports = router | 41.576923 | 95 | 0.776133 |
d5fcfcdf05640d09a513380f99692013054c8144 | 42 | js | JavaScript | 14.Workshop-Advanced-Techniques/test-react/src/components/Circle/Index.js | Shtekata/14.Softuni-ReactJS | 5d1ce67681a650b23095a945033e91c2628e0195 | [
"MIT"
] | null | null | null | 14.Workshop-Advanced-Techniques/test-react/src/components/Circle/Index.js | Shtekata/14.Softuni-ReactJS | 5d1ce67681a650b23095a945033e91c2628e0195 | [
"MIT"
] | null | null | null | 14.Workshop-Advanced-Techniques/test-react/src/components/Circle/Index.js | Shtekata/14.Softuni-ReactJS | 5d1ce67681a650b23095a945033e91c2628e0195 | [
"MIT"
] | null | null | null | export {CircleWithBorder} from './Circle'
| 21 | 41 | 0.761905 |
d5fd0a6e785b9cde609e4a08ced3a2488c370f9e | 2,103 | js | JavaScript | index.js | aligilan/loading | 4ac46dbd6d95c272d93a8cc7cb2083ef49f9b5ce | [
"MIT"
] | null | null | null | index.js | aligilan/loading | 4ac46dbd6d95c272d93a8cc7cb2083ef49f9b5ce | [
"MIT"
] | null | null | null | index.js | aligilan/loading | 4ac46dbd6d95c272d93a8cc7cb2083ef49f9b5ce | [
"MIT"
] | null | null | null | 'use strict'
module.exports = class Loading {
manage_loading(){
//set target-element
if(typeof this.target === "object"){
this.target_element = this.target;
}else if(typeof this.target === 'string'){
this.target_element = document.querySelector(this.target);
}else{
console.log('Show loading Error: target type not support ....')
}
// Disable button on loading
this.manage_button()
}
toggle_loading(){
this.manage_loading();
if(!this.target_element.classList.contains('overlay-container')){
this.show_loading();
}else{
this.hide_loading();
}
}
show_loading(){
this.manage_loading();
if(!this.target_element) return;
this.target_element.classList.add('overlay-container');
let overlay_node = document.createElement('div');
overlay_node.classList.add('my-overlay');
let spinner_node = document.createElement('div');
spinner_node.classList.add('spinner');
overlay_node.appendChild(spinner_node);
this.target_element.appendChild(overlay_node);
}
hide_loading(){
this.manage_loading();
if(!this.target_element) return;
this.target_element.classList.remove('overlay-container');
let my_overlay = this.target_element.getElementsByClassName('my-overlay')[0];
if(!!my_overlay){
my_overlay.remove();
}
}
manage_button(){
if(!this.target_element) return ;
if(this.target_element.nodeName === 'button' || this.target_element.type === 'submit'){
this.target_element.disabled = !!!this.target_element.classList.contains('overlay-container')
}
}
toggle(target){
this.target = target;
this.toggle_loading();
}
show(target){
this.target = target;
this.show_loading();
}
hide(target){
this.target = target;
this.hide_loading();
}
} | 29.619718 | 105 | 0.583452 |
d5fd263017a0c25243929249b26399f1098732cc | 97 | js | JavaScript | work/examplefmOX.js | stinsonga/geo-prime-workspace | 809669151912bd1da839334b4a673c5070177477 | [
"CC0-1.0"
] | null | null | null | work/examplefmOX.js | stinsonga/geo-prime-workspace | 809669151912bd1da839334b4a673c5070177477 | [
"CC0-1.0"
] | null | null | null | work/examplefmOX.js | stinsonga/geo-prime-workspace | 809669151912bd1da839334b4a673c5070177477 | [
"CC0-1.0"
] | null | null | null | function my_function025(){
//77130442840865760473664532659303ZgAJCfVryfCubqnGxpBuRChyHRVCAYux
}
| 24.25 | 66 | 0.886598 |
d5fd45ec5a4f4f26331aa6c5a9b2b6bad7af6516 | 1,549 | js | JavaScript | modules/cards/client/directives/asteroid-field.client.directive.js | jzlosman/asteroid-harvest-builder | 0fe734504addd163cbf6287e68cb3c4b89e9fc9d | [
"MIT"
] | null | null | null | modules/cards/client/directives/asteroid-field.client.directive.js | jzlosman/asteroid-harvest-builder | 0fe734504addd163cbf6287e68cb3c4b89e9fc9d | [
"MIT"
] | null | null | null | modules/cards/client/directives/asteroid-field.client.directive.js | jzlosman/asteroid-harvest-builder | 0fe734504addd163cbf6287e68cb3c4b89e9fc9d | [
"MIT"
] | null | null | null | (function () {
'use strict';
angular.module('cards')
.directive('asteroidField', asteroidField);
asteroidField.$inject = ['$rootScope', '$timeout', '$interpolate', '$state', '$log', 'CardsService', 'CardsHelper'];
function asteroidField($rootScope, $timeout, $interpolate, $state, $log, CardsService, CardsHelper) {
var directive = {
retrict: 'E',
link: link,
scope: {
cards: '=',
field: '=',
move: '&'
},
template: "" +
"<button ng-click='buildField()'>Build Asteroid Field</button><div class='row'>" +
"<div class='col-xs-4' ng-repeat='card in field track by $index'><div class='asteroid' ng-class='{\"occupied-you\":card.properties.occupied == 1, \"occupied-them\":card.properties.occupied == 2}' ng-click='move({position:$index, isYou:true})'>" +
"<div class='pull-right'><strong><img src='https://s3.amazonaws.com/gettattlemisc/harvest/icons/crushing-ground.svg' style='width:24px;height:auto'/>x{{card.source.amount}}</strong></div>"+
"<div class='pull-left energies'><span class='label label-default {{energy | energyToLabel}}' ng-repeat='energy in card.source.energies'>{{energy}}</span></div></div></div>" +
"</div>"
};
return directive;
function link(scope, element) {
scope.buildField = function() {
var results = CardsHelper.buildHand(scope.cards, 6);
scope.field = results.hand;
scope.cards = results.deck;
$log.log('asteroids deck is now ', scope.cards);
};
}
}
}());
| 40.763158 | 252 | 0.615236 |
d5fdf5f46ce4aaca1ad987a890057c168b0b6cbb | 37,960 | js | JavaScript | src/pages/content.js | elvinsolano/astro-design-system | ce6c758ed252f366b3badb1deaf7419aad3cba40 | [
"MIT"
] | null | null | null | src/pages/content.js | elvinsolano/astro-design-system | ce6c758ed252f366b3badb1deaf7419aad3cba40 | [
"MIT"
] | null | null | null | src/pages/content.js | elvinsolano/astro-design-system | ce6c758ed252f366b3badb1deaf7419aad3cba40 | [
"MIT"
] | null | null | null | import React, { Component } from "react";
import Scrollspy from 'react-scrollspy';
import {Link} from 'gatsby';
import 'lazysizes';
import Layout from "../components/layout";
import SEO from "../components/seo";
import Heading from '../components/atoms/heading';
import Copy from "../components/copy";
import ctaBoard1 from "../assets/content/Call to Action/01 Board of Directors/01 Board of Directors.png";
import ctaBoard2 from "../assets/content/Call to Action/01 Board of Directors/02 Board of Directors.png";
import ctaSalesforce1 from "../assets/content/Call to Action/02 Salesforce/01 Salesforce.png";
import ctaSalesforce2 from "../assets/content/Call to Action/02 Salesforce/02 Salesforce.png";
import ctaTaskList1 from "../assets/content/Call to Action/03 Task List/01 Remind.png";
import ctaTaskList2 from "../assets/content/Call to Action/03 Task List/02 Remind.png";
import nudgesConversational1 from "../assets/content/Nudges/Conversational/Conversational.png";
import nudgesNudge1 from "../assets/content/Nudges/Nudge/Nudge.png";
import nudgesUserUtterances1 from "../assets/content/User Utterances/User Utterances.png";
class ContentPage extends Component {
render() {
return (
<Layout>
<SEO
title="Astro"
keywords={[``, ``]}
/>
<aside className="fixed overflow-y-auto as-nav bg-white top-auto h-full border-r border-grey-500 border-solid">
<div className="as-nav-logo">
<svg
className="fill-current"
width="103"
height="20"
viewBox="0 0 165 32"
xmlns="http://www.w3.org/2000/svg"
>
<path fill="#000" d="M48.972 0c8.177 0 9.686 6.286 9.741 8.781l0.002 0.142v2.029h-4.897v-2.029c0-2.479-1.551-4.462-4.849-4.462-3.155 0-5.235 1.713-5.235 4.281 0 2.854 2.689 4.067 5.682 5.13l0.669 0.234c4.461 1.533 9.116 3.245 9.116 9.555 0 3.967-2.227 8.339-9.794 8.339-10.451 0-10.982-7.286-11.005-8.953l-0.001-2.18h4.851v2.028c0 2.479 1.6 4.643 6.158 4.643 4.315 0 4.897-2.614 4.897-3.877 0-2.685-2.606-3.847-5.548-4.904l-0.658-0.234c-4.461-1.622-9.26-3.335-9.26-9.781 0-2.433 1.503-8.743 10.132-8.743zM92.8 0v4.525h-7.984v27.475h-4.832v-27.475h-7.984v-4.525h20.8zM154.331 0c9.234 0 10.469 7.209 10.469 16s-1.234 16-10.469 16c-9.083 0-10.293-6.974-10.33-15.569v-0.862c0.037-8.595 1.247-15.569 10.33-15.569zM13.494 0l8.906 32h-4.631l-6.592-24.653-6.546 24.653h-4.632l8.906-32h4.587zM118.304 0c9.053 0 10.47 6.125 10.47 10.925 0.001 3.611-0.946 8.827-5.508 9.394v0l6.334 11.682h-5.169l-7.888-14.662 1.761-0.055c5.12-0.183 5.898-2.228 5.853-6.354-0.040-3.52-0.732-6.399-5.853-6.399v0h-4.886v27.465h-4.618v-31.996zM154.331 4.462c-5.211 0-5.714 4.55-5.714 11.535 0 7.029 0.503 11.536 5.714 11.536 5.258 0 5.851-4.506 5.851-11.536 0-6.985-0.594-11.535-5.851-11.535z"></path>
</svg>
</div>
<nav>
<ul className="">
<li><Link to="content" className="block text-sm text-grey-400 w-full active bg-grey-700 font-semibold hover:bg-grey-100" activeClassName="block text-sm text-grey-400 w-full active bg-grey-700 font-semibold hover:bg-grey-100 focus:bg-grey-800 focus:font-semibold">Content</Link>
<Scrollspy items={ ['voicetone','guidelines', 'utterances', 'cta', 'nudges', 'guidance'] } offset={-80} className="block" currentClassName="is-current">
<li><Link to="content#voicetone-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100" activeClassName="active-link">Voice and Tone</Link></li>
<li><Link to="content#guidelines-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100 " activeClassName="active-link">Writing Guidelines</Link></li>
<li><Link to="content#utterances-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100 " activeClassName="active-link">User Utterances</Link></li>
<li><Link to="content#cta-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100" activeClassName="active-link">Call to Action (CTA)</Link></li>
<li><Link to="content#nudges-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100" activeClassName="active-link">Nudges</Link></li>
<li><Link to="content#guidance-anchor" className="block text-sm text-grey-400 pl-16 py-2 w-full hover:bg-grey-100" activeClassName="active-link">Guidance</Link></li>
</Scrollspy>
</li>
</ul>
</nav>
</aside>
<div className="flex flex-col flex-1 mx-auto as-body w-full pb-5.5">
<main className=" pl-16 pr-16 pt-16">
<div className="block md:flex justify-between pb-2 border-b border-greyStatus-200 mb-5">
<Heading level="1" className="as-h1 as-type-medium">Content</Heading>
</div>
<section id="voicetone" name="voicetone" className="as-section">
<span id="voicetone-anchor" className="page-anchor"></span>
<p className="mb-12 text-greyStatus-600 tracking-wider">Astro’s content is designed to create a seamless, efficient and intuitive experience for users. From voice to visual, Astro represents an evolution in the way users access information through a simple voice command or the touch of a button. Our style is sleek but unpretentious, information-driven, but not overwhelming. We seek to deliver insights that make users more efficient, knowledgeable and proactive throughout their day.</p>
<p className="mb-8 text-greyStatus-600 tracking-wider">The full writing guide is <a className="inline text-status-100 hover:text-red-900 underline" rel="noopener noreferrer" target="_blank" href="https://docs.google.com/document/d/1Kv4gH9Ki_0Bj3eEWKpDjdhuRUC_0KsMl-lXGHdiBxPo/edit#heading=h.t7nurv6jq2u1">here</a>.</p>
<Heading level="2" className="as-h2 as-type-medium mb-6">Voice and Tone
<Copy id="voicetone" />
</Heading>
<p className="mb-6 text-greyStatus-600 tracking-wider"><span className="as-type-medium">Voice</span> is what Astro says and does. As a user engagement point, Astro’s voice is <span className="as-type-medium">helpful, trustworthy and approachable.</span></p>
<p className="mb-10 text-greyStatus-600 tracking-wider"><span className="as-type-medium">Tone</span> is Astro’s character or attitude as it talks and behaves. Astro’s tone is <span className="as-type-medium">powerful, insightful and proactive.</span></p>
<div className="mb-10">
<p className="text-sm text-greyStatus-600 uppercase">Helpful</p>
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">"How can I help you today, Mary?"</p>
</div>
<div className="mb-10">
<p className="text-sm text-greyStatus-600 uppercase">Insightful</p>
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">"Your meeting is at 1:00 PM with the CEO of Target. Would you like to see this client’s company insights?"</p>
</div>
<div className="mb-10">
<p className="text-sm text-greyStatus-600 uppercase">Proactive</p>
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">"Your opportunity is expiring on September 4, 2020. Update it now before it expires."</p>
</div>
</section>
<section id="writing-guidelines" name="writing-guidelines" className="as-section">
<span id="writing-guidelines-anchor" className="page-anchor"></span>
<Heading level="2" className="as-h2 as-type-medium mb-6">Writing Guidelines
<Copy id="writing-guidelines" />
</Heading>
<div className="mb-10">
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">We create simple, elegant phrases.</p>
<p className="mb-10 text-greyStatus-600 tracking-wider">Astro's voice responses are direct, conversational and matter-of-fact. Astro will never talk first. It waits for a question in order to surface information.</p>
</div>
<div className="mb-10">
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">We prefer white space.</p>
<p className="mb-10 text-greyStatus-600 tracking-wider">Less is more. Short responses are a must. Information is presented with room to breathe. We aim to make the user’s experience easier –– including reading information in a digestible way.</p>
</div>
<div className="mb-10">
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">We always write with the next step in mind.</p>
<p className="mb-10 text-greyStatus-600 tracking-wider">We surface information in order to propel users to the next step, keeping in mind that their end goal may not be just one answer.</p>
</div>
<div className="mb-10">
<p className="as-type-medium as-h3 text-greyStatus-600 tracking-wider">We protect confidentiality.</p>
<p className="mb-10 text-greyStatus-600 tracking-wider">Astro does not speak any client or personal information aloud. Astro’s generic voice-first approach means responses should use generic language that does not contain sensitive information.</p>
</div>
<div className="mb-10">
<p className="mb-5 text-sm text-greyStatus-600 uppercase">Examples</p>
<div className="flex mb-6">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<p className="as-type-medium text-greyStatus-600 ml-3">"Here are your 15 open opportunities for Acme International."</p>
</div>
<div className="flex mb-10">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<p className="as-type-medium text-greyStatus-600 ml-3">"You have 15 open opportunities worth $45 million for Acme International."</p>
</div>
<div className="flex mb-6">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<p className="as-type-medium text-greyStatus-600 ml-3">"Here’s your elective contribution to your 401k for this year."</p>
</div>
<div className="flex mb-6">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<p className="as-type-medium text-greyStatus-600 ml-3">"Your maximum 401k contribution is $500,000. You’re currently contributing $20,000."</p>
</div>
</div>
</section>
<section id="user-utterances" name="user-utterances" className="as-section">
<span id="user-utterances-anchor" className="page-anchor"></span>
<Heading level="2" className="as-h2 as-type-medium mb-6">User Utterances
<Copy id="user-utterances" />
</Heading>
<div className="flex">
<div className="w-1/2 pr-6">
<p className="mb-10 text-greyStatus-600 tracking-wider">Utterances are how a user asks a question to Astro. Create between 5-8 for each story. When creating utterances, specificity is key. The more specific the language, the higher the probability that the right conversation model will be triggered.</p>
<p className="mb-5 text-sm text-greyStatus-600 uppercase">Examples</p>
<div className="mb-3">
<p className="as-type-medium text-greyStatus-600 mb-6">"Do I have any outstanding invoices?"</p>
<p className="as-type-medium text-greyStatus-600 mb-6">"Can I see my past due bills?"</p>
<p className="as-type-medium text-greyStatus-600 mb-6">"What are my past due ARs?"</p>
<p className="as-type-medium text-greyStatus-600 mb-6">"I need to see my past due receivables?"</p>
<p className="as-type-medium text-greyStatus-600">"Am I overdue in paying my bills?"</p>
</div>
</div>
<div className="w-1/2">
<img data-src={nudgesUserUtterances1} className="lazyload" width="494" alt="Hi, I'm Astro. Ask me about your Invoices" />
</div>
</div>
</section>
<section id="cta" name="cta" className="as-section">
<span id="cta-anchor" className="page-anchor"></span>
<Heading level="2" className="as-h2 as-type-medium mb-6">Call to Action (CTA)
<Copy id="cta" />
</Heading>
<p className="mb-5 text-greyStatus-600 tracking-wider">Call to actions are buttons that exist at the end of each story and are designed to push users to the next actionable insight, redirect them outside of Astro or help them to navigate to related stories. There must at least be one CTA per conversation. There should generally be no more than 5 CTAs per story.</p>
<p className="mb-10 text-greyStatus-600 tracking-wider">A full list of CTAs can be found <a className="inline text-status-100 hover:text-red-900 underline" rel="noopener noreferrer" target="_blank" href="https://docs.google.com/spreadsheets/d/1nSpKhP1FcBh8KrtV4GHOMqvY1cMbbbnv/edit#gid=1209391679">here</a>.</p>
<div className="flex mb-16">
<div className="w-1/2 pr-6">
<p className="mb-10 text-greyStatus-600 as-h3 as-type-medium">Our CTAs are:</p>
<div className="flex mb-10">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<p className="text-greyStatus-600 ml-3"><span className="as-type-medium">Short.</span> Only use a few words.</p>
</div>
<div className="flex mb-10">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<p className="text-greyStatus-600 ml-3"><span className="as-type-medium">Specific.</span> Written with a specific action in mind.</p>
</div>
<div className="flex">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<div className="block">
<p className="text-greyStatus-600 ml-3 mb-3"><span className="as-type-medium">Managing expectations.</span> Differentiate when a user needs to be taken outside of Astro.</p>
<p className="text-sm text-greyStatus-600 ml-3">CTAs that contain a link that takes the user out Astro for additional information are written as “More Info in X System.”</p>
</div>
</div>
</div>
<div className="w-1/2">
<p className="mb-10 text-greyStatus-600 as-h3 as-type-medium">Our CTAs are not:</p>
<div className="flex mb-10">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<p className="text-greyStatus-600 ml-3"><span className="as-type-medium">Long.</span> The words must be few, fit and be clear.</p>
</div>
<div className="flex mb-10">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<p className="text-greyStatus-600 ml-3"><span className="as-type-medium">Generic.</span> Ambiguous words like “click,” “tap” or “see” do not add value to user actions.</p>
</div>
<div className="flex">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<p className="text-greyStatus-600 ml-3 mb-3"><span className="as-type-medium">Blindsiding.</span> A CTA should not surprise a user by taking them out of Astro unknowingly or without user permission.</p>
</div>
</div>
</div>
<div className="mb-16">
<Heading level="3" className="as-h3 as-type-medium mb-6">Examples</Heading>
<div className="mb-10">
<div className="mb-5 py-16 pl-20 pr-10 bg-placeholder-200 flex flex-wrap justify-start">
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<img data-src={ctaBoard1} className="lazyload inline-block" width="145" alt="Buttons Specs Primary 1" />
</div>
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<img data-src={ctaBoard2} className="lazyload inline-block" width="227" alt="Buttons Specs Primary 3" />
</div>
</div>
<p className="as-type-regular text-sm text-greyStatus-600">Action: CTA links to a list of a company's Board of Directors</p>
</div>
<div className="mb-10">
<div className="mb-5 py-16 pl-20 pr-10 bg-placeholder-200 flex flex-wrap justify-start">
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<img data-src={ctaSalesforce1} className="lazyload inline-block" width="175" alt="Buttons Specs Primary 1" />
</div>
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<img data-src={ctaSalesforce2} className="lazyload inline-block" width="203" alt="Buttons Specs Primary 3" />
</div>
</div>
<p className="as-type-regular text-sm text-greyStatus-600">Action: CTA takes users outside of Astro to Salesforce</p>
</div>
<div className="mb-10">
<div className="mb-5 py-16 pl-20 pr-10 bg-placeholder-200 flex flex-wrap justify-start">
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<img data-src={ctaTaskList1} className="lazyload inline-block" width="102" alt="Buttons Specs Primary 1" />
</div>
<div className="flex mb-6 as-grid-8">
<div className="as-guidance mr-4">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<img data-src={ctaTaskList2} className="lazyload inline-block" width="205" alt="Buttons Specs Primary 3" />
</div>
</div>
<p className="as-type-regular text-sm text-greyStatus-600">Action: User gets taken to their task list</p>
</div>
</div>
</section>
<section id="nudges" name="nudges" className="as-section">
<span id="nudges-anchor" className="page-anchor"></span>
<Heading level="2" className="as-h2 as-type-medium mb-6">Nudges
<Copy id="nudges" />
</Heading>
<p className="mb-16 text-greyStatus-600 tracking-wider">Other apps have push notifications. We have <span className="as-type-medium">nudges:</span> a short message meant to gently guide the user through their day and help them stay ahead. Nudges are <span className="as-type-medium">personal, actionable and insightful</span>.</p>
<p className="mb-16 text-greyStatus-600 tracking-wider">Nudges should ideally draw from 2+ data points that are combined to give a user insight they wouldn’t otherwise receive. They are either scheduled nudges (i.e., tax payment reminders), ad-hoc (the new Apple iPhone is out and you’re eligible for an upgrade!) or triggered (Christmas is coming up. Set a reminder for vacation now)</p>
<div className="mb-16">
<Heading level="3" className="as-h3 as-type-medium mb-3">Nudge Copy</Heading>
<div className="mb-5 py-16 pl-20 pr-10 bg-placeholder-200 flex flex-wrap justify-start">
<img data-src={nudgesNudge1} className="lazyload" width="699" alt="" />
</div>
<p className="as-type-regular text-sm text-greyStatus-600">For the notification screen, write a short call to action phrase followed by the basic information no more than 80 characters.</p>
</div>
<div className="mb-16">
<Heading level="3" className="as-h3 as-type-medium mb-3">Conversational Copy</Heading>
<div className="mb-5 py-16 pl-20 pr-10 bg-placeholder-200 flex flex-wrap justify-start">
<img data-src={nudgesConversational1} className="lazyload" width="656" alt="" />
</div>
<p className="as-type-regular text-sm text-greyStatus-600">For the conversational copy, explain the corresponding card copy or the action a user can take to complete the action in no more than 140 characters.</p>
</div>
</section>
<section id="guidance" name="guidance" className="as-section mb-48">
<span id="guidance-anchor" className="page-anchor"></span>
<Heading level="2" className="as-h2 as-type-medium mb-6">Guidance
<Copy id="guidance" />
</Heading>
<p className="mb-12 text-greyStatus-600 tracking-wider">Principles to keep in mind when writing for Astro.</p>
<div className="flex -mx-5 mb-6">
<div className="w-1/2 px-5">
<div className="flex">
<p className="as-h3 as-type-medium">Do:</p>
</div>
</div>
<div className="w-1/2 px-5">
<div className="flex">
<p className="as-h3 as-type-medium">Don't:</p>
</div>
</div>
</div>
<div className="flex -mx-5 mb-6">
<div className="w-full px-5 mb-5">
<div className="border-b border-grey-500 border-solid">
</div>
</div>
</div>
<div className="flex -mx-5 mb-12">
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Create personalized voice responses.</p>
<p className="mb-6 text-greyStatus-600 ml-3 tracking-wider">Use contractions like "here's", "I’ve" and "can't" to lend a conversational, less-robotic tone to Astro.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">For Example</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">Say, “Here’s what I found” instead of “Here is what I found.”</p>
</div>
</div>
</div>
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Pretend Astro is human.</p>
<p className="mb-6 text-greyStatus-600 ml-3 tracking-wider">Don’t hide that Astro has limitations. Set expectations by telling users what Astro can and cannot do.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">For Example</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">User: "Astro, order me an Uber."<br /> Astro: "I can't do that yet. Here are some other things you can ask me."</p>
</div>
</div>
</div>
</div>
<div className="flex -mx-5 mb-12">
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Use “I, Me, You” for Astro’s responses.</p>
<p className="mb-6 text-greyStatus-600 ml-3 tracking-wider">As an agent, Astro refers to itself as “I” and “me” and the user as “you.”</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">For Example</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">“I’ve found these things for you.”<br />“Let me see if I can get that for you.”<br />“Thanks for your feedback. It helps me improve.”</p>
</div>
</div>
</div>
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Use “We, Us or Astro.”</p>
<p className="mb-6 text-greyStatus-600 ml-3 tracking-wider">Only use language that helps users relate to Astro as a unique entity.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">Avoid using examples like these:</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">“Astro found these things for you.”<br />“Let’s see if we can get that for you.</p>
</div>
</div>
</div>
</div>
<div className="flex -mx-5 mb-12">
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Spell out client names, acronyms and roles fully.</p>
<p className="mb-6 text-greyStatus-600 ml-3 tracking-wider">The exception: when it’s a widely understood abbreviation (i.e., IBM, UPS, etc.).</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">For Example</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">"Here is your revenue as Engagement Leader."<br />"Here are your outstanding invoices as Global Relationship Leader for IBM."</p>
</div>
</div>
</div>
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Abbreviate assuming users will naturally understand.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">Avoid using examples like these:</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">"Here's your revenue as EL."<br /> "Here are your outstanding invoices as GRL for International Business Machines Corporation."</p>
</div>
</div>
</div>
</div>
<div className="flex -mx-5 mb-12">
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#4ead58" d="M12 28.093l-12-11.517 3.721-3.827 8.208 7.832 16.28-16.581 3.791 3.756z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Use date, month, year in voice responses.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">For Example</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">"I've scheduled your task for November 28, 2020."</p>
</div>
</div>
</div>
<div className="w-1/2 px-5 mb-5">
<div className="flex mb-3">
<div className="as-guidance">
<svg className="fill-current mt-1" width="14" height="14" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path fill="#c52a1a" d="M28.586 0.586l2.828 2.828-12.584 12.586 12.584 12.586-2.828 2.828-12.586-12.584-12.586 12.584-2.828-2.828 12.584-12.586-12.584-12.586 2.828-2.828 12.586 12.584z"></path>
</svg>
</div>
<div>
<p className="mb-2 text-greyStatus-600 as-type-medium ml-3">Use the day or alternative formats.</p>
<p className="mb-3 text-xs uppercase text-greyStatus-600 ml-3">Avoid using examples like these:</p>
<p className="text-sm as-type-medium text-greyStatus-600 ml-3">"I’ve scheduled your task for November 28."<br />"I've scheduled your task for Wed 28 Nov 2020."</p>
</div>
</div>
</div>
</div>
</section>
</main>
</div>
</Layout>
);
}
}
export default ContentPage;
| 77.946612 | 1,184 | 0.559589 |
d5fe1429a5cc32a0747e698686e250fed8339cb1 | 357 | js | JavaScript | test/threeGenerator.test.js | ladybug-tools/spider-core | dacebd29847a7d2c447568a29d85193878c422e2 | [
"MIT"
] | 3 | 2019-04-01T01:37:14.000Z | 2019-04-09T21:14:00.000Z | test/threeGenerator.test.js | ladybug-tools/spider-core | dacebd29847a7d2c447568a29d85193878c422e2 | [
"MIT"
] | 8 | 2019-03-31T16:35:38.000Z | 2019-04-10T15:09:50.000Z | test/threeGenerator.test.js | ladybug-tools/spider-core | dacebd29847a7d2c447568a29d85193878c422e2 | [
"MIT"
] | 3 | 2019-03-31T16:05:20.000Z | 2021-11-07T15:20:02.000Z | const assert = require('assert');
const threeGenerator = require('../lib/threeGenerator');
const surfacesJson = require('./assets/sam-live-surfaces.json')
describe('threeGenerator', () => {
describe('getSurfaceMeshes', () => {
it('should not fail', () => {
const surfaceMeshes = threeGenerator.getSurfaceMeshes(surfacesJson);
});
});
}); | 29.75 | 74 | 0.663866 |
d5ff611804dda377b1549a984f6e08201cd33688 | 326 | js | JavaScript | validators/email.js | flamejs/flame.js | f6f0d115cf476396944e1c16caebb7eb426b8966 | [
"MIT"
] | 34 | 2015-01-09T16:43:59.000Z | 2022-03-02T05:29:54.000Z | validators/email.js | flamejs/flame.js | f6f0d115cf476396944e1c16caebb7eb426b8966 | [
"MIT"
] | 2 | 2015-05-18T17:54:02.000Z | 2015-10-11T13:24:20.000Z | validators/email.js | flamejs/flame.js | f6f0d115cf476396944e1c16caebb7eb426b8966 | [
"MIT"
] | 11 | 2015-01-22T09:44:30.000Z | 2018-08-03T08:57:55.000Z | import { Validator } from '../validations';
var pattern = /^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9\-]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,63}$/i;
export default Validator.create({
validate: function(target, key) {
return pattern.test(target.get(key));
}
});
| 32.6 | 151 | 0.51227 |
d5ffce1e2e512c6b819ed8f7377689031bc1c1b0 | 2,444 | js | JavaScript | gatsby-theme-minsbi/src/themes/styles.js | andrewmmc/gatsby-theme-minsbi | 42e0a5a3793774172da5b921c72b30af7fdf9856 | [
"MIT"
] | null | null | null | gatsby-theme-minsbi/src/themes/styles.js | andrewmmc/gatsby-theme-minsbi | 42e0a5a3793774172da5b921c72b30af7fdf9856 | [
"MIT"
] | null | null | null | gatsby-theme-minsbi/src/themes/styles.js | andrewmmc/gatsby-theme-minsbi | 42e0a5a3793774172da5b921c72b30af7fdf9856 | [
"MIT"
] | null | null | null | import styled, { createGlobalStyle } from 'styled-components';
import rgba from 'polished/lib/color/rgba';
import { rhythm } from 'themes/typography';
const MAX_WIDTH = 42;
export const GlobalStyle = createGlobalStyle`
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: ${({ theme }) => theme.backgroundColor};
color: ${({ theme }) => theme.primaryTextColor};
}
::selection {
background-color: ${({ theme }) => rgba(theme.primaryColor, 0.4)};
}
a {
color: ${({ theme }) => theme.primaryTextColor};
text-decoration: none;
transition: all 100ms;
border-bottom: 2px solid ${({ theme }) =>
rgba(theme.primaryTextColor, 0.2)};
&:hover,
&:focus,
&:active {
color: ${({ theme }) => theme.primaryColor};
border-bottom: 2px solid ${({ theme }) => theme.primaryColor};
text-decoration: none;
}
}
small {
a, a:hover, a:focus, a:active {
border-width: 1px;
}
}
blockquote {
padding: 1em;
border-left: 2px solid ${({ theme }) => theme.primaryTextColor};
color: ${({ theme }) => theme.primaryTextColor};
background-color: ${({ theme }) => rgba(theme.primaryTextColor, 0.1)};
}
code {
background-color: ${({ theme }) => theme.lightGrayColor} !important;
color: ${({ theme }) => theme.primaryTextColor} !important;
}
figcaption.gatsby-resp-image-figcaption {
text-align: center;
font-size: 85%;
margin: 4px 0;
}
/* PrismJS tweaks and line numbers */
div.gatsby-highlight {
margin-bottom: ${rhythm(1)};
}
.gatsby-highlight {
font-size: 0.85rem;
background-color: ${({ theme }) => theme.lightGrayColor};
padding: 1em;
overflow: auto;
border: 1px solid ${({ theme }) => rgba(theme.primaryTextColor, 0.2)};
border-radius: 4px;
}
.gatsby-highlight pre[class*="language-"] {
background-color: ${({ theme }) => theme.lightGrayColor};
padding: 0;
}
.gatsby-highlight pre[class*="language-"].line-numbers {
padding-left: 2.5em;
overflow: scroll;
}
code[class*="language-"] {
font-size: 0.85rem;
text-shadow: none !important;
}
.gatsby-highlight .token {
background: none;
}
`;
export const Container = styled.div`
width: 100%;
max-width: ${MAX_WIDTH}rem;
padding: 0 1rem;
margin: 0 auto;
`;
export const Main = styled.div`
margin: 2rem 0;
`;
| 23.728155 | 74 | 0.608838 |
9100094bb55b3cbf926a681c1f914baa67bbed86 | 455 | js | JavaScript | Doxygen/html/search/files_5.js | LFGUI/LFGUI | 70f2b92a5c5fcaec5a6a74b9a6e5324ffd87c2d4 | [
"MIT"
] | 6 | 2016-04-12T07:05:16.000Z | 2021-07-21T15:43:19.000Z | Doxygen/html/search/files_5.js | ppiecuch/LFGUI | b43d9c892b152b3bc88274f7e144f06ff157340e | [
"MIT"
] | 17 | 2016-02-18T15:18:33.000Z | 2016-11-21T09:35:30.000Z | Doxygen/html/search/files_5.js | LFGUI/LFGUI | 70f2b92a5c5fcaec5a6a74b9a6e5324ffd87c2d4 | [
"MIT"
] | 3 | 2016-08-08T09:16:57.000Z | 2019-09-01T07:42:32.000Z | var searchData=
[
['label_2eh',['label.h',['../label_8h.html',1,'']]],
['lfgui_2ecpp',['lfgui.cpp',['../lfgui_8cpp.html',1,'']]],
['lfgui_2eh',['lfgui.h',['../lfgui_8h.html',1,'']]],
['lfgui_5fwrapper_5fqt_2eh',['lfgui_wrapper_qt.h',['../lfgui__wrapper__qt_8h.html',1,'']]],
['lfgui_5fwrapper_5furho3d_2eh',['lfgui_wrapper_urho3d.h',['../lfgui__wrapper__urho3d_8h.html',1,'']]],
['lineedit_2eh',['lineedit.h',['../lineedit_8h.html',1,'']]]
];
| 45.5 | 105 | 0.628571 |
9100499d012fe48ecc511765bebf43054b0339ef | 195 | js | JavaScript | hostedfunctions/nodejs-app/config.js | swilliams11/apigee-edge-firestore-rapidstart | 3c5d4a3d645847deb1b35261b54b91e1fa33e555 | [
"MIT"
] | null | null | null | hostedfunctions/nodejs-app/config.js | swilliams11/apigee-edge-firestore-rapidstart | 3c5d4a3d645847deb1b35261b54b91e1fa33e555 | [
"MIT"
] | null | null | null | hostedfunctions/nodejs-app/config.js | swilliams11/apigee-edge-firestore-rapidstart | 3c5d4a3d645847deb1b35261b54b91e1fa33e555 | [
"MIT"
] | null | null | null | var serviceAccountFile = require("./serviceaccount/apigee-developer-labs-4eb377b71885.json");
module.exports = {
db : '(default)',
serviceAccount : serviceAccountFile
};
| 27.857143 | 93 | 0.671795 |
91006bffc5a3bbbd63ef3ce8a63125e4b7082048 | 228 | js | JavaScript | frontend/plugins/nuxt-codemirror.js | ValentinGaut/shaman | 754e9eef3c097f3e58b0f06e7c08716bc1b11edd | [
"Apache-2.0"
] | null | null | null | frontend/plugins/nuxt-codemirror.js | ValentinGaut/shaman | 754e9eef3c097f3e58b0f06e7c08716bc1b11edd | [
"Apache-2.0"
] | null | null | null | frontend/plugins/nuxt-codemirror.js | ValentinGaut/shaman | 754e9eef3c097f3e58b0f06e7c08716bc1b11edd | [
"Apache-2.0"
] | null | null | null | import Vue from 'vue'
import VueCodemirror from 'vue-codemirror'
// codemirror language
import 'codemirror/mode/vue/vue.js'
// codemirror active-line.js
import 'codemirror/addon/selection/active-line.js'
Vue.use(VueCodemirror)
| 25.333333 | 50 | 0.79386 |
91006c5d5c33c2d6fd65c02dd3b47265aed59117 | 1,082 | js | JavaScript | examples/chapter1/app.js | zakingwong/zaking-axios | 24c7ea106a8242f6a485d75ef27bbccda99f987c | [
"MIT"
] | null | null | null | examples/chapter1/app.js | zakingwong/zaking-axios | 24c7ea106a8242f6a485d75ef27bbccda99f987c | [
"MIT"
] | null | null | null | examples/chapter1/app.js | zakingwong/zaking-axios | 24c7ea106a8242f6a485d75ef27bbccda99f987c | [
"MIT"
] | null | null | null | import axios from "../../lib/axios";
// method小写
axios({
method: "get",
url: "/c1/get",
});
// method大写
axios({
method: "GET",
url: "/c1/get",
});
// 普通的params对象
axios({
method: "get",
url: "/c1/get",
params: {
a: 1,
b: 2,
},
});
// params的参数的值为数组的情况
axios({
method: "get",
url: "/c1/get",
params: {
a: [1, 2, 3, 4],
},
});
// params的参数的值为对象的情况
axios({
method: "get",
url: "/c1/get",
params: {
a: {
b: 1,
},
},
});
// params的参数的值为Date类型
const date = new Date();
axios({
method: "get",
url: "/c1/get",
params: {
date,
},
});
// 支持特殊字符
axios({
method: "get",
url: "/c1/get",
params: {
a: "@:$, ",
},
});
// 忽略空值
axios({
method: "get",
url: "/c1/get",
params: {
a: 1,
b: null,
c: undefined,
},
});
// 丢弃URL中的hash标记
axios({
method: "get",
url: "/c1/get#fuckhash?m=12&md=23",
params: {
a: 1,
b: null,
c: undefined,
},
});
// 保留URL中已存在的参数
axios({
method: "get",
url: "/c1/get?m=12&md=23",
params: {
a: 1,
b: null,
c: undefined,
},
});
| 11.154639 | 37 | 0.472274 |
9101eedf4449f8ce636d060029e03e07ee19e17f | 154 | js | JavaScript | js/store-widget.js | FAIRsharing/FAIRsharing-client | f2e9603db6e1b18b97ad6c8c215ba5ed4ba839df | [
"BSD-3-Clause"
] | null | null | null | js/store-widget.js | FAIRsharing/FAIRsharing-client | f2e9603db6e1b18b97ad6c8c215ba5ed4ba839df | [
"BSD-3-Clause"
] | null | null | null | js/store-widget.js | FAIRsharing/FAIRsharing-client | f2e9603db6e1b18b97ad6c8c215ba5ed4ba839df | [
"BSD-3-Clause"
] | null | null | null | import { createStore } from 'redux';
import graphReducer from './reducers/graph-reducer';
const store = createStore(graphReducer);
export default store;
| 25.666667 | 52 | 0.772727 |
91027847b3c0731b0e9b0dcfabbe661c86a95fce | 1,667 | js | JavaScript | wookie-features/src/main/webapp/features/camera/shared/bondi_camera.js | apache/wookie | b75542fc42ea081aaa8947549e368c31a797eaa4 | [
"Apache-2.0"
] | 6 | 2015-05-05T04:02:17.000Z | 2021-11-10T16:31:10.000Z | wookie-features/src/main/webapp/features/camera/shared/bondi_camera.js | apache/wookie | b75542fc42ea081aaa8947549e368c31a797eaa4 | [
"Apache-2.0"
] | 1 | 2021-08-02T17:21:31.000Z | 2021-08-02T17:21:31.000Z | wookie-features/src/main/webapp/features/camera/shared/bondi_camera.js | ibrahimelbanna/wooki | c5fe0cd0a870e45f5cb9d392b38139fb179c8a21 | [
"Apache-2.0"
] | 11 | 2015-12-11T06:37:24.000Z | 2021-11-10T16:31:03.000Z | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* webcam is the default browser-based camera. We have to assume it
* exists as we can't check until the user is prompted to allow access
*/
webcam = new function webcam(){
this.takePicture = function(success_callback, error_callback, options){
this.callback = success_callback;
this.error = error_callback;
var pathArray = window.location.pathname.split( '/' );
tb_show("","/" + pathArray[1] + "/features/camera/shared/camcanvas.html?TB_iframe=true&height=320&width=335","");
}
this.snapped = function(image){
tb_remove();
if (this.callback) this.callback(image);
}
this.cancelled = function(){
tb_remove();
if (this.error) this.error();
}
}
/**
* Bondi camera interface
*/
camera = new function camera(){
this.getCameras = function(success_callback, err_callback){
if (webcam){
return [webcam];
success_callback([webcam]);
} else {
err_callback();
}
}
}
bondi = new function bondi(){
this.camera = camera;
}
| 29.245614 | 122 | 0.646071 |
9102f3c67b7ddbfdd682f96fd21104943093c264 | 1,143 | js | JavaScript | src/util/getMetadata.js | AngusFu/dokiv | 19052424b271c1be445e240d1669e3bc62a8710f | [
"MIT"
] | 1 | 2018-03-22T17:58:35.000Z | 2018-03-22T17:58:35.000Z | src/util/getMetadata.js | AngusFu/dokiv | 19052424b271c1be445e240d1669e3bc62a8710f | [
"MIT"
] | null | null | null | src/util/getMetadata.js | AngusFu/dokiv | 19052424b271c1be445e240d1669e3bc62a8710f | [
"MIT"
] | 1 | 2018-03-22T17:40:47.000Z | 2018-03-22T17:40:47.000Z | import { readFileSync } from 'fs-extra'
import { basename, extname } from 'path'
import { loadFront } from 'yaml-front-matter'
import pascalCase from './pascalCase'
/**
* extract front matters and document from markdown file
*/
export default (file, markdown) => {
if (typeof markdown === 'undefined') {
markdown = readFileSync(file, 'utf-8')
}
if (markdown.trim() === '') {
return 'Empty markdown: '
}
let {
route,
title,
highlight,
body = '# Not Found',
layout = 'default',
meta = {}
} = loadFront(markdown, 'body')
meta.title = meta.title || title
if (!meta.title) {
return 'Field `title` or `meta.title` is not defined: '
}
if (!route) {
return 'Field `route` is not defined: '
}
route = route.replace(/^\//, '')
const [group, name] = route.split('/')
const pageName = name || basename(file, extname(file))
const componentName = pascalCase(`doc-${layout}-${group}-${pageName}`)
const isMain = group === 'index' && !name
return {
layout,
fullPath: isMain ? '/' : `/${route}`,
highlight,
meta,
componentName,
markdown: body
}
}
| 20.781818 | 72 | 0.598425 |
9103673cdcc2918a2e7c12f6306abb820c72eb63 | 8,024 | js | JavaScript | phase1/week1/boggle-1/boggle.js | juleshwa/hacktiv8 | 24f5a3033bbf7572b9f1c6916bdbc74f13909235 | [
"MIT"
] | 1 | 2022-01-13T07:35:56.000Z | 2022-01-13T07:35:56.000Z | phase1/week1/boggle-1/boggle.js | elsetsuna/hacktiv8-1 | 24f5a3033bbf7572b9f1c6916bdbc74f13909235 | [
"MIT"
] | null | null | null | phase1/week1/boggle-1/boggle.js | elsetsuna/hacktiv8-1 | 24f5a3033bbf7572b9f1c6916bdbc74f13909235 | [
"MIT"
] | 3 | 2019-11-26T09:27:35.000Z | 2021-07-26T14:52:13.000Z | 'use strict'
// Exercise 24 - Boogle
// Andreas Sosilo - Hacktiv8 Batch 34 - Humble Fox
/** To run the program, type node boogle.js 4 4
* Where the first number is the row length
* And the second number is the column length
* */
const input = process.argv.slice(2)
const num1 = input[0]
const num2 = input[1]
// Get the words from dictionary data.js using module.exports
const dictionary = require('./data.js').Data
class Boggle {
constructor (dictionary, num1, num2) {
this.board = this.shake(num1, num2)
this.newDictionary = this.filterDictionary(dictionary)
}
// Generate randomize boogle board according to row and column input
shake (num1, num2) {
if (num1 < 4 || num2 < 4) {
return `Invalid input. Row and column must be at least 4 in length`
}
const reference = `ABCDEFGHIJKLMNOPQRSTUVWXYZ`
const row = []
for (let i = 0; i < num1; i++) {
const col = []
for (let j = 0; j < num2; j++) {
const randomIndex = Math.floor(Math.random() * 26)
col.push(reference[randomIndex])
}
row.push(col)
}
console.log(`\n╔══════════════╗\n║ Boggle Board ║\n╚══════════════╝`)
return row
}
// Filter the dictionary, only contain the alphabet that listed in the boggle board
filterDictionary (dictionary) {
const result = []
for (let i = 0; i < dictionary.length; i++) {
if (this.inArray(this.board, dictionary[i][0])) {
result.push(dictionary[i])
}
}
return result
}
inArray (array, val) {
for (let i = 0; i < array.length; i++) {
for (let j = 0; j < array[i].length; j++) {
if (val === array[i][j]) {
return true
}
}
}
return false
}
// Check the every word in boggle board that match with the dictionary
checking () {
const board = this.board
if (this.newDictionary.length === 0) return `Please insert the dictionary first!`
function firstWord (str) {
const alphabetLocation = []
for (let i = 0; i < board.length; i++) {
for (let j = 0; j < board[i].length; j++) {
if (str[0] === board[i][j]) {
alphabetLocation.push([i, j])
}
}
}
return alphabetLocation
}
// Check each word in dictionary
const output = []
for (let i = 0; i < this.newDictionary.length; i++) {
const str = this.newDictionary[i]
// console.log(str)
const firstWordLocation = firstWord(str)
if (firstWordLocation.length > 1) {
let flag = false
let x = 0
while (flag === false && x < firstWordLocation.length) {
if (validation(str, firstWordLocation[x]) === true) {
flag = true
output.push(str)
break
}
x++
}
} else if (firstWordLocation.length === 1) {
if (validation(str, firstWordLocation[0]) === true) {
output.push(str)
}
}
}
function validation (word, location) {
let counter = 0
const locationlist = [[location[0], location[1]]]
let noWord = false
while (counter < word.length - 1 && noWord === false) {
let next = false
const x = location[1]
const y = location[0]
if (
word[counter + 1] === board[y][x + 1] &&
board[y][x + 1] !== undefined
) {
let flag = true
if (!coordinateCheck(locationlist, y, x + 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[1] = x + 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y + 1] !== undefined &&
word[counter + 1] === board[y + 1][x]
) {
let flag = true
if (!coordinateCheck(locationlist, y + 1, x)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y + 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
word[counter + 1] === board[y][x - 1] &&
board[y][x - 1] !== undefined
) {
let flag = true
if (!coordinateCheck(locationlist, y, x - 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[1] = x - 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y - 1] !== undefined &&
word[counter + 1] === board[y - 1][x]
) {
let flag = true
if (!coordinateCheck(locationlist, y - 1, x)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y - 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y - 1] !== undefined &&
word[counter + 1] === board[y - 1][x + 1]
) {
let flag = true
if (!coordinateCheck(locationlist, y - 1, x + 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y - 1
location[1] = x + 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y + 1] !== undefined &&
word[counter + 1] === board[y + 1][x + 1]
) {
let flag = true
if (!coordinateCheck(locationlist, y + 1, x + 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y + 1
location[1] = x + 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y + 1] !== undefined &&
word[counter + 1] === board[y + 1][x - 1]
) {
let flag = true
if (!coordinateCheck(locationlist, y + 1, x - 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y + 1
location[1] = x - 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (
next === false &&
board[y - 1] !== undefined &&
word[counter + 1] === board[y - 1][x - 1]
) {
let flag = true
if (!coordinateCheck(locationlist, y - 1, x - 1)) {
flag = false
noWord = true
}
if (flag) {
next = true
noWord = false
location[0] = y - 1
location[1] = x - 1
locationlist.push([location[0], location[1]])
counter++
}
}
if (noWord === true || next === false) {
return false
}
}
if (counter === word.length - 1) {
return true
}
function coordinateCheck (arr, y, x) {
for (let i = 0; i < arr.length; i++) {
if (arr[i][0] === y && arr[i][1] === x) {
return false
}
}
return true
}
}
console.log(`\n╔════════╗\n║ Result ║\n╚════════╝`)
const result = output.length + ((output.length <= 1) ? ' word found: ' : ' words found: ')
return console.log(result, output)
}
}
const game = new Boggle(dictionary, num1, num2)
console.log(game.board)
game.checking()
| 27.861111 | 94 | 0.459995 |
9104eb0a166ce051183550cef6fb593b47021a0f | 1,390 | js | JavaScript | commands/contentcreators/add.js | CrewmateBot/ImposterBot | 60d67fb77dc082b21573c9ec967eded680e2a37d | [
"MIT"
] | null | null | null | commands/contentcreators/add.js | CrewmateBot/ImposterBot | 60d67fb77dc082b21573c9ec967eded680e2a37d | [
"MIT"
] | null | null | null | commands/contentcreators/add.js | CrewmateBot/ImposterBot | 60d67fb77dc082b21573c9ec967eded680e2a37d | [
"MIT"
] | null | null | null | const db = require('quick.db');
const twitch = require('../../twitch/api');
module.exports = {
name: "cc-add",
description: "Adds someone as a content creator.",
useParams: "cc-add <@User> <twitch_id>",
useExample: "[prefix]cc-add @Minisimp minisimp",
useDesc: "This would add Minisimp as a content creator, and announce lives on the twitch account \"minisimp\".",
userPermissions: ["ADMINISTRATOR"],
async execute(bot, message, args) {
if (!db.get(`${message.guild.id}.isCreatorsSetup`)) return message.reply("The content creator feature isn't setup on this server yet. Please do that first.");
const user = message.mentions.members.first();
if (!user || !args[1]) return;
const twitchId = await twitch.getIdFromUsername(args[1]);
if (!twitch || isNaN(twitchId)) return;
if (!db.has(`${message.guild.id}.creators`))
db.set(`${message.guild.id}.creators`, [ `${user.id}:${twitchId}` ]);
else
db.push(`${message.guild.id}.creators`, `${user.id}:${twitchId}`);
const creatorRole = message.guild.roles.cache.get(db.get(`${message.guild.id}.creatorRole`));
if (creatorRole)
user.roles.add(creatorRole);
message.channel.send(`${user} was added as a content creator, I will now notify when when they go live.`);
}
}; | 43.4375 | 167 | 0.618705 |
91057ea3cb7cc870658cdba2c62c82bce659ab86 | 7,161 | js | JavaScript | src/list/CellViewFactory.js | xsburg/core-ui | 16538c5b0c0205e1e9acb88d756a238a82e849f6 | [
"MIT"
] | 1 | 2016-06-01T17:18:25.000Z | 2016-06-01T17:18:25.000Z | src/list/CellViewFactory.js | xsburg/core-ui | 16538c5b0c0205e1e9acb88d756a238a82e849f6 | [
"MIT"
] | null | null | null | src/list/CellViewFactory.js | xsburg/core-ui | 16538c5b0c0205e1e9acb88d756a238a82e849f6 | [
"MIT"
] | null | null | null | /**
* Developer: Grigory Kuznetsov
* Date: 23.07.2015
* Copyright: 2009-2016 Comindware®
* All Rights Reserved
* Published under the MIT license
*/
"use strict";
import { objectPropertyTypes } from '../Meta';
import { helpers } from 'utils';
import { Handlebars } from 'lib';
let factory = {
getCellViewByDataType: function(type) {
var result;
switch (type) {
case objectPropertyTypes.STRING:
result = factory.getTextCellView();
break;
case objectPropertyTypes.INSTANCE:
result = factory.getReferenceCellView();
break;
case objectPropertyTypes.ACCOUNT:
result = factory.getUserCellView();
break;
case objectPropertyTypes.ENUM:
result = factory.getEnumCellView();
break;
case objectPropertyTypes.INTEGER:
case objectPropertyTypes.DOUBLE:
case objectPropertyTypes.DECIMAL:
result = factory.getNumberCellView();
break;
case objectPropertyTypes.DURATION:
result = factory.getDurationCellView();
break;
case objectPropertyTypes.BOOLEAN:
result = factory.getBooleanCellView();
break;
case objectPropertyTypes.DATETIME:
result = factory.getDateTimeCellView();
break;
case objectPropertyTypes.DOCUMENT:
result = factory.getDocumentCellView();
break;
default:
helpers.throwNotSupportedError('Data type' + type + 'is not supported');
break;
}
return result;
},
getTextCellView: function () {
return factory.__getSimpleView('{{highlightFragment value highlightedFragment}}');
},
getReferenceCellView: function () {
return factory.__getSimpleView('{{#if value}}{{#if value.name}}{{highlightFragment value.name highlightedFragment}}{{/if}}{{/if}}');
},
getUserCellView: function () {
return factory.__getAccountView();
},
getEnumCellView: function () {
return factory.__getEnumView();
},
getNumberCellView: function () {
return factory.__getSimpleView('{{value}}');
},
getDurationCellView: function () {
return factory.__getSimpleView('{{renderShortDuration value}}');
},
getBooleanCellView: function () {
return factory.__getSimpleView(
"{{#if value}}{{localize 'CORE.GRID.CELLVIEWFACTORY.BOOLEANCELLVIEW.YES'}}{{/if}}" +
"{{#unless value}}{{localize 'CORE.GRID.CELLVIEWFACTORY.BOOLEANCELLVIEW.NO'}}{{/unless}}");
},
getDateTimeCellView: function () {
return factory.__getSimpleView('{{#if value}}{{renderFullDate value}}{{/if}}');
},
getDocumentCellView: function () {
return factory.__getDocumentView();
},
__getSimpleView: function (template, templateHelpers) {
return Marionette.ItemView.extend({
template: Handlebars.compile(template),
modelEvents: {
'change:highlightedFragment': '__handleHighlightedFragmentChange'
},
__handleHighlightedFragmentChange: function () {
this.render();
},
className: 'grid-cell',
templateHelpers: templateHelpers
});
},
__getAccountView: function () {
return Marionette.ItemView.extend({
template: Handlebars.compile('{{text}}'),
templateHelpers: function () {
var value = this.model.get('value');
var text = '';
if (value && value.length > 0) {
text = _.chain(value).
map(function (item) {
return {
id: item.id,
text: item.columns[0]
};
}).
sortBy(function (member) {
return member.text;
}).
reduce(function (memo, member) {
if (memo) {
return memo + ', ' + member.text;
} else {
return member.text;
}
}, null).
value();
}
else if (value && value.name) {
text = value.name;
}
return {
text: text
};
},
modelEvents: {
'change:highlightedFragment': '__handleHighlightedFragmentChange'
},
__handleHighlightedFragmentChange: function () {
this.render();
},
className: 'grid-cell'
});
},
__getDocumentView: function () {
return Marionette.ItemView.extend({
template: Handlebars.compile('{{#each documents}}<a href="{{url}}">{{text}}</a>{{#unless @last}}, {{/unless}}{{/each}}'),
templateHelpers: function () {
var value = this.model.get('value');
var documents = [];
if (value && value.length > 0) {
documents = _.chain(value).
map(function (item) {
return {
id: item.id,
text: item.columns[0],
url: item.columns[1]
};
}).
sortBy(function (document) {
return document.text;
}).
value();
}
return {
documents: documents
};
},
modelEvents: {
'change:highlightedFragment': '__handleHighlightedFragmentChange'
},
__handleHighlightedFragmentChange: function () {
this.render();
},
className: 'grid-cell'
});
},
__getEnumView: function() {
return Marionette.ItemView.extend({
template: Handlebars.compile("{{#if value}}{{valueExplained}}{{/if}}"),
modelEvents: {
'change:highlightedFragment': '__handleHighlightedFragmentChange'
},
__handleHighlightedFragmentChange: function () {
this.render();
},
templateHelpers: function () {
var value = this.model.get("value");
return {
value: value,
valueExplained: value.valueExplained
};
},
className: 'grid-cell'
});
}
};
export default factory;
| 34.1 | 141 | 0.473398 |
91069f8ce619762d8028a491e8140ab5e5ed843a | 303 | js | JavaScript | client/config/errorHandler.js | teamco/zeurcv | 393cbc807928be37d8a08077d8a730565038c65f | [
"MIT"
] | null | null | null | client/config/errorHandler.js | teamco/zeurcv | 393cbc807928be37d8a08077d8a730565038c65f | [
"MIT"
] | null | null | null | client/config/errorHandler.js | teamco/zeurcv | 393cbc807928be37d8a08077d8a730565038c65f | [
"MIT"
] | 1 | 2018-11-23T06:55:09.000Z | 2018-11-23T06:55:09.000Z | // import {throwError} from '../../lib/logs';
//
// window.onerror = (message, url, line, column, error) => throwError({
// details: 'line: ' + line + ', column: ' + column,
// error: error.message,
// errorType: error.name,
// message: message,
// reason: url,
// stack: error.stack
// });
| 27.545455 | 71 | 0.577558 |
910744782d33f9ed7a97af36f419f4d876626ffb | 103 | js | JavaScript | lib/boundary.js | Ariel-Rodriguez/react-hook-sticky | 67d93ad211480738bf31883efa7feb907e25248a | [
"MIT"
] | 23 | 2019-11-21T22:00:26.000Z | 2022-01-28T09:25:08.000Z | lib/boundary.js | Ariel-Rodriguez/react-hook-sticky | 67d93ad211480738bf31883efa7feb907e25248a | [
"MIT"
] | 3 | 2021-02-12T01:09:15.000Z | 2021-05-17T09:13:31.000Z | lib/boundary.js | Ariel-Rodriguez/react-hook-sticky | 67d93ad211480738bf31883efa7feb907e25248a | [
"MIT"
] | null | null | null | export const createBoundary = (name, element, params = {}) => {
return { name, element, params };
};
| 25.75 | 63 | 0.631068 |
9108755014079a2809c394a130a3510084df9a54 | 2,584 | js | JavaScript | packages/web/components/Modal/CreateInstitutionsModal/StepTwo.js | samirsm/plataforma-sabia | 5c86a7db0bbbc9c6027a9fe68242891c39106eef | [
"MIT"
] | 37 | 2020-03-21T09:40:51.000Z | 2022-02-11T18:01:02.000Z | packages/web/components/Modal/CreateInstitutionsModal/StepTwo.js | samirsm/plataforma-sabia | 5c86a7db0bbbc9c6027a9fe68242891c39106eef | [
"MIT"
] | 924 | 2020-03-22T18:47:46.000Z | 2022-02-02T13:27:05.000Z | packages/web/components/Modal/CreateInstitutionsModal/StepTwo.js | samirsm/plataforma-sabia | 5c86a7db0bbbc9c6027a9fe68242891c39106eef | [
"MIT"
] | 6 | 2020-05-14T01:09:59.000Z | 2021-11-12T12:33:37.000Z | /* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
import PropTypes from 'prop-types';
import { InputField, MaskedInputField, SelectField } from '../../Form';
import { Cell, Row } from '../../Common';
import { maskPatterns } from '../../../utils/masks';
const typeOptions = [
{
label: 'Público',
value: 'public',
},
{
label: 'Privado',
value: 'private',
},
{
label: 'Misto',
value: 'mixed',
},
{
label: 'Outro',
value: 'other',
},
];
const categoryOptions = [
{
label: 'Universidade',
value: 'university',
},
{
label: 'Instituto',
value: 'institute',
},
{
label: 'Associação',
value: 'association',
},
{
label: 'Fundação',
value: 'foundation',
},
{
label: 'Cooperativa',
value: 'cooperative',
},
{
label: 'Companhia',
value: 'company',
},
{
label: 'Outro',
value: 'other',
},
];
const StepTwo = ({ form }) => {
const { setValue } = form;
return (
<>
<Row>
<Cell col={12}>
<InputField
form={form}
label="E-mail para contato"
name="email"
type="email"
variant="gray"
/>
</Cell>
</Row>
<Row>
<Cell col={6}>
<MaskedInputField
form={form}
name="phone_number"
alwaysShowMask={false}
label="Telefone"
maskChar={null}
variant="gray"
defaultValue=""
mask={maskPatterns.phoneNumber.stringMask}
pattern={maskPatterns.phoneNumber.pattern}
formatChars={maskPatterns.phoneNumber.formatChars}
/>
</Cell>
<Cell col={6}>
<InputField
form={form}
label="Website"
name="website"
placeholder="https://exemplo.org"
type="text"
variant="gray"
/>
</Cell>
</Row>
<Row>
<Cell col={6}>
<SelectField
form={form}
name="type"
label="Tipo"
validation={{ required: true }}
onChange={([option]) => {
setValue('type', option.value);
return option;
}}
options={typeOptions}
variant="gray"
/>
</Cell>
<Cell col={6}>
<SelectField
form={form}
name="category"
label="Categoria"
validation={{ required: true }}
onChange={([option]) => {
setValue('category', option.value);
return option;
}}
options={categoryOptions}
variant="gray"
/>
</Cell>
</Row>
</>
);
};
StepTwo.propTypes = {
form: PropTypes.shape({
watch: PropTypes.func,
getValues: PropTypes.func,
setValue: PropTypes.func,
}),
};
StepTwo.defaultProps = {
form: {},
};
export default StepTwo;
| 17.578231 | 71 | 0.555728 |
91090362fe32134b70037f708b3f11517513e07a | 547 | js | JavaScript | mitmproxy/tools/web/static/js/44.8df2eadf.chunk.js | web-trump/soft-mock | 88f5cb48c30499735e688d49a47682976094142f | [
"MIT"
] | 4 | 2021-02-08T07:35:57.000Z | 2021-02-09T09:55:04.000Z | mitmproxy/tools/web/static/js/44.8df2eadf.chunk.js | web-trump/softmock | 88f5cb48c30499735e688d49a47682976094142f | [
"MIT"
] | null | null | null | mitmproxy/tools/web/static/js/44.8df2eadf.chunk.js | web-trump/softmock | 88f5cb48c30499735e688d49a47682976094142f | [
"MIT"
] | null | null | null | (this["webpackJsonpsoft-mock-template"]=this["webpackJsonpsoft-mock-template"]||[]).push([[44],{1544:function(e,t,n){!function(e){"use strict";e.defineMode("diff",(function(){var e={"+":"positive","-":"negative","@":"meta"};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||0===n)return t.skipToEnd(),("error "+(e[t.string.charAt(0)]||"")).replace(/ $/,"");var i=e[t.peek()]||t.skipToEnd();return-1===n?t.skipToEnd():t.pos=n,i}}})),e.defineMIME("text/x-diff","diff")}(n(46))}}]);
//# sourceMappingURL=44.8df2eadf.chunk.js.map | 273.5 | 501 | 0.632541 |
91094b7cd9c1763bcfca3ba12f31ccf29ed0e83c | 3,048 | js | JavaScript | node_modules/calcite-ui-icons-react/BearRightIcon.js | jon-jones-DDOT/Signworks3 | f18bc5ba1dce7e824497c555b39741eeb3a968db | [
"Apache-2.0"
] | null | null | null | node_modules/calcite-ui-icons-react/BearRightIcon.js | jon-jones-DDOT/Signworks3 | f18bc5ba1dce7e824497c555b39741eeb3a968db | [
"Apache-2.0"
] | null | null | null | node_modules/calcite-ui-icons-react/BearRightIcon.js | jon-jones-DDOT/Signworks3 | f18bc5ba1dce7e824497c555b39741eeb3a968db | [
"Apache-2.0"
] | null | null | null | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var BearRightIcon = function BearRightIcon(_ref) {
var _ref$color = _ref.color,
color = _ref$color === undefined ? 'currentColor' : _ref$color,
_ref$size = _ref.size,
size = _ref$size === undefined ? 24 : _ref$size,
_ref$filled = _ref.filled,
filled = _ref$filled === undefined ? false : _ref$filled,
className = _ref.className,
children = _ref.children,
props = _objectWithoutProperties(_ref, ['color', 'size', 'filled', 'className', 'children']);
var classes = 'calcite-icon';
if (className) classes += ' ' + className;
if (size <= 16) {
return _react2.default.createElement(
'svg',
_extends({}, props, { width: size, height: size, fill: color, viewBox: '0 0 16 16', className: classes }),
filled ? _react2.default.createElement('path', { d: 'M9.697 4.866l-.98 1.204.004.002A2.98 2.98 0 0 0 8 8v8H6V8a4.987 4.987 0 0 1 1.111-3.116l.002.002.944-1.17-.124-.088L6.5 2.624 10.998 1 11 3.098V5.78z' }) : _react2.default.createElement('path', { d: 'M12 3v4h-1V4.706L8.655 7.048C7.515 8.3 7 9.987 7 12.5V14H6v-1.5a8.75 8.75 0 0 1 1.932-6.142L10.292 4H8V3z' })
);
}
if (size <= 24) {
return _react2.default.createElement(
'svg',
_extends({}, props, { width: size, height: size, fill: color, viewBox: '0 0 24 24', className: classes }),
filled ? _react2.default.createElement('path', { d: 'M13.077 9.104l.005.004A4.472 4.472 0 0 0 12 12v12H9V12a7.48 7.48 0 0 1 1.667-4.674l.003.003 2.498-3.1L11 2.5 17.997.3 18 8.083l-2.482-1.98z' }) : _react2.default.createElement('path', { d: 'M17 4v5h-1V5.655l-4.872 5.266a7.89 7.89 0 0 0-2.104 5.373V21h-1v-4.706a8.888 8.888 0 0 1 2.37-6.051L15.244 5H12V4z' })
);
}
return _react2.default.createElement(
'svg',
_extends({}, props, { width: size, height: size, fill: color, viewBox: '0 0 32 32', className: classes }),
filled ? _react2.default.createElement('path', { d: 'M21.162 8.787l-2.727 3.352.007.005A5.96 5.96 0 0 0 17 16v16h-4V16a9.973 9.973 0 0 1 2.223-6.231l.004.002 2.65-3.288-.012-.009L15 4.464l8.996-3.247L24 5.413v5.364z' }) : _react2.default.createElement('path', { d: 'M23 5v8h-1V6.645l-4.627 5.08A16.741 16.741 0 0 0 13 23.022V27h-1v-3.979a17.74 17.74 0 0 1 4.633-11.969L21.234 6H15V5z' })
);
};
exports.default = BearRightIcon; | 56.444444 | 391 | 0.658465 |
910a2ccb4019fdc7fe8449292880913ef84ee5ec | 696 | js | JavaScript | lib/utils/request.js | phwa/phwa-mds | 60894295f577e05e4e8f7a8dd56d9399ff5c3df6 | [
"Apache-2.0"
] | null | null | null | lib/utils/request.js | phwa/phwa-mds | 60894295f577e05e4e8f7a8dd56d9399ff5c3df6 | [
"Apache-2.0"
] | null | null | null | lib/utils/request.js | phwa/phwa-mds | 60894295f577e05e4e8f7a8dd56d9399ff5c3df6 | [
"Apache-2.0"
] | null | null | null | 'use strict';
/**
* NOTE: We've abstracted requests into
* their own helper modudule so that they
* can easily be stubbed in unit-tests.
*/
/**
* Dependencies
*/
const debug = require('debug')('magnet-metadata-service:request');
const ua = require('../../config').user_agent;
const request = require('superagent');
/**
* Perform a get request.
*
* @param {String} url
* @return {Promise}
*/
exports.get = function(url) {
debug('get', url);
return new Promise((resolve, reject) => {
request.get(url)
.buffer()
.set('User-Agent', ua)
.end((err, res) => {
if (err) {
return reject(err);
}
resolve(res);
});
});
};
| 18.315789 | 66 | 0.573276 |
910d1f223461e531bb9a9c9b098bbfd63e6a3649 | 233 | js | JavaScript | backend/controllers/createdGamesController.js | RavNowak/PaperPlayers | 888868987f63932f9dfdd3fee05e0169f2138e00 | [
"MIT"
] | null | null | null | backend/controllers/createdGamesController.js | RavNowak/PaperPlayers | 888868987f63932f9dfdd3fee05e0169f2138e00 | [
"MIT"
] | null | null | null | backend/controllers/createdGamesController.js | RavNowak/PaperPlayers | 888868987f63932f9dfdd3fee05e0169f2138e00 | [
"MIT"
] | null | null | null | const { getCreatedGames } = require('../models/model');
module.exports = {
createdGamesController: (req, res) => {
const createdGames = getCreatedGames();
return res.send(JSON.stringify({
createdGames
}));
}
} | 21.181818 | 55 | 0.639485 |
910d9de3f6b634e7c0d70146fdd1af8e81e9d4da | 427 | js | JavaScript | src/components/UI/Slider/PrevArrow/PrevArrow.js | samuelndm/leo-moviegas | 1b2d7e6dc8c3683d08dfe03e8a0975bbed9181fe | [
"MIT"
] | 3 | 2021-03-10T21:05:58.000Z | 2021-10-19T21:53:25.000Z | src/components/UI/Slider/PrevArrow/PrevArrow.js | samuelndm/leo-movies | 1b2d7e6dc8c3683d08dfe03e8a0975bbed9181fe | [
"MIT"
] | null | null | null | src/components/UI/Slider/PrevArrow/PrevArrow.js | samuelndm/leo-movies | 1b2d7e6dc8c3683d08dfe03e8a0975bbed9181fe | [
"MIT"
] | null | null | null | import React from "react";
import * as S from "./styles";
const PrevArrow = ({ className, onClick, CustomPrevArrow }) => {
return CustomPrevArrow ? (
<CustomPrevArrow
className={className}
aria-label="previous slide"
onClick={onClick}
/>
) : (
<S.DefaultPrevArrow
className={className}
aria-label="previous slide"
onClick={onClick}
/>
);
};
export default PrevArrow;
| 20.333333 | 64 | 0.625293 |
910e0925808f36e2dab891dbce46b4180719c2ea | 324 | js | JavaScript | Static/ueditor/ue_config_min.js | imdante15002/weitCME | 79bfe95a7e5bd581388c5d263ac42a069257f561 | [
"BSD-2-Clause"
] | null | null | null | Static/ueditor/ue_config_min.js | imdante15002/weitCME | 79bfe95a7e5bd581388c5d263ac42a069257f561 | [
"BSD-2-Clause"
] | null | null | null | Static/ueditor/ue_config_min.js | imdante15002/weitCME | 79bfe95a7e5bd581388c5d263ac42a069257f561 | [
"BSD-2-Clause"
] | null | null | null | window.UEDITOR_HOME_URL='/Static/ueditor/';
window.onload=function(){
window.UEDITOR_CONFIG.initialFrameWidth=690;
window.UEDITOR_CONFIG.initialFrameHeight=120;
window.UEDITOR_CONFIG.imageUrl="/Upload/upload";
UE.getEditor('Content',{
toolbars:[['emotion']]
});
} | 36 | 56 | 0.645062 |
910f320a56cfe4ab86fa482e6ce252f68dcda516 | 3,207 | js | JavaScript | src/documentProcessing/resolvePlaceholders/resolvePlaceholders.test.js | kuboon/google-docs-mustaches | 9019604488359a6487a395a19ab6b62f7d44a983 | [
"MIT"
] | 21 | 2019-02-13T10:23:50.000Z | 2021-09-26T07:53:11.000Z | src/documentProcessing/resolvePlaceholders/resolvePlaceholders.test.js | kuboon/google-docs-mustaches | 9019604488359a6487a395a19ab6b62f7d44a983 | [
"MIT"
] | 31 | 2019-02-27T11:54:10.000Z | 2021-11-02T20:24:29.000Z | src/documentProcessing/resolvePlaceholders/resolvePlaceholders.test.js | kuboon/google-docs-mustaches | 9019604488359a6487a395a19ab6b62f7d44a983 | [
"MIT"
] | 6 | 2019-03-19T12:40:13.000Z | 2020-09-28T12:26:57.000Z | import resolvePlaceholders from './resolvePlaceholders'
import { UndefinedVariableError, UnknownFormatterError } from './errors'
describe('resolvePlaceholders', () => {
test('no placeholders', () => {
const placeholders = resolvePlaceholders([], {})
expect(placeholders).toEqual([])
})
test('contentPlaceholder - text', () => {
const placeholders = [
{
raw: '{{ user.name.first | lowercase }}',
position: {
start: 134,
end: 166
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {
user: { name: { first: 'Thibaud' } }
})
expect(contentPlaceholders).toMatchSnapshot()
})
test('contentPlaceholder - image', () => {
const placeholders = [
{
raw: '{{ catUrl | image }}',
position: {
start: 134,
end: 166
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {
catUrl: 'http://example.cat'
})
expect(contentPlaceholders).toMatchSnapshot()
})
test('contentPlaceholder - image (width)', () => {
const placeholders = [
{
raw: '{{ catUrl | image(150) }}',
position: {
start: 134,
end: 166
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {
catUrl: 'http://example.cat'
})
expect(contentPlaceholders).toMatchSnapshot()
})
test('contentPlaceholder - image (with, height)', () => {
const placeholders = [
{
raw: '{{ catUrl | image(150, 80) }}',
position: {
start: 134,
end: 166
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {
catUrl: 'http://example.cat'
})
expect(contentPlaceholders).toMatchSnapshot()
})
test('commentPlaceholder', () => {
const placeholders = [
{
raw: '{{ # This is a comment }}',
position: {
start: 134,
end: 158
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {})
expect(contentPlaceholders).toMatchSnapshot()
})
test('unknownPlaceholder - reserved symbol', () => {
const placeholders = [
{
raw: '{{ % reserved symbol }}',
position: {
start: 134,
end: 158
}
}
]
const contentPlaceholders = resolvePlaceholders(placeholders, {})
expect(contentPlaceholders).toMatchSnapshot()
})
test('Unknown Formatter — strict', () => {
const placeholders = [
{
raw: '{{ name | pretty }}',
position: {
start: 134,
end: 153
}
}
]
expect(() => {
resolvePlaceholders(placeholders, { name: 'Antoine' }, { strict: true })
}).toThrow(UnknownFormatterError)
})
test('Undefined variable — strict', () => {
const placeholders = [
{
raw: '{{ surname | capitalize }}',
position: {
start: 134,
end: 153
}
}
]
expect(() => {
resolvePlaceholders(placeholders, { name: 'Antoine' }, { strict: true })
}).toThrow(UndefinedVariableError)
})
})
| 21.816327 | 78 | 0.537262 |
9110ec7e5b63a452193a0a8fbb8e82011bbc9fba | 1,617 | js | JavaScript | pbix.js | mfeyx/pbix | 65d5d1fbc335b8a69b81d97a0f5382d323dc720c | [
"MIT"
] | null | null | null | pbix.js | mfeyx/pbix | 65d5d1fbc335b8a69b81d97a0f5382d323dc720c | [
"MIT"
] | null | null | null | pbix.js | mfeyx/pbix | 65d5d1fbc335b8a69b81d97a0f5382d323dc720c | [
"MIT"
] | null | null | null | /**
* @module PBIX
* ## pbix
* Read Microsoft Power BI-Files
* @author Markus Feiks
* @version 0.0.2
*
* @license
* MIT License
* Copyright (c) 2021 Markus Feiks
*
* 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.
*
* @example
* const PBIX = require('pbix')
* const fpath = 'my-dataset.pbix';
* // no options atm, but will be of type `object`
* const options = {};
* const pbix = new PBIX(options);
* pbix.readFile(fpath).then(data => {
* const layout = data.layout;
* console.log(layout);
* });
*/
const PBIX = require('./src/core/pbix-file');
module.exports = PBIX;
| 36.75 | 81 | 0.718615 |
91121b21993e8c579db8ab31c056404a02a407ca | 719 | js | JavaScript | client/build/webpack.dev.js | Wzb3422/luckyForU | c1b50e238281ab45c75f7eae46c3cf315c18c53e | [
"MIT"
] | null | null | null | client/build/webpack.dev.js | Wzb3422/luckyForU | c1b50e238281ab45c75f7eae46c3cf315c18c53e | [
"MIT"
] | 4 | 2021-05-10T18:11:03.000Z | 2022-02-26T19:23:41.000Z | client/build/webpack.dev.js | Wzb3422/luckyForU | c1b50e238281ab45c75f7eae46c3cf315c18c53e | [
"MIT"
] | null | null | null | const path = require('path')
const commonConfig = require('./webpack.common')
const merge = require('webpack-merge');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
module.exports = merge(commonConfig, {
mode: 'development',
devtool: 'cheap-eval-source-map',
devServer: {
contentBase: path.resolve(__dirname, '../dist'),
port: 3000,
hot: true,
quiet: true,
host: '0.0.0.0',
historyApiFallback: true, // fallback
proxy: {
'/api': 'http://localhost:3000'
}
},
plugins: [
new FriendlyErrorsWebpackPlugin({
compilationSuccessInfo: {
messages: [`You application is running here http://localhost:3000`],
}
})
]
})
| 25.678571 | 78 | 0.645341 |
9112deec5660b5357d0c7ee5fcc5a96a7fdb8a03 | 392 | js | JavaScript | Documentations/html/dir_b37fc66fd27e6ff7ce3bfbd406b204f7.js | alexlobanov/fh-dotnet-sdk | 6b5b1c5b351386a396d3f0ba600ca7194d691ce4 | [
"Apache-2.0"
] | null | null | null | Documentations/html/dir_b37fc66fd27e6ff7ce3bfbd406b204f7.js | alexlobanov/fh-dotnet-sdk | 6b5b1c5b351386a396d3f0ba600ca7194d691ce4 | [
"Apache-2.0"
] | 46 | 2015-02-17T13:24:52.000Z | 2019-06-08T19:26:30.000Z | Documentations/html/dir_b37fc66fd27e6ff7ce3bfbd406b204f7.js | alexlobanov/fh-dotnet-sdk | 6b5b1c5b351386a396d3f0ba600ca7194d691ce4 | [
"Apache-2.0"
] | 14 | 2015-01-27T08:17:52.000Z | 2018-09-17T22:30:40.000Z | var dir_b37fc66fd27e6ff7ce3bfbd406b204f7 =
[
[ "NetworkService.cs", "_dist_2src_2_f_h_s_d_k_portable_2_services_2_network_2_network_service_8cs.html", null ],
[ "Push.cs", "_dist_2src_2_f_h_s_d_k_portable_2_services_2_network_2_push_8cs.html", [
[ "Push", "class_f_h_s_d_k_1_1_services_1_1_network_1_1_push.html", "class_f_h_s_d_k_1_1_services_1_1_network_1_1_push" ]
] ]
]; | 56 | 127 | 0.806122 |
91137a8793c4b2b030b9634d96af2ef871556418 | 2,247 | js | JavaScript | src/components/Util/util.js | chriz218/articulate | 496bf4aacba52ee49608ab0ea1f9cbf199cb27c9 | [
"Apache-2.0"
] | null | null | null | src/components/Util/util.js | chriz218/articulate | 496bf4aacba52ee49608ab0ea1f9cbf199cb27c9 | [
"Apache-2.0"
] | null | null | null | src/components/Util/util.js | chriz218/articulate | 496bf4aacba52ee49608ab0ea1f9cbf199cb27c9 | [
"Apache-2.0"
] | 2 | 2020-03-12T23:22:58.000Z | 2020-04-18T22:59:55.000Z | import {
CATEGORY_ACTION,
CATEGORY_ALL,
CATEGORY_NATURE,
CATEGORY_OBJECT,
CATEGORY_PERSON,
CATEGORY_RANDOM,
CATEGORY_WORLD,
MIN_PLAYERS_PER_TEAM,
RESPONSE_JSON,
RESPONSE_TEXT,
} from '../../properties';
export const TruncateString = (str, length) => {
if(str.toString().length <= length) return str;
return str.toString().substring(0, length) + "...";
};
export const TranslateTeamDisplayed = (teamNumber) => {
return String.fromCharCode(teamNumber + 65);
};
export const PostRequest = (
URL, reqBody, responseType, handler, errorHandler) => {
fetch(URL, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(reqBody),
}).then(response => {
if (response.status === 200) {
switch (responseType) {
case RESPONSE_JSON:
return response.json();
case RESPONSE_TEXT:
return response.text();
default:
console.error('responseType provided invalid: ', responseType);
}
}
throw new Error(response.statusText);
}).then(data => handler(data)).catch(error => {
if (errorHandler) errorHandler(error);
});
};
export const IsWhiteTile = (gamePosition, team) => {
return (gamePosition[team] % 7 === 6);
};
export const WordCategoryGivenPos = (gamePosition, team) => {
const posMod = gamePosition[team] % 7;
switch (posMod) {
case 0:
return CATEGORY_OBJECT;
case 1:
return CATEGORY_ACTION;
case 2:
return CATEGORY_NATURE;
case 3:
return CATEGORY_WORLD;
case 4:
return CATEGORY_PERSON;
case 5:
return CATEGORY_RANDOM;
case 6:
return CATEGORY_ALL;
default:
console.error('GamePosition Invalid: ', gamePosition);
return '';
}
};
export const CheckEnoughPlayers = (teams) => {
// return true; // TODO: FOR DEVELOPMENT
for (let i = 0; i < teams.length; i++) {
if (teams[i].length < MIN_PLAYERS_PER_TEAM) {
return false;
}
}
return true;
};
| 27.072289 | 83 | 0.566978 |
911530f3f5493a5494e77bbc2140bb85ef39ef84 | 82 | js | JavaScript | doc/html/search/classes_2.js | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 24 | 2017-08-01T16:13:28.000Z | 2021-08-29T13:13:29.000Z | doc/html/search/classes_2.js | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 10 | 2017-07-13T17:31:21.000Z | 2021-06-18T21:32:15.000Z | doc/html/search/classes_2.js | fenollp/lk | 14ed9cb1997906c9af2711ce03ce07b31c284349 | [
"BSD-3-Clause"
] | 26 | 2017-09-17T00:29:31.000Z | 2022-03-17T04:25:54.000Z | var searchData=
[
['doc_5ft',['doc_t',['../classlk_1_1doc__t.html',1,'lk']]]
];
| 16.4 | 60 | 0.597561 |
9116418d50dd700225c90c547dc527a4a6213c5d | 698 | js | JavaScript | src/components/Flag.js | Mock1ng/nations-flag-api | 17687a50f9bd2cca7e8f6b168ae7c252493246ad | [
"MIT"
] | null | null | null | src/components/Flag.js | Mock1ng/nations-flag-api | 17687a50f9bd2cca7e8f6b168ae7c252493246ad | [
"MIT"
] | null | null | null | src/components/Flag.js | Mock1ng/nations-flag-api | 17687a50f9bd2cca7e8f6b168ae7c252493246ad | [
"MIT"
] | null | null | null | import React from 'react';
import { NavLink } from 'react-router-dom';
const Flag = ({ name, flag, population, region, capital }) => {
return (
<NavLink to={'/detail/' + name} className="flag-card">
<div className="flag-container">
<img src={flag} alt={name + '\'s flag'} />
</div>
<div className="card-body">
<h4>{name}</h4>
<p className='title'>Population: <span>{population}</span></p>
<p className='title'>Region: <span>{region}</span></p>
<p className='title'>Capital: <span>{capital}</span></p>
</div>
</NavLink>
)
}
export default Flag;
| 33.238095 | 78 | 0.510029 |