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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1d00767fc28d56dce42fe656e2f3f23f289f238f | 2,095 | js | JavaScript | course-mgmt/rabbitClient.js | daleran/lion-msg | 5615a0db5bdeb9f6efcff561d63c89d594260bcd | [
"MIT"
] | null | null | null | course-mgmt/rabbitClient.js | daleran/lion-msg | 5615a0db5bdeb9f6efcff561d63c89d594260bcd | [
"MIT"
] | 4 | 2020-04-23T18:34:52.000Z | 2021-12-09T21:23:05.000Z | course-mgmt/rabbitClient.js | daleran/lion-msg | 5615a0db5bdeb9f6efcff561d63c89d594260bcd | [
"MIT"
] | null | null | null | // Class to encapsulate the amqplib package for connecting and listening to topics
module.exports = class Rabbit {
// Connect to a specific host
connect (hostname) {
// Wrap the ampq connection and channel creation in a promise for reliable async
return new Promise(function (resolve, reject) {
// Connect to the RabbitMQ service at the specified hostname
require('amqplib').connect(hostname)
// Then create a channel
.then((connection) => {
return connection.createChannel()
})
// Then log the connection and resolve the promise with the channel
.then((channel) => {
console.log(`Connected to RabbitMQ on ${hostname}`)
resolve(channel)
})
// If there is an error, reject the promise and print an error
.catch((error) => {
console.error(`Error: Unable to connect to ${hostname}`)
reject(error)
})
})
}
// Listen for messages on the specified exhange and topic
listen (channel, exchange, topic, callback) {
// Wrap exchange and queue binding in a promise
return new Promise(function (resolve, reject) {
// Create or get a topic exchange exsists of the specified name
channel.assertExchange(exchange, 'topic', { durable: false })
// Create or get an anynomous queue exsists for the channnel
channel.assertQueue('', { exclusive: true })
// Then bind the queue to the exchange and topic
.then((q) => {
console.log(`Listening for ${topic} on ${exchange}. Press CTRL+C to exit.`)
channel.bindQueue(q.queue, exchange, topic)
// Consume any messages in the queue and pass them to the callback
channel.consume(q.queue, callback, { noAck: true })
})
// Then resolve the promise as a success
.then(() => { resolve() })
// Or reject the promise if there is an error and log it to the console
.catch((error) => {
console.error(`Error: Unable to listen on ${exchange}`)
reject(error)
})
})
}
}
| 41.078431 | 85 | 0.622434 |
1d01c3408f272b420ea512a4434962f49ca77a46 | 2,518 | js | JavaScript | js/list.js | awrznc/timer | 9347ccace7151103b7df9e6b38785727a085fcf1 | [
"Unlicense"
] | null | null | null | js/list.js | awrznc/timer | 9347ccace7151103b7df9e6b38785727a085fcf1 | [
"Unlicense"
] | 3 | 2021-07-01T11:51:12.000Z | 2021-08-18T14:02:42.000Z | js/list.js | awrznc/timer | 9347ccace7151103b7df9e6b38785727a085fcf1 | [
"Unlicense"
] | null | null | null | export class List {
/**
* @property {Number} length
*/
length;
/**
* @property {ChildNode}
*/
ul;
/**
* Constructor.
* @constructor
* @param {HTMLElement} element
*/
constructor(element) {
element.insertAdjacentHTML('beforeend', '<ul id="list"></ul>');
if(element.childNodes.length != 1) alert('[ERROR] Initialize Error in List class.');
this.ul = element.childNodes.item('list');
this.length = 0;
}
/**
* Generate "li" content.
* @param {String} string
* @return {String}
*/
generate(string) {
return `${string} <button id="remove-list-${this.length - 1}">del</button>`;
}
/**
* Add "li" element string.
* @param {String} string
*/
add(string) {
let htmlString = `<li>${this.generate(string)}</li>`;
this.ul.insertAdjacentHTML('beforeend', htmlString);
this.length = this.ul.childNodes.length;
this.rehashId();
}
/**
* Add element object.
* @param {HTMLLIElement} elementObject
*/
addElement(elementObject) {
elementObject.insertAdjacentHTML('beforeend', this.generate(''));
this.ul.appendChild(elementObject);
this.length = this.ul.childNodes.length;
this.rehashId();
}
/**
* Remove "li" element with index.
* @param {Number} index
*/
remove(index) {
let li = this.ul.getElementsByTagName('li');
if(li.length > index && -1 < index) li[index].remove();
this.length = this.ul.childNodes.length;
this.rehashId();
}
/**
* Rebase "li" element with index.
* @param {String} rebaseString
* @param {Number} index
*/
rebase(rebaseString, index) {
let htmlString = this.generate(rebaseString);
this.ul.childNodes[index].innerHTML = htmlString;
this.length = this.ul.childNodes.length;
this.rehashId();
}
/**
* Add class name.
* @param {String} classString
* @param {Number} index
*/
addClass(classString, index) {
this.ul.childNodes[index].classList.add(classString);
}
addId(idString, index) {
this.ul.childNodes[index].setAttribute('id', idString);
}
/**
* Rehash instance list.
*/
rehashId() {
let self = this;
this.ul.childNodes.forEach(function (li, index) {
li.id = `list${index}`;
li.childNodes[li.childNodes.length-1].onclick = function () {
self.remove(index);
}
});
this.length = this.ul.childNodes.length;
}
}
| 23.754717 | 89 | 0.584591 |
1d02a3705e1bb4072b8f744dc9f8e79d920b41e3 | 1,295 | js | JavaScript | pages/api/v1/private/noticia/[noticiaId].js | savi8sant8s/oopg | f85673837179641e454be990ac07288a8cc30c62 | [
"MIT"
] | null | null | null | pages/api/v1/private/noticia/[noticiaId].js | savi8sant8s/oopg | f85673837179641e454be990ac07288a8cc30c62 | [
"MIT"
] | null | null | null | pages/api/v1/private/noticia/[noticiaId].js | savi8sant8s/oopg | f85673837179641e454be990ac07288a8cc30c62 | [
"MIT"
] | null | null | null | import { Validacao } from "../../../../../services/validacao";
import { STATUS } from "../../../../../services/codigo-status";
import { schema } from "../../../../../services/schemas";
import moment from "moment";
import { capturarExcecoes } from "../../../../../middlewares/capturar-excecoes";
import prisma from "../../../../../services/prisma-db";
export default capturarExcecoes(
async (req, res) => {
let validar = new Validacao(req, res);
validar.metodo(["PUT", "DELETE"]);
await validar.token("ADMIN");
await validar.primeiroAcesso(false);
await validar.noticia();
let resposta = {};
resposta.dataHora = moment().format();
let noticiaId = Number(req.query.noticiaId);
if (req.method == "PUT") {
await validar.corpo(schema.noticia);
req.body.dataAtualizacao = moment().format();
await prisma.noticia.update({ data: req.body, where: { id: noticiaId } });
resposta.status = STATUS.NOTICIA.ALTERADA_SUCESSO;
}
else if (req.method == "DELETE") {
await prisma.noticia.delete({ where: { id: noticiaId } });
resposta.status = STATUS.NOTICIA.DELETADA_SUCESSO;
}
res.status(200).json(resposta);
}
);
| 35.972222 | 86 | 0.576062 |
1d042e75c0d4d280e3421f85451963b3ae01d8a8 | 193 | js | JavaScript | src/redux/modules/contacts/selectors.js | AYCHVerify/Xrpwallet | 1f0f4dbf724a96bd3cb161357f39f89143921f24 | [
"Apache-2.0"
] | 24 | 2018-03-25T22:57:37.000Z | 2021-09-15T10:15:19.000Z | src/redux/modules/contacts/selectors.js | AYCHVerify/Xrpwallet | 1f0f4dbf724a96bd3cb161357f39f89143921f24 | [
"Apache-2.0"
] | 5 | 2020-07-20T02:13:58.000Z | 2022-03-15T20:09:18.000Z | src/redux/modules/contacts/selectors.js | AYCHVerify/Xrpwallet | 1f0f4dbf724a96bd3cb161357f39f89143921f24 | [
"Apache-2.0"
] | 12 | 2018-03-24T13:30:08.000Z | 2019-08-04T13:15:22.000Z | import { createSelector } from 'reselect';
const contactsState = state => state.get('contacts');
export const contactsSelector = createSelector([contactsState], contacts => contacts.toJS());
| 32.166667 | 93 | 0.751295 |
1d04367d365df7da9d060006abe64f69e66eec16 | 47 | js | JavaScript | packages/gen/bin/omega.js | piglovesyou/zeromus | d9262d07a10361cc84f0bfda2f4e90802dbd8632 | [
"Xnet",
"X11"
] | null | null | null | packages/gen/bin/omega.js | piglovesyou/zeromus | d9262d07a10361cc84f0bfda2f4e90802dbd8632 | [
"Xnet",
"X11"
] | 2 | 2020-09-29T04:12:41.000Z | 2021-08-11T11:50:24.000Z | packages/gen/bin/omega.js | piglovesyou/omega | d9262d07a10361cc84f0bfda2f4e90802dbd8632 | [
"Xnet",
"X11"
] | null | null | null | #!/usr/bin/env node
require('../dist/omega');
| 11.75 | 25 | 0.617021 |
1d04ed5efc47b47ae44041ce6010c787ed63a593 | 30,754 | js | JavaScript | src/main/webapp/plugins/layui/homepage/hm.js | lerry-lee/simple-writer | 08234e02596645efe9d10cfd4494bc81b294168b | [
"MIT"
] | 3 | 2020-10-20T02:02:50.000Z | 2022-01-05T03:28:54.000Z | src/main/webapp/plugins/layui/homepage/hm.js | lerry-lee/simple-writer | 08234e02596645efe9d10cfd4494bc81b294168b | [
"MIT"
] | 6 | 2021-01-20T23:35:02.000Z | 2022-03-31T21:12:12.000Z | src/main/webapp/plugins/layui/homepage/hm.js | lerrylca/simple-writer | 859513f8298f54d33c7f73c14b98b48f98f3a8d4 | [
"MIT"
] | null | null | null | (function(){var h={},mt={},c={id:"d214947968792b839fd669a4decaaffc",dm:["layui.com"],js:"tongji.baidu.com/hm-web/js/",etrk:[],icon:'',ctrk:true,align:0,nv:-1,vdur:1800000,age:31536000000,rec:0,rp:[],trust:0,vcard:0,qiao:0,lxb:0,kbtrk:0,pt:0,aet:'',conv:0,med:0,cvcc:'',cvcf:[],apps:''};var r=void 0,s=!0,t=null,u=!1;mt.cookie={};mt.cookie.set=function(b,a,d){var g;d.Y&&(g=new Date,g.setTime(g.getTime()+d.Y));document.cookie=b+"="+a+(d.domain?"; domain="+d.domain:"")+(d.path?"; path="+d.path:"")+(g?"; expires="+g.toGMTString():"")+(d.Vb?"; secure":"")};mt.cookie.get=function(b){return(b=RegExp("(^| )"+b+"=([^;]*)(;|$)").exec(document.cookie))?b[2]:t};mt.lang={};mt.lang.d=function(b,a){return"[object "+a+"]"==={}.toString.call(b)};
mt.lang.wa=function(b){return mt.lang.d(b,"Number")&&isFinite(b)};mt.lang.ea=function(){return mt.lang.d(c.aet,"String")};mt.lang.i=function(b){return b.replace?b.replace(/'/g,"'0").replace(/\*/g,"'1").replace(/!/g,"'2"):b};mt.lang.trim=function(b){return b.replace(/^\s+|\s+$/g,"")};mt.lang.F=function(b,a){var d=u;if(b==t||!mt.lang.d(b,"Array")||a===r)return d;if(Array.prototype.indexOf)d=-1!==b.indexOf(a);else for(var g=0;g<b.length;g++)if(b[g]===a){d=s;break}return d};
(function(){var b=mt.lang;mt.e={};mt.e.Wa=function(a){return document.getElementById(a)};mt.e.ba=function(a,b){var g=[],k=[];if(!a)return k;for(;a.parentNode!=t;){for(var n=0,l=0,p=a.parentNode.childNodes.length,f=0;f<p;f++){var e=a.parentNode.childNodes[f];if(e.nodeName===a.nodeName&&(n++,e===a&&(l=n),0<l&&1<n))break}if((p=""!==a.id)&&b){g.unshift("#"+encodeURIComponent(a.id));break}else p&&(p="#"+encodeURIComponent(a.id),p=0<g.length?p+">"+g.join(">"):p,k.push(p)),g.unshift(encodeURIComponent(String(a.nodeName).toLowerCase())+
(1<n?"["+l+"]":""));a=a.parentNode}k.push(g.join(">"));return k};mt.e.ta=function(a){return(a=mt.e.ba(a,s))&&a.length?String(a[0]):""};mt.e.Rb=function(a){return mt.e.ba(a,u)};mt.e.Xa=function(a){var b;for(b="A";(a=a.parentNode)&&1==a.nodeType;)if(a.tagName==b)return a;return t};mt.e.Za=function(a){return 9===a.nodeType?a:a.ownerDocument||a.document};mt.e.eb=function(a){var b={top:0,left:0};if(!a)return b;var g=mt.e.Za(a).documentElement;"undefined"!==typeof a.getBoundingClientRect&&(b=a.getBoundingClientRect());
return{top:b.top+(window.pageYOffset||g.scrollTop)-(g.clientTop||0),left:b.left+(window.pageXOffset||g.scrollLeft)-(g.clientLeft||0)}};mt.e.getAttribute=function(a,b){var g=a.getAttribute&&a.getAttribute(b)||t;if(!g&&a.attributes&&a.attributes.length)for(var k=a.attributes,n=k.length,l=0;l<n;l++)k[l].nodeName===b&&(g=k[l].nodeValue);return g};mt.e.M=function(a){var b="document";a.tagName!==r&&(b=a.tagName);return b.toLowerCase()};mt.e.hb=function(a){var d="";a.textContent?d=b.trim(a.textContent):
a.innerText&&(d=b.trim(a.innerText));d&&(d=d.replace(/\s+/g," ").substring(0,255));return d};mt.e.$a=function(a){var b=mt.e.M(a);"input"===b&&("button"===a.type||"submit"===a.type)?a=a.value||"":"img"===b?(b=mt.e.getAttribute,a=b(a,"alt")||b(a,"title")||b(a,"src")):a="body"===b||"html"===b?["(hm-default-content-for-",b,")"].join(""):mt.e.hb(a);return String(a).substring(0,255)};(function(){(mt.e.zb=function(){function a(){if(!a.O){a.O=s;for(var b=0,g=k.length;b<g;b++)k[b]()}}function b(){try{document.documentElement.doScroll("left")}catch(g){setTimeout(b,
1);return}a()}var g=u,k=[],n;document.addEventListener?n=function(){document.removeEventListener("DOMContentLoaded",n,u);a()}:document.attachEvent&&(n=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",n),a())});(function(){if(!g)if(g=s,"complete"===document.readyState)a.O=s;else if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,u),window.addEventListener("load",a,u);else if(document.attachEvent){document.attachEvent("onreadystatechange",
n);window.attachEvent("onload",a);var k=u;try{k=window.frameElement==t}catch(p){}document.documentElement.doScroll&&k&&b()}})();return function(b){a.O?b():k.push(b)}}()).O=u})();return mt.e})();mt.event={};mt.event.c=function(b,a,d){b.attachEvent?b.attachEvent("on"+a,function(a){d.call(b,a)}):b.addEventListener&&b.addEventListener(a,d,u)};mt.event.preventDefault=function(b){b.preventDefault?b.preventDefault():b.returnValue=u};
(function(){var b=mt.event;mt.g={};mt.g.da=/msie (\d+\.\d+)/i.test(navigator.userAgent);mt.g.rb=/msie (\d+\.\d+)/i.test(navigator.userAgent)?document.documentMode||+RegExp.$1:r;mt.g.cookieEnabled=navigator.cookieEnabled;mt.g.javaEnabled=navigator.javaEnabled();mt.g.language=navigator.language||navigator.browserLanguage||navigator.systemLanguage||navigator.userLanguage||"";mt.g.Bb=(window.screen.width||0)+"x"+(window.screen.height||0);mt.g.colorDepth=window.screen.colorDepth||0;mt.g.D=function(){var a;
a=a||document;return parseInt(window.pageYOffset||a.documentElement.scrollTop||a.body&&a.body.scrollTop||0,10)};mt.g.z=function(){var a=document;return parseInt(window.innerHeight||a.documentElement.clientHeight||a.body&&a.body.clientHeight||0,10)};mt.g.orientation=0;(function(){function a(){var a=0;window.orientation!==r&&(a=window.orientation);screen&&(screen.orientation&&screen.orientation.angle!==r)&&(a=screen.orientation.angle);mt.g.orientation=a}a();b.c(window,"orientationchange",a)})();return mt.g})();
mt.l={};mt.l.parse=function(){return(new Function('return (" + source + ")'))()};
mt.l.stringify=function(){function b(a){/["\\\x00-\x1f]/.test(a)&&(a=a.replace(/["\\\x00-\x1f]/g,function(a){var b=d[a];if(b)return b;b=a.charCodeAt();return"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16)}));return'"'+a+'"'}function a(a){return 10>a?"0"+a:a}var d={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(d){switch(typeof d){case "undefined":return"undefined";case "number":return isFinite(d)?String(d):"null";case "string":return b(d);case "boolean":return String(d);
default:if(d===t)return"null";if(d instanceof Array){var k=["["],n=d.length,l,p,f;for(p=0;p<n;p++)switch(f=d[p],typeof f){case "undefined":case "function":case "unknown":break;default:l&&k.push(","),k.push(mt.l.stringify(f)),l=1}k.push("]");return k.join("")}if(d instanceof Date)return'"'+d.getFullYear()+"-"+a(d.getMonth()+1)+"-"+a(d.getDate())+"T"+a(d.getHours())+":"+a(d.getMinutes())+":"+a(d.getSeconds())+'"';l=["{"];p=mt.l.stringify;for(n in d)if(Object.prototype.hasOwnProperty.call(d,n))switch(f=
d[n],typeof f){case "undefined":case "unknown":case "function":break;default:k&&l.push(","),k=1,l.push(p(n)+":"+p(f))}l.push("}");return l.join("")}}}();mt.localStorage={};mt.localStorage.T=function(){if(!mt.localStorage.j)try{mt.localStorage.j=document.createElement("input"),mt.localStorage.j.type="hidden",mt.localStorage.j.style.display="none",mt.localStorage.j.addBehavior("#default#userData"),document.getElementsByTagName("head")[0].appendChild(mt.localStorage.j)}catch(b){return u}return s};
mt.localStorage.set=function(b,a,d){var g=new Date;g.setTime(g.getTime()+d||31536E6);try{window.localStorage?(a=g.getTime()+"|"+a,window.localStorage.setItem(b,a)):mt.localStorage.T()&&(mt.localStorage.j.expires=g.toUTCString(),mt.localStorage.j.load(document.location.hostname),mt.localStorage.j.setAttribute(b,a),mt.localStorage.j.save(document.location.hostname))}catch(k){}};
mt.localStorage.get=function(b){if(window.localStorage){if(b=window.localStorage.getItem(b)){var a=b.indexOf("|"),d=b.substring(0,a)-0;if(d&&d>(new Date).getTime())return b.substring(a+1)}}else if(mt.localStorage.T())try{return mt.localStorage.j.load(document.location.hostname),mt.localStorage.j.getAttribute(b)}catch(g){}return t};
mt.localStorage.remove=function(b){if(window.localStorage)window.localStorage.removeItem(b);else if(mt.localStorage.T())try{mt.localStorage.j.load(document.location.hostname),mt.localStorage.j.removeAttribute(b),mt.localStorage.j.save(document.location.hostname)}catch(a){}};mt.sessionStorage={};mt.sessionStorage.set=function(b,a){if(window.sessionStorage)try{window.sessionStorage.setItem(b,a)}catch(d){}};
mt.sessionStorage.get=function(b){return window.sessionStorage?window.sessionStorage.getItem(b):t};mt.sessionStorage.remove=function(b){window.sessionStorage&&window.sessionStorage.removeItem(b)};mt.Aa={};mt.Aa.log=function(b,a){var d=new Image,g="mini_tangram_log_"+Math.floor(2147483648*Math.random()).toString(36);window[g]=d;d.onload=d.onerror=d.onabort=function(){d.onload=d.onerror=d.onabort=t;d=window[g]=t;a&&a(b)};d.src=b};mt.la={};
mt.la.ib=function(){var b="";if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];a&&a.description&&(b=a.description.replace(/^.*\s+(\S+)\s+\S+$/,"$1"))}else if(window.ActiveXObject)try{if(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))(b=a.GetVariable("$version"))&&(b=b.replace(/^.*\s+(\d+),(\d+).*$/,"$1.$2"))}catch(d){}return b};
mt.la.Qb=function(b,a,d,g,k){return'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="'+b+'" width="'+d+'" height="'+g+'"><param name="movie" value="'+a+'" /><param name="flashvars" value="'+(k||"")+'" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" name="'+b+'" width="'+d+'" height="'+g+'" src="'+a+'" flashvars="'+(k||"")+'" allowscriptaccess="always" /></object>'};mt.url={};
mt.url.k=function(b,a){var d=b.match(RegExp("(^|&|\\?|#)("+a+")=([^&#]*)(&|$|#)",""));return d?d[3]:t};mt.url.Sb=function(b){return(b=b.match(/^(https?:)\/\//))?b[1]:t};mt.url.bb=function(b){return(b=b.match(/^(https?:\/\/)?([^\/\?#]*)/))?b[2].replace(/.*@/,""):t};mt.url.aa=function(b){return(b=mt.url.bb(b))?b.replace(/:\d+$/,""):b};mt.url.ba=function(b){return(b=b.match(/^(https?:\/\/)?[^\/]*(.*)/))?b[2].replace(/[\?#].*/,"").replace(/^$/,"/"):t};
(function(){function b(){for(var a=u,b=document.getElementsByTagName("script"),g=b.length,g=100<g?100:g,k=0;k<g;k++){var n=b[k].src;if(n&&0===n.indexOf("https://hm.baidu.com/h")){a=s;break}}return a}return h.Va=b})();var A=h.Va;
h.m={Tb:"http://tongji.baidu.com/hm-web/welcome/ico",ia:"hm.baidu.com/hm.gif",Ha:"tongji.baidu.com",ob:"hmmd",pb:"hmpl",Mb:"utm_medium",nb:"hmkw",Ob:"utm_term",lb:"hmci",Lb:"utm_content",qb:"hmsr",Nb:"utm_source",mb:"hmcu",Kb:"utm_campaign",A:0,o:Math.round(+new Date/1E3),C:Math.round(+new Date/1E3)%65535,protocol:"https:"===document.location.protocol?"https:":"http:",P:A()||"https:"===document.location.protocol?"https:":"http:",Ub:0,Na:6E5,ub:6E5,Cb:5E3,Oa:5,B:1024,Ma:1,I:2147483647,Ba:"kb cc cf ci ck cl cm cp cu cw ds vl ep et fl ja ln lo lt rnd si su v cv lv api sn ct u tt".split(" "),
G:s,qa:["a","input","button"],Ja:{id:"data-hm-id",W:"data-hm-class",na:"data-hm-xpath",content:"data-hm-content",S:"data-hm-tag",link:"data-hm-link"},pa:"data-hm-enabled",oa:"data-hm-disabled"};(function(){var b={r:{},c:function(a,b){this.r[a]=this.r[a]||[];this.r[a].push(b)},L:function(a,b){this.r[a]=this.r[a]||[];for(var g=this.r[a].length,k=0;k<g;k++)this.r[a][k](b)}};return h.w=b})();
(function(){function b(b,g){var k=document.createElement("script");k.charset="utf-8";a.d(g,"Function")&&(k.readyState?k.onreadystatechange=function(){if("loaded"===k.readyState||"complete"===k.readyState)k.onreadystatechange=t,g()}:k.onload=function(){g()});k.src=b;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(k,n)}var a=mt.lang;return h.load=b})();
(function(){var b=mt.e,a=mt.lang,d=mt.event,g=mt.g,k=h.m,n=h.w,l=[],p={Ca:function(){c.ctrk&&(d.c(document,"mouseup",p.La()),d.c(window,"unload",function(){p.Q()}),setInterval(function(){p.Q()},k.Na))},La:function(){return function(e){e=p.Ya(e);if(""!==e){var a=(k.P+"//"+k.ia+"?"+h.a.za().replace(/ep=[^&]*/,"ep="+encodeURIComponent(e))).length;a+(k.I+"").length>k.B||(a+encodeURIComponent(l.join("!")+(l.length?"!":"")).length+(k.I+"").length>k.B&&p.Q(),l.push(e),(l.length>=k.Oa||/\*a\*/.test(e))&&
p.Q())}}},Ya:function(e){var d=e.target||e.srcElement;if(0===k.Ma){var m=(d.tagName||"").toLowerCase();if("embed"==m||"object"==m)return""}var q;g.da?(q=Math.max(document.documentElement.scrollTop,document.body.scrollTop),m=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),m=e.clientX+m,q=e.clientY+q):(m=e.pageX,q=e.pageY);e=p.cb(e,d,m,q);var f=window.innerWidth||document.documentElement.clientWidth||document.body.offsetWidth;switch(c.align){case 1:m-=f/2;break;case 2:m-=f}f=
[];f.push(m);f.push(q);f.push(e.vb);f.push(e.wb);f.push(e.yb);f.push(a.i(e.xb));f.push(e.Pb);f.push(e.jb);(d="a"===(d.tagName||"").toLowerCase()?d:b.Xa(d))?(f.push("a"),f.push(a.i(encodeURIComponent(d.href)))):f.push("b");return f.join("*")},cb:function(e,d,m,q){e=b.ta(d);var f=0,k=0,n=0,l=0;if(d&&(f=d.offsetWidth||d.clientWidth,k=d.offsetHeight||d.clientHeight,l=b.eb(d),n=l.left,l=l.top,a.d(d.getBBox,"Function")&&(k=d.getBBox(),f=k.width,k=k.height),"html"===(d.tagName||"").toLowerCase()))f=Math.max(f,
d.clientWidth),k=Math.max(k,d.clientHeight);return{vb:Math.round(100*((m-n)/f)),wb:Math.round(100*((q-l)/k)),yb:g.orientation,xb:e,Pb:f,jb:k}},Q:function(){0!==l.length&&(h.a.b.et=2,h.a.b.ep=l.join("!"),h.a.h(),l=[])}},f={Fa:function(){c.ctrk&&setInterval(f.Db,k.Cb)},Db:function(){var e=g.D()+g.z();0<e-h.a.b.vl&&(h.a.b.vl=e)}};n.c("pv-b",p.Ca);n.c("pv-b",f.Fa);return p})();
(function(){var b=mt.lang,a=mt.e,d=mt.event,g=mt.g,k=h.m,n=h.w,l=+new Date,p=[],f={ra:function(){return function(e){if(h.a&&h.a.G&&c.aet&&c.aet.length){var d=e.target||e.srcElement;if(d){var m=h.a.qa,q=a.getAttribute(d,k.pa)!=t?s:u;if(a.getAttribute(d,k.oa)==t)if(q)f.U(f.$(d,e));else{var g=a.M(d);if(b.F(m,"*")||b.F(m,g))f.U(f.$(d,e));else for(;d.parentNode!=t;){var q=d.parentNode,g=a.M(q),n="a"===g&&b.F(m,"a")?s:u,g="button"===g&&b.F(m,"button")?s:u,l=a.getAttribute(q,k.pa)!=t?s:u;if(a.getAttribute(q,
k.oa)==t&&(n||g||l)){f.U(f.$(q,e));break}d=d.parentNode}}}}}},$:function(e,d){var m={},q=k.Ja;m.id=a.getAttribute(e,q.id)||a.getAttribute(e,"id")||"";m.W=a.getAttribute(e,q.W)||a.getAttribute(e,"class")||"";m.na=a.getAttribute(e,q.na)||a.ta(e);m.content=a.getAttribute(e,q.content)||a.$a(e);m.S=a.getAttribute(e,q.S)||a.M(e);m.link=a.getAttribute(e,q.link)||a.getAttribute(e,"href")||"";m.type=d.type||"click";q=b.wa(e.offsetTop)?e.offsetTop:0;"click"===d.type?q=g.da?d.clientY+Math.max(document.documentElement.scrollTop,
document.body.scrollTop):d.pageY:"touchend"===d.type&&(d.ga&&b.d(d.ga.changedTouches,"Array")&&d.ga.changedTouches.length)&&(q=d.ga.changedTouches[0].pageY);m.Jb=q;return m},U:function(e){var a=b.i,a=[+new Date-(h.a.s!==r?h.a.s:l),a(e.id),a(e.W),a(e.S),a(e.na),a(e.link),a(e.content),e.type,e.Jb].join("*");f.V(a);b.F(["a"],e.S)&&b.d(this.J(),"Function")&&this.J()()},V:function(e){e.length>k.B||(encodeURIComponent(p.join("!")+e).length>k.B&&(f.K(p.join("!")),p=[]),p.push(e))},K:function(e){h.a.b.et=
5;h.a.b.ep=e;h.a.h()},J:function(){return function(){p&&p.length&&(f.K(p.join("!")),p=[])}}};b.ea()&&""!==c.aet&&n.c("pv-b",function(){d.c(document,"click",f.ra());"ontouchend"in document&&d.c(window,"touchend",f.ra());d.c(window,"unload",f.J())});return f})();
(function(){var b=mt.event,a=mt.g,d=h.m,g=h.w,k=+new Date,n=[],l=t,p={Ra:function(){return function(){h.a&&(h.a.G&&c.aet&&c.aet.length)&&(window.clearTimeout(l),l=window.setTimeout(function(){p.Ea(a.D()+a.z())},150))}},Ea:function(a){p.V([+new Date-(h.a.s!==r?h.a.s:k),a].join("*"))},V:function(a){if(encodeURIComponent(n.join("!")+a).length>d.B||5<n.length)p.K(n.join("!")),n=[];n.push(a)},K:function(b){h.a.b.et=6;h.a.b.vh=a.z();h.a.b.ep=b;h.a.h()},J:function(){return function(){n&&n.length&&(p.K(n.join("!")),
n=[])}}};mt.lang.ea()&&""!==c.aet&&g.c("pv-b",function(){b.c(window,"scroll",p.Ra());b.c(window,"unload",p.J())});return p})();
(function(){function b(){return function(){h.a.b.nv=0;h.a.b.st=4;h.a.b.et=3;h.a.b.ep=h.X.fb()+","+h.X.ab();h.a.h()}}function a(){clearTimeout(z);var b;w&&(b="visible"==document[w]);y&&(b=!document[y]);p="undefined"==typeof b?s:b;if((!l||!f)&&p&&e)x=s,m=+new Date;else if(l&&f&&(!p||!e))x=u,q+=+new Date-m;l=p;f=e;z=setTimeout(a,100)}function d(e){var a=document,b="";if(e in a)b=e;else for(var m=["webkit","ms","moz","o"],d=0;d<m.length;d++){var q=m[d]+e.charAt(0).toUpperCase()+e.slice(1);if(q in a){b=
q;break}}return b}function g(b){if(!("focus"==b.type||"blur"==b.type)||!(b.target&&b.target!=window))e="focus"==b.type||"focusin"==b.type?s:u,a()}var k=mt.event,n=h.w,l=s,p=s,f=s,e=s,v=+new Date,m=v,q=0,x=s,w=d("visibilityState"),y=d("hidden"),z;a();(function(){var e=w.replace(/[vV]isibilityState/,"visibilitychange");k.c(document,e,a);k.c(window,"pageshow",a);k.c(window,"pagehide",a);"object"==typeof document.onfocusin?(k.c(document,"focusin",g),k.c(document,"focusout",g)):(k.c(window,"focus",g),
k.c(window,"blur",g))})();h.X={fb:function(){return+new Date-v},ab:function(){return x?+new Date-m+q:q}};n.c("pv-b",function(){k.c(window,"unload",b())});return h.X})();
(function(){var b=mt.lang,a=h.m,d=h.load,g={tb:function(k){if((window._dxt===r||b.d(window._dxt,"Array"))&&"undefined"!==typeof h.a){var g=h.a.Z();d([a.protocol,"//datax.baidu.com/x.js?si=",c.id,"&dm=",encodeURIComponent(g)].join(""),k)}},Ib:function(a){if(b.d(a,"String")||b.d(a,"Number"))window._dxt=window._dxt||[],window._dxt.push(["_setUserId",a])}};return h.Pa=g})();
(function(){function b(e,a,b,d){if(!(e===r||a===r||d===r)){if(""===e)return[a,b,d].join("*");e=String(e).split("!");for(var f,k=u,g=0;g<e.length;g++)if(f=e[g].split("*"),String(a)===f[0]){f[1]=b;f[2]=d;e[g]=f.join("*");k=s;break}k||e.push([a,b,d].join("*"));return e.join("!")}}function a(e){for(var b in e)if({}.hasOwnProperty.call(e,b)){var m=e[b];d.d(m,"Object")||d.d(m,"Array")?a(m):e[b]=String(m)}}var d=mt.lang,g=mt.l,k=mt.g,n=h.m,l=h.w,p=h.Pa,f={H:[],R:0,xa:u,p:{ma:"",page:""},init:function(){f.f=
0;l.c("pv-b",function(){f.Qa();f.Ta()});l.c("pv-d",function(){f.Ua();f.p.page=""});l.c("stag-b",function(){h.a.b.api=f.f||f.R?f.f+"_"+f.R:"";h.a.b.ct=[decodeURIComponent(h.a.getData("Hm_ct_"+c.id)||""),f.p.ma,f.p.page].join("!")});l.c("stag-d",function(){h.a.b.api=0;f.f=0;f.R=0})},Qa:function(){var e=window._hmt||[];if(!e||d.d(e,"Array"))window._hmt={id:c.id,cmd:{},push:function(){for(var e=window._hmt,a=0;a<arguments.length;a++){var b=arguments[a];d.d(b,"Array")&&(e.cmd[e.id].push(b),"_setAccount"===
b[0]&&(1<b.length&&/^[0-9a-f]{32}$/.test(b[1]))&&(b=b[1],e.id=b,e.cmd[b]=e.cmd[b]||[]))}}},window._hmt.cmd[c.id]=[],window._hmt.push.apply(window._hmt,e)},Ta:function(){var e=window._hmt;if(e&&e.cmd&&e.cmd[c.id])for(var a=e.cmd[c.id],b=/^_track(Event|MobConv|Order|RTEvent)$/,d=0,k=a.length;d<k;d++){var g=a[d];b.test(g[0])?f.H.push(g):f.ha(g)}e.cmd[c.id]={push:f.ha}},Ua:function(){if(0<f.H.length)for(var e=0,a=f.H.length;e<a;e++)f.ha(f.H[e]);f.H=t},ha:function(a){var b=a[0];if(f.hasOwnProperty(b)&&
d.d(f[b],"Function"))f[b](a)},_setAccount:function(a){1<a.length&&/^[0-9a-f]{32}$/.test(a[1])&&(f.f|=1)},_setAutoPageview:function(a){if(1<a.length&&(a=a[1],u===a||s===a))f.f|=2,h.a.ua=a},_trackPageview:function(a){if(1<a.length&&a[1].charAt&&"/"===a[1].charAt(0)){f.f|=4;h.a.b.et=0;h.a.b.ep="";h.a.b.vl=k.D()+k.z();h.a.b.kb=0;h.a.ca?(h.a.b.nv=0,h.a.b.st=4):h.a.ca=s;var b=h.a.b.u,d=h.a.b.su;h.a.b.u=n.protocol+"//"+document.location.host+a[1];f.xa||(h.a.b.su=document.location.href);h.a.h();h.a.b.u=b;
h.a.b.su=d;h.a.s=+new Date}},_trackEvent:function(a){2<a.length&&(f.f|=8,h.a.b.nv=0,h.a.b.st=4,h.a.b.et=4,h.a.b.ep=d.i(a[1])+"*"+d.i(a[2])+(a[3]?"*"+d.i(a[3]):"")+(a[4]?"*"+d.i(a[4]):""),h.a.h())},_setCustomVar:function(a){if(!(4>a.length)){var b=a[1],m=a[4]||3;if(0<b&&6>b&&0<m&&4>m){f.R++;for(var q=(h.a.b.cv||"*").split("!"),g=q.length;g<b-1;g++)q.push("*");q[b-1]=m+"*"+d.i(a[2])+"*"+d.i(a[3]);h.a.b.cv=q.join("!");a=h.a.b.cv.replace(/[^1](\*[^!]*){2}/g,"*").replace(/((^|!)\*)+$/g,"");""!==a?h.a.setData("Hm_cv_"+
c.id,encodeURIComponent(a),c.age):h.a.Ab("Hm_cv_"+c.id)}}},_setUserTag:function(a){if(!(3>a.length)){var f=d.i(a[1]);a=d.i(a[2]);if(f!==r&&a!==r){var m=decodeURIComponent(h.a.getData("Hm_ct_"+c.id)||""),m=b(m,f,1,a);h.a.setData("Hm_ct_"+c.id,encodeURIComponent(m),c.age)}}},_setVisitTag:function(a){if(!(3>a.length)){var g=d.i(a[1]);a=d.i(a[2]);if(g!==r&&a!==r){var m=f.p.ma,m=b(m,g,2,a);f.p.ma=m}}},_setPageTag:function(a){if(!(3>a.length)){var g=d.i(a[1]);a=d.i(a[2]);if(g!==r&&a!==r){var m=f.p.page,
m=b(m,g,3,a);f.p.page=m}}},_setReferrerOverride:function(a){1<a.length&&(h.a.b.su=a[1].charAt&&"/"===a[1].charAt(0)?n.protocol+"//"+window.location.host+a[1]:a[1],f.xa=s)},_trackOrder:function(b){b=b[1];d.d(b,"Object")&&(a(b),f.f|=16,h.a.b.nv=0,h.a.b.st=4,h.a.b.et=94,h.a.b.ep=g.stringify(b),h.a.h())},_trackMobConv:function(a){if(a={webim:1,tel:2,map:3,sms:4,callback:5,share:6}[a[1]])f.f|=32,h.a.b.et=93,h.a.b.ep=a,h.a.h()},_trackRTPageview:function(b){b=b[1];d.d(b,"Object")&&(a(b),b=g.stringify(b),
512>=encodeURIComponent(b).length&&(f.f|=64,h.a.b.rt=b))},_trackRTEvent:function(b){b=b[1];if(d.d(b,"Object")){a(b);b=encodeURIComponent(g.stringify(b));var k=function(a){var b=h.a.b.rt;f.f|=128;h.a.b.et=90;h.a.b.rt=a;h.a.h();h.a.b.rt=b},m=b.length;if(900>=m)k.call(this,b);else for(var m=Math.ceil(m/900),q="block|"+Math.round(Math.random()*n.I).toString(16)+"|"+m+"|",l=[],w=0;w<m;w++)l.push(w),l.push(b.substring(900*w,900*w+900)),k.call(this,q+l.join("|")),l=[]}},_setUserId:function(a){a=a[1];p.tb();
p.Ib(a)},_setAutoTracking:function(a){if(1<a.length&&(a=a[1],u===a||s===a))h.a.va=a},_setAutoEventTracking:function(a){if(1<a.length&&(a=a[1],u===a||s===a))h.a.G=a}};f.init();h.Ia=f;return h.Ia})();
(function(){function b(){"undefined"===typeof window["_bdhm_loaded_"+c.id]&&(window["_bdhm_loaded_"+c.id]=s,this.b={},this.va=this.ua=s,this.G=e.G,this.qa=k.ea()&&0<c.aet.length?c.aet.split(","):"",this.ca=u,this.init())}var a=mt.url,d=mt.Aa,g=mt.la,k=mt.lang,n=mt.cookie,l=mt.g,p=mt.localStorage,f=mt.sessionStorage,e=h.m,v=h.w;b.prototype={fa:function(a,b){a="."+a.replace(/:\d+/,"");b="."+b.replace(/:\d+/,"");var d=a.indexOf(b);return-1<d&&d+b.length===a.length},ya:function(a,b){a=a.replace(/^https?:\/\//,
"");return 0===a.indexOf(b)},N:function(b){for(var d=0;d<c.dm.length;d++)if(-1<c.dm[d].indexOf("/")){if(this.ya(b,c.dm[d]))return s}else{var e=a.aa(b);if(e&&this.fa(e,c.dm[d]))return s}return u},Z:function(){for(var a=document.location.hostname,b=0,d=c.dm.length;b<d;b++)if(this.fa(a,c.dm[b]))return c.dm[b].replace(/(:\d+)?[\/\?#].*/,"");return a},sa:function(){for(var a=0,b=c.dm.length;a<b;a++){var d=c.dm[a];if(-1<d.indexOf("/")&&this.ya(document.location.href,d))return d.replace(/^[^\/]+(\/.*)/,
"$1")+"/"}return"/"},gb:function(){if(!document.referrer)return e.o-e.A>c.vdur?1:4;var b=u;this.N(document.referrer)&&this.N(document.location.href)?b=s:(b=a.aa(document.referrer),b=this.fa(b||"",document.location.hostname));return b?e.o-e.A>c.vdur?1:4:3},getData:function(a){try{return n.get(a)||f.get(a)||p.get(a)}catch(b){}},setData:function(a,b,d){try{n.set(a,b,{domain:this.Z(),path:this.sa(),Y:d}),d?p.set(a,b,d):f.set(a,b)}catch(e){}},Ab:function(a){try{n.set(a,"",{domain:this.Z(),path:this.sa(),
Y:-1}),f.remove(a),p.remove(a)}catch(b){}},Gb:function(){var a,b,d,f,g;e.A=this.getData("Hm_lpvt_"+c.id)||0;13===e.A.length&&(e.A=Math.round(e.A/1E3));b=this.gb();a=4!==b?1:0;if(d=this.getData("Hm_lvt_"+c.id)){f=d.split(",");for(g=f.length-1;0<=g;g--)13===f[g].length&&(f[g]=""+Math.round(f[g]/1E3));for(;2592E3<e.o-f[0];)f.shift();g=4>f.length?2:3;for(1===a&&f.push(e.o);4<f.length;)f.shift();d=f.join(",");f=f[f.length-1]}else d=e.o,f="",g=1;this.setData("Hm_lvt_"+c.id,d,c.age);this.setData("Hm_lpvt_"+
c.id,e.o);d=e.o===this.getData("Hm_lpvt_"+c.id)?"1":"0";if(0===c.nv&&this.N(document.location.href)&&(""===document.referrer||this.N(document.referrer)))a=0,b=4;this.b.nv=a;this.b.st=b;this.b.cc=d;this.b.lt=f;this.b.lv=g},za:function(){for(var a=[],b=this.b.et,d=+new Date,f=0,g=e.Ba.length;f<g;f++){var k=e.Ba[f],l=this.b[k];"undefined"!==typeof l&&""!==l&&("tt"!==k||"tt"===k&&0===b)&&(("ct"!==k||"ct"===k&&0===b)&&("kb"!==k||"kb"===k&&3===b))&&a.push(k+"="+encodeURIComponent(l))}switch(b){case 0:a.push("sn="+
e.C);this.b.rt&&a.push("rt="+encodeURIComponent(this.b.rt));break;case 3:a.push("sn="+e.C);break;case 5:a.push("sn="+e.C);a.push("_lpt="+this.s);a.push("_ct="+d);break;case 6:a.push("sn="+e.C);a.push("_lpt="+this.s);a.push("_ct="+d);break;case 85:a.push("sn="+e.C);break;case 90:this.b.rt&&a.push("rt="+this.b.rt)}return a.join("&")},Hb:function(){this.Gb();this.b.si=c.id;this.b.su=document.referrer;this.b.ds=l.Bb;this.b.cl=l.colorDepth+"-bit";this.b.ln=String(l.language).toLowerCase();this.b.ja=l.javaEnabled?
1:0;this.b.ck=l.cookieEnabled?1:0;this.b.lo="number"===typeof _bdhm_top?1:0;this.b.fl=g.ib();this.b.v="1.2.38";this.b.cv=decodeURIComponent(this.getData("Hm_cv_"+c.id)||"");this.b.tt=document.title||"";this.b.vl=l.D()+l.z();var b=document.location.href;this.b.cm=a.k(b,e.ob)||"";this.b.cp=a.k(b,e.pb)||a.k(b,e.Mb)||"";this.b.cw=a.k(b,e.nb)||a.k(b,e.Ob)||"";this.b.ci=a.k(b,e.lb)||a.k(b,e.Lb)||"";this.b.cf=a.k(b,e.qb)||a.k(b,e.Nb)||"";this.b.cu=a.k(b,e.mb)||a.k(b,e.Kb)||""},init:function(){try{this.Hb(),
0===this.b.nv?this.Fb():this.ka(".*"),h.a=this,this.Ka(),v.L("pv-b"),this.Eb()}catch(a){var b=[];b.push("si="+c.id);b.push("n="+encodeURIComponent(a.name));b.push("m="+encodeURIComponent(a.message));b.push("r="+encodeURIComponent(document.referrer));d.log(e.P+"//"+e.ia+"?"+b.join("&"))}},Eb:function(){function a(){v.L("pv-d")}this.ua?(this.ca=s,this.b.et=0,this.b.ep="",this.b.vl=l.D()+l.z(),this.h(a)):a();this.s=+new Date},h:function(a){if(this.va){var b=this;b.b.rnd=Math.round(Math.random()*e.I);
v.L("stag-b");var f=e.P+"//"+e.ia+"?"+b.za();v.L("stag-d");b.Ga(f);d.log(f,function(d){b.ka(d);k.d(a,"Function")&&a.call(b)})}},Ka:function(){var b=document.location.hash.substring(1),d=RegExp(c.id),f=a.aa(document.referrer)===e.Ha?1:0,g=a.k(b,"jn"),k=/^heatlink$|^select$|^pageclick$/.test(g);b&&(d.test(b)&&f&&k)&&(this.b.rnd=Math.round(Math.random()*e.I),b=document.createElement("script"),b.setAttribute("type","text/javascript"),b.setAttribute("charset","utf-8"),b.setAttribute("src",e.protocol+"//"+
c.js+g+".js?"+this.b.rnd),g=document.getElementsByTagName("script")[0],g.parentNode.insertBefore(b,g))},Ga:function(a){var b=f.get("Hm_unsent_"+c.id)||"",d=this.b.u?"":"&u="+encodeURIComponent(document.location.href),b=encodeURIComponent(a.replace(/^https?:\/\//,"")+d)+(b?","+b:"");f.set("Hm_unsent_"+c.id,b)},ka:function(a){var b=f.get("Hm_unsent_"+c.id)||"";b&&(a=encodeURIComponent(a.replace(/^https?:\/\//,"")),a=RegExp(a.replace(/([\*\(\)])/g,"\\$1")+"(%26u%3D[^,]*)?,?","g"),(b=b.replace(a,"").replace(/,$/,
""))?f.set("Hm_unsent_"+c.id,b):f.remove("Hm_unsent_"+c.id))},Fb:function(){var a=this,b=f.get("Hm_unsent_"+c.id);if(b)for(var b=b.split(","),g=function(b){d.log(e.P+"//"+decodeURIComponent(b),function(b){a.ka(b)})},k=0,l=b.length;k<l;k++)g(b[k])}};return new b})();
(function(){var b=mt.event,a=mt.lang,d=h.m;if(c.kbtrk&&"undefined"!==typeof h.a){h.a.b.kb=a.wa(h.a.b.kb)?h.a.b.kb:0;var g=function(){h.a.b.et=85;h.a.b.ep=h.a.b.kb;h.a.h()};b.c(document,"keyup",function(){h.a.b.kb++});b.c(window,"unload",function(){g()});setInterval(g,d.ub)}})();var B=h.m,C=h.load;c.pt&&C([B.protocol,"//ada.baidu.com/phone-tracker/insert_bdtj?sid=",c.pt].join(""));
(function(){var b=mt.event,a=mt.l;try{if(window.performance&&performance.timing&&"undefined"!==typeof h.a){var d=function(a){var b=performance.timing,d=b[a+"Start"]?b[a+"Start"]:0;a=b[a+"End"]?b[a+"End"]:0;return{start:d,end:a,value:0<a-d?a-d:0}},g=function(){var b;b=d("navigation");var g=d("request");b={netAll:g.start-b.start,netDns:d("domainLookup").value,netTcp:d("connect").value,srv:d("response").start-g.start,dom:performance.timing.domInteractive-performance.timing.fetchStart,loadEvent:d("loadEvent").end-
b.start};h.a.b.et=87;h.a.b.ep=a.stringify(b);h.a.h()};b.c(window,"load",function(){setTimeout(g,500)})}}catch(k){}})();
(function(){var b=mt.g,a=mt.lang,d=mt.event,g=mt.l;if("undefined"!==typeof h.a&&(c.med||(!b.da||7<b.rb)&&c.cvcc)){var k,n,l,p,f=function(a){if(a.item){for(var b=a.length,d=Array(b);b--;)d[b]=a[b];return d}return[].slice.call(a)},e=function(a,b){for(var d in a)if(a.hasOwnProperty(d)&&b.call(a,d,a[d])===u)return u},v=function(b,d){var e={};e.n=k;e.t="clk";e.v=b;if(d){var f=d.getAttribute("href"),n=d.getAttribute("onclick")?""+d.getAttribute("onclick"):t,m=d.getAttribute("id")||"";l.test(f)?(e.sn="mediate",
e.snv=f):a.d(n,"String")&&l.test(n)&&(e.sn="wrap",e.snv=n);e.id=m}h.a.b.et=86;h.a.b.ep=g.stringify(e);h.a.h();for(e=+new Date;400>=+new Date-e;);};if(c.med)n="/zoosnet",k="swt",l=/swt|zixun|call|chat|zoos|business|talk|kefu|openkf|online|\/LR\/Chatpre\.aspx/i,p={click:function(){for(var a=[],b=f(document.getElementsByTagName("a")),b=[].concat.apply(b,f(document.getElementsByTagName("area"))),b=[].concat.apply(b,f(document.getElementsByTagName("img"))),d,e,g=0,k=b.length;g<k;g++)d=b[g],e=d.getAttribute("onclick"),
d=d.getAttribute("href"),(l.test(e)||l.test(d))&&a.push(b[g]);return a}};else if(c.cvcc){n="/other-comm";k="other";l=c.cvcc.q||r;var m=c.cvcc.id||r;p={click:function(){for(var a=[],b=f(document.getElementsByTagName("a")),b=[].concat.apply(b,f(document.getElementsByTagName("area"))),b=[].concat.apply(b,f(document.getElementsByTagName("img"))),d,e,g,k=0,n=b.length;k<n;k++)d=b[k],l!==r?(e=d.getAttribute("onclick"),g=d.getAttribute("href"),m?(d=d.getAttribute("id"),(l.test(e)||l.test(g)||m.test(d))&&
a.push(b[k])):(l.test(e)||l.test(g))&&a.push(b[k])):m!==r&&(d=d.getAttribute("id"),m.test(d)&&a.push(b[k]));return a}}}if("undefined"!==typeof p&&"undefined"!==typeof l){var q;n+=/\/$/.test(n)?"":"/";var x=function(b,d){if(q===d)return v(n+b,d),u;if(a.d(d,"Array")||a.d(d,"NodeList"))for(var e=0,f=d.length;e<f;e++)if(q===d[e])return v(n+b+"/"+(e+1),d[e]),u};d.c(document,"mousedown",function(b){b=b||window.event;q=b.target||b.srcElement;var d={};for(e(p,function(b,e){d[b]=a.d(e,"Function")?e():document.getElementById(e)});q&&
q!==document&&e(d,x)!==u;)q=q.parentNode})}}})();(function(){var b=mt.e,a=mt.lang,d=mt.event,g=mt.l;if("undefined"!==typeof h.a&&a.d(c.cvcf,"Array")&&0<c.cvcf.length){var k={Da:function(){for(var a=c.cvcf.length,g,p=0;p<a;p++)(g=b.Wa(decodeURIComponent(c.cvcf[p])))&&d.c(g,"click",k.Sa())},Sa:function(){return function(){h.a.b.et=86;var a={n:"form",t:"clk"};a.id=this.id;h.a.b.ep=g.stringify(a);h.a.h()}}};b.zb(function(){k.Da()})}})();
(function(){var b=mt.event,a=mt.l;if(c.med&&"undefined"!==typeof h.a){var d=+new Date,g={n:"anti",sb:0,kb:0,clk:0},k=function(){h.a.b.et=86;h.a.b.ep=a.stringify(g);h.a.h()};b.c(document,"click",function(){g.clk++});b.c(document,"keyup",function(){g.kb=1});b.c(window,"scroll",function(){g.sb++});b.c(window,"unload",function(){g.t=+new Date-d;k()});b.c(window,"load",function(){setTimeout(k,5E3)})}})();})();
| 445.710145 | 737 | 0.638616 |
1d05232dcb218b0d68155a0974c5a9b68bf44178 | 499 | js | JavaScript | src/utils/import/realTime.js | alenrajsp/sport-data-visualization | f54ba9eceed96153fa2b343444c3045b4ce58dd4 | [
"MIT"
] | null | null | null | src/utils/import/realTime.js | alenrajsp/sport-data-visualization | f54ba9eceed96153fa2b343444c3045b4ce58dd4 | [
"MIT"
] | 2 | 2022-03-30T08:45:52.000Z | 2022-03-31T18:30:45.000Z | src/utils/import/realTime.js | alenrajsp/sport-data-visualization | f54ba9eceed96153fa2b343444c3045b4ce58dd4 | [
"MIT"
] | 2 | 2022-03-29T13:39:29.000Z | 2022-03-29T19:25:53.000Z | import axios from 'axios';
import { addCharts } from '../../functions/charts/addCharts';
import { AddRealTimeRequest } from '../axios/multipleAxios';
function ImportRealTime(commit) {
axios.all(AddRealTimeRequest())
.then(response => {
commit('SET_REALTIME_DATA', response[0].data)
commit('SET_REALTIME_CHART_OPTIONS', addCharts(response[0].data))
})
.catch((error) => {
console.log(error)
})
.finally(() => {
})
}
export {
ImportRealTime
} | 23.761905 | 73 | 0.635271 |
1d05c96d7c61da826a58e4843c677df4158585d2 | 4,800 | js | JavaScript | app/src/features/home/NetworkContainer.js | iandanforth/thought-experiment | c7f8a56d372a6cc5bb1e65d1899e8f180b0c1052 | [
"MIT"
] | null | null | null | app/src/features/home/NetworkContainer.js | iandanforth/thought-experiment | c7f8a56d372a6cc5bb1e65d1899e8f180b0c1052 | [
"MIT"
] | null | null | null | app/src/features/home/NetworkContainer.js | iandanforth/thought-experiment | c7f8a56d372a6cc5bb1e65d1899e8f180b0c1052 | [
"MIT"
] | null | null | null | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Stage } from 'react-pixi-fiber';
import { isEqual } from 'underscore';
import * as PIXI from 'pixi.js';
import * as actions from './redux/actions';
import NetWrapper from './NetWrapper';
import InputRow from './InputRow';
import NeuronGroupRow from './NeuronGroupRow';
import NetworkConnections from './NetworkConnections';
import { getNextInputVector } from '../../common/inputVector';
import { getNextNeuronVector } from '../../common/neuronVector';
import { getNextTransitionMatrix } from '../../common/transitionMatrix';
export class NetworkContainer extends PureComponent {
static propTypes = {
home: PropTypes.shape({
numNeurons: PropTypes.number.isRequired,
nv: PropTypes.array.isRequired,
iv: PropTypes.array.isRequired,
inputDirection: PropTypes.number.isRequired,
neuronSpacing: PropTypes.number.isRequired,
neuronRadius: PropTypes.number.isRequired,
baseConnectionHeight: PropTypes.number.isRequired,
baseConnectionWidth: PropTypes.number.isRequired,
tm: PropTypes.object.isRequired,
updateDelay: PropTypes.number.isRequired,
inputRunning: PropTypes.bool.isRequired,
probeOnce: PropTypes.bool.isRequired,
networkY: PropTypes.number.isRequired,
stageWidth: PropTypes.number.isRequired
}).isRequired,
actions: PropTypes.object.isRequired,
};
constructor(props) {
super(props);
this.updateTimer = null;
this.stepInput = this.stepInput.bind(this);
this.tick = this.tick.bind(this);
this.updateNetwork = this.updateNetwork.bind(this);
}
componentDidMount() {
// Start ticker here
const { updateDelay } = this.props.home;
if (this.updateTimer === null) {
this.updateTimer = setTimeout(this.tick, updateDelay);
}
}
componentWillUnmount() {
const { resetNeuronVector, resetInputVector, stopInputRunning } = this.props.actions;
if (this.updateTimer !== null) {
console.log('Cleaning up timer');
clearInterval(this.updateTimer);
this.updateTimer = null;
}
stopInputRunning();
resetInputVector();
resetNeuronVector();
}
stepInput() {
const { iv, inputDirection } = this.props.home;
const { updateInputVector } = this.props.actions;
// For now we always advance to the next input being on in a repeating cycle
const nextIV = getNextInputVector(iv, inputDirection);
updateInputVector(nextIV);
return nextIV;
}
tick() {
const { inputRunning, updateDelay, probeOnce, iv } = this.props.home;
const { disableProbe } = this.props.actions;
// Special case where we want to probe the network with a single
// 'flash' of an input
// TODO: This is an ugly hack ... figure out something better
if (probeOnce) {
setTimeout(disableProbe, updateDelay / 2);
}
let nextIV = iv;
if (inputRunning) {
nextIV = this.stepInput();
}
this.updateNetwork(nextIV);
this.updateTimer = setTimeout(this.tick, updateDelay);
}
// Updates both the neuron vector and the transition matrix
updateNetwork(inputVector) {
// ES6 absurdity: Asignment is right to left. prevNV is assigned value of nv.
const { nv: prevNV, tm: prevTM } = this.props.home;
const { updateFullNetwork } = this.props.actions;
const nextNV = getNextNeuronVector(prevNV, inputVector, prevTM);
if (!isEqual(prevNV, nextNV)) {
const nextTM = getNextTransitionMatrix(prevTM, prevNV, nextNV);
updateFullNetwork(nextNV, nextTM);
}
}
render() {
const stageOptions = {
backgroundColor: 0xC7DAF2,
antialias: true,
resolution: 2,
};
// Take control of rendering
// See NetWrapper for new rendering loop
stageOptions.autoStart = false;
stageOptions.sharedTicker = true;
const ticker = PIXI.ticker.shared;
ticker.autoStart = false;
ticker.stop();
const { stageWidth } = this.props.home;
return (
<div className="home-network-container">
<Stage height={500} width={stageWidth} options={stageOptions}>
<NetWrapper>
<NetworkConnections {...this.props.home} />
<NeuronGroupRow {...this.props.home} />
<InputRow {...this.props.home} />
</NetWrapper>
</Stage>
</div>
);
}
}
/* istanbul ignore next */
function mapStateToProps(state) {
return {
home: state.home,
};
}
/* istanbul ignore next */
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({ ...actions }, dispatch)
};
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(NetworkContainer);
| 30.188679 | 89 | 0.676875 |
1d09023c79ed836a83ead659bea06c4bb5b75f42 | 1,107 | js | JavaScript | src/app/templates/src/shared/redux/reducers/authentication.js | AnalyticsFire/generator-spike | 348e5a8f88da2dc60b109ef896c56890e286b446 | [
"MIT"
] | null | null | null | src/app/templates/src/shared/redux/reducers/authentication.js | AnalyticsFire/generator-spike | 348e5a8f88da2dc60b109ef896c56890e286b446 | [
"MIT"
] | 1 | 2017-06-26T17:39:57.000Z | 2017-06-27T14:25:23.000Z | src/app/templates/src/shared/redux/reducers/authentication.js | AnalyticsFire/generator-spike | 348e5a8f88da2dc60b109ef896c56890e286b446 | [
"MIT"
] | null | null | null | import { createReducer } from 'redux-act';
import actions from 'shared/redux/actions';
const { authentication } = actions;
export default createReducer({
[authentication.login]: (authState, _payload) => ({
...authState,
loggingIn: true,
loginError: null,
token: null
}),
[authentication.loginSuccess]: (authState, { token }) => ({
...authState,
loggingIn: false,
loggedIn: true,
loginError: null,
token
}),
[authentication.loginError]: (authState, payload) => ({
...authState,
loggingIn: false,
loggedIn: false,
loginError: payload,
token: null
}),
[authentication.logout]: authState => ({
...authState,
loggingOut: true
}),
[authentication.logoutSuccess]: authState => ({
...authState,
loggingOut: false,
loggedIn: false,
token: null
}),
// Logout of server failed. Logout of client. The error
// should be reported in middleware.
[authentication.logoutError]: authState => ({
...authState,
loggingOut: false,
loggedIn: false,
token: null
})
}, { token: null, loggedIn: false });
| 24.065217 | 61 | 0.633243 |
1d099a69f59c215a4b0f147e2677df903460a137 | 579 | js | JavaScript | src/theme/_variables.js | shlommi/shlomi-cohen-portfolio | 4421ec7c1cf56d03a805f606f2fe86c9bc75a31a | [
"MIT"
] | null | null | null | src/theme/_variables.js | shlommi/shlomi-cohen-portfolio | 4421ec7c1cf56d03a805f606f2fe86c9bc75a31a | [
"MIT"
] | null | null | null | src/theme/_variables.js | shlommi/shlomi-cohen-portfolio | 4421ec7c1cf56d03a805f606f2fe86c9bc75a31a | [
"MIT"
] | null | null | null | import "../css/typography.css"
// COLORS
export const dark_green = "#133030"
export const textColor = "#1a2925"
export const green = "#2F7A79"
export const light_green = "#B4E2E2"
export const white_green = "#F2FAFA"
export const background_white = "#FEFFFF"
// Fonts
export const font_size_sm = "16px"
export const font_size_md = "18px"
export const font_light = '"Montserrat-Light", sans-serif'
export const font_regular = '"Montserrat-Regular", sans-serif'
export const font_black = '"Montserrat-Black", sans-serif'
// ANIMATION
export const transition_time = "150ms"
| 25.173913 | 62 | 0.74266 |
1d09c8b45fab72da43fcccf8db5157199c659948 | 813 | js | JavaScript | MagicMirror/modules/YouTubeM/YouTubeM.js | HyeongRae/SmartMirrorForDiet | c5349fecafde6f156c8f1f028df698359eb4fb42 | [
"MIT"
] | 5 | 2018-11-23T04:44:23.000Z | 2018-11-23T06:05:55.000Z | MagicMirror/modules/YouTubeM/YouTubeM.js | HyeongRae/SmartMirrorForDiet | c5349fecafde6f156c8f1f028df698359eb4fb42 | [
"MIT"
] | null | null | null | MagicMirror/modules/YouTubeM/YouTubeM.js | HyeongRae/SmartMirrorForDiet | c5349fecafde6f156c8f1f028df698359eb4fb42 | [
"MIT"
] | 1 | 2018-11-23T04:45:00.000Z | 2018-11-23T04:45:00.000Z | Module.register("YouTubeM", {
start: function() {
this.key = this.config.key;
},
getDom: function(){
var wrapper = document.createElement('div');
wrapper.setAttribute("id", "YouTubeDiv");
var videoframe = document.createElement("iframe");
wrapper.appendChild(videoframe);
videoframe.setAttribute("id", "ytplayer");
videoframe.setAttribute("src", "");
videoframe.setAttribute("class", ".yt_player_iframe");
videoframe.setAttribute("width", "100%");
videoframe.setAttribute("height", "100%");
videoframe.setAttribute("allowfullscreen", "ture");
videoframe.setAttribute("allowscriptaccess", "always");
videoframe.setAttribute("frameborder", "0");
return wrapper;
}
});
| 30.111111 | 63 | 0.610086 |
1d09fd2198793fcee209d368ffbc440583c0be1c | 481 | js | JavaScript | framework/PVRCore/docs/html/search/enums_0.js | amaiorano/Native_SDK | 0a5b48fd1f4ad251f5b4f0e07c46744c4841255b | [
"MIT"
] | 2 | 2020-11-04T03:57:28.000Z | 2020-11-04T03:57:33.000Z | framework/PVRCore/docs/html/search/enums_0.js | amaiorano/Native_SDK | 0a5b48fd1f4ad251f5b4f0e07c46744c4841255b | [
"MIT"
] | 1 | 2021-02-09T19:06:05.000Z | 2021-02-09T19:06:05.000Z | framework/PVRCore/docs/html/search/enums_0.js | amaiorano/Native_SDK | 0a5b48fd1f4ad251f5b4f0e07c46744c4841255b | [
"MIT"
] | 1 | 2021-12-09T09:49:35.000Z | 2021-12-09T09:49:35.000Z | var searchData=
[
['api',['API',['../_file_defines_p_v_r_8h.html#ab6f4ab3a35364bfc682879bd7fafe39b',1,'pvr::texture_legacy::API()'],['../namespacepvr.html#a74c5d1afa51512f076dd8e5844b171c8',1,'pvr::Api()']]],
['axis',['Axis',['../classpvr_1_1_texture_meta_data.html#ae6062237be958135b6d9cfc9fe0fb883',1,'pvr::TextureMetaData']]],
['axisorientation',['AxisOrientation',['../classpvr_1_1_texture_meta_data.html#a5acad07c0f0cc281a017cb56e7a92f5a',1,'pvr::TextureMetaData']]]
];
| 68.714286 | 192 | 0.758836 |
1d0ab4a22d2727e49a0fe922d2f3ea62390a8cd9 | 6,971 | js | JavaScript | rightnow-firebase/src/components/user_settings/user_settings_form.js | Lambda-School-Labs/CS9-RightNow | be1c9b9e3a7a0008382bd15de114f469698da725 | [
"MIT"
] | 2 | 2018-08-13T22:53:45.000Z | 2018-08-29T19:14:52.000Z | src/components/user_settings/user_settings_form.js | mark-marchant-portfolio/Sesho-Enterprise-Appointment-Conductor | fae533e79a30fe1d0357766f514cc1c165c3fdee | [
"MIT"
] | 12 | 2018-08-17T19:27:34.000Z | 2018-09-10T18:53:30.000Z | src/components/user_settings/user_settings_form.js | mark-marchant-portfolio/Sesho-Enterprise-Appointment-Conductor | fae533e79a30fe1d0357766f514cc1c165c3fdee | [
"MIT"
] | 2 | 2018-08-22T15:16:37.000Z | 2020-05-18T15:46:28.000Z | import React, { Component } from 'react';
import moment from 'moment';
// import EmailPhone from '../share_settings/email_phone'
import { CheckBoxContainer, CheckBox, CheckBoxes } from '../share_settings/user_notification';
import { Wrapper, PwLabel, ChangePasswordInput } from '../share_settings/user_change_password';
import AppointmentDetails from '../share_settings/appointmentDetails/appointmentDetailsCustomerView';
import { Appointment, AppointmentList, Upcoming } from '../share_settings/upcoming_appointments';
import { PastAppointment, Past } from '../share_settings/past_appointments';
import { Container, Label, InputField, LeftSide, ContactTitle } from '../share_settings/contact_form';
import UserProvider, { UserContext } from '../../context/userContext';
import glamorous from 'glamorous';
export const FormContainer = glamorous.div({
// border: '1px solid blue',
width: '100%',
// margin: "2%",
border: '10px 10px',
backgroundColor: '#353A50',
cover: 'no-repeat',
textAlign: 'center',
paddingTop: '2%'
});
const Button = glamorous.button({
borderRadius: '7px',
background: '#EF5B5B',
width: '60%',
height: '100%',
alignSelf: 'center',
//margin: "0 1%",
padding: '0 3%',
fontWeight: 600,
fontSize: '1.3em',
color: '#EBEBEB',
':hover': {
color: 'white',
cursor: 'pointer',
boxShadow: '2px 2px gray'
}
});
class UserSettings extends Component {
state = {
firstName: '',
lastName: '',
phone: '',
location: '',
newPassword: '',
newPasswordAgain: '',
passwordMatch: false
};
onInputChange = (e) => {
const { name, value } = e.target;
this.setState({ [name]: value });
};
// This is for the user to see the password they are typing
showPassword() {
let x = document.getElementById('MyInput');
let y = document.getElementById('MyInput2');
if (x.type === 'password' && y.type === 'password') {
console.log('hello');
x.type = 'text';
y.type = 'text';
} else {
x.type = 'password';
y.type = 'password';
console.log('hello password');
}
}
// This function is to update and save user contact information
// need to clear form when submit happens so we need e.preventDefault() also
handleSubmit = (value) => {
/* if (newPassword !== newPasswordAgain) {
Idea one (pw):
monitor password matching
Idea two (pw):
1. change border around password fields
2. shift to top of page
3. write out which fields are throwing error
4. show warning at the password fields that they don't match
} else if (newPassword === newPasswordAgain) {
value.saveCustomerInfo(this.state)
} */
// if not empty and matching new passwords
if (this.state.newPassword === this.state.newPasswordAgain && this.state.newPassword !== '') {
value.updateUserPassword(this.state.newPasswordAgain);
}
// make it so that any unchange info retains its values rather than overwriting
// it with empty string ''
// value.updateUserBasicInfo(this.state);
};
render() {
return (
<UserProvider>
<UserContext.Consumer>
{(value) => {
return (
<FormContainer>
<h3>User Settings</h3>
{/*<UpcomingAppointments userState={value.queryResults} />*/}
<Appointment>
<Upcoming>Upcoming Appointments</Upcoming>
<hr />
<AppointmentList>
{value.upcoming_appointments.map((appt, index) => {
return (
<AppointmentDetails
service={appt['service']}
time={`${moment(appt['start']).format('h:mm A')} - ${moment(
appt['end']
).format('h:mm A')}`}
day={`${moment(appt['start']).format('MMM D YYYY')}`}
company={value.companyNames[index]}
money={appt['cost']}
/>
);
})}
</AppointmentList>
</Appointment>
<PastAppointment>
<Past>Past Appointments</Past>
</PastAppointment>
<Container>
{/*<PastAppointments userState={value} />*/}
{/*<ContactForm userState={value} />*/}
<ContactTitle>Profile Information</ContactTitle>
<LeftSide>
<Label for="test">First Name</Label>
<InputField
type="text"
name="firstName"
value={this.state.firstName}
onChange={this.onInputChange}
placeholder={value.name.split(' ')[0]}
/>
<Label>Last Name</Label>
<InputField
name="lastName"
value={this.state.lastName}
onChange={this.onInputChange}
type="text"
placeholder={value.name.split(' ')[1]}
/>
<Label>Phone Number</Label>
<InputField
name="phone"
value={this.state.phone}
onChange={this.onInputChange}
type="text"
placeholder={value.phone}
/>
<Label>Location</Label>
<InputField
name="location"
type="text"
value={this.state.location}
onChange={this.onInputChange}
placeholder={value.location}
/>
</LeftSide>
</Container>
{value.ifOAuth.includes('google') || value.ifOAuth.includes('facebook') ? null : (
<Wrapper>
{/*< UserChangePassword />*/}
<h3>Password</h3>
<Label>Password</Label>
<ChangePasswordInput
name="newPassword"
value={this.state.newPassword}
type="password"
placeholder="password"
onChange={this.onInputChange}
id="MyInput"
/>
<PwLabel>Re-Enter Password</PwLabel>
<ChangePasswordInput
name="newPasswordAgain"
value={this.state.newPasswordAgain}
type="password"
placeholder="enter password"
onChange={this.onInputChange}
id="MyInput2"
/>
<PwLabel>Show Password</PwLabel>
<ChangePasswordInput type="checkbox" onClick={this.showPassword} />
</Wrapper>
)}
<CheckBoxContainer>
{/*<UserNotification />*/}
<h3>Communication Preferences</h3> <CheckBoxes>
<CheckBox>
<div className="pretty p-default">
<input type="checkbox" />
<div className="state p-primary">
<label>Email</label>
</div>
</div>
</CheckBox>
<CheckBox>
<div className="pretty p-default">
<input type="checkbox" />
<div className="state p-warning">
<label>Text</label>
</div>
</div>
</CheckBox>
</CheckBoxes>
</CheckBoxContainer>
<Button onClick={() => this.handleSubmit(value)}>Save</Button>
</FormContainer>
);
}}
</UserContext.Consumer>
</UserProvider>
);
}
}
export default UserSettings;
| 29.790598 | 102 | 0.579257 |
1d0b66f659f616e005390639ec2e65f3c10d856d | 1,308 | js | JavaScript | js/app.js | Josly025/elite_media_design.io | a4b6e5a012896be20d679b0744ca6b1e6cf76f70 | [
"MIT"
] | null | null | null | js/app.js | Josly025/elite_media_design.io | a4b6e5a012896be20d679b0744ca6b1e6cf76f70 | [
"MIT"
] | null | null | null | js/app.js | Josly025/elite_media_design.io | a4b6e5a012896be20d679b0744ca6b1e6cf76f70 | [
"MIT"
] | null | null | null | const meals = document.getElementById("meals");
const nav = document.getElementById("nav");
window.onload = renderMeals();
function renderMeals() {
fetch(`https://www.themealdb.com/api/json/v1/1/categories.php`)
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data.categories);
let render = "";
data.categories.map(
(meal) =>
(render += `
<div class="uk-card uk-card-default uk-card-body uk-grid-margin ">
<div class="uk-card-media-top">
<img
class="dash__image uk-margin-medium-top"
src="${meal.strCategoryThumb}"
alt=""
/>
</div>
<div class="uk-card-body">
<h3 class="uk-card-title dash__title--product cat__title">${meal.strCategory}</h3>
</div>
<button uk-toggle="target: #my-id"
class="uk-button uk-button-default uk-margin-medium-bottom dash__cartBtn"
>
Description
</button>
<p id="my-id" >${meal.strCategoryDescription}</p>
</div>
`)
);
meals.innerHTML = render;
});
}
function responsivenss() {
if (nav.className === "res__nav") {
nav.className += " responsive";
} else {
nav.className = "res__nav";
}
}
| 23.781818 | 90 | 0.555046 |
1d0df05719176ab0e5fd364db06731dc4032396a | 88 | js | JavaScript | lib/osf-components/app/components/registries/page-renderer/component.js | west1636/RDM-ember-osf-web | 288630deaa954512dd66c0a289d3a094045173a8 | [
"Apache-2.0"
] | 110 | 2017-09-23T06:15:50.000Z | 2022-03-28T11:07:35.000Z | lib/osf-components/app/components/registries/page-renderer/component.js | west1636/RDM-ember-osf-web | 288630deaa954512dd66c0a289d3a094045173a8 | [
"Apache-2.0"
] | 936 | 2017-09-20T13:57:01.000Z | 2022-03-31T16:03:01.000Z | lib/osf-components/app/components/registries/page-renderer/component.js | west1636/RDM-ember-osf-web | 288630deaa954512dd66c0a289d3a094045173a8 | [
"Apache-2.0"
] | 50 | 2017-09-18T13:59:50.000Z | 2022-02-01T11:42:15.000Z | export { default } from 'osf-components/components/registries/page-renderer/component';
| 44 | 87 | 0.806818 |
1d0fd52969116c8740a714f551cea76cc2665b0b | 14,919 | js | JavaScript | experiments/non_english_collection_pilot/experiment/js/norming.js | thegricean/woq | f1c86ed0f1cc5fd7a4b774d8559f764fbc436d19 | [
"MIT"
] | null | null | null | experiments/non_english_collection_pilot/experiment/js/norming.js | thegricean/woq | f1c86ed0f1cc5fd7a4b774d8559f764fbc436d19 | [
"MIT"
] | null | null | null | experiments/non_english_collection_pilot/experiment/js/norming.js | thegricean/woq | f1c86ed0f1cc5fd7a4b774d8559f764fbc436d19 | [
"MIT"
] | null | null | null | // Returns a random integer between min (included) and max (excluded)
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function fillArray(value, len) {
var arr = [];
for (var i = 0; i < len; i++) {
arr.push(value);
}
return arr;
}
function uniform(a, b) {
return ( (Math.random() * (b - a)) + a );
}
//convert to rectangular coordinates
function rect(point, center) {
var x = center.x + point.radius * Math.cos(point.theta);
var y = center.y + point.radius * Math.sin(point.theta);
return {x: x, y: y};
}
function get100Points(n_total, n_target, tcolor, ocolor, w, h, radius) {
var points = [];
var targetcolor = tcolor;
var othercolor = ocolor;
var pointcolors = _.shuffle(fillArray(targetcolor, n_target).concat(fillArray(othercolor, n_total - n_target)));
var pcnt = 0;
var y = 24.5;
for (var i = 0; i < 4; i++) {
for (var x = 23; x < 600; x += 46) {
points.push({x: x + uniform(-13, 13), y: y + uniform(-13, 13), color: pointcolors[pcnt]});
pcnt++;
}
y = y + 49;
for (var x = 24.5; x < 600; x += 49) {
points.push({x: x + uniform(-13, 13), y: y + uniform(-13, 13), color: pointcolors[pcnt]});
pcnt++;
}
y = y + 49;
}
return points;
}
function get5Points(n_total, n_target, tcolor, ocolor, w, h, radius) {
var points = [];
var targetcolor = tcolor;
var othercolor = ocolor;
var pointcolors = _.shuffle(fillArray(targetcolor, n_target).concat(fillArray(othercolor, n_total - n_target)));
var pcnt = 0;
points.push({x: 100 + uniform(-70, 70), y: 100 + uniform(-60, 60), color: pointcolors[pcnt]});
pcnt++;
points.push({x: 300 + uniform(-70, 70), y: 100 + uniform(-60, 60), color: pointcolors[pcnt]});
pcnt++;
points.push({x: 500 + uniform(-70, 70), y: 100 + uniform(-60, 60), color: pointcolors[pcnt]});
pcnt++;
points.push({x: 150 + uniform(-90, 90), y: 300 + uniform(-60, 60), color: pointcolors[pcnt]});
pcnt++;
points.push({x: 350 + uniform(-90, 90), y: 300 + uniform(-60, 60), color: pointcolors[pcnt]});
return points;
}
function get10Points(n_total, n_target, tcolor, ocolor, w, h, radius) {
var points = [];
var targetcolor = tcolor;
var othercolor = ocolor;
var pointcolors = _.shuffle(fillArray(targetcolor, n_target).concat(fillArray(othercolor, n_total - n_target)));
var pcnt = 0;
var cnt = 0
for (var y = 67; y < 400; y += 133) {
if (cnt % 2 == 0) {
for (var x = 100; x < 600; x += 200) {
points.push({x: x + uniform(-80, 80), y: y + uniform(-40, 40), color: pointcolors[pcnt]});
pcnt++;
}
} else {
for (var x = 75; x < 600; x += 150) {
points.push({x: x + uniform(-60, 60), y: y + uniform(-40, 40), color: pointcolors[pcnt]});
pcnt++;
}
}
cnt++;
}
return points;
}
function get25Points(n_total, n_target, tcolor, ocolor, w, h, radius) {
var points = [];
var targetcolor = tcolor;
var othercolor = ocolor;
var pointcolors = _.shuffle(fillArray(targetcolor, n_target).concat(fillArray(othercolor, n_total - n_target)));
var pcnt = 0;
for (var y = 40; y < 400; y += 80) {
for (var x = 60; x < 600; x += 120) {
points.push({x: x + uniform(-30, 30), y: y + uniform(-25, 25), color: pointcolors[pcnt]});
pcnt++;
}
}
return points;
}
function draw(id, n_total, n_target, tcolor, ocolor) {
var canvas = document.getElementById(id);
canvas.style.background = "lightgrey"; // Useful in the case of black/white colors.
if (canvas.getContext) {
var ctx = canvas.getContext("2d");
canvas.width = 600;
canvas.height = 400;
var radius = 0;
if (n_total < 25) {
radius = 150 / n_total;
} else {
if (n_total == 25) {
radius = 10;
} else {
radius = 6;
}
}
//paint the rectangle
// var x = canvas.width / 2;
// var y = canvas.height / 4
var counterClockwise = true;
ctx.rect(0, 0, canvas.width, canvas.height);
ctx.strokeStyle = 'black';
ctx.stroke();
//paint the marbles
if (n_total == 5) {
points = get5Points(n_total, n_target, tcolor, ocolor, canvas.width, canvas.height, radius);
} else {
if (n_total == 10) {
points = get10Points(n_total, n_target, tcolor, ocolor, canvas.width, canvas.height, radius);
} else {
if (n_total == 25) {
points = get25Points(n_total, n_target, tcolor, ocolor, canvas.width, canvas.height, radius);
} else {
points = get100Points(n_total, n_target, tcolor, ocolor, canvas.width, canvas.height, radius);
}
}
}
for (var i = 0; i < points.length; i++) {
ctx.beginPath();
ctx.arc(points[i].x, points[i].y, radius, 0, 2 * Math.PI, true);
ctx.fillStyle = points[i].color;
ctx.closePath();
ctx.fill();
}
}
}
function make_slides(f) {
var slides = {};
slides.i0 = slide({
name: "i0",
start: function () {
exp.startT = Date.now();
}
});
// Actually we don't seem to have used this slide in this version of the trial. The instructions are just simply at each page.
slides.instructions = slide({
name: "instructions",
button: function () {
exp.go(); //use exp.go() if and only if there is no "present" data.
}
});
slides.example1 = slide({
name: "example1",
start: function () {
this.trial_start = Date.now();
draw("situation1", 100, 100, "#FFFFFF", "#000000");
},
// This is the "Continue" button.
button: function () {
exp.go(); //use exp.go() if and only if there is no "present" data.
},
});
slides.example2 = slide({
name: "example2",
present: exp.all_stims,
start: function () {
this.trial_start = Date.now();
draw("situation2", 100, 75, "#FFFFFF", "#000000");
},
// This is the "Continue" button.
button: function () {
exp.go(); //use exp.go() if and only if there is no "present" data.
},
});
slides.example3 = slide({
name: "example3",
start: function () {
this.trial_start = Date.now();
draw("situation3", 100, 25, "#000000", "#FFFFFF");
},
// This is the "Continue" button.
button: function () {
exp.go(); //use exp.go() if and only if there is no "present" data.
},
});
slides.example4 = slide({
name: "example4",
start: function () {
this.trial_start = Date.now();
draw("situation4", 10, 0, "#000000", "#FFFFFF");
},
// This is the "Continue" button.
button: function () {
exp.go(); //use exp.go() if and only if there is no "present" data.
},
});
slides.question = slide({
name: "question",
present: exp.all_stims,
start: function () {
$(".err-no-input").hide();
$(".err-no-quantifier").hide();
},
present_handle: function (stim) {
this.trial_start = Date.now();
this.stim = stim;
console.log(this.stim);
var englishSentence = "@" + this.stim.quantifier + "@" + " of the dots are <span style='color:'" + this.stim.color_target.color + "; background:lightgrey'>" + this.stim.color_target.colorword + "</span>.";
// var questionDesc = "How would you translate this description of the picture into your native language? Put @ (at signs) around the words that correspond to the underlined part in the English sentence.";
$(".englishSentence").html(englishSentence);
draw("situation", this.stim.n_total, this.stim.n_target, this.stim.color_target.color, this.stim.color_other.color);
$(".err-no-input").hide();
$(".err-no-quantifier").hide();
$(".response-input").val('');
$(".response-input-1")[0].focus();
},
validButNoAtSign: function(responseInput) {
return responseInput.length > 0 && (responseInput.split("@").length - 1 <= 1 && (responseInput.indexOf("No") == -1 || responseInput.indexOf("no") == -1));
},
// This is the "Continue" button.
button: function () {
var responseInput1 = $(".response-input-1").val();
var responseInput2 = $(".response-input-2").val();
var responseInput3 = $(".response-input-3").val();
if (responseInput1.length <= 0 && responseInput2.length <= 0 && responseInput3.length <= 0) {
$(".err-no-input").show();
} else if (this.validButNoAtSign(responseInput1) || this.validButNoAtSign(responseInput2) || this.validButNoAtSign(responseInput3)) {
$(".err-no-quantifier").show();
} else {
this.stim.response = [];
if (responseInput1.length > 0) {
this.stim.response.push(responseInput1);
}
if (responseInput2.length > 0) {
this.stim.response.push(responseInput2);
}
if (responseInput3.length > 0) {
this.stim.response.push(responseInput3);
}
this.log_responses();
// Go to the next trial.
_stream.apply(this); //use exp.go() if and only if there is no "present" data.
// exp.go();
}
},
log_responses: function () {
exp.data_trials.push({
"slide_number_in_experiment": exp.phase,
"rt": Date.now() - _s.trial_start,
"response": this.stim.response,
"color_target": this.stim.color_target.colorword,
"color_other": this.stim.color_other.colorword,
"n_total": this.stim.n_total,
"n_target": this.stim.n_target,
"target_quantifier": this.stim.quantifier
});
}
});
slides.language_info = slide({
name: "language_info",
start: function (e) {
$(".language-info-error").hide();
},
button: function () {
// Let me just rewrite this... BitBallon is getting me crazy results by inserting <pre> elements on its own!
exp.language_data = {
country_of_birth: $(".country-of-birth-response").val(),
country_of_residence: $(".country-of-residence-response").val(),
native_language: $(".native-language-response").val(),
father_country_of_birth: $(".father-cob-response").val(),
mother_country_of_birth: $(".mother-cob-response").val(),
childhood_language: $(".childhood-language-response").val(),
preferred_language: $(".preferred-language-response").val()
};
for (var response in exp.language_data) {
if (!exp.language_data.hasOwnProperty(response)) {
continue;
}
if (exp.language_data[response].length <= 0) {
$(".language-info-error").show();
return;
}
}
exp.go();
}
});
slides.subj_info = slide({
name: "subj_info",
submit: function (e) {
exp.subj_data = {
languages: $("#languages").val(),
count: $("#count").val(),
enjoyment: $("#enjoyment").val(),
asses: $('input[name="assess"]:checked').val(),
age: $("#age").val(),
gender: $("#gender").val(),
education: $("#education").val(),
colorblind: $("#colorblind").val(),
comments: $("#comments").val(),
};
exp.go(); //use exp.go() if and only if there is no "present" data.
}
});
slides.thanks = slide({
name: "thanks",
start: function () {
exp.data = {
"trials": exp.data_trials,
"catch_trials": exp.catch_trials,
"system": exp.system,
"condition": exp.condition,
// "language_information": exp.language_data,
"subject_information": exp.subj_data,
"time_in_minutes": (Date.now() - exp.startT) / 60000,
"country_of_birth" : exp.language_data.country_of_birth,
"country_of_residence" : exp.language_data.country_of_residence,
"native_language" : exp.language_data.native_language,
"father_country_of_birth" : exp.language_data.father_country_of_birth,
"mother_country_of_birth" : exp.language_data.mother_country_of_birth,
"childhood_language" : exp.language_data.childhood_language,
"preferred_language" : exp.language_data.preferred_language
};
setTimeout(function () {
turk.submit(exp.data);
}, 1000);
}
});
return slides;
}
/// init ///
function init() {
// This function is called when the sequence of experiments is generated, further down in the init() function.
// Let me change it so that the actual quantifier we want in each scenario is also included.
function makeStim(i, n, quantifier) {
// Make it only black and white
var colors = ([{color: "#000000", colorword: "black"}, {color: "#FFFFFF", colorword: "white"}]);
var shuffled = _.shuffle(colors);
color_target = shuffled[0];
color_other = shuffled[1];
return {
"n_target": i,
"n_total": n,
"color_target": color_target,
"color_other": color_other,
"quantifier": quantifier
}
}
exp.all_stims = [];
// Let me manually make them here.
exp.all_stims.push(makeStim(100, 100, "all"));
exp.all_stims.push(makeStim(90, 100, "almost all"));
exp.all_stims.push(makeStim(75, 100, "most"));
exp.all_stims.push(makeStim(65, 100, "many"));
exp.all_stims.push(makeStim(5, 10, "half"));
exp.all_stims.push(makeStim(8, 25, "less than half"));
exp.all_stims.push(makeStim(25, 100, "some"));
exp.all_stims.push(makeStim(3, 10, "a few"));
exp.all_stims.push(makeStim(2, 10, "two"));
exp.all_stims.push(makeStim(0, 10, "none"));
exp.all_stims = _.shuffle(exp.all_stims);
console.log("Showing exp.all_stims");
console.log(exp.all_stims);
exp.trials = [];
exp.catch_trials = [];
exp.condition = {}; //can randomize between subject conditions here
exp.system = {
Browser: BrowserDetect.browser,
OS: BrowserDetect.OS,
screenH: screen.height,
screenUH: exp.height,
screenW: screen.width,
screenUW: exp.width
};
//blocks of the experiment:
exp.structure = ["i0", "example1", "example2", "example3", "example4", "question", "language_info", 'subj_info', 'thanks'];
// exp.structure = ["i0", "examples", "question", "thanks"];
exp.data_trials = [];
//make corresponding slides:
exp.slides = make_slides(exp);
// exp.nQs = utils.get_exp_length(); //this does not work if there are stacks of stims (but does work for an experiment with this structure)
// The above code doesn't produce the correct result. Not sure why but I'll just manually specify it here.
exp.nQs = 16;
//relies on structure and slides being defined
$(".nQs").html(exp.nQs);
$('.slide').hide(); //hide everything
//make sure turkers have accepted HIT (or you're not in mturk)
$("#start_button").click(function () {
if (turk.previewMode) {
$("#mustaccept").show();
} else {
$("#start_button").click(function () {
$("#mustaccept").show();
});
exp.go();
}
});
exp.go(); //show first slide
}
| 32.153017 | 219 | 0.59937 |
1d105f85f75a3704aa6083718078a0b6cf401c1e | 538 | js | JavaScript | mongoose/index.js | lianruhe/koa-server | 0be85b234e24aa087442b01a227fec60a8755b48 | [
"MIT"
] | 1 | 2017-12-18T04:01:04.000Z | 2017-12-18T04:01:04.000Z | mongoose/index.js | lianruhe/koa-server | 0be85b234e24aa087442b01a227fec60a8755b48 | [
"MIT"
] | null | null | null | mongoose/index.js | lianruhe/koa-server | 0be85b234e24aa087442b01a227fec60a8755b48 | [
"MIT"
] | null | null | null | import mongoose, { Schema } from 'mongoose'
mongoose.Promise = global.Promise
const db = mongoose.createConnection('mongodb://admin:1234567@localhost/koa-server', {
useMongoClient: true
})
db.on('error', console.error.bind(console, 'Mongodb connection error:'))
db.once('open', console.log.bind(console, 'Mongodb connection success!!!'))
/**
* 登陆用户的模型
* Account Model
*/
const userSchema = new Schema({ username: String, password: String })
export const AccountModel = db.model('Account', userSchema, 'account')
export default db
| 29.888889 | 86 | 0.734201 |
1d127afe0ac78f3b333e59f25a95ad0f5d3c1239 | 1,371 | js | JavaScript | resources/js/app.js | hallstar/LendMe | e62ed949019b5a382f2a322ffb49d15317109324 | [
"MIT"
] | null | null | null | resources/js/app.js | hallstar/LendMe | e62ed949019b5a382f2a322ffb49d15317109324 | [
"MIT"
] | null | null | null | resources/js/app.js | hallstar/LendMe | e62ed949019b5a382f2a322ffb49d15317109324 | [
"MIT"
] | null | null | null | import Vue from 'vue'
import VueMeta from 'vue-meta'
import { App, plugin } from '@inertiajs/inertia-vue'
import { InertiaProgress } from '@inertiajs/progress/src'
Vue.mixin({ methods: { route: window.route } })
// Vuesax Component Framework
import Vuesax from 'vuesax'
import Layout from './Pages/Layout'
Vue.use(plugin)
Vue.use(Vuesax)
// Filters
import './filters/filters.js'
// Theme Configurations
import './themeConfig.js'
// Globally Registered Components
import './globalComponents.js'
// Vuejs - Vue wrapper for hammerjs
import { VueHammer } from 'vue2-hammer'
Vue.use(VueHammer)
// PrismJS
import 'prismjs'
import 'prismjs/themes/prism-tomorrow.css'
// Vuex Store
import store from './store/store'
Vue.config.productionTip = false
Vue.use(VueMeta)
InertiaProgress.init()
let app = document.getElementById('app')
new Vue({
store,
metaInfo: {
titleTemplate: (title) => title ? `${title} - LendMe` : `LendMe`
},
render: h => h(App, {
props: {
initialPage: JSON.parse(app.dataset.page),
resolveComponent: name => import(`./Pages/${name}`).then(module => module.default),
// resolveComponent: name => import(`./Pages/${name}`)
// .then(({ default: page }) => {
// page.layout = page.layout === undefined ? Layout : page.layout
// return page
// }),
},
}),
}).$mount(app)
| 21.092308 | 89 | 0.655726 |
1d12f10a6cee31d10195fdb0c3ba3f179b882c84 | 1,595 | js | JavaScript | .eslintrc.js | pribeiro89/shortly-landing-page | 0320f0316d8403e63b8dba7ff9b74cdf541535bd | [
"MIT"
] | null | null | null | .eslintrc.js | pribeiro89/shortly-landing-page | 0320f0316d8403e63b8dba7ff9b74cdf541535bd | [
"MIT"
] | null | null | null | .eslintrc.js | pribeiro89/shortly-landing-page | 0320f0316d8403e63b8dba7ff9b74cdf541535bd | [
"MIT"
] | null | null | null | module.exports = {
extends: [
'react-app',
],
parserOptions: {
project: './tsconfig.json'
},
rules: {
semi: ["error", "always"],
indent: ["error", 2, { "SwitchCase": 1 }]
// 'react/jsx-props-no-spreading': 'off',
// 'react/jsx-fragments': 'off',
// 'import/prefer-default-export': 'off',
// 'no-console': ['error', { allow: ['error', 'debug'] }],
// '@typescript-eslint/interface-name-prefix': 'off',
// '@typescript-eslint/no-unused-vars': 'error',
// '@typescript-eslint/explicit-function-return-type': 'error',
// 'no-unused-vars': 'off',
// curly: ['error', 'all'],
// 'brace-style': ['error', '1tbs'],
// 'padding-line-between-statements': [
// 'error',
// { blankLine: 'always', prev: '*', next: ['return'] },
// { blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
// ],
// indent: ['error', 2, { "SwitchCase": 1 }],
// 'no-plusplus': [
// 'error',
// {
// allowForLoopAfterthoughts: true,
// },
// ],
// 'no-underscore-dangle': 'off',
// 'import/extensions': [
// 'error',
// 'ignorePackages',
// {
// js: 'always',
// ts: 'never',
// tsx: 'never',
// },
// ],
// 'max-len': [
// 'warn',
// {
// code: 140,
// ignoreComments: true,
// },
// ],
// 'no-restricted-syntax': 'off',
// 'no-shadow': 'off',
// '@typescript-eslint/no-shadow': 'error',
},
globals: {
window: true,
localStorage: true
}
};
| 26.583333 | 92 | 0.470846 |
1d12fc329fa65d3be07ca9ac0056294907358fb0 | 8,070 | js | JavaScript | ForumArchive/acc/post_17886_page_4.js | doc22940/Extensions | d8dbc9be08e0b8c0bd6b72e068ef73223d2799a8 | [
"Apache-2.0"
] | 136 | 2015-01-01T17:33:35.000Z | 2022-02-26T16:38:08.000Z | ForumArchive/acc/post_17886_page_4.js | doc22940/Extensions | d8dbc9be08e0b8c0bd6b72e068ef73223d2799a8 | [
"Apache-2.0"
] | 60 | 2015-06-20T00:39:16.000Z | 2021-09-02T22:55:27.000Z | ForumArchive/acc/post_17886_page_4.js | doc22940/Extensions | d8dbc9be08e0b8c0bd6b72e068ef73223d2799a8 | [
"Apache-2.0"
] | 141 | 2015-04-29T09:50:11.000Z | 2022-03-18T09:20:44.000Z | [{"Owner":"jerome","Date":"2015-11-10T16:07:06Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_to be continued here _dd_ _lt_a href_eq__qt_http_dd_//www.html5gamedevs.com/topic/18512-sps-finished/?p_eq_104986_qt__gt_http_dd_//www.html5gamedevs.com/topic/18512-sps-finished/?p_eq_104986_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_at last ..._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2015-11-10T23:01:58Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Its one mesh_co_ and not all one mesh. sigh. How the hell did you do this_co_ Jerome? _lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I thought... hmm. Remember that playground... with the depth render issue? All the particles were either behind something_co_ or in-front-of something_co_ but they could not be BOTH. Remember? _lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I thought... that was caused... by all the particles being a single mesh... and the depth renderer treated it so_co_ and thus there was problems._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_But you... how the hell? The depth render/alpha-thingy is gone_co_ with SPS? _lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_How the hell... ??? You_t_re a maniac_co_ J-man. Too good._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_That_t_s the 4th BJS trophy for you_co_ ya know?_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_1. Spherical Harmonics - skyrocket to fame and fortune_lt_/p_gt__lt_p_gt_2. Parametric Shapes_lt_/p_gt__lt_p_gt_3. Options Parameters/Meshbuilder_lt_/p_gt__lt_p_gt_4. Solid Particle Sprayer _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_wink.png_qt_ alt_eq__qt__sm_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/wink@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Good lookin_t_ trophy case_co_ Jerome! Well done!_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2015-11-11T07:42:09Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_You know_co_ I did no magic_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Remember there was a discussion between DK_co_ Jahow and Fenomas about the issues of the legacy Particle System when dealing with z-sort or alpha. These were design choices for performance reasons and because the particles were 2D quads drawn on top of the screen layer._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_The ol_t_good BJS classical abstract mesh then remained the best object in terms of z-sort_co_ blending_co_ alpha_co_ etc._lt_/p_gt__lt_p_gt_So I didn_t_t re-invent anything._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I just got this ol_t_good BJS mesh and made it a particle system in order to keep as much as possible all its features and capabilities. I just got the benefit that if I were using a real mesh_co_ then I could make solid particles rotating in the space instead of only 2D quad ever facing the camera._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_The real challenge was to optimize all the very numerous 3D computations CPU side _dd_ each solid particle is applied_co_ in brief_co_ quite the same process than what the World Matrix does GPU side for a whole standard mesh (+ here _dd_ dynamic updates for colors_co_ uvs and user custom logic)._lt_/p_gt__lt_p_gt_The SPS mesh is modified_co_ updated_co_ rebuild each frame_co_ particle per particle_co_ then passed to the GPU for its usual process _dd_ world transformation_co_ view transformation_co_ etc. These GPU processes apply only on the whole mesh _dd_ SPS rotation (not particle rotation)_co_ translation_co_ camera moves_co_ etc._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_So the SPS is a real BJS standard mesh. It should have the same weaknesses and powers than its brothers _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt_ _dd_ as you can display a sphere in the middle of a torus_co_ you can display a sphere within a SPS._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"MasterSplinter","Date":"2016-01-01T08:10:29Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_I dunno if I am doing something wrong in my set up... But_co_ the Mesh that is created with SPS has no id or name -- you have to look it up by it_t_s array value. _lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-01T08:32:00Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt__lt_a href_eq__qt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.solidParticleSystem.ts#L107_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.solidParticleSystem.ts#L107_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_ooops_lt_/p_gt__lt_p_gt_seems to be a bug here_lt_/p_gt__lt_p_gt_this should be _lt_em_gt_this.name_lt_/em_gt_ instead of _lt_em_gt_name_lt_/em_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I_t_ll fix it next week_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I don_t_t get how this could passed the TS compilation_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-04T12:33:46Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_PRed_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Jon DevoS","Date":"2018-06-11T11:05:49Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\thi guys i am super new in babylon_lt_br /_gt_\n\tand i have some question_co_ when mesh moves behind camera she disabled?_lt_br /_gt_\n\tany suggestion how to solve it?_lt_br /_gt_\n\there is PG _lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#WCDZS%2381_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#WCDZS#81_lt_/a_gt__lt_br /_gt_\n\tsorry for my bad english and maybe wrong theme\n_lt_/p_gt_\n\n_lt_p_gt_\n\tsolved\n_lt_/p_gt_\n\n_lt_div style_eq__qt_color_dd_#000000_sm_background-color_dd_#fffffe_sm_font-family_dd_Consolas_co_ _t_Courier New_t__co_ monospace_sm_font-weight_dd_normal_sm_font-size_dd_14px_sm_line-height_dd_19px_sm_white-space_dd_pre_sm__qt__gt_\n\t_lt_div_gt_\n\t\t_lt_span style_eq__qt_color_dd_#000000_sm__qt__gt_SPS.mesh.alwaysSelectAsActiveMesh _eq_ _lt_/span_gt__lt_span style_eq__qt_color_dd_#0000ff_sm__qt__gt_true_lt_/span_gt__lt_span style_eq__qt_color_dd_#000000_sm__qt__gt__sm__lt_br /_gt_\n\t\t_lt_span_gt__dd__lt_/span_gt_)_lt_/span_gt_\n\t_lt_/div_gt_\n_lt_/div_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2018-06-11T16:32:34Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\twell done _lt_span_gt__lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt_true_qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt__gt__lt_/span_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2018-06-11T18:15:24Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\teverything is explained here _dd_ _lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/solid_particles#sps-visibility_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//doc.babylonjs.com/how_to/solid_particles#sps-visibility_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}] | 8,070 | 8,070 | 0.835688 |
1d131c7805b4284549d038c1dcc4799c61d35a24 | 18,182 | js | JavaScript | src/css/iconfont/iconfont.js | bao76296/TFboy | b8cdb14b951cf5f9fabe5e0a692d8ad8b29d81e8 | [
"MIT"
] | 1 | 2018-10-16T00:12:24.000Z | 2018-10-16T00:12:24.000Z | src/css/iconfont/iconfont.js | bao76296/TFboy | b8cdb14b951cf5f9fabe5e0a692d8ad8b29d81e8 | [
"MIT"
] | null | null | null | src/css/iconfont/iconfont.js | bao76296/TFboy | b8cdb14b951cf5f9fabe5e0a692d8ad8b29d81e8 | [
"MIT"
] | null | null | null | (function(window){var svgSprite='<svg><symbol id="icon-asmkticon0126" viewBox="0 0 1024 1024"><path d="M736 128l-64 0c-10.88 0-19.2 8.32-19.2 19.2s8.32 19.2 19.2 19.2l64 0c32 0 57.6 25.6 57.6 57.6l0 576c0 32-25.6 57.6-57.6 57.6L288 857.6c-32 0-57.6-25.6-57.6-57.6L230.4 224c0-32 25.6-57.6 57.6-57.6l64 0c10.88 0 19.2-8.32 19.2-19.2s-8.32-19.2-19.2-19.2L288 128c-53.12 0-96 42.88-96 96l0 576c0 53.12 42.88 96 96 96l448 0c53.12 0 96-42.88 96-96L832 224C832 170.88 789.12 128 736 128z" ></path><path d="M672 524.8 352 524.8c-10.88 0-19.2 8.32-19.2 19.2s8.32 19.2 19.2 19.2l320 0c10.88 0 19.2-8.32 19.2-19.2S682.88 524.8 672 524.8z" ></path><path d="M672 396.8 352 396.8c-10.88 0-19.2 8.32-19.2 19.2s8.32 19.2 19.2 19.2l320 0c10.88 0 19.2-8.32 19.2-19.2S682.24 396.8 672 396.8z" ></path><path d="M448 166.4l128 0c10.88 0 19.2-8.32 19.2-19.2s-8.32-19.2-19.2-19.2L448 128c-10.88 0-19.2 8.32-19.2 19.2S437.12 166.4 448 166.4z" ></path><path d="M672 652.16 352 652.16c-10.88 0-19.2 8.32-19.2 19.2s8.32 19.2 19.2 19.2l320 0c10.88 0 19.2-8.32 19.2-19.2S682.88 652.16 672 652.16z" ></path></symbol><symbol id="icon-jiazai" viewBox="0 0 1024 1024"><path d="M748.434897 853.076142c9.549493 16.139585 4.169973 37.658691-12.507872 46.736441-16.408715 9.549493-37.186947 3.900843-46.467311-12.507872-10.020214-16.139585-4.168949-37.187971 11.970636-46.736441C718.376301 831.087339 738.886427 836.93758 748.434897 853.076142L748.434897 853.076142 748.434897 853.076142zM546.56012 926.039921 546.56012 926.039921c0 18.627243-15.399735 34.228569-34.765805 34.228569-18.628266 0-34.228569-15.198144-34.228569-34.228569l0-24.006763c0-19.097964 15.667841-34.296107 34.228569-34.296107 19.09694 0 34.765805 15.19712 34.765805 34.296107L546.56012 926.039921 546.56012 926.039921 546.56012 926.039921zM335.13585 887.37225 335.13585 887.37225c-9.751085 16.878412-30.798447 22.258956-47.00557 12.709463-16.609283-9.347902-22.528086-30.327726-12.70844-47.00557l25.485441-44.584428c9.818623-16.408715 30.867008-22.057365 47.477314-12.709463 16.139585 9.54847 22.056342 30.867008 12.238742 47.00557L335.13585 887.37225 335.13585 887.37225 335.13585 887.37225zM171.120332 748.84422 171.120332 748.84422c-16.609283 9.280364-37.925774 3.698229-47.004547-12.709463-9.751085-16.139585-4.169973-37.456077 12.238742-47.004547l68.524676-39.675628c16.408715-9.078773 37.658691-3.967358 47.00557 12.70844 9.279341 16.139585 3.63069 37.4571-12.709463 47.00557L171.120332 748.84422 171.120332 748.84422 171.120332 748.84422zM98.225115 546.43016 98.225115 546.43016c-19.097964 0-34.228569-15.399735-34.228569-34.228569 0-19.09694 15.130605-34.496675 34.228569-34.496675l106.720603 0c19.097964 0 34.228569 15.399735 34.228569 34.228569 0 19.09694-15.130605 34.496675-34.228569 34.496675L98.225115 546.43016 98.225115 546.43016 98.225115 546.43016zM136.421043 334.737784 136.421043 334.737784c-16.676821-9.280364-22.056342-30.329772-12.238742-46.736441 9.078773-16.610306 30.327726-22.25998 47.00557-12.710486l115.932406 67.314105c16.408715 9.347902 21.788236 30.327726 12.709463 46.534849-9.751085 16.610306-30.798447 21.99085-46.938032 12.709463L136.421043 334.737784 136.421043 334.737784 136.421043 334.737784zM275.420817 170.788781 275.420817 170.788781l80.763418 140.210345c9.8176 16.408715 30.867008 22.257933 47.207162 12.507872 16.408715-9.279341 21.788236-30.597879 12.239765-47.00557l-81.032548-139.940193c-9.280364-16.2061-30.329772-22.056342-46.468334-12.507872C271.453459 133.600811 266.073938 154.649196 275.420817 170.788781L275.420817 170.788781 275.420817 170.788781zM477.565746 98.364285 477.565746 98.364285c0-18.628266 15.667841-34.498722 34.228569-34.498722 19.09694 0 34.765805 15.467273 34.765805 34.498722l0 161.526837c0 19.097964-15.399735 34.498722-34.765805 34.765805-18.628266 0-34.228569-15.130605-34.228569-34.765805L477.565746 98.364285 477.565746 98.364285 477.565746 98.364285zM688.990017 136.560212 688.990017 136.560212c9.8176-16.609283 30.597879-22.056342 47.004547-12.709463 16.610306 9.280364 22.528086 30.329772 12.709463 47.00557l-80.966033 140.210345c-9.145287 16.341177-30.664394 22.191418-47.004547 12.709463-16.408715-9.54847-21.788236-30.867008-12.508895-47.2747L688.990017 136.560212 688.990017 136.560212 688.990017 136.560212zM853.476255 275.290857 853.476255 275.290857l-140.479475 80.966033c-16.408715 9.279341-22.057365 30.327726-12.709463 47.004547 9.751085 16.139585 30.79947 21.519106 47.00557 12.508895l140.479475-80.966033c16.139585-9.280364 22.056342-30.327726 12.238742-46.736441C890.663202 271.390014 869.548302 265.473257 853.476255 275.290857L853.476255 275.290857 853.476255 275.290857zM925.630598 477.703893 925.630598 477.703893c19.300578 0 34.498722 15.399735 34.228569 34.496675 0 18.828834-14.927991 34.228569-34.228569 34.228569L763.90217 546.429137c-18.627243 0-34.296107-15.399735-34.296107-34.496675 0-18.828834 15.668865-34.228569 34.296107-34.228569L925.630598 477.703893 925.630598 477.703893 925.630598 477.703893z" ></path></symbol><symbol id="icon-fanhui" viewBox="0 0 1024 1024"><path d="M356.762376 512.186182l420.522666 420.522666a48.174545 48.174545 0 0 1 0.155152 68.189091l-7.028364 7.028364a48.174545 48.174545 0 0 1-68.189091-0.155151L246.728921 552.261818a48.283152 48.283152 0 0 1-13.870545-40.075636 48.314182 48.314182 0 0 1 13.870545-40.091152L702.222739 16.601212a48.174545 48.174545 0 0 1 68.189091-0.155151l7.028364 7.028363a48.174545 48.174545 0 0 1-0.155152 68.189091L356.762376 512.186182z" fill="#515151" ></path></symbol><symbol id="icon-faxianwei" viewBox="0 0 1024 1024"><path d="M709.36884231 289.87379905l-251.86397689 116.29149828a26.22295652 26.22295652 0 0 0-3.94106561 2.16952267 124.85917474 124.85917474 0 0 0-57.02473335 108.4579824l0.07250977 2.04839841a124.43812454 124.43812454 0 0 0 120.06282514 120.14769451h4.02511102a124.75123407 124.75123407 0 0 0 106.65018456-60.61560974 16.03946832 16.03946832 0 0 0 1.02502278-1.92809811L751.90812179 334.10140003a32.53706488 32.53706488 0 0 0-42.53927948-44.22677701zM571.03605288 545.95652017a59.31455548 59.31455548 0 0 1-50.28874996 28.07854487h-1.93963376a59.31455548 59.31455548 0 0 1-57.16975287-57.24143867v-2.04922238a59.50736555 59.50736555 0 0 1 25.48797198-50.61421911l164.33821665-75.92091752zM885.83018091 316.86717016a32.53706488 32.53706488 0 0 0-57.62788193 30.12776725 356.61078342 356.61078342 0 1 1-134.78887957-142.20134528 32.54942451 32.54942451 0 0 0 33.14021428-56.03596545 421.78214218 421.78214218 0 1 0-247.14096102 783.67047556c11.09892316 0.96404865 22.15005578 1.32577349 33.15257309 1.32577349A421.90244248 421.90244248 0 0 0 885.83018091 316.86717016z" fill="#666666" ></path></symbol><symbol id="icon-guanggao" viewBox="0 0 1024 1024"><path d="M847.995 767.802H178.004c-49.626 0-90-34.669-90-77.283V333.283c0-42.614 40.374-77.283 90-77.283h669.991c49.626 0 90 34.669 90 77.283v357.235c0 42.615-40.374 77.284-90 77.284zM178.004 273.174c-38.598 0-70 26.965-70 60.109v357.235c0 33.144 31.402 60.109 70 60.109h669.991c38.598 0 70-26.965 70-60.109V333.283c0-33.144-31.402-60.109-70-60.109H178.004z" ></path><path d="M371.435 423.001c-5.158-20.223-14.178-36.581-27.063-49.071l3.569-5.354c19.824 6.348 33.207 11.599 40.149 15.763 6.938 4.164 10.409 8.429 10.409 12.788 0 4.364-1.292 9.22-3.866 14.573-2.579 5.354-7.24 9.122-13.978 11.301h71.674l13.681-18.142c2.179-2.974 3.964-4.461 5.353-4.461 1.979 0 8.076 4.266 18.29 12.789 10.21 8.527 15.316 13.931 15.316 16.208 0 2.282-2.778 3.42-8.327 3.42H299.463c-1.189 62.654-3.076 103.25-5.65 121.788-2.579 18.541-8.23 34.847-16.952 48.923-8.727 14.075-23.597 31.125-44.61 51.153l-4.461-4.759c17.844-19.628 29.294-42.082 34.35-67.361 5.056-25.279 7.584-59.43 7.584-102.457 0-22.998-0.697-46.692-2.082-71.079 13.876 4.164 25.377 8.824 34.499 13.978h69.294zM684.303 495.271h70.188l10.409-17.25c1.189-1.979 3.071-2.974 5.65-2.974 2.574 0 5.303 1.143 8.179 3.42 2.872 2.282 6.59 5.456 11.152 9.518 4.56 4.065 7.928 7.239 10.112 9.517 2.18 2.281 3.271 4.066 3.271 5.354 0 1.291-2.082 1.933-6.246 1.933H544.226c-5.353 0-9.517 0.697-12.49 2.082l-5.354-13.086c4.163 0.994 9.117 1.487 14.87 1.487h113.905v-48.477h-57.398c-7.537 12.096-18.839 25.874-33.904 41.339l-5.354-3.569c16.655-27.956 29.044-61.757 37.176-101.415 6.738 2.579 13.681 5.502 20.818 8.773s11.301 5.456 12.491 6.543c1.189 1.092 1.784 2.133 1.784 3.123 0 1.984-1.887 3.271-5.65 3.866-3.77 0.595-6.989 3.769-9.666 9.517-2.677 5.753-6.496 13.086-11.45 22.008h51.153v-38.96c0-9.912-0.199-18.737-0.595-26.469 15.465 3.569 26.218 6.594 32.269 9.071 6.046 2.481 9.07 4.415 9.07 5.799 0 1.589-3.866 4.266-11.599 8.03v42.528h35.986l9.814-15.167c2.379-3.764 5.204-5.65 8.476-5.65s8.871 4.266 16.804 12.788c7.928 8.527 11.896 13.634 11.896 15.316 0 1.687-2.281 2.528-6.84 2.528h-76.136v48.477z m33.606 120.151H610.25v17.547c0 1.385-0.251 2.277-0.744 2.677-0.497 0.396-2.035 1.339-4.609 2.825-2.579 1.487-6.297 2.872-11.153 4.164-4.86 1.287-7.732 1.934-8.624 1.934-0.893 0-1.241-0.893-1.041-2.677 0.989-9.717 1.487-18.839 1.487-27.361v-67.213c0-8.328-0.298-16.753-0.893-25.279 14.67 4.563 25.079 9.419 31.228 14.572h98.738l6.245-11.302c1.189-1.979 2.527-2.974 4.015-2.974s6.938 2.63 16.357 7.881c9.415 5.256 14.127 8.974 14.127 11.153 0 2.184-3.271 5.158-9.814 8.922v48.774c0 9.517 0.098 16.356 0.297 20.521l0.595 10.111c0 2.774-3.521 5.154-10.558 7.138-7.04 1.98-12.342 2.975-15.911 2.975-1.39 0-2.082-0.893-2.082-2.677v-21.711z m-107.659-9.814h107.659V545.83H610.25v59.778z" ></path></symbol><symbol id="icon-eliaomo" viewBox="0 0 1024 1024"><path d="M521.3602389 749.88332045c-98.51099253 5.22797407-185.14081836-53.09156477-222.88883327-132.66047538-41.48124755-87.37647235-33.67440998-173.73472451 25.59527457-250.72404741 56.417799-73.39079082 134.96848941-102.516523 227.97993421-91.58622623 46.16607427 5.43147326 86.9013995 24.10125732 122.34067619 53.70206237 19.28100586 16.09019637 18.805933 23.28653634-2.51223744 35.30385195-18.53435933 10.45594811-37.20486761 20.7750231-55.67115246 31.43374623-50.98632574 29.39730585-102.31302382 58.31881462-152.75620223 88.6669904-27.02121735 16.2256211-32.38461613 42.22861825-17.31191575 69.11368668 16.29369558 29.12573218 47.99901545 35.84699929 81.53800071 16.76876844 99.66463745-56.68937265 198.99107515-113.98996711 298.92728626-170.13691665 16.56526923-9.301579 18.33086014-18.73785853 10.99909544-34.48913097-25.86684823-55.39957882-63.95451126-100.88708103-114.94083703-134.96848941-112.76824773-75.15565753-233.07175934-87.24104762-356.22788071-30.0758779-122.88382351 57.02902078-189.68949616 157.10138082-200.75521766 289.08255993-9.16543007 109.37393904 33.13126266 201.97766125 113.31139504 278.22033764 111.88545227 106.25047982 298.79113733 122.95189798 427.31065749 37.54451573 33.47091078-22.26831615 33.47091078-22.26831615 12.69588769-56.2142998-22.40446508-36.72979475-44.67278124-43.51841212-83.64251554-25.18755197-36.79786919 17.37999022-75.0202328 28.65065932-113.98996712 26.20649635z" fill="#27acff" ></path><path d="M859.59690762 594.47945607c-1.83294118-26.27384663-16.36177003-47.59201705-28.85415853-69.65683401-4.07360495-7.19706416-10.59137286-4.41325307-16.49719476-1.15436911-22.87953795 12.89938689-45.75907588 25.93492269-68.84211302 38.49466145-9.77665185 5.36339879-11.54224276 11.81381644-5.90654611 21.25009596 13.17096054 21.79324329 26.20649636 43.65383685 38.76623513 65.78745245 5.49954772 9.57315266 12.01731563 11.81381644 21.52166961 5.90654614 13.78145814-8.55493249 28.03943753-16.56526923 41.3458228-25.79877378 11.94924116-8.21528435 18.94135774-19.75607872 18.46628488-34.8287791z" fill="#27acff" ></path></symbol><symbol id="icon-xingtaiduICON_sousuo---copy" viewBox="0 0 1024 1024"><path d="M222.6944 222.7968A323.1488 323.1488 0 0 0 133.6832 512c19.2512-87.3728 64.512-172.7488 135.0144-243.3024C339.2512 198.1184 424.6272 152.8832 512 133.632c-101.632-19.1488-210.688 10.5216-289.3056 89.1648z" fill="#a7a7a7" ></path><path d="M989.44 822.1184l-121.7024-121.7024a118.016 118.016 0 0 0-92.8-34.1248c114.4576-165.5552 97.92-394.3936-49.4848-541.824-165.9392-165.9904-435.0464-165.9904-601.0368 0-165.9392 165.9904-165.9392 435.1232 0 601.1136 147.4048 147.4304 376.064 163.84 541.7216 49.3824-2.56 33.28 8.8576 67.5328 34.1248 92.8l121.7024 121.728c46.08 45.9776 121.3696 45.9776 167.3472 0 46.208-45.9776 46.208-121.2928 0.128-167.3728zM676.096 676.096c-138.6752 138.6752-363.392 138.6752-502.016 0-138.6752-138.6752-138.6752-363.4432 0-502.1184 138.624-138.6752 363.3408-138.6752 502.016 0 138.6496 138.5728 138.6496 363.4432 0 502.1184z" fill="#a7a7a7" ></path></symbol><symbol id="icon-weizhi" viewBox="0 0 1024 1024"><path d="M512 0C282.24 0 96 171.904 96 384c0 160.576 346.88 640.32 416 640 68.096 0.32 416-481.6 416-640 0-212.096-186.24-384-416-384z m0 928c-57.6 0.256-346.688-410.24-346.688-544 0-176.704 155.2-320 346.688-320s346.688 143.296 346.688 320c0 132.032-289.92 544.256-346.688 544z m0-704C416.256 224 338.688 295.68 338.688 384S416.256 544 512 544c95.744 0 173.312-71.68 173.312-160S607.744 224 512 224z m0 256c-57.408 0-104-43.008-104-96S454.592 288 512 288s104 43.008 104 96S569.408 480 512 480z" fill="#666666" ></path></symbol><symbol id="icon-shaixuanxuanzhong" viewBox="0 0 1024 1024"><path d="M516.352988 544.844268l11.121971-10.486972 17.301954-16.383957a12966.801684 12966.801684 0 0 0 201.443467-195.369483c81.813783-81.495784 140.674628-143.782619 166.663559-177.50353 24.927934-32.449914 27.011929-49.999868 18.99595-60.27384-6.602983-8.509977-22.950939-14.865961-31.319917-14.159963-15.606959 1.306997-155.08059 1.553996-391.657964 1.164997a195025.099869 195025.099869 0 0 1-334.314115-0.881998l-40.747892-0.105999-10.592972-0.036C96.129101 77.375505 88.85512 84.790486 88.291121 94.818459c-0.634998 11.722969 4.695988 26.48293 18.325952 54.165857 12.499967 21.715943 76.834797 89.899762 172.029545 183.540514l15.00696 14.724961A12028.934166 12028.934166 0 0 0 489.27006 534.251296l11.192971 10.486972V887.95036l15.889957 8.015979V544.844268z m-92.194756 25.139934A13457.009386 13457.009386 0 0 1 229.141749 382.841697C126.813019 282.208963 62.867189 214.342143 44.400237 182.282228c-20.373946-41.277891-28.141926-62.710834-26.588929-91.347759 2.471993-45.37288 35.169907-76.799797 93.783752-89.933762l3.883989-0.847997h3.98999l14.688961 0.069999 40.641892 0.142a247597.126738 247597.126738 0 0 0 334.244116 0.846998c225.312404 0.352999 373.332012 0.106 385.583979-0.917998 31.213917-2.647993 70.972812 12.887966 93.006754 41.136891 30.22492 38.839897 24.009936 91.028759-18.78495 146.712612-28.565924 37.074902-88.698765 100.703733-172.771543 184.494512l-16.807955 16.700956A11746.029914 11746.029914 0 0 1 586.972802 575.281188v435.512847l-157.093585-79.41179V575.387187l-5.719985-5.401985z" ></path></symbol><symbol id="icon-fanhui1" viewBox="0 0 1024 1024"><path d="M309.128624 511.685156L777.781125 43.032654A25.214446 25.214446 0 0 0 742.144708 7.396237l-504.288918 504.288919 504.288918 504.288918a25.214446 25.214446 0 1 0 35.636417-35.636417z" ></path></symbol><symbol id="icon-wode" viewBox="0 0 1024 1024"><path d="M820.225293 864.365899H201.399596c-12.792242 0-25.584485-6.396121-33.578667-15.99095-7.995475-11.192889-11.192889-23.985131-7.995474-36.777373C191.806061 648.497131 324.525253 526.969535 484.428283 514.177293c6.396121-1.598061 11.192889-1.598061 19.188363-1.598061v15.99095c-6.396121 0-11.192889 0-17.58901 1.59806-153.508202 11.192889-281.430626 127.922424-311.811878 284.628041-1.599354 7.995475 0 17.58901 6.396121 23.985131 4.796768 6.396121 12.792242 9.593535 20.786424 9.593535h618.825697c7.995475 0 15.989657-3.197414 20.787717-9.593535 4.798061-6.396121 7.995475-14.391596 6.396121-23.985131-19.188364-102.337939-81.550222-190.284283-169.496565-239.855192-9.594828-6.396121-20.787717-11.192889-30.382546-15.99095l6.396121-14.390303c11.192889 4.796768 22.385778 11.192889 31.980607 15.989657 92.743111 52.768323 156.704323 143.913374 177.49204 251.048081 3.198707 12.792242 0 25.584485-9.593535 36.777373-7.992889 9.594828-20.786424 15.990949-33.578667 15.99095zM508.414707 528.568889h-3.198707v-15.99095h4.798061l-1.599354 15.99095z" fill="#666666" ></path><path d="M514.810828 528.568889c-100.738586 0-183.888162-83.149576-183.888161-183.888162s83.149576-183.888162 183.888161-183.888161S698.69899 243.942141 698.69899 344.680727s-83.149576 183.888162-183.888162 183.888162z m0-351.786667c-92.743111 0-167.898505 75.155394-167.898505 167.898505s75.154101 167.898505 167.898505 167.898505 167.898505-75.154101 167.898505-167.898505S607.555232 176.782222 514.810828 176.782222z" fill="#666666" ></path></symbol></svg>';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) | 18,182 | 18,182 | 0.776702 |
1d138e7f47a1bbaeb8c42ce4246c7cea9e64f15e | 2,772 | js | JavaScript | lib/db.js | varjoinen/tmgmt | 077716cbc9ad272a9dafa5abafef5df4a66e2f2f | [
"MIT"
] | null | null | null | lib/db.js | varjoinen/tmgmt | 077716cbc9ad272a9dafa5abafef5df4a66e2f2f | [
"MIT"
] | null | null | null | lib/db.js | varjoinen/tmgmt | 077716cbc9ad272a9dafa5abafef5df4a66e2f2f | [
"MIT"
] | null | null | null | const sqlite = require('sqlite');
const moment = require('moment');
const bluebird = require('bluebird');
const env = require('./env');
const getConnection = () => {
return sqlite.open(env.getEnv().dbFilePath, { bluebird })
.then((conn) => {
return conn.run('CREATE TABLE IF NOT EXISTS time_reports (id INTEGER PRIMARY KEY, description TEXT, date TEXT, time_in_minutes INTEGER);')
.then(() => {
return conn.run('CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY, tag TEXT, time_report_id INTEGER, FOREIGN KEY(time_report_id) REFERENCES time_reports(id))');
})
.then(() => conn);
});
}
const insertTimeReport = (description, date, tags, time) => {
return getConnection()
.then((conn) => {
return conn.prepare('INSERT INTO time_reports (description, date, time_in_minutes) VALUES (?,?,?)')
.then((stmt) => {
return stmt.run(
description,
date,
time)
.then((resp) => {
if ( tags && tags.length ) {
const report_id = resp.stmt.lastID
return conn.prepare('INSERT INTO tags (tag, time_report_id) VALUES (?,?)')
.then((tagStmt) => {
tags.forEach((tag) => {
tagStmt.run(
tag,
resp.stmt.lastID);
});
return null;
});
}
});
});
})
}
const getTimeReports = (startDate, endDate, tag) => {
return getConnection()
.then((conn) => {
return conn.prepare('SELECT * FROM time_reports WHERE date BETWEEN (?) AND (?);')
.then((stmt) => {
return stmt.all(
startDate.format('YYYY-MM-DD'),
endDate.format('YYYY-MM-DD'))
});
});
}
const getTags = (report_id) => {
return getConnection()
.then((conn) => {
return conn.prepare('SELECT tag FROM tags WHERE time_report_id = ?;')
.then((stmt) => {
return stmt.all(report_id)
.then((rows) => {
return rows.map((row) => row.tag);
})
});
});
}
const removeReport = (id) => {
return getConnection()
.then((conn) => {
return _removeTagsByReportId(conn, id)
.then(() => {
return _removeReport(conn, id);
});
});
}
const _removeTagsByReportId = (conn, id) => {
return conn.prepare('DELETE FROM tags WHERE time_report_id = ?;')
.then((stmt) => {
return stmt.run(id)
});
}
const _removeReport = (conn, id) => {
return conn.prepare('DELETE FROM time_reports WHERE id = ?;')
.then((stmt) => {
return stmt.run(id)
})
}
module.exports = {
getConnection,
insertTimeReport,
getTimeReports,
getTags,
removeReport
};
| 27.445545 | 175 | 0.542569 |
1d139f80f76d48b783a3b2d1f2717ef3bb883563 | 1,119 | js | JavaScript | src/views/Address/AddressDetail.js | palsp/halffin-frontend | 46ae834bedd8db5f00791ed92a32cc5368c44189 | [
"MIT"
] | 1 | 2021-12-01T05:33:53.000Z | 2021-12-01T05:33:53.000Z | src/views/Address/AddressDetail.js | palsp/halffin-frontend | 46ae834bedd8db5f00791ed92a32cc5368c44189 | [
"MIT"
] | 1 | 2021-12-13T13:41:00.000Z | 2021-12-13T13:41:00.000Z | src/views/Address/AddressDetail.js | palsp/halffin-frontend | 46ae834bedd8db5f00791ed92a32cc5368c44189 | [
"MIT"
] | null | null | null | import Detail from './Detail/Detail';
import { formatPhoneNumberIntl } from 'react-phone-number-input';
const AddressDetail = ({ address, color = 'white' }) => {
const {
firstName,
lastName,
email,
address1,
address2,
city,
state,
postalCode,
countryCode,
phoneNumber,
} = address;
return (
<>
{firstName.length > 0 ? (
<div style={{ justifyContent: 'left', marginTop: '12px' }}>
<Detail
title={'Name:'}
description={`${firstName} ${lastName}`}
color={color}
/>
<Detail title={'Email:'} description={`${email}`} color={color} />
<Detail
title={'Address: '}
color={color}
description={`${address1} ${address2}
${city} ${state}
${postalCode}`}
/>
<Detail
title={'Phone:'}
color={color}
description={`${formatPhoneNumberIntl(
phoneNumber
)} ${countryCode} `}
/>
</div>
) : null}
</>
);
};
export default AddressDetail;
| 22.836735 | 76 | 0.490617 |
1d1421ec6e1664391e698701234f25ca5b73ea52 | 135 | js | JavaScript | src/components/game/logic/gameplay/command/group.js | fenghou1st/AnotherWorld | 1e7a127d0e288f87ae220cf7b821b6aa0f166deb | [
"MIT"
] | null | null | null | src/components/game/logic/gameplay/command/group.js | fenghou1st/AnotherWorld | 1e7a127d0e288f87ae220cf7b821b6aa0f166deb | [
"MIT"
] | null | null | null | src/components/game/logic/gameplay/command/group.js | fenghou1st/AnotherWorld | 1e7a127d0e288f87ae220cf7b821b6aa0f166deb | [
"MIT"
] | null | null | null | export default {
CHARACTER: 1,
WORLD: 2,
properties: new Map([
[1, {name: 'character'}],
[2, {name: 'world'}],
]),
};
| 13.5 | 29 | 0.511111 |
1d15b7f94e93457941f68c5545ba573b77c3db3b | 579 | js | JavaScript | src/main/resources/META-INF/resources/webjars/service/prov/azure/nls/messages.js | ligoj/plugin-provisioning-azure | 2bf6bfd142ed64c5ba120401ba7ae6b1cd23794d | [
"MIT"
] | 4 | 2017-04-14T07:53:41.000Z | 2020-03-23T12:41:38.000Z | src/main/resources/META-INF/resources/webjars/service/prov/azure/nls/messages.js | ligoj/plugin-provisioning-azure | 2bf6bfd142ed64c5ba120401ba7ae6b1cd23794d | [
"MIT"
] | 3 | 2017-09-17T15:32:09.000Z | 2020-09-17T11:18:08.000Z | src/main/resources/META-INF/resources/webjars/service/prov/azure/nls/messages.js | ligoj/plugin-provisioning-azure | 2bf6bfd142ed64c5ba120401ba7ae6b1cd23794d | [
"MIT"
] | null | null | null | /*
* Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
*/
define({
"root" : {
"service:prov:azure:application" : "Application ID",
"service:prov:azure:key" : "Application Key",
"service:prov:azure:tenant" : "Tenant ID",
"service:prov:azure:name" : "Name",
"service:prov:azure:subscription" : "Subscription",
"service:prov:azure:location" : "Location",
"service:prov:azure:resource-group" : "Resource Group",
"error" : {
"azure-login" : "Authentication failed",
"azure-admin" : "Administrator access failed"
}
},
"fr" : true
});
| 28.95 | 74 | 0.663212 |
1d162c2f353e0951ed2d9c2c0bc7938cb8904741 | 1,114 | js | JavaScript | server/api/login.js | Rellfy/HURP | 2094bac95a0f359fe5a5851769809bcac27a4ec9 | [
"MIT"
] | 1 | 2017-11-28T01:16:17.000Z | 2017-11-28T01:16:17.000Z | server/api/login.js | Rellfy/HURP | 2094bac95a0f359fe5a5851769809bcac27a4ec9 | [
"MIT"
] | null | null | null | server/api/login.js | Rellfy/HURP | 2094bac95a0f359fe5a5851769809bcac27a4ec9 | [
"MIT"
] | null | null | null | const Joi = require('joi');
const Boom = require('boom');
exports.register = function(server, options, next) {
server.route({
method: 'POST',
path: '/login',
config: {
plugins: {
'hapi-auth-cookie': {
redirectTo: false
}
},
auth: {
mode: 'try',
strategy: 'session'
},
validate: {
payload: {
username: Joi.string().min(4).max(24).lowercase().required(),
password: Joi.string().min(4).max(24).required()
}
},
pre: [{
assign: 'accountCheck',
method: (request, reply) => {
/* Checks if username is unique, then continue to handler */
reply(true);
}
}]
},
handler: (request, reply) => {
/* Example authentication */
const user = {
id: parseInt(Math.random() * 100),
username: request.payload.username
};
request.server.app.cache.set(user.id, { account: user }, 0, (error) => {
if (error)
return reply({ error });
request.cookieAuth.set(user);
reply({ error: null });
});
}
});
next();
}
exports.register.attributes = {
name: 'api/login'
} | 18.881356 | 75 | 0.549372 |
1d163d00c15445a6a33597679ec21d57d3b99d01 | 2,653 | js | JavaScript | apollo-server/schema.graphql/index.js | TheStopsign/veneu | f0017dd023b8f852b70b94bb8ea9393fe82aa34b | [
"MIT"
] | null | null | null | apollo-server/schema.graphql/index.js | TheStopsign/veneu | f0017dd023b8f852b70b94bb8ea9393fe82aa34b | [
"MIT"
] | 2 | 2021-04-29T23:06:06.000Z | 2022-02-27T23:15:13.000Z | apollo-server/schema.graphql/index.js | TheStopsign/veneu | f0017dd023b8f852b70b94bb8ea9393fe82aa34b | [
"MIT"
] | 2 | 2021-04-23T04:00:03.000Z | 2021-12-19T01:29:39.000Z | const { gql } = require("apollo-server-express");
const linkSchema = gql`
directive @auth(requires: Role!) on OBJECT | FIELD_DEFINITION
directive @rateLimit(
max: Int
window: String
message: String
identityArgs: [String]
arrayLengthField: String
) on FIELD_DEFINITION
scalar Date
enum Role {
ADMIN
INSTRUCTOR
TEACHING_ASSISTANT
STUDENT
GUEST
UNKNOWN
}
enum PhotoType {
URL
BOTS
}
type Photo {
photoType: PhotoType
value: String
}
enum WeekDay {
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
}
union ParentResource = User | Course | RegistrationSection | UserGroup | Lecture | YTVideoStream
union SearchResult = User | Course | RegistrationSection | UserGroup | Lecture | YTVideoStream
interface Assignable {
_id: ID!
type: String!
assignment: Assignment
}
interface Submittable {
_id: ID!
type: String!
submission: Submission
created_at: Date!
updated_at: Date!
}
interface VideoStream implements SharedResource & Assignable {
_id: ID!
type: String!
assignment: Assignment
url: String!
duration: Int!
checkins: [Checkin!]
creator: User!
auths: [Auth]!
name: String!
parent_resource: ParentResource
parent_resource_type: String
}
interface SharedResource {
_id: ID!
creator: User!
auths: [Auth]!
name: String!
type: String!
parent_resource: ParentResource
parent_resource_type: String
}
interface CalendarizableEvent {
_id: ID!
name: String!
start: Date!
end: Date!
type: String!
}
input CalendarEventInput {
name: String!
start: Date!
end: Date!
}
input WeekDayEventInput {
weekday: WeekDay!
event: CalendarEventInput!
}
type CalendarEvent {
name: String!
start: Date!
end: Date!
}
type WeekDayEvent {
weekday: WeekDay!
event: CalendarEvent!
}
type Query {
_: Boolean
calendarEvents: [CalendarizableEvent]!
assignables: [Assignable]!
}
type Mutation {
_: Boolean
}
type Subscription {
_: Boolean
}
`;
module.exports = [
linkSchema,
require("./Assignment.Schema"),
require("./Auth.Schema"),
require("./Checkin.Schema"),
require("./Course.Schema"),
require("./Lecture.Schema"),
require("./Notification.Schema"),
require("./RegistrationSection.Schema"),
require("./Submission.Schema"),
require("./Ticket.Schema"),
require("./User.Schema"),
require("./UserGroup.Schema"),
require("./VideoStreamPlayback.Schema"),
require("./YTVideoStream.Schema"),
];
| 18.296552 | 98 | 0.647946 |
1d1641775f48529a987f1d7463dc2658d764e391 | 4,771 | js | JavaScript | vision/doxygen/html/search/all_0.js | victoriapc/HockusPockus | 2130b462b0038a527061744ab7faf20c2996c04f | [
"BSD-3-Clause"
] | null | null | null | vision/doxygen/html/search/all_0.js | victoriapc/HockusPockus | 2130b462b0038a527061744ab7faf20c2996c04f | [
"BSD-3-Clause"
] | 52 | 2020-01-15T16:45:32.000Z | 2020-04-19T12:00:01.000Z | vision/doxygen/html/search/all_0.js | victoriapc/HockusPockus | 2130b462b0038a527061744ab7faf20c2996c04f | [
"BSD-3-Clause"
] | 4 | 2020-01-15T15:11:08.000Z | 2021-01-11T17:41:07.000Z | var searchData=
[
['_5f_5fdel_5f_5f_0',['__del__',['../classsrc_1_1_vision_puck_detector_1_1_puck_detector_core_1_1_puck_detector_core.html#a87f03cf779f32d7e36167bbb73b97bb9',1,'src.VisionPuckDetector.PuckDetectorCore.PuckDetectorCore.__del__()'],['../classsrc_1_1_vision_u_s_b_1_1_camera_u_s_b_1_1_camera_u_s_b.html#a8906cc1a3f304995943e8c03f229493f',1,'src.VisionUSB.CameraUSB.CameraUSB.__del__()']]],
['_5f_5finit_5f_5f_1',['__init__',['../classsrc_1_1main_vision_1_1_main_vision.html#a3161b9f3dd102afd0def8412a2709905',1,'src.mainVision.MainVision.__init__()'],['../classsrc_1_1_vision_dialog_1_1dialog_config_1_1dialog__config___radius.html#aa9f810980ec712421fa14b6f1ca1a719',1,'src.VisionDialog.dialogConfig.dialog_config_Radius.__init__()'],['../classsrc_1_1_vision_dialog_1_1dialog_config_1_1dialog__config___h_s_v.html#a5c9d02337c7dad3490734255d116e8e3',1,'src.VisionDialog.dialogConfig.dialog_config_HSV.__init__()'],['../classsrc_1_1_vision_dialog_1_1dialog_config_1_1dialog__config___dimensions_converter.html#a94f2706e049e03ce9d0d960c42ef0b47',1,'src.VisionDialog.dialogConfig.dialog_config_DimensionsConverter.__init__()'],['../classsrc_1_1_vision_dimensions_converter_1_1_dimensions_converter_1_1_dimensions_converter.html#aba103409c354c6593c443687e5d29e4b',1,'src.VisionDimensionsConverter.DimensionsConverter.DimensionsConverter.__init__()'],['../classsrc_1_1_vision_dimensions_converter_1_1_dimensions_converter_configuration_1_1_dimensions_converter_configuration.html#a0b6762ade48525d5b7c4ca243d758144',1,'src.VisionDimensionsConverter.DimensionsConverterConfiguration.DimensionsConverterConfiguration.__init__()'],['../classsrc_1_1_vision_dimensions_converter_1_1_dimensions_converter_core_1_1_dimensions_converter_core.html#a54c8a17ec6d66a2c17c3a34178dd3d41',1,'src.VisionDimensionsConverter.DimensionsConverterCore.DimensionsConverterCore.__init__()'],['../classsrc_1_1_vision_interfaces_1_1_mouse_event_handler_1_1_mouse_event_handler.html#af9cc07cdfa18890096b1a45aed24649e',1,'src.VisionInterfaces.MouseEventHandler.MouseEventHandler.__init__()'],['../classsrc_1_1_vision_puck_detector_1_1_puck_detector_1_1_puck_detector.html#a2e66f9e559dcb2945374010995d03113',1,'src.VisionPuckDetector.PuckDetector.PuckDetector.__init__()'],['../classsrc_1_1_vision_puck_detector_1_1_puck_detector_builder_1_1_puck_detector_builder.html#a8f1f3bec10ab9276c42836783c75f6d2',1,'src.VisionPuckDetector.PuckDetectorBuilder.PuckDetectorBuilder.__init__()'],['../classsrc_1_1_vision_puck_detector_1_1_puck_detector_configuration_1_1_puck_detector_configuration.html#a0ffa57a87c472e9e44ec35ed80a464cc',1,'src.VisionPuckDetector.PuckDetectorConfiguration.PuckDetectorConfiguration.__init__()'],['../classsrc_1_1_vision_puck_detector_1_1_puck_detector_core_1_1_puck_detector_core.html#aa56ffc7fd4d6def8f76bb2a8ada5971a',1,'src.VisionPuckDetector.PuckDetectorCore.PuckDetectorCore.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1_broadcaster_r_o_s_1_1_broadcaster_r_o_s.html#ae9ba65d43970673c2a2908bb6e24da85',1,'src.VisionROS.BroadcasterROS.BroadcasterROS.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1_camera_r_o_s_1_1_camera_r_o_s.html#ae4a44dd61aab948388cdb1e835cbd57e',1,'src.VisionROS.CameraROS.CameraROS.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1dialog_config_r_o_s_1_1_radius_config_subscriber.html#ab5547b6096f652a97f6ff7d38c0c6d0a',1,'src.VisionROS.dialogConfigROS.RadiusConfigSubscriber.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1dialog_config_r_o_s_1_1_h_s_v_config_subscriber.html#ac52e8c4d6a649229179a7bdd8f21c744',1,'src.VisionROS.dialogConfigROS.HSVConfigSubscriber.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1dialog_config_r_o_s_1_1_dimensions_converter_config_subscriber.html#af520c75abf3de6aa565a548085d9a86b',1,'src.VisionROS.dialogConfigROS.DimensionsConverterConfigSubscriber.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1_minimalist_broadcaster_r_o_s_1_1_minimalist_broadcaster_r_o_s.html#ad9b20486bfcf7685b1104007c5e2d2d8',1,'src.VisionROS.MinimalistBroadcasterROS.MinimalistBroadcasterROS.__init__()'],['../classsrc_1_1_vision_r_o_s_1_1_mouse_event_handler_r_o_s_1_1_mouse_event_handler_r_o_s.html#a95ab57241f5fcedee265e88775991afe',1,'src.VisionROS.MouseEventHandlerROS.MouseEventHandlerROS.__init__()'],['../classsrc_1_1_vision_test_1_1_camera_t_e_s_t_1_1_camera_t_e_s_t.html#a0b2ab0699d0890208145c2499e35fbce',1,'src.VisionTest.CameraTEST.CameraTEST.__init__()'],['../classsrc_1_1_vision_u_s_b_1_1_camera_u_s_b_1_1_camera_u_s_b.html#a84962ab74c6fdd9457f588142b6682d7',1,'src.VisionUSB.CameraUSB.CameraUSB.__init__()'],['../classsrc_1_1_vision_u_s_b_1_1_mouse_event_handler_u_s_b_1_1_mouse_event_handler_u_s_b.html#a074a66499047627d2b8be4930a7d9164',1,'src.VisionUSB.MouseEventHandlerUSB.MouseEventHandlerUSB.__init__()']]]
];
| 795.166667 | 4,361 | 0.892685 |
1d16af1d8a2f1bca9e873251e1d9e088630f9cb1 | 952 | js | JavaScript | lib/request/extensions.js | jaredhanson/oauth2orize-response-mode | eca143f5726aa3244271cd797e5f6d1b43aec412 | [
"MIT"
] | 1 | 2018-03-26T18:36:24.000Z | 2018-03-26T18:36:24.000Z | lib/request/extensions.js | jaredhanson/oauth2orize-response-mode | eca143f5726aa3244271cd797e5f6d1b43aec412 | [
"MIT"
] | 1 | 2018-01-04T16:23:54.000Z | 2018-01-04T16:23:54.000Z | lib/request/extensions.js | jaredhanson/oauth2orize-response-mode | eca143f5726aa3244271cd797e5f6d1b43aec412 | [
"MIT"
] | 2 | 2018-01-04T16:17:45.000Z | 2019-09-11T11:08:30.000Z | /**
* Parse request parameters defined by multiple response type encoding
* practices.
*
* This module is a wildcard parser that parses authorization requests for
* extensions parameters defined by multiple response type encoding practices.
* In particular, `response_mode` paratmeter is defined which informs the
* authorization server of the mechanism to be used for returning the
* authorization response.
*
* Examples:
*
* server.grant(mode.extensions());
*
* References:
* - [OAuth 2.0 Multiple Response Type Encoding Practices](http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html)
*
* @return {Object} module
* @api public
*/
module.exports = function() {
function request(req) {
var q = req.query
, ext = {};
if (q.response_mode) {
ext.responseMode = q.response_mode;
}
return ext;
}
var mod = {};
mod.name = '*';
mod.request = request;
return mod;
}
| 24.410256 | 126 | 0.677521 |
1d18653e4f96b211171acf1a5786ca23be042b20 | 2,781 | js | JavaScript | src/index.js | AktivCo/rutoken-connect-js | 0464b2b2590a557ff8885d89e91529628d6de72e | [
"BSD-2-Clause"
] | null | null | null | src/index.js | AktivCo/rutoken-connect-js | 0464b2b2590a557ff8885d89e91529628d6de72e | [
"BSD-2-Clause"
] | 8 | 2020-04-09T11:04:10.000Z | 2021-08-31T17:50:47.000Z | src/index.js | AktivCo/rutoken-connect-js | 0464b2b2590a557ff8885d89e91529628d6de72e | [
"BSD-2-Clause"
] | null | null | null | const Status = Object.freeze({
noExtension: -1,
ready: 0,
noNative: 1,
oldExtension: 2,
oldNative: 3,
error: 4,
});
const lastStatus = Status.error;
const isFirefox = typeof InstallTrigger !== 'undefined';
let status;
let statusPromise;
function getStatus() {
if (status !== undefined && status !== null) return Promise.resolve(status);
if (statusPromise !== undefined) return statusPromise;
let resolve;
let reject;
statusPromise = new Promise((resolveCallback, rejectCallback) => {
resolve = (value) => {
if (statusPromise !== undefined && status !== null) {
resolveCallback(value);
}
status = value;
statusPromise = undefined;
};
reject = (reason) => {
if (statusPromise !== undefined && status !== null) {
rejectCallback(reason);
}
status = null;
statusPromise = Promise.reject(reason);
};
});
const onMessage = (event) => {
if (event.source !== window || event.data === undefined || event.data.rutoken === undefined
|| event.data.rutoken.uuid !== 'EE4F9C58-64D8-4FCD-AB45-0E3040EEB37D') {
return;
}
const { status: newStatus } = event.data.rutoken;
if (newStatus !== undefined && newStatus >= 0 && newStatus <= lastStatus) {
resolve(newStatus);
} else {
reject(new Error(`Couldn't parse extension status: ${newStatus}`));
}
};
window.addEventListener('message', onMessage);
let url = 'chrome-extension://acbchkahfmndkenefkcklofjmipghjjp/check_rtconnect_extension';
const options = {};
if (isFirefox) {
url = 'https://qbwjg564lyt1tdfo23xz5l3udvdfe0ux.rutoken.ru/api/v1/check_rtconnect_extension';
options.mode = 'no-cors';
}
return fetch(url, options).then(() => {
// request in firefox is not canceled - no extension
// request in chrome is successful - extension will send status
if (isFirefox) {
resolve(Status.noExtension);
}
}).catch((reason) => {
// request in firefox is canceled - extension is present
// request in chrome failed - no extension
if (isFirefox) {
setTimeout(() => {
if (status === undefined) {
window.removeEventListener('message', onMessage);
reject(reason);
}
}, 2000);
} else {
resolve(Status.noExtension);
}
}).then(() => {
if (status !== undefined && status !== null) {
return status;
}
return statusPromise;
});
}
export { Status, getStatus };
| 30.228261 | 101 | 0.552319 |
1d189931528262885e9f55d78e1d5e5c549802af | 309 | js | JavaScript | src/custom-array.js | Skydropx/xlsx-mapper | f104e2731e0bb58441e4208ebcc15baa8f3ac723 | [
"MIT"
] | null | null | null | src/custom-array.js | Skydropx/xlsx-mapper | f104e2731e0bb58441e4208ebcc15baa8f3ac723 | [
"MIT"
] | null | null | null | src/custom-array.js | Skydropx/xlsx-mapper | f104e2731e0bb58441e4208ebcc15baa8f3ac723 | [
"MIT"
] | null | null | null | // pending to found a solution with extend Array
export default class CustomArray {
constructor (array) {
this.array = array
}
diff (array) {
return this.array.filter(idx => array.indexOf(idx) < 0)
}
matrixToArray () {
return this.array.reduce((prev, next) => prev.concat(next))
}
}
| 20.6 | 63 | 0.653722 |
1d1962f7d46134c722252060e9cd7956df65e35a | 140 | js | JavaScript | static/programming-tutorials-backup/src/languages/python/lessons/ControlFlow_Python.js | EdwardR5/EdwardR5.github.io | 585178c4f02b6ed61e78ecbfb421a623d78a0304 | [
"MIT"
] | null | null | null | static/programming-tutorials-backup/src/languages/python/lessons/ControlFlow_Python.js | EdwardR5/EdwardR5.github.io | 585178c4f02b6ed61e78ecbfb421a623d78a0304 | [
"MIT"
] | 6 | 2020-09-04T17:40:15.000Z | 2022-02-10T17:01:53.000Z | static/programming-tutorials-backup/src/languages/python/lessons/ControlFlow_Python.js | EdwardRees/EdwardRees.github.io | 1553d3bfa1e778a346927d572d405dbd4a504dc2 | [
"MIT"
] | null | null | null | import React from "react";
const ControlFlow_Python = () => (
<div>
<h3>Control Flow</h3>
</div>
);
export { ControlFlow_Python };
| 15.555556 | 34 | 0.628571 |
1d19d84ad974819a4e3316d19002c44445d12115 | 248 | js | JavaScript | src/components/organisms/Card/SquareCard/index.js | rifanid98/event | 73be3fb651811a2fb75d1e2be75ba6a18d3654e5 | [
"MIT"
] | null | null | null | src/components/organisms/Card/SquareCard/index.js | rifanid98/event | 73be3fb651811a2fb75d1e2be75ba6a18d3654e5 | [
"MIT"
] | null | null | null | src/components/organisms/Card/SquareCard/index.js | rifanid98/event | 73be3fb651811a2fb75d1e2be75ba6a18d3654e5 | [
"MIT"
] | null | null | null | import React from 'react'
import styles from './styles.module.css';
const SquareCard = (props) => {
return (
<div className={styles.container}>
<p>box!</p>
</div>
)
}
export default React.memo(SquareCard); | 19.076923 | 42 | 0.580645 |
1d1a00cb44bc37f192c0b3c25ba9f2019ea4b531 | 829 | js | JavaScript | node_modules/@iconify/icons-mdi/present-open-outline.js | Ehtisham-Ayaan/aoo-ghr-bnain-update | fb857ffe2159f59d11cfb1faf4e7889a778dceca | [
"MIT"
] | null | null | null | node_modules/@iconify/icons-mdi/present-open-outline.js | Ehtisham-Ayaan/aoo-ghr-bnain-update | fb857ffe2159f59d11cfb1faf4e7889a778dceca | [
"MIT"
] | null | null | null | node_modules/@iconify/icons-mdi/present-open-outline.js | Ehtisham-Ayaan/aoo-ghr-bnain-update | fb857ffe2159f59d11cfb1faf4e7889a778dceca | [
"MIT"
] | null | null | null | var data = {
"body": "<path d=\"M22 10.87l-2.74-1.59c.24-.21.47-.48.64-.78c.83-1.43.34-3.27-1.1-4.1c-.86-.5-1.87-.5-2.72-.14l.01-.01l-.88.39l-.11-.96l-.01.01c-.09-.91-.62-1.79-1.48-2.29A3.023 3.023 0 0 0 9.5 2.5c-.17.3-.28.63-.34.95L6.41 1.87c-.96-.55-2.18-.23-2.73.73l-1.5 2.6a.988.988 0 0 0 .37 1.36l1.73 1L8.5 10H2v10a2 2 0 0 0 2 2h16c1.11 0 2-.89 2-2v-5.13l.73-1.27c.55-.96.23-2.18-.73-2.73M16.44 6.5c.27-.5.89-.64 1.36-.37c.48.28.65.87.37 1.37c-.28.5-.89.64-1.37.37c-.47-.28-.64-.87-.36-1.37m-2.37 2.1l6.93 4l-1 1.73l-6.93-4l1-1.73M11 20H4v-8h7v8m.34-10.67l-6.93-4l1-1.73l6.93 4l-1 1.73m.27-4.46c-.48-.28-.64-.87-.37-1.37c.26-.5.89-.64 1.37-.37c.48.28.64.87.36 1.37c-.27.5-.88.64-1.36.37M13 20v-7.4l7 4.04V20h-7z\" fill=\"currentColor\"/>",
"width": 24,
"height": 24
};
exports.__esModule = true;
exports.default = data;
| 103.625 | 733 | 0.620024 |
1d1a6d92c876bbbdc663b5fe03def4bfee343ca4 | 3,564 | js | JavaScript | ui/src/components/sidebar/index.js | knowankit/video-calling-app | 80aec898f41db4d52aa6b34138c1b921f5a42a2c | [
"MIT"
] | 14 | 2021-09-12T12:20:38.000Z | 2022-03-29T04:59:08.000Z | ui/src/components/sidebar/index.js | prakhar011/video-calling-app | 05d7604033bffdd86a69e77a4524ac21f5faeb64 | [
"MIT"
] | 3 | 2021-09-12T10:43:46.000Z | 2022-03-30T18:18:35.000Z | ui/src/components/sidebar/index.js | prakhar011/video-calling-app | 05d7604033bffdd86a69e77a4524ac21f5faeb64 | [
"MIT"
] | 4 | 2021-09-15T05:36:06.000Z | 2022-01-21T08:57:10.000Z | import React, { useState, useContext } from "react";
import {
Button,
TextField,
Grid,
Typography,
Container
} from "@material-ui/core";
import { CopyToClipboard } from "react-copy-to-clipboard";
import {
Assignment,
Phone,
PhoneDisabled,
VideoCall
} from "@material-ui/icons";
import { makeStyles } from "@material-ui/core/styles";
import { SocketContext } from "src/socket-context";
const useStyles = makeStyles(theme => ({
root: {
display: "flex",
flexDirection: "column"
},
gridContainer: {
width: "100%",
[theme.breakpoints.down("xs")]: {
flexDirection: "column"
}
},
container: {
width: "800px",
margin: "35px 0",
padding: 0,
[theme.breakpoints.down("xs")]: {
width: "80%"
}
},
margin: {
marginTop: 20
},
padding: {
padding: 20
},
paper: {
padding: "10px 20px",
border: "2px solid black"
}
}));
const Sidebar = ({ children }) => {
const {
me,
callAccepted,
name,
setName,
callEnded,
leaveCall,
callUser,
setVideoAvailability,
isVideoAvailable
} = useContext(SocketContext);
const [idToCall, setIdToCall] = useState("");
const classes = useStyles();
return (
<Container className={classes.container}>
<form className={classes.root} noValidate autoComplete="off">
<Grid container className={classes.gridContainer}>
<Grid item xs={12} md={6} className={classes.padding}>
<Typography gutterBottom variant="h6">
Account Info
</Typography>
<TextField
label="Name"
value={name}
onChange={e => setName(e.target.value)}
fullWidth
/>
<CopyToClipboard text={me} className={classes.margin}>
<Button
variant="outlined"
color="primary"
fullWidth
startIcon={<Assignment fontSize="large" />}
>
Copy Your ID
</Button>
</CopyToClipboard>
</Grid>
<Grid item xs={12} md={6} className={classes.padding}>
<Typography gutterBottom variant="h6">
Make a call
</Typography>
<TextField
label="ID to call"
value={idToCall}
onChange={e => setIdToCall(e.target.value)}
fullWidth
/>
{callAccepted && !callEnded ? (
<Button
variant="outlined"
color="secondary"
startIcon={<PhoneDisabled fontSize="large" />}
fullWidth
onClick={leaveCall}
className={classes.margin}
>
Hang Up
</Button>
) : (
<Button
variant="outlined"
color="primary"
startIcon={<Phone fontSize="large" />}
fullWidth
onClick={() => callUser(idToCall)}
className={classes.margin}
>
Call
</Button>
)}
<Button
variant="outlined"
color="secondary"
startIcon={<VideoCall fontSize="large" />}
onClick={() => setVideoAvailability(!isVideoAvailable)}
className={classes.margin}
></Button>
</Grid>
</Grid>
</form>
{children}
</Container>
);
};
export default Sidebar;
| 25.457143 | 69 | 0.50477 |
1d1ab6c8bc8fbe32fd6c3f4809bdc075ca999386 | 889 | js | JavaScript | packages/cli/styleguide.config.js | hehex9/sketch-retired | 38c1ea22590404aa9723dedb5bbff230fb0b7860 | [
"MIT"
] | 21 | 2018-05-18T14:05:53.000Z | 2021-08-07T11:59:48.000Z | packages/cli/styleguide.config.js | hehex9/sketch-retired | 38c1ea22590404aa9723dedb5bbff230fb0b7860 | [
"MIT"
] | 168 | 2018-05-10T14:53:17.000Z | 2021-06-22T16:21:45.000Z | packages/cli/styleguide.config.js | hehex9/sketch-retired | 38c1ea22590404aa9723dedb5bbff230fb0b7860 | [
"MIT"
] | 8 | 2018-05-18T13:34:31.000Z | 2021-08-07T11:59:49.000Z | const { override, addBabelPlugin, addLessLoader } = require("customize-cra");
const importCwd = require("import-cwd");
const antdTheme = importCwd.silent("./antd.theme") || {};
const path = require("path");
const webpackConfig = override(
// for styled-components
addBabelPlugin([
"styled-components",
{
displayName: process.env.NODE_ENV !== "production",
fileName: false,
pure: true,
ssr: false,
},
]),
// for antd
addBabelPlugin(
["import", { libraryName: "antd", libraryDirectory: "es", style: true }] // change importing css to less
),
addLessLoader({
modifyVars: antdTheme,
javascriptEnabled: true,
})
)(require("react-scripts/config/webpack.config")(process.env.NODE_ENV));
module.exports = {
webpackConfig,
skipComponentsWithoutExample: true,
components: path.join(process.cwd(), "src/components/**/*.js"),
};
| 27.78125 | 108 | 0.667042 |
1d1bfe65ca089120576e83d86a7252db65c92c4c | 2,484 | js | JavaScript | src/server/services/milestoneService.js | boostcamp-2020/IssueTracker-26 | c23d48800d0d58a06eb567e895b945a0e8ba4b80 | [
"MIT"
] | 2 | 2020-10-26T08:56:53.000Z | 2020-10-26T09:07:41.000Z | src/server/services/milestoneService.js | boostcamp-2020/IssueTracker-26 | c23d48800d0d58a06eb567e895b945a0e8ba4b80 | [
"MIT"
] | 63 | 2020-10-26T09:11:50.000Z | 2020-11-13T02:54:25.000Z | src/server/services/milestoneService.js | boostcamp-2020/IssueTracker-26 | c23d48800d0d58a06eb567e895b945a0e8ba4b80 | [
"MIT"
] | 4 | 2020-11-21T04:40:07.000Z | 2020-11-22T22:40:34.000Z | const milestoneService = (model) => {
return {
model,
async deleteMilestone(id) {
try {
const milestoneId = await this.model.deleteMilestone(id);
return milestoneId;
} catch (e) {
return undefined;
}
},
async getMilestoneList() {
let milestoneList = await this.model.getMilestoneList();
const issuesListsPromise = milestoneList.map((milestone) => {
return this.model.getIssueListByMilestoneId(milestone.id);
});
const issuesLists = await Promise.all(issuesListsPromise);
milestoneList = milestoneList.map((milestone, index) => ({
...milestone,
issues: issuesLists[index],
}));
return milestoneList;
},
async getMilestoneById(id) {
const milestone = await this.model.getMilestoneById(id);
return milestone;
},
async createMilestone({ title, duedate, description }) {
try {
const milestoneId = await this.model.createMilestone({
title,
duedate,
description,
});
return milestoneId;
} catch (e) {
return undefined;
}
},
async updateMilestone({ id, title, duedate, description }) {
try {
const milestoneId = await this.model.updateMilestone({
id,
title,
duedate,
description,
});
return milestoneId;
} catch (e) {
return undefined;
}
},
async getMilestoneTotal() {
try {
const total = await this.model.getMilestoneTotal();
return total;
} catch (e) {
return undefined;
}
},
async getMilestoneAll() {
try {
const list = await this.model.getMilestoneAll();
return list;
} catch (e) {
return undefined;
}
},
async stateChange(state, id) {
try {
const milestone = await this.model.stateChange(state ? 0 : 1, id);
return milestone;
} catch (e) {
return undefined;
}
},
async getMilestoneRatio(id) {
try {
const ratio = await this.model.getMilestoneRatio(id);
return ratio;
} catch (e) {
return undefined;
}
},
async getMilestoneWithRatio() {
try {
const milestone = await this.model.getMilestoneWithRatio();
return milestone;
} catch (e) {
return undefined;
}
},
};
};
module.exports = milestoneService;
| 25.608247 | 74 | 0.560386 |
1d1c714e2ed1ef183df04475e4aa9b16ee3a8e3f | 1,016 | js | JavaScript | src/api/controllers/index.js | 19bharat/scannearn-backend | 3f2b06d91890837615b0c80cf0481b50ec6bdeb8 | [
"Apache-2.0"
] | null | null | null | src/api/controllers/index.js | 19bharat/scannearn-backend | 3f2b06d91890837615b0c80cf0481b50ec6bdeb8 | [
"Apache-2.0"
] | null | null | null | src/api/controllers/index.js | 19bharat/scannearn-backend | 3f2b06d91890837615b0c80cf0481b50ec6bdeb8 | [
"Apache-2.0"
] | null | null | null | const {ServerConstants} = require('../../utilities/AppConstants.js');
const {
getUserStatus,
addUser,
postImageData
} = require('../impl/ServiceImpl.js');
module.exports = (app, upload, express_server) => {
try {
/*
* API to know the status of a user whether he is online or not
*/
app.get(ServerConstants.API_BASE_URL + 'user/:name', getUserStatus);
/*
* API to consume webrtc answer from a user
*/
app.post(ServerConstants.API_BASE_URL + 'user/add', addUser);
/**
* API to upload image
*/
app.post(ServerConstants.API_BASE_URL + 'user/image/upload', upload.none(), postImageData);
express_server.listen(ServerConstants.EXPRESS_PORT);
} catch (e) {
global.logger.info(JSON.stringify({
code: StatusConstants.SERVER_ERR,
text: 'error while registering api endpoints on express server.',
type: ServerConstants.ERROR
}));
}
}; | 28.222222 | 99 | 0.598425 |
1d1cd5c6cc564abd0e36b1459fe2b30cc3c56a45 | 365 | js | JavaScript | src/plugins/getDataFunc.js | darkmcua/peiko | 6b918a9d6ff32c03895e73c6efcf2bf77972593e | [
"Unlicense"
] | null | null | null | src/plugins/getDataFunc.js | darkmcua/peiko | 6b918a9d6ff32c03895e73c6efcf2bf77972593e | [
"Unlicense"
] | null | null | null | src/plugins/getDataFunc.js | darkmcua/peiko | 6b918a9d6ff32c03895e73c6efcf2bf77972593e | [
"Unlicense"
] | null | null | null | const getRandomInt = (min, max) =>
Math.floor(Math.random() * (max - min + 1)) + min;
const simulateAsyncReq = async (data) => {
const delay = (ms) =>
new Promise((res, rej) =>
setTimeout(getRandomInt(1, 5) > 2 ? res : rej, ms)
);
await delay(getRandomInt(500, 2000));
return data;
};
export default simulateAsyncReq;
| 24.333333 | 62 | 0.578082 |
1d1da7ed65c890874d34d58b93c3512654a08f9d | 1,589 | js | JavaScript | app/components/send-cash/TransactionModal.js | growlot/cloakcoin-desktop-wallet | 2249469c0e3472230aeb6e027e6a3b7567bc9f4b | [
"MIT"
] | 3 | 2019-08-02T08:01:50.000Z | 2019-08-10T22:49:43.000Z | app/components/send-cash/TransactionModal.js | growlot/cloakcoin-desktop-wallet | 2249469c0e3472230aeb6e027e6a3b7567bc9f4b | [
"MIT"
] | 19 | 2019-08-10T18:53:12.000Z | 2022-03-25T18:52:42.000Z | app/components/send-cash/TransactionModal.js | growlot/cloakcoin-desktop-wallet | 2249469c0e3472230aeb6e027e6a3b7567bc9f4b | [
"MIT"
] | 1 | 2021-02-12T17:17:17.000Z | 2021-02-12T17:17:17.000Z | // @flow
import React, { Component } from 'react'
import { translate } from 'react-i18next'
import cn from 'classnames'
import styles from './TransactionModal.scss'
import fingerImg from '~/assets/images/main/send/finger.png';
import {
RoundedInput,
RoundedInputWithCopy,
} from '~/components/rounded-form'
type Props = {
t: any
}
/**
* @class TransactionModal
* @extends {Component<Props>}
*/
class TransactionModal extends Component<Props> {
props: Props
render() {
const { t, isVisible, onClose, txId } = this.props
if (!isVisible) {
return null
}
let { canCopyTxId } = this.props
if (canCopyTxId === undefined || canCopyTxId === null) {
canCopyTxId = true
}
return (
<div className={styles.overlay}>
<div className={cn(styles.container, styles.txAddress)}>
<div
role="button"
tabIndex={0}
className={cn('icon', styles.modalClose)}
onClick={onClose}
onKeyDown={() => {}}
/>
<img className={cn(styles.finger)} src={fingerImg} alt="finger" />
<p>{t('TX ID')}</p>
{canCopyTxId ? (
<RoundedInputWithCopy
className={styles.transactionId}
readOnly={true}
defaultValue={txId}
/>) : (
<RoundedInput
className={styles.transactionId}
readOnly={true}
defaultValue={txId}
/>
)}
</div>
</div>
)
}
}
export default (translate('send-cash')(TransactionModal))
| 24.075758 | 76 | 0.559471 |
1d1e37c777e451cd62effd549b247e9c03807300 | 835 | js | JavaScript | MEAN_App/app/contacts/contacts.js | arunprabu/Full_Stack | ad631d0a906b490439f52fbf513b46039bb38679 | [
"MIT"
] | null | null | null | MEAN_App/app/contacts/contacts.js | arunprabu/Full_Stack | ad631d0a906b490439f52fbf513b46039bb38679 | [
"MIT"
] | null | null | null | MEAN_App/app/contacts/contacts.js | arunprabu/Full_Stack | ad631d0a906b490439f52fbf513b46039bb38679 | [
"MIT"
] | null | null | null | 'use strict';
angular.module('myApp.contacts', ['ngRoute', 'ui.grid'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/contacts', {
templateUrl: 'contacts/contacts.html',
controller: 'ContactsCtrl'
});
}])
.controller('ContactsCtrl', ['$scope', 'ContactsSvc', function($scope, svc) {
$scope.contacts = [];
var promise = svc.getAll();
promise.then(function(data) {
$scope.$apply(function() {
Array.prototype.push.apply($scope.contacts, data);
});
});
}])
.service('ContactsSvc', ['$resource', function($resource) {
this.getAll = function() {
var promise = new Promise(function(resolve, reject) {
var Contact = $resource("/contacts");
Contact.query(function(data) {
resolve(data);
});
});
return promise;
};
}]); | 25.30303 | 77 | 0.608383 |
1d1f73c9a27c0dbab71e68a5f3ddc5fb331fecf5 | 762 | js | JavaScript | data/provinces/north/districts/gicumbi/sectors/rutare/index.js | abayo-luc/rwanda | e33704efa99de3397fc485fcb63309ab98a92257 | [
"MIT"
] | 36 | 2019-12-02T11:16:15.000Z | 2022-03-22T12:32:19.000Z | data/provinces/north/districts/gicumbi/sectors/rutare/index.js | abayo-luc/rwanda | e33704efa99de3397fc485fcb63309ab98a92257 | [
"MIT"
] | 9 | 2019-12-04T04:29:43.000Z | 2021-07-31T14:55:00.000Z | data/provinces/north/districts/gicumbi/sectors/rutare/index.js | abayo-luc/rwanda | e33704efa99de3397fc485fcb63309ab98a92257 | [
"MIT"
] | 13 | 2019-12-03T18:22:38.000Z | 2022-02-20T15:21:11.000Z | /**
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
* Sectors - Rutare
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*/
module.exports = {
"Bikumba": [
"Karugeyo",
"Kintaganirwa",
"Marembo",
"Matyazo",
"Nyabisindu"
],
"Gasharu": [
"Buyegero",
"Kabagabo",
"Kabusunzu",
"Kagarama",
"Rwimbogo",
"Yogi"
],
"Gatwaro": [
"Bureranyana",
"Gashinya",
"Kabira",
"Kanaba"
],
"Kigabiro": [
"Kabuye",
"Munini",
"Nyakabingo",
"Nyakavunga",
"Rugarama"
],
"Munanira": [
"Bushokanyambo",
"Gasharu",
"Kirwa",
"Mataba",
"Ruti"
],
"Nkoto": [
"Bariza",
"Bwangamwanda",
"Murehe",
"Nyagatoma",
"Nyansenge"
]
};
| 14.941176 | 59 | 0.400262 |
1d1f988a3904427939c1fe54df3a60f3dde69fce | 813 | js | JavaScript | dist/photos/multer-config.js | ARTMUC/cookbookV2 | c290606f00ca620043366663d8a9564cc2f52577 | [
"MIT"
] | null | null | null | dist/photos/multer-config.js | ARTMUC/cookbookV2 | c290606f00ca620043366663d8a9564cc2f52577 | [
"MIT"
] | null | null | null | dist/photos/multer-config.js | ARTMUC/cookbookV2 | c290606f00ca620043366663d8a9564cc2f52577 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.editFileName = exports.imageFileFilter = void 0;
const common_1 = require("@nestjs/common");
const path = require("path");
const uuid_1 = require("uuid");
const imageFileFilter = (req, file, callback) => {
if (!file.originalname.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
return callback(new common_1.HttpException('Only image files are allowed!', 400));
}
callback(null, true);
};
exports.imageFileFilter = imageFileFilter;
const editFileName = async (req, file, callback) => {
try {
callback(null, (0, uuid_1.v4)() + path.extname(file.originalname));
}
catch (error) {
callback(error);
}
};
exports.editFileName = editFileName;
//# sourceMappingURL=multer-config.js.map | 35.347826 | 90 | 0.676507 |
1d2084b7d2856ab9248a77a63816301cbe212fc8 | 796 | js | JavaScript | src/App.js | xdmorgan/ipsum | 36d03fb81b460e75327fbfdde7632a3b37b9b901 | [
"MIT"
] | null | null | null | src/App.js | xdmorgan/ipsum | 36d03fb81b460e75327fbfdde7632a3b37b9b901 | [
"MIT"
] | 5 | 2018-03-03T14:52:32.000Z | 2018-03-14T00:17:53.000Z | src/App.js | xdmorgan/ipsum | 36d03fb81b460e75327fbfdde7632a3b37b9b901 | [
"MIT"
] | null | null | null | // @flow
import React, { Component } from "react";
import styled from "styled-components/primitives";
import { NUFC } from "./generator/data";
import { GeneratedText } from "./generator";
import { AppLayout, ContainerView } from "./global";
const IntroHeading = styled.Text`
font-weight: 700;
font-size: 32px;
`;
type State = {
data: string[],
length: number
};
class App extends Component<{}, State> {
constructor() {
super();
this.state = {
data: NUFC,
length: 25
};
}
render() {
return (
<AppLayout>
<ContainerView>
<IntroHeading>Lorem Ipsum Generator</IntroHeading>
<GeneratedText data={this.state.data} length={this.state.length} />
</ContainerView>
</AppLayout>
);
}
}
export default App;
| 19.9 | 77 | 0.616834 |
1d2174de785705424a4c897498aa3d41665e716a | 4,785 | js | JavaScript | docs/14-es2015.f97bb00bbf6dfa34fdd7.js | kafiln/rxjs-fruits | c51e227fb539f94aa0cb057ba7f22c21db474c4b | [
"MIT"
] | 180 | 2020-03-26T12:40:20.000Z | 2022-03-05T04:46:17.000Z | docs/14-es2015.f97bb00bbf6dfa34fdd7.js | kafiln/rxjs-fruits | c51e227fb539f94aa0cb057ba7f22c21db474c4b | [
"MIT"
] | 34 | 2020-04-10T12:25:11.000Z | 2022-03-02T07:51:06.000Z | docs/14-es2015.f97bb00bbf6dfa34fdd7.js | kafiln/rxjs-fruits | c51e227fb539f94aa0cb057ba7f22c21db474c4b | [
"MIT"
] | 29 | 2020-05-08T13:18:23.000Z | 2022-03-06T14:56:47.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[14],{KdnK:function(e,n,t){"use strict";t.r(n),t.d(n,"SkipModule",function(){return q});var i=t("iInd");class c{constructor(){this.fruits=["apple","apple","banana","apple"],this.expectedFruits=["banana","apple"],this.code='const fruits = from([\n "apple",\n "apple",\n "banana",\n "apple"]);\n\nfruits.pipe(\n\t\n).subscribe(fruit => toConveyorBelt(fruit));\n',this.minPositionLineNumber=7,this.positionColumnNumber=2}}var r=t("8Y7J"),s=t("VIrA"),a=t("TSSN"),o=t("SVse"),p=t("dJsq"),b=t("uzYf");function u(e,n){if(1&e&&(r.Ob(0,"div"),r.Ob(1,"p"),r.qc(2,"Auf die ersten zwei Fr\xfcchte k\xf6nnen wir verzichten."),r.Nb(),r.Ob(3,"p"),r.qc(4,"Der "),r.Ob(5,"code",4),r.qc(6,"skip"),r.Nb(),r.qc(7,"-Operator erm\xf6glicht uns das \xdcberspringen unn\xf6tiger Fr\xfcchte. "),r.Ob(8,"a",5),r.qc(9,"(Mehr Infos zu skip)"),r.Nb(),r.Nb(),r.Nb()),2&e){r.ac();const e=r.hc(9);r.Bb(5),r.fc("appTooltip",e)}}function f(e,n){if(1&e&&(r.Ob(0,"div"),r.Ob(1,"p"),r.qc(2,"We can do without the first two fruits. The "),r.Ob(3,"code",4),r.qc(4,"skip"),r.Nb(),r.qc(5," operator enables us to skip unnecessary fruit. "),r.Ob(6,"a",5),r.qc(7,"(Learn more about skip)"),r.Nb(),r.Nb(),r.Nb()),2&e){r.ac();const e=r.hc(9);r.Bb(3),r.fc("appTooltip",e)}}function d(e,n){if(1&e&&(r.Ob(0,"div"),r.Ob(1,"p"),r.qc(2,"\u6211\u4eec\u4e0d\u9700\u8981\u524d\u4e24\u4e2a\u6c34\u679c\u3002 "),r.Ob(3,"code",4),r.qc(4,"skip"),r.Nb(),r.qc(5," \u64cd\u4f5c\u7b26\u80fd\u591f\u8df3\u8fc7\u4e0d\u5fc5\u8981\u7684\u6c34\u679c\u3002 "),r.Ob(6,"a",5),r.qc(7,"\uff08\u4e86\u89e3\u5173\u4e8e skip \u64cd\u4f5c\u7b26\u7684\u66f4\u591a\u4fe1\u606f\uff09"),r.Nb(),r.Nb(),r.Nb()),2&e){r.ac();const e=r.hc(9);r.Bb(3),r.fc("appTooltip",e)}}function h(e,n){if(1&e&&(r.Ob(0,"div"),r.Ob(1,"p"),r.qc(2,"\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u043f\u043b\u043e\u0434\u043e\u0432. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 "),r.Ob(3,"code",4),r.qc(4,"skip"),r.Nb(),r.qc(5," \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0440\u0443\u043a\u0442\u044b. "),r.Ob(6,"a",5),r.qc(7,"(\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e skip)"),r.Nb(),r.Nb(),r.Nb()),2&e){r.ac();const e=r.hc(9);r.Bb(3),r.fc("appTooltip",e)}}function l(e,n){if(1&e&&(r.Ob(0,"div"),r.Ob(1,"p"),r.qc(2,"Podemos hacerlo sin las primeras dos frutas. El operador "),r.Ob(3,"code",4),r.qc(4,"skip"),r.Nb(),r.qc(5," nos permite omitir fruta innecesaria. "),r.Ob(6,"a",5),r.qc(7,"(Aprende m\xe1s sobre skip)"),r.Nb(),r.Nb(),r.Nb()),2&e){r.ac();const e=r.hc(9);r.Bb(3),r.fc("appTooltip",e)}}const g=[{path:"",component:(()=>{class e{constructor(e,n){this.exerciseService=e,this.translateService=n,this.exerciseTitle="skip",this.skipCode="\n of(1, 2, 3, 4).pipe(\n skip(1)\n ).subscribe(data => console.log(data));\n\n // Logs:\n // 2\n // 3\n // 4\n ",this.currentLanguage=""}ngOnInit(){this.exerciseService.newExercise(new c),this.currentLanguage=this.translateService.currentLang,this.onLangChangeSubscription=this.translateService.onLangChange.subscribe({next:()=>{this.currentLanguage=this.translateService.currentLang}})}ngOnDestroy(){this.onLangChangeSubscription.unsubscribe()}}return e.\u0275fac=function(n){return new(n||e)(r.Lb(s.a),r.Lb(a.d))},e.\u0275cmp=r.Fb({type:e,selectors:[["app-skip"]],decls:14,vars:10,consts:[[4,"ngIf"],[1,"tooltip","codeTooltip"],["tooltip",""],[3,"highlight"],[1,"help",3,"appTooltip"],["href","https://rxjs.dev/api/operators/skip","target","_blank"]],template:function(e,n){1&e&&(r.Ob(0,"h3"),r.qc(1),r.bc(2,"translate"),r.Nb(),r.pc(3,u,10,1,"div",0),r.pc(4,f,8,1,"div",0),r.pc(5,d,8,1,"div",0),r.pc(6,h,8,1,"div",0),r.pc(7,l,8,1,"div",0),r.Ob(8,"div",1,2),r.Ob(10,"pre"),r.qc(11," "),r.Mb(12,"code",3),r.qc(13,"\n "),r.Nb(),r.Nb()),2&e&&(r.Bb(1),r.tc("",r.cc(2,8,"EXERCISES.EXERCISETITLE"),": ",n.exerciseTitle,""),r.Bb(2),r.fc("ngIf","de"===n.currentLanguage),r.Bb(1),r.fc("ngIf","en"===n.currentLanguage),r.Bb(1),r.fc("ngIf","zh_CN"===n.currentLanguage),r.Bb(1),r.fc("ngIf","ru"===n.currentLanguage),r.Bb(1),r.fc("ngIf","es"===n.currentLanguage),r.Bb(5),r.fc("highlight",n.skipCode))},directives:[o.j,p.b,b.a],pipes:[a.c],styles:[""]}),e})()}];let N=(()=>{class e{}return e.\u0275mod=r.Jb({type:e}),e.\u0275inj=r.Ib({factory:function(n){return new(n||e)},imports:[[i.d.forChild(g)],i.d]}),e})();var O=t("PCNd");let q=(()=>{class e{}return e.\u0275mod=r.Jb({type:e}),e.\u0275inj=r.Ib({factory:function(n){return new(n||e)},imports:[[O.a,N]]}),e})()}}]); | 4,785 | 4,785 | 0.650157 |
1d2188b7d3595065c333f508a7d8c4a7d4d9e3a4 | 398 | js | JavaScript | src/js/Views/SocialFeed.js | Cloudoki/hacktool-backoffice | 373665d021e4c61ceb6f02f3da807aee77d52692 | [
"MIT"
] | null | null | null | src/js/Views/SocialFeed.js | Cloudoki/hacktool-backoffice | 373665d021e4c61ceb6f02f3da807aee77d52692 | [
"MIT"
] | null | null | null | src/js/Views/SocialFeed.js | Cloudoki/hacktool-backoffice | 373665d021e4c61ceb6f02f3da807aee77d52692 | [
"MIT"
] | null | null | null |
// THE ADMIN CAN EDIT THIS PAGE
define(
['Views/BaseView'],
function (BaseView)
{
var SocialFeed = BaseView.extend({
events: {},
initialize: function(options) {
$.extend(this, options);
},
render: function()
{
this.$el.html(Mustache.render(Templates.social_feed, {handle: this.handle}));
return this;
}
});
return SocialFeed;
}
); | 14.740741 | 84 | 0.585427 |
1d21a6da4a87716a1a46f682e4a0435fa972935a | 2,469 | js | JavaScript | compoents/postDetail.js | JackieLin/v2ex | b33d04373a97d2061578af9c2a9c0ec1a4fc70a3 | [
"MIT"
] | null | null | null | compoents/postDetail.js | JackieLin/v2ex | b33d04373a97d2061578af9c2a9c0ec1a4fc70a3 | [
"MIT"
] | 1 | 2016-10-10T05:40:18.000Z | 2016-10-10T05:41:37.000Z | compoents/postDetail.js | JackieLin/v2ex | b33d04373a97d2061578af9c2a9c0ec1a4fc70a3 | [
"MIT"
] | null | null | null | /**
* 帖子详情模块
* @author jackieLin <dashi_lin@163.com>
*/
'use strict';
import React, { Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import v2exStyle from '../styles/v2ex';
import PostMessage from './postMessage';
import CommentList from './commentList';
import {getCommentsById} from '../actions/v2ex';
import {
ScrollView,
StyleSheet,
Text,
View
} from 'react-native';
const containerStyles = StyleSheet.create(v2exStyle.container);
const postStyles = StyleSheet.create(v2exStyle.postDetail);
class PostDetail extends Component {
constructor() {
super();
}
componentDidMount() {
const {dispatch, post} = this.props;
dispatch(getCommentsById(post.id));
}
render() {
const {post, comments} = this.props;
return (
<ScrollView style={postStyles.container}>
<View style={postStyles.postMessage}>
<PostMessage post={post} showComment={false}/>
</View>
<View style={postStyles.divider}></View>
<View style={[postStyles.postMessage, {marginBottom: 10}]}>
<Text style={postStyles.content}>{post.content}</Text>
</View>
<View style={postStyles.postscript}>
<Text style={postStyles.postscriptText}>第一条附言 ● 3 小时 30 分钟前</Text>
<Text>联通 4G,。。。之前</Text>
</View>
<View style={[postStyles.postMessage, {marginTop: 27}]}>
<Text>33 回复 | 直到 2016-06-02 12:17:26 +08:00</Text>
</View>
<View style={[postStyles.divider, {marginTop: 15}]} />
<View style={postStyles.commentList}>
<View style={postStyles.postMessage}>
<CommentList comments={comments}/>
</View>
<View style={postStyles.divider}></View>
</View>
</ScrollView>
);
}
};
PostDetail.propTypes = {
post: PropTypes.object.isRequired,
comments: PropTypes.array.isRequired,
isFetching: PropTypes.bool.isRequired,
dispatch: PropTypes.func.isRequired
}
function mapStateToProps(state) {
const { commentList, isFetching = false } = state;
const {
items: comments
} = commentList;
return {
isFetching: isFetching,
comments: comments
};
}
export default connect(mapStateToProps)(PostDetail);
| 29.392857 | 84 | 0.583637 |
1d23843d408e14ebe446d99c8004675a4920b52a | 410 | js | JavaScript | src/components/1-Atoms/GlobalStyle/GlobalStyles.js | rish18/BlockChain-blink | dcbefacbb50c3f6918f51399c9b0cd24cabd7237 | [
"MIT"
] | null | null | null | src/components/1-Atoms/GlobalStyle/GlobalStyles.js | rish18/BlockChain-blink | dcbefacbb50c3f6918f51399c9b0cd24cabd7237 | [
"MIT"
] | null | null | null | src/components/1-Atoms/GlobalStyle/GlobalStyles.js | rish18/BlockChain-blink | dcbefacbb50c3f6918f51399c9b0cd24cabd7237 | [
"MIT"
] | null | null | null | import { createGlobalStyle } from "styled-components";
export default createGlobalStyle`
body {
color: $first-color;
font-family: fira-sans, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 400;
height: 100vh;
margin: 0;
}
/* stylelint-disable-next-line selector-max-id */
#root {
height: 100%;
}
h1 {
margin-top: 0;
}
`;
| 17.826087 | 55 | 0.582927 |
1d2397e9c87375953bc7e4e19267e433de931706 | 707 | js | JavaScript | src/routes/test_env/api_data_reset.js | TKOaly/rv-backend | 370e84f012785c56f85b9cb67725403e0bc61199 | [
"MIT"
] | null | null | null | src/routes/test_env/api_data_reset.js | TKOaly/rv-backend | 370e84f012785c56f85b9cb67725403e0bc61199 | [
"MIT"
] | 45 | 2018-07-10T16:36:04.000Z | 2022-02-11T14:32:32.000Z | src/routes/test_env/api_data_reset.js | TKOaly/rv-backend | 370e84f012785c56f85b9cb67725403e0bc61199 | [
"MIT"
] | 1 | 2019-11-06T20:36:03.000Z | 2019-11-06T20:36:03.000Z | const express = require('express');
const router = express.Router();
const knex = require('../../db/knex');
router.post('/', async (req, res) => {
if (!['test', 'development', 'ci'].includes(process.env.NODE_ENV)) {
return res.status(500).json({ message: 'API not running in development, test or CI environment', error: true });
}
try {
await knex.migrate.rollback();
await knex.migrate.latest();
await knex.seed.run();
return res.status(200).json({ message: 'Successfully reset API data', error: false });
} catch (err) {
return res.status(500).json({ message: 'Error resetting API data', error: true });
}
});
module.exports = router;
| 35.35 | 120 | 0.615276 |
4a6c6579ed1a99db2ba0d138057235e168bbda33 | 793 | js | JavaScript | src/pages/services.js | jcarrera94/gatsby-crashcourse | 8bae18dadbdd6fce03e17fb5ab948b62f73358a7 | [
"MIT"
] | null | null | null | src/pages/services.js | jcarrera94/gatsby-crashcourse | 8bae18dadbdd6fce03e17fb5ab948b62f73358a7 | [
"MIT"
] | 3 | 2021-03-10T04:30:07.000Z | 2021-09-21T06:25:20.000Z | src/pages/services.js | jcarrera94/gatsby-crashcourse | 8bae18dadbdd6fce03e17fb5ab948b62f73358a7 | [
"MIT"
] | null | null | null | import React from 'react';
import Layout from "../components/layout";
import SEO from "../components/seo";
const ServicesPage = () => (
<Layout>
<SEO title="Services" />
<h1>Our Services</h1>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aspernatur, nulla doloremque, aperiam odio reprehenderit dolorum, sunt amet tempora expedita similique voluptates. Ut quasi nisi suscipit reiciendis necessitatibus architecto tenetur iusto.
</p>
<p>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aspernatur, nulla doloremque, aperiam odio reprehenderit dolorum, sunt amet tempora expedita similique voluptates. Ut quasi nisi suscipit reiciendis necessitatibus architecto tenetur iusto.
</p>
</Layout>
)
export default ServicesPage; | 41.736842 | 253 | 0.742749 |
4a6d6f0d97e4d52de2ebab08af1a220f8ee41fc6 | 325 | js | JavaScript | spec/TestTask.js | mbrio/react-pipeline | d05427e73fa3135ccd8f756231a55ca9cd8f7c3a | [
"BSD-3-Clause"
] | 26 | 2016-03-04T02:23:42.000Z | 2019-04-08T12:39:29.000Z | spec/TestTask.js | mbrio/react-pipeline | d05427e73fa3135ccd8f756231a55ca9cd8f7c3a | [
"BSD-3-Clause"
] | 1 | 2016-03-11T19:43:44.000Z | 2016-03-11T19:43:44.000Z | spec/TestTask.js | mbrio/react-pipeline | d05427e73fa3135ccd8f756231a55ca9cd8f7c3a | [
"BSD-3-Clause"
] | 6 | 2016-03-11T18:31:32.000Z | 2021-10-18T07:53:51.000Z | import React from 'react';
import Task from '../src/Task';
import { callbackExec } from './helper';
export default class TestTask extends Task {
static propTypes = {
callback: React.PropTypes.func
};
handleSomething() {
return callbackExec.call(this);
}
exec() {
return this.handleSomething();
}
}
| 18.055556 | 44 | 0.667692 |
4a6ed9d2b5ca8022639e25dd54fc7f2d1ff8b634 | 1,665 | js | JavaScript | app/main/services/cameraApi.js | haiyuncode/myproject | 7e4a9e52e0cd21a8078a73b93ec5d24be2f0d363 | [
"BSD-Source-Code"
] | null | null | null | app/main/services/cameraApi.js | haiyuncode/myproject | 7e4a9e52e0cd21a8078a73b93ec5d24be2f0d363 | [
"BSD-Source-Code"
] | null | null | null | app/main/services/cameraApi.js | haiyuncode/myproject | 7e4a9e52e0cd21a8078a73b93ec5d24be2f0d363 | [
"BSD-Source-Code"
] | null | null | null | /**
* Created by Haiyun on 2/8/2016.
*/
'use strict';
/*global LokiCordovaFSAdapter, Camera, CameraPopoverOptions*/
angular.module('main')
.service('cameraApi', function ($log, $q, Loki, $cordovaCamera) {
$log.log('Hello from your Service: cameraApi in module main');
var vm = this;
var options = {
quality: 40,
//destinationType : Camera.DestinationType.DATA_URL,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
//targetWidth: 800,
//targetHeight: 1000,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: true,
correctOrientation: true
};
var _db;
var _receipts;
function initDB () {
var adapter = new LokiCordovaFSAdapter({'prefix': 'loki' });
_db = new Loki('receiptsDB',
{
autosave: true,
autosaveInterval: 5000, //1 second
adapter: adapter
});
console.log('receiptsDB created', new Date());
}
function getReceiptFromDB ()
{
return $q(function (resolve, reject) {
_db.loadDatabase('{}', function () {
//retrieve data from notes collection
_receipts = _db.getCollection('receipts');
if (!_receipts) {
//create notes collection
_receipts = _db.addCollection('receipts');
}
resolve(_receipts.data);
});
});
}
function addReceipt (receipt) {
_receipts.insert(receipt);
}
return {
initDB: initDB,
addReceipt: addReceipt
};
});
| 23.785714 | 67 | 0.596396 |
4a6f08173c04ec1b06fbe9cc5eff52e59170ce64 | 5,084 | js | JavaScript | fluent/javascript/fluent.js | Dale-WAX/consolecmnd | e6415c23155c9803ef4ed269e8e48f123bcd0dc8 | [
"Unlicense"
] | null | null | null | fluent/javascript/fluent.js | Dale-WAX/consolecmnd | e6415c23155c9803ef4ed269e8e48f123bcd0dc8 | [
"Unlicense"
] | null | null | null | fluent/javascript/fluent.js | Dale-WAX/consolecmnd | e6415c23155c9803ef4ed269e8e48f123bcd0dc8 | [
"Unlicense"
] | null | null | null | (function($) {
/**
* File: fluent.js
*
* Injects locale navigation menu into the website
*/
$.entwine('ss', function($) {
/**
* Determine the url to navigate to given the specified locale
*/
var urlForLocale = function(url, locale) {
var re, separator;
// Remove hash. See https://github.com/tractorcow/silverstripe-fluent/issues/90
url = url.split('#')[0];
re = new RegExp("([?&])" + fluentParam + "=.*?(&|$)", "i");
separator = url.indexOf('?') !== -1 ? "&" : "?";
if (url.match(re)) {
return url.replace(re, '$1' + fluentParam + "=" + locale + '$2');
} else {
return url + separator + fluentParam + "=" + locale;
}
};
/**
* Activation for cms menu
*/
$('.cms > .cms-container > .cms-menu > .cms-panel-content.center').entwine({
/**
* Generate the locale selector when activated
*/
onmatch: function() {
this._super();
var selector =
$("<div class='cms-fluent-selector'>\
<span class='icon icon-16 icon-fluent-translate'> </span>\
<span class='text'></span>\
<a class='cms-fluent-selector-flydown' type='button' title='"+fluentButtonTitle+"'><span class='icon icon-fluent-select'>"+fluentButtonTitle+"</span></a>\
<ul class='cms-fluent-selector-locales'></ul>\
</div>");
// Create options
$.each(fluentLocales, function(locale, name){
var item = $("<li><a><span class='full-title'></span><span class='short-title'></span></a></li>");
$(".full-title", item).text(name);
$(".short-title", item).text(locale.split("_")[0]);
$("a", item)
.attr('data-locale', locale)
.attr('title', name);
$(".cms-fluent-selector-locales", selector).append(item);
});
// Display selected locale
$(".text", selector).text(fluentLocales[fluentLocale]);
this.prepend(selector);
}
});
/**
* Selector container
*/
$(".cms-fluent-selector").entwine({
/**
* Show or hide the selector when clicked
*/
onclick: function() {
this.toggleClass('active');
}
});
/**
* Locale links
*/
$(".cms-fluent-selector .cms-fluent-selector-locales a").entwine({
/**
* Takes the user to the selected locale
*/
onclick: function(event) {
event.preventDefault();
locale = this.attr('data-locale');
url = urlForLocale(document.location.href, locale);
// Load panel
$('.cms-container').loadPanel(url);
// Update selector
$(".cms-fluent-selector")
.removeClass("active")
.find(".text")
.text(fluentLocales[locale]);
return false;
}
});
$('.cms-panel-deferred').entwine({
/**
* Ensure that any deferred panel URLs include the locale parameter in their URL
*/
onadd: function() {
var url = this.attr('data-url'),
newUrl = urlForLocale(url, $.cookie('FluentLocale_CMS'));
this.attr('data-url', newUrl);
this._super();
}
});
/**
* Translated fields - visual indicator
*/
$('div.LocalisedField *').entwine({
/**
* Switch the class and title/tooltip on translated fields
*/
toggleModified: function(sameAsDefault, selector) {
selector = selector || this;
var label = selector.closest('.field').find('.fluent-locale-label');
label.toggleClass('fluent-modified-value');
if (label.hasClass('fluent-modified-value')) {
label.attr('title', 'Modified from default locale value - click to reset');
} else {
label.attr('title', 'Using default locale value');
}
}
});
$('div.LocalisedField .LocalisedField').entwine({
/**
* Check for changes against the default value
*/
onchange: function() {
if (this.is('input')) {
var newValue = this.val();
} else if (this.is('textarea')) {
var newValue = this.text();
}
var defaultValue = this.data('default-locale-value');
if (!defaultValue) {
// We'll turn this off on the default locale
return;
}
this.toggleModified(newValue === defaultValue);
}
});
/**
* If the user clicks on the locale label in its modified state, reset to the default field value
*/
$('.fluent-locale-label.fluent-modified-value').entwine({
onclick: function() {
var input = this.closest('.LocalisedField').find('.LocalisedField');
var defaultValue = input.data('default-locale-value');
if (!defaultValue) {
return;
}
if (input.is('input')) {
input.val(defaultValue);
} else if (input.is('textarea')) {
input.text(defaultValue);
// If it's a WYSIWYG editor, trigger it to update
if ('true' === input.attr('tinymce')) {
tinyMCE.get(input.attr('id')).setContent(defaultValue);
}
}
input.change();
}
});
/**
* Maintain UI state of the CMS locale switcher when using standard browser navigation buttons.
*/
$('.cms-edit-form').entwine({
redraw: function() {
var localeMenuLocale = $.cookie('FluentLocale_CMS')
$('.cms-fluent-selector .text').text(fluentLocales[localeMenuLocale]);
this._super();
}
});
});
})(jQuery);
| 26.757895 | 160 | 0.596381 |
4a6f5894499ac2e775f97b58cc98f023b823ce0b | 1,086 | js | JavaScript | termine-fe/src/Components/CouponBox.js | hschaeidt/covid19-teststation-termine | a8cb178154b74f76de24c934b72036b947f6a047 | [
"MIT"
] | null | null | null | termine-fe/src/Components/CouponBox.js | hschaeidt/covid19-teststation-termine | a8cb178154b74f76de24c934b72036b947f6a047 | [
"MIT"
] | null | null | null | termine-fe/src/Components/CouponBox.js | hschaeidt/covid19-teststation-termine | a8cb178154b74f76de24c934b72036b947f6a047 | [
"MIT"
] | null | null | null | import React from "react";
import { Trans, Plural } from "@lingui/macro";
export const CouponBox = ({ coupons }) => {
return (
<div id="coupons">
<h3 style={{ paddingLeft: "calc(2 * var(--universal-padding))" }}>
<div>
<Trans>
<Plural
value={coupons}
_0="You can book"
_1="You can still book"
other="You can still book"
/>
<b>
<u>
<Plural
value={coupons}
_0="no appointment"
_1="one appointment"
other="# appointments"
/>
</u>
</b>
<Plural value={coupons} _0="anymore" _1="" other="" />
</Trans>
</div>
{coupons === 0 ? (
<>
<div
dangerouslySetInnerHTML={{
__html: window.config.contactInfoCoupons,
}}
/>
</>
) : (
<div> </div>
)}
</h3>
</div>
);
};
| 24.681818 | 72 | 0.378453 |
4a6f5b1c82851fc3a19dc79a04403e6d5640bc7a | 6,936 | js | JavaScript | public/js/components/card.js | doong-jo/carousel | ff71c333252a0c2f6be75997e21e42a17ee6aba9 | [
"MIT"
] | 1 | 2020-08-12T23:46:39.000Z | 2020-08-12T23:46:39.000Z | public/js/components/card.js | doong-jo/carousel | ff71c333252a0c2f6be75997e21e42a17ee6aba9 | [
"MIT"
] | 6 | 2020-08-02T03:42:28.000Z | 2022-02-27T09:21:55.000Z | public/js/components/card.js | doong-jo/carousel | ff71c333252a0c2f6be75997e21e42a17ee6aba9 | [
"MIT"
] | 2 | 2020-08-12T23:46:40.000Z | 2021-10-12T07:31:18.000Z | import Component from "./component.js";
import getCardView from "../../views/card-view.js";
import {
on,
containClass,
findChildren,
setHTML,
addClass,
removeClass,
getAttribute
} from "../utils/light-dom.js";
import _ from "../services/constants.js";
class Card extends Component {
constructor() {
super();
this.CLASS_CONTAINER = "card-container";
this.CLASS_CARD = "item";
this.CLASS_IMG = "img";
this.CLASS_IMG_SPRITE_PLAY = `${this.CLASS_IMG}-sprite-play`;
this.CLASS_TITLE = "title";
this.CLASS_CIRCLE_CONTAINER = "circle-container";
this.CLASS_CIRCLE = `${this.CLASS_CIRCLE_CONTAINER}__circle`;
this.CLASS_CIRCLE_SELECTED = "circle-selected";
this.CLASS_CARD_SCALE_UP = `${this.CLASS_CARD}-scale-up`;
this.CLASS_IMG_SCALE_UP = `${this.CLASS_IMG}-scale-up`;
this.ATTR_CARD_INDEX = "card-index";
this.ATTR_CIRCLE_INDEX = "circle-index";
this.circleClickHandler = this.circleClickHandler.bind(this);
this.cardClickHandler = this.cardClickHandler.bind(this);
this.spriteAnimOverHandler = this.spriteAnimOverHandler.bind(this);
this.spriteAnimOutHandler = this.spriteAnimOutHandler.bind(this);
this.followByCircleIndex = this.followByCircleIndex.bind(this);
this.options = {
minLength: 2,
maxLength: 5,
animSpriteIndexArr: [0]
};
}
render() {
setHTML(this.elContainer, this.view);
this.processWhenAfterRender();
return this;
}
processWhenAfterRender() {
this.makeElementVariables();
this.setListeners();
this.applyCardFocus(0);
this.applyCircleFocus(0);
}
build(data) {
if (!Array.isArray(data) || data.length < this.options.minLength) {
throw new Error("Card needs array of items");
}
this.data =
data.length > 5 ? data.slice(0, this.options.maxLength) : data;
this.view = getCardView(this);
return this;
}
setListeners() {
on(this.elContainer, "click", this.cardClickHandler);
on(this.elContainer, "click", this.circleClickHandler);
if (this.options.animSpriteIndexArr) {
for (const cardIndex of this.options.animSpriteIndexArr) {
on(
this.cardContainers[cardIndex],
"mouseover",
this.spriteAnimOverHandler
);
}
}
on(this.elContainer, "mouseout", this.spriteAnimOutHandler);
}
makeElementVariables() {
this.cardContainers = findChildren(
this.elContainer,
`.${this.CLASS_CARD}`
);
this.cardImgs = findChildren(this.elContainer, `.${this.CLASS_IMG}`);
this.circleContainers = findChildren(
this.elContainer,
`.${this.CLASS_CIRCLE_CONTAINER}`
);
this.circles = [];
for (const circleContainer of [...this.circleContainers]) {
this.circles = this.circles.concat([...circleContainer.children]);
}
}
cardClickHandler(e) {
const targetCard = e.target.parentElement;
if (!containClass(targetCard, this.CLASS_CARD)) {
return;
}
const cardIndex = getAttribute(targetCard, this.ATTR_CARD_INDEX);
const circleIndex = (() => {
let acc = 0;
for (let i = 0; i < cardIndex; i++) {
acc += this.data[i].items;
}
return acc;
})();
this.applyCardFocus(cardIndex);
this.applyCircleFocus(circleIndex);
console.log(circleIndex);
if (this.circleChangeHandler) {
this.circleChangeHandler(circleIndex);
}
}
circleClickHandler(e) {
const targetCircleContainer = e.target.parentElement;
if (!containClass(targetCircleContainer, this.CLASS_CIRCLE_CONTAINER)) {
return;
}
const { target } = e;
const circleIndex = getAttribute(target, this.ATTR_CIRCLE_INDEX);
this.applyCircleFocus(circleIndex);
if (this.circleChangeHandler) {
this.circleChangeHandler(circleIndex);
}
}
isNotImgInCard(target, targetCard) {
// is not focus card and didn't start play animation
return (
!containClass(targetCard, this.CLASS_CARD) ||
containClass(target, this.CLASS_IMG_SPRITE_PLAY) ||
!containClass(target, this.CLASS_IMG) ||
this.focusCard === targetCard
);
}
isNotSpriteAnimation(target, targetCard) {
// is card and is not img
return (
containClass(targetCard, this.CLASS_CARD) ||
!containClass(target, this.CLASS_IMG)
);
}
spriteAnimOverHandler(e) {
const { target } = e;
const targetCard = target.parentElement;
if (this.isNotImgInCard(target, targetCard)) {
return;
}
this.curSprite = target;
addClass(this.curSprite, this.CLASS_IMG_SPRITE_PLAY);
}
spriteAnimOutHandler(e) {
const { target } = e;
const targetCard = target.parentElement;
if (!this.isNotSpriteAnimation(target, targetCard)) {
return;
}
if (this.curSprite) {
removeClass(this.curSprite, this.CLASS_IMG_SPRITE_PLAY);
}
}
applyCircleFocus(circleIndex) {
if (this.selectedCircle) {
removeClass(this.selectedCircle, this.CLASS_CIRCLE_SELECTED);
}
this.selectedCircle = this.circles[circleIndex];
addClass(this.selectedCircle, this.CLASS_CIRCLE_SELECTED);
}
applyCardFocus(index) {
if (this.focusCard) {
removeClass(this.focusCard, this.CLASS_CARD_SCALE_UP);
removeClass(this.focusCardImg, this.CLASS_IMG_SCALE_UP);
}
this.focusCard = this.cardContainers[index];
this.focusCardImg = this.cardImgs[index];
addClass(this.focusCard, this.CLASS_CARD_SCALE_UP);
addClass(this.focusCardImg, this.CLASS_IMG_SCALE_UP);
}
getCardIndexByCircleIndex(circleIndex) {
let result = 0;
let acc = 0;
for (let i = 0; i < this.data.length; i++) {
acc += this.data[i].items;
if (acc > circleIndex) {
result = i;
return result;
}
}
}
followByCircleIndex(circleIndex) {
const cardIndex =
circleIndex === 0
? circleIndex
: this.getCardIndexByCircleIndex(circleIndex);
this.applyCardFocus(cardIndex);
this.applyCircleFocus(circleIndex);
}
setChangeCircleHandler(handler) {
this.circleChangeHandler = handler;
}
}
export default Card;
| 29.896552 | 80 | 0.589821 |
4a6f70188c044f56251083b62a0b50edbbbc9299 | 384 | js | JavaScript | src/components/layouts/Footer.js | Synacten/Koatest | ce102aa5349eee30311438aceac8822d9e48dfbc | [
"MIT"
] | null | null | null | src/components/layouts/Footer.js | Synacten/Koatest | ce102aa5349eee30311438aceac8822d9e48dfbc | [
"MIT"
] | null | null | null | src/components/layouts/Footer.js | Synacten/Koatest | ce102aa5349eee30311438aceac8822d9e48dfbc | [
"MIT"
] | null | null | null | import React from 'react';
import styled from 'styled-components';
export const Footer = () => (
<FooterC>
<footer className="footer">footer</footer>
</FooterC>
);
export const color = 'green';
const FooterC = styled.div`
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%);
display: none;
.footer{
color: ${color};
}
`;
| 16.695652 | 46 | 0.609375 |
4a6fb3e185bc1d7819b0596a8ed8e580cb581b67 | 82 | js | JavaScript | solution_task/index.js | AllDayAlone/summer | 0f413db61b24735844f013f3780c982fc2c25ca0 | [
"MIT"
] | 2 | 2020-07-06T10:19:40.000Z | 2020-07-06T12:29:43.000Z | solution_task/index.js | AllDayAlone/summer | 0f413db61b24735844f013f3780c982fc2c25ca0 | [
"MIT"
] | 33 | 2020-07-06T09:54:39.000Z | 2020-07-16T23:00:28.000Z | solution_task/index.js | AllDayAlone/summer | 0f413db61b24735844f013f3780c982fc2c25ca0 | [
"MIT"
] | 13 | 2020-07-06T08:45:48.000Z | 2020-07-06T10:53:25.000Z | const arr = [1, 2, 3, 4, 5];
console.log((arr=>{
return arr.slice(1)
})(arr))
| 16.4 | 28 | 0.536585 |
4a705da9fd3c3e58f7685a795727b3d901b37323 | 4,829 | js | JavaScript | templates/server_my/WorldOfRoach/bin-debug/nodep/view/container/GameWindow.js | xiemingzhang/gulp-my | 75412a383c17764f07355d2ce341cdd2c540e12b | [
"MIT"
] | null | null | null | templates/server_my/WorldOfRoach/bin-debug/nodep/view/container/GameWindow.js | xiemingzhang/gulp-my | 75412a383c17764f07355d2ce341cdd2c540e12b | [
"MIT"
] | null | null | null | templates/server_my/WorldOfRoach/bin-debug/nodep/view/container/GameWindow.js | xiemingzhang/gulp-my | 75412a383c17764f07355d2ce341cdd2c540e12b | [
"MIT"
] | null | null | null | var __reflect = (this && this.__reflect) || function (p, c, t) {
p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/**
* 游戏通用的界面,继承之后可以通过GameWindow进行管理
* 1.01:
* 界面的缩放不影响布局效果
* @author nodep
* @version 1.01
*/
var GameWindow = (function (_super) {
__extends(GameWindow, _super);
function GameWindow() {
var _this = _super !== null && _super.apply(this, arguments) || this;
/**
*所屬層級,需要在業務中自定義
*/
_this.layerType = "";
//非初次加入舞台
_this.__inited = false;
//布局方式
_this.__align = "NONE";
_this.__offsetX = 0;
_this.__offsetY = 0;
/**
* 是否有遮罩
*/
_this.pop = false;
return _this;
}
GameWindow.prototype.partAdded = function (partName, instance) {
instance.name = partName;
_super.prototype.partAdded.call(this, partName, instance);
};
GameWindow.prototype.childrenCreated = function () {
_super.prototype.childrenCreated.call(this);
this.visible = true;
this.resize();
};
/**
*再次加入舞臺
*/
GameWindow.prototype.reOpen = function () {
this.visible = true;
};
/**
* 捕获到对应的通知
*/
GameWindow.prototype.update = function (updateType, updateObject) {
};
/**
* 关闭界面之前
* 如果要添加关闭动画则在实现中返回false,并实现自己的关闭动画。则关闭动画完成后彻底移除。
*/
GameWindow.prototype.beforeClose = function () {
return true;
};
/**
* 舞台大小发生变化
*/
GameWindow.prototype.resize = function () {
switch (this.__align) {
case AlignType.TOP_LEFT:
this.x = this.__offsetX;
this.y = this.__offsetY;
break;
case AlignType.TOP_CENTER:
this.x = (WinsManager.stageWidth - this.width * this.scaleX) / 2 + this.__offsetX;
this.y = this.__offsetY;
break;
case AlignType.TOP_RIGHT:
this.x = WinsManager.stageWidth - this.width * this.scaleX + this.__offsetX;
this.y = this.__offsetY;
break;
case AlignType.CENTER:
this.x = (WinsManager.stageWidth - this.width * this.scaleX) / 2 + this.__offsetX;
this.y = (WinsManager.stageHeight - this.height * this.scaleY) / 2 + this.__offsetY;
break;
case AlignType.BOTTOM_LEFT:
this.x = this.__offsetX;
this.y = WinsManager.stageHeight - this.height * this.scaleY + this.__offsetY;
break;
case AlignType.BOTTOM_CENTER:
this.x = this.x = (WinsManager.stageWidth - this.width * this.scaleX) / 2 + this.__offsetX;
this.y = WinsManager.stageHeight - this.height * this.scaleY + this.__offsetY;
break;
case AlignType.BOTTOM_RIGHT:
this.x = WinsManager.stageWidth - this.width * this.scaleX + this.__offsetX;
this.y = WinsManager.stageHeight - this.height * this.scaleY + this.__offsetY;
break;
}
};
/**
* 设置布局方式
*/
GameWindow.prototype.align = function (alignType, offsetX, offsetY) {
if (offsetX === void 0) { offsetX = 0; }
if (offsetY === void 0) { offsetY = 0; }
this.__align = alignType;
this.__offsetX = offsetX * this.scaleX;
this.__offsetY = offsetY * this.scaleY;
if (this.stage != null)
this.resize();
};
/**
* 为自己的子对象增加事件监听:点击
* 可传数组或字符串
*/
GameWindow.prototype.addEventTap = function (args) {
switch (typeof args) {
case "string":
this.getChildByName(args).addEventListener(egret.TouchEvent.TOUCH_TAP, this.eventTapHandler, this);
break;
case "object":
var key;
for (key in args) {
this.getChildByName(args[key]).addEventListener(egret.TouchEvent.TOUCH_TAP, this.eventTapHandler, this);
}
break;
default:
throw (new Error(NodepErrorType.PARAM_TYPE_ERROR));
}
};
/**
* tap响应函数
*/
GameWindow.prototype.tapCallback = function (childName) {
};
GameWindow.prototype.eventTapHandler = function (evt) {
this.tapCallback(evt.currentTarget.name);
};
return GameWindow;
}(eui.Component));
__reflect(GameWindow.prototype, "GameWindow");
//# sourceMappingURL=GameWindow.js.map | 34.492857 | 124 | 0.553945 |
4a727ab083291c00f1bf2ad9f72fce19135b3756 | 663 | js | JavaScript | website/gatsby-browser.js | Right-Angle-Engineering/mui-treasury | 567374bce3895e96c1b18c138a39731e4b98b683 | [
"MIT"
] | 2,063 | 2019-03-16T14:24:13.000Z | 2022-03-31T10:43:04.000Z | website/gatsby-browser.js | Right-Angle-Engineering/mui-treasury | 567374bce3895e96c1b18c138a39731e4b98b683 | [
"MIT"
] | 760 | 2019-03-16T17:12:32.000Z | 2022-03-30T08:04:12.000Z | website/gatsby-browser.js | Right-Angle-Engineering/mui-treasury | 567374bce3895e96c1b18c138a39731e4b98b683 | [
"MIT"
] | 168 | 2019-03-18T17:41:09.000Z | 2022-03-25T22:11:03.000Z | import React from 'react';
import ReactDOM from 'react-dom';
import App from './src/App';
import RouterContext from './src/contexts/router';
export const wrapPageElement = ({ element, props }) => {
return (
<RouterContext.Provider
value={{ navigate: props.navigate, location: props.location }}
>
<App {...props}>{element}</App>
</RouterContext.Provider>
);
};
// todo: find a better solution, will hit performance issue with React17
// https://github.com/gatsbyjs/gatsby/discussions/17914
export function replaceHydrateFunction() {
return (element, container, callback) => {
ReactDOM.render(element, container, callback)
}
}
| 28.826087 | 72 | 0.695324 |
4a72d80d5aeb80c30e75fc8dcb9f0edb7439256e | 24,542 | js | JavaScript | docs/7.bundle.js | mfakhrusy/ecommerceJS | 92f2b6ac3a613336c364cb731578ff1af8e76042 | [
"MIT"
] | null | null | null | docs/7.bundle.js | mfakhrusy/ecommerceJS | 92f2b6ac3a613336c364cb731578ff1af8e76042 | [
"MIT"
] | null | null | null | docs/7.bundle.js | mfakhrusy/ecommerceJS | 92f2b6ac3a613336c364cb731578ff1af8e76042 | [
"MIT"
] | 1 | 2018-12-11T04:43:59.000Z | 2018-12-11T04:43:59.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{445:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(6),a=n(535),u=(o=a)&&o.__esModule?o:{default:o};var i=(0,r.connect)(function(e){return{ownuser:e.ownuser,profileModal:e.profileModal,isModalOpen:e.isModalOpen}})(u.default);t.default=i},450:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconButton=t.FloatingButton=t.RaisedButton=t.FlatButton=t.Button=void 0;var o=l(n(84)),r=l(n(464)),a=l(n(463)),u=l(n(462)),i=l(n(453));function l(e){return e&&e.__esModule?e:{default:e}}t.default=o.default,t.Button=o.default,t.FlatButton=r.default,t.RaisedButton=a.default,t.FloatingButton=u.default,t.IconButton=i.default},451:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=f(n(0)),a=n(20),u=f(n(1)),i=f(n(157)),l=f(n(13));function f(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"render",value:function(){var e=this;return r.default.createElement(l.default,{className:this.props.className,onClick:function(){e.props.history.push("/")}},r.default.createElement(i.default,{height:30,width:30}))}}]),t}();c.propTypes={className:u.default.string.isRequired,history:u.default.object.isRequired},t.default=(0,a.withRouter)(c)},452:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1)),a=i(n(450)),u=i(n(87));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){var t=e.inset,n=e.fixed,r=e.nav,a=e.title,i=e.actions;return o.default.createElement(u.default,{className:"ViewNavbar",id:"view-navbar",inset:t,fixed:n,nav:r,title:""===a?"":o.default.createElement("div",{className:"ViewNavbarTitle"},a),actions:i})};l.defaultProps={inset:!1,fixed:!1,nav:o.default.createElement(a.default,{icon:!0},"menu"),title:"",actions:o.default.createElement(a.default,{icon:!0},"more_vert")},l.propTypes={inset:r.default.bool,fixed:r.default.bool,nav:r.default.element,title:r.default.oneOfType([r.default.string,r.default.element]),actions:r.default.oneOfType([r.default.element,r.default.arrayOf(r.default.element)])},t.default=l},453:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),u=d(a),i=d(n(2)),l=d(n(85)),f=d(n(25)),c=d(n(159)),s=d(n(84));function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.PureComponent),r(t,[{key:"render",value:function(){var e=this.props,t=e.iconClassName,n=e.children,r=e.tooltip,a=e.floating,i=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["iconClassName","children","tooltip","floating"]);return delete i.tooltipLabel,delete i.tooltipPosition,u.default.createElement(s.default,o({},i,{icon:!a,floating:a}),r,u.default.createElement(f.default,{iconClassName:t},n))}}]),t}();p.propTypes={iconClassName:i.default.string,children:i.default.node,className:i.default.string,type:i.default.string,disabled:i.default.bool,href:i.default.string,onClick:i.default.func,tooltipLabel:i.default.node,tooltipPosition:i.default.oneOf(["top","right","bottom","left"]),tooltipDelay:i.default.number,tooltip:i.default.node,floating:i.default.bool,deprecated:(0,l.default)("The behavior of the `IconButton` can be achieved with the `Button` component without the additional bundle size. Switch to the `Button` component and add a prop `icon`.")},p.defaultProps={type:"button"},t.default=(0,c.default)(p)},454:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=s(n(0)),a=s(n(1)),u=s(n(88)),i=s(n(158)),l=s(n(450)),f=s(n(452)),c=s(n(4));function s(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={isVisible:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"componentDidMount",value:function(){void 0!==this.props.pathname&&this.setState({isVisible:!0})}},{key:"render",value:function(){var e,t,n,o=(0,c.default)((e={"view-paper":!0,"view-fixed":this.props.fixed,"view-inset":this.props.inset},t=this.props.className,n=!!this.props.className,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e));return r.default.createElement(u.default,{className:"Views",type:u.default.DrawerTypes.TEMPORARY,defaultVisible:!0,position:"right"},r.default.createElement(f.default,{inset:this.props.inset,fixed:this.props.fixed,nav:this.props.nav,title:this.props.title,actions:this.props.actions}),r.default.createElement(i.default,{className:o},this.props.children))}}]),t}();d.defaultProps={inset:!1,fixed:!1,className:"",nav:r.default.createElement(l.default,{icon:!0},"menu"),title:"",actions:r.default.createElement(r.default.Fragment,null)},d.propTypes={children:a.default.element.isRequired,pathname:a.default.string.isRequired,nav:a.default.element,title:a.default.oneOfType([a.default.string,a.default.element]),actions:a.default.oneOfType([a.default.string,a.default.element,a.default.arrayOf(a.default.element)]),className:a.default.string,fixed:a.default.bool,inset:a.default.bool},t.default=d},455:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(6),a=n(454),u=(o=a)&&o.__esModule?o:{default:o},i=n(86);var l=(0,r.connect)(function(e){return{isSidebarOpen:e.isSidebarOpen}},function(e){return{onClick:function(t){e((0,i.showSidebar)(t))}}})(u.default);t.default=l},462:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),u=s(a),i=s(n(2)),l=s(n(4)),f=s(n(85)),c=s(n(453));function s(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.PureComponent),r(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.fixed,r=e.mini,a=e.children,i=e.iconClassName,f=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["className","fixed","mini","children","iconClassName"]);return u.default.createElement(c.default,o({},f,{className:(0,l.default)({"md-btn--floating-fixed":n,"md-btn--floating-mini":r},t),iconClassName:i,floating:!0}),a)}}]),t}();d.propTypes={iconClassName:i.default.string,children:i.default.node,className:i.default.string,type:i.default.string,disabled:i.default.bool,href:i.default.string,onClick:i.default.func,tooltipLabel:i.default.node,tooltipPosition:i.default.oneOf(["top","right","bottom","left"]),tooltipDelay:i.default.number,fixed:i.default.bool,mini:i.default.bool,primary:i.default.bool,secondary:i.default.bool,deprecated:(0,f.default)("The behavior of the `FloatingButton` can be achieved with the `Button` component without the additional bundle size. Switch to the `Button` component and add a prop `floating`.")},t.default=d},463:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),u=c(a),i=c(n(2)),l=c(n(85)),f=c(n(84));function c(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.PureComponent),r(t,[{key:"render",value:function(){return u.default.createElement(f.default,o({},this.props,{raised:!0}))}}]),t}();s.propTypes={label:i.default.node.isRequired,className:i.default.string,iconBefore:i.default.bool,children:i.default.node,type:i.default.string,primary:i.default.bool,secondary:i.default.bool,disabled:i.default.bool,href:i.default.string,onClick:i.default.func,deprecated:(0,l.default)("The behavior of the `RaisedButton` can be achieved with the `Button` component without the additional bundle size. Switch to the `Button` component and add a prop `raised`.")},s.defaultProps={type:"button",iconBefore:!0},t.default=s},464:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),u=c(a),i=c(n(2)),l=c(n(85)),f=c(n(84));function c(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.PureComponent),r(t,[{key:"render",value:function(){return u.default.createElement(f.default,o({},this.props,{flat:!0}))}}]),t}();s.propTypes={label:i.default.node.isRequired,className:i.default.string,iconBefore:i.default.bool,children:i.default.node,type:i.default.string,primary:i.default.bool,secondary:i.default.bool,disabled:i.default.bool,href:i.default.string,onClick:i.default.func,deprecated:(0,l.default)("The behavior of the `FlatButton` can be achieved with the `Button` component without the additional bundle size. Switch to the `Button` component and add a prop `flat`.")},s.defaultProps={type:"button",iconBefore:!0},t.default=s},526:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=f(n(0)),a=f(n(1)),u=f(n(167)),i=f(n(166)),l=f(n(165));function f(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={descriptionIsOpen:!1},e.showDescription=e.showDescription.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"showDescription",value:function(e){this.setState({descriptionIsOpen:e})}},{key:"render",value:function(){return r.default.createElement(l.default,{className:"ProfileModal"},r.default.createElement(i.default,{homeItem:this.props.favoriteItem,descriptionIsOpen:this.state.descriptionIsOpen}),r.default.createElement(u.default,{showDescription:this.showDescription,homeItem:this.props.favoriteItem,descriptionIsOpen:this.state.descriptionIsOpen}))}}]),t}();c.propTypes={favoriteItem:a.default.object.isRequired},t.default=c},527:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),r=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(e){var t=e.ownuser;return o.default.createElement("h2",null,t.name+", "+t.location)};u.propTypes={ownuser:r.default.object.isRequired},t.default=u},528:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProfileModal=void 0;var o=n(7);t.setProfileModal=function(e){return{type:o.SET_PROFILE_MODAL,profileModal:e}}},529:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=l(n(0)),a=l(n(1)),u=l(n(46)),i=l(n(168));function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.handleClick=e.handleClick.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"handleClick",value:function(e){this.props.setProfileModal(e),this.props.showModal(!0)}},{key:"render",value:function(){var e=this;return r.default.createElement(i.default,{className:"TabFavorite"},this.props.favoriteItems.map(function(t){return r.default.createElement(r.default.Fragment,{key:t.id},r.default.createElement(u.default,{className:"TabFavoriteItem",onClick:function(){return e.handleClick(t)},onKeyPress:function(){return e.handleClick(t)},role:"button",tabIndex:"0"},r.default.createElement("img",{src:t.imageUrl,alt:"favorite-"+t.id})))}))}}]),t}();f.propTypes={favoriteItems:a.default.arrayOf(a.default.object).isRequired,setProfileModal:a.default.func.isRequired,showModal:a.default.func.isRequired},t.default=f},530:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(6),a=n(529),u=(o=a)&&o.__esModule?o:{default:o},i=n(528),l=n(49);var f=(0,r.connect)(function(e){return{favoriteItems:e.favoriteItems}},function(e){return{setProfileModal:function(t){e((0,i.setProfileModal)(t))},showModal:function(t){e((0,l.showModal)(t))}}})(u.default);t.default=f},531:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=i(n(0)),a=n(509),u=i(n(530));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={tabMenuItems:["SELLING","SOLD","FAVORITES"]},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"render",value:function(){var e=this.state.tabMenuItems;return r.default.createElement(a.TabsContainer,{themed:!0,className:"ProfileTabMenu"},r.default.createElement(a.Tabs,{inactiveTabClassName:"md-text--secondary",mobile:!0,tabId:"profile-tab-menu"},r.default.createElement(a.Tab,{label:e[0]}),r.default.createElement(a.Tab,{label:e[1]}),r.default.createElement(a.Tab,{label:e[2]},r.default.createElement(u.default,null))))}}]),t}();t.default=l},532:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),r=a(n(170));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return o.default.createElement(r.default,{className:"ProfileHeaderAvatar"})}},533:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=i(n(0)),a=i(n(46)),u=i(n(532));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"render",value:function(){return r.default.createElement(a.default,{className:"ProfileHeader",id:"profile-header"},r.default.createElement(u.default,null))}}]),t}();t.default=l},534:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=u(n(0)),r=u(n(533)),a=u(n(531));function u(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return o.default.createElement(o.default.Fragment,null,o.default.createElement(r.default,null),o.default.createElement(a.default,null))}},535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=d(n(0)),a=n(20),u=d(n(1)),i=d(n(534)),l=d(n(527)),f=d(n(451)),c=d(n(455)),s=d(n(526));function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.Component),o(t,[{key:"render",value:function(){return r.default.createElement(r.default.Fragment,null,r.default.createElement(c.default,{fixed:!0,pathname:this.props.location.pathname,className:"Profile",nav:r.default.createElement(f.default,null),title:r.default.createElement(l.default,{ownuser:this.props.ownuser})},r.default.createElement(i.default,null)),this.props.isModalOpen?r.default.createElement(s.default,{favoriteItem:this.props.profileModal}):"")}}]),t}();p.propTypes={location:u.default.object.isRequired,ownuser:u.default.object.isRequired,profileModal:u.default.object.isRequired,isModalOpen:u.default.bool.isRequired},t.default=(0,a.withRouter)(p)}}]);
//# sourceMappingURL=7.bundle.js.map | 12,271 | 24,505 | 0.733966 |
4a73776a9bf9424f9deca7f864a0ce48fdf7627c | 500 | js | JavaScript | check.js | iilab/metalsmith-pandoc | b11af9faa9856e42ca6c1609475ee3cd5a0ca9d3 | [
"MIT"
] | 8 | 2015-05-26T23:29:15.000Z | 2021-05-18T14:10:11.000Z | check.js | iilab/metalsmith-pandoc | b11af9faa9856e42ca6c1609475ee3cd5a0ca9d3 | [
"MIT"
] | 10 | 2015-01-26T00:59:12.000Z | 2017-11-28T23:34:35.000Z | check.js | iilab/metalsmith-pandoc | b11af9faa9856e42ca6c1609475ee3cd5a0ca9d3 | [
"MIT"
] | 8 | 2015-11-07T07:09:40.000Z | 2018-05-04T04:06:39.000Z | var debug = require('debug')('metalsmith-pandoc');
var which = require('which');
var install = require('system-install')();
// Make sure pandoc is installed
which('pandoc', function(err, cmd){
if (err) {
// TODO: ask user to accept installation via system package manager.
console.error('metalsmith-pandoc: ERROR, pandoc not found.');
console.error('Install pandoc on your system with `' + install + ' pandoc`.');
process.exit(1);
}
debug('Found pandoc: ' + cmd)
});
| 33.333333 | 82 | 0.654 |
4a73ef7229e3df2cc2a21b14dbd1fabeb314a062 | 4,286 | js | JavaScript | src/components/contact/contact-form.js | SamCook19/canyoncreekapp | ca5f0867035f61a1638898188839b14336a90d85 | [
"MIT"
] | null | null | null | src/components/contact/contact-form.js | SamCook19/canyoncreekapp | ca5f0867035f61a1638898188839b14336a90d85 | [
"MIT"
] | null | null | null | src/components/contact/contact-form.js | SamCook19/canyoncreekapp | ca5f0867035f61a1638898188839b14336a90d85 | [
"MIT"
] | null | null | null | import React from 'react';
import { useForm } from 'react-hook-form';
import emailjs from 'emailjs-com';
import 'react-toastify/dist/ReactToastify.min.css';
export default function ContactForm() {
function sendEmail(e) {
e.preventDefault();
emailjs.sendForm('service_513nv6e', 'template_t241g0h', e.target, 'user_VfVWKG6WCJ4vDEdQkClCo')
.then((result) => {
console.log(result.text);
}, (error) => {
console.log(error.text);
});
e.target.reset()
}
return (
<div className='ContactForm'>
<div className="disclaimer">
If you or someone you know is in need of supportive services related to domestic violence or sexual assault, please either contact our 24 hour hotline at 435-233-5732 for immediate assistance or complete <a href="https://apricot.socialsolutions.com/auth/autologin/org_id/1698/hash/fe63cfb2b7190a8b89cde77419b8d89c5af6ee4e">this</a> form and a member of our team will contact you as soon as possible.
</div>
<div className='container'>
<div className='row'>
<div className='col-12 text-center'>
<div className='contactForm'>
<form id='contact-form' onSubmit={sendEmail}>
{/* Row 1 of form */}
<div className='row formRow'>
<div className='col-6'>
<input
type='text'
name='name'
className='name-area'
placeholder='Name'
></input>
</div>
<div className='col-6'>
<input
type='email'
name='email'
className='email-area'
placeholder='Email address'
></input>
</div>
<div className='emaildropdown'>
<label for="emails">Who Would You Like To Reach?</label>
<select id='emails'
type='to'
name='recipient'
className='form-dropdown'
placeholder='recipient address'>
<option value="prevention@canyoncreekservices.org">Community Outreach/ Education/Awareness/Prevention</option>
<option value="administration@canyoncreekservices.org">General Organizational Information/ Administration/Executive Director</option>
<option value="development@canyoncreekservices.org">Fundraising/Donations</option>
<option value="volunteers@canyoncreekservices.org">Volunteering/Internships/Service Projects</option>
<option value="business@canyoncreekservices.org"> Human Resources/Billing/Accounts/Grant Reporting</option>
<option value="board@canyoncreekservices.org">Board of Directors</option>
<option value="ciarra@canyoncreekservices.org">Help For Survivors/Shelter</option>
</select>
</div>
</div>
{/* Row 2 of form */}
<div className='row formRow'>
<div className='col'>
<input
type='text'
name='subject'
className='subject-area'
placeholder='Subject'
></input>
</div>
</div>
{/* Row 3 of form */}
<div className='row formRow'>
<div className='col'>
<textarea className='message-area'
rows={3}
name='message'
placeholder='Message'
></textarea>
</div>
</div>
<div className='submit-contact'>
<button className='submit-btn' type='submit'>
Submit
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
);
};
| 40.819048 | 413 | 0.491834 |
4a7461466510ad16457a816d78f7976be5b0e02e | 62 | js | JavaScript | server/utils/roles.js | ibobev/dent-appointment-system | 2fcda99dbc72917a5f6c97428cbb6b22c500a999 | [
"MIT"
] | null | null | null | server/utils/roles.js | ibobev/dent-appointment-system | 2fcda99dbc72917a5f6c97428cbb6b22c500a999 | [
"MIT"
] | null | null | null | server/utils/roles.js | ibobev/dent-appointment-system | 2fcda99dbc72917a5f6c97428cbb6b22c500a999 | [
"MIT"
] | null | null | null | module.exports = {
ADMIN: 1,
DENTIST: 2,
PATIENT: 3,
};
| 10.333333 | 18 | 0.564516 |
4a7801fb6ee0894b5c3649786a9317d3adb2478e | 1,650 | js | JavaScript | gulpfile.js | Javilete/front-end-rural-house | 8ca833da3092db47fa0256dbd64a7736c3ea9502 | [
"Apache-2.0"
] | null | null | null | gulpfile.js | Javilete/front-end-rural-house | 8ca833da3092db47fa0256dbd64a7736c3ea9502 | [
"Apache-2.0"
] | null | null | null | gulpfile.js | Javilete/front-end-rural-house | 8ca833da3092db47fa0256dbd64a7736c3ea9502 | [
"Apache-2.0"
] | null | null | null | // Grab our gulp packages
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
//var sass = require('gulp-sass');
var annotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var argv = require('yargs').argv;
var gulpif = require('gulp-if');
var rename = require('gulp-rename');
// Create a default task
gulp.task('default', ['watch']);
// Configure the jshint task
gulp.task('jshint', function(){
return gulp.src('public/javascripts/application/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
// Configure the css build from sass
//gulp.task('build-css', function() {
// return gulp.src('public/stylesheets/scss/**/*.scss')
// .pipe(sass())
// .pipe(gulp.dest('./app/assets/stylesheets'));
//});
// Configur uglify for js just in production
gulp.task('build-js', function() {
return gulp.src('public/javascripts/application/**/*.js')
.pipe(gulpif(argv.production), uglify({magle: true}))
.pipe(gulp.dest('./app/assets/javascript'));
});
// configure which files to watch and what tasks to use on file changes
gulp.task('watch', function() {
gulp.watch('public/javascripts/application/**/*.js', ['jshint']);
gulp.watch('public/stylesheets/scss/**/*.scss', ['build-css']);
});
gulp.task('ngAnnotate', function() {
return gulp.src('public/javascripts/application/**/*.js')
.pipe(annotate({add:true, single_quotes: true}))
// .pipe(rename(function(path){
// path.extname = '.annotated.js';
// }))
.pipe(gulp.dest('./app/assets/javascript'));
}); | 32.352941 | 71 | 0.635152 |
4a78fb4ecb99f5b8e9ef78e1b65f1c66bd2869bf | 299 | js | JavaScript | wiki/html/search/functions_a.js | cesclass/projetL2S3 | fb97f80cb7f2e43a0dd56914988ef52a59376128 | [
"MIT"
] | null | null | null | wiki/html/search/functions_a.js | cesclass/projetL2S3 | fb97f80cb7f2e43a0dd56914988ef52a59376128 | [
"MIT"
] | null | null | null | wiki/html/search/functions_a.js | cesclass/projetL2S3 | fb97f80cb7f2e43a0dd56914988ef52a59376128 | [
"MIT"
] | null | null | null | var searchData=
[
['pickeltlist',['pickEltList',['../liste_8h.html#ab925256fc1775b71a5986418101f09f3',1,'pickEltList(liste l, Elementliste *e, int index): liste.c'],['../liste_8c.html#ab925256fc1775b71a5986418101f09f3',1,'pickEltList(liste l, Elementliste *e, int index): liste.c']]]
];
| 59.8 | 277 | 0.73913 |
4a79043a4df1526fc5453a8549d07f80c37e9a1f | 2,826 | js | JavaScript | node_modules/caniuse-lite/data/regions/ES.js | grodriguez-dev/curso-ibero-learning | 99f2e3354b8f413b9c147224db5b3b79b73bc8ab | [
"MIT"
] | 34 | 2021-09-25T02:16:58.000Z | 2022-01-07T07:52:52.000Z | node_modules/caniuse-lite/data/regions/ES.js | grodriguez-dev/curso-ibero-learning | 99f2e3354b8f413b9c147224db5b3b79b73bc8ab | [
"MIT"
] | 102 | 2021-02-02T20:46:33.000Z | 2021-07-20T12:31:18.000Z | node_modules/caniuse-lite/data/regions/ES.js | janis-jenny/MyPortfolio | ea1905ac0a76358baa378d62ce1ce0fade04ec3f | [
"MIT"
] | 13 | 2021-09-27T02:25:34.000Z | 2021-12-09T03:00:01.000Z | module.exports={C:{"45":0.00484,"48":0.01451,"49":0.00484,"52":0.10641,"55":0.00484,"56":0.00484,"59":0.00484,"60":0.02419,"63":0.00484,"64":0.00484,"66":0.01451,"67":0.01451,"68":0.01935,"69":0.01451,"72":0.00967,"73":0.00484,"76":0.00484,"77":0.00484,"78":0.25636,"79":0.00967,"80":0.00967,"81":0.00967,"82":0.00967,"83":0.00967,"84":0.04837,"85":0.01935,"86":0.01935,"87":0.02902,"88":0.56593,"89":2.63133,"90":0.01451,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 50 51 53 54 57 58 61 62 65 70 71 74 75 91 3.5 3.6"},D:{"38":0.01935,"49":0.31924,"53":0.01935,"54":0.07739,"56":0.00967,"57":0.00484,"58":0.00967,"61":0.1693,"63":0.01451,"64":0.00967,"65":0.02419,"66":0.01935,"67":0.01935,"68":0.00967,"69":0.02902,"70":0.02419,"71":0.00967,"72":0.01451,"73":0.01451,"74":0.02902,"75":0.09674,"76":0.02902,"77":0.02419,"78":0.02902,"79":0.14995,"80":0.05321,"81":0.05804,"83":0.05804,"84":0.07256,"85":0.06288,"86":0.12576,"87":0.32892,"88":0.12576,"89":0.34826,"90":4.23721,"91":25.53452,"92":0.01935,"93":0.00967,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 50 51 52 55 59 60 62 94"},F:{"36":0.00484,"75":0.42566,"76":0.55626,"77":0.21767,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},E:{"4":0,"12":0.01451,"13":0.09674,"14":1.4511,_:"0 5 6 7 8 9 10 11 15 3.1 3.2 6.1 7.1","5.1":0.01935,"9.1":0.00484,"10.1":0.01935,"11.1":0.07739,"12.1":0.09674,"13.1":0.42566,"14.1":1.7123},G:{"8":0.0021,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00421,"6.0-6.1":0.00315,"7.0-7.1":0.01051,"8.1-8.4":0.01262,"9.0-9.2":0.00526,"9.3":0.1514,"10.0-10.2":0.05152,"10.3":0.14614,"11.0-11.2":0.04416,"11.3-11.4":0.0389,"12.0-12.1":0.0368,"12.2-12.4":0.13037,"13.0-13.1":0.04311,"13.2":0.01787,"13.3":0.12406,"13.4-13.7":0.36798,"14.0-14.4":3.62933,"14.5-14.7":5.18641},B:{"14":0.00484,"15":0.00484,"16":0.00484,"17":0.00967,"18":0.04353,"84":0.00484,"85":0.00967,"86":0.01935,"87":0.00967,"88":0.00967,"89":0.02902,"90":0.10641,"91":3.33269,_:"12 13 79 80 81 83"},P:{"4":0.14786,"5.0-5.4":0.02112,"6.2-6.4":0.03027,"7.2-7.4":0.57507,"8.2":0.03027,"9.2":0.01056,"10.1":0.01056,"11.1-11.2":0.1373,"12.0":0.07393,"13.0":0.21123,"14.0":2.39746},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.01328,"4.2-4.3":0.00959,"4.4":0,"4.4.3-4.4.4":0.05458},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"9":0.00543,"11":0.65724,_:"6 7 8 10 5.5"},N:{"10":0.42578,"11":0.03849},J:{"7":0,"10":0},O:{"0":0.09293},H:{"0":0.21996},L:{"0":40.04878},S:{"2.5":0},R:{_:"0"},M:{"0":0.29945},Q:{"10.4":0.01549}};
| 1,413 | 2,825 | 0.588464 |
4a7a576e5b2e472af62352934e4f90f1983c4f27 | 162 | js | JavaScript | src/index.js | vimplus/React-tetris-lite | b9a6d115f7876b9e997b26b1270372033b4212e0 | [
"MIT"
] | null | null | null | src/index.js | vimplus/React-tetris-lite | b9a6d115f7876b9e997b26b1270372033b4212e0 | [
"MIT"
] | null | null | null | src/index.js | vimplus/React-tetris-lite | b9a6d115f7876b9e997b26b1270372033b4212e0 | [
"MIT"
] | null | null | null | import React from 'react';
import { render } from 'react-dom';
import Game from './game';
let game = render(
<Game />,
document.getElementById('root')
)
| 18 | 35 | 0.648148 |
4a7b145a94549566029844bfef02991396d1f895 | 185 | js | JavaScript | docs/reference/cmsis-plus/assert_8c.js | micro-os-plus/web-preview | f22c44746b8f346e03363632d7d9c0c34d97b7d6 | [
"MIT"
] | null | null | null | docs/reference/cmsis-plus/assert_8c.js | micro-os-plus/web-preview | f22c44746b8f346e03363632d7d9c0c34d97b7d6 | [
"MIT"
] | 1 | 2016-03-04T10:49:16.000Z | 2016-03-04T10:49:16.000Z | docs/reference/cmsis-plus/assert_8c.js | micro-os-plus/web-preview | f22c44746b8f346e03363632d7d9c0c34d97b7d6 | [
"MIT"
] | 2 | 2016-08-13T15:52:08.000Z | 2018-07-30T16:56:39.000Z | var assert_8c =
[
[ "__assert_func", "assert_8c.html#a620a4f992f76741d22c71a8736391bf6", null ],
[ "assert_failed", "assert_8c.html#a2532ff72b1a2ff82f65e8c2a5a4dde00", null ]
]; | 37 | 82 | 0.745946 |
4a7b530a81227df13ad4394bc8275b2b056eb871 | 3,096 | js | JavaScript | src/parser/script.js | marswong/express-vue-renderer | 9174fa203896dbe698af36685385af6d39879e03 | [
"Apache-2.0"
] | 9 | 2017-07-09T13:07:20.000Z | 2018-06-16T15:35:01.000Z | src/parser/script.js | marswong/express-vue-renderer | 9174fa203896dbe698af36685385af6d39879e03 | [
"Apache-2.0"
] | 121 | 2017-07-06T17:22:39.000Z | 2020-06-03T08:50:39.000Z | src/parser/script.js | marswong/express-vue-renderer | 9174fa203896dbe698af36685385af6d39879e03 | [
"Apache-2.0"
] | 11 | 2017-07-14T23:24:48.000Z | 2017-12-11T14:21:06.000Z | // @flow
const {
DataObject
} = require('../models');
const Utils = require('../utils');
const babel = require('babel-core');
const stringHash = require('string-hash');
type ScriptObjectType = {
type: 'string',
content: 'string',
start: number,
attrs: Object,
end: number
}
function dataMerge(script: Object, defaults: Object, type: string): Object {
let finalScript = {};
for (var element in script) {
if (script.hasOwnProperty(element)) {
if (element === 'data') {
let data = new DataObject(script.data(), defaults.data, type).data;
finalScript[element] = () => data;
} else {
finalScript[element] = script[element];
}
}
}
//FUCK THIS _Ctor property fuck this fucking thing
//fuck you you fucking fuckstick i cant believe this
//is the offical vue-loader fix
if (finalScript.components) {
finalScript = deleteCtor(finalScript);
}
return finalScript;
}
function deleteCtor(script: Object): Object {
for (let component in script.components) {
if (script.components.hasOwnProperty(component)) {
delete script.components[component]._Ctor;
if (script.components[component].components) {
script.components[component] = deleteCtor(script.components[component]);
}
}
}
return script;
}
function scriptParser(scriptObject: ScriptObjectType, defaults: Object, type: string, Cache: Object): Promise < Object > {
return new Promise((resolve, reject) => {
if (!scriptObject && !scriptObject.content) {
reject(new Error('Missing Script block'));
} else {
const options = {
'presets': ['es2015']
};
// caching for babel script string so time spent in babel is reduced
const cacheKey = stringHash(scriptObject.content);
const cachedBabelScript = Cache.get(cacheKey);
if (cachedBabelScript) {
const finalScript = dataMerge(cachedBabelScript, defaults, type);
resolve(finalScript);
} else {
const babelScript = babel.transform(scriptObject.content, options);
// const filename = path.join(defaults.rootPath, '/', defaults.component);
const requireFromStringOptions = {
rootPath: defaults.rootPath,
defaults: defaults
};
Utils.requireFromString(babelScript.code, defaults.component, requireFromStringOptions, Cache)
.then(scriptFromString => {
// set the cache for the babel script string
Cache.set(cacheKey, scriptFromString);
const finalScript = dataMerge(scriptFromString, defaults, type);
resolve(finalScript);
})
.catch(error => reject(error));
}
}
});
}
module.exports = scriptParser;
| 34.4 | 122 | 0.573643 |
4a7beb746fc9dc073323e1af51a7eb249fc48bbe | 636 | js | JavaScript | .eleventy.js | ecaron/ericcaron.com | 2519def26e9cf7c340c3a64ca078d27cb55ddea2 | [
"MIT"
] | null | null | null | .eleventy.js | ecaron/ericcaron.com | 2519def26e9cf7c340c3a64ca078d27cb55ddea2 | [
"MIT"
] | 5 | 2016-11-14T05:45:27.000Z | 2022-02-12T17:11:33.000Z | .eleventy.js | ecaron/ericcaron.com | 2519def26e9cf7c340c3a64ca078d27cb55ddea2 | [
"MIT"
] | null | null | null | const smartquotes = require('smartquotes');
const less = require('less');
const CleanCSS = require('clean-css');
module.exports = function (config) {
config.addNunjucksAsyncFilter('cssmin', function(code, callback) {
less.render(code, {}, function(error, output) {
let minCSS = new CleanCSS({}).minify(output.css).styles;
return callback(null, minCSS);
});
});
config.addFilter('smartquotes', string => {
return smartquotes(string);
});
config.addPassthroughCopy('src/assets');
return {
dir: {
input: 'src'
},
templateFormats: ['njk', 'md', 'css', 'js', 'html', 'txt']
};
};
| 23.555556 | 68 | 0.625786 |
4a7ce9842e5d5f75e7af28d7f03c3cee0958da5e | 5,205 | js | JavaScript | lib/HttpClient.js | Magiccwl/bce-sdk-mp | 7aec203769162a463603d113160534be3cb5acf8 | [
"MIT"
] | null | null | null | lib/HttpClient.js | Magiccwl/bce-sdk-mp | 7aec203769162a463603d113160534be3cb5acf8 | [
"MIT"
] | null | null | null | lib/HttpClient.js | Magiccwl/bce-sdk-mp | 7aec203769162a463603d113160534be3cb5acf8 | [
"MIT"
] | null | null | null | import axios from 'axios'
import EventBus from './EventBus'
import Auth from './Auth'
import {
AUTHORIZATION,
CONTENT_TYPE,
X_BCE_DATE,
X_CODE,
X_REQUEST_ID,
X_STATUS_CODE,
X_MESSAGE,
X_HTTP_HEADERS,
X_BODY
} from './headers'
import mpAdapter from './Adapter'
import { getRequest } from './utils'
if (getRequest() !== 'browser') {
axios.defaults.adapter = mpAdapter
}
export default class HttpClient extends EventBus {
constructor (config) {
super()
this.config = config
this._client = axios.create({
baseURL: this.config.endpoint,
headers: {
[CONTENT_TYPE]: 'application/json; charset=UTF-8'
},
onUploadProgress: this.updateProgress.bind(this)
})
}
sendRequest (httpMethod, path, body, headers, params, signFunction) {
httpMethod = httpMethod.toUpperCase()
const options = {
url: path,
method: httpMethod,
params
}
// Prepare the request headers.
options.headers = {
...headers,
[X_BCE_DATE]: new Date().toISOString().replace(/\.\d+Z$/, 'Z')
}
if (typeof signFunction === 'function') {
options.headers[AUTHORIZATION] = signFunction(this.config.credentials, httpMethod, path, params, headers)
} else {
options.headers[AUTHORIZATION] = createSignature(this.config.credentials, httpMethod, path, params, headers)
}
// TODO: unsafe headers 处理
// bce-sdk-js 用的 http(s)-browserify 里面搞了过滤如果是 unsafe 头就不调用 setRequestHeader
// 但是 axios 里面没有处理这个,导致会触发一个 console 报错(但不影响功能),要隐藏这个报错的话就也要实现下这个
// https://github.com/browserify/http-browserify/blob/17b2990010ebd39461d1117c1e2c50c25eab869f/lib/request.js#L44
// https://github.com/axios/axios/blob/ffea03453f77a8176c51554d5f6c3c6829294649/lib/adapters/xhr.js#L132
return this._doRequest(options, body)
}
async _doRequest (options, body) {
let response
try {
response = await this._client.request({
...options,
data: body,
responseType: 'text',
cancelToken: new axios.CancelToken(cancel => {
this._cancelRequest = cancel
})
})
} catch (error) {
if (!error.response) {
return Promise.reject(error)
}
const { status, data, headers } = error.response
if (status >= 100 && status < 200) {
return Promise.reject(failure(status, 'Can not handle 1xx http status code.'))
} else if (status < 100 || status >= 300) {
let responseBody
try {
responseBody = parseHttpResponseBody(data, headers)
} catch (err) {};
if (responseBody.requestId) {
const { message, code, requestId } = responseBody
return Promise.reject(failure(status, message, code, requestId, headers.date))
} else {
return Promise.reject(failure(status, responseBody))
}
}
return Promise.reject(failure(error.response.status, error.message))
}
let data
try {
data = parseHttpResponseBody(response.data, response.headers)
} catch (error) {
return Promise.reject(failure(response.status, error.message))
}
return success(fixHeaders(response.headers), data)
}
cancelRequest (...args) {
if (this._cancelRequest) {
this._cancelRequest(...args)
}
}
updateProgress (progressEvent) {
this.emit('progress', progressEvent)
}
}
function createSignature (credentials, httpMethod, path, params, headers) {
const auth = new Auth(credentials.ak, credentials.sk)
return auth.generateAuthorization(httpMethod, path, params, headers)
}
function fixHeaders (headers = {}) {
return Object.entries(headers).reduce(function (ret, [key, value]) {
value = value.trim()
if (value) {
key = key.toLowerCase()
if (key === 'etag') {
value = value.replace(/"/g, '')
}
ret[key] = value
}
return ret
}, {})
}
function success (httpHeaders, body) {
return {
[X_HTTP_HEADERS]: httpHeaders,
[X_BODY]: body
}
}
function failure (statusCode, message, code, requestId, xBceDate) {
const response = {
[X_STATUS_CODE]: statusCode,
[X_MESSAGE]: message
}
if (code) {
response[X_CODE] = code
}
if (requestId) {
response[X_REQUEST_ID] = requestId
}
if (xBceDate) {
response[X_BCE_DATE] = xBceDate
}
return response
}
function parseHttpResponseBody (raw, headers) {
const contentType = headers['content-type']
if (!raw || !raw.length) {
return {}
} else if (contentType && /^(application|text)\/json$/i.test(contentType)) {
return JSON.parse(raw)
}
return raw
}
| 29.742857 | 121 | 0.570989 |
4a7e363bbc8e5e09664301890403ba08e5b4019b | 935 | js | JavaScript | build/useFlutterwave.js | Wharley01/flutterwave-vue3 | ec8bedbdc9c9bc9e85f989f65c0a5a57c4d9d29c | [
"MIT"
] | 5 | 2021-11-06T01:24:54.000Z | 2022-03-29T12:38:32.000Z | build/useFlutterwave.js | Wharley01/flutterwave-vue3 | ec8bedbdc9c9bc9e85f989f65c0a5a57c4d9d29c | [
"MIT"
] | null | null | null | build/useFlutterwave.js | Wharley01/flutterwave-vue3 | ec8bedbdc9c9bc9e85f989f65c0a5a57c4d9d29c | [
"MIT"
] | null | null | null | "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ApITracker_1 = __importDefault(require("./ApITracker"));
function default_1(paymentData) {
var _a;
console.log({ paymentData });
if (!paymentData.public_key)
throw new Error('Please specify your public key');
let payData = Object.assign(Object.assign({}, paymentData), { public_key: (_a = paymentData.public_key) !== null && _a !== void 0 ? _a : '', callback: (response) => {
(0, ApITracker_1.default)({
paymentData: payData,
response: response,
responseTime: 1000
});
paymentData.callback(response);
} });
// @ts-ignore
window.FlutterwaveCheckout(payData);
}
exports.default = default_1;
| 38.958333 | 170 | 0.613904 |
4a7e6f676894eb49178442066c5bcc6f181fc9ff | 1,061 | js | JavaScript | sources/views/GridCajeros.js | ingjosecruzp/jet-start-master | 3d0ef42a853b008c559965392c7397e6e789c458 | [
"MIT"
] | null | null | null | sources/views/GridCajeros.js | ingjosecruzp/jet-start-master | 3d0ef42a853b008c559965392c7397e6e789c458 | [
"MIT"
] | 4 | 2020-07-16T17:00:29.000Z | 2022-02-12T06:05:05.000Z | sources/views/GridCajeros.js | ingjosecruzp/jet-start-master | 3d0ef42a853b008c559965392c7397e6e789c458 | [
"MIT"
] | null | null | null | import { JetView } from "webix-jet";
import { cajeros } from "models/pventa/cajeros";
import { FrmCajeros } from "views/pventa/FrmCajeros";
import { GridBase } from "views/GridBase";
export default class GridCajeros extends GridBase {
constructor(app, name) {
let columns = [
{ id: "_id", hidden: true },
{ id: "Nombre", MongoField:"Nombre",header: ["Nombre", { content: "textFilter" }], fillspace: true },
{ id: "Usuario", MongoField:"Usuarios.NombreCompleto",template: (obj) => { return obj.Usuarios.NombreCompleto }, header: ["Usuario", { content: "textFilter" }], width: 500 },
];
let cajero = new cajeros();
super(app, name, columns, cajero);
}
init(view) {
this.$$(this.Grid).attachEvent("onItemDblClick", (id, e, node) => {
var item = $$(this.Grid).getItem(id);
console.log("double click");
this.FrmCajeros = this.ui(FrmCajeros);
this.FrmCajeros.showWindow(item._id);
});
super.init(view);
}
} | 36.586207 | 186 | 0.586239 |
4a7eac2518b8498fd733844ff024fe237f6f958f | 1,453 | js | JavaScript | src/createPaginationReducer.js | founderlab/fl-redux-utils | 811447bd840ca9c7d61f01e4f7901b18c38014a8 | [
"MIT"
] | null | null | null | src/createPaginationReducer.js | founderlab/fl-redux-utils | 811447bd840ca9c7d61f01e4f7901b18c38014a8 | [
"MIT"
] | null | null | null | src/createPaginationReducer.js | founderlab/fl-redux-utils | 811447bd840ca9c7d61f01e4f7901b18c38014a8 | [
"MIT"
] | null | null | null | import _ from 'lodash' // eslint-disable-line
import {fromJS} from 'immutable'
export default function createPaginationReducer(actionType, _options={}) {
const defaultState = fromJS({
visible: [],
total: 0,
currentPage: 0,
})
const options = _.defaults(_options, {
append: false,
countSuffix: '_COUNT_SUCCESS',
deleteSuffix: '_DELETE_SUCCESS',
loadSuffix: '_LOAD_SUCCESS',
})
const {countSuffix, deleteSuffix, loadSuffix} = options
return function pagination(_state=defaultState, action={}) {
let state = _state
if (action.type === actionType + countSuffix) {
state = state.merge({total: +action.res})
}
else if (action.type === actionType + deleteSuffix) {
const visible = state.get('visible').toJSON()
state = state.merge({visible: _.without(visible, action.deletedId)})
}
else if (action.type === actionType + loadSuffix && action.page) {
if (options.append && action.page > +state.get('currentPage')) {
// Only append if the page being loaded is higher than the current page
// If a lower number assume it's a refresh and behave as if append was not set
const current = state.get('visible').toJSON()
state = state.merge({visible: current.concat(action.ids), currentPage: action.page})
}
else {
state = state.merge({visible: action.ids, currentPage: action.page})
}
}
return state
}
}
| 30.270833 | 92 | 0.651067 |
4a80f0c52d183c512276677900d307c3f2df946c | 441 | js | JavaScript | extern/Halide/osx/share/doc/Halide/_intrusive_ptr_8h.js | HiDoYa/webassembly-video-filters | 70bcaaaeb94a763988975aa8e1582ed10c2f2c39 | [
"MIT"
] | 5 | 2021-01-15T03:40:25.000Z | 2021-09-05T22:53:38.000Z | extern/Halide/osx/share/doc/Halide/_intrusive_ptr_8h.js | HiDoYa/webassembly-video-filters | 70bcaaaeb94a763988975aa8e1582ed10c2f2c39 | [
"MIT"
] | 1 | 2021-05-05T21:57:46.000Z | 2021-05-05T23:18:06.000Z | extern/Halide/osx/share/doc/Halide/_intrusive_ptr_8h.js | HiDoYa/webassembly-video-filters | 70bcaaaeb94a763988975aa8e1582ed10c2f2c39 | [
"MIT"
] | null | null | null | var _intrusive_ptr_8h =
[
[ "RefCount", "class_halide_1_1_internal_1_1_ref_count.html", "class_halide_1_1_internal_1_1_ref_count" ],
[ "IntrusivePtr", "struct_halide_1_1_internal_1_1_intrusive_ptr.html", "struct_halide_1_1_internal_1_1_intrusive_ptr" ],
[ "ref_count", "_intrusive_ptr_8h.html#abbc100b5bea312321ff79baff93ee558", null ],
[ "destroy", "_intrusive_ptr_8h.html#a11ca920b642ef490aeac2b4e864d6254", null ]
]; | 63 | 125 | 0.78458 |
4a8141e09b3e7095cbeb8f3129b6ee1a8e3979c5 | 197 | js | JavaScript | back-end/database/database.js | simejisan/osip-web-app | 525afdd0a5ea62a5d0b04086dff44843ff5952d8 | [
"MIT"
] | null | null | null | back-end/database/database.js | simejisan/osip-web-app | 525afdd0a5ea62a5d0b04086dff44843ff5952d8 | [
"MIT"
] | null | null | null | back-end/database/database.js | simejisan/osip-web-app | 525afdd0a5ea62a5d0b04086dff44843ff5952d8 | [
"MIT"
] | 2 | 2021-01-01T08:25:12.000Z | 2021-07-19T05:06:27.000Z | const { Client } = require('pg')
const dotenv = require('dotenv');
dotenv.config();
const client = new Client({
connectionString: process.env.DATABASE_URL,
ssl: true
})
module.exports = client | 21.888889 | 45 | 0.71066 |
4a823953fbd6e0577b2064723bebebded7a0a554 | 103 | js | JavaScript | vsdoc/search--/s_610.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | vsdoc/search--/s_610.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | vsdoc/search--/s_610.js | asiboro/asiboro.github.io | a2e56607dca65eed437b6a666dcbc3f586492d8c | [
"MIT"
] | null | null | null | search_result['610']=["topic_0000000000000142.html","PaymentController.AddProductPurchased Method",""]; | 103 | 103 | 0.815534 |
4a82ae0d78671a3253777d9090cf9fde5bb2b9e5 | 901 | js | JavaScript | resources/js/services/booking-service.js | omenejoseph/bookings_app | bca960c2cc29480b075072f88a46e09e08ffd3f3 | [
"MIT"
] | null | null | null | resources/js/services/booking-service.js | omenejoseph/bookings_app | bca960c2cc29480b075072f88a46e09e08ffd3f3 | [
"MIT"
] | 3 | 2021-03-10T10:07:39.000Z | 2022-02-18T22:04:48.000Z | resources/js/services/booking-service.js | omenejoseph/bookings_app | bca960c2cc29480b075072f88a46e09e08ffd3f3 | [
"MIT"
] | null | null | null | import DataService from './data-service';
class BookingService {
listBookings(){
return axios.post('get-bookings', {}, {
headers: DataService.authHeader()
})
.then(response => {
return response.data.data;
})
.catch((error) => Promise.reject(error));
}
createBooking(formData){
return axios.post('booking', {...formData}, {
headers: DataService.authHeader()
})
.then(response => {
return response.data.data;
})
.catch((error) => Promise.reject(error));
}
viewBooking(id){
return axios.post('booking/' + id)
.then(response => {
return response.data.data;
})
.catch((error) => Promise.reject(error));
}
}
export default new BookingService(); | 28.15625 | 57 | 0.498335 |
4a8406467394893f448e129f8261f4d451560492 | 18,015 | js | JavaScript | test/unit/view/dimension-marshal/publish-while-dragging.spec.js | KN878/react-beautiful-dnd | 739d03ea61dba7c3f4414134c40976f12ebdef59 | [
"Apache-2.0"
] | 27,785 | 2017-08-10T07:05:51.000Z | 2022-03-31T22:40:15.000Z | test/unit/view/dimension-marshal/publish-while-dragging.spec.js | KN878/react-beautiful-dnd | 739d03ea61dba7c3f4414134c40976f12ebdef59 | [
"Apache-2.0"
] | 1,823 | 2017-08-10T15:32:53.000Z | 2022-03-30T20:35:29.000Z | test/unit/view/dimension-marshal/publish-while-dragging.spec.js | KN878/react-beautiful-dnd | 739d03ea61dba7c3f4414134c40976f12ebdef59 | [
"Apache-2.0"
] | 2,446 | 2017-08-10T10:16:39.000Z | 2022-03-31T16:52:43.000Z | // @flow
import createDimensionMarshal from '../../../../src/state/dimension-marshal/dimension-marshal';
import type {
Callbacks,
DimensionMarshal,
StartPublishingResult,
} from '../../../../src/state/dimension-marshal/dimension-marshal-types';
import type {
DraggableDimension,
DroppableDimension,
DimensionMap,
Published,
Viewport,
Critical,
} from '../../../../src/types';
import { preset } from '../../../util/preset-action-args';
import { getCallbacksStub } from '../../../util/dimension-marshal';
import { defaultRequest } from './util';
import { makeScrollable } from '../../../util/dimension';
import { setViewport } from '../../../util/viewport';
import getFrame from '../../../../src/state/get-frame';
import type { Registry } from '../../../../src/state/registry/registry-types';
import createRegistry from '../../../../src/state/registry/create-registry';
import {
getDraggableEntry,
getDroppableEntry,
populate,
type DimensionWatcher,
} from '../../../util/registry';
import { origin } from '../../../../src/state/position';
import patchDimensionMap from '../../../../src/state/patch-dimension-map';
import { withWarn } from '../../../util/console';
const viewport: Viewport = preset.viewport;
setViewport(viewport);
const empty: Published = {
removals: [],
additions: [],
modified: [],
};
function makeVirtual(droppable: DroppableDimension): DroppableDimension {
return {
...droppable,
descriptor: {
...droppable.descriptor,
mode: 'virtual',
},
};
}
const scrollableHome: DroppableDimension = makeScrollable(
makeVirtual(preset.home),
);
const scrollableForeign: DroppableDimension = makeScrollable(
makeVirtual(preset.foreign),
);
const withScrollables: DimensionMap = {
draggables: preset.dimensions.draggables,
droppables: {
...preset.dimensions.droppables,
[scrollableHome.descriptor.id]: scrollableHome,
[scrollableForeign.descriptor.id]: scrollableForeign,
},
};
const ofAnotherType: DroppableDimension = {
...preset.foreign,
descriptor: {
type: 'some rogue type',
id: 'another droppable',
mode: 'virtual',
},
};
const inAnotherType: DraggableDimension = {
...preset.inHome1,
descriptor: {
type: ofAnotherType.descriptor.type,
droppableId: ofAnotherType.descriptor.id,
id: 'addition!',
index: 0,
},
};
const anotherDroppable: DroppableDimension = {
...preset.foreign,
descriptor: {
...preset.foreign.descriptor,
id: 'another droppable',
},
};
const critical: Critical = {
draggable: preset.inHome1.descriptor,
droppable: scrollableHome.descriptor,
};
const justCritical: DimensionMap = {
draggables: {
[preset.inHome1.descriptor.id]: preset.inHome1,
},
droppables: {
[preset.home.descriptor.id]: scrollableHome,
},
};
afterEach(() => {
requestAnimationFrame.reset();
});
describe('draggable additions', () => {
it('should collect and publish the draggables', () => {
const beforeInHome1: DraggableDimension = {
...preset.inHome1,
descriptor: {
...preset.inHome1.descriptor,
id: 'addition1',
index: 0,
},
};
const beforeInHome2: DraggableDimension = {
...preset.inHome2,
descriptor: {
...preset.inHome2.descriptor,
id: 'addition2',
index: 1,
},
};
const registry: Registry = createRegistry();
const callbacks: Callbacks = getCallbacksStub();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome1 }),
);
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome2 }),
);
expect(callbacks.collectionStarting).toHaveBeenCalled();
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
// Fire the collection / publish step
requestAnimationFrame.step();
const expected: Published = {
...empty,
additions: [beforeInHome1, beforeInHome2],
modified: [{ droppableId: scrollableHome.descriptor.id, scroll: origin }],
};
expect(callbacks.publishWhileDragging).toHaveBeenCalledWith(expected);
});
it('should not do anything if trying to add a draggable that does not have the same type as the dragging item', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
// Registering a new draggable (inserted before inHome1)
registry.draggable.register(
getDraggableEntry({ dimension: inAnotherType }),
);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
it('should order published draggables by their index', () => {
const beforeInHome1: DraggableDimension = {
...preset.inHome1,
descriptor: {
...preset.inHome1.descriptor,
id: 'b',
index: 0,
},
};
const beforeInHome2: DraggableDimension = {
...preset.inHome2,
descriptor: {
...preset.inHome2.descriptor,
// if ordered by a key, this would be first
id: 'a',
index: 1,
},
};
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
// publishing the higher index value first
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome2 }),
);
// publishing the lower index value second
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome1 }),
);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
// Fire the collection / publish step
requestAnimationFrame.step();
const expected: Published = {
...empty,
// we expect this to be ordered by index
additions: [beforeInHome1, beforeInHome2],
modified: [{ droppableId: scrollableHome.descriptor.id, scroll: origin }],
};
expect(callbacks.publishWhileDragging).toHaveBeenCalledWith(expected);
});
it('should log a warning if trying to add or remove a draggable from a non-virtual list', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
const notVirtual: DroppableDimension = {
...scrollableHome,
descriptor: {
...scrollableHome.descriptor,
mode: 'standard',
},
};
const map: DimensionMap = patchDimensionMap(withScrollables, notVirtual);
populate(registry, map);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
// additions log a warning
withWarn(() => {
const beforeInHome1: DraggableDimension = {
...preset.inHome1,
descriptor: {
...preset.inHome1.descriptor,
id: 'b',
index: 0,
},
};
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome1 }),
);
});
// removals log a warning
withWarn(() => {
registry.draggable.unregister(
registry.draggable.getById(preset.inHome2.descriptor.id),
);
});
// neither cause a collection to start
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
});
describe('draggable removals', () => {
it('should publish a removal', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.draggable.unregister(
registry.draggable.getById(preset.inHome2.descriptor.id),
);
registry.draggable.unregister(
registry.draggable.getById(preset.inHome3.descriptor.id),
);
registry.draggable.unregister(
registry.draggable.getById(preset.inForeign1.descriptor.id),
);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
// Fire the collection / publish step
requestAnimationFrame.flush();
const expected: Published = {
additions: [],
removals: [
preset.inHome2.descriptor.id,
preset.inHome3.descriptor.id,
preset.inForeign1.descriptor.id,
],
modified: [
{ droppableId: scrollableHome.descriptor.id, scroll: origin },
{ droppableId: scrollableForeign.descriptor.id, scroll: origin },
],
};
expect(callbacks.publishWhileDragging).toHaveBeenCalledWith(expected);
});
it('should do nothing if tying to remove a draggable of a different type', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
const dimensions: DimensionMap = {
draggables: {
...withScrollables.draggables,
[inAnotherType.descriptor.id]: inAnotherType,
},
droppables: {
...withScrollables.droppables,
[ofAnotherType.descriptor.id]: ofAnotherType,
},
};
populate(registry, dimensions);
// A publish has started
marshal.startPublishing(defaultRequest);
registry.draggable.unregister(
registry.draggable.getById(inAnotherType.descriptor.id),
);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
it('should do nothing if removing the critical draggable', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
marshal.startPublishing(defaultRequest);
registry.draggable.unregister(
registry.draggable.getById(critical.draggable.id),
);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
});
describe('droppables', () => {
it('should not do anything if a droppable is added', () => {
const registry: Registry = createRegistry();
const callbacks: Callbacks = getCallbacksStub();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.droppable.register(
getDroppableEntry({ dimension: anotherDroppable }),
);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
it('should not do anything if a droppable is removed', () => {
const registry: Registry = createRegistry();
const callbacks: Callbacks = getCallbacksStub();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.droppable.unregister(
registry.droppable.getById(scrollableForeign.descriptor.id),
);
expect(callbacks.collectionStarting).not.toHaveBeenCalled();
});
it('should recollect the scroll from droppables that had draggable additions', () => {
const beforeInHome2: DraggableDimension = {
...preset.inHome2,
descriptor: {
...preset.inHome2.descriptor,
id: 'addition2',
index: 1,
},
};
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
const watcher: DimensionWatcher = populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.draggable.register(
getDraggableEntry({ dimension: beforeInHome2 }),
);
expect(callbacks.collectionStarting).toHaveBeenCalled();
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
expect(watcher.droppable.getScrollWhileDragging).not.toHaveBeenCalled();
// Fire the collection / publish step
requestAnimationFrame.flush();
// not hiding placeholder in home list
expect(watcher.droppable.getScrollWhileDragging).toHaveBeenCalledWith(
scrollableHome.descriptor.id,
getFrame(scrollableHome).scroll.current,
);
const expected: Published = {
additions: [beforeInHome2],
removals: [],
modified: [{ droppableId: scrollableHome.descriptor.id, scroll: origin }],
};
expect(callbacks.publishWhileDragging).toHaveBeenCalledWith(expected);
});
it('should recollect the scroll from droppables that had draggable removals', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
const watcher: DimensionWatcher = populate(registry, withScrollables);
// A publish has started
marshal.startPublishing(defaultRequest);
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
registry.draggable.unregister(
registry.draggable.getById(preset.inHome2.descriptor.id),
);
expect(callbacks.collectionStarting).toHaveBeenCalled();
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
expect(watcher.droppable.getScrollWhileDragging).not.toHaveBeenCalled();
// Fire the collection / publish step
requestAnimationFrame.flush();
// not hiding placeholder in home list
expect(watcher.droppable.getScrollWhileDragging).toHaveBeenCalledWith(
scrollableHome.descriptor.id,
getFrame(scrollableHome).scroll.current,
);
const expected: Published = {
additions: [],
removals: [preset.inHome2.descriptor.id],
modified: [{ droppableId: scrollableHome.descriptor.id, scroll: origin }],
};
expect(callbacks.publishWhileDragging).toHaveBeenCalledWith(expected);
});
});
describe('cancelling mid publish', () => {
it('should cancel any pending collections', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, justCritical);
const result: StartPublishingResult = marshal.startPublishing(
defaultRequest,
);
const expected: StartPublishingResult = {
critical,
dimensions: justCritical,
viewport,
};
expect(result).toEqual(expected);
registry.draggable.register(
getDraggableEntry({ dimension: preset.inHome2 }),
);
expect(callbacks.collectionStarting).toHaveBeenCalled();
// no request animation fired yet
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
// marshal told to stop - which should cancel any pending publishes
marshal.stopPublishing();
// flushing any frames
requestAnimationFrame.flush();
expect(callbacks.publishWhileDragging).not.toHaveBeenCalled();
});
});
describe('subsequent', () => {
it('should allow subsequent publishes in the same drag', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, justCritical);
marshal.startPublishing(defaultRequest);
registry.draggable.register(
getDraggableEntry({ dimension: preset.inHome2 }),
);
requestAnimationFrame.step();
expect(callbacks.publishWhileDragging).toHaveBeenCalledTimes(1);
// $FlowFixMe
callbacks.publishWhileDragging.mockReset();
registry.draggable.register(
getDraggableEntry({ dimension: preset.inHome3 }),
);
requestAnimationFrame.step();
expect(callbacks.publishWhileDragging).toHaveBeenCalledTimes(1);
});
it('should allow subsequent publishes between drags', () => {
const callbacks: Callbacks = getCallbacksStub();
const registry: Registry = createRegistry();
const marshal: DimensionMarshal = createDimensionMarshal(
registry,
callbacks,
);
populate(registry, justCritical);
marshal.startPublishing(defaultRequest);
registry.draggable.register(
getDraggableEntry({ dimension: preset.inHome2 }),
);
requestAnimationFrame.step();
expect(callbacks.publishWhileDragging).toHaveBeenCalledTimes(1);
// $FlowFixMe
callbacks.publishWhileDragging.mockReset();
marshal.stopPublishing();
// second drag
marshal.startPublishing(defaultRequest);
registry.draggable.register(
getDraggableEntry({ dimension: preset.inHome3 }),
);
requestAnimationFrame.step();
expect(callbacks.publishWhileDragging).toHaveBeenCalledTimes(1);
});
});
| 30.533898 | 121 | 0.684208 |
4a84cef87428cfbe38bc8b8be232b6dede6288ba | 3,935 | js | JavaScript | js/NAMELIST.js | mkszk/mkszk.github.io | 3e24a2bbe29a292d5255eb5ab75637b5a3ba27f0 | [
"MIT"
] | null | null | null | js/NAMELIST.js | mkszk/mkszk.github.io | 3e24a2bbe29a292d5255eb5ab75637b5a3ba27f0 | [
"MIT"
] | null | null | null | js/NAMELIST.js | mkszk/mkszk.github.io | 3e24a2bbe29a292d5255eb5ab75637b5a3ba27f0 | [
"MIT"
] | null | null | null | var NAMELIST = [
"バエル",
"アガレス",
"ウァサゴ",
"ガミジン",
"マルバス",
"ウァレフォル",
"アモン",
"バルバトス",
"パイモン",
"ブエル",
"グシオン",
"シトリー",
"ベレト",
"レラジェ",
"エリゴス",
"ゼパル",
"ボティス",
"バティン",
"サレオス",
"プルソン",
"モラクス",
"イポス",
"アイム",
"ナベリウス",
"グラシャラボラス",
"ブネ",
"ロノウェ",
"ベリト",
"アスタロト",
"フォルネウス",
"フォラス",
"アスモデウス",
"ガープ",
"フルフル",
"マルコシアス",
"ストラス",
"フェニックス",
"ハルファス",
"マルファス",
"ラウム",
"フォカロル",
"ウェパル",
"サブナック",
"シャックス",
"ヴィネ",
"ビフロンス",
"ウヴァル",
"ハーゲンティ",
"クロケル",
"フルカス",
"バラム",
"アロケル",
"カイム",
"ムルムル",
"オロバス",
"グレモリー",
"オセ",
"アミー",
"オリアス",
"ウァプラ",
"ザガン",
"ウァラク",
"アンドラス",
"フラウロス",
"アンドレアルフス",
"キマリス",
"アムドゥスキアス",
"ベリアル",
"デカラビア",
"セーレ",
"ダンタリオン",
"アンドロマリウス",
"未実装",
"アガレスRe",
"ウァサゴRe",
"未実装",
"マルバスRe",
"未実装",
"アモンRe",
"バルバトスRe",
"未実装",
"未実装",
"グシオンRe",
"シトリーRe",
"未実装",
"レラジェRe",
"エリゴスRe",
"ゼパルRe",
"ボティスRe",
"バティンRe",
"サレオスRe",
"プルソンRe",
"モラクスRe",
"イポスRe",
"アイムRe",
"ナベリウスRe",
"グラシャラボラスRe",
"ブネRe",
"未実装",
"ベリトRe",
"アスタロトRe",
"フォルネウスRe",
"フォラスRe",
"未実装",
"ガープRe",
"フルフルRe",
"マルコシアスRe",
"ストラスRe",
"フェニックスRe",
"未実装",
"マルファスRe",
"ラウムRe",
"フォカロルRe",
"ウェパルRe",
"サブナックRe",
"シャックスRe",
"ヴィネRe",
"ビフロンスRe",
"ウヴァルRe",
"ハーゲンティRe",
"クロケルRe",
"フルカスRe",
"未実装",
"アロケルRe",
"未実装",
"未実装",
"オロバスRe",
"未実装",
"未実装",
"未実装",
"オリアスRe",
"ウァプラRe",
"未実装",
"未実装",
"アンドラスRe",
"フラウロスRe",
"未実装",
"キマリスRe",
"アムドゥスキアスRe",
"ベリアルRe",
"デカラビアRe",
"セーレRe",
"ダンタリオンRe",
"未実装",
"リリム",
"ニバス",
"サキュバス",
"ユフィール",
"フリアエ",
"アラストール",
"ヒュトギン",
"未実装",
"インキュバス",
"グリマルキン",
"コルソン",
"ジニマル",
"バフォメット",
"サラ",
"サタナキア",
"タナトス",
"ティアマト",
"ブニ",
"オリエンス",
"未実装",
"リヴァイアサン",
"カスピエル",
"ネフィリム",
"ミノソン",
"ニスロク",
"オレイ",
"マルチネ",
"アザゼル",
"アルマロス",
"バラキエル",
"フルーレティ",
"未実装",
"ハック",
"マスティマ",
"ブリフォー",
"メフィスト",
"ネビロス",
"アガリアレプト",
"ウコバク",
"グザファン",
"アマイモン",
"ルキフゲス",
"サルガタナス",
"タムス",
"チェルノボグ",
"アガシオン",
"ヴェルドレ",
"ウトゥック",
"サタナイル",
"シャミハザ",
"プルフラス",
"ジズ",
"ベバル",
"アバラム",
"アリトン",
"バロール",
"ベヒモス",
"ダゴン",
"スコルベノト",
"未実装",
"フィロタヌス",
"インプ",
"アマゼロト",
"プロメテウス",
"ベルフェゴール",
"マモン",
"未実装",
"ネルガル",
"バールゼフォン",
"アスラフィル",
"アクィエル",
"未実装",
"リリムRe",
"ニバスRe",
"サキュバスRe",
"ユフィールRe",
"未実装",
"アラストールRe",
"ヒュトギンRe",
"未実装",
"インキュバスRe",
"未実装",
"コルソンRe",
"未実装",
"未実装",
"未実装",
"サタナキアRe",
"未実装",
"未実装",
"ブニRe",
"未実装",
"未実装",
"未実装",
"カスピエルRe",
"ネフィリムRe",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"メフィストRe",
"未実装",
"アガリアレプトRe",
"未実装",
"未実装",
"アマイモンRe",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"シャミハザRe",
"プルフラスRe",
"ジズRe",
"未実装",
"未実装",
"未実装",
"未実装",
"ベヒモスRe",
"未実装",
"未実装",
"未実装",
"未実装",
"インプRe",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"未実装",
"バールゼフォンRe",
"未実装",
"未実装",
"未実装",
];
| 13.522337 | 18 | 0.338501 |
4a850f6c986b95dbb03e91625ce22fd6a236e069 | 148 | js | JavaScript | src/types/BackupInfos.js | TheDevYellowy/selfbot-backup | 12aafa376de208e95011cfb8a577e8d54cd729da | [
"MIT"
] | null | null | null | src/types/BackupInfos.js | TheDevYellowy/selfbot-backup | 12aafa376de208e95011cfb8a577e8d54cd729da | [
"MIT"
] | null | null | null | src/types/BackupInfos.js | TheDevYellowy/selfbot-backup | 12aafa376de208e95011cfb8a577e8d54cd729da | [
"MIT"
] | null | null | null | const { BackupData } = require('./');
module.exports = class BackupInfos {
constructor({
id = String,
size = Number,
data = BackupData
})
} | 16.444444 | 37 | 0.635135 |
4a869d9f2d5ad5b262c12bc6d67ade1b0b245e59 | 914 | js | JavaScript | web/app/plugins/ninja-forms-conditionals/assets/js/builder/main.js | tommyseijkens/trendsinhr_composer | 3d4f64d0cdb54b5c35dfe4b0affa45d13a3be40e | [
"MIT"
] | 2 | 2021-04-15T12:28:06.000Z | 2021-06-20T22:12:10.000Z | web/app/plugins/ninja-forms-conditionals/assets/js/builder/main.js | tommyseijkens/trendsinhr_composer | 3d4f64d0cdb54b5c35dfe4b0affa45d13a3be40e | [
"MIT"
] | 125 | 2020-07-23T23:19:33.000Z | 2022-03-28T10:24:48.000Z | web/app/plugins/ninja-forms-conditionals/assets/js/builder/main.js | tommyseijkens/trendsinhr_composer | 3d4f64d0cdb54b5c35dfe4b0affa45d13a3be40e | [
"MIT"
] | 1 | 2020-11-04T07:28:31.000Z | 2020-11-04T07:28:31.000Z | var nfRadio = Backbone.Radio;
require( [ 'controllers/loadControllers', 'models/conditionCollection' ], function( LoadControllers, ConditionCollection ) {
var NFConditionalLogic = Marionette.Application.extend( {
initialize: function( options ) {
this.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.afterNFLoad );
},
onStart: function() {
new LoadControllers();
},
afterNFLoad: function( app ) {
/*
* Convert our form's "condition" setting into a collection.
*/
var conditions = nfRadio.channel( 'settings' ).request( 'get:setting', 'conditions' );
if ( false === conditions instanceof Backbone.Collection ) {
conditions = new ConditionCollection( conditions );
nfRadio.channel( 'settings' ).request( 'update:setting', 'conditions', conditions, true );
}
}
} );
var nfConditionalLogic = new NFConditionalLogic();
nfConditionalLogic.start();
} ); | 30.466667 | 124 | 0.693654 |
4a86ca1e89dfd0a97f2da2ce3c7d539956b4689f | 3,697 | js | JavaScript | test/remark/components/Timer.spec.js | WayneBuckhanan/remark-redux | 4f38d8bb200bd453ad9c2a41c4f75e6f081e7a0b | [
"MIT"
] | null | null | null | test/remark/components/Timer.spec.js | WayneBuckhanan/remark-redux | 4f38d8bb200bd453ad9c2a41c4f75e6f081e7a0b | [
"MIT"
] | null | null | null | test/remark/components/Timer.spec.js | WayneBuckhanan/remark-redux | 4f38d8bb200bd453ad9c2a41c4f75e6f081e7a0b | [
"MIT"
] | 1 | 2019-07-06T05:04:41.000Z | 2019-07-06T05:04:41.000Z | import EventEmitter from 'events';
import Timer from '../../../src/remark/components/Timer/Timer';
describe('Timer', () => {
let events;
let element;
let timer;
beforeEach(() => {
events = new EventEmitter();
element = document.createElement('div');
});
describe('timer updates', () => {
beforeEach(() => {
timer = new Timer(events, element);
});
it('should do nothing if the timer has not started', () => {
timer.element.innerHTML.should.equal('0:00:00');
});
it('should show progress time if the slideshow has started', () => {
// Force a specific start time and update
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
timer.updateTimer();
// Timer output should match forced time
timer.element.innerHTML.should.equal('2:34:56');
});
it('should compensate for a pause in progress', () => {
// Force a specific start time and update, including an in-progress pause
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
timer.pauseStart = new Date() - (3600000 + 23 * 60000 + 45 * 1000);
timer.updateTimer();
// Timer output should match forced time
timer.element.innerHTML.should.equal('1:11:11 | Paused');
});
it('should compensate for paused time', () => {
// Force a specific start time and update, including a recorded pause
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
timer.pauseLength = (5 * 60000 + 6 * 1000);
timer.updateTimer();
// Timer output should match forced time
timer.element.innerHTML.should.equal('2:29:50');
});
it('should compensate for a pause in progress in addition to previous pauses', () => {
// Force a specific start time and update, including a recorded pause
// and an in-progress pause
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
timer.pauseLength = (5 * 60000 + 6 * 1000);
timer.pauseStart = new Date() - (3600000 + 23 * 60000 + 45 * 1000);
timer.updateTimer();
// Timer output should match forced time
timer.element.innerHTML.should.equal('1:06:05 | Paused');
});
});
describe('timer events', () => {
beforeEach(() => {
timer = new Timer(events, element);
});
it('should respond to a start event', () => {
events.emit('start');
timer.startTime.should.not.equal(null);
});
it('should reset on demand', () => {
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
events.emit('resetTimer');
timer.element.innerHTML.should.equal('0:00:00');
// BDD seems to make this really easy test impossible...
// timer.startTime.should.equal(null);
// timer.pauseStart.should.equal(null);
timer.pauseLength.should.equal(0);
});
it('should track pause start end time', () => {
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
events.emit('togglePause');
timer.pauseStart.should.not.equal(null);
timer.pauseLength.should.equal(0);
});
it('should accumulate pause duration at pause end', () => {
timer.startTime = new Date() - (2*3600000 + 34 * 60000 + 56 * 1000);
timer.pauseStart = new Date() - (12 * 1000);
timer.pauseLength = 100000;
events.emit('togglePause');
// BDD seems to make this really easy test impossible...
//timer.pauseStart.should.equal(null);
// Microsecond accuracy is a possible problem here, so
// allow a 5 microsecond window just in case.
timer.pauseLength.should.be.approximately(112000, 5);
});
});
});
| 35.209524 | 90 | 0.606979 |
4a874ecda437baacfd6eedc0f73f171d561dfb65 | 2,418 | js | JavaScript | doc/html/search/all_7.js | Jiancongzheng/hull-abstraction | 3d08cc303af18d852b00a59d0bac9d3e0fbcee8b | [
"MIT"
] | 2 | 2020-10-20T18:37:24.000Z | 2020-11-01T13:36:12.000Z | doc/html/search/all_7.js | jiancong0204/hull-abstraction | 3d08cc303af18d852b00a59d0bac9d3e0fbcee8b | [
"MIT"
] | null | null | null | doc/html/search/all_7.js | jiancong0204/hull-abstraction | 3d08cc303af18d852b00a59d0bac9d3e0fbcee8b | [
"MIT"
] | null | null | null | var searchData=
[
['generate_5fcached_5fsetup',['generate_cached_setup',['../namespacegenerate__cached__setup.html',1,'']]],
['generate_5fcached_5fsetup_2epy',['generate_cached_setup.py',['../generate__cached__setup_8py.html',1,'']]],
['generatedata',['generateData',['../classbenchmark_1_1_benchmark.html#a56970453ee4a690a35135ffc07dffb34',1,'benchmark::Benchmark']]],
['generatepointcloud',['generatePointCloud',['../classpoint__generation_1_1_point_generator.html#a87e2c4dbd27760092ff2e3a6d64bb8d2',1,'point_generation::PointGenerator']]],
['getinputcloud',['getInputCloud',['../classbenchmark_1_1_benchmark.html#ab1dd595f97616c2879b7d102e32e9889',1,'benchmark::Benchmark']]],
['getpointcloud',['getPointCloud',['../classpoint__generation_1_1_point_generator.html#ab25233ac5bae73c74976170910b13dcf',1,'point_generation::PointGenerator']]],
['gettestcloud',['getTestCloud',['../classbenchmark_1_1_benchmark.html#a1b49288ec1193ac3bc85501091fb5b2f',1,'benchmark::Benchmark']]],
['greedy_5fprojection_5ftriangulation',['greedy_projection_triangulation',['../classhull__abstraction_1_1_reconstructor.html#aeb53b00a5a6300f6fcbef59d6759f01b',1,'hull_abstraction::Reconstructor']]],
['greedy_5ftriangulation',['greedy_triangulation',['../namespacegreedy__triangulation.html',1,'']]],
['greedy_5ftriangulation_2ecpp',['greedy_triangulation.cpp',['../greedy__triangulation_8cpp.html',1,'']]],
['greedy_5ftriangulation_2eh',['greedy_triangulation.h',['../greedy__triangulation_8h.html',1,'']]],
['greedy_5ftriangulation_5fnode_2ecpp',['greedy_triangulation_node.cpp',['../greedy__triangulation__node_8cpp.html',1,'']]],
['greedytriangulation',['GreedyTriangulation',['../classgreedy__triangulation_1_1_greedy_triangulation.html',1,'greedy_triangulation']]],
['greedytriangulation',['greedyTriangulation',['../classhull__abstraction_1_1_reconstructor.html#a585b9418c1a64ec21c195c72139ce581',1,'hull_abstraction::Reconstructor::greedyTriangulation(pcl::PointCloud< pcl::PointNormal >::Ptr cloud_with_normals)'],['../classhull__abstraction_1_1_reconstructor.html#a585b9418c1a64ec21c195c72139ce581',1,'hull_abstraction::Reconstructor::greedyTriangulation(pcl::PointCloud< pcl::PointNormal >::Ptr cloud_with_normals)'],['../classgreedy__triangulation_1_1_greedy_triangulation.html#aa72aa5549f91496308e74182524c20ba',1,'greedy_triangulation::GreedyTriangulation::GreedyTriangulation()']]]
];
| 134.333333 | 638 | 0.807279 |
4a87e517ba0ed0dd6d3ae5ac1af10d358e19d17c | 2,973 | js | JavaScript | extensions/donjayamanne.python-0.6.9/out/client/providers/importSortProvider.js | Sunshengjin/RoboWare-Studio | aa2c309bd5e79f92ba7bf456ff86ad0573975c49 | [
"BSD-3-Clause"
] | 239 | 2018-04-20T06:58:32.000Z | 2022-03-22T18:06:08.000Z | extensions/donjayamanne.python-0.6.9/out/client/providers/importSortProvider.js | Sunshengjin/RoboWare-Studio | aa2c309bd5e79f92ba7bf456ff86ad0573975c49 | [
"BSD-3-Clause"
] | 10 | 2018-12-09T13:49:06.000Z | 2021-07-03T00:38:53.000Z | extensions/donjayamanne.python-0.6.9/out/client/providers/importSortProvider.js | Sunshengjin/RoboWare-Studio | aa2c309bd5e79f92ba7bf456ff86ad0573975c49 | [
"BSD-3-Clause"
] | 99 | 2018-07-20T09:16:13.000Z | 2022-03-20T11:58:56.000Z | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const fs = require("fs");
const child_process = require("child_process");
const settings = require("../common/configSettings");
const editor_1 = require("../common/editor");
class PythonImportSortProvider {
sortImports(extensionDir, document) {
if (document.lineCount === 1) {
return Promise.resolve([]);
}
return new Promise((resolve, reject) => {
// isort does have the ability to read from the process input stream and return the formatted code out of the output stream
// However they don't support returning the diff of the formatted text when reading data from the input stream
// Yes getting text formatted that way avoids having to create a temporary file, however the diffing will have
// to be done here in node (extension), i.e. extension cpu, i.e. les responsive solution
let importScript = path.join(extensionDir, "pythonFiles", "sortImports.py");
let tmpFileCreated = document.isDirty;
let filePromise = tmpFileCreated ? editor_1.getTempFileWithDocumentContents(document) : Promise.resolve(document.fileName);
filePromise.then(filePath => {
const pythonPath = settings.PythonSettings.getInstance().pythonPath;
const isort = settings.PythonSettings.getInstance().sortImports.path;
const args = settings.PythonSettings.getInstance().sortImports.args.join(' ');
let isort_cmd = '';
if (typeof isort === 'string' && isort.length > 0) {
if (isort.indexOf(' ') > 0) {
isort_cmd = `"${isort}" "${filePath}" --diff ${args}`;
}
else {
isort_cmd = `${isort} "${filePath}" --diff ${args}`;
}
}
else {
if (pythonPath.indexOf(' ') > 0) {
isort_cmd = `"${pythonPath}" "${importScript}" "${filePath}" --diff ${args}`;
}
else {
isort_cmd = `${pythonPath} "${importScript}" "${filePath}" --diff ${args}`;
}
}
child_process.exec(isort_cmd, (error, stdout, stderr) => {
if (tmpFileCreated) {
fs.unlink(filePath);
}
if (error || (stderr && stderr.length > 0)) {
return reject(error ? error : stderr);
}
let edits = editor_1.getTextEditsFromPatch(document.getText(), stdout);
resolve(edits);
});
}).catch(reject);
});
}
}
exports.PythonImportSortProvider = PythonImportSortProvider;
//# sourceMappingURL=importSortProvider.js.map | 52.157895 | 135 | 0.543222 |
4a881feecb56a4bc2271edbd69bea928c030a9af | 2,052 | js | JavaScript | src/common/js/table.js | Fredtwins/weatherAdmin | 8534331ebaffec2d69f2d83bd6d85fcc443d40f7 | [
"MIT"
] | 1 | 2019-01-31T00:54:56.000Z | 2019-01-31T00:54:56.000Z | src/common/js/table.js | Fredtwins/weatherAdmin | 8534331ebaffec2d69f2d83bd6d85fcc443d40f7 | [
"MIT"
] | null | null | null | src/common/js/table.js | Fredtwins/weatherAdmin | 8534331ebaffec2d69f2d83bd6d85fcc443d40f7 | [
"MIT"
] | null | null | null | import { cloneObj } from 'common/js/util'
export function Getuserthead (that) {
return [
{
title: '选项(一个)',
align: 'center',
width: 100,
type: 'selection'
}, {
title: '用户名',
align: 'center',
key: 'username'
}, {
title: '真实姓名',
align: 'center',
key: 'realname'
}, {
title: '邮箱',
align: 'center',
key: 'email'
}, {
title: '手机号',
align: 'center',
key: 'mobile'
}, {
title: '状态',
align: 'center',
key: 'status'
}, {
title: '创建时间',
align: 'center',
key: 'createTime'
}, {
title: '操作',
align: 'center',
render: (h, params) => {
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
style: {
marginRight: '5px'
},
on: {
click: () => {
let data = cloneObj(params.row, params.index)
delete data['_index']
delete data['_rowKey']
that.edit(data)
}
}
}, '编辑'),
h('Button', {
props: {
type: 'error',
size: 'small'
},
on: {
click: () => {
that.del(cloneObj(params.row))
}
}
}, '删除')
])
}
}
]
}
export function GetMenuThead (that) {
return [
{
title: 'ID',
align: 'center',
key: 'menuId',
width: 100
}, {
title: '名称',
align: 'center',
key: 'name'
}, {
title: '排序号',
align: 'center',
key: 'orderNum'
}, {
title: '图标',
align: 'center',
key: 'icon'
}, {
title: '类型',
align: 'center',
key: 'type'
}, {
title: '菜单Url',
align: 'center',
key: 'url'
}, {
title: '授权标识',
align: 'center',
key: 'perms'
}
]
}
| 19.17757 | 61 | 0.368908 |
4a8822705ba1e2c44a864b5ec1cd636ee79066ca | 361 | js | JavaScript | vue.config.js | libaizr/vue_shop | cc803aaaacecd31c78faec60091da5eaf0b9d1b6 | [
"MIT"
] | null | null | null | vue.config.js | libaizr/vue_shop | cc803aaaacecd31c78faec60091da5eaf0b9d1b6 | [
"MIT"
] | null | null | null | vue.config.js | libaizr/vue_shop | cc803aaaacecd31c78faec60091da5eaf0b9d1b6 | [
"MIT"
] | null | null | null | const path = require('path')
const resolve = dir => path.join(__dirname,dir)
module.exports={
chainWebpack:config=>{
config.resolve.alias
.set('@',resolve('./src'))
.set('assets',resolve('./src/assets'))
.set('components',resolve('./src/components'))
.set('views',resolve('./src/views'))
.set('network',resolve('./src/network'))
}
} | 27.769231 | 50 | 0.623269 |
4a8c98f72ee0f17d44e1cb97cc9120e03ed53fa4 | 232 | js | JavaScript | app/js/nested/nested.js | pjlamb12/wp-angular | cea9d9f4ad4bdf43c4a24b8c4793dd8c1b174fa3 | [
"MIT"
] | 1 | 2015-08-20T00:34:15.000Z | 2015-08-20T00:34:15.000Z | app/js/nested/nested.js | pjlamb12/wp-angular | cea9d9f4ad4bdf43c4a24b8c4793dd8c1b174fa3 | [
"MIT"
] | null | null | null | app/js/nested/nested.js | pjlamb12/wp-angular | cea9d9f4ad4bdf43c4a24b8c4793dd8c1b174fa3 | [
"MIT"
] | null | null | null | angular.module('myApp.nested',
[
'myApp',
'myApp.nested.nested1'
])
.config(function($stateProvider){
$stateProvider
.state('nested',{
abstract: true,
url: '/nested',
templateUrl: 'js/nested/nested.html',
});
}); | 17.846154 | 40 | 0.637931 |
4a8d04233a5a627020dece2914314f8f8d978db8 | 2,091 | js | JavaScript | build/webpack.base.config.js | eagl3s1ght/vue-wordpress-pwa | 0a9b692a2695f13164a60058a026d91fa7b394d2 | [
"MIT"
] | 733 | 2017-03-07T08:31:42.000Z | 2022-02-25T08:02:26.000Z | build/webpack.base.config.js | eagl3s1ght/vue-wordpress-pwa | 0a9b692a2695f13164a60058a026d91fa7b394d2 | [
"MIT"
] | 16 | 2017-03-08T14:09:43.000Z | 2021-10-19T01:55:30.000Z | build/webpack.base.config.js | kuivis/ilves19pwa | d185af7f430aaed80ce897a1fe4b3ac08ea03ae5 | [
"MIT"
] | 192 | 2017-03-08T05:08:53.000Z | 2022-01-30T20:50:59.000Z | const path = require("path");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const config = {
devtool: "#source-map",
entry: {
app: "./src/client-entry.js",
vendor: ["vue", "vue-router", "vuex", "vuex-router-sync", "axios"]
},
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"],
extensions: [".js", ".vue"],
alias: {
src: path.resolve(__dirname, "../src"),
assets: path.resolve(__dirname, "../src/assets"),
components: path.resolve(__dirname, "../src/components"),
theme: path.resolve(__dirname, "./src/theme")
}
},
output: {
path: path.resolve(__dirname, "../dist"),
publicPath: "/",
filename:
process.env.NODE_ENV === "production"
? "assets/js/[name].[hash].js"
: "assets/js/[name].js"
},
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
loader: "eslint-loader",
exclude: /node_modules/
},
{
enforce: "pre",
test: /\.vue$/,
loader: "eslint-loader",
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.scss$/,
use: ["vue-style-loader", "css-loader", "sass-loader"]
},
{
test: /\.css$/,
use: [
process.env.NODE_ENV !== "production"
? "vue-style-loader"
: MiniCssExtractPlugin.loader,
"css-loader"
]
},
{
test: /\.js$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader",
options: {
name: "assets/[name].[ext]?[hash]"
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: "url-loader",
query: {
limit: 10000,
name: "assets/fonts/[name]_[hash:7].[ext]"
}
}
]
},
plugins: [new VueLoaderPlugin()]
};
module.exports = config;
| 24.313953 | 70 | 0.487805 |
4a8ead2e3c7d320f66fee2173bf733847db4fbff | 3,234 | js | JavaScript | lib/Construct.js | profects/react-ionicons | dc745a6e6b9ff0bec0311040f54deb97b2b1dc91 | [
"Apache-2.0"
] | null | null | null | lib/Construct.js | profects/react-ionicons | dc745a6e6b9ff0bec0311040f54deb97b2b1dc91 | [
"Apache-2.0"
] | null | null | null | lib/Construct.js | profects/react-ionicons | dc745a6e6b9ff0bec0311040f54deb97b2b1dc91 | [
"Apache-2.0"
] | null | null | null | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _SvgContainer = require('./SvgContainer');
var _SvgContainer2 = _interopRequireDefault(_SvgContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Construct = function Construct(_ref) {
var _ref$height = _ref.height,
height = _ref$height === undefined ? 22 : _ref$height,
_ref$width = _ref.width,
width = _ref$width === undefined ? 22 : _ref$width,
_ref$style = _ref.style,
style = _ref$style === undefined ? {} : _ref$style,
_ref$color = _ref.color,
color = _ref$color === undefined ? '#000' : _ref$color,
_ref$cssClasses = _ref.cssClasses,
cssClasses = _ref$cssClasses === undefined ? '' : _ref$cssClasses,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {
return null;
} : _ref$onClick;
return _react2.default.createElement(
_SvgContainer2.default,
{
height: height,
width: width,
color: color,
onClick: onClick,
className: className
},
_react2.default.createElement(
'svg',
{ style: style, className: cssClasses, xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 512 512' },
_react2.default.createElement(
'title',
null,
'Construct'
),
_react2.default.createElement('path', { d: 'M503.58 126.2a16.85 16.85 0 00-27.07-4.55l-51.15 51.15a11.15 11.15 0 01-15.66 0l-22.48-22.48a11.17 11.17 0 010-15.67l50.88-50.89a16.85 16.85 0 00-5.27-27.4c-39.71-17-89.08-7.45-120 23.29-26.81 26.61-34.83 68-22 113.7a11 11 0 01-3.16 11.1L114.77 365.1a56.76 56.76 0 1080.14 80.18L357 272.08a11 11 0 0110.9-3.17c45 12 86 4 112.43-22 15.2-15 25.81-36.17 29.89-59.71 3.83-22.2 1.41-44.44-6.64-61z' }),
_react2.default.createElement('path', { d: 'M437.33 378.41c-13.94-11.59-43.72-38.4-74.07-66.22l-66.07 70.61c28.24 30 53.8 57.85 65 70.88l.07.08A30 30 0 00383.72 464h1.1a30.11 30.11 0 0021-8.62l.07-.07 33.43-33.37a29.46 29.46 0 00-2-43.53zM118.54 214.55a20.48 20.48 0 00-3-10.76 2.76 2.76 0 012.62-4.22h.06c.84.09 5.33.74 11.7 4.61 4.73 2.87 18.23 12.08 41.73 35.54a34.23 34.23 0 007.22 22.12l66.23-61.55a33.73 33.73 0 00-21.6-9.2 2.65 2.65 0 01-.21-.26l-.65-.69-24.54-33.84a28.45 28.45 0 01-4-26.11 35.23 35.23 0 0111.78-16.35c5.69-4.41 18.53-9.72 29.44-10.62a52.92 52.92 0 0115.19.94 65.57 65.57 0 017.06 2.13 15.46 15.46 0 002.15.63 16 16 0 0016.38-25.06c-.26-.35-1.32-1.79-2.89-3.73a91.85 91.85 0 00-9.6-10.36c-8.15-7.36-29.27-19.77-57-19.77a123.13 123.13 0 00-46.3 9c-38.37 15.45-63.47 36.58-75.01 47.79l-.09.09A222.14 222.14 0 0063.7 129.5a27 27 0 00-4.7 11.77 7.33 7.33 0 01-7.71 6.17H50.2a20.65 20.65 0 00-14.59 5.9L6.16 182.05l-.32.32a20.89 20.89 0 00-.24 28.72c.19.2.37.39.57.58L53.67 258a21 21 0 0014.65 6 20.65 20.65 0 0014.59-5.9l29.46-28.79a20.51 20.51 0 006.17-14.76z' })
)
);
};
exports.default = Construct;
module.exports = exports['default'];
//# sourceMappingURL=Construct.js.map | 53.9 | 1,091 | 0.654917 |
4a8efeb6767435a654d05d0d4524c22632614770 | 137 | js | JavaScript | crates/ditto-cli/fixtures/javascript-project/dist/E.js | ditto-lang/ditto | 1d73c2fbb3b54e643b79de2acb0677b80f0b1d77 | [
"BSD-3-Clause"
] | 12 | 2015-08-20T20:00:57.000Z | 2015-09-02T18:08:00.000Z | crates/ditto-cli/fixtures/javascript-project/dist/E.js | ditto-lang/Ditto | 6ed0a7c22c0aa960f2875e9fd21bce5e4ac0dfbc | [
"BSD-3-Clause"
] | 2 | 2015-09-02T20:31:08.000Z | 2015-09-10T02:40:46.000Z | crates/ditto-cli/fixtures/javascript-project/dist/E.js | ditto-lang/Ditto | 6ed0a7c22c0aa960f2875e9fd21bce5e4ac0dfbc | [
"BSD-3-Clause"
] | null | null | null | import {e_from_int_impl as foreign$e_from_int_impl} from "../src/E.js";
const e_from_int = foreign$e_from_int_impl;
export {e_from_int};
| 34.25 | 71 | 0.788321 |
4a8fd1b271fff2f0b60b2b262c4664f64782b99f | 1,437 | js | JavaScript | app/routes/_file-upload.router.js | irden-fire/irden-profiler | 17883024383a375fa5ad8dda2ad3eb2fe6954910 | [
"MIT"
] | null | null | null | app/routes/_file-upload.router.js | irden-fire/irden-profiler | 17883024383a375fa5ad8dda2ad3eb2fe6954910 | [
"MIT"
] | null | null | null | app/routes/_file-upload.router.js | irden-fire/irden-profiler | 17883024383a375fa5ad8dda2ad3eb2fe6954910 | [
"MIT"
] | null | null | null | import File from '../models/file.model';
import multer from 'multer';
import fs from 'fs';
const DIR = './uploads/';
// const PATH = './dist/src/assets/uploads/';
const PATH = '/assets/uploads/';
const SERVER_DIR = './src' + PATH;
let getFilePath = (fileId, fileType) => {
return PATH + fileId + (fileType ? `/${fileType}` : '');
}
export default (app, router, auth) => {
let upload = multer({dest: SERVER_DIR}).single('file');
router.route('/files')
.get((req, res) => {
fs.readdir(SERVER_DIR, (err, pictures) => {
pictures = pictures && pictures.map((picture) => getFilePath(picture));
res.json(pictures);
});
})
.post((req, res) => {
upload(req, res, (err) => {
if (err) {
return res.end(err.toString());
}
res.json(req.file);
});
});
router.route('/files/meta')
.post((req, res) => {
File.create( {
name : req.body.name,
description : req.body.description,
type : req.body.type,
file_id : req.body.file_id,
path: getFilePath(req.body.file_id),
}, (err, feedback) => {
if (err)
res.send(err);
// DEBUG
console.log(`Feedback created: ${feedback}`);
// return the new `expense` to our front-end
res.json(feedback);
});
});
};
| 22.453125 | 83 | 0.505915 |
4a9036291a13a9401eb6a79d6d3f74873404d31c | 1,927 | js | JavaScript | webpack.config.js | slimeygecko/dojo-webpack-resolver | 540daccc5936f3446b367cbacd9937be1eaa9baa | [
"MIT"
] | 1 | 2017-02-17T00:06:41.000Z | 2017-02-17T00:06:41.000Z | webpack.config.js | slimeygecko/dojo-webpack-resolver | 540daccc5936f3446b367cbacd9937be1eaa9baa | [
"MIT"
] | null | null | null | webpack.config.js | slimeygecko/dojo-webpack-resolver | 540daccc5936f3446b367cbacd9937be1eaa9baa | [
"MIT"
] | null | null | null | var webpack = require("webpack");
var path = require("path");
module.exports = {
entry: './src/dgrid_01_hello',
resolveLoader: {
alias: {
"dojo/text": 'raw-loader',
'domReadyLoader': path.resolve(__dirname, './src/util/domReady')
},
modulesDirectories: [
path.resolve(__dirname, './node_modules/')
]
},
resolve: {
alias: {
"dojo": path.resolve(__dirname, './node_modules/dojo'),
"dstore": path.resolve(__dirname, './node_modules/dstore'),
"dijit": path.resolve(__dirname, './node_modules/dijit'),
"dgrid": path.resolve(__dirname, './node_modules/dgrid')
},
root: [
path.resolve(__dirname, './src'),
]
},
devtool: 'source-map',
plugins: [
//this is used along with the resolveLoader alias to 'dojo/text' to load the nls files
new webpack.NormalModuleReplacementPlugin(/util\/nls/, function(result) {
// util/nls!resourceFile,resourceFile2 => ../src/util/nls?resourceFile,resourceFile2
result.request = '../src/' + result.request.replace('!', '?')
})
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ["dojo-webpack-loader", 'domReadyLoader']
},
{
test: [/\.resx$/], loader: 'resx-webpack-loader'
}
]
},
output: {
path: path.resolve(__dirname, 'bundle/'),
publicPath: "bundle/",
filename: "[name].bundle.js"
},
dojoWebpackLoader: {
// We should specify paths to core and dijit modules because we using both
dojoCorePath: path.resolve(__dirname, './node_modules/dojo'),
dojoDijitPath: path.resolve(__dirname, './node_modules/dijit'),
// Languages for dojo/nls module which will be in result pack.
includeLanguages: ['en', 'ru', 'fr']
}
};
| 32.116667 | 96 | 0.557862 |
4a9055ba959ce418b3cc21b08c3b54ff4228c91b | 3,956 | js | JavaScript | index.js | aslafy-z/gulp-download2 | 938ac9dc4ef633ad3106f76dbe3a3067641577ed | [
"MIT"
] | null | null | null | index.js | aslafy-z/gulp-download2 | 938ac9dc4ef633ad3106f76dbe3a3067641577ed | [
"MIT"
] | null | null | null | index.js | aslafy-z/gulp-download2 | 938ac9dc4ef633ad3106f76dbe3a3067641577ed | [
"MIT"
] | null | null | null | /* eslint-disable dot-location */
const stream = require('stream');
const gutil = require('gulp-util');
const hyperquest = require('hyperquest');
const hyperdirect = require('hyperdirect')(10, hyperquest);
const progress = require('progress');
const col = gutil.colors;
const log = gutil.log;
const Error = gutil.PluginError;
/**
* Canonicalizes the URLs into an object of urls and file names.
* @param urls {string|string[]} The list of URLs to process.
* @returns {Object[]}
*/
function canonical(urls) {
'use strict';
urls = Array.isArray(urls) ? urls : [urls];
return urls.map(url => typeof url === 'object' ? url : {
url: url,
file: url.split('/').pop()
});
}
/**
* Downloads the remote file.
* @param url {string|string[]} A URL or list of URLs to download.
* @param options {object} Configuration object for hyperquest.
* @returns {stream}
*/
function download(url, options) {
'use strict';
let firstLog = false;
const file = new gutil.File({
path: url.file,
contents: stream.PassThrough()
});
const emitError = e => file.contents.emit('error', new Error('gulp-download2', e));
log('Downloading', `${col.cyan(url.url)}...`);
hyperdirect(url.url, options)
.on('response', res => {
if (res.statusCode >= 400) {
if (typeof options.errorCallback === 'function') {
options.errorCallback(res.statusCode);
} else {
emitError(`${col.magenta(res.statusCode)} returned from ${col.magenta(url.url)}`);
}
}
let bar = null;
if (res.headers['content-length']) {
bar = new progress('downloading [:bar] :rate/bps :percent :etas', {
complete: '=',
incomplete: '-',
width: 20,
total: parseInt(res.headers['content-length'], 10)
});
} else {
const numeral = require('numeral');
const singleLog = require('single-line-log').stdout;
bar = require('progress-stream')({
time: 100,
drain: true
});
bar.on('progress', prog => {
singleLog(`
Running: ${numeral(prog.runtime).format('00:00:00')} (${numeral(prog.transferred).format('0 b')})
${numeral(prog.speed).format('0.00b')}/s ${Math.round(prog.percentage)}%
`);
});
res.pipe(bar);
}
res
.on('data', chunk => {
if (firstLog) {
process.stdout.write(`[${col.green('gulp')}] downloading ${col.cyan(url)}...\n`);
firstLog = false;
}
if (res.headers['content-length']) {
bar.tick(chunk.length);
}
})
.on('end', () => process.stdout.write(`\n${col.green('Done')}\n\n`));
})
.on('error', function (e) {
if (typeof options.errorCallback === 'function') {
options.errorCallback(e);
} else {
emitError(e);
}
})
.pipe(file.contents); // write straight to disk
return file;
}
module.exports = function (urls, options) {
'use strict';
const urlObjects = canonical(urls);
options = options || {};
let index = 0;
return stream.Readable({
objectMode: true,
read: function (size) {
let i = 0;
let more = true;
while (index < urlObjects.length && i++ < size && more) {
more = this.push(download(urlObjects[index++], options));
}
if (index === urlObjects.length) {
this.push(null);
}
}
});
};
| 29.522388 | 105 | 0.492922 |
4a914e5dfdc3d0e7279a680f1d2619a68e890ae5 | 580 | js | JavaScript | src/components/Home.js | choton654/graphql_chat_client | c9664c0c442582afaffb3fde0f404872dbd89a7a | [
"RSA-MD"
] | null | null | null | src/components/Home.js | choton654/graphql_chat_client | c9664c0c442582afaffb3fde0f404872dbd89a7a | [
"RSA-MD"
] | null | null | null | src/components/Home.js | choton654/graphql_chat_client | c9664c0c442582afaffb3fde0f404872dbd89a7a | [
"RSA-MD"
] | null | null | null | import { useQuery } from "@apollo/client"
import React from "react"
import { Card, Grid } from "semantic-ui-react"
import { GET_USERS } from "../graphql/query"
const Home = () => {
const { loading, error, data } = useQuery(GET_USERS)
if (loading) return "Loading..."
if (error) return `Error! ${error.message}`
return (
<Grid container columns={3}>
{data.allUsers.map(user => (
<Grid.Column key={user.id}>
<Card color="olive" header={user.username} meta={user.email} />
</Grid.Column>
))}
</Grid>
)
}
export default Home
| 25.217391 | 73 | 0.610345 |
4a920043ff29d3c9e33ee8baec2559d97321687a | 664 | js | JavaScript | src/components/List.js | kamalyzl/movies-admin | 4f3e3d2425c01625ccdeb86acee0d21c33d47705 | [
"MIT"
] | null | null | null | src/components/List.js | kamalyzl/movies-admin | 4f3e3d2425c01625ccdeb86acee0d21c33d47705 | [
"MIT"
] | 4 | 2021-03-10T13:59:48.000Z | 2022-02-26T21:11:07.000Z | src/components/List.js | kamalyzl/movies-admin | 4f3e3d2425c01625ccdeb86acee0d21c33d47705 | [
"MIT"
] | null | null | null | import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faEdit, faTrash } from '@fortawesome/free-solid-svg-icons'
const List = ({ id, name, datePublic, status, onClickEdit, onClickTrash }) => {
return (
<tr>
<td>{id}</td>
<td>{name}</td>
<td>{datePublic}</td>
<td>{status}</td>
<td>
<a href='#' className='table-icons'>
<FontAwesomeIcon icon={faEdit} onClick={onClickEdit} />
</a>
<a href='#' className='table-icons'>
<FontAwesomeIcon icon={faTrash} onClick={onClickTrash} />
</a>
</td>
</tr>
)
}
export default List
| 26.56 | 79 | 0.578313 |
4a9353c4c8db690674b940b3383334bb6e134dc7 | 1,517 | js | JavaScript | private/classv8_1_1internal_1_1_segment.js | joshgav/v8docs | 0518c2bd4927d7ffae467d9becd8bed3cec10882 | [
"MIT"
] | null | null | null | private/classv8_1_1internal_1_1_segment.js | joshgav/v8docs | 0518c2bd4927d7ffae467d9becd8bed3cec10882 | [
"MIT"
] | null | null | null | private/classv8_1_1internal_1_1_segment.js | joshgav/v8docs | 0518c2bd4927d7ffae467d9becd8bed3cec10882 | [
"MIT"
] | null | null | null | var classv8_1_1internal_1_1_segment =
[
[ "address", "classv8_1_1internal_1_1_segment.html#aa9737e52dabfbf003ed58407ac1b2870", null ],
[ "capacity", "classv8_1_1internal_1_1_segment.html#a6989878d7be376bfafdd734b4bc31425", null ],
[ "end", "classv8_1_1internal_1_1_segment.html#ae3d423ce6c83233af0f81b80fd5f226a", null ],
[ "Initialize", "classv8_1_1internal_1_1_segment.html#a348222c2ad08aaa0a3a4e0386623b8f6", null ],
[ "next", "classv8_1_1internal_1_1_segment.html#a0aefcd7c631b87c17b8428d10bc408ab", null ],
[ "set_next", "classv8_1_1internal_1_1_segment.html#aafd40a351dec49b6d12309af80fbd9f3", null ],
[ "set_zone", "classv8_1_1internal_1_1_segment.html#ab4851303c0750994872ef72e2e0becd7", null ],
[ "size", "classv8_1_1internal_1_1_segment.html#a8da8b667c812532de9defccd60e99fbf", null ],
[ "start", "classv8_1_1internal_1_1_segment.html#abbaaa544cff0d9869cab5fbc3bf0e803", null ],
[ "ZapContents", "classv8_1_1internal_1_1_segment.html#afc72b6c0bcc19388e22a4ffb956fa91a", null ],
[ "ZapHeader", "classv8_1_1internal_1_1_segment.html#a7e49a7368483ce1176ebfb5c8d2d4f09", null ],
[ "zone", "classv8_1_1internal_1_1_segment.html#a55199ed5e92de55ed3883a56334666c4", null ],
[ "next_", "classv8_1_1internal_1_1_segment.html#af0ed8d1255018af4f1cab1c38fd375aa", null ],
[ "size_", "classv8_1_1internal_1_1_segment.html#a5398c6ced7ca3804b33dcb5da69e46f7", null ],
[ "zone_", "classv8_1_1internal_1_1_segment.html#a1e60eb3a94d759e77b96ccbd11fb7ebd", null ]
]; | 84.277778 | 102 | 0.797627 |
4a94f5d9e99ef739ad3c85701c6751b4f1654aed | 2,117 | js | JavaScript | webpack.config.js | lfac-pt/pushing-html-canvas-talk | 2dc244feee8fd9ea867aaedd2a46422186b00eed | [
"ISC"
] | null | null | null | webpack.config.js | lfac-pt/pushing-html-canvas-talk | 2dc244feee8fd9ea867aaedd2a46422186b00eed | [
"ISC"
] | null | null | null | webpack.config.js | lfac-pt/pushing-html-canvas-talk | 2dc244feee8fd9ea867aaedd2a46422186b00eed | [
"ISC"
] | null | null | null | const webpack = require("webpack");
const path = require("path");
const autoprefixer = require("autoprefixer");
const glob_entries = require('webpack-glob-entries')
// importing webpack plugins
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ErrorOverlayPlugin = require("error-overlay-webpack-plugin");
const DashboardPlugin = require('webpack-dashboard/plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: "development",
devtool: "source-map",
entry: glob_entries('./src/examples/**/*.js'),
output: {
path: path.join(__dirname, "dist"),
publicPath: "/",
filename: "[name].js"
},
optimization: {
splitChunks: {
chunks: "async",
minChunks: 1,
minSize: 0,
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "initial",
minChunks: 1,
minSize: 0
},
default: {
reuseExistingChunk: true
}
}
}
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader"]
}
]
},
plugins: [
new DashboardPlugin(),
new webpack.HotModuleReplacementPlugin(),
new ErrorOverlayPlugin(),
new CopyWebpackPlugin([
{
from: "examples/**/*.html",
to: "./"
},
{
from: "examples/**/*.png",
to: "./"
},
{
from: "src/common/css/style.css",
to: "./style.css"
}
])
],
resolve: {
modules: [
path.resolve("./src"),
"node_modules"
]
},
devServer: {
port: 8080,
contentBase: "./dist",
hot: true,
overlay: true
}
};
| 23.786517 | 67 | 0.448276 |
4a94f656cacd168f64b77fbb8f7e1c779e307d78 | 1,735 | js | JavaScript | app/controller/admin/nodes.js | Indexyz/Sakura | 0d2171e2533dac5cc27cd80008fb5ede8db9bebf | [
"MIT"
] | 1 | 2017-11-21T15:27:21.000Z | 2017-11-21T15:27:21.000Z | app/controller/admin/nodes.js | PaperDashboard/Sakura-Old | 0d2171e2533dac5cc27cd80008fb5ede8db9bebf | [
"MIT"
] | null | null | null | app/controller/admin/nodes.js | PaperDashboard/Sakura-Old | 0d2171e2533dac5cc27cd80008fb5ede8db9bebf | [
"MIT"
] | null | null | null | 'use strict';
module.exports = app => {
class AdminNodeController extends app.Controller {
* get(message, error) {
if (typeof message !== 'string') {
message = undefined;
}
const nodes = yield this.ctx.model.Node.find({});
yield this.ctx.render('admin/nodes', { nodes, message, error });
}
* createNodePage() {
yield this.ctx.render('admin/create-node');
}
* create() {
const { name, address, rate, enable, level, kind, detail } = this.ctx.request.body;
try {
const node = yield this.ctx.service.node.create(name, address, rate, enable, level, kind, detail);
this.ctx.body = node;
} catch (e) {
this.ctx.status = 413;
this.ctx.body = { error: e.message };
}
}
* delete() {
const { id } = this.ctx.params;
try {
yield this.ctx.service.node.delete(id);
} catch (e) {
return yield this.get(undefined, e.message);
}
yield this.get(this.ctx.__('admin.nodes.delete.success'));
}
* editNodePage() {
const { id } = this.ctx.params;
const node = yield this.ctx.service.node.get(id);
yield this.ctx.render('admin/edit-node', { node });
}
* edit() {
const { id } = this.ctx.request.body;
const node = yield this.ctx.service.node.get(id);
Object.assign(node, this.ctx.request.body);
yield node.save();
this.ctx.body = node;
}
}
return AdminNodeController;
};
| 33.365385 | 114 | 0.491643 |
4a96c14d7cad6bcb4a03008b18ae323a50642362 | 13,075 | js | JavaScript | node_modules/tmi.js/lib/commands.js | Eonfow/EonfowBoatNode | 7475082be16b953c441efa2ef2c7eabf8220d577 | [
"MIT"
] | null | null | null | node_modules/tmi.js/lib/commands.js | Eonfow/EonfowBoatNode | 7475082be16b953c441efa2ef2c7eabf8220d577 | [
"MIT"
] | null | null | null | node_modules/tmi.js/lib/commands.js | Eonfow/EonfowBoatNode | 7475082be16b953c441efa2ef2c7eabf8220d577 | [
"MIT"
] | null | null | null | var _ = require("underscore");
var utils = require("./utils");
module.exports = {
action: function action(channel, message) {
channel = utils.normalizeChannel(channel);
message = `\u0001ACTION ${message}\u0001`;
return this._sendMessage(this._getPromiseDelay(), channel, message, (resolve, reject) => {
resolve([channel, message]);
});
},
ban: function ban(channel, username) {
channel = utils.normalizeChannel(channel);
username = utils.normalizeUsername(username);
return this._sendCommand(this._getPromiseDelay(), channel, `/ban ${username}`, (resolve, reject) => {
this.once("_promiseBan", (err) => {
if (!err) { resolve([channel, username]); }
else { reject(err); }
});
});
},
clear: function clear(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/clear", (resolve, reject) => {
this.once("_promiseClear", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
color: function color(channel, color) {
if (typeof color === "undefined") { color = channel; }
return this._sendCommand(this._getPromiseDelay(), "#jtv", `/color ${color}`, (resolve, reject) => {
this.once("_promiseColor", (err) => {
if (!err) { resolve([color]); }
else { reject(err); }
});
});
},
commercial: function commercial(channel, seconds) {
channel = utils.normalizeChannel(channel);
seconds = typeof seconds === "undefined" ? 30 : seconds;
return this._sendCommand(this._getPromiseDelay(), channel, `/commercial ${seconds}`, (resolve, reject) => {
this.once("_promiseCommercial", (err) => {
if (!err) { resolve([channel, seconds]); }
else { reject(err); }
});
});
},
emoteonly: function emoteonly(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/emoteonly", (resolve, reject) => {
this.once("_promiseEmoteonly", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
emoteonlyoff: function emoteonlyoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/emoteonlyoff", (resolve, reject) => {
this.once("_promiseEmoteonlyoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
host: function host(channel, target) {
channel = utils.normalizeChannel(channel);
target = utils.normalizeUsername(target);
return this._sendCommand(2000, channel, `/host ${target}`, (resolve, reject) => {
this.once("_promiseHost", (err, remaining) => {
if (!err) { resolve([channel, target, remaining]); }
else { reject(err); }
});
});
},
join: function join(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), null, `JOIN ${channel}`, (resolve, reject) => {
this.once("_promiseJoin", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
mod: function mod(channel, username) {
channel = utils.normalizeChannel(channel);
username = utils.normalizeUsername(username);
return this._sendCommand(this._getPromiseDelay(), channel, `/mod ${username}`, (resolve, reject) => {
this.once("_promiseMod", (err) => {
if (!err) { resolve([channel, username]); }
else { reject(err); }
});
});
},
mods: function mods(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/mods", (resolve, reject) => {
this.once("_promiseMods", (err, mods) => {
if (!err) {
mods.forEach((username) => {
if (!this.moderators[channel]) { this.moderators[channel] = []; }
if (this.moderators[channel].indexOf(username) < 0) { this.moderators[channel].push(username); }
});
resolve(mods);
} else { reject(err); }
});
});
},
part: function part(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), null, `PART ${channel}`, (resolve, reject) => {
this.once("_promisePart", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
leave: function leave(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), null, `PART ${channel}`, (resolve, reject) => {
this.once("_promisePart", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
ping: function ping() {
return this._sendCommand(this._getPromiseDelay(), null, "PING", (resolve, reject) => {
this.latency = new Date();
this.pingTimeout = setTimeout(() => {
if (!_.isNull(this.ws)) {
this.wasCloseCalled = false;
this.log.error("Ping timeout.");
this.ws.close();
clearInterval(this.pingLoop);
clearTimeout(this.pingTimeout);
}
}, typeof this.opts.connection.timeout === "undefined" ? 9999 : this.opts.connection.timeout);
this.once("_promisePing", (latency) => { resolve([latency]); });
});
},
r9kbeta: function r9kbeta(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/r9kbeta", (resolve, reject) => {
this.once("_promiseR9kbeta", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
r9kmode: function r9kmode(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/r9kbeta", (resolve, reject) => {
this.once("_promiseR9kbeta", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
r9kbetaoff: function r9kbetaoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/r9kbetaoff", (resolve, reject) => {
this.once("_promiseR9kbetaoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
r9kmodeoff: function r9kmodeoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/r9kbetaoff", (resolve, reject) => {
this.once("_promiseR9kbetaoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
raw: function raw(message) {
return this._sendCommand(this._getPromiseDelay(), null, message, (resolve, reject) => {
resolve([message]);
});
},
say: function say(channel, message) {
channel = utils.normalizeChannel(channel);
if (message.toLowerCase().startsWith("/me ") || message.toLowerCase().startsWith("\\me ")) {
return this.action(channel, message.substr(4));
}
else if (message.startsWith(".") || message.startsWith("/") || message.startsWith("\\")) {
return this._sendCommand(this._getPromiseDelay(), channel, message, (resolve, reject) => {
resolve([channel]);
});
}
return this._sendMessage(this._getPromiseDelay(), channel, message, (resolve, reject) => {
resolve([channel, message]);
});
},
slow: function slow(channel, seconds) {
channel = utils.normalizeChannel(channel);
seconds = typeof seconds === "undefined" ? 300 : seconds;
return this._sendCommand(this._getPromiseDelay(), channel, `/slow ${seconds}`, (resolve, reject) => {
this.once("_promiseSlow", (err) => {
if (!err) { resolve([channel, seconds]); }
else { reject(err); }
});
});
},
slowmode: function slowmode(channel, seconds) {
channel = utils.normalizeChannel(channel);
seconds = typeof seconds === "undefined" ? 300 : seconds;
return this._sendCommand(this._getPromiseDelay(), channel, `/slow ${seconds}`, (resolve, reject) => {
this.once("_promiseSlow", (err) => {
if (!err) { resolve([channel, seconds]); }
else { reject(err); }
});
});
},
slowoff: function slowoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/slowoff", (resolve, reject) => {
this.once("_promiseSlowoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
slowmodeoff: function slowoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/slowoff", (resolve, reject) => {
this.once("_promiseSlowoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
subscribers: function subscribers(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/subscribers", (resolve, reject) => {
this.once("_promiseSubscribers", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
subscribersoff: function subscribersoff(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(this._getPromiseDelay(), channel, "/subscribersoff", (resolve, reject) => {
this.once("_promiseSubscribersoff", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
timeout: function timeout(channel, username, seconds) {
channel = utils.normalizeChannel(channel);
username = utils.normalizeUsername(username);
seconds = typeof seconds === "undefined" ? 300 : seconds;
return this._sendCommand(this._getPromiseDelay(), channel, `/timeout ${username} ${seconds}`, (resolve, reject) => {
this.once("_promiseTimeout", (err) => {
if (!err) { resolve([channel, username, seconds]); }
else { reject(err); }
});
});
},
unban: function unban(channel, username) {
channel = utils.normalizeChannel(channel);
username = utils.normalizeUsername(username);
return this._sendCommand(this._getPromiseDelay(), channel, `/unban ${username}`, (resolve, reject) => {
this.once("_promiseUnban", (err) => {
if (!err) { resolve([channel, username]); }
else { reject(err); }
});
});
},
unhost: function unhost(channel) {
channel = utils.normalizeChannel(channel);
return this._sendCommand(2000, channel, "/unhost", (resolve, reject) => {
this.once("_promiseUnhost", (err) => {
if (!err) { resolve([channel]); }
else { reject(err); }
});
});
},
unmod: function unmod(channel, username) {
channel = utils.normalizeChannel(channel);
username = utils.normalizeUsername(username);
return this._sendCommand(this._getPromiseDelay(), channel, `/unmod ${username}`, (resolve, reject) => {
this.once("_promiseUnmod", (err) => {
if (!err) { resolve([channel, username]); }
else { reject(err); }
});
});
},
whisper: function whisper(username, message) {
username = utils.normalizeUsername(username);
return this._sendCommand(this._getPromiseDelay(), "#jtv", `/w ${username} ${message}`, (resolve, reject) => {
resolve([username, message]);
});
}
}
| 39.264264 | 124 | 0.530554 |