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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
128c1cdc17675d07c46aab019ba59f6ed4a79e89 | 1,719 | js | JavaScript | server.js | decahill480/Harmony-Hub | 3c2448aed430f5537efeb27334bb2dc19da2b23a | [
"MIT"
] | 57 | 2015-08-09T03:02:15.000Z | 2022-03-19T04:10:37.000Z | server.js | decahill480/Harmony-Hub | 3c2448aed430f5537efeb27334bb2dc19da2b23a | [
"MIT"
] | 23 | 2015-08-27T01:52:37.000Z | 2020-03-27T11:41:41.000Z | server.js | decahill480/Harmony-Hub | 3c2448aed430f5537efeb27334bb2dc19da2b23a | [
"MIT"
] | 22 | 2015-09-07T04:26:47.000Z | 2018-08-30T12:14:55.000Z | //var hotswap = require('hotswap');
var fs = require('fs');
var path = path = require('path');
var express = require('express');
var alexa = require('alexa-app');
var bodyParser = require('body-parser');
var https = require('https');
var privateKey = fs.readFileSync('./cert/private-key.pem', 'utf8');
var certificate = fs.readFileSync('./cert/certificate.pem', 'utf8');
var credentials = {key: privateKey, cert: certificate,
//requestCert: true, rejectUnauthorized: true
requestCert: true
};
// this code is largely taken from
// https://github.com/matt-kruse/alexa-app-server
// Start up the server
var expressApp = express();
var httpsServer = https.createServer(credentials, expressApp);
var PORT = 443;
expressApp.use(bodyParser.urlencoded({ extended: true }));
expressApp.use(bodyParser.json());
expressApp.set('view engine', 'ejs');
// Register Alexa apps
//register_apps('./','/');
var app = require('./remote.js');
var endpoint = '/remote';
expressApp.post(endpoint,function(req,res) {
var subject = req.connection.getPeerCertificate().subject;
app.request(req.body).then(function(response) {
res.json(response);
},function(response) {
res.status(500).send("Server Error");
});
});
// Configure GET requests to run a debugger UI
expressApp.get(endpoint,function(req,res) {
var subject = req.connection.getPeerCertificate().subject;
res.render('test',{"app":app,"schema":app.schema(),"utterances":app.utterances(),"intents":app.intents});
});
// Serve static files
//expressApp.use(express.static('public_html'));
//expressApp.listen(PORT);
httpsServer.listen(PORT);
console.log("Listening on port "+PORT);
| 33.057692 | 109 | 0.68121 |
128c494c2e2a0a802a2ff793d8a8fc8e449283de | 1,146 | js | JavaScript | test/idbcursor_delete_objectstore3.wpt.t.js | micmil1977/indexeddb | ae2c11482282d2fac07d1d9f3ab8a0dfbdf7379b | [
"MIT"
] | 21 | 2016-01-14T20:40:07.000Z | 2022-03-13T07:45:30.000Z | test/idbcursor_delete_objectstore3.wpt.t.js | passariello/indexeddb | 07bbb54222da7ba328697353d06fc19271658171 | [
"MIT"
] | 19 | 2015-10-17T21:42:26.000Z | 2021-07-30T04:20:46.000Z | test/idbcursor_delete_objectstore3.wpt.t.js | passariello/indexeddb | 07bbb54222da7ba328697353d06fc19271658171 | [
"MIT"
] | 3 | 2021-02-02T10:43:11.000Z | 2021-11-28T04:54:15.000Z | require('proof')(2, async okay => {
await require('./harness')(okay, 'idbcursor_delete_objectstore3')
await harness(async function () {
var db,
t = async_test(),
records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" },
{ pKey: "primaryKey_1", iKey: "indexKey_1" } ];
var open_rq = createdb(t);
open_rq.onupgradeneeded = function(e) {
db = e.target.result;
var objStore = db.createObjectStore("test", { keyPath: "pKey" });
for (var i = 0; i < records.length; i++)
objStore.add(records[i]);
var cursor_rq = objStore.openCursor();
cursor_rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
assert_true(cursor instanceof IDBCursor, "cursor exist");
window.cursor = cursor;
});
e.target.transaction.oncomplete = t.step_func(function(e) {
assert_throws_dom('TransactionInactiveError', function() { window.cursor.delete(); })
t.done();
});
}
})
})
| 33.705882 | 101 | 0.529668 |
128c5b40bfac741456517247d58c059d348c6cc2 | 44,399 | js | JavaScript | webapp/src/main/webapp/oozie-console.js | isabella232/oozie | 9ae23699d3e8ae3719bc3bad642d274911f7df3d | [
"Apache-2.0"
] | null | null | null | webapp/src/main/webapp/oozie-console.js | isabella232/oozie | 9ae23699d3e8ae3719bc3bad642d274911f7df3d | [
"Apache-2.0"
] | 1 | 2021-02-24T08:33:19.000Z | 2021-02-24T08:33:19.000Z | webapp/src/main/webapp/oozie-console.js | isabella232/oozie | 9ae23699d3e8ae3719bc3bad642d274911f7df3d | [
"Apache-2.0"
] | null | null | null | /**
* Copyright (c) 2010 Yahoo! Inc. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. See accompanying LICENSE file.
*/
// Warn about dependencies
if (typeof Ext == 'undefined'){
var warning = 'Missing JavaScript dependencies.';
var dependencies = document.getElementById('dependencies');
if (dependencies){
warning += "\n" + (dependencies.innerText || dependencies.textContent);
dependencies.style.display = '';
}
throw new Error(warning);
}
//so it works from remote browsers, "http://localhost:8080";
var oozie_host = "";
var flattenedObject;
function getOozieClientVersion() {
return 1;
}
function getOozieVersionsUrl() {
var ctxtStr = location.pathname;
return oozie_host + ctxtStr + "versions";
}
function getOozieBase() {
var ctxtStr = location.pathname;
return oozie_host + ctxtStr.replace(/[-]*console/, "") + "v" + getOozieClientVersion() + "/";
}
function getReqParam(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null) {
return "";
}
else {
return results[1];
}
}
// renderer functions
function valueRenderer(value, metadata, record, row, col, store) {
if (value.length > 60) {
return value.substring(0, 60) + " ...";
}
else {
return value;
}
}
function dateTime(value, metadata, record, row, col, store) {
return value;
}
function checkUrl(value, metadata, record, row, col, store) {
if (value != null) {
return "Y";
}
else {
return "N";
}
}
// Makes a tree node from an XML
function treeNodeFromXml(XmlEl) {
var t = ((XmlEl.nodeType == 3) ? XmlEl.nodeValue : XmlEl.tagName);
if (t.replace(/\s/g, '').length == 0) {
return null;
}
var result = new Ext.tree.TreeNode({
text: t
});
// For Elements, process attributes and children
if (XmlEl.nodeType == 1) {
Ext.each(XmlEl.attributes, function(a) {
result.appendChild(new Ext.tree.TreeNode({
text: a.nodeName
})).appendChild(new Ext.tree.TreeNode({
text: a.nodeValue
}));
});
Ext.each(XmlEl.childNodes, function(el) {
var c = treeNodeFromXml(el);
if (c)
result.appendChild(c);
});
}
return result;
}
function treeNodeFromJson(json, rootText) {
var result = new Ext.tree.TreeNode({
text: rootText,
});
// For Elements, process attributes and children
if (typeof json === 'object') {
for (var i in json) {
if (json[i]) {
if (typeof json[i] == 'object') {
var c;
if (json[i]['group']) {
c = treeNodeFromJson(json[i]['data'], json[i]['group']);
}
else {
c = treeNodeFromJson(json[i], json[i]['name']);
}
if (c)
result.appendChild(c);
}
else if (typeof json[i] != 'function') {
result.appendChild(new Ext.tree.TreeNode({
text: i + " -> " + json[i],
}));
}
}
else {
result.appendChild(new Ext.tree.TreeNode({
text: i + " -> " + json[i],
}));
}
}
}
else {
result.appendChild(new Ext.tree.TreeNode({
text: json,
}));
}
return result;
}
// Common stuff to get a paging toolbar for a data store
function getPagingBar(dataStore) {
var pagingBar = new Ext.PagingToolbar({
pageSize: 50,
store: dataStore,
displayInfo: true,
displayMsg: '{0} - {1} of {2}',
emptyMsg: "No data",
});
pagingBar.paramNames = {
start: 'offset',
limit: 'len'
};
return pagingBar;
}
// stuff to show details of a job
function jobDetailsPopup(response, request) {
var jobDefinitionArea = new Ext.form.TextArea({
fieldLabel: 'Definition',
editable: false,
name: 'definition',
width: 1005,
height: 400,
autoScroll: true,
emptyText: "Loading..."
});
var jobLogArea = new Ext.form.TextArea({
fieldLabel: 'Logs',
editable: false,
name: 'logs',
width: 1010,
height: 400,
autoScroll: true,
emptyText: "Loading..."
});
function fetchDefinition(workflowId) {
Ext.Ajax.request({
url: getOozieBase() + 'job/' + workflowId + "?show=definition",
success: function(response, request) {
jobDefinitionArea.setRawValue(response.responseText);
},
});
}
function fetchLogs(workflowId) {
Ext.Ajax.request({
url: getOozieBase() + 'job/' + workflowId + "?show=log",
success: function(response, request) {
jobLogArea.setRawValue(response.responseText);
},
});
}
var jobDetails = eval("(" + response.responseText + ")");
var workflowId = jobDetails["id"];
var appName = jobDetails["appName"];
var jobActionStatus = new Ext.data.JsonStore({
data: jobDetails["actions"],
fields: ['id', 'name', 'type', 'startTime', 'retries', 'consoleUrl', 'endTime', 'externalId', 'status', 'trackerUri', 'workflowId', 'errorCode', 'errorMessage', 'conf', 'transition', 'externalStatus'],
});
/*
*/
var formFieldSet = new Ext.form.FieldSet({
autoHeight: true,
defaultType: 'textfield',
items: [ {
fieldLabel: 'Job Id',
editable: false,
name: 'id',
width: 200,
value: jobDetails["id"]
}, {
fieldLabel: 'Name',
editable: false,
name: 'appName',
width: 200,
value: jobDetails["appName"]
}, {
fieldLabel: 'App Path',
editable: false,
name: 'appPath',
width: 200,
value: jobDetails["appPath"]
}, {
fieldLabel: 'Run',
editable: false,
name: 'run',
width: 200,
value: jobDetails["run"]
}, {
fieldLabel: 'Status',
editable: false,
name: 'status',
width: 200,
value: jobDetails["status"]
}, {
fieldLabel: 'User',
editable: false,
name: 'user',
width: 200,
value: jobDetails["user"]
}, {
fieldLabel: 'Group',
editable: false,
name: 'group',
width: 200,
value: jobDetails["group"]
}, {
fieldLabel: 'Create Time',
editable: false,
name: 'createdTime',
width: 200,
value: jobDetails["createdTime"]
}, {
fieldLabel: 'Nominal Time',
editable: false,
name: 'nominalTime',
width: 200,
value: jobDetails["nominalTime"]
}, {
fieldLabel: 'Start Time',
editable: false,
name: 'startTime',
width: 200,
value: jobDetails["startTime"]
}, {
fieldLabel: 'Last Modified',
editable: false,
name: 'lastModTime',
width: 200,
value: jobDetails["lastModTime"]
},{
fieldLabel: 'End Time',
editable: false,
name: 'endTime',
width: 200,
value: jobDetails["endTime"]
}, ]
});
var fs = new Ext.FormPanel({
frame: true,
labelAlign: 'right',
labelWidth: 85,
width: 1010,
items: [formFieldSet],
tbar: [ {
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'job/' + workflowId,
success: function(response, request) {
jobDetails = eval("(" + response.responseText + ")");
jobActionStatus.loadData(jobDetails["actions"]);
fs.getForm().setValues(jobDetails);
},
});
}
}],
});
var jobs_grid = new Ext.grid.GridPanel({
store: jobActionStatus,
loadMask: true,
columns: [new Ext.grid.RowNumberer(), {
id: 'id',
header: "Action Id",
width: 240,
sortable: true,
dataIndex: 'id'
}, {
header: "Name",
width: 80,
sortable: true,
dataIndex: 'name'
}, {
header: "Type",
width: 80,
sortable: true,
dataIndex: 'type'
}, {
header: "Status",
width: 120,
sortable: true,
dataIndex: 'status'
}, {
header: "Transition",
width: 80,
sortable: true,
dataIndex: 'transition'
}, {
header: "StartTime",
width: 170,
sortable: true,
dataIndex: 'startTime'
}, {
header: "EndTime",
width: 170,
sortable: true,
dataIndex: 'endTime'
}, ],
stripeRows: true,
// autoHeight: true,
autoScroll: true,
frame: true,
height: 400,
width: 1200,
title: 'Actions',
listeners: {
cellclick: {
fn: showActionContextMenu
}
},
});
function showActionContextMenu(thisGrid, rowIndex, cellIndex, e) {
var jobContextMenu = new Ext.menu.Menu('taskContext');
var actionStatus = thisGrid.store.data.items[rowIndex].data;
actionDetailsGridWindow(actionStatus);
function actionDetailsGridWindow(actionStatus) {
var formFieldSet = new Ext.form.FieldSet({
title: actionStatus.actionName,
autoHeight: true,
width: 520,
defaultType: 'textfield',
items: [ {
fieldLabel: 'Name',
editable: false,
name: 'name',
width: 400,
value: actionStatus["name"]
}, {
fieldLabel: 'Type',
editable: false,
name: 'type',
width: 400,
value: actionStatus["type"]
}, {
fieldLabel: 'Transition',
editable: false,
name: 'transition',
width: 400,
value: actionStatus["transition"]
}, {
fieldLabel: 'Start Time',
editable: false,
name: 'startTime',
width: 400,
value: actionStatus["startTime"]
}, {
fieldLabel: 'End Time',
editable: false,
name: 'endTime',
width: 400,
value: actionStatus["endTime"]
}, {
fieldLabel: 'Status',
editable: false,
name: 'status',
width: 400,
value: actionStatus["status"]
}, {
fieldLabel: 'Error Code',
editable: false,
name: 'errorCode',
width: 400,
value: actionStatus["errorCode"]
}, {
fieldLabel: 'Error Message',
editable: false,
name: 'errorMessage',
width: 400,
value: actionStatus["errorMessage"]
}, {
fieldLabel: 'External ID',
editable: false,
name: 'externalId',
width: 400,
value: actionStatus["externalId"]
}, {
fieldLabel: 'External Status',
editable: false,
name: 'externalStatus',
width: 400,
value: actionStatus["externalStatus"]
}, new Ext.form.TriggerField({
fieldLabel: 'Console URL',
editable: false,
name: 'consoleUrl',
width: 400,
value: actionStatus["consoleUrl"],
triggerClass: 'x-form-search-trigger',
onTriggerClick: function() {
window.open(actionStatus["consoleUrl"]);
},
}), {
fieldLabel: 'Tracker URI',
editable: false,
name: 'trackerUri',
width: 400,
value: actionStatus["trackerUri"],
}, ]
});
var detail = new Ext.FormPanel({
frame: true,
labelAlign: 'right',
labelWidth: 85,
width: 540,
items: [formFieldSet]
});
var win = new Ext.Window({
title: 'Action (Name: ' + actionStatus["name"] + '/JobId: ' + workflowId + ')',
closable: true,
width: 560,
autoHeight: true,
plain: true,
items: [new Ext.TabPanel({
activeTab: 0,
autoHeight: true,
deferredRender: false,
items: [ {
title: 'Action Info',
items: detail
}, {
title: 'Action Configuration',
items: new Ext.form.TextArea({
fieldLabel: 'Configuration',
editable: false,
name: 'config',
height: 350,
width: 540,
autoScroll: true,
value: actionStatus["conf"]
})
}, ]
})]
});
win.setPosition(50, 50);
win.show();
}
}
var jobDetailsTab = new Ext.TabPanel({
activeTab: 0,
autoHeight: true,
deferredRender: false,
items: [ {
title: 'Job Info',
items: fs,
}, {
title: 'Job Definition',
items: jobDefinitionArea,
}, {
title: 'Job Configuration',
items: new Ext.form.TextArea({
fieldLabel: 'Configuration',
editable: false,
name: 'config',
width: 1010,
height: 430,
autoScroll: true,
value: jobDetails["conf"]
})
}, {
title: 'Job Log',
items: jobLogArea,
tbar: [ {
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
fetchLogs(workflowId);
}
}],
}]
});
jobDetailsTab.addListener("tabchange", function(panel, selectedTab) {
if (selectedTab.title == "Job Info") {
jobs_grid.setVisible(true);
return;
}
if (selectedTab.title == 'Job Log') {
fetchLogs(workflowId);
}
else if (selectedTab.title == 'Job Definition') {
fetchDefinition(workflowId);
}
jobs_grid.setVisible(false);
});
var win = new Ext.Window({
title: 'Job (Name: ' + appName + '/JobId: ' + workflowId + ')',
closable: true,
width: 1020,
autoHeight: true,
plain: true,
items: [jobDetailsTab, jobs_grid]
});
win.setPosition(10, 10);
win.show();
}
function coordJobDetailsPopup(response, request) {
/*
*/
var jobDefinitionArea = new Ext.form.TextArea({
fieldLabel: 'Definition',
editable: false,
name: 'definition',
width: 1005,
height: 400,
autoScroll: true,
emptyText: "Loading..."
});
var jobDetails = eval("(" + response.responseText + ")");
var coordJobId = jobDetails["coordJobId"];
var appName = jobDetails["coordJobName"];
var jobActionStatus = new Ext.data.JsonStore({
data: jobDetails["actions"],
fields: ['id', 'name', 'type', 'createdConf', 'runConf', 'actionNumber', 'createdTime', 'externalId', 'lastModifiedTime', 'nominalTime', 'status', 'missingDependencies', 'externalStatus', 'trackerUri', 'consoleUrl', 'errorCode', 'errorMessage', 'actions'],
});
/*
*/
var formFieldSet = new Ext.form.FieldSet({
autoHeight: true,
defaultType: 'textfield',
items: [ {
fieldLabel: 'Job Id',
editable: false,
name: 'coordJobId',
width: 400,
value: jobDetails["coordJobId"]
}, {
fieldLabel: 'Name',
editable: false,
name: 'coordJobName',
width: 200,
value: jobDetails["coordJobName"]
}, {
fieldLabel: 'Status',
editable: false,
name: 'status',
width: 200,
value: jobDetails["status"]
}, {
fieldLabel: 'Frequency',
editable: false,
name: 'frequency',
width: 200,
value: jobDetails["frequency"]
}, {
fieldLabel: 'Unit',
editable: false,
name: 'timeUnit',
width: 200,
value: jobDetails["timeUnit"]
}, {
fieldLabel: 'Start Time',
editable: false,
name: 'startTime',
width: 170,
value: jobDetails["startTime"]
}, {
fieldLabel: 'Next Matd',
editable: false,
name: 'nextMaterializedTime',
width: 170,
value: jobDetails["nextMaterializedTime"]
}, ]
});
var fs = new Ext.FormPanel({
frame: true,
labelAlign: 'right',
labelWidth: 85,
width: 1010,
items: [formFieldSet],
tbar: [ {
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'job/' + coordJobId,
success: function(response, request) {
jobDetails = eval("(" + response.responseText + ")");
jobActionStatus.loadData(jobDetails["actions"]);
fs.getForm().setValues(jobDetails);
},
});
}
}],
});
var coord_jobs_grid = new Ext.grid.GridPanel({
store: jobActionStatus,
loadMask: true,
columns: [new Ext.grid.RowNumberer(), {
id: 'id',
header: "Action Id",
width: 240,
sortable: true,
dataIndex: 'id'
}, {
header: "Status",
width: 80,
sortable: true,
dataIndex: 'status'
}, {
header: "Ext Id",
width: 220,
sortable: true,
dataIndex: 'externalId'
}, {
header: "Error Code",
width: 80,
sortable: true,
dataIndex: 'errorCode'
}, {
header: "Created Time",
width: 160,
sortable: true,
dataIndex: 'createdTime'
}, {
header: "Nominal Time",
width: 160,
sortable: true,
dataIndex: 'nominalTime'
}, {
header: "Last Mod Time",
width: 170,
sortable: true,
dataIndex: 'LastModifiedTime'
}, ],
stripeRows: true,
// autoHeight: true,
autoScroll: true,
frame: true,
height: 400,
width: 1000,
title: 'Actions',
bbar: getPagingBar(jobActionStatus),
listeners: {
cellclick: {
fn: showCoordActionContextMenu
}
},
});
// alert("Coordinator PopUP 4 inside coordDetailsPopup ");
function showCoordActionContextMenu(thisGrid, rowIndex, cellIndex, e) {
var jobContextMenu = new Ext.menu.Menu('taskContext');
var actionStatus = thisGrid.store.data.items[rowIndex].data;
actionDetailsGridWindow(actionStatus);
function actionDetailsGridWindow(actionStatus) {
var formFieldSet = new Ext.form.FieldSet({
title: actionStatus.actionName,
autoHeight: true,
width: 520,
defaultType: 'textfield',
items: [ {
fieldLabel: 'Name',
editable: false,
name: 'name',
width: 400,
value: actionStatus["name"]
}, {
fieldLabel: 'Type',
editable: false,
name: 'type',
width: 400,
value: actionStatus["type"]
}, {
fieldLabel: 'externalId',
editable: false,
name: 'externalId',
width: 400,
value: actionStatus["externalId"]
}, {
fieldLabel: 'Start Time',
editable: false,
name: 'startTime',
width: 400,
value: actionStatus["startTime"]
}, {
fieldLabel: 'Nominal Time',
editable: false,
name: 'nominalTime',
width: 400,
value: actionStatus["nominalTime"]
}, {
fieldLabel: 'Status',
editable: false,
name: 'status',
width: 400,
value: actionStatus["status"]
}, {
fieldLabel: 'Error Code',
editable: false,
name: 'errorCode',
width: 400,
value: actionStatus["errorCode"]
}, {
fieldLabel: 'Error Message',
editable: false,
name: 'errorMessage',
width: 400,
value: actionStatus["errorMessage"]
}, {
fieldLabel: 'External Status',
editable: false,
name: 'externalStatus',
width: 400,
value: actionStatus["externalStatus"]
}, new Ext.form.TriggerField({
fieldLabel: 'Console URL',
editable: false,
name: 'consoleUrl',
width: 400,
value: actionStatus["consoleUrl"],
triggerClass: 'x-form-search-trigger',
onTriggerClick: function() {
window.open(actionStatus["consoleUrl"]);
},
}), {
fieldLabel: 'Tracker URI',
editable: false,
name: 'trackerUri',
width: 400,
value: actionStatus["trackerUri"],
}, ]
});
/*
var detail = new Ext.FormPanel( {
frame: true,
labelAlign: 'right',
labelWidth: 85,
width: 540,
items: [formFieldSet]
});
var win = new Ext.Window( {
title: 'Action (Name: ' + actionStatus["name"] + '/JobId: ' + coordJobId + ')',
closable: true,
width: 560,
autoHeight: true,
plain: true,
items: [new Ext.TabPanel( {
activeTab: 0,
autoHeight: true,
deferredRender: false,
items: [ {
title: 'Action Info',
items: detail
}, {
title: 'Action Configuration',
items: new Ext.form.TextArea( {
fieldLabel: 'Configuration',
editable: false,
name: 'config',
height: 350,
width: 540,
autoScroll: true,
value: actionStatus["conf"]
})
}, ]
})]
});
win.setPosition(50, 50);
win.show();
*/
}
}
var jobDetailsTab = new Ext.TabPanel({
activeTab: 0,
autoHeight: true,
deferredRender: false,
items: [ {
title: 'Coord Job Info',
items: fs,
}]
});
jobDetailsTab.addListener("tabchange", function(panel, selectedTab) {
if (selectedTab.title == "Coord Job Info") {
coord_jobs_grid.setVisible(true);
return;
}
if (selectedTab.title == 'Job Log') {
fetchLogs(workflowId);
}
else if (selectedTab.title == 'Job Definition') {
fetchDefinition(workflowId);
}
jobs_grid.setVisible(false);
});
var win = new Ext.Window({
title: 'Job (Name: ' + appName + '/coordJobId: ' + coordJobId + ')',
closable: true,
width: 1020,
autoHeight: true,
plain: true,
items: [jobDetailsTab, coord_jobs_grid]
});
win.setPosition(10, 10);
win.show();
}
function jobDetailsGridWindow(workflowId) {
Ext.Ajax.request({
url: getOozieBase() + 'job/' + workflowId,
success: jobDetailsPopup,
});
}
function coordJobDetailsGridWindow(coordJobId) {
Ext.Ajax.request({
/*
Ext.Msg.show({
title:'Coord JobDetails Window Popup'
msg: 'coordJobDetailsGridWindow invoked',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
*/
url: getOozieBase() + 'job/' + coordJobId,
success: coordJobDetailsPopup,
// success: alert("succeeded " + response),
// failure: alert("Coordinator PopUP did not work" + coordJobId),
});
}
function showConfigurationInWindow(dataObject, windowTitle) {
var configGridData = new Ext.data.JsonStore({
data: dataObject,
root: 'elements',
fields: ['name', 'value'],
});
var configGrid = new Ext.grid.GridPanel({
store: configGridData,
loadMask: true,
columns: [new Ext.grid.RowNumberer(), {
id: 'name',
header: "Name",
width: 160,
sortable: true,
dataIndex: 'name'
}, {
header: "Value",
width: 240,
sortable: true,
dataIndex: 'value'
}, ],
stripeRows: true,
autoHeight: true,
autoScroll: true,
frame: false,
width: 600,
});
var win = new Ext.Window({
title: windowTitle,
closable: true,
autoWidth: true,
autoHeight: true,
plain: true,
items: [configGrid]
});
win.show();
}
var coord_jobs_store = new Ext.data.JsonStore({
/*
*/
baseParams: {
jobtype: "coord",
filter: ""
},
idProperty: 'coordJobId',
totalProperty: 'total',
autoLoad: true,
/*
data: {
elements: []
},
*/
root: 'coordinatorjobs',
fields: ['coordJobId', 'coordJobName', 'status', 'frequency', 'timeUnit', 'startTime', 'nextMaterializedTime'],
proxy: new Ext.data.HttpProxy({
url: getOozieBase() + 'jobs',
})
});
coord_jobs_store.proxy.conn.method = "GET";
// Stores
// create the data store
var jobs_store = new Ext.data.JsonStore({
baseParams: {
filter: ""
},
idProperty: 'id',
totalProperty: 'total',
autoLoad: true,
root: 'workflows',
fields: ['appPath', 'appName', 'id', 'conf', 'status', 'createdTime', 'startTime', 'lastModTime', 'endTime', 'user', 'group', 'run', 'actions'],
proxy: new Ext.data.HttpProxy({
url: getOozieBase() + 'jobs',
})
});
jobs_store.proxy.conn.method = "GET";
var configGridData = new Ext.data.JsonStore({
data: {
elements: []
},
root: 'elements',
fields: ['name', 'value', 'ovalue'],
});
function getConfigObject(responseTxt) {
var fo = {
elements: []
};
var responseObj = eval('(' + responseTxt + ')');
var j = 0;
for (var i in responseObj) {
fo.elements[j] = {};
fo.elements[j].name = i;
fo.elements[j].value = responseObj[i];
j ++;
}
return fo;
}
// All the actions
var refreshCustomJobsAction = new Ext.Action({
text: 'status=KILLED',
handler: function() {
jobs_store.baseParams.filter = this.text;
jobs_store.reload();
},
});
var refreshActiveJobsAction = new Ext.Action({
text: 'Active Jobs',
handler: function() {
jobs_store.baseParams.filter = 'status=RUNNING';
jobs_store.reload();
},
});
var refreshAllJobsAction = new Ext.Action({
text: 'All Jobs',
handler: function() {
jobs_store.baseParams.filter = '';
jobs_store.reload();
},
});
var refreshDoneJobsAction = new Ext.Action({
text: 'Done Jobs',
handler: function() {
jobs_store.baseParams.filter = 'status=SUCCEEDED;status=KILLED';
jobs_store.reload();
},
});
var refreshCoordActiveJobsAction = new Ext.Action({
text: 'Active Jobs',
handler: function() {
coord_jobs_store.baseParams.filter = 'status=RUNNING';
coord_jobs_store.reload();
/*
Ext.Ajax.request( {
url: getOozieBase() + 'jobs/?jobtype=coord',
success: function(response, request) {
var coordData = getConfigObject(response.responseText);
coord_jobs_store.loadData(coordData);
},
});
*/
},
});
var refreshCoordAllJobsAction = new Ext.Action({
text: 'All Jobs',
handler: function() {
coord_jobs_store.baseParams.filter = '';
coord_jobs_store.reload();
/*
Ext.Ajax.request( {
url: getOozieBase() + 'jobs/?jobtype=coord',
success: function(response, request) {
var coordData = getConfigObject(response.responseText);
coord_jobs_store.loadData(coordData);
},
});
*/
},
});
var refreshCoordDoneJobsAction = new Ext.Action({
text: 'Done Jobs',
handler: function() {
coord_jobs_store.baseParams.filter = 'status=SUCCEEDED;status=KILLED';
coord_jobs_store.reload();
/*
Ext.Ajax.request( {
url: getOozieBase() + 'jobs' + '?jobtype=coord',
success: function(response, request) {
var coordData = getConfigObject(response.responseText);
coord_jobs_store.loadData(coordData);
},
});
*/
},
});
var helpFilterAction = new Ext.Action({
text: 'Help',
handler: function() {
Ext.Msg.show({
title:'Filter Help!',
msg: 'Results in this console can be filtered by "status".\n "status" can have values "RUNNING", "SUCCEEDED", "KILLED", "FAILED".\n To add multiple filters, use ";" as the separator. \nFor ex. "status=KILLED;status=SUCCEEDED" will return jobs which are either in SUCCEEDED or KILLED status',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
}
});
var changeFilterAction = new Ext.Action({
text: 'Custom Filter',
handler: function() {
Ext.Msg.prompt('Filter Criteria', 'Filter text:', function(btn, text) {
if (btn == 'ok' && text) {
refreshCustomJobsAction.setText(text);
jobs_store.baseParams.filter = text;
jobs_store.reload();
}
});
}
});
var getSupportedVersions = new Ext.Action({
text: 'Checking server for supported versions...',
handler: function() {
Ext.Ajax.request({
url: getOozieVersionsUrl(),
success: function(response, request) {
var versions = JSON.parse(response.responseText);
for (var i = 0; i < versions.length; i += 1) {
if (versions[i] == getOozieClientVersion()) {
initConsole();
return;
}
}
Ext.Msg.alert('Oozie Console Alert!', 'Server doesn\'t support client version: v' + getOozieClientVersion());
},
})
},
});
var checkStatus = new Ext.Action({
text: 'Status - Unknown',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'admin/status',
success: function(response, request) {
var status = eval("(" + response.responseText + ")");
if (status.safeMode) {
checkStatus.setText("<font color='700000' size='2> Safe Mode - ON </font>");
}
else {
checkStatus.setText("<font color='007000' size='2> Status - Normal</font>");
}
},
});
},
});
var viewConfig = new Ext.Action({
text: 'Configuration',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'admin/configuration',
success: function(response, request) {
var configData = getConfigObject(response.responseText);
configGridData.loadData(configData);
},
});
},
});
var viewInstrumentation = new Ext.Action({
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'admin/instrumentation',
success: function(response, request) {
var jsonData = eval("(" + response.responseText + ")");
var timers = treeNodeFromJson(jsonData["timers"], "timers");
timers.expanded = false;
var samplers = treeNodeFromJson(jsonData["samplers"], "samplers");
samplers.expanded = false;
var counters = treeNodeFromJson(jsonData["counters"], "counters");
counters.expanded = false;
var variables = treeNodeFromJson(jsonData["variables"], "variables");
variables.expanded = false;
while (treeRoot.hasChildNodes()) {
var child = treeRoot.firstChild;
treeRoot.removeChild(child);
}
treeRoot.appendChild(samplers);
treeRoot.appendChild(counters);
treeRoot.appendChild(timers);
treeRoot.appendChild(variables);
treeRoot.expand(false, true);
},
});
},
});
var viewCoordJobs = new Ext.Action({
text: 'All Jobs',
handler: function() {
/*
Ext.Ajax.request( {
url: getOozieBase() + 'jobs/?jobtype=coord',
success: function(response, request) {
var configData = getConfigObject(response.responseText);
coord_job_store.loadData(configData);
},
});
*/
// coord_jobs_store.baseParams.filter = 'jobtype=coord';
coord_jobs_store.reload();
},
});
var viewSystemDetails = new Ext.Action({
text: 'Java System Props',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'admin/java-sys-properties',
success: function(response, request) {
var configData = getConfigObject(response.responseText);
configGridData.loadData(configData);
},
});
},
});
var viewOSDetails = new Ext.Action({
text: 'OS Env',
handler: function() {
Ext.Ajax.request({
url: getOozieBase() + 'admin/os-env',
success: function(response, request) {
var configData = getConfigObject(response.responseText);
configGridData.loadData(configData);
},
});
},
});
var treeRoot = new Ext.tree.TreeNode({
text: "Instrumentation",
expanded: true,
});
function initConsole() {
function showJobContextMenu(thisGrid, rowIndex, cellIndex, e) {
var jobContextMenu = new Ext.menu.Menu('taskContext');
var workflowId = thisGrid.store.data.items[rowIndex].data.id;
jobDetailsGridWindow(workflowId);
}
function showCoordJobContextMenu(thisGrid, rowIndex, cellIndex, e) {
var jobContextMenu = new Ext.menu.Menu('taskContext');
var coordJobId = thisGrid.store.data.items[rowIndex].data.coordJobId;
coordJobDetailsGridWindow(coordJobId);
}
var jobs_grid = new Ext.grid.GridPanel({
store: jobs_store,
loadMask: true,
columns: [new Ext.grid.RowNumberer(), {
id: 'id',
header: "Job Id",
width: 190,
sortable: true,
dataIndex: 'id'
}, {
header: "Name",
width: 100,
sortable: true,
dataIndex: 'appName'
}, {
header: "Status",
width: 70,
sortable: true,
dataIndex: 'status'
}, {
header: "Run",
width: 30,
sortable: true,
dataIndex: 'run'
}, {
header: "User",
width: 60,
sortable: true,
dataIndex: 'user'
}, {
header: "Group",
width: 60,
sortable: true,
dataIndex: 'group'
}, {
header: "Created",
width: 170,
sortable: true,
dataIndex: 'createdTime'
}, {
header: "Started",
width: 170,
sortable: true,
dataIndex: 'startTime'
}, {
header: "Last Modified",
width: 170,
sortable: true,
dataIndex: 'lastModTime'
}, {
header: "Ended",
width: 170,
sortable: true,
dataIndex: 'endTime'
}, ],
stripeRows: true,
autoScroll: true,
frame: false,
width: 1050,
tbar: [ {
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
jobs_store.reload();
}
}, refreshAllJobsAction, refreshActiveJobsAction, refreshDoneJobsAction, {
text: 'Custom Filter',
menu: [refreshCustomJobsAction, changeFilterAction, helpFilterAction ]
}, {
xtype: 'tbfill'
}, checkStatus, ],
title: 'Workflow Jobs',
bbar: getPagingBar(jobs_store),
listeners: {
cellclick: {
fn: showJobContextMenu
}
},
});
var expander = new Ext.grid.RowExpander({
tpl: new Ext.Template('<br><p><b>Name:</b> {name}</p>', '<p><b>Value:</b> {value}</p>')
});
var adminGrid = new Ext.grid.GridPanel({
store: configGridData,
loadMask: true,
columns: [expander, {
id: 'name',
header: "Name",
width: 300,
sortable: true,
dataIndex: 'name'
}, {
id: 'value',
header: "Value",
width: 740,
sortable: true,
renderer: valueRenderer,
dataIndex: 'value'
}, ],
height: 500,
width: 1040,
autoScroll: true,
frame: false,
tbar: [viewConfig, viewSystemDetails, viewOSDetails, {
xtype: 'tbfill'
}, checkStatus],
viewConfig: {
forceFit: true,
},
plugins: expander,
collapsible: true,
animCollapse: false,
title: "System Info"
});
var resultArea = new Ext.tree.TreePanel({
autoScroll: true,
useArrows: true,
height: 300,
root: treeRoot,
tbar: [viewInstrumentation, {
xtype: 'tbfill'
}, checkStatus],
title: 'Instrumentation',
});
var coordJobArea = new Ext.grid.GridPanel({
store: coord_jobs_store,
loadMask: true,
columns: [new Ext.grid.RowNumberer(), {
id: 'id',
header: "Job Id",
width: 190,
sortable: true,
dataIndex: 'coordJobId'
}, {
header: "Name",
width: 100,
sortable: true,
dataIndex: 'coordJobName'
}, {
header: "Status",
width: 70,
sortable: true,
dataIndex: 'status'
}, {
header: "frequency",
width: 60,
sortable: true,
dataIndex: 'frequency'
}, {
header: "unit",
width: 60,
sortable: true,
dataIndex: 'timeUnit'
}, {
header: "Started",
width: 170,
sortable: true,
dataIndex: 'startTime'
}, {
header: "Next Materrializtion",
width: 170,
sortable: true,
dataIndex: 'nextMaterializedTime'
},],
stripeRows: true,
autoScroll: true,
useArrows: true,
height: 300,
tbar: [ {
text: " ",
icon: 'ext-2.2/resources/images/default/grid/refresh.gif',
handler: function() {
coord_jobs_store.reload();
}
}, refreshCoordAllJobsAction, refreshCoordActiveJobsAction, refreshCoordDoneJobsAction,
{
xtype: 'tbfill'
}, checkStatus],
title: 'Coordinator Jobs',
bbar: getPagingBar(coord_jobs_store),
listeners: {
cellclick: {
fn: showCoordJobContextMenu
}
},
});
var tabs = new Ext.TabPanel({
renderTo: 'oozie-console',
height: 500,
width: 1050,
title: "Oozie Web Console",
});
tabs.add(jobs_grid);
tabs.add(adminGrid);
tabs.add(resultArea);
tabs.add(coordJobArea);
tabs.setActiveTab(jobs_grid);
checkStatus.execute();
viewConfig.execute();
viewInstrumentation.execute();
// viewCoordJobs.execute();
var jobId = getReqParam("job");
if (jobId != "") {
jobDetailsGridWindow(jobId);
}
}
// now the on ready function
Ext.onReady(function() {
getSupportedVersions.execute();
});
| 30.535763 | 303 | 0.480979 |
128c7bd3aac30a41ea41388af40f700cc63e7231 | 26 | js | JavaScript | node_modules/semantic/lib/assemble.js | SmallMoist/LitLunch | 2a722dd3e909e2d698922446c0e87004fee0d0b1 | [
"MIT"
] | null | null | null | node_modules/semantic/lib/assemble.js | SmallMoist/LitLunch | 2a722dd3e909e2d698922446c0e87004fee0d0b1 | [
"MIT"
] | null | null | null | node_modules/semantic/lib/assemble.js | SmallMoist/LitLunch | 2a722dd3e909e2d698922446c0e87004fee0d0b1 | [
"MIT"
] | null | null | null | console.log('assemble');
| 13 | 25 | 0.692308 |
128d31301a76738d503a206665f84908ee21700d | 107 | js | JavaScript | src/components/editor/components/layers/Ecomparison/data.js | Lefty240/hb | d4ec3fdb31eb9fb5aefae0772d273cb68abd42b9 | [
"MIT"
] | null | null | null | src/components/editor/components/layers/Ecomparison/data.js | Lefty240/hb | d4ec3fdb31eb9fb5aefae0772d273cb68abd42b9 | [
"MIT"
] | null | null | null | src/components/editor/components/layers/Ecomparison/data.js | Lefty240/hb | d4ec3fdb31eb9fb5aefae0772d273cb68abd42b9 | [
"MIT"
] | null | null | null | export default {
type: 'Ecomparison',
layerName: '竞品-关键指标-对比一览',
belong: '竞品分析',
parent: 'goods'
}
| 15.285714 | 28 | 0.635514 |
128d9cbca821dc53bd26394902b7308cfc95182b | 6,965 | js | JavaScript | bbm/www/js/bbm.js | mg901423/BB10-WebWorks-Samples | 02cf87de5adbe7852fb14797ba24c41ba0641421 | [
"Apache-2.0"
] | 31 | 2015-02-04T15:08:18.000Z | 2021-09-26T07:22:01.000Z | bbm/www/js/bbm.js | RANBIJAY/BB10-WebWorks-Samples | 25f435eb5a5ea2613404732cef4ca997bc337ecc | [
"Apache-2.0"
] | 7 | 2015-02-03T14:19:21.000Z | 2016-03-14T05:50:44.000Z | bbm/www/js/bbm.js | RANBIJAY/BB10-WebWorks-Samples | 25f435eb5a5ea2613404732cef4ca997bc337ecc | [
"Apache-2.0"
] | 95 | 2015-01-04T15:03:18.000Z | 2021-12-22T01:47:04.000Z | /*
* Copyright (c) 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at:
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*global blackberry */
var bbm = {
registered: false,
/**
* Registers this application with the blackberry.bbm.platform APIs.
*
* NOTE: This is NOT required for the invoke APIs.
*/
register: function () {
blackberry.event.addEventListener('onaccesschanged', function (accessible, status) {
if (status === 'unregistered') {
blackberry.bbm.platform.register({
uuid: '33490f91-ad95-4ba9-82c4-33f6ad69fbbc'
});
} else if (status === 'allowed') {
bbm.registered = accessible;
}
}, false);
},
/**
* setDisplayPicture: Sets the BBM profile display picture.
*/
setDisplayPicture: function () {
blackberry.bbm.platform.self.setDisplayPicture('local:///img/avatar-32x32.png');
},
/**
* inviteToDownload: Displays a BBM list of existing users that can be
* contacted to also download this application.
*/
inviteToDownload: function () {
blackberry.bbm.platform.users.inviteToDownload();
},
/**
* inviteToBBM: Invokes the invite to BBM functionality to add BBM contacts.
*/
inviteToBBM: function () {
blackberry.invoke.invoke({
action: 'bb.action.INVITEBBM',
uri: 'pin:2100000A'
});
},
/**
* setAvatarLocal: Invokes the avatar selector on the specified local:// image.
*/
setAvatarLocal: function () {
blackberry.invoke.invoke({
target: 'sys.bbm.imagehandler',
action: 'bb.action.SET',
uri: 'local:///img/avatar.png'
});
},
/**
* setAvatarShared: Invokes the avatar selector on the specified file:// image.
*/
setAvatarShared: function () {
blackberry.invoke.card.invokeFilePicker({
mode: blackberry.invoke.card.FILEPICKER_MODE_PICKER,
type: [blackberry.invoke.card.FILEPICKER_TYPE_PICTURE, blackberry.invoke.card.FILEPICKER_TYPE_MUSIC]
}, function (path) {
blackberry.invoke.invoke({
target: 'sys.bbm.imagehandler',
action: 'bb.action.SET',
uri: 'file://' + path[0]
});
}, function (reason) {
/* Cancelled. */
console.log(reason);
}, function (error) {
/* Error. */
console.log(error);
});
},
/**
* startChat: Invokes a BBM chat with an existing BBM contact.
*
* Specifying a PIN that is not already in the user's contacts will result in the Invite To BBM screen.
*
* Specifying a PIN that is in the user's contacts will immediately start a chat with that person.
*
* Specifying no PIN should invoke the Contact Picker, but currently does not. However, shareText with empty data string should do the job.
*/
startChat: function (pin) {
pin = prompt('Contact PIN (Ex. 2100000A)', pin);
/* null is returned on Cancel or empty string; check valid text first. */
if (pin !== null) {
if (/^[A-Fa-f0-9]{8}$/.test(pin)) {
/* Valid PIN format: Invoke Chat/Invite. */
blackberry.invoke.invoke({
action: 'bb.action.BBMCHAT',
uri: 'pin:' + pin
});
} else {
/* Invalid PIN: Prompt to Retry. */
blackberry.ui.toast.show(
'Invalid PIN',
{
buttonText: 'Retry',
buttonCallback: function () {
bbm.startChat(pin);
},
dismissCallback: function () {
}
}
);
}
} else {
/* Confirm Cancel or empty string. */
blackberry.ui.toast.show(
'Invoke chat with empty string?',
{
buttonText: 'Yes',
buttonCallback: function () {
/* Empty PIN: Invoke Contact Picker. */
blackberry.invoke.invoke({
action: 'bb.action.BBMCHAT'
});
},
dismissCallback: function () {
}
}
);
}
},
/**
* shareText: Starts a chat session with pre-populated text.
*/
shareText: function () {
var text = prompt('Default Text', '');
if (text !== null) {
blackberry.invoke.invoke({
target: 'sys.bbm.sharehandler',
action: 'bb.action.SHARE',
data: text,
mimeType: 'text/plain'
});
} else {
/* Confirm Cancel or empty string. */
blackberry.ui.toast.show(
'Invoke share with empty string?',
{
buttonText: 'Yes',
buttonCallback: function () {
blackberry.invoke.invoke({
target: 'sys.bbm.sharehandler',
action: 'bb.action.SHARE',
data: '',
mimeType: 'text/plain'
});
},
dismissCallback: function () {
}
}
);
}
},
/**
* shareImage: Starts a chat session with attached image.
* Must be a file:// uri.
*/
shareImage: function () {
blackberry.invoke.card.invokeFilePicker({
mode: blackberry.invoke.card.FILEPICKER_MODE_PICKER,
type: [blackberry.invoke.card.FILEPICKER_TYPE_PICTURE, blackberry.invoke.card.FILEPICKER_TYPE_MUSIC]
}, function (path) {
blackberry.invoke.invoke({
target: 'sys.bbm.sharehandler',
action: 'bb.action.SHARE',
uri: 'file://' + path[0]
});
}, function (reason) {
/* Cancelled. */
console.log(reason);
}, function (error) {
/* Error. */
console.log(error);
});
},
/**
* populate: Retrieve BBM profile information and populate a BBUI screen.
*/
populate: function (element) {
element.querySelector('#displayname').setCaption(blackberry.bbm.platform.self.displayName);
element.querySelector('#available').setChecked(
blackberry.bbm.platform.self.status === 'available' ? true : false
);
element.querySelector('#statusmessage').value = blackberry.bbm.platform.self.statusMessage;
element.querySelector('#personalmessage').value = blackberry.bbm.platform.self.personalMessage;
element.querySelector('#ppid').value = blackberry.bbm.platform.self.ppid;
element.querySelector('#handle').value = blackberry.bbm.platform.self.handle;
element.querySelector('#applicationversion').value = blackberry.bbm.platform.self.appVersion;
element.querySelector('#bbmsdkversion').value = blackberry.bbm.platform.self.bbmsdkVersion;
},
/**
* save: Updates the user's BBM profile based on the current information.
*/
save: function () {
/* Update status. */
blackberry.bbm.platform.self.setStatus(
document.querySelector('#available').getChecked() === true ? 'available' : 'busy',
document.querySelector('#statusmessage').value,
function (accepted) {
/* Complete. */
console.log(accepted);
}
);
/* Update personal message. */
blackberry.bbm.platform.self.setPersonalMessage(
document.querySelector('#personalmessage').value,
function (accepted) {
/* Complete. */
console.log(accepted);
}
);
}
}; | 27.971888 | 140 | 0.657286 |
128e61412ac267d334e36b2249a339b20541de97 | 36 | js | JavaScript | src/components/Gutter/index.js | vpavlenko-cv/shared-components | 9631142f51ecd46f82ad315d5675103760a8c1ef | [
"MIT"
] | 22 | 2017-06-08T10:20:09.000Z | 2021-07-04T23:31:42.000Z | src/components/Gutter/index.js | vpavlenko-cv/shared-components | 9631142f51ecd46f82ad315d5675103760a8c1ef | [
"MIT"
] | 114 | 2017-06-26T21:20:10.000Z | 2020-06-08T19:46:00.000Z | src/components/Gutter/index.js | vpavlenko-cv/shared-components | 9631142f51ecd46f82ad315d5675103760a8c1ef | [
"MIT"
] | 16 | 2017-08-25T12:58:17.000Z | 2019-08-16T19:00:10.000Z | export { default } from './Gutter';
| 18 | 35 | 0.638889 |
128e96d716d3df7c8355b1ce8cb58d3784a5c7c2 | 4,000 | js | JavaScript | app/admin/formwidgets/repeater/assets/js/repeater.js | chengjunyong/TastyIgniter | 65d2be7e6fc898e29370a9110fa79b4b3f652597 | [
"MIT"
] | null | null | null | app/admin/formwidgets/repeater/assets/js/repeater.js | chengjunyong/TastyIgniter | 65d2be7e6fc898e29370a9110fa79b4b3f652597 | [
"MIT"
] | null | null | null | app/admin/formwidgets/repeater/assets/js/repeater.js | chengjunyong/TastyIgniter | 65d2be7e6fc898e29370a9110fa79b4b3f652597 | [
"MIT"
] | 1 | 2021-06-02T18:00:20.000Z | 2021-06-02T18:00:20.000Z | /*
* Field Repeater plugin
*
* Data attributes:
* - data-control="repeater" - enables the plugin on an element
*/
+function ($) {
"use strict";
// FIELD REPEATER CLASS DEFINITION
// ============================
var Repeater = function (element, options) {
this.options = options
this.$el = $(element)
this.$appendTo = $(this.options.appendTo, this.$el)
this.$sortable = null
this.$sortableContainer = $(this.options.sortableContainer, this.$el)
// Init
this.init()
}
Repeater.DEFAULTS = {
appendTo: 'table.repeater-items > tbody',
sortableContainer: 'table.repeater-items > tbody',
sortableHandle: '.repeater-item-handle',
}
Repeater.prototype.init = function () {
this.$el.on('click', '[data-control="add-item"]', $.proxy(this.addItem, this))
this.$el.on('click', '[data-control="remove-item"]', $.proxy(this.removeItem, this))
this.bindSorting()
}
Repeater.prototype.bindSorting = function () {
var sortableOptions = {
handle: this.options.sortableHandle,
ghostClass: "sortable-ghost", // Class name for the drop placeholder
chosenClass: "sortable-chosen", // Class name for the chosen item
dragClass: "sortable-drag", // Class name for the dragging item
fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback
}
this.$sortable = Sortable.create(this.$sortableContainer.get(0), sortableOptions)
}
Repeater.prototype.unbind = function () {
this.$sortable.destroy()
this.$el.removeData('ti.repeater')
}
Repeater.prototype.removeItem = function (event) {
var $element = $(event.currentTarget),
$parent = $($element.data('target')),
prompt = $element.data('prompt')
if (prompt.length && !confirm(prompt))
return false;
$parent.remove()
}
Repeater.prototype.addItem = function (event) {
var self = this,
$element = $(event.target),
$template = self.$el.find('[data-repeater-template]'),
$newTemplate = $template.clone(),
findString = $template.data('find'),
find = new RegExp(findString, "g"),
secFind = new RegExp(findString.replace(/_/g, '-'), "g"),
replace = $template.data('replace')
if (!$newTemplate.length) {
throw new Error("No template element found with attribute [data-repeater-template]")
}
this.$appendTo.find('.repeater-item-placeholder').remove()
this.$appendTo.append($newTemplate[0].innerHTML.replace(find, replace).replace(secFind, replace))
$template.data('replace', parseInt(replace) + 1)
$(document).trigger('render')
}
// FIELD REPEATER PLUGIN DEFINITION
// ============================
var old = $.fn.repeater
$.fn.repeater = function (option) {
var args = Array.prototype.slice.call(arguments, 1), result
this.each(function () {
var $this = $(this)
var data = $this.data('ti.repeater')
var options = $.extend({}, Repeater.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('ti.repeater', (data = new Repeater(this, options)))
if (typeof option == 'string') result = data[option].apply(data, args)
if (typeof result != 'undefined') return false
})
return result ? result : this
}
$.fn.repeater.Constructor = Repeater
// FIELD REPEATER NO CONFLICT
// =================
$.fn.repeater.noConflict = function () {
$.fn.repeater = old
return this
}
// FIELD REPEATER DATA-API
// ===============
$(document).render(function () {
$('[data-control="repeater"]', document).repeater()
});
}(window.jQuery);
| 31.746032 | 114 | 0.57175 |
129090f0f091d2598d037707a12e4c3b8b21e692 | 197 | js | JavaScript | libraries/javascript/device/index.js | Valmach/home-automation | d681582f40dba14c80360895f9e13a383e8e1530 | [
"MIT"
] | null | null | null | libraries/javascript/device/index.js | Valmach/home-automation | d681582f40dba14c80360895f9e13a383e8e1530 | [
"MIT"
] | 2 | 2020-07-17T17:02:11.000Z | 2021-05-09T23:51:07.000Z | libraries/javascript/device/index.js | TweederX21/HOME-AUTOMATON | 5623d4f43d48d3f4c069cb8e1f5cff8bd63a556f | [
"MIT"
] | null | null | null | const Device = require("./Device");
const store = require("./store");
const updateDependencies = require("./updateDependencies");
exports = module.exports = { Device, store, updateDependencies };
| 32.833333 | 65 | 0.725888 |
1290d597910994cd0752105a84c9bc7459659a67 | 1,462 | js | JavaScript | sorting/mergesort.js | doing-data-science/algorithm-visualization | c8c9ea23aa4a87930c975c9372c7b613d48dfc3c | [
"MIT"
] | 11 | 2016-12-18T07:20:27.000Z | 2017-01-04T13:26:53.000Z | sorting/mergesort.js | doing-data-science/algorithm-collection | c8c9ea23aa4a87930c975c9372c7b613d48dfc3c | [
"MIT"
] | null | null | null | sorting/mergesort.js | doing-data-science/algorithm-collection | c8c9ea23aa4a87930c975c9372c7b613d48dfc3c | [
"MIT"
] | 2 | 2016-12-19T03:28:55.000Z | 2016-12-19T03:29:37.000Z | (function(root, factory) {
if (typeof exports !== 'undefined') {
return factory(exports);
} else {
factory(root['sorting'] || (root['sorting'] = {}));
}
})(this, function(exports) {
function loop() {
}
function comparator(a, b) {
return a - b;
}
function merge(left, right, cmp) {
var result = [];
while (left.length && right.length) {
if (cmp(left[0], right[0]) < 0) {
result.push(left.shift());
} else {
result.push(right.shift());
}
}
return result.concat(left).concat(right);
}
function mergeSort(array, cmp, handle) {
cmp = cmp || comparator;
handle = handle || loop;
if (array.length < 2) {
return array;
}
var work = [];
for (let i = 0; i < array.length; i++) {
work.push([array[i]]);
}
work.push([]);
handle(array, 0);
for (let lim = array.length; lim > 1; lim = Math.floor((lim + 1) / 2)) {
for (var j = 0, k = 0; k < lim; j++, k += 2) {
work[j] = merge(work[k], work[k + 1], cmp);
var num = 0;
var arr = [];
for (let i = 0; i < work.length; i++) {
var temp = work[i];
arr = arr.concat(temp);
num += temp.length;
if (num === array.length) {
handle(arr, lim);
num = 0;
arr = [];
}
}
}
work[j] = [];
}
return work[0];
}
exports.mergeSort = mergeSort;
});
| 21.5 | 76 | 0.471956 |
12916c70e5e6072074c479e4c72e20bfcabb9962 | 4,097 | js | JavaScript | assets/js/modules/Administration/Pjp.js | muhamadari10/kkpi | 58ac1d0bfa1e3d7e32dcfb279418ef65cf6947c5 | [
"MIT"
] | null | null | null | assets/js/modules/Administration/Pjp.js | muhamadari10/kkpi | 58ac1d0bfa1e3d7e32dcfb279418ef65cf6947c5 | [
"MIT"
] | null | null | null | assets/js/modules/Administration/Pjp.js | muhamadari10/kkpi | 58ac1d0bfa1e3d7e32dcfb279418ef65cf6947c5 | [
"MIT"
] | null | null | null |
var formId = false;
$(document).ajaxStart(function () {
Pace.restart()
});
$(document).ready(function () {
var pjpList = {
id: 'pjpList',
column: [
{
"data": "action",
"orderable": false
},
{
"data": "pjp_name",
"orderable": false,
"className": "text-left"
},
{
"data": "pjp_address",
"orderable": false,
"className": "text-left"
}
],
function: _gridAction,
order: [[1, 'desc']],
length: [10, 20, 30]
}
window.pjpGrid = new grid(pjpList);
window.pjpGrid.url = current_url + "/grid/pjp_list";
window.pjpGrid.type = 'GET';
window.pjpGrid.init();
var table = pjpGrid.getTablesID();
});
$('#createPjp').on('click', function () {
formId = false;
$('#openModalCreate').modal('show');
$('#pjpId').val('');
$('#pjpName').val('');
$('#pjpAddress').val('');
});
var _gridAction = function () {
$(".update-row").on("click", function () {
$('#openModalCreate').modal('show');
formId = true;
var rowdata = window.pjpGrid.table.row($(this).parents('tr')).data();
$('#pjpId').val(rowdata.id);
$('#pjpName').val(rowdata.pjp_name);
$('#pjpAddress').val(rowdata.pjp_address);
});
$(".delete-row").on("click", function () {
formId = false;
var rowdata = window.pjpGrid.table.row($(this).parents('tr')).data();
var myAjax = new ajax();
myAjax.url = current_url + '/ajax/' + 'delete_pjp';
myAjax.async = false;
myAjax.data = {
id: rowdata.id,
};
myAjax.callback = _actionCallback;
myAjax.init();
});
}
$('#savePjp').on('click', function () {
var stopProcessing = false;
$($(this).parents('form')).find('.insert-pjp').each(function (index, element) {
if ((($(this).val() == '') || ($(this).val() == null)) && ($(this).hasClass("validate"))) {
stopProcessing = true;
}
});
if (stopProcessing) {
alert('Field masih kosong. Perhatikan data anda!');
return false;
} else {
var action_url = (formId == false) ? 'create_pjp' : 'update_pjp';
_actionInsert($(this).parents('form'), 'Administration/Pjp/ajax/' + action_url, '.insert-pjp');
}
});
_actionInsert = function (element, url, class_identity) {
var dataset = {};
var i = 0;
$(element).find(class_identity).each(function (index, element) {
i++;
var value = [];
if ($(this).attr('name') !== undefined) {
var key = $(this).attr('name');
var ids = $(this).attr('ids');
if ($(this).attr('ids') !== undefined) {
if ($(this).attr("type") == "hidden") {
dataset[key] = $(this).val();
} else {
dataset[key] = $(this).val();
}
} else {
dataset[key] = $(this).val();
}
}
});
// console.log(dataset);
// return false;
_postToAJax(dataset, url);
};
_postToAJax = function (param, url) {
var myAjax = new ajax();
myAjax.url = base_url + url;
myAjax.async = false;
myAjax.data = param;
myAjax.timeout = 10000;
myAjax.callback = _actionCallback;
myAjax.init();
};
_actionCallback = function (data, status, xhr) {
var data = JSON.parse(data);
if (xhr.status == 200) {
if (data.status == 200) {
alert(data.message);
$('#openModalCreate').modal('hide');
window.pjpGrid.table.draw();
$('#pjpForm')[0].reset();
} else if (data.status == 500) {
alert(data.message);
} else {
alert(data.message);
window.pjpGrid.table.draw();
}
} else {
alert((data.message == "" ? "Check your input" : data.message));
}
};
| 21.563158 | 103 | 0.481816 |
1291a889661ef5a9eb311dfacee81d74d6b65494 | 83,175 | js | JavaScript | 4.0.0/search/all_10.js | isabella232/tessapi | 54e30298a42ca64562008bc093ae678de3752c30 | [
"Apache-2.0"
] | 8 | 2020-01-31T02:21:41.000Z | 2022-02-09T09:39:21.000Z | 4.0.0/search/all_10.js | tesseract-ocr/tessapi | 54e607767038052bb5df70a1f092a21a85d89d06 | [
"Apache-2.0"
] | 1 | 2021-05-28T16:54:43.000Z | 2021-05-28T16:58:02.000Z | 4.0.0/search/all_10.js | isabella232/tessapi | 54e30298a42ca64562008bc093ae678de3752c30 | [
"Apache-2.0"
] | 9 | 2021-01-25T01:17:47.000Z | 2022-02-12T08:40:52.000Z | var searchData=
[
['p',['p',['../a04110.html#a93b39fd8b95d1ba06f4851b9c2e4105e',1,'CLASS_PRUNER_STRUCT']]],
['pad',['pad',['../a02610.html#ad78f4f7e9746def02b0d2e8e8a2b3ceb',1,'TBOX']]],
['padding',['Padding',['../a04162.html#a79168a392a03af2c73eff389ec17abe0',1,'MFEDGEPT']]],
['page',['page',['../a04686.html#af685776eede9d4f58a1d15b0d61b75c2',1,'tesseract::BoxChar']]],
['page_5f',['page_',['../a04730.html#a3a984b81598e188fd5aeb20578fc9e7c',1,'tesseract::StringRenderer']]],
['page_5fboxes_5f',['page_boxes_',['../a04730.html#ac8d3082fbfb0f3d404c554a89e1e8572',1,'tesseract::StringRenderer']]],
['page_5fcount_5f',['page_count_',['../a02246.html#aec76c4ef860f40ec042c65ea1340fc31',1,'tesseract::EquationDetect']]],
['page_5fheight_5f',['page_height_',['../a04730.html#a43c46131d864fd2beb4fa2fb3d0d3c7f',1,'tesseract::StringRenderer']]],
['page_5fnum',['page_num',['../a04230.html#a0de7ab449384e3c52fb02606ae8e6a9f',1,'tesseract::TrainingSample']]],
['page_5fnumber',['page_number',['../a02478.html#a06a5a05171b87d5bd8bfa3be6ab1ec17',1,'tesseract::ImageData']]],
['page_5fres',['PAGE_RES',['../a02530.html',1,'PAGE_RES'],['../a02546.html#aab221a373111c4be685444b5633e22a5',1,'PAGE_RES_IT::page_res()'],['../a02530.html#a62243a900ed0580325d6560ba36f3147',1,'PAGE_RES::PAGE_RES()'],['../a02530.html#a5503efe2d25093a821f335cd47759a9d',1,'PAGE_RES::PAGE_RES(bool merge_similar_words, BLOCK_LIST *block_list, WERD_CHOICE **prev_word_best_choice_ptr)']]],
['page_5fres_5f',['page_res_',['../a02186.html#a12dda612630eba40e15f9d0b9955a04c',1,'tesseract::TessBaseAPI::page_res_()'],['../a02278.html#a480fee3b9cf81df1745ab671c5f28788',1,'tesseract::PageIterator::page_res_()']]],
['page_5fres_5fit',['PAGE_RES_IT',['../a02546.html',1,'PAGE_RES_IT'],['../a02546.html#a03cc68b39cad0cf23cfe09bb6273c9c0',1,'PAGE_RES_IT::PAGE_RES_IT()=default'],['../a02546.html#aeed6f67d734999acb27c9138e6500d72',1,'PAGE_RES_IT::PAGE_RES_IT(PAGE_RES *the_page_res)']]],
['page_5fseparator',['page_separator',['../a02358.html#adf768bc7088ffcfc627ab210338a83bf',1,'tesseract::Tesseract']]],
['page_5fwidth_5f',['page_width_',['../a04730.html#ade7f89a4986d1cbe758492e5cd392ff2',1,'tesseract::StringRenderer']]],
['page_5fysize',['PAGE_YSIZE',['../a00119.html#aaaf26213af8574153166d181aa612aa3',1,'output.cpp']]],
['pageiterator',['PageIterator',['../a02278.html',1,'tesseract::PageIterator'],['../a02278.html#ad9f7980a1c4b008c90bb860d5aa82f48',1,'tesseract::PageIterator::PageIterator(PAGE_RES *page_res, Tesseract *tesseract, int scale, int scaled_yres, int rect_left, int rect_top, int rect_width, int rect_height)'],['../a02278.html#a578df2b00868be69cad7b8237400fb38',1,'tesseract::PageIterator::PageIterator(const PageIterator &src)']]],
['pageiterator_2ecpp',['pageiterator.cpp',['../a00125.html',1,'']]],
['pageiterator_2eh',['pageiterator.h',['../a00128.html',1,'']]],
['pageiteratorlevel',['PageIteratorLevel',['../a01629.html#aa26c22b65cc9765a0e747120f4287fd7',1,'tesseract']]],
['pageres_2ecpp',['pageres.cpp',['../a00341.html',1,'']]],
['pageres_2eh',['pageres.h',['../a00344.html',1,'']]],
['pageresit',['PageResIt',['../a02258.html#ab8f0407490b81601af672c339aaa5d7a',1,'tesseract::MutableIterator']]],
['pageseg_5fdevanagari_5fsplit_5fstrategy',['pageseg_devanagari_split_strategy',['../a02358.html#a3c9d5e5c15d00aba9621bf1026fb8b87',1,'tesseract::Tesseract']]],
['pageseg_5fsplit_5fstrategy',['pageseg_split_strategy',['../a04586.html#ad6413d83bc18c3eaab90ca551d35dc82',1,'tesseract::ShiroRekhaSplitter']]],
['pagesegmain_2ecpp',['pagesegmain.cpp',['../a00131.html',1,'']]],
['pagesegmode',['PageSegMode',['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a',1,'tesseract']]],
['pagewalk_2ecpp',['pagewalk.cpp',['../a00134.html',1,'']]],
['painpointdescription',['PainPointDescription',['../a04826.html#aa1c3decb040ee5043283c94d5d14d9ff',1,'tesseract::LMPainPoints']]],
['painpointheap',['PainPointHeap',['../a01629.html#adf882f4b951f52710bc921268afa8497',1,'tesseract']]],
['paintcolparts',['PaintColParts',['../a02246.html#ada4df5ef0eee657cfeb7524205ce878a',1,'tesseract::EquationDetect']]],
['paintspecialtexts',['PaintSpecialTexts',['../a02246.html#a56443e2bab5cd7a0376dbd8e05fe7bdd',1,'tesseract::EquationDetect']]],
['pale_5fgreen',['PALE_GREEN',['../a04778.html#a100504544a5423a94222149ee9ed0fe8af87dada665fcb5ddbba90e0f555febfe',1,'ScrollView::PALE_GREEN()'],['../a00857.html#a17bc059e437838f094a5a25c2d5ab88fa5c98c19f7558c42bc632a868cbe5b2d1',1,'Pale_GREEN(): callcpp.h']]],
['pango_5ffont_5finfo_2ecpp',['pango_font_info.cpp',['../a01409.html',1,'']]],
['pango_5ffont_5finfo_2eh',['pango_font_info.h',['../a01412.html',1,'']]],
['pangofontinfo',['PangoFontInfo',['../a04722.html',1,'tesseract::PangoFontInfo'],['../a04722.html#af6bc79cf50493749fa2b572c31371eb9',1,'tesseract::PangoFontInfo::PangoFontInfo()'],['../a04722.html#abaa427818a0af999bf699c6bdddcdf71',1,'tesseract::PangoFontInfo::PangoFontInfo(const std::string &name)']]],
['pangofonttypeinfo',['PangoFontTypeInfo',['../a04726.html#ac80d4288507179922bebe67cf2897190',1,'tesseract::FontUtils']]],
['par1',['par1',['../a00365.html#af48d60ada722514c300ec13eb809b23c',1,'polyaprx.cpp']]],
['par2',['par2',['../a00365.html#aa2560a18739e37081028f530cdd91caf',1,'polyaprx.cpp']]],
['par_5fcontrol_2ecpp',['par_control.cpp',['../a00137.html',1,'']]],
['para',['PARA',['../a02518.html',1,'PARA'],['../a02518.html#a056f5ed06e8a14b9f55ef9267d8b90fd',1,'PARA::PARA()'],['../a02526.html#aa5fa3212ac4b34b56f51691c04f1f10c',1,'ROW::para()']]],
['para_5flist',['para_list',['../a02514.html#abd6dfaae322a74d32ae95c55dd1ca173',1,'BLOCK']]],
['paragraph_5fdebug_5flevel',['paragraph_debug_level',['../a02358.html#a10fc85896233cb7f0725ba6d08be5030',1,'tesseract::Tesseract']]],
['paragraph_5fmodels_5f',['paragraph_models_',['../a02186.html#a06084d66b830a388515663761d842041',1,'tesseract::TessBaseAPI']]],
['paragraph_5fseparator_5f',['paragraph_separator_',['../a02250.html#a1c6e431ccea8aaad26d9e8d6b9ca2f60',1,'tesseract::LTRResultIterator']]],
['paragraph_5ftext_5fbased',['paragraph_text_based',['../a02358.html#af0404c9390ab30bf16989d4a16f43020',1,'tesseract::Tesseract']]],
['paragraphinfo',['ParagraphInfo',['../a02278.html#a0b191c2a4506399ccaf52def01f59d19',1,'tesseract::PageIterator']]],
['paragraphisltr',['ParagraphIsLtr',['../a02346.html#a17891e56b5a812ee7728300dac362b40',1,'tesseract::ResultIterator']]],
['paragraphjustification',['ParagraphJustification',['../a01629.html#a550970d1662b3ac5830c6a28dba676b1',1,'tesseract']]],
['paragraphmodel',['ParagraphModel',['../a02522.html',1,'ParagraphModel'],['../a02522.html#ab1f81be6e22e055efdbbc4bb2aa5add3',1,'ParagraphModel::ParagraphModel(tesseract::ParagraphJustification justification, int margin, int first_indent, int body_indent, int tolerance)'],['../a02522.html#a95d3987b6187377c046e2bd19a269f90',1,'ParagraphModel::ParagraphModel()']]],
['paragraphmodelsmearer',['ParagraphModelSmearer',['../a02322.html',1,'tesseract::ParagraphModelSmearer'],['../a02322.html#a42b97ade9478b6198e94bae46b8de969',1,'tesseract::ParagraphModelSmearer::ParagraphModelSmearer()']]],
['paragraphs_2ecpp',['paragraphs.cpp',['../a00140.html',1,'']]],
['paragraphs_2eh',['paragraphs.h',['../a00143.html',1,'']]],
['paragraphs_5finternal_2eh',['paragraphs_internal.h',['../a00146.html',1,'']]],
['paragraphtheory',['ParagraphTheory',['../a02318.html',1,'tesseract::ParagraphTheory'],['../a02318.html#a31207d2ffa022ff1c85adf4c46f69e69',1,'tesseract::ParagraphTheory::ParagraphTheory()']]],
['parallel',['Parallel',['../a04430.html',1,'tesseract::Parallel'],['../a04430.html#a7d28d110f22fd0ac456c0968676099b7',1,'tesseract::Parallel::Parallel()']]],
['parallel_2ecpp',['parallel.cpp',['../a01007.html',1,'']]],
['parallel_2eh',['parallel.h',['../a01010.html',1,'']]],
['parallel_5fc',['parallel_c',['../a02378.html#a957f0052e222e7eaeb32aa911248bd8d',1,'TO_ROW']]],
['parallel_5ferror',['parallel_error',['../a02378.html#a5d1f18af5019eaab8c1ef611a2e8cb9e',1,'TO_ROW']]],
['parallel_5fif_5fopenmp',['PARALLEL_IF_OPENMP',['../a00962.html#a640e05199d977160f5b1adbeb0b7526a',1,'lstm.cpp']]],
['parallelizebaselines',['ParallelizeBaselines',['../a04494.html#a8a7ab56dd7abc0421cff9680b6634b85',1,'tesseract::BaselineBlock']]],
['param',['Param',['../a02798.html',1,'tesseract::Param'],['../a02798.html#a7d2b3a9b8108f1c1b973f4f498114482',1,'tesseract::Param::Param()']]],
['param_5fdesc',['PARAM_DESC',['../a04170.html',1,'']]],
['paramcontent',['ParamContent',['../a02326.html',1,'ParamContent'],['../a02326.html#ae89257b000ddc430a2df69a4610ab350',1,'ParamContent::ParamContent()=default'],['../a02326.html#aafe9a9672d79a0b8f54e14c818d51482',1,'ParamContent::ParamContent(tesseract::StringParam *it)'],['../a02326.html#a0f7ce09f0abb4f8e195bb8081b9cffb0',1,'ParamContent::ParamContent(tesseract::IntParam *it)'],['../a02326.html#a950bacf688ce4327750e5d8062797d1a',1,'ParamContent::ParamContent(tesseract::BoolParam *it)'],['../a02326.html#a3efc1c9f590624122b9472a0f1af500c',1,'ParamContent::ParamContent(tesseract::DoubleParam *it)']]],
['paramdesc',['ParamDesc',['../a04038.html#af44850047e9f5b3648871d7517c04316',1,'CLUSTERER::ParamDesc()'],['../a04166.html#a57382d35825f360d88f32032e05239f3',1,'NORM_PROTOS::ParamDesc()'],['../a04174.html#acc46f9f5b3cded3ca8e7de3e94407c58',1,'FEATURE_DESC_STRUCT::ParamDesc()']]],
['parameter',['parameter',['../a04770.html#a6e0de466c57df117c731bfb4db68fc79',1,'SVEvent']]],
['params',['Params',['../a04178.html#acdddc3235f689b0d45574003fc3e3b1b',1,'FEATURE_STRUCT::Params()'],['../a02666.html#ac993425386ae1f73762107299ee8a114',1,'tesseract::CCUtil::params()']]],
['params_2ecpp',['params.cpp',['../a00554.html',1,'']]],
['params_2eh',['params.h',['../a00557.html',1,'']]],
['params_5fmodel_2ecpp',['params_model.cpp',['../a01589.html',1,'']]],
['params_5fmodel_2eh',['params_model.h',['../a01592.html',1,'']]],
['params_5fmodel_5f',['params_model_',['../a04818.html#a344405fb6a548551e9e9fd3c6dd38b22',1,'tesseract::LanguageModel']]],
['params_5fmodel_5fclassify_5f',['params_model_classify_',['../a04290.html#a55e77d5ba41d71a1e836f46f93d1b177',1,'tesseract::Dict']]],
['params_5ftraining_5fbundle',['params_training_bundle',['../a02370.html#a6e7a5f37ac60f9b4b5a4c833989b33ed',1,'BlamerBundle']]],
['params_5ftraining_5ffeatdef_2ecpp',['params_training_featdef.cpp',['../a00347.html',1,'']]],
['params_5ftraining_5ffeatdef_2eh',['params_training_featdef.h',['../a00350.html',1,'']]],
['paramsd_2ecpp',['paramsd.cpp',['../a00149.html',1,'']]],
['paramsd_2eh',['paramsd.h',['../a00152.html',1,'']]],
['paramseditor',['ParamsEditor',['../a02330.html',1,'ParamsEditor'],['../a02330.html#af11d1928ed020bf510cc17ce7d848f87',1,'ParamsEditor::ParamsEditor()']]],
['paramsmodel',['ParamsModel',['../a04854.html',1,'tesseract::ParamsModel'],['../a04854.html#aafeab9959cac899236b065d390965662',1,'tesseract::ParamsModel::ParamsModel()'],['../a04854.html#a6aada97119632e8272d3c84c017fcd11',1,'tesseract::ParamsModel::ParamsModel(const char *lang, const GenericVector< float > &weights)']]],
['paramsmodelclassify',['ParamsModelClassify',['../a04290.html#af9525045e3c23632e120c2ad9d734639',1,'tesseract::Dict']]],
['paramsmodelclassifyfunc',['ParamsModelClassifyFunc',['../a01629.html#a57e9ea37415c443dc4f66d72b3a1d88b',1,'tesseract']]],
['paramstrainingbundle',['ParamsTrainingBundle',['../a02554.html',1,'tesseract::ParamsTrainingBundle'],['../a02554.html#a47e9ce115cbbf23de727037891cfe24b',1,'tesseract::ParamsTrainingBundle::ParamsTrainingBundle()']]],
['paramstrainingfeaturebyname',['ParamsTrainingFeatureByName',['../a01629.html#a12cc58bffc8cbb802685ce4cb25aff37',1,'tesseract']]],
['paramstraininghypothesis',['ParamsTrainingHypothesis',['../a02550.html',1,'tesseract::ParamsTrainingHypothesis'],['../a02550.html#a1c30109a96767c1ee27c0b00065ad205',1,'tesseract::ParamsTrainingHypothesis::ParamsTrainingHypothesis()'],['../a02550.html#a00f8e977a94665eefcee06d769a28331',1,'tesseract::ParamsTrainingHypothesis::ParamsTrainingHypothesis(const ParamsTrainingHypothesis &other)']]],
['paramstraininghypothesislist',['ParamsTrainingHypothesisList',['../a01629.html#a008f78a2d77f64f92e6bd4329409f860',1,'tesseract']]],
['paramsvectors',['ParamsVectors',['../a02790.html',1,'tesseract']]],
['paramtype',['ParamType',['../a00152.html#a3a023c0c27667e78ae521eb64f1c7c81',1,'paramsd.h']]],
['paramutils',['ParamUtils',['../a02794.html',1,'tesseract']]],
['parent_5fvse',['parent_vse',['../a04838.html#a8fafa528c3935768a6fe19501c619d5b',1,'tesseract::ViterbiStateEntry']]],
['parse_5ffrom_5fstring',['parse_from_string',['../a03946.html#ac56b3d4af146800dd576dd60a11ea563',1,'CHAR_FRAGMENT']]],
['parsearguments',['ParseArguments',['../a01346.html#a5177d61ebf73a60571198cb6eaa753ac',1,'ParseArguments(int *argc, char ***argv): commontraining.cpp'],['../a01349.html#a5177d61ebf73a60571198cb6eaa753ac',1,'ParseArguments(int *argc, char ***argv): commontraining.cpp']]],
['parseboxfilestr',['ParseBoxFileStr',['../a00239.html#acd464bb54397318c2f6fb8db9e644fd0',1,'ParseBoxFileStr(const char *boxfile_str, int *page_number, STRING *utf8_str, TBOX *bounding_box): boxread.cpp'],['../a00242.html#acd464bb54397318c2f6fb8db9e644fd0',1,'ParseBoxFileStr(const char *boxfile_str, int *page_number, STRING *utf8_str, TBOX *bounding_box): boxread.cpp']]],
['parsecommandlineflags',['ParseCommandLineFlags',['../a01629.html#a07614d344b574ebcc2d3ae4d68fad1d5',1,'tesseract']]],
['parsefontdescriptionname',['ParseFontDescriptionName',['../a04722.html#a3a45803623b1298396c72b157077ea2f',1,'tesseract::PangoFontInfo']]],
['parselanguagestring',['ParseLanguageString',['../a02358.html#added03ae596d720403d5a8227c3e7dcf',1,'tesseract::Tesseract']]],
['part_5fgrid_5f',['part_grid_',['../a02246.html#a4798ba96020b3ce55050b66dd3c72fe0',1,'tesseract::EquationDetect']]],
['part_5fof_5fcombo',['part_of_combo',['../a02542.html#a4ffd6b844b62d19df43effdc3faec8e3',1,'WERD_RES']]],
['partial_5ffuncs_5f',['partial_funcs_',['../a02226.html#a1fcea4ce2c16453174e3386ebd81fdf1',1,'tesseract::IntSimdMatrix']]],
['partial_5fsplit_5fpriority',['partial_split_priority',['../a01547.html#a89f8eb5089f8bf157471ccab31e5c54b',1,'findseam.cpp']]],
['partialfunc',['PartialFunc',['../a02226.html#ad2e7073d382c84f09f72621188e62456',1,'tesseract::IntSimdMatrix']]],
['partialsetpropertiesfromother',['PartialSetPropertiesFromOther',['../a03950.html#a5dffb4b84343be7b6c9a1f011a532a8c',1,'UNICHARSET']]],
['partition_5fcoords',['partition_coords',['../a01208.html#aad2034679e53c7d16b8306b773c552a7',1,'partition_coords(TBOX blobcoords[], int blobcount, char partids[], int bestpart, int xcoords[], int ycoords[]): oldbasel.cpp'],['../a01211.html#aad2034679e53c7d16b8306b773c552a7',1,'partition_coords(TBOX blobcoords[], int blobcount, char partids[], int bestpart, int xcoords[], int ycoords[]): oldbasel.cpp']]],
['partition_5fline',['partition_line',['../a01208.html#a75f15842c2f303b5343bdc22504098a0',1,'partition_line(TBOX blobcoords[], int blobcount, int *numparts, char partids[], int partsizes[], QSPLINE *spline, float jumplimit, float ydiffs[]): oldbasel.cpp'],['../a01211.html#a75f15842c2f303b5343bdc22504098a0',1,'partition_line(TBOX blobcoords[], int blobcount, int *numparts, char partids[], int partsizes[], QSPLINE *spline, float jumplimit, float ydiffs[]): oldbasel.cpp']]],
['partitionfindresult',['PartitionFindResult',['../a01629.html#a2987d37792e5b3297193091de3911634',1,'tesseract']]],
['partitiontype',['PartitionType',['../a04570.html#ab0b7a960040a3ab05a742db3a0565c77',1,'tesseract::ColPartition']]],
['partnerless',['Partnerless',['../a04662.html#a8990fa90af6622a4e2de22cdacb3f2b8',1,'tesseract::TabVector']]],
['partners',['partners',['../a04662.html#a5ae127318dc7432516182d7539b78c84',1,'tesseract::TabVector']]],
['parts_5f',['parts_',['../a04762.html#af895f662c5fda08ebcc244df1ccaddcf',1,'tesseract::Validator']]],
['partsetvector',['PartSetVector',['../a01629.html#a6fb32beebbc5c707d14869180acab99c',1,'tesseract']]],
['pass2_5fok_5fsplit',['pass2_ok_split',['../a04866.html#a671c4b102b976c600adc3bf60ee44323',1,'tesseract::Wordrec']]],
['passenum',['PassEnum',['../a04854.html#af1ac568aa510bbcd30ff34da3d0037f2',1,'tesseract::ParamsModel']]],
['pathlength',['pathlength',['../a02422.html#ae80a9800eb44c83b018277edccc3e015',1,'C_OUTLINE::pathlength()'],['../a02442.html#aaecea5f6d555c95ee89bc1869fd20794',1,'tesseract::DPPoint::Pathlength()']]],
['pattern_5floop_5fedge',['pattern_loop_edge',['../a04258.html#abfa158a70b41c2b27f5344021b9c1ba4',1,'tesseract::Dawg::pattern_loop_edge()'],['../a04306.html#afdaf885d2ca4c6f656b10a908ca45709',1,'tesseract::Trie::pattern_loop_edge()']]],
['pb_5fline_5fit',['PB_LINE_IT',['../a02586.html',1,'PB_LINE_IT'],['../a02586.html#af16844a810674c1c47bb40dc421699e0',1,'PB_LINE_IT::PB_LINE_IT()']]],
['pdblk',['PDBLK',['../a02558.html',1,'PDBLK'],['../a02514.html#a9e4346e037f2cc01c3c51d888531da74',1,'BLOCK::pdblk()'],['../a02558.html#ae31312e99565038e54d111a644060b53',1,'PDBLK::PDBLK()'],['../a02558.html#abea19fb28f42f1eba72477bb039f2951',1,'PDBLK::PDBLK(int16_t xmin, int16_t ymin, int16_t xmax, int16_t ymax)'],['../a00356.html#aedc6a690b03da0d4f84ba90a25b287ab',1,'PDBLK(): pdblock.h']]],
['pdblock_2ecpp',['pdblock.cpp',['../a00353.html',1,'']]],
['pdblock_2eh',['pdblock.h',['../a00356.html',1,'']]],
['pdfrenderer_2ecpp',['pdfrenderer.cpp',['../a00017.html',1,'']]],
['pearson',['pearson',['../a02490.html#a17f417840eb6a900bd71b253fe65beb4',1,'LLSQ']]],
['peektop',['PeekTop',['../a02726.html#a69c1d7916b848a66ac9c473769e92989',1,'tesseract::GenericHeap']]],
['peekworst',['PeekWorst',['../a02726.html#a6277cb29124f9bb98ad8f2f2e1702506',1,'tesseract::GenericHeap']]],
['pen',['Pen',['../a04778.html#a79855c525ec660b452382e9813d2edb5',1,'ScrollView::Pen(Color color)'],['../a04778.html#a34929057291998178b2635cf4b7775fe',1,'ScrollView::Pen(int red, int green, int blue)'],['../a04778.html#ae3ea809b51a795b6fd88273057ebf3bd',1,'ScrollView::Pen(int red, int green, int blue, int alpha)']]],
['pen_5fcolor_5f',['pen_color_',['../a04730.html#ae9f5bfdce8be0c2c6b4c5e2ed2f4c757',1,'tesseract::StringRenderer']]],
['perf_5fcount_5fend',['PERF_COUNT_END',['../a01073.html#a0a1c82e812e15164718039c84cd9e97b',1,'openclwrapper.h']]],
['perf_5fcount_5freport_5fstr',['PERF_COUNT_REPORT_STR',['../a01073.html#a07e95f8da2077671edf586a59bad54a5',1,'openclwrapper.h']]],
['perf_5fcount_5fstart',['PERF_COUNT_START',['../a01073.html#a7b1e67112c5c3cc13ba8f90c8b60f05e',1,'openclwrapper.h']]],
['perf_5fcount_5fsub',['PERF_COUNT_SUB',['../a01073.html#a61302b59795a7ee480de0bb07dda984a',1,'openclwrapper.h']]],
['perf_5fcount_5fverbose',['PERF_COUNT_VERBOSE',['../a01073.html#ac40d4728e19a53dff6d7f4a9da5816fc',1,'openclwrapper.h']]],
['perfect',['PERFECT',['../a01629.html#a135f3f6fb7bfcc33d93018c8f3946901a269f6d78f669a618dd130954b7b83533',1,'tesseract']]],
['perfect_5fdelay_5f',['perfect_delay_',['../a04390.html#a5c17e6af51d1adea269aadf3a595bc5d',1,'tesseract::LSTMTrainer']]],
['perfect_5fwerds',['PERFECT_WERDS',['../a00089.html#a943a2c8946e26cd62fd7a455b7e53c04',1,'fixspace.cpp']]],
['perimeter',['perimeter',['../a02422.html#a6e49349d58ec3dc365d43609a59feb48',1,'C_OUTLINE::perimeter()'],['../a02634.html#aafb7684ebdb3d000001d7b4c6b5a901a',1,'C_BLOB::perimeter()']]],
['perm',['Perm',['../a03978.html#a2327d1db8e954280ae274a0dc106f99c',1,'ADAPTED_CONFIG']]],
['perm_5f',['perm_',['../a04258.html#ad33dc7881a2f933e801f0d5fd4ccbe41',1,'tesseract::Dawg']]],
['perm_5fconfig',['PERM_CONFIG',['../a00644.html#a461ee34b392d9264f8ff553d28029c52',1,'adaptive.h']]],
['perm_5fconfig_5fstruct',['PERM_CONFIG_STRUCT',['../a03974.html',1,'']]],
['perm_5frejected',['perm_rejected',['../a02614.html#aaf1e632d675eb808f894c9691d7604f7',1,'REJ']]],
['permconfigfor',['PermConfigFor',['../a00644.html#aea4d5dd0059c222f111f9537af74a325',1,'adaptive.h']]],
['permconfigs',['PermConfigs',['../a03982.html#ad19f8e0d6520b447871c5d958b367bf4',1,'ADAPT_CLASS_STRUCT']]],
['permdawg_2ecpp',['permdawg.cpp',['../a00917.html',1,'']]],
['permprotos',['PermProtos',['../a03982.html#a0dd8b01d8c5cc59c77098cdb268ce1ea',1,'ADAPT_CLASS_STRUCT']]],
['permute_5fchoices',['permute_choices',['../a04290.html#a0ceb12c3a410ba12fdb9a93df11d47e2',1,'tesseract::Dict']]],
['permuter',['permuter',['../a04286.html#ac6d1140877409a292367493620fd8b9b',1,'tesseract::DawgArgs::permuter()'],['../a04438.html#af6c73a19efa3c4e2726d79e0bccc4f22',1,'tesseract::RecodeNode::permuter()'],['../a04830.html#a172ed1149f12df85de309b228715a002',1,'tesseract::LanguageModelDawgInfo::permuter()'],['../a02606.html#a7a606dd5236e78662fccade85d23edee',1,'WERD_CHOICE::permuter()'],['../a04258.html#aca7e80095930ad1b8ca0a8f852f1c865',1,'tesseract::Dawg::permuter()']]],
['permuter_5fname',['permuter_name',['../a02606.html#ad42008447b223df9bf5e790b9b05d7af',1,'WERD_CHOICE::permuter_name(uint8_t permuter)'],['../a02606.html#a8d3b2f290fb678d5b8407c7d1e370030',1,'WERD_CHOICE::permuter_name() const']]],
['permutertype',['PermuterType',['../a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc',1,'ratngs.h']]],
['perpdisp',['PerpDisp',['../a04490.html#a31f1ab3eb5a4d39c7956b9ad7fba07b0',1,'tesseract::BaselineRow']]],
['pfr_5fnoise',['PFR_NOISE',['../a01629.html#a2987d37792e5b3297193091de3911634af5682e259ea2132d1705be1dc1ddebe1',1,'tesseract']]],
['pfr_5fok',['PFR_OK',['../a01629.html#a2987d37792e5b3297193091de3911634a0a35bbb694c579efc7e7ded8a8a63e73',1,'tesseract']]],
['pfr_5fskew',['PFR_SKEW',['../a01629.html#a2987d37792e5b3297193091de3911634a60a7950f62d772f395a6f1a404f4b8b6',1,'tesseract']]],
['pgedit_2ecpp',['pgedit.cpp',['../a00155.html',1,'']]],
['pgedit_2eh',['pgedit.h',['../a00158.html',1,'']]],
['pgeditor_5fmain',['pgeditor_main',['../a02358.html#ab48cff8de587e3a573a327846e57c51d',1,'tesseract::Tesseract']]],
['pgeditor_5fmsg',['pgeditor_msg',['../a00155.html#ab24fd8ff5eebe93922dcf1c8bee12fb1',1,'pgeditor_msg(const char *msg): pgedit.cpp'],['../a00158.html#ab24fd8ff5eebe93922dcf1c8bee12fb1',1,'pgeditor_msg(const char *msg): pgedit.cpp']]],
['pgeditor_5fshow_5fpoint',['pgeditor_show_point',['../a00155.html#a32e21cde92c5d9918323615c2ae64920',1,'pgeditor_show_point(SVEvent *event): pgedit.cpp'],['../a00158.html#a32e21cde92c5d9918323615c2ae64920',1,'pgeditor_show_point(SVEvent *event): pgedit.cpp']]],
['pgeventhandler',['PGEventHandler',['../a02338.html',1,'PGEventHandler'],['../a02338.html#a9d9d15673f7d24bf751d3d67ea63ddd8',1,'PGEventHandler::PGEventHandler()']]],
['pick_5fclose_5fpoint',['pick_close_point',['../a04866.html#a79aec1d9a1c9c001a24838117585091a',1,'tesseract::Wordrec']]],
['pick_5fgood_5fseam',['pick_good_seam',['../a04866.html#adeb84d8b94a6c87354fc452461de3b39',1,'tesseract::Wordrec']]],
['pick_5fx_5fheight',['pick_x_height',['../a01208.html#a7cfd63f215d5f9d728d795ea43eaf7af',1,'pick_x_height(TO_ROW *row, int modelist[], int lefts[], int rights[], STATS *heightstat, int mode_threshold): oldbasel.cpp'],['../a01211.html#a7cfd63f215d5f9d728d795ea43eaf7af',1,'pick_x_height(TO_ROW *row, int modelist[], int lefts[], int rights[], STATS *heightstat, int mode_threshold): oldbasel.cpp']]],
['pico_5ffeat_5fparam_5fname',['PICO_FEAT_PARAM_NAME',['../a00803.html#ac00e1c5d2ac3096e0928e2186aee1aac',1,'picofeat.h']]],
['pico_5ffeature_5flength',['PICO_FEATURE_LENGTH',['../a00686.html#af9508e257a32a6046ee5b30079a50bdb',1,'featdefs.cpp']]],
['picofeat_2ecpp',['picofeat.cpp',['../a00800.html',1,'']]],
['picofeat_2eh',['picofeat.h',['../a00803.html',1,'']]],
['picofeatdesc',['PicoFeatDesc',['../a00689.html#a41e8458def8175ed44c412097f8c4099',1,'featdefs.h']]],
['picofeatdir',['PicoFeatDir',['../a00803.html#ac00e1c5d2ac3096e0928e2186aee1aaca9895f2baa648985ab8ee5586c1563511',1,'picofeat.h']]],
['picofeaturelength',['PicoFeatureLength',['../a00803.html#a5fb0325a4196a4ea24ba3d256844e467',1,'picofeat.h']]],
['picofeatx',['PicoFeatX',['../a00803.html#ac00e1c5d2ac3096e0928e2186aee1aacaf28d56154a908256d7b3beb62977e2fc',1,'picofeat.h']]],
['picofeaty',['PicoFeatY',['../a00803.html#ac00e1c5d2ac3096e0928e2186aee1aaca43884de5e2e87be26f9642b50135f98a',1,'picofeat.h']]],
['pieces_2ecpp',['pieces.cpp',['../a01595.html',1,'']]],
['piecesallnatural',['PiecesAllNatural',['../a02542.html#a299ea507b80d5df42ae20043d715bcff',1,'WERD_RES']]],
['pile_5fcount',['pile_count',['../a02630.html#a3c8bc9b57b27780a349d55449366c97f',1,'STATS']]],
['pink',['PINK',['../a04778.html#a100504544a5423a94222149ee9ed0fe8aee71d1b0400315f55f86c9723631a10e',1,'ScrollView::PINK()'],['../a00857.html#a17bc059e437838f094a5a25c2d5ab88fa500fa51afdd48f15c4176c234835c182',1,'Pink(): callcpp.h']]],
['pitch_5fcorr_5ffixed',['PITCH_CORR_FIXED',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154a66d4c50c3dfbe049f0600dbff10ec362',1,'blobbox.h']]],
['pitch_5fcorr_5fprop',['PITCH_CORR_PROP',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154aa44925f7147c8bb8948712ba9fbe55d3',1,'blobbox.h']]],
['pitch_5fdecision',['pitch_decision',['../a02378.html#a86c03914f286e37cbbc30e341cf6c253',1,'TO_ROW::pitch_decision()'],['../a02382.html#a034647e00f39451c75edb83da6e4578d',1,'TO_BLOCK::pitch_decision()']]],
['pitch_5fdef',['PITCH_DEF',['../a00551.html#ac3897114422f255ea0d1021a0efd807f',1,'ocrclass.h']]],
['pitch_5fdef_5ffixed',['PITCH_DEF_FIXED',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154a0cba173121a328d3cb40be58bb3fd372',1,'blobbox.h']]],
['pitch_5fdef_5fprop',['PITCH_DEF_PROP',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154a9d6e380146149c1a17e58394bd40e438',1,'blobbox.h']]],
['pitch_5fdunno',['PITCH_DUNNO',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154a10ae5c0248c64ac97f5b982caff993bc',1,'blobbox.h']]],
['pitch_5ffixed',['PITCH_FIXED',['../a00551.html#a8018d90b23ed65b65caa68817bacd512',1,'ocrclass.h']]],
['pitch_5fmaybe_5ffixed',['PITCH_MAYBE_FIXED',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154a4f170138679e21b92bcdb28fa7ee7624',1,'blobbox.h']]],
['pitch_5fmaybe_5fprop',['PITCH_MAYBE_PROP',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154aa52a7d1e5021f648986d68ab18d5fe6a',1,'blobbox.h']]],
['pitch_5ftype',['PITCH_TYPE',['../a00224.html#a4c698e96e1ebeb67e13f584c524fd154',1,'blobbox.h']]],
['pitch_5fvar',['PITCH_VAR',['../a00551.html#a807aa057a46ece9ccf5f3793c6a12089',1,'ocrclass.h']]],
['pithsync_2ecpp',['pithsync.cpp',['../a01214.html',1,'']]],
['pithsync_2eh',['pithsync.h',['../a01217.html',1,'']]],
['pitsync1_2ecpp',['pitsync1.cpp',['../a01220.html',1,'']]],
['pitsync1_2eh',['pitsync1.h',['../a01223.html',1,'']]],
['pitsync_5ffake_5fdepth',['pitsync_fake_depth',['../a01220.html#a017f9254f6b703215cfe5940a67d52f2',1,'pitsync_fake_depth(): pitsync1.cpp'],['../a01223.html#a017f9254f6b703215cfe5940a67d52f2',1,'pitsync_fake_depth(): pitsync1.cpp']]],
['pitsync_5fjoined_5fedge',['pitsync_joined_edge',['../a01220.html#a06bb83057da5b8bc252bac729baa0a65',1,'pitsync_joined_edge(): pitsync1.cpp'],['../a01223.html#a06bb83057da5b8bc252bac729baa0a65',1,'pitsync_joined_edge(): pitsync1.cpp']]],
['pitsync_5foffset_5ffreecut_5ffraction',['pitsync_offset_freecut_fraction',['../a01220.html#a676189661b13473a99c0242726cdc08a',1,'pitsync_offset_freecut_fraction(): pitsync1.cpp'],['../a01223.html#a676189661b13473a99c0242726cdc08a',1,'pitsync_offset_freecut_fraction(): pitsync1.cpp']]],
['pix',['pix',['../a02510.html#ab0049defd6f06bb4a56600cda5740b51',1,'DENORM']]],
['pix_5f',['pix_',['../a02362.html#a8ffaca2b9b8f5c01df4959d043564e44',1,'tesseract::ImageThresholder']]],
['pix_5fbinary',['pix_binary',['../a02358.html#ae6daf71366bf37ae460f95c5d9cad11b',1,'tesseract::Tesseract']]],
['pix_5fchannels_5f',['pix_channels_',['../a02362.html#ac1e0c609f5468520746233102f4e654c',1,'tesseract::ImageThresholder']]],
['pix_5fgrey',['pix_grey',['../a02358.html#a03e51d9200586d7164574b8ae9498d69',1,'tesseract::Tesseract']]],
['pix_5fldistance',['pix_ldistance',['../a02306.html#a73c65095fd2f4989243f008a2371cb4e',1,'tesseract::RowInfo']]],
['pix_5foriginal',['pix_original',['../a02358.html#a87360c517f48316e9817bdc8ede63d0e',1,'tesseract::Tesseract']]],
['pix_5frdistance',['pix_rdistance',['../a02306.html#a05b44b71c393e82ac5e5630a0d430629',1,'tesseract::RowInfo']]],
['pix_5fwpl_5f',['pix_wpl_',['../a02362.html#a17a1faa196e7b195dc5ff5eec60e3814',1,'tesseract::ImageThresholder']]],
['pix_5fxheight',['pix_xheight',['../a02306.html#a0a8039b47badfeb0f1a422e543c034f9',1,'tesseract::RowInfo']]],
['pixel_5fdiff',['pixel_diff',['../a02418.html#a23a5741ba55744d51b791778f9f94afb',1,'EdgeOffset']]],
['pixelhistogram',['PixelHistogram',['../a04582.html',1,'tesseract::PixelHistogram'],['../a04582.html#a7aae88da4ca93d46a01a3593a3b6d6bc',1,'tesseract::PixelHistogram::PixelHistogram()']]],
['pixnearlyrectangular',['pixNearlyRectangular',['../a04606.html#a3797147bcff0b7fd5ffee3f818770165',1,'tesseract::ImageFind']]],
['platform_2eh',['platform.h',['../a00560.html',1,'']]],
['plot',['plot',['../a02374.html#a298c71714cb9c1dfa613bddb8e48f75d',1,'BLOBNBOX::plot()'],['../a02394.html#a32b0c2d11e9ebe59d1a1d8b3cf4c6d18',1,'TESSLINE::plot()'],['../a02398.html#aea2abdf5701d97f2aece1a5fbabaf77e',1,'TBLOB::plot()'],['../a02402.html#afe89f2f31b48fa578028f2527b55e144',1,'TWERD::plot()'],['../a02422.html#a7b8b4b67944f30154c3550f9b2bc6329',1,'C_OUTLINE::plot()'],['../a02526.html#a0b42c2eec2fb387a8ff72889451f9665',1,'ROW::plot(ScrollView *window, ScrollView::Color colour)'],['../a02526.html#ac7752c9f627f09538e643a7372455c40',1,'ROW::plot(ScrollView *window)'],['../a02558.html#a6d1e10da021eb64f99977a60cc7ec2f0',1,'PDBLK::plot()'],['../a02582.html#afdff361301e7f7aab1e74fdfda4eac55',1,'POLY_BLOCK::plot()'],['../a02598.html#a76779877e010949e0055ed273801619d',1,'QSPLINE::plot(ScrollView *window, ScrollView::Color colour) const'],['../a02598.html#af57ba3f496f4e836f9cdb4fe6108e27d',1,'QSPLINE::plot(Pix *pix) const'],['../a02610.html#a2d91b8ccc95f5f2c0e9966d3c6ebe52f',1,'TBOX::plot(ScrollView *fd) const'],['../a02610.html#adc1740a3013eb2f7fec6be3b04532860',1,'TBOX::plot(ScrollView *fd, ScrollView::Color fill_colour, ScrollView::Color border_colour) const'],['../a02630.html#a0dbbddacbc53584813552dfdd9eb7bab',1,'STATS::plot()'],['../a02634.html#a229bd1845ea91366349c7dee1d52360a',1,'C_BLOB::plot()'],['../a02638.html#ae88f52597b2b6fffa9ca2f8be53908c4',1,'WERD::plot(ScrollView *window, ScrollView::Color colour)'],['../a02638.html#ac6f328d2ebd8c59f38ac1c15f53073d4',1,'WERD::plot(ScrollView *window)']]],
['plot_5fbaseline',['plot_baseline',['../a02526.html#ad38403a98f61a77fe3bf82afedc8d3d2',1,'ROW']]],
['plot_5fblob_5flist',['plot_blob_list',['../a00221.html#a331e6744e04cb0a2fb23c1465c82196c',1,'plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour): blobbox.cpp'],['../a00224.html#a331e6744e04cb0a2fb23c1465c82196c',1,'plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour): blobbox.cpp']]],
['plot_5fbox_5flist',['plot_box_list',['../a01154.html#a5408725b0921a22271363f8c1adc293e',1,'plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour): drawtord.cpp'],['../a01157.html#a5408725b0921a22271363f8c1adc293e',1,'plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour): drawtord.cpp']]],
['plot_5ffp_5fcells',['plot_fp_cells',['../a01154.html#a463f0f31556776b160312f2b10aec4ec',1,'plot_fp_cells(ScrollView *win, ScrollView::Color colour, BLOBNBOX_IT *blob_it, int16_t pitch, int16_t blob_count, STATS *projection, int16_t projection_left, int16_t projection_right, float projection_scale): drawtord.cpp'],['../a01157.html#a463f0f31556776b160312f2b10aec4ec',1,'plot_fp_cells(ScrollView *win, ScrollView::Color colour, BLOBNBOX_IT *blob_it, int16_t pitch, int16_t blob_count, STATS *projection, int16_t projection_left, int16_t projection_right, float projection_scale): drawtord.cpp']]],
['plot_5ffp_5fcells2',['plot_fp_cells2',['../a01154.html#a00892e8dcc8d387749ad7e0a8b0b5f8c',1,'plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list): drawtord.cpp'],['../a01157.html#a00892e8dcc8d387749ad7e0a8b0b5f8c',1,'plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list): drawtord.cpp']]],
['plot_5ffp_5fword',['plot_fp_word',['../a01280.html#a39a1be499c86f5a74b371323f3c1f873',1,'plot_fp_word(TO_BLOCK *block, float pitch, float nonspace): topitch.cpp'],['../a01283.html#a39a1be499c86f5a74b371323f3c1f873',1,'plot_fp_word(TO_BLOCK *block, float pitch, float nonspace): topitch.cpp']]],
['plot_5fgraded_5fblobs',['plot_graded_blobs',['../a02382.html#afd0504ca5c8fa605fbea3dbca2d8ee2e',1,'TO_BLOCK']]],
['plot_5fnoise_5fblobs',['plot_noise_blobs',['../a02382.html#ae1af42d3d5b1cc342627c6e3be93a1d4',1,'TO_BLOCK']]],
['plot_5fnormed',['plot_normed',['../a02422.html#afb1b75357dfc2f7a5d76db50e0816b02',1,'C_OUTLINE::plot_normed()'],['../a02634.html#a8744be17fe315d5774e92f8a386b9422',1,'C_BLOB::plot_normed()']]],
['plot_5fparallel_5frow',['plot_parallel_row',['../a01154.html#a45fd44462f3b32c42b22004d951af0b6',1,'plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation): drawtord.cpp'],['../a01157.html#a45fd44462f3b32c42b22004d951af0b6',1,'plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation): drawtord.cpp']]],
['plot_5frej_5fblobs',['plot_rej_blobs',['../a02638.html#adc9c85b2475c4165e3d9ea984be5a0f2',1,'WERD']]],
['plot_5frow_5fcells',['plot_row_cells',['../a01154.html#a0e989a3f79b110a1bcd477561de37207',1,'plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells): drawtord.cpp'],['../a01157.html#a0e989a3f79b110a1bcd477561de37207',1,'plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells): drawtord.cpp']]],
['plot_5fto_5frow',['plot_to_row',['../a01154.html#ac61d56bb753572e573a45e56823b92c0',1,'plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation): drawtord.cpp'],['../a01157.html#ac61d56bb753572e573a45e56823b92c0',1,'plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation): drawtord.cpp']]],
['plot_5fword_5fdecisions',['plot_word_decisions',['../a01154.html#a76f46f528183ee4d81bf7769611ab01d',1,'plot_word_decisions(ScrollView *win, int16_t pitch, TO_ROW *row): drawtord.cpp'],['../a01157.html#a76f46f528183ee4d81bf7769611ab01d',1,'plot_word_decisions(ScrollView *win, int16_t pitch, TO_ROW *row): drawtord.cpp']]],
['plotblobs',['PlotBlobs',['../a02374.html#a4390090c077b282cb4bc814633cb8e27',1,'BLOBNBOX']]],
['plotedges_2ecpp',['plotedges.cpp',['../a01598.html',1,'']]],
['plotedges_2eh',['plotedges.h',['../a01601.html',1,'']]],
['plotgradedblobs',['PlotGradedBlobs',['../a04666.html#aac6c563b3b6bc5f903f7c4b0061daf32',1,'tesseract::TextlineProjection']]],
['plotline',['plotline',['../a02630.html#ac41165fa94ea2483fd82c31d6f9a1345',1,'STATS']]],
['plotnoiseblobs',['PlotNoiseBlobs',['../a02374.html#a64e7f32e8eb4319767dfb632db3867bf',1,'BLOBNBOX']]],
['plum',['PLUM',['../a04778.html#a100504544a5423a94222149ee9ed0fe8aee2267f1436fd5c51d0c9d0a2166b7e2',1,'ScrollView::PLUM()'],['../a00857.html#a17bc059e437838f094a5a25c2d5ab88fa9c05314e65fbb3aa4605f979158358b8',1,'Plum(): callcpp.h']]],
['plumbing',['Plumbing',['../a04434.html',1,'tesseract::Plumbing'],['../a04434.html#a83e7780330c8a41efe797e55056175e2',1,'tesseract::Plumbing::Plumbing()']]],
['plumbing_2ecpp',['plumbing.cpp',['../a01013.html',1,'']]],
['plumbing_2eh',['plumbing.h',['../a01016.html',1,'']]],
['plus',['PLUS',['../a00554.html#a0ea7ff5947c5f5430a29fdd98391eb2a',1,'params.cpp']]],
['point',['Point',['../a04162.html#a2b633b56b9a1a71a23551e387b7c8af4',1,'MFEDGEPT']]],
['point1',['point1',['../a02626.html#a6e1438a5497d0376b4daed310395d7bf',1,'SPLIT']]],
['point2',['point2',['../a02626.html#a71ffab0530d007b565e69711594afa08',1,'SPLIT']]],
['point_5fdiff',['point_diff',['../a00443.html#adc5b1f2b1c3f7afb5b0b035449f5e2ec',1,'vecfuncs.h']]],
['point_5fpriority',['point_priority',['../a04866.html#adfe6b5aa74fe948a11bf631af18e7494',1,'tesseract::Wordrec']]],
['point_5fsize',['point_size',['../a02782.html#a41a59a3cd37211860534e730bec36883',1,'EANYCODE_CHAR']]],
['pointat',['PointAt',['../a00767.html#aabb22902a8c1b9a830cb6347a474feea',1,'mfoutline.h']]],
['pointervector',['PointerVector',['../a02730.html',1,'tesseract::PointerVector< T >'],['../a02730.html#a022d9a96e0d6c359284232387db109f3',1,'tesseract::PointerVector::PointerVector()'],['../a02730.html#ada50f92a05337f4f193de0179fae226c',1,'tesseract::PointerVector::PointerVector(int size)'],['../a02730.html#a9fb21553c3e9d1c7582deebc3be62d9c',1,'tesseract::PointerVector::PointerVector(const PointerVector &other)']]],
['pointervector_3c_20genericvector_3c_20double_20_3e_20_3e',['PointerVector< GenericVector< double > >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20recodebeam_20_3e',['PointerVector< RecodeBeam >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3abaselineblock_20_3e',['PointerVector< tesseract::BaselineBlock >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3abaselinerow_20_3e',['PointerVector< tesseract::BaselineRow >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3adocumentdata_20_3e',['PointerVector< tesseract::DocumentData >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3aimagedata_20_3e',['PointerVector< tesseract::ImageData >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3alanguagemodelstate_20_3e',['PointerVector< tesseract::LanguageModelState >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3anetwork_20_3e',['PointerVector< tesseract::Network >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3anetworkio_20_3e',['PointerVector< tesseract::NetworkIO >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3ashape_20_3e',['PointerVector< tesseract::Shape >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3atrainingsample_20_3e',['PointerVector< tesseract::TrainingSample >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20tesseract_3a_3atransposedarray_20_3e',['PointerVector< tesseract::TransposedArray >',['../a02730.html',1,'tesseract']]],
['pointervector_3c_20werd_5fres_20_3e',['PointerVector< WERD_RES >',['../a02730.html',1,'tesseract']]],
['pointheap',['PointHeap',['../a01532.html#a6ea49e5c54f90d06755a9ad39bda3b1d',1,'chop.h']]],
['pointinside',['PointInside',['../a01394.html#a1d5c536e89d2c8814a6324cc185e2d9d',1,'PointInside(FRECT *Rectangle, float X, float Y): mergenf.cpp'],['../a01397.html#a1d5c536e89d2c8814a6324cc185e2d9d',1,'PointInside(FRECT *Rectangle, float X, float Y): mergenf.cpp']]],
['pointpair',['PointPair',['../a01532.html#ab644b1a83b3ef5c62442fac3f0f67b12',1,'chop.h']]],
['points',['points',['../a02582.html#a0835a8ea39e763d6a229603d5532c879',1,'POLY_BLOCK']]],
['points_2ecpp',['points.cpp',['../a00359.html',1,'']]],
['points_2eh',['points.h',['../a00362.html',1,'']]],
['poly2',['poly2',['../a00365.html#ab1a151f8dbd379f2ecf2d59f9ce2bc23',1,'poly2(EDGEPT *startpt, int area): polyaprx.cpp'],['../a00368.html#ab1a151f8dbd379f2ecf2d59f9ce2bc23',1,'poly2(EDGEPT *startpt, int area): polyaprx.cpp']]],
['poly_5fallow_5fdetailed_5ffx',['poly_allow_detailed_fx',['../a02358.html#ae1206c0c4b63a008cc01650004fb7b03',1,'tesseract::Tesseract']]],
['poly_5fblock',['POLY_BLOCK',['../a02582.html',1,'POLY_BLOCK'],['../a02558.html#a87856f8400f0629dc761fec0f7a17b57',1,'PDBLK::poly_block()'],['../a02582.html#a072aee065c4dbcd7b3aa2a0a11092b06',1,'POLY_BLOCK::POLY_BLOCK()=default'],['../a02582.html#a0503034113163e4f5ab8338d7fcc63c8',1,'POLY_BLOCK::POLY_BLOCK(const TBOX &tbox, PolyBlockType type)'],['../a02582.html#a064dae5963de56ef8ab7d70afd04dbc8',1,'POLY_BLOCK::POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType type)']]],
['poly_5fdebug',['poly_debug',['../a00365.html#af4b004883139214414d5ed6f109bbd17',1,'polyaprx.cpp']]],
['poly_5fwide_5fobjects_5fbetter',['poly_wide_objects_better',['../a00365.html#ac0b10a62dff4fda6c92ebb536e387d21',1,'polyaprx.cpp']]],
['polyaprx_2ecpp',['polyaprx.cpp',['../a00365.html',1,'']]],
['polyaprx_2eh',['polyaprx.h',['../a00368.html',1,'']]],
['polyblk_2ecpp',['polyblk.cpp',['../a00371.html',1,'']]],
['polyblk_2eh',['polyblk.h',['../a00374.html',1,'']]],
['polyblocktype',['PolyBlockType',['../a00380.html#a03566528a98c079dafeebf00502f2b60',1,'publictypes.h']]],
['polygonal_5fcmd_5fevent',['POLYGONAL_CMD_EVENT',['../a00155.html#a403a043f57fa17a455baa86114cd4154a5d1e7f13fe04e15c934fe266110ce8a0',1,'pgedit.cpp']]],
['polygonalcopy',['PolygonalCopy',['../a02398.html#a7b6051e1c1934265a91e1ee864bd5164',1,'TBLOB::PolygonalCopy()'],['../a02402.html#acb450fc7232032170beacf07d4069732',1,'TWERD::PolygonalCopy()']]],
['pop',['Pop',['../a02726.html#a65f73703e294dddf82497c483584f5f9',1,'tesseract::GenericHeap::Pop()'],['../a00878.html#a4a16ea0d766f4b3bc697142d5303a62c',1,'pop(LIST list): oldlist.cpp'],['../a00881.html#a4a16ea0d766f4b3bc697142d5303a62c',1,'pop(LIST list): oldlist.cpp']]],
['pop_5fback',['pop_back',['../a02182.html#a0621dd57ce58dae3cb5f3d61e76bd233',1,'GenericVector']]],
['pop_5foff',['pop_off',['../a00881.html#a162ee82d7627f9be2a60d54c735697b5',1,'oldlist.h']]],
['popupitem',['PopupItem',['../a04778.html#a245a24cbd1ad39085e450765980113e1',1,'ScrollView::PopupItem(const char *parent, const char *name)'],['../a04778.html#ad9671cdaa4e47c782138f0e99ec1da20',1,'ScrollView::PopupItem(const char *parent, const char *name, int cmdEvent, const char *value, const char *desc)']]],
['popworst',['PopWorst',['../a02726.html#a2c7c50a73339f8093d05c30817ebf9a7',1,'tesseract::GenericHeap']]],
['pos',['pos',['../a02390.html#adee462d390e637a8393ba373c8d2a1bb',1,'EDGEPT::pos()'],['../a02426.html#ae7bcdb1f6f28f612a0ff4ace03b38165',1,'CRACKEDGE::pos()']]],
['posandsizeagree',['PosAndSizeAgree',['../a02602.html#a86bc72a1cdf65f78694de8bc18e4b565',1,'BLOB_CHOICE']]],
['position',['position',['../a04614.html#afb531923104630b4eb4d48acccc4679f',1,'FPCUTPT::position()'],['../a04618.html#a2e3b5cbc30d881958c55e390365e7d9b',1,'FPSEGPT::position()']]],
['position_5fat_5findex',['position_at_index',['../a02422.html#a9ab7b959ca8b1b6b5d6d85b95c851201',1,'C_OUTLINE']]],
['positionedatsameword',['PositionedAtSameWord',['../a02278.html#a512d630c4f7b5662a96af6da86a25658',1,'tesseract::PageIterator']]],
['positionfrombuckets',['PositionFromBuckets',['../a04074.html#adea89a64ac5798b190d2d89dce381e71',1,'tesseract::IntFeatureSpace']]],
['positionfromindex',['PositionFromIndex',['../a04074.html#a89de22c1c2aef24cae668aa656790161',1,'tesseract::IntFeatureSpace']]],
['positionofbestmatch',['PositionOfBestMatch',['../a04406.html#a6432c332545b499c7ed687847740c649',1,'tesseract::NetworkIO']]],
['post_5fload_5fsetup',['post_load_setup',['../a03950.html#ac704da42f758626cf6d24491b5ffb3e5',1,'UNICHARSET']]],
['postloadcleanup',['PostLoadCleanup',['../a04158.html#a22e405da9437d15500ed6796a0195143',1,'tesseract::MasterTrainer']]],
['potential_5fword_5fcrunch',['potential_word_crunch',['../a02358.html#abaf0e879a8660f0ff78364960b9b9b8f',1,'tesseract::Tesseract']]],
['pprunerbitindexfor',['PPrunerBitIndexFor',['../a00737.html#a1984b3429755e6ddd8c41a4877674863',1,'intproto.h']]],
['pprunermaskfor',['PPrunerMaskFor',['../a00737.html#aa5e907e17b721089448946166789f7e6',1,'intproto.h']]],
['pprunerwordindexfor',['PPrunerWordIndexFor',['../a00737.html#a0855a639976fdb01523615955dd23e03',1,'intproto.h']]],
['pr_5fnonsp',['pr_nonsp',['../a02378.html#a323c76c41077d4ada275cc5e2e979a52',1,'TO_ROW::pr_nonsp()'],['../a02382.html#a21f28449a45963c01186652c0e3b09c8',1,'TO_BLOCK::pr_nonsp()']]],
['pr_5fspace',['pr_space',['../a02378.html#a129c37c4cc8d85b7f49a8fcdbcf5f928',1,'TO_ROW::pr_space()'],['../a02382.html#ac44a3329ef87feb53f417773b8ec753d',1,'TO_BLOCK::pr_space()']]],
['pre_5fassociate_5fblobs',['pre_associate_blobs',['../a01202.html#a18cd081fdb5a70768e2a93473418c13a',1,'pre_associate_blobs(ICOORD page_tr, TO_BLOCK *block, FCOORD rotation, bool testing_on): makerow.cpp'],['../a01205.html#a18cd081fdb5a70768e2a93473418c13a',1,'pre_associate_blobs(ICOORD page_tr, TO_BLOCK *block, FCOORD rotation, bool testing_on): makerow.cpp']]],
['predecessor',['predecessor',['../a02510.html#ac2cd872982cfe3caf8483266d21a1e63',1,'DENORM']]],
['preenxheights',['PreenXHeights',['../a02358.html#a9cdc0e4ef9b85ed1b047764e9560196d',1,'tesseract::Tesseract']]],
['prefix_5fin_5fdawg',['prefix_in_dawg',['../a04258.html#a2306a358490ae46f060f8ad5fa6db832',1,'tesseract::Dawg']]],
['preparedistortedpix',['PrepareDistortedPix',['../a01629.html#a86417193af3bfa69d20ce6dbe2af1261',1,'tesseract']]],
['prepareforbackward',['PrepareForBackward',['../a04390.html#a05a3ccc7ae0b666678089622c6af9830',1,'tesseract::LSTMTrainer']]],
['prepareforpageseg',['PrepareForPageseg',['../a02358.html#ac91217d377d153e34cf89961cd9b0b2f',1,'tesseract::Tesseract']]],
['prepareforsplinefitting',['PrepareForSplineFitting',['../a04494.html#ab6e80c4b218c94c056659659a4d5e59b',1,'tesseract::BaselineBlock']]],
['preparefortessocr',['PrepareForTessOCR',['../a02358.html#a8c193bd6f78f20373ed9b0fb63984733',1,'tesseract::Tesseract']]],
['preparelogmsg',['PrepareLogMsg',['../a04390.html#a0e2ae9921658399730005a0560272283',1,'tesseract::LSTMTrainer']]],
['preparelstminputs',['PrepareLSTMInputs',['../a04378.html#a9cceec01bb74f8872ab5a254ac5f73f1',1,'tesseract::Input']]],
['preparepixinput',['PreparePixInput',['../a04378.html#a614b8792c46699f23aab5c8e61d0e2ab',1,'tesseract::Input']]],
['preparetoinsertseam',['PrepareToInsertSeam',['../a02622.html#a6ce6b5f3aee9f7eac2bcb2980a5e2162',1,'SEAM']]],
['preparetowrite',['PrepareToWrite',['../a04686.html#a809c087af42348fc1497c663483e5c77',1,'tesseract::BoxChar']]],
['prerecallwordspar',['PrerecAllWordsPar',['../a02358.html#aed023036d84d981089ea0a0828e0e595',1,'tesseract::Tesseract']]],
['prescale',['PreScale',['../a02478.html#a516d8b162fb672b7bc5dc583ca4265f9',1,'tesseract::ImageData']]],
['preserve_5finterword_5fspaces',['preserve_interword_spaces',['../a02358.html#a8a4f92c5ddac8da57ca85e0a2cd0f5ef',1,'tesseract::Tesseract']]],
['preserve_5foutline',['preserve_outline',['../a01535.html#a0a3b9f61e193c679c40344dad4267e3d',1,'preserve_outline(EDGEPT *start): chopper.cpp'],['../a01538.html#a0a3b9f61e193c679c40344dad4267e3d',1,'preserve_outline(EDGEPT *start): chopper.cpp']]],
['preserve_5foutline_5ftree',['preserve_outline_tree',['../a01535.html#af2a51913c75408354ffd6e5344c30389',1,'preserve_outline_tree(TESSLINE *srcline): chopper.cpp'],['../a01538.html#af2a51913c75408354ffd6e5344c30389',1,'preserve_outline_tree(TESSLINE *srcline): chopper.cpp']]],
['pretrainedtemplates',['PreTrainedTemplates',['../a03998.html#a64383806f917e682c4a644efdd71d530',1,'tesseract::Classify']]],
['pretrainingsetup',['PreTrainingSetup',['../a04158.html#a5708ffeae4662b9f2b09b2ef76ba9d20',1,'tesseract::MasterTrainer']]],
['prev',['prev',['../a02390.html#a8326da8daf597bcdc5a05064a37cbbb1',1,'EDGEPT::prev()'],['../a02426.html#a22411a30eb2b7529ccb755dc3971b0d1',1,'CRACKEDGE::prev()'],['../a04438.html#a0eadbbc3fc13a17a9a7616b9770e3b98',1,'tesseract::RecodeNode::prev()']]],
['prev_5fblock',['prev_block',['../a02546.html#a872e8f5ce0da4f99413d9d55c8214748',1,'PAGE_RES_IT']]],
['prev_5frow',['prev_row',['../a02546.html#a32f7ecd54106290053205cc118395d8d',1,'PAGE_RES_IT']]],
['prev_5fsample_5fiteration_5f',['prev_sample_iteration_',['../a04390.html#acf11b4f14f80f7c155744a2e69ba6736',1,'tesseract::LSTMTrainer']]],
['prev_5fword',['prev_word',['../a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee',1,'tesseract::WordData::prev_word()'],['../a02546.html#a5bb88f3eab337643069e11de386100eb',1,'PAGE_RES_IT::prev_word()']]],
['prev_5fword_5fbest_5fchoice',['prev_word_best_choice',['../a02530.html#a1c5edd82d9dbca80e3042fa38ada0a54',1,'PAGE_RES']]],
['prev_5fword_5fbest_5fchoice_5f',['prev_word_best_choice_',['../a04866.html#a143608f482c6c0c4f312740e6a5f5fd9',1,'tesseract::Wordrec']]],
['prev_5fword_5fstr_5f',['prev_word_str_',['../a04818.html#a1eeb6e0ec00c1b3bd5824423da13c408',1,'tesseract::LanguageModel']]],
['prev_5fword_5funichar_5fstep_5flen_5f',['prev_word_unichar_step_len_',['../a04818.html#a52a5540ea4de4f4b830dbcbb220d6bff',1,'tesseract::LanguageModel']]],
['previous',['previous',['../a04614.html#af9b9cd3fd3e437486e6020d16580fe9d',1,'FPCUTPT::previous()'],['../a04618.html#a4386c87b640304091479028601b74ff9',1,'FPSEGPT::previous()']]],
['previousdirection',['PreviousDirection',['../a04162.html#a47d3c4465ab5bb663d77c507cfebc18a',1,'MFEDGEPT']]],
['print',['print',['../a02378.html#a37b9bbaeccfe47e4403bd3ed320983de',1,'TO_ROW::print()'],['../a02498.html#a614c673fe776cb6f98bcfaeb59e5e109',1,'MATRIX::print()'],['../a02514.html#aa0f1d6d5d5ea36db30221579c9d356c2',1,'BLOCK::print()'],['../a02526.html#ae48a5c7845ce2d82fa897e4f3d96198e',1,'ROW::print()'],['../a02602.html#ab4b4b87308f7a1d3f59228683b32b56f',1,'BLOB_CHOICE::print()'],['../a02606.html#af1ae6bf0c69cf408c3efa6fb78bcabc7',1,'WERD_CHOICE::print() const'],['../a02606.html#a8db9b75a4e2c831e7e0be76cdfad5a1d',1,'WERD_CHOICE::print(const char *msg) const'],['../a02610.html#a61af64df548c7638bf005fcd8343c435',1,'TBOX::print()'],['../a02618.html#a124889539460b8c200b3186da4a692e0',1,'REJMAP::print()'],['../a02630.html#a99d575509790164609442b71e4cb9982',1,'STATS::print()'],['../a02638.html#a5a2d228e15200b7535fac2144109b677',1,'WERD::print()'],['../a02642.html#a555621fcd9c34b946ed7235cdd8653e6',1,'tesseract::UnicharIdArrayUtils::print()'],['../a04130.html#a3df5da933e95b4d6c63586b63ee9a88b',1,'INT_FEATURE_STRUCT::print()'],['../a02510.html#a04eb6a8e85731a59780ad5e93d41290f',1,'DENORM::Print()'],['../a02622.html#af7dafc449064c67d3eba53c94f761726',1,'SEAM::Print()'],['../a02626.html#a92c64d68f081746782554c80bbaca59c',1,'SPLIT::Print()'],['../a04202.html#a26b89daaefe26ca30a5bb507848cd1ea',1,'tesseract::UnicharRating::Print()'],['../a04406.html#a57209d20fd7c84c01eddbf6af1288110',1,'tesseract::NetworkIO::Print()'],['../a04438.html#a4eb600d5b664a2d8d33301501fbedae3',1,'tesseract::RecodeNode::Print()'],['../a04462.html#abee71eb0b3a1208641177dd3fa3df170',1,'tesseract::StaticShape::Print()'],['../a04490.html#a1b1af2359af16a1a44ec5dcf74114142',1,'tesseract::BaselineRow::Print()'],['../a04570.html#a7179ed632c13592a88667043f964febe',1,'tesseract::ColPartition::Print()'],['../a04578.html#a51f3aa3845b8ea00943fac4ca72e905f',1,'tesseract::ColPartitionSet::Print()'],['../a04662.html#a8cfd3dfed67ed93c57f40f15bc724e1e',1,'tesseract::TabVector::Print()'],['../a04810.html#a3f7be6507f48cb03151615b750579af8',1,'tesseract::AssociateStats::Print()'],['../a04838.html#a84ae8c3f67641cfe706263593325d3f4',1,'tesseract::ViterbiStateEntry::Print()'],['../a04842.html#a1ac5f824607fbc600f076afe0edc8f77',1,'tesseract::LanguageModelState::Print()'],['../a04854.html#ae4572db84f4263b4e7111fc17e7d1726',1,'tesseract::ParamsModel::Print()']]],
['print_5fall',['print_all',['../a04306.html#a34ed0e1ea9fce2a12bb02a61e166a784',1,'tesseract::Trie']]],
['print_5fblock_5fcounts',['print_block_counts',['../a01280.html#aa5338a403a2e0124608ba81678f83490',1,'print_block_counts(TO_BLOCK *block, int32_t block_index): topitch.cpp'],['../a01283.html#aa5338a403a2e0124608ba81678f83490',1,'print_block_counts(TO_BLOCK *block, int32_t block_index): topitch.cpp']]],
['print_5fedge_5frec',['print_edge_rec',['../a04306.html#af5d309c990c287c6934ce2bd3f772092',1,'tesseract::Trie']]],
['print_5ffeature_5fmatches',['PRINT_FEATURE_MATCHES',['../a00737.html#af5131c6984c3afc47e8344ae4a440ccd',1,'intproto.h']]],
['print_5ffull',['print_full',['../a02602.html#ae0a65afa81ba0908798355ec29582098',1,'BLOB_CHOICE']]],
['print_5fmatch_5fsummary',['PRINT_MATCH_SUMMARY',['../a00737.html#aa2ca7d346731ee98e1ef445c0313d0db',1,'intproto.h']]],
['print_5fnode',['print_node',['../a04258.html#aa9e379edd04453122e805d9266f8f21c',1,'tesseract::Dawg::print_node()'],['../a04270.html#ad1967f664815b772205830f30a26ecc0',1,'tesseract::SquishedDawg::print_node()'],['../a04306.html#acef9a1c34e04d962e3bdf5b1d7adba80',1,'tesseract::Trie::print_node()']]],
['print_5fpitch_5fsd',['print_pitch_sd',['../a01280.html#ab67ac34396527cdc2e36c6e3ca75444d',1,'print_pitch_sd(TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float initial_pitch): topitch.cpp'],['../a01283.html#ab67ac34396527cdc2e36c6e3ca75444d',1,'print_pitch_sd(TO_ROW *row, STATS *projection, int16_t projection_left, int16_t projection_right, float space_size, float initial_pitch): topitch.cpp']]],
['print_5fproto_5fmatches',['PRINT_PROTO_MATCHES',['../a00737.html#aed2eae56505e79fb4ad49057437bd377',1,'intproto.h']]],
['print_5fratings_5flist',['print_ratings_list',['../a00398.html#a2de5b7d5a020bb9823091dbece4ea36e',1,'print_ratings_list(const char *msg, BLOB_CHOICE_LIST *ratings, const UNICHARSET &current_unicharset): ratngs.cpp'],['../a00401.html#a2de5b7d5a020bb9823091dbece4ea36e',1,'print_ratings_list(const char *msg, BLOB_CHOICE_LIST *ratings, const UNICHARSET &current_unicharset): ratngs.cpp']]],
['print_5frows',['print_rows',['../a02382.html#a2c7cbdd280f7965433e685ac0ba6ae97',1,'TO_BLOCK']]],
['print_5fscores',['print_scores',['../a02266.html#ae041af033010cb111f0e46508eb5544e',1,'OSResults::print_scores(void) const'],['../a02266.html#ab0671ec364a43c88a3a71b8b6fe45351',1,'OSResults::print_scores(int orientation_id) const']]],
['print_5fstate',['print_state',['../a02606.html#a7341b5a714d2da0a8b14f75ac9490218',1,'WERD_CHOICE']]],
['print_5fsummary',['print_summary',['../a02630.html#aeb3a2bf1381d3c09bd493cc1bcc049b8',1,'STATS::print_summary()'],['../a01580.html#ad4c2ed3ea71f5c47ed1aa55b7a324040',1,'print_summary(): measure.h']]],
['print_5fto_5fstr',['print_to_str',['../a02610.html#a7bd11393de6e798f39265b653556b8da',1,'TBOX']]],
['printadaptedtemplates',['PrintAdaptedTemplates',['../a03998.html#a15d6951abc586793270de0825bdb7dd7',1,'tesseract::Classify']]],
['printadaptivematchresults',['PrintAdaptiveMatchResults',['../a03998.html#afda7a8fc280c36131c70a7782d1ba00f',1,'tesseract::Classify']]],
['printbestchoices',['PrintBestChoices',['../a02542.html#a5d887fd12d885c0575559a66f292d128',1,'WERD_RES']]],
['printcolors',['PrintColors',['../a04570.html#af07ad7867464972ce64aa421af34dada',1,'tesseract::ColPartition']]],
['printdw',['PrintDW',['../a04382.html#a0c7191217205e68548f837769dd3118e',1,'tesseract::LSTM']]],
['printfeaturematcheson',['PrintFeatureMatchesOn',['../a00737.html#a48c73a08f2b93aea7b672d64cf2aa6b5',1,'intproto.h']]],
['printmatchsummaryon',['PrintMatchSummaryOn',['../a00737.html#a58f7baca07428ed3a374eba467ae560f',1,'intproto.h']]],
['printnormmatch',['PrintNormMatch',['../a00782.html#a2a041eb1273bd7e18bcb663d2106ac15',1,'normmatch.cpp']]],
['printparams',['PrintParams',['../a02794.html#ac9884aced9c9941e8df8763960d798c4',1,'tesseract::ParamUtils']]],
['printproto',['PrintProto',['../a00809.html#aa80649ea9aed0280b09677f2f6868b5c',1,'protos.h']]],
['printprotoline',['PrintProtoLine',['../a00809.html#a2414185be2fdb0d265e6a37c223a4b7d',1,'protos.h']]],
['printprotomatcheson',['PrintProtoMatchesOn',['../a00737.html#af9768c71d08cded9ee3736a16fc53a79',1,'intproto.h']]],
['printprotos',['PrintProtos',['../a00806.html#a5c0c05c9986fd218a772e9acca9b02f6',1,'PrintProtos(CLASS_TYPE Class): protos.cpp'],['../a00809.html#a5c0c05c9986fd218a772e9acca9b02f6',1,'PrintProtos(CLASS_TYPE Class): protos.cpp']]],
['printresults',['PrintResults',['../a04198.html#a56ecfc6c9db4fe72630bd5f950c9cd1b',1,'tesseract::ShapeClassifier']]],
['printrows',['PrintRows',['../a02298.html#ae047fef32d75d63a808383aa1744bdbc',1,'tesseract::GeometricClassifierState']]],
['printseams',['PrintSeams',['../a02622.html#a2bae12ad3c6521d5063c16260099161a',1,'SEAM']]],
['printsegmentationstats',['PrintSegmentationStats',['../a00317.html#a7f48b20c8959347726c816b94b3c47f5',1,'PrintSegmentationStats(BLOCK_LIST *block_list): ocrblock.cpp'],['../a00320.html#a7f48b20c8959347726c816b94b3c47f5',1,'PrintSegmentationStats(BLOCK_LIST *block_list): ocrblock.cpp']]],
['printspecialblobsdensity',['PrintSpecialBlobsDensity',['../a02246.html#ad7ae4f58197c854689b69df45e77352d',1,'tesseract::EquationDetect']]],
['printuntransposed',['PrintUnTransposed',['../a04474.html#afa4a5fcd6f74da287c1a645d1114712b',1,'tesseract::TransposedArray']]],
['printvariables',['PrintVariables',['../a02186.html#a9b25f5b2e2e3d9791e145355e91efdea',1,'tesseract::TessBaseAPI']]],
['printw',['PrintW',['../a04382.html#a757d2e155fa573030ca53f4d62b35ba9',1,'tesseract::LSTM']]],
['prioritize_5fdivision',['prioritize_division',['../a03998.html#a22717c4d299d3a52683ad90114b20200',1,'tesseract::Classify']]],
['prioritize_5fpoints',['prioritize_points',['../a04866.html#a6bfcf571dbe50c3e8dc920005911af85',1,'tesseract::Wordrec']]],
['priority',['priority',['../a02622.html#a2a2a8c84555ef8e7834628b7da952dba',1,'SEAM::priority()'],['../a00419.html#a64c977704107e265e5997b915a83ccf2',1,'PRIORITY(): seam.h']]],
['probability_5fin_5fcontext_5f',['probability_in_context_',['../a04290.html#ab24a33b89082414b75df5caa86bf6da8',1,'tesseract::Dict']]],
['probabilityincontext',['ProbabilityInContext',['../a04290.html#abc4cf75b1bd5f5cb0f733c92afeb5239',1,'tesseract::Dict']]],
['probabilityincontextfunc',['ProbabilityInContextFunc',['../a01629.html#ad7ebf88af7dcdd155deb8655ba5991ff',1,'tesseract']]],
['probtocertainty',['ProbToCertainty',['../a04406.html#a697f458c5fddc50996db4aebc43bd943',1,'tesseract::NetworkIO']]],
['process_5fcmd_5fwin_5fevent',['process_cmd_win_event',['../a02358.html#a12439dcdd69bf8946289764c08050944',1,'tesseract::Tesseract']]],
['process_5fimage_5fevent',['process_image_event',['../a02358.html#a0d018bb13a3e3c7e76992ba372664dd7',1,'tesseract::Tesseract']]],
['process_5fselected_5fwords',['process_selected_words',['../a02358.html#a8b2de7d7c968f60246626f9271f89793',1,'tesseract::Tesseract']]],
['processmatchedblobs',['ProcessMatchedBlobs',['../a02410.html#a114878e47b1abf1d799350aea31af8e2',1,'tesseract::BoxWord']]],
['processmathblocksatelliteparts',['ProcessMathBlockSatelliteParts',['../a02246.html#a0bb5b44fbab44c93cb338eed35b4ef4a',1,'tesseract::EquationDetect']]],
['processpage',['ProcessPage',['../a01625.html#ga0cfc2f772980b283b98b5c4ea37db724',1,'tesseract::TessBaseAPI']]],
['processpages',['ProcessPages',['../a01625.html#ga551aa98cd0a9957195f83729a599a89f',1,'tesseract::TessBaseAPI']]],
['processpagesinternal',['ProcessPagesInternal',['../a01625.html#ga091018e103238979eac0912d3f5ff126',1,'tesseract::TessBaseAPI']]],
['processpatternedges',['ProcessPatternEdges',['../a04290.html#a05cfda6d89f51fbdc8cf336dcf718924',1,'tesseract::Dict']]],
['processsegsearchpainpoint',['ProcessSegSearchPainPoint',['../a04866.html#ae44c5dc9bd69b43bf7f1a740eb900724',1,'tesseract::Wordrec']]],
['processtargetword',['ProcessTargetWord',['../a02358.html#ac5790042616434be2d95f33dc62f9c04',1,'tesseract::Tesseract']]],
['program_5feditdown',['program_editdown',['../a04866.html#a335b25bd31642ae8cd11cf73252d5bf9',1,'tesseract::Wordrec']]],
['program_5feditup',['program_editup',['../a04866.html#a3820accb9c4cf4da9d304373f3d387bc',1,'tesseract::Wordrec']]],
['program_5ffeature_5ftype',['PROGRAM_FEATURE_TYPE',['../a01331.html#a13f1cc39e4f40922426135364cb7c3c2',1,'PROGRAM_FEATURE_TYPE(): cntraining.cpp'],['../a01400.html#a13f1cc39e4f40922426135364cb7c3c2',1,'PROGRAM_FEATURE_TYPE(): mftraining.cpp']]],
['progress',['progress',['../a02786.html#a469c1ab091847e37969871bd89cf1005',1,'ETEXT_DESC']]],
['progress_5fcallback',['progress_callback',['../a02786.html#a4e76cdcca81c40cb7871e56f23d316b0',1,'ETEXT_DESC']]],
['progress_5fcallback2',['progress_callback2',['../a02786.html#a51ef2705184520ed0b44e218aa2b1706',1,'ETEXT_DESC']]],
['progress_5ffunc',['PROGRESS_FUNC',['../a00551.html#acfa77e552598fd4cfe84b127de213faa',1,'ocrclass.h']]],
['progress_5ffunc2',['PROGRESS_FUNC2',['../a00551.html#a06e088d4f8a2ab850fea9e40f55e7fab',1,'ocrclass.h']]],
['projection',['projection',['../a02378.html#a3a0910989c04549a96689f72c72baf91',1,'TO_ROW::projection()'],['../a04566.html#a7393e9cbe4a4f7f24b082af90b7a8005',1,'tesseract::ColumnFinder::projection()']]],
['projection_5fleft',['projection_left',['../a02378.html#a2f357bfcab3e16621d88abc3a5b10ad5',1,'TO_ROW']]],
['projection_5fmargin',['PROJECTION_MARGIN',['../a00221.html#a01dbc51856714fc0f1871d2eb3c03a5e',1,'PROJECTION_MARGIN(): blobbox.cpp'],['../a01214.html#a01dbc51856714fc0f1871d2eb3c03a5e',1,'PROJECTION_MARGIN(): pithsync.cpp'],['../a01301.html#a01dbc51856714fc0f1871d2eb3c03a5e',1,'PROJECTION_MARGIN(): underlin.cpp']]],
['projection_5fright',['projection_right',['../a02378.html#a4901daf77658c7b5adb8e660832884f5',1,'TO_ROW']]],
['projectivecoeffs',['ProjectiveCoeffs',['../a01629.html#aaaf7fc93d2ee7ab611ecf8f9863d8806',1,'tesseract']]],
['prop',['prop',['../a02514.html#a83d248b4e67b1f7a51d6240b16ed3cb9',1,'BLOCK']]],
['properties',['properties',['../a02458.html#ac313bf1c4d46cd588b1f7b9407bc5f6b',1,'tesseract::FontInfo']]],
['propertiesincomplete',['PropertiesIncomplete',['../a03950.html#aaecc4315133c7591da37639a20edeb0a',1,'UNICHARSET']]],
['proto',['Proto',['../a03966.html#acf720eb61d4a91e84d949a6f772ea7c5',1,'TEMP_PROTO_STRUCT::Proto()'],['../a00809.html#a05167a61304b96dd0513e52743dbf45f',1,'PROTO(): protos.h']]],
['proto_5fevidence_5f',['proto_evidence_',['../a04090.html#ae3f39039fbb9bc4e0b7722919d320ccd',1,'ScratchEvidence']]],
['proto_5fid',['PROTO_ID',['../a00914.html#a7e3352f12ad03d1c7939d3e3d078930d',1,'matchdefs.h']]],
['proto_5fincrement',['PROTO_INCREMENT',['../a00806.html#a84b07ab4cf4e8b013de05ee603af79e8',1,'protos.cpp']]],
['proto_5fkey',['PROTO_KEY',['../a03994.html',1,'']]],
['proto_5fpruner',['PROTO_PRUNER',['../a00737.html#adc4814efc53ffd530124ad72f03139dd',1,'intproto.h']]],
['proto_5fpruner_5fscale',['PROTO_PRUNER_SCALE',['../a00734.html#ad0a217ed135414378d65558a77b9b2ba',1,'intproto.cpp']]],
['proto_5fset',['PROTO_SET',['../a00737.html#ad546501d14b3863823361c838ea469ec',1,'intproto.h']]],
['proto_5fset_5fstruct',['PROTO_SET_STRUCT',['../a04118.html',1,'']]],
['proto_5fstruct',['PROTO_STRUCT',['../a04186.html',1,'']]],
['proto_5fsuffix',['PROTO_SUFFIX',['../a01397.html#a984126ee107477861a21bfd46051483d',1,'mergenf.h']]],
['protodisplaywindow',['ProtoDisplayWindow',['../a00734.html#a23f6e9320fd27edf24ff0788bbd15d14',1,'intproto.cpp']]],
['protoforprotoid',['ProtoForProtoId',['../a00737.html#aff1a8cea9b56061e344b3b3f256f5253',1,'intproto.h']]],
['protoid',['ProtoId',['../a03966.html#aa03b90e32f019b51d66853b5eeea5fff',1,'TEMP_PROTO_STRUCT']]],
['protoin',['ProtoIn',['../a00809.html#a3def7bc87c3ad9ad793128f0dc5b8fce',1,'protos.h']]],
['protolengths',['ProtoLengths',['../a04122.html#ab0202389adecfa45e744d49597472c7b',1,'INT_CLASS_STRUCT']]],
['protolist',['ProtoList',['../a04038.html#af6bd9758400f9a886e8fde8d009de70f',1,'CLUSTERER']]],
['protopruner',['ProtoPruner',['../a04118.html#a6c4fddbacb407bdda234dfe3d1835df4',1,'PROTO_SET_STRUCT']]],
['protos',['Protos',['../a03970.html#a2ea5edb90b556766fce2105dcdfe3141',1,'TEMP_CONFIG_STRUCT::Protos()'],['../a04118.html#aec92455cfcae19d9a7278ab3e8733d11',1,'PROTO_SET_STRUCT::Protos()'],['../a04166.html#ada1e6e21410af2577e978c63d0517f26',1,'NORM_PROTOS::Protos()']]],
['protos_2ecpp',['protos.cpp',['../a00806.html',1,'']]],
['protos_2eh',['protos.h',['../a00809.html',1,'']]],
['protos_5fper_5fpp_5fwerd',['PROTOS_PER_PP_WERD',['../a00737.html#af75b95b37fa32f58b664c30024496354',1,'intproto.h']]],
['protos_5fper_5fproto_5fset',['PROTOS_PER_PROTO_SET',['../a00737.html#ac6c8bf8f6110ef3cfc4bcd13d52c475c',1,'intproto.h']]],
['protosets',['ProtoSets',['../a04122.html#ac11726dfb0e9ac06fd00351082ca7888',1,'INT_CLASS_STRUCT']]],
['protostyle',['ProtoStyle',['../a04026.html#a53c426e655c701e99f7744a35ecced70',1,'CLUSTERCONFIG::ProtoStyle()'],['../a00665.html#a2bf647f23b4a059a559e4d991437c9ea',1,'PROTOSTYLE(): cluster.h']]],
['prototype',['PROTOTYPE',['../a04034.html',1,'PROTOTYPE'],['../a04022.html#af0c82e552c662971cf574f9ee8bcb40f',1,'sample::Prototype()']]],
['prototypes',['Prototypes',['../a04190.html#add1a2c4f7b02eb438c377242495013ef',1,'CLASS_STRUCT']]],
['protovectorsize',['ProtoVectorSize',['../a03970.html#aebc12958833fd4604f6a1ca9a8eb2235',1,'TEMP_CONFIG_STRUCT']]],
['prunablepath',['PrunablePath',['../a04818.html#a0c9b9c5e553558ed4e566b39cc59f995',1,'tesseract::LanguageModel']]],
['pruneandsort',['PruneAndSort',['../a04082.html#a5ea13168b4c0af42ffb46118d41bf559',1,'tesseract::ClassPruner']]],
['pruneclasses',['PruneClasses',['../a03998.html#a44ab6533ba8e421e90acbccde86daa18',1,'tesseract::Classify']]],
['pruned',['pruned',['../a04834.html#a4e5c109a8e5e6a3887024615f40817d1',1,'tesseract::LanguageModelNgramInfo']]],
['pruner_5fangle',['PRUNER_ANGLE',['../a00737.html#aa1522c3f9ac9fa4ce3369ee47e73a481',1,'intproto.h']]],
['pruner_5fx',['PRUNER_X',['../a00737.html#af01cd9af1d00fa943dd1edfd19882833',1,'intproto.h']]],
['pruner_5fy',['PRUNER_Y',['../a00737.html#a7c72f47e4c4a455c9ac0d3855c1aeff2',1,'intproto.h']]],
['psm_5fauto',['PSM_AUTO',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca068d51ecbcebae704935caddbdae37f2',1,'PSM_AUTO(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa759fdd456efbe83648acd54f0a9263cb',1,'tesseract::PSM_AUTO()']]],
['psm_5fauto_5fonly',['PSM_AUTO_ONLY',['../a00014.html#a4d1f965486ce272064ffdbd7a618234cae24d182a87d37f38abc92bd274c71889',1,'PSM_AUTO_ONLY(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa6c70374f53473ba410723e32b12f3f01',1,'tesseract::PSM_AUTO_ONLY()']]],
['psm_5fauto_5fosd',['PSM_AUTO_OSD',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca36d69e059dc35353e8c416df4eb3534e',1,'PSM_AUTO_OSD(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa1f0a7b4dbb495bc92c36847c555a706b',1,'tesseract::PSM_AUTO_OSD()']]],
['psm_5fblock_5ffind_5fenabled',['PSM_BLOCK_FIND_ENABLED',['../a01629.html#aec87d6029c75c5289d98a9e723e27a03',1,'tesseract']]],
['psm_5fcircle_5fword',['PSM_CIRCLE_WORD',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca3f99557b7b3e149c07821e9ee4de99c5',1,'PSM_CIRCLE_WORD(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa2c473f99b506306a04efeb199444217e',1,'tesseract::PSM_CIRCLE_WORD()']]],
['psm_5fcol_5ffind_5fenabled',['PSM_COL_FIND_ENABLED',['../a01629.html#a65f6404c41e8115bf0f3b5a3c3cb0330',1,'tesseract']]],
['psm_5fcount',['PSM_COUNT',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca5c654b2ec85e7604d3aa5842124b0f75',1,'PSM_COUNT(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa43cbd9776a49ef8469e8148d8161eaae',1,'tesseract::PSM_COUNT()']]],
['psm_5fline_5ffind_5fenabled',['PSM_LINE_FIND_ENABLED',['../a01629.html#a4bccdd42ad4df4d7c901ec9f4241b42f',1,'tesseract']]],
['psm_5forientation_5fenabled',['PSM_ORIENTATION_ENABLED',['../a01629.html#a3bbc313593c4d81ccb01b05b5cba680c',1,'tesseract']]],
['psm_5fosd_5fenabled',['PSM_OSD_ENABLED',['../a01629.html#a30bf30e24d408ea5baf9bbc83f9930e2',1,'tesseract']]],
['psm_5fosd_5fonly',['PSM_OSD_ONLY',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca1c556e92c0b7635b7202f82217ace03b',1,'PSM_OSD_ONLY(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa319d6168eaa4b2002ac84c0558ba947d',1,'tesseract::PSM_OSD_ONLY()']]],
['psm_5fraw_5fline',['PSM_RAW_LINE',['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aabea071f8e7061ba47e289e5ca9d7977d',1,'tesseract']]],
['psm_5fsingle_5fblock',['PSM_SINGLE_BLOCK',['../a00014.html#a4d1f965486ce272064ffdbd7a618234cad0373e8d76ab32ca18fdbf1d4e684736',1,'PSM_SINGLE_BLOCK(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aab76fe3ca390d99e070ea60b892ee18ef',1,'tesseract::PSM_SINGLE_BLOCK()']]],
['psm_5fsingle_5fblock_5fvert_5ftext',['PSM_SINGLE_BLOCK_VERT_TEXT',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca4a4730535c5ef7ebdc68d4afae53514e',1,'PSM_SINGLE_BLOCK_VERT_TEXT(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa6d12cbb6be71dad8d3f090f214301630',1,'tesseract::PSM_SINGLE_BLOCK_VERT_TEXT()']]],
['psm_5fsingle_5fchar',['PSM_SINGLE_CHAR',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca2029404beb7a3711c3ee0b32998c1e47',1,'PSM_SINGLE_CHAR(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa7045cff7a3ae929fb1db5dbf031a4875',1,'tesseract::PSM_SINGLE_CHAR()']]],
['psm_5fsingle_5fcolumn',['PSM_SINGLE_COLUMN',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca4cc3e6a7edcf093940c00e3786983d84',1,'PSM_SINGLE_COLUMN(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa73beed38a70fa050cd927691e757eb7d',1,'tesseract::PSM_SINGLE_COLUMN()']]],
['psm_5fsingle_5fline',['PSM_SINGLE_LINE',['../a00014.html#a4d1f965486ce272064ffdbd7a618234cab3a479a4989c5a07e8b51b120f1b5ec9',1,'PSM_SINGLE_LINE(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aae3fc1f34ef8d2b0a1f7b09a9d3dc138a',1,'tesseract::PSM_SINGLE_LINE()']]],
['psm_5fsingle_5fword',['PSM_SINGLE_WORD',['../a00014.html#a4d1f965486ce272064ffdbd7a618234cae75bd9b747d8ae1a0e0c00ba9239ca9b',1,'PSM_SINGLE_WORD(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aab2ba05e0391e8fa0014323490c54b1b8',1,'tesseract::PSM_SINGLE_WORD()']]],
['psm_5fsparse',['PSM_SPARSE',['../a01629.html#a8d3049bd09022ed6dd40fa03f9fa4b48',1,'tesseract']]],
['psm_5fsparse_5ftext',['PSM_SPARSE_TEXT',['../a00014.html#a4d1f965486ce272064ffdbd7a618234ca5ad724aa22a7073fe914cb3317c8a5e8',1,'PSM_SPARSE_TEXT(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa52098adaaa77f63a382a3ec2a8202c43',1,'tesseract::PSM_SPARSE_TEXT()']]],
['psm_5fsparse_5ftext_5fosd',['PSM_SPARSE_TEXT_OSD',['../a00014.html#a4d1f965486ce272064ffdbd7a618234cae8b2319ceb988d8cd52de990507b968a',1,'PSM_SPARSE_TEXT_OSD(): capi.h'],['../a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aae9467850a0f8b1ad6df639994a20bfb5',1,'tesseract::PSM_SPARSE_TEXT_OSD()']]],
['psm_5fword_5ffind_5fenabled',['PSM_WORD_FIND_ENABLED',['../a01629.html#ae352b5f90645de29b1d9d3a3d6b37946',1,'tesseract']]],
['pt_5fcaption_5ftext',['PT_CAPTION_TEXT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677faf25906cdd91c91c56489f5878b89b99b',1,'PT_CAPTION_TEXT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60af25906cdd91c91c56489f5878b89b99b',1,'PT_CAPTION_TEXT(): publictypes.h']]],
['pt_5fcount',['PT_COUNT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa1cfce41c30bf1aefe403aaa66d271da1',1,'PT_COUNT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a1cfce41c30bf1aefe403aaa66d271da1',1,'PT_COUNT(): publictypes.h']]],
['pt_5fequation',['PT_EQUATION',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fadfde914b43bcf45b29f149fa4415bf45',1,'PT_EQUATION(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60adfde914b43bcf45b29f149fa4415bf45',1,'PT_EQUATION(): publictypes.h']]],
['pt_5fflowing_5fimage',['PT_FLOWING_IMAGE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fae4dd1e076e7d8354de8123bbdfb9e6b0',1,'PT_FLOWING_IMAGE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60ae4dd1e076e7d8354de8123bbdfb9e6b0',1,'PT_FLOWING_IMAGE(): publictypes.h']]],
['pt_5fflowing_5ftext',['PT_FLOWING_TEXT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677faaa63d8d8a99ddc2b3957f8e8787b4eca',1,'PT_FLOWING_TEXT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60aaa63d8d8a99ddc2b3957f8e8787b4eca',1,'PT_FLOWING_TEXT(): publictypes.h']]],
['pt_5fheading_5fimage',['PT_HEADING_IMAGE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa919711bca6bed2e6a9846e4dc91f3900',1,'PT_HEADING_IMAGE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a919711bca6bed2e6a9846e4dc91f3900',1,'PT_HEADING_IMAGE(): publictypes.h']]],
['pt_5fheading_5ftext',['PT_HEADING_TEXT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa47f25d4065407dd98db92554ca54468b',1,'PT_HEADING_TEXT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a47f25d4065407dd98db92554ca54468b',1,'PT_HEADING_TEXT(): publictypes.h']]],
['pt_5fhorz_5fline',['PT_HORZ_LINE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fad3f3a03631d09be1ba300cdd2af9a0d5',1,'PT_HORZ_LINE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60ad3f3a03631d09be1ba300cdd2af9a0d5',1,'PT_HORZ_LINE(): publictypes.h']]],
['pt_5finline_5fequation',['PT_INLINE_EQUATION',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677faa52ce81f771512916e01215965910fc6',1,'PT_INLINE_EQUATION(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60aa52ce81f771512916e01215965910fc6',1,'PT_INLINE_EQUATION(): publictypes.h']]],
['pt_5fnoise',['PT_NOISE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa639c79458d7bb60c9d6f26f661dee484',1,'PT_NOISE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a639c79458d7bb60c9d6f26f661dee484',1,'PT_NOISE(): publictypes.h']]],
['pt_5fpullout_5fimage',['PT_PULLOUT_IMAGE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa88dcd7f4800095eb2f18b8a9bd521001',1,'PT_PULLOUT_IMAGE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a88dcd7f4800095eb2f18b8a9bd521001',1,'PT_PULLOUT_IMAGE(): publictypes.h']]],
['pt_5fpullout_5ftext',['PT_PULLOUT_TEXT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa0e758c0b8cd519397b9c94ce6c12858c',1,'PT_PULLOUT_TEXT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a0e758c0b8cd519397b9c94ce6c12858c',1,'PT_PULLOUT_TEXT(): publictypes.h']]],
['pt_5ftable',['PT_TABLE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa5f41d3730899e22bf30c977bef2bcfa3',1,'PT_TABLE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a5f41d3730899e22bf30c977bef2bcfa3',1,'PT_TABLE(): publictypes.h']]],
['pt_5fto_5fpt_5fdist',['pt_to_pt_dist',['../a02570.html#a9f7923586562e1d7c098dcb297ba41d9',1,'ICOORD::pt_to_pt_dist()'],['../a02578.html#af6af460e5530319378f52951571432e5',1,'FCOORD::pt_to_pt_dist()']]],
['pt_5fto_5fpt_5fsqdist',['pt_to_pt_sqdist',['../a02570.html#a7c8279255cb7af80cb179bfc68db265c',1,'ICOORD::pt_to_pt_sqdist()'],['../a02578.html#a681ca1d6fba280192a0c302f97610560',1,'FCOORD::pt_to_pt_sqdist()']]],
['pt_5funknown',['PT_UNKNOWN',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fac0b3cd1b4592e1a3c609ff4273fb505b',1,'PT_UNKNOWN(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60ac0b3cd1b4592e1a3c609ff4273fb505b',1,'PT_UNKNOWN(): publictypes.h']]],
['pt_5fvert_5fline',['PT_VERT_LINE',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fa0cc815637c8f3f7967719c6abd956f0f',1,'PT_VERT_LINE(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60a0cc815637c8f3f7967719c6abd956f0f',1,'PT_VERT_LINE(): publictypes.h']]],
['pt_5fvertical_5ftext',['PT_VERTICAL_TEXT',['../a00014.html#a02cfd8369d5ad8c70a8b90c0f40d677fadf6b7dd3b8ca94923c3b94dfe53f230e',1,'PT_VERTICAL_TEXT(): capi.h'],['../a00380.html#a03566528a98c079dafeebf00502f2b60adf6b7dd3b8ca94923c3b94dfe53f230e',1,'PT_VERTICAL_TEXT(): publictypes.h']]],
['ptisimagetype',['PTIsImageType',['../a00380.html#a92fa403305db196dae658fac2153f2e9',1,'publictypes.h']]],
['ptislinetype',['PTIsLineType',['../a00380.html#adaf51915410883cb49ce4b2309528641',1,'publictypes.h']]],
['ptispullouttype',['PTIsPulloutType',['../a00380.html#a3b3b817fc17799383d414c2ea1c3f888',1,'publictypes.h']]],
['ptistexttype',['PTIsTextType',['../a00380.html#a49b7c03fb4e55b82a8fd22b7c6094082',1,'publictypes.h']]],
['ptrain_5fdict_5flong',['PTRAIN_DICT_LONG',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a70a08810d2d0222f222ce03f5ad0efa8',1,'tesseract']]],
['ptrain_5fdict_5fmed',['PTRAIN_DICT_MED',['../a01629.html#a996f57000ba7e945e304ca3a5268b467aae16de223a8d019d2847a7bdae6c8d5d',1,'tesseract']]],
['ptrain_5fdict_5fshort',['PTRAIN_DICT_SHORT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a4ed49f4fd757ded1bf8eca9aecdbeab7',1,'tesseract']]],
['ptrain_5fdigits_5flong',['PTRAIN_DIGITS_LONG',['../a01629.html#a996f57000ba7e945e304ca3a5268b467ae94102012c081e339674591a1ea39423',1,'tesseract']]],
['ptrain_5fdigits_5fmed',['PTRAIN_DIGITS_MED',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a8e5df70e0a4feb520442eea38ad42581',1,'tesseract']]],
['ptrain_5fdigits_5fshort',['PTRAIN_DIGITS_SHORT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a1500cece41ad4b1311e252f2b84d2650',1,'tesseract']]],
['ptrain_5fdoc_5flong',['PTRAIN_DOC_LONG',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a28c22a50dfa668c9d74a39cfab211b10',1,'tesseract']]],
['ptrain_5fdoc_5fmed',['PTRAIN_DOC_MED',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a073cad7d2dddd23f878513b197f70836',1,'tesseract']]],
['ptrain_5fdoc_5fshort',['PTRAIN_DOC_SHORT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467abb1f75943b9c111831107bd17c327062',1,'tesseract']]],
['ptrain_5ffreq_5flong',['PTRAIN_FREQ_LONG',['../a01629.html#a996f57000ba7e945e304ca3a5268b467aea70fe3d96122e670ec9e5a4152d93d9',1,'tesseract']]],
['ptrain_5ffreq_5fmed',['PTRAIN_FREQ_MED',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a695424d03a50adf3fe6a1998acbe3f87',1,'tesseract']]],
['ptrain_5ffreq_5fshort',['PTRAIN_FREQ_SHORT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a5d90fce75b366d7e15fa7a69d83357c2',1,'tesseract']]],
['ptrain_5fngram_5fcost_5fper_5fchar',['PTRAIN_NGRAM_COST_PER_CHAR',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a232084d7e65391f3c7e6b5709a989aa9',1,'tesseract']]],
['ptrain_5fnum_5fbad_5fcase',['PTRAIN_NUM_BAD_CASE',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a9638fa9da907b679b1ec6ceacc49a625',1,'tesseract']]],
['ptrain_5fnum_5fbad_5fchar_5ftype',['PTRAIN_NUM_BAD_CHAR_TYPE',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a2b5b59226e9e2688f6d620a551cc14c9',1,'tesseract']]],
['ptrain_5fnum_5fbad_5ffont',['PTRAIN_NUM_BAD_FONT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467adb38a8f09fbe5d6515936780e6cc2561',1,'tesseract']]],
['ptrain_5fnum_5fbad_5fpunc',['PTRAIN_NUM_BAD_PUNC',['../a01629.html#a996f57000ba7e945e304ca3a5268b467ac5449fec1bf1e8ce13f0c4b534aa9081',1,'tesseract']]],
['ptrain_5fnum_5fbad_5fspacing',['PTRAIN_NUM_BAD_SPACING',['../a01629.html#a996f57000ba7e945e304ca3a5268b467abf6ca295b288dca43c10b9022372a1db',1,'tesseract']]],
['ptrain_5fnum_5ffeature_5ftypes',['PTRAIN_NUM_FEATURE_TYPES',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a1f9a0441244ce25f22a62f3b17cf9d2e',1,'tesseract']]],
['ptrain_5fnum_5flong',['PTRAIN_NUM_LONG',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a4e3a359d1accb5c88630a86193085b30',1,'tesseract']]],
['ptrain_5fnum_5fmed',['PTRAIN_NUM_MED',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a70e53977ac4926e96923c104e4da104e',1,'tesseract']]],
['ptrain_5fnum_5fpasses',['PTRAIN_NUM_PASSES',['../a04854.html#af1ac568aa510bbcd30ff34da3d0037f2a09645783fadb30ad8a72455b4d0c5496',1,'tesseract::ParamsModel']]],
['ptrain_5fnum_5fshort',['PTRAIN_NUM_SHORT',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a9993582b2b81198845d05ba22a9bdb34',1,'tesseract']]],
['ptrain_5fpass1',['PTRAIN_PASS1',['../a04854.html#af1ac568aa510bbcd30ff34da3d0037f2a5931b6d2adc45720602cb1d3a42a0a28',1,'tesseract::ParamsModel']]],
['ptrain_5fpass2',['PTRAIN_PASS2',['../a04854.html#af1ac568aa510bbcd30ff34da3d0037f2abfb2f56c5a42f83aa4afc26d19ec9d24',1,'tesseract::ParamsModel']]],
['ptrain_5frating_5fper_5fchar',['PTRAIN_RATING_PER_CHAR',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a0f4d3799e004120bbaeaf1b6194264a8',1,'tesseract']]],
['ptrain_5fshape_5fcost_5fper_5fchar',['PTRAIN_SHAPE_COST_PER_CHAR',['../a01629.html#a996f57000ba7e945e304ca3a5268b467a8a4552af7b096cd4e07365b0142b39b2',1,'tesseract']]],
['ptrain_5fxheight_5fconsistency',['PTRAIN_XHEIGHT_CONSISTENCY',['../a01629.html#a996f57000ba7e945e304ca3a5268b467ac1573ea4f6bb4964d253022e801a214e',1,'tesseract']]],
['ptrhash',['PtrHash',['../a04518.html',1,'tesseract']]],
['publictypes_2ecpp',['publictypes.cpp',['../a00377.html',1,'']]],
['publictypes_2eh',['publictypes.h',['../a00380.html',1,'']]],
['punc_5findex',['punc_index',['../a04262.html#a15ab43b2ba0425cb90c25de4f1ec0ff0',1,'tesseract::DawgPosition']]],
['punc_5fpattern_5f',['punc_pattern_',['../a04306.html#a7533c8651890d62e6b0d678ed7155cb4',1,'tesseract::Trie']]],
['punc_5fperm',['PUNC_PERM',['../a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bcaa416e1922ec40e584a929afc70a90fe6',1,'ratngs.h']]],
['punc_5fref',['punc_ref',['../a04262.html#a88b4f8768d887ce2e8e4ff79f1b23972',1,'tesseract::DawgPosition::punc_ref()'],['../a04822.html#a1b7d40586e8a2d83687ea6c4171ca190',1,'tesseract::LMConsistencyInfo::punc_ref()']]],
['punct_5fstripped',['punct_stripped',['../a02606.html#a70e78c26d6a53b9b90cc60c194d5055f',1,'WERD_CHOICE']]],
['push',['Push',['../a02726.html#af0fc3154029c1c8d584f0e26d55fe03b',1,'tesseract::GenericHeap::Push()'],['../a00878.html#a9c4294375af81ab4c133b6b5a3679a16',1,'push(LIST list, void *element): oldlist.cpp'],['../a00881.html#a9c4294375af81ab4c133b6b5a3679a16',1,'push(LIST list, void *element): oldlist.cpp']]],
['push_5fback',['push_back',['../a02182.html#a0dc89fe2a365b04a61017f9d78c1a303',1,'GenericVector::push_back()'],['../a02446.html#a659534293ab0e46a46cab4421bebfb8f',1,'UnicityTable::push_back()']]],
['push_5fback_5fnew',['push_back_new',['../a02182.html#aa3301a4f99b267da4408eee97cd8cf43',1,'GenericVector']]],
['push_5ffront',['push_front',['../a02182.html#ad864fc1c7d438c70d7ef5b2886a406d0',1,'GenericVector']]],
['push_5flast',['push_last',['../a00878.html#a1019c2e1108695bb4f33f83e02ee62ad',1,'push_last(LIST list, void *item): oldlist.cpp'],['../a00881.html#a1019c2e1108695bb4f33f83e02ee62ad',1,'push_last(LIST list, void *item): oldlist.cpp']]],
['push_5fon',['push_on',['../a00881.html#aa778d36cfea0e6a352bd500710cf5198',1,'oldlist.h']]],
['put',['put',['../a02222.html#aaf69869f1a513348bd2ef26aa70e5717',1,'GENERIC_2D_ARRAY::put(ICOORD pos, const T &thing)'],['../a02222.html#a610f90d717d1a774cefa8736714f1cc2',1,'GENERIC_2D_ARRAY::put(int column, int row, const T &thing)']]]
];
| 159.644914 | 2,342 | 0.76297 |
1291b2e1eb0512bd1b23c28ea0e0151fca737acd | 392 | js | JavaScript | src/actions/types.js | KonradSzwarc/Sii-hackathon | 101b0dffee37388442d5566e022a8b0e5ef994d8 | [
"MIT"
] | null | null | null | src/actions/types.js | KonradSzwarc/Sii-hackathon | 101b0dffee37388442d5566e022a8b0e5ef994d8 | [
"MIT"
] | null | null | null | src/actions/types.js | KonradSzwarc/Sii-hackathon | 101b0dffee37388442d5566e022a8b0e5ef994d8 | [
"MIT"
] | null | null | null | export const CREATE_BOARD = 'CREATE_BOARD';
export const ADD_NOTIFICATION = 'ADD_NOTIFICATION';
export const ADD_IDEA = 'ADD_IDEA';
export const EDIT_IDEA = 'EDIT_IDEA';
export const REMOVE_IDEA = 'REMOVE_IDEA';
export const ADD_PERSON = 'ADD_PERSON';
export const REMOVE_PERSON = 'REMOVE_PERSON';
export const CHANGE_PHASE = 'CHANGE_PHASE';
export const CHANGE_DEADLINE = 'CHANGE_DEADLINE';
| 39.2 | 51 | 0.793367 |
1292134032d01de0f2cc55d029fea390c711dde6 | 1,092 | js | JavaScript | components/core/ObjectBoxPreview.js | ekilzen/slate | b2a5670a56108cdbad636b204a0f3bbdd9d3d74f | [
"MIT"
] | 485 | 2020-06-26T08:15:14.000Z | 2022-03-26T03:58:15.000Z | components/core/ObjectBoxPreview.js | TimGuo7/slate | 9f6334ddcb9661af3fd31dd69b8af68d8d9f4d5a | [
"MIT"
] | 770 | 2020-06-26T18:40:00.000Z | 2022-03-31T15:28:08.000Z | components/core/ObjectBoxPreview.js | TimGuo7/slate | 9f6334ddcb9661af3fd31dd69b8af68d8d9f4d5a | [
"MIT"
] | 82 | 2020-07-04T00:25:01.000Z | 2022-03-26T20:20:51.000Z | import * as React from "react";
import * as Validations from "~/common/validations";
import * as Strings from "~/common/strings";
import { css } from "@emotion/react";
import ObjectPlaceholder from "~/components/core/ObjectPreview/placeholders";
const STYLES_PLACEHOLDER_CONTAINER = css`
height: 100%;
width: 100%;
min-width: auto;
`;
const STYLES_PREVIEW = css`
height: 100%;
width: 100%;
background-size: cover;
overflow: hidden;
img {
height: 100%;
width: 100%;
object-fit: cover;
}
`;
export default function BlobObjectPreview({ file, css, placeholderRatio = 1, ...props }) {
const isImage = Validations.isPreviewableImage(file.type);
const url = Strings.getURLfromCID(file.cid);
if (isImage) {
return (
<div css={[STYLES_PREVIEW, css]} {...props}>
<img src={url} alt="File preview" />
</div>
);
}
return (
<div css={[STYLES_PREVIEW, css]} {...props}>
<ObjectPlaceholder
ratio={placeholderRatio}
containerCss={STYLES_PLACEHOLDER_CONTAINER}
file={file}
/>
</div>
);
}
| 22.285714 | 90 | 0.64011 |
129232c973e2aa6a32eb7fba47e2ae0168ca3a43 | 1,779 | js | JavaScript | packages/docusaurus-1.x/lib/core/CodeTabsMarkdownBlock.js | nikereginaa/docusaurus | 06044cffa7654e0d3e8d885deb9cc24eee95ff63 | [
"CC-BY-4.0",
"MIT"
] | 7 | 2020-01-10T20:43:59.000Z | 2021-10-29T20:42:59.000Z | packages/docusaurus-1.x/lib/core/CodeTabsMarkdownBlock.js | jartuso/docusaurus | c46bf90f600b0505ae4cb4440bd8d1d66a3c3978 | [
"CC-BY-4.0",
"MIT"
] | 17 | 2019-06-25T18:40:34.000Z | 2022-02-26T12:16:18.000Z | packages/docusaurus-1.x/lib/core/CodeTabsMarkdownBlock.js | jartuso/docusaurus | c46bf90f600b0505ae4cb4440bd8d1d66a3c3978 | [
"CC-BY-4.0",
"MIT"
] | 2 | 2019-09-10T14:43:11.000Z | 2020-11-18T19:01:48.000Z | /**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import _ from 'lodash';
const React = require('react');
const Remarkable = require('./Remarkable');
/**
* The MarkdownBlock component is used to parse markdown and render to HTML.
*/
class MarkdownBlock extends React.Component {
render() {
const groupId = _.uniqueId();
const tabs = this.props.children.map(({title, content}) => ({
id: _.uniqueId(),
groupId,
label: title,
lang: title,
panelContent: <Remarkable source={content} />,
}));
return (
<div className="tabs">
<div className="nav-tabs">
{tabs.map((t, i) => {
const tabId = `tab-group-${groupId}-tab-${t.id}`;
const contentId = `tab-group-${groupId}-content-${t.id}`;
return (
<div
id={tabId}
key={tabId}
className={`nav-link${i === 0 ? ' active' : ''}`}
data-group={`group_${t.groupId}`}
data-tab={contentId}>
{t.label}
</div>
);
})}
</div>
<div className="tab-content">
{tabs.map((t, i) => {
const id = `tab-group-${groupId}-content-${t.id}`;
return (
<div
id={id}
key={id}
className={`tab-pane${i === 0 ? ' active' : ''}`}
data-group={`group_${t.groupId}`}
tabIndex="-1">
{t.panelContent}
</div>
);
})}
</div>
</div>
);
}
}
module.exports = MarkdownBlock;
| 26.552239 | 76 | 0.474424 |
1292a09fa632d2654cfcbbda40a3d29817637454 | 32,720 | js | JavaScript | src-rx/src/components/Instances/InstanceCard.js | UncleSamSwiss/ioBroker.admin | 81d881c86ea5e630d21c4cd4dced967282ae324d | [
"MIT"
] | null | null | null | src-rx/src/components/Instances/InstanceCard.js | UncleSamSwiss/ioBroker.admin | 81d881c86ea5e630d21c4cd4dced967282ae324d | [
"MIT"
] | null | null | null | src-rx/src/components/Instances/InstanceCard.js | UncleSamSwiss/ioBroker.admin | 81d881c86ea5e630d21c4cd4dced967282ae324d | [
"MIT"
] | null | null | null | import React, { memo, useState } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import clsx from 'clsx';
import { Button, Card, CardContent, CardMedia, Fab, FormControl, Hidden, IconButton, InputLabel, MenuItem, Select, Tooltip, Typography } from "@material-ui/core";
import MoreVertIcon from '@material-ui/icons/MoreVert';
import RefreshIcon from '@material-ui/icons/Refresh';
import BuildIcon from '@material-ui/icons/Build';
import InputIcon from '@material-ui/icons/Input';
import DeleteIcon from '@material-ui/icons/Delete';
import LowPriorityIcon from '@material-ui/icons/LowPriority';
import MemoryIcon from '@material-ui/icons/Memory';
import ScheduleIcon from '@material-ui/icons/Schedule';
import ViewCompactIcon from '@material-ui/icons/ViewCompact';
import EditIcon from '@material-ui/icons/Edit';
import PauseIcon from '@material-ui/icons/Pause';
import PlayArrowIcon from '@material-ui/icons/PlayArrow';
import ImportExportIcon from '@material-ui/icons/ImportExport';
import { green, red } from '@material-ui/core/colors';
import ComplexCron from '@iobroker/adapter-react/Dialogs/ComplexCron';
import I18n from '@iobroker/adapter-react/i18n';
import sentry from '../../assets/sentry.svg';
import InstanceInfo from './InstanceInfo';
import State from '../State';
import CustomModal from '../CustomModal';
import LinksDialog from './LinksDialog';
const boxShadow = '0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)';
const boxShadowHover = '0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)';
const styles = theme => ({
root: {
position: 'relative',
margin: 10,
width: 300,
minHeight: 200,
background: theme.palette.background.default,
boxShadow,
display: 'flex',
flexDirection: 'column',
transition: 'box-shadow 0.5s',
'&:hover': {
boxShadow: boxShadowHover
}
},
imageBlock: {
background: 'silver',
minHeight: 60,
display: 'flex',
padding: '0 10px 0 10px',
position: 'relative',
justifyContent: 'space-between',
transition: 'background 0.5s',
},
img: {
width: 45,
height: 45,
margin: 'auto 0',
position: 'relative',
'&:after': {
content: '""',
position: 'absolute',
zIndex: 2,
top: 0,
left: 0,
width: '100%',
height: '100%',
background: 'url("img/no-image.png") 100% 100% no-repeat',
backgroundSize: 'cover',
backgroundColor: '#fff',
}
},
installed: {
background: '#77c7ff8c'
},
/*update: {
background: '#10ff006b'
},*/
fab: {
position: 'absolute',
bottom: -20,
width: 40,
height: 40,
right: 20,
},
greenText: {
color: theme.palette.success.dark,
},
collapse: {
height: '100%',
backgroundColor: theme.palette.type === 'dark' ? '#4a4a4a' : '#d4d4d4',
position: 'absolute',
width: '100%',
zIndex: 3,
marginTop: 'auto',
bottom: 0,
transition: 'height 0.3s',
justifyContent: 'space-between',
display: 'flex',
flexDirection: 'column'
},
collapseOff: {
height: 0
},
close: {
width: '20px',
height: '20px',
opacity: '0.9',
cursor: 'pointer',
position: 'relative',
marginLeft: 'auto',
marginBottom: 10,
transition: 'all 0.6s ease',
'&:hover': {
transform: 'rotate(90deg)'
},
'&:before': {
position: 'absolute',
left: '9px',
content: '""',
height: '20px',
width: '3px',
backgroundColor: '#ff4f4f',
transform: 'rotate(45deg)'
},
'&:after': {
position: 'absolute',
left: '9px',
content: '""',
height: '20px',
width: '3px',
backgroundColor: '#ff4f4f',
transform: 'rotate(-45deg)'
},
},
footerBlock: {
background: theme.palette.background.default,
padding: 10,
display: 'flex',
justifyContent: 'space-between'
},
hidden: {
display: 'none'
},
buttonUpdate: {
border: '1px solid',
padding: '0px 7px',
borderRadius: 5,
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
transition: 'background 0.5s',
'&:hover': {
background: '#00800026'
}
},
versionDate: {
alignSelf: 'center'
},
adapter: {
width: '100%',
fontWeight: 'bold',
fontSize: 16,
verticalAlign: 'middle',
paddingLeft: 8,
paddingTop: 16,
color: theme.palette.type === 'dark' ? '#333' : '#555'
},
hide: {
visibility: 'hidden'
},
button: {
padding: '5px',
transition: 'opacity 0.2s',
height: 34,
},
visibility: {
opacity: 0
},
enabled: {
color: green[400],
'&:hover': {
backgroundColor: green[200]
}
},
disabled: {
color: red[400],
'&:hover': {
backgroundColor: red[200]
}
},
cardContent: {
marginTop: 16,
paddingTop: 0
},
sentry: {
width: 24,
height: 24,
objectFit: 'fill',
filter: 'invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)'
},
cardContentH5: {
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between'
},
marginTop10: {
marginTop: 10
},
memoryIcon: {
color: '#dc8e00',
},
displayFlex: {
display: 'flex',
},
logLevel: {
width: '100%',
marginBottom: 5
},
overflowAuto: {
overflow: 'auto'
},
collapseIcon: {
position: 'sticky',
right: 0,
top: 0,
background: theme.palette.type === 'dark' ? '#4a4a4a' : '#d4d4d4',
zIndex: 2
},
addCompact: {
width: '100%',
marginBottom: 5
},
addCompactButton: {
display: 'flex',
margin: 5,
justifyContent: 'space-around'
},
scheduleIcon: {
color: '#dc8e00'
},
marginRight5: {
marginRight: 5
},
marginLeft5: {
marginLeft: 5
},
enableButton: {
display: 'flex',
justifyContent: 'space-between'
},
instanceStateNotAlive1: {
backgroundColor: 'rgba(192, 192, 192, 0.7)'
},
/*instanceStateNotAlive2: {
backgroundColor: 'rgb(192 192 192 / 15%)'
},*/
instanceStateAliveNotConnected1: {
backgroundColor: 'rgba(255, 177, 0, 0.4)'
},
/*instanceStateAliveNotConnected2: {
backgroundColor: 'rgb(255 177 0 / 14%)'
},*/
instanceStateAliveAndConnected1: {
backgroundColor: 'rgba(0, 255, 0, 0.4)'
},
/*instanceStateAliveAndConnected2: {
backgroundColor: 'rgb(0 255 0 / 14%)'
}*/
});
const InstanceCard = memo(({
name,
classes,
image,
expertMode,
hidden,
instance,
running,
id,
extendObject,
openConfig,
connectedToHost,
alive,
connected,
getMemory,
loglevelIcon,
getRestartSchedule,
getSchedule,
key,
checkCompact,
compactGroup,
setCompactGroup,
compactGroupCount,
setCompact,
compact,
supportCompact,
checkSentry,
currentSentry,
setSentry,
setRestartSchedule,
setName,
logLevel,
setLogLevel,
inputOutput,
mode,
setSchedule,
deletedInstances,
memoryLimitMB,
setMemoryLimitMB,
t,
tier,
setTier
}) => {
const [openCollapse, setCollapse] = useState(false);
const [mouseOver, setMouseOver] = useState(false);
const [openSelect, setOpenSelect] = useState(false);
const [openDialogCron, setOpenDialogCron] = useState(false);
const [openDialogSchedule, setOpenDialogSchedule] = useState(false);
const [openDialogText, setOpenDialogText] = useState(false);
const [openDialogSelect, setOpenDialogSelect] = useState(false);
const [openDialogDelete, setOpenDialogDelete] = useState(false);
const [openDialogMemoryLimit, setOpenDialogMemoryLimit] = useState(false);
const [select, setSelect] = useState(logLevel);
const [openDialogCompact, setOpenDialogCompact] = useState(false);
const [selectCompact, setSelectCompact] = useState(compactGroup || 0);
const [selectCompactGroupCount, setSelectCompactGroupCount] = useState(compactGroupCount);
const [openDialogSelectTier, setOpenDialogSelectTier] = useState(false);
const [tierValue, setTierValue] = useState(tier);
const [showLinks, setShowLinks] = useState(false);
const arrayLogLevel = ['silly', 'debug', 'info', 'warn', 'error'];
const arrayTier = [{ value: 1, desc: "1: Logic adapters" }, { value: 2, desc: "2: Data provider adapters" }, { value: 3, desc: "3: Other adapters" }];
const customModal =
openDialogSelectTier ||
openDialogCompact ||
openDialogSelect ||
openDialogText ||
openDialogDelete ||
openDialogMemoryLimit ?
<CustomModal
title={
(openDialogText && t('Enter title for %s', instance.id)) ||
(openDialogSelect && t('Edit log level rule for %s', instance.id)) ||
(openDialogDelete && t('Please confirm')) ||
(openDialogMemoryLimit && t('Edit memory limit rule for %s', instance.id)) ||
(openDialogCompact && t('Edit compact groups for %s', instance.id)) ||
(openDialogSelectTier && t('Set tier for %s', instance.id)) ||
''
}
help={
(openDialogMemoryLimit && t('Default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit)')) ||
(openDialogSelectTier && t('Tiers define the order of adapters when the system starts.')) ||
''
}
open={true}
applyDisabled={openDialogText || openDialogMemoryLimit}
textInput={openDialogText || openDialogMemoryLimit}
defaultValue={openDialogText ? name : openDialogMemoryLimit ? memoryLimitMB : ''}
onApply={value => {
if (openDialogSelect) {
setLogLevel(select)
setOpenDialogSelect(false);
} else if (openDialogText) {
setName(value);
setOpenDialogText(false);
} else if (openDialogDelete) {
setOpenDialogDelete(false);
deletedInstances();
} else if (openDialogMemoryLimit) {
setMemoryLimitMB(value)
setOpenDialogMemoryLimit(false);
} else if (openDialogCompact) {
setCompactGroup(selectCompact);
setOpenDialogCompact(false);
} else if (openDialogSelectTier) {
setTier(tierValue);
setOpenDialogSelectTier(false);
}
}}
onClose={() => {
if (openDialogSelect) {
setSelect(logLevel);
setOpenDialogSelect(false);
} else if (openDialogText) {
setOpenDialogText(false);
} else if (openDialogDelete) {
setOpenDialogDelete(false);
} else if (openDialogMemoryLimit) {
setOpenDialogMemoryLimit(false);
} else if (openDialogCompact) {
setSelectCompact(compactGroup);
setSelectCompactGroupCount(compactGroupCount);
setOpenDialogCompact(false);
} else if (openDialogSelectTier) {
setTierValue(tier);
setOpenDialogSelectTier(false);
}
}}>
{openDialogSelect && <FormControl className={classes.logLevel} variant="outlined" >
<InputLabel htmlFor="outlined-age-native-simple">{t('log level')}</InputLabel>
<Select
variant="standard"
value={select}
fullWidth
onChange={el => setSelect(el.target.value)}
>
{arrayLogLevel.map(el => <MenuItem key={el} value={el}>
{t(el)}
</MenuItem>)}
</Select>
</FormControl>}
{openDialogCompact && <FormControl className={classes.addCompact} variant="outlined" >
<InputLabel htmlFor="outlined-age-native-simple">{t('compact groups')}</InputLabel>
<Select
variant="standard"
autoWidth
onClose={e => setOpenSelect(false)}
onOpen={e => setOpenSelect(true)}
open={openSelect}
value={selectCompact === 1 ? 'default' : selectCompact === '0' ? "controller" : !selectCompact ? 'default' : selectCompact || 'default'}
onChange={el => setSelectCompact(el.target.value)}
>
<div onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
className={classes.selectStyle}>
<Button onClick={e => {
setOpenSelect(false);
setSelectCompact(selectCompactGroupCount + 1);
setSelectCompactGroupCount(selectCompactGroupCount + 1);
}} variant="outlined" stylevariable='outlined'>{t('Add compact group')}</Button>
</div>
<MenuItem value="controller">
{t('with controller')}
</MenuItem>
<MenuItem value="default">
{t('default group')}
</MenuItem>
{Array(selectCompactGroupCount - 1).fill().map((_, idx) => <MenuItem key={idx} value={idx + 2}>
{idx + 2}
</MenuItem>)}
</Select>
</FormControl>}
{openDialogSelectTier && <FormControl className={classes.logLevel} variant="outlined" >
<InputLabel htmlFor="outlined-age-native-simple">{t('Tiers')}</InputLabel>
<Select
variant="standard"
value={tierValue}
fullWidth
onChange={el => setTierValue(el.target.value)}
>
{arrayTier.map(el => <MenuItem key={el.value} value={el.value}>
{t(el.desc)}
</MenuItem>)}
</Select>
</FormControl>}
{openDialogDelete && t('Are you sure you want to delete the instance %s?', instance.id)}
</CustomModal>
: null;
const secondCardInfo = openCollapse || mouseOver ?
<div className={clsx(classes.collapse, !openCollapse ? classes.collapseOff : '')}>
<CardContent classes={{ root: classes.cardContent }} className={classes.overflowAuto}>
<div className={classes.collapseIcon}>
<div className={classes.close} onClick={() => setCollapse(false)} />
</div>
<Typography gutterBottom component={'span'} variant={'body2'}>
{instance.mode === 'daemon' && <State state={connectedToHost} >{t('Connected to host')}</State>}
{instance.mode === 'daemon' && <State state={alive} >{t('Heartbeat')}</State>}
{connected !== null &&
<State state={connected}>{t('Connected to %s', instance.adapter)}</State>
}
<InstanceInfo tooltip={t('Installed')}>
v {instance.version}
</InstanceInfo>
<InstanceInfo icon={<MemoryIcon />} tooltip={t('RAM usage')}>
{(instance.mode === 'daemon' && running ? getMemory(id) : '-.--') + ' MB'}
</InstanceInfo>
{expertMode &&
<div className={classes.displayFlex}>
<InstanceInfo icon={<ImportExportIcon />} tooltip={t('events')}>
<div className={classes.displayFlex}>
<Tooltip title={t('input events')}>
<div className={classes.marginRight5}>⇥{inputOutput.stateInput}</div>
</Tooltip>
/
<Tooltip title={t('output events')}>
<div className={classes.marginLeft5}>↦{inputOutput.stateOutput}</div>
</Tooltip>
</div>
</InstanceInfo>
</div>
}
{expertMode && <div className={classes.displayFlex}>
<InstanceInfo
icon={<MemoryIcon className={classes.memoryIcon} />}
tooltip={t('RAM limit')}
>
{(memoryLimitMB ? memoryLimitMB : '-.--') + ' MB'}
</InstanceInfo>
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={classes.button}
onClick={() => setOpenDialogMemoryLimit(true)}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>
}
{expertMode && <div className={classes.displayFlex}>
<InstanceInfo icon={loglevelIcon} tooltip={t('loglevel')}>
{logLevel}
</InstanceInfo>
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={classes.button}
onClick={() => setOpenDialogSelect(true)}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>}
{mode && <div className={classes.displayFlex}>
<InstanceInfo icon={<ScheduleIcon />} tooltip={t('schedule_group')}>
{getSchedule(id) || '-'}
</InstanceInfo>
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={classes.button}
onClick={() => setOpenDialogSchedule(true)}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>}
{expertMode && (instance.mode === 'daemon') &&
<div className={classes.displayFlex}>
<InstanceInfo
icon={<ScheduleIcon className={classes.scheduleIcon} />}
tooltip={t('restart')}
>
{getRestartSchedule(id) || '-'}
</InstanceInfo>
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={classes.button}
onClick={() => setOpenDialogCron(true)}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>
}
{expertMode && checkCompact && compact && supportCompact &&
<div className={classes.displayFlex}>
<InstanceInfo icon={<ViewCompactIcon className={classes.marginRight} color="inherit" />} tooltip={t('compact groups')}>
{compactGroup === 1 ? 'default' : compactGroup === '0' ? "controller" : !compactGroup ? 'default' : compactGroup || 'default'}
</InstanceInfo>
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={classes.button}
onClick={e => {
setOpenDialogCompact(true);
e.stopPropagation();
}}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>}
{expertMode && <div className={classes.displayFlex}>
<InstanceInfo icon={<LowPriorityIcon className={classes.marginRight} color="inherit" />} tooltip={t('Start order (tier)')}>
{instance.adapter === 'admin' ? t('Always first') : (arrayTier.find(el => el.value === tier)?.desc || arrayTier[2])}
</InstanceInfo>
{instance.adapter !== 'admin' ? <Tooltip title={t('Edit start order (tier)')}>
<IconButton
size="small"
className={classes.button}
onClick={e => {
setOpenDialogSelectTier(true);
e.stopPropagation();
}}
>
<EditIcon />
</IconButton>
</Tooltip> : null}
</div>}
<Hidden smUp>
<IconButton
size="small"
className={classes.button}
onClick={() => openConfig(id)}
>
<BuildIcon />
</IconButton>
</Hidden>
</Typography>
</CardContent>
<div className={classes.footerBlock}>
<div className={classes.displayFlex}>
<Tooltip title={t('Delete')}>
<IconButton
size="small"
className={classes.button}
onClick={() => setOpenDialogDelete(true)}
>
<DeleteIcon />
</IconButton>
</Tooltip>
</div>
{expertMode && checkSentry && <div className={classes.displayFlex}>
<Tooltip title="sentry">
<IconButton
size="small"
className={classes.button}
onClick={setSentry}
>
<CardMedia
className={clsx(classes.sentry, !currentSentry && classes.contrast0)}
component="img"
image={sentry}
/>
</IconButton>
</Tooltip>
</div>}
{supportCompact && expertMode && checkCompact && <div className={classes.displayFlex}>
<Tooltip title={t('compact groups')}>
<IconButton
size="small"
className={classes.button}
onClick={setCompact}
>
<ViewCompactIcon color={!!compact ? 'primary' : 'inherit'} />
</IconButton>
</Tooltip>
</div>}
</div>
</div> : null;
const linksDialog = showLinks ? <LinksDialog image={image} instanceId={instance.id} links={instance.links} onClose={() => setShowLinks(false)} t={t}/> : null;
const cronDialog = (openDialogCron || openDialogSchedule) &&
<ComplexCron
title={
(openDialogCron && t('Edit restart rule for %s', instance.id)) ||
(openDialogSchedule && t('Edit schedule rule for %s', instance.id))
}
cron={openDialogCron ? getRestartSchedule(id) : getSchedule(id)}
language={I18n.getLanguage()}
onOk={cron => {
if (openDialogCron) {
setRestartSchedule(cron);
} else if (openDialogSchedule) {
setSchedule(cron);
}
}}
onClose={() => {
if (openDialogCron) {
setOpenDialogCron(false);
} else if (openDialogSchedule) {
setOpenDialogSchedule(false);
}
}}
/>;
const [visibleEdit, handlerEdit] = useState(false);
return <Card key={key} className={clsx(classes.root, hidden ? classes.hidden : '')}>
{customModal}
{cronDialog}
{secondCardInfo}
{linksDialog}
<div className={clsx(
classes.imageBlock,
(!connectedToHost || !alive) && classes.instanceStateNotAlive1,
connectedToHost && alive && connected === false && classes.instanceStateAliveNotConnected1,
connectedToHost && alive && connected !== false && classes.instanceStateAliveAndConnected1
)}>
<CardMedia className={classes.img} component="img" image={image || 'img/no-image.png'} />
<div className={classes.adapter}>{instance.id}</div>
<div className={classes.versionDate}>
{/* {expertMode && checkCompact && <Tooltip title={t('compact groups')}>
<ViewCompactIcon color="action" style={{ margin: 10 }} />
</Tooltip>} */}
</div>
<Fab
onMouseOver={() => setMouseOver(true)}
onMouseOut={() => setMouseOver(false)}
onClick={() => setCollapse(true)}
className={classes.fab}
color="primary"
aria-label="add"
>
<MoreVertIcon />
</Fab>
</div>
<CardContent className={classes.cardContentH5}>
<Typography gutterBottom variant="h5" component="h5">
<div
onMouseMove={() => handlerEdit(true)}
onMouseEnter={() => handlerEdit(true)}
onMouseLeave={() => handlerEdit(false)}
className={classes.displayFlex}>
{name}
<Tooltip title={t('Edit')}>
<IconButton
size="small"
className={clsx(classes.button, !visibleEdit && classes.visibility)}
onClick={() => setOpenDialogText(true)}
>
<EditIcon />
</IconButton>
</Tooltip>
</div>
</Typography>
<div className={classes.marginTop10}>
<Typography component={'span'} className={classes.enableButton}>
<Tooltip title={t('Start/stop')}>
<div><IconButton
size="small"
onClick={event => {
extendObject('system.adapter.' + instance.id, { common: { enabled: !running } });
event.stopPropagation();
}}
onFocus={event => event.stopPropagation()}
className={clsx(classes.button, instance.canStart ? (running ? classes.enabled : classes.disabled) : classes.hide)}
>
{running ? <PauseIcon /> : <PlayArrowIcon />}
</IconButton>
</div>
</Tooltip>
<Hidden xsDown>
<Tooltip title={t('Settings')}>
<IconButton
size="small"
className={clsx(classes.button, !instance.config && classes.visibility)}
onClick={() => openConfig(id)}
>
<BuildIcon />
</IconButton>
</Tooltip>
</Hidden>
<Tooltip title={t('Restart')}>
<div>
<IconButton
size="small"
onClick={event => {
extendObject('system.adapter.' + instance.id, {});
event.stopPropagation();
}}
onFocus={event => event.stopPropagation()}
className={clsx(classes.button, !instance.canStart && classes.hide)}
disabled={!running}
>
<RefreshIcon />
</IconButton>
</div>
</Tooltip>
<Tooltip title={t('Instance link %s', instance.id)}>
<div>
<IconButton
size="small"
className={clsx(classes.button, (!instance.links || !instance.links[0]) && classes.hide)}
disabled={!running}
onClick={event => {
event.stopPropagation()
if (instance.links.length === 1) {
window.open(instance.links[0].link, instance.id);
} else {
setShowLinks(true);
}
}}
onFocus={event => event.stopPropagation()}
>
<InputIcon />
</IconButton>
</div>
</Tooltip>
</Typography>
</div>
</CardContent>
</Card>
})
InstanceCard.propTypes = {
t: PropTypes.func,
};
export default withStyles(styles)(InstanceCard); | 40.545229 | 245 | 0.445018 |
1292dbd505390a6c5d9dca7e08883ebb38870974 | 520 | js | JavaScript | html/search/variables_1.js | katielys/TP2-BD-TREE | 867ee151b15eccb33d4da7307f452b0d1c49fa58 | [
"MIT"
] | null | null | null | html/search/variables_1.js | katielys/TP2-BD-TREE | 867ee151b15eccb33d4da7307f452b0d1c49fa58 | [
"MIT"
] | null | null | null | html/search/variables_1.js | katielys/TP2-BD-TREE | 867ee151b15eccb33d4da7307f452b0d1c49fa58 | [
"MIT"
] | null | null | null | var searchData=
[
['blockoffset',['blockOffset',['../structHashing_1_1Address.html#aa40d44e5eff7693e2ffea4037fc341e1',1,'Hashing::Address']]],
['blockscount',['blocksCount',['../structHashing_1_1OverflowArea.html#a0df78418b8f26082b1c36e66d5a797d2',1,'Hashing::OverflowArea']]],
['buckets',['buckets',['../structHashing_1_1HashInstance.html#afee1920815c454b8ee9930197f2e2b5d',1,'Hashing::HashInstance']]],
['bytesoccupied',['bytesOccupied',['../structBlock.html#abde6adf69d1e430b4229ecc9a5a0e085',1,'Block']]]
];
| 65 | 136 | 0.767308 |
12933bd07844d84f2978c6b84f3eda75fb6edf3a | 3,155 | js | JavaScript | web/app/plugins/wordpress-seo/js/src/values/replaceVar.js | thomasjohan/bluehands | 9a437bb26217397107df371f812af8c0df8f734d | [
"MIT"
] | null | null | null | web/app/plugins/wordpress-seo/js/src/values/replaceVar.js | thomasjohan/bluehands | 9a437bb26217397107df371f812af8c0df8f734d | [
"MIT"
] | null | null | null | web/app/plugins/wordpress-seo/js/src/values/replaceVar.js | thomasjohan/bluehands | 9a437bb26217397107df371f812af8c0df8f734d | [
"MIT"
] | 1 | 2016-09-04T19:32:10.000Z | 2016-09-04T19:32:10.000Z | /* global require */
var isEmpty = require( "lodash/isEmpty" );
var indexOf = require( "lodash/indexOf" );
var defaults = require( "lodash/defaults" );
( function() {
var defaultOptions = { source: "wpseoReplaceVarsL10n", scope: [], aliases: [] };
/**
* Constructs the replace var.
*
* @param {string} placeholder The placeholder to search for.
* @param {string} replacement The name of the property to search for as an replacement.
* @param {object} [options] The options to be used to determine things as scope, source and search for aliases.
* @constructor
*/
var ReplaceVar = function( placeholder, replacement, options ) {
this.placeholder = placeholder;
this.replacement = replacement;
this.options = defaults( options, defaultOptions );
};
/**
* Gets the placeholder for the current replace var.
*
* @param {bool} [includeAliases] Whether or not to include aliases when getting the placeholder.
* @returns {string} The placeholder.
*/
ReplaceVar.prototype.getPlaceholder = function( includeAliases ) {
includeAliases = includeAliases || false;
if ( includeAliases && this.hasAlias() ) {
return this.placeholder + "|" + this.getAliases().join( "|" );
}
return this.placeholder;
};
/**
* Override the source of the replacement.
*
* @param {string} source The source to use.
*
* @returns {void}
*/
ReplaceVar.prototype.setSource = function( source ) {
this.options.source = source;
};
/**
* Determines whether or not the replace var has a scope defined.
*
* @returns {boolean} Returns true if a scope is defined and not empty.
*/
ReplaceVar.prototype.hasScope = function() {
return ! isEmpty( this.options.scope );
};
/**
* Adds a scope to the replace var.
*
* @param {string} scope The scope to add.
*
* @returns {void}
*/
ReplaceVar.prototype.addScope = function( scope ) {
if ( ! this.hasScope() ) {
this.options.scope = [];
}
this.options.scope.push( scope );
};
/**
* Determines whether the passed scope is defined in the replace var.
*
* @param {string} scope The scope to check for.
* @returns {boolean} Whether or not the passed scope is present in the replace var.
*/
ReplaceVar.prototype.inScope = function( scope ) {
if ( ! this.hasScope() ) {
return true;
}
return indexOf( this.options.scope, scope ) > -1;
};
/**
* Determines whether or not the current replace var has an alias.
*
* @returns {boolean} Whether or not the current replace var has one or more aliases.
*/
ReplaceVar.prototype.hasAlias = function() {
return ! isEmpty( this.options.aliases );
};
/**
* Adds an alias to the replace var.
*
* @param {string} alias The alias to add.
*
* @returns {void}
*/
ReplaceVar.prototype.addAlias = function( alias ) {
if ( ! this.hasAlias() ) {
this.options.aliases = [];
}
this.options.aliases.push( alias );
};
/**
* Gets the aliases for the current replace var.
*
* @returns {array} The aliases available to the replace var.
*/
ReplaceVar.prototype.getAliases = function() {
return this.options.aliases;
};
module.exports = ReplaceVar;
}() );
| 25.650407 | 113 | 0.664976 |
1295eb83ab0f338e2d1b2489f2a33bebba708a9d | 480 | js | JavaScript | src/Acme/DemoBundle/Resources/public/js/admin/pages/controllers/pageController.js | Nikoms/symfober | 6752c487ff97c19854bded559fb03251dbc4efd1 | [
"MIT"
] | null | null | null | src/Acme/DemoBundle/Resources/public/js/admin/pages/controllers/pageController.js | Nikoms/symfober | 6752c487ff97c19854bded559fb03251dbc4efd1 | [
"MIT"
] | null | null | null | src/Acme/DemoBundle/Resources/public/js/admin/pages/controllers/pageController.js | Nikoms/symfober | 6752c487ff97c19854bded559fb03251dbc4efd1 | [
"MIT"
] | null | null | null | AppAdmin.PageController = Ember.ObjectController.extend({
actions: {
remove: function(){
var model = this.get('model');
model.deleteRecord();
var controller = this;
model.save().then(
function(model) {
controller.transitionToRoute('pages');
},
function() {
console.error('removePage failed');
});
}
}
}); | 30 | 58 | 0.454167 |
129619f9faf0fcb1578ae1a3b064e0f33b06c922 | 2,686 | js | JavaScript | sensors.js | rdeininger/PostCycla | 3e13894de7f07f0d21aff249d686ceccc9ebbcd2 | [
"MIT"
] | 8 | 2018-01-19T07:27:32.000Z | 2021-08-04T02:08:19.000Z | sensors.js | rdeininger/PostCycla | 3e13894de7f07f0d21aff249d686ceccc9ebbcd2 | [
"MIT"
] | 1 | 2018-01-31T08:57:01.000Z | 2018-03-20T08:17:18.000Z | sensors.js | rdeininger/PostCycla | 3e13894de7f07f0d21aff249d686ceccc9ebbcd2 | [
"MIT"
] | 3 | 2018-07-13T04:32:39.000Z | 2020-03-25T03:17:22.000Z | /**
* Sensors
* Provides a common interface for all sensors/sensor data
* currently only supports Ant+ and STM32/Android sensors
*
* Sensordata provided:
* mps => meters per second ... current speed (from the STM32)
* dist => distance ... distance travelled since last reading (from STM32)
* hr => heart rate ... current heart (from Ant+)
cad => cadence ... curent cadence (from Ant+)
servo => servo position current position of the servo controlling resistance (from STM32)
*
* @author Richard Deininger
* @version 1.0
*/
var Settings = require('./settings.js');
// using sensor mocks by default for testing
var AntSensors = require('./antplus/AntSensorsMock.js');
var stm = require('./stm/stmMock.js');
if (!Settings.Data.UseMockups) //only use the real sensors when set in settings
{
AntSensors = require('./antplus/AntSensors.js');
stm = require('./stm/newstm.js');
}
var SensorData =
{
mps: 0,
dist: 0,
hr:0,
cad:0,
servo:0
}
var sensorCallback = null;
var startCallback = null;
var antSensors = new AntSensors(Settings.Data.Sensors.HeartRate_AntId, Settings.Data.Sensors.Cadence_AntId);
var stmSensors = new stm(Settings.Data.Sensors.STM.ComPort);
stmSensors.on("SensorReady", function (data)
{
if (Settings.Data.DebugOutput)
{
console.log("Sensor Ready");
}
if (startCallback)
{
startCallback();
}
});
stmSensors.on("SensorData", function (data)
{
// expected data = { distance: 0.1, speedms: 0, servoPos: 0.1 }
if (sensorCallback)
{
sensorCallback(readSensorData(data));
}
});
var readSensorData = function(stmData)
{
var data = Object.create(SensorData);
if (stmData)
{
data.mps = stmData.speedms;
data.dist = stmData.distance;
data.servo = stmData.servoPos;
}
lastread = (new Date()).getTime();
data.hr = antSensors.Data.HeartRate;
data.cad = antSensors.Data.Cadence;
//console.log("data: ",data);
return data;
}
exports.SetSensorDataCallback = function(callback)
{
sensorCallback = callback;
}
// gets values from 0.0 to 1.0 (percentage of maxResistnac)
exports.SetServoPos = function(pos)
{
stmSensors.SetLevel(pos, false);
}
exports.GetSensorData = function()
{
return readSensorData();
}
exports.Start = function(stcallback)
{
startCallback = stcallback;
stmSensors.Connect();
antSensors.Open();
}
exports.Stop = function()
{ try
{
stmSensors.Disconnect();
antSensors.Close();
} catch(e)
{
console.log("Error:", e);
}
}
exports.End = function()
{
stmSensors.Destruct();
} | 22.571429 | 109 | 0.644825 |
129746dba92709337ad6154de9a50d45d0a06b94 | 110 | js | JavaScript | src/dataloaders/index.js | nubs/bareapi | cea127b8de27e0891e2294c36e978437f16ed662 | [
"MIT"
] | null | null | null | src/dataloaders/index.js | nubs/bareapi | cea127b8de27e0891e2294c36e978437f16ed662 | [
"MIT"
] | 3 | 2020-04-06T12:16:53.000Z | 2021-09-21T08:07:58.000Z | src/dataloaders/index.js | nubs/bareapi | cea127b8de27e0891e2294c36e978437f16ed662 | [
"MIT"
] | null | null | null | export { default as modelByField } from './modelByField';
export { default as modelById } from './modelById';
| 36.666667 | 57 | 0.727273 |
1298516e0af00037af2f9418487f9a48cc72bd86 | 10,655 | js | JavaScript | build/hotkeys.min.js | vofus/angular-hotkeys | 77584ea5d3af2336ebc87c6dd1041aa1ce2d19e0 | [
"MIT"
] | null | null | null | build/hotkeys.min.js | vofus/angular-hotkeys | 77584ea5d3af2336ebc87c6dd1041aa1ce2d19e0 | [
"MIT"
] | null | null | null | build/hotkeys.min.js | vofus/angular-hotkeys | 77584ea5d3af2336ebc87c6dd1041aa1ce2d19e0 | [
"MIT"
] | 1 | 2020-10-20T10:38:19.000Z | 2020-10-20T10:38:19.000Z | /*!
* angular-hotkeys v1.7.0
* https://chieffancypants.github.io/angular-hotkeys
* Copyright (c) 2016 Wes Cruver
* License: MIT
*/
!function(){"use strict";angular.module("cfp.hotkeys",[]).provider("hotkeys",["$injector",function(a){this.includeCheatSheet=!0,this.useNgRoute=a.has("ngViewDirective"),this.templateTitle="Keyboard Shortcuts:",this.templateHeader=null,this.templateFooter=null,this.template='<div class="cfp-hotkeys-container fade" ng-class="{in: helpVisible}" style="display: none;"><div class="cfp-hotkeys"><h4 class="cfp-hotkeys-title" ng-if="!header">{{ title }}</h4><div ng-bind-html="header" ng-if="header"></div><table><tbody><tr ng-repeat="hotkey in hotkeys | filter:{ description: \'!$$undefined$$\' }"><td class="cfp-hotkeys-keys"><span ng-repeat="key in hotkey.format() track by $index" class="cfp-hotkeys-key">{{ key }}</span></td><td class="cfp-hotkeys-text">{{ hotkey.description }}</td></tr></tbody></table><div ng-bind-html="footer" ng-if="footer"></div><div class="cfp-hotkeys-close" ng-click="toggleCheatSheet()">×</div></div></div>',this.cheatSheetHotkey="?",this.cheatSheetDescription="Show / hide this help menu",this.$get=["$rootElement","$rootScope","$compile","$window","$document",function(a,b,c,d,e){function f(){q=!1}function g(){q=!0}function h(a){var b={command:"⌘",shift:"⇧",left:"←",right:"→",up:"↑",down:"↓",return:"⏎",backspace:"⌫"};a=a.split("+");for(var c=0;c<a.length;c++)"mod"===a[c]&&(d.navigator&&d.navigator.platform.indexOf("Mac")>=0?a[c]="command":a[c]="ctrl"),a[c]=b[a[c]]||a[c];return a.join(" + ")}function i(a,b,c,d,e,f){this.combo=a instanceof Array?a:[a],this.description=b,this.callback=c,this.action=d,this.allowIn=e,this.persistent=f,this._formated=null}function j(){for(var a=r.hotkeys.length;a--;){var b=r.hotkeys[a];b&&!b.persistent&&m(b)}}function k(){r.helpVisible=!r.helpVisible,r.helpVisible?(w=n("esc"),m("esc"),l("esc",w.description,k,null,["INPUT","SELECT","TEXTAREA"])):(m("esc"),w!==!1&&l(w))}function l(a,b,c,d,e,f){var g,h=["INPUT","SELECT","TEXTAREA"],j=Object.prototype.toString.call(a);if("[object Object]"===j&&(b=a.description,c=a.callback,d=a.action,f=a.persistent,e=a.allowIn,a=a.combo),m(a),b instanceof Function?(d=c,c=b,b="$$undefined$$"):angular.isUndefined(b)&&(b="$$undefined$$"),void 0===f&&(f=!0),"function"==typeof c){g=c,e instanceof Array||(e=[]);for(var k,l=0;l<e.length;l++)e[l]=e[l].toUpperCase(),k=h.indexOf(e[l]),k!==-1&&h.splice(k,1);c=function(a){var b=!0;if(a){var c=a.target||a.srcElement,d=c.nodeName.toUpperCase();if((" "+c.className+" ").indexOf(" mousetrap ")>-1)b=!0;else for(var e=0;e<h.length;e++)if(h[e]===d){b=!1;break}}b&&p(g.apply(this,arguments))}}"string"==typeof d?Mousetrap.bind(a,p(c),d):Mousetrap.bind(a,p(c));var n=new i(a,b,c,d,e,f);return r.hotkeys.push(n),n}function m(a){var b=a instanceof i?a.combo:a;if(Mousetrap.unbind(b),angular.isArray(b)){for(var c=!0,d=b.length;d--;)c=m(b[d])&&c;return c}var e=r.hotkeys.indexOf(n(b));return e>-1&&(r.hotkeys[e].combo.length>1?r.hotkeys[e].combo.splice(r.hotkeys[e].combo.indexOf(b),1):(angular.forEach(s,function(a){var b=a.indexOf(r.hotkeys[e]);b!==-1&&a.splice(b,1)}),r.hotkeys.splice(e,1)),!0)}function n(a){if(!a)return r.hotkeys;for(var b,c=0;c<r.hotkeys.length;c++)if(b=r.hotkeys[c],b.combo.indexOf(a)>-1)return b;return!1}function o(a){return a.$id in s||(s[a.$id]=[],a.$on("$destroy",function(){for(var b=s[a.$id].length;b--;)m(s[a.$id].pop())})),{add:function(b){var c;return c=arguments.length>1?l.apply(this,arguments):l(b),s[a.$id].push(c),this}}}function p(a){return function(c,d){if(a instanceof Array){var e=a[0],f=a[1];a=function(a){f.scope.$eval(e)}}b.$apply(function(){a(c,n(d))})}}var q=!0;Mousetrap.prototype.stopCallback=function(a,b){return!q||!((" "+b.className+" ").indexOf(" mousetrap ")>-1)&&(b.contentEditable&&"true"==b.contentEditable)},i.prototype.format=function(){if(null===this._formated){for(var a=this.combo[0],b=a.split(/[\s]/),c=0;c<b.length;c++)b[c]=h(b[c]);this._formated=b}return this._formated};var r=b.$new();r.hotkeys=[],r.helpVisible=!1,r.title=this.templateTitle,r.header=this.templateHeader,r.footer=this.templateFooter,r.toggleCheatSheet=k;var s={};if(this.useNgRoute&&b.$on("$routeChangeSuccess",function(a,b){j(),b&&b.hotkeys&&angular.forEach(b.hotkeys,function(a){var c=a[2];("string"==typeof c||c instanceof String)&&(a[2]=[c,b]),a[5]=!1,l.apply(this,a)})}),this.includeCheatSheet){var t=e[0],u=a[0],v=angular.element(this.template);l(this.cheatSheetHotkey,this.cheatSheetDescription,k),u!==t&&u!==t.documentElement||(u=t.body),angular.element(u).append(c(v)(r))}var w=!1,x={add:l,del:m,get:n,bindTo:o,template:this.template,toggleCheatSheet:k,includeCheatSheet:this.includeCheatSheet,cheatSheetHotkey:this.cheatSheetHotkey,cheatSheetDescription:this.cheatSheetDescription,useNgRoute:this.useNgRoute,purgeHotkeys:j,templateTitle:this.templateTitle,pause:f,unpause:g};return x}]}]).directive("hotkey",["hotkeys",function(a){return{restrict:"A",link:function(b,c,d){var e,f=[];angular.forEach(b.$eval(d.hotkey),function(b,c){e="string"==typeof d.hotkeyAllowIn?d.hotkeyAllowIn.split(/[\s,]+/):[],f.push(c),a.add({combo:c,description:d.hotkeyDescription,callback:b,action:d.hotkeyAction,allowIn:e})}),c.bind("$destroy",function(){angular.forEach(f,a.del)})}}}]).run(["hotkeys",function(a){}])}(),function(a,b,c,d){function e(a,b,c){return a.addEventListener?void a.addEventListener(b,c,!1):void a.attachEvent("on"+b,c)}function f(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);return a.shiftKey||(b=b.toLowerCase()),b}if(0===a.which&&s){var c=new RegExp(t[s].pattern),d=-1;if(c.test(a.key.toLowerCase())&&(d=t[s].characters.indexOf(a.key.toLowerCase()),d!==-1))return t.eng.characters[d]}return u[a.which]?u[a.which]:v[a.which]?v[a.which]:String.fromCharCode(a.which).toLowerCase()}function g(a,b){return a.sort().join(",")===b.sort().join(",")}function h(a){var b=[];return a.shiftKey&&b.push("shift"),a.altKey&&b.push("alt"),a.ctrlKey&&b.push("ctrl"),a.metaKey&&b.push("meta"),b}function i(a){return a.preventDefault?void a.preventDefault():void(a.returnValue=!1)}function j(a){return a.stopPropagation?void a.stopPropagation():void(a.cancelBubble=!0)}function k(a){return"shift"==a||"ctrl"==a||"alt"==a||"meta"==a}function l(){if(!r){r={};for(var a in u)a>95&&a<112||u.hasOwnProperty(a)&&(r[u[a]]=a)}return r}function m(a,b,c){return c||(c=l()[a]?"keydown":"keypress"),"keypress"==c&&b.length&&(c="keydown"),c}function n(a){return"+"===a?["+"]:(a=a.replace(/\+{2}/g,"+plus"),a.split("+"))}function o(a,b){var c,d,e,f=[];for(c=n(a),e=0;e<c.length;++e)d=c[e],x[d]&&(d=x[d]),b&&"keypress"!=b&&w[d]&&(d=w[d],f.push("shift")),k(d)&&f.push(d);return b=m(d,f,b),{key:d,modifiers:f,action:b}}function p(a,c){return null!==a&&a!==b&&(a===c||p(a.parentNode,c))}function q(a){function c(a){a=a||{};var b,c=!1;for(b in u)a[b]?c=!0:u[b]=0;c||(x=!1)}function d(a,b,c,d,e,f){var h,i,j=[],l=c.type;if(!s._callbacks[a])return[];for("keyup"==l&&k(a)&&(b=[a]),h=0;h<s._callbacks[a].length;++h)if(i=s._callbacks[a][h],(d||!i.seq||u[i.seq]==i.level)&&l==i.action&&("keypress"==l&&!c.metaKey&&!c.ctrlKey||g(b,i.modifiers))){var m=!d&&i.combo==e,n=d&&i.seq==d&&i.level==f;(m||n)&&s._callbacks[a].splice(h,1),j.push(i)}return j}function l(a,b,c,d){s.stopCallback(b,b.target||b.srcElement,c,d)||a(b,c)===!1&&(i(b),j(b))}function m(a){"number"!=typeof a.which&&(a.which=a.keyCode);var b=f(a);if(b)return"keyup"==a.type&&v===b?void(v=!1):void s.handleKey(b,h(a),a)}function n(){clearTimeout(t),t=setTimeout(c,1e3)}function p(a,b,d,e){function g(b){return function(){x=b,++u[a],n()}}function h(b){l(d,b,a),"keyup"!==e&&(v=f(b)),setTimeout(c,10)}u[a]=0;for(var i=0;i<b.length;++i){var j=i+1===b.length,k=j?h:g(e||o(b[i+1]).action);r(b[i],k,e,a,i)}}function r(a,b,c,e,f){s._directMap[a+":"+c]=b,a=a.replace(/\s+/g," ");var g,h=a.split(" ");return h.length>1?void p(a,h,b,c):(g=o(a,c),s._callbacks[g.key]=s._callbacks[g.key]||[],d(g.key,g.modifiers,{type:g.action},e,a,f),void s._callbacks[g.key][e?"unshift":"push"]({callback:b,modifiers:g.modifiers,action:g.action,seq:e,level:f,combo:a}))}var s=this;if(a=a||b,!(s instanceof q))return new q(a);s.target=a,s._callbacks={},s._directMap={};var t,u={},v=!1,w=!1,x=!1;s._handleKey=function(a,b,e){var f,g=d(a,b,e),h={},i=0,j=!1;for(f=0;f<g.length;++f)g[f].seq&&(i=Math.max(i,g[f].level));for(f=0;f<g.length;++f)if(g[f].seq){if(g[f].level!=i)continue;j=!0,h[g[f].seq]=1,l(g[f].callback,e,g[f].combo,g[f].seq)}else j||l(g[f].callback,e,g[f].combo);var m="keypress"==e.type&&w;e.type!=x||k(a)||m||c(h),w=j&&"keydown"==e.type},s._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)r(a[d],b,c)},e(a,"keypress",m),e(a,"keydown",m),e(a,"keyup",m)}for(var r,s=c,t={eng:{characters:"qwertyuiopasdfghjkl;'zxcvbnm,QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>`~[].".split(""),pattern:"[a-z]"},rus:{characters:"йцукенгшщзфывапролджэячсмитьбЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёЁхъю".split(""),pattern:"[а-я]"}},u={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},v={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},w={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},x={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},y=1;y<20;++y)u[111+y]="f"+y;for(y=0;y<=9;++y)u[y+96]=y;q.prototype.bind=function(a,b,c){var d=this;return a=a instanceof Array?a:[a],d._bindMultiple.call(d,a,b,c),d},q.prototype.unbind=function(a,b){var c=this;return c.bind.call(c,a,function(){},b)},q.prototype.trigger=function(a,b){var c=this;return c._directMap[a+":"+b]&&c._directMap[a+":"+b]({},a),c},q.prototype.reset=function(){var a=this;return a._callbacks={},a._directMap={},a},q.prototype.stopCallback=function(a,b){var c=this;return!((" "+b.className+" ").indexOf(" mousetrap ")>-1)&&(!p(b,c.target)&&("INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable))},q.prototype.handleKey=function(){var a=this;return a._handleKey.apply(a,arguments)},q.init=function(){var a=q(b);for(var c in a)"_"!==c.charAt(0)&&(q[c]=function(b){return function(){return a[b].apply(a,arguments)}}(c))},q.init(),a.Mousetrap=q,"undefined"!=typeof module&&module.exports&&(module.exports=q),"function"==typeof define&&define.amd&&define(function(){return q})}(window,document,"rus"); | 1,522.142857 | 10,518 | 0.657626 |
12989fab7188789d0fd5aefbd67c01bfc88bb5d9 | 2,137 | js | JavaScript | src/js/login.js | xiekecheng/MallDemo | 7191daebbcb45e07b6f1d70722aadd84c2fba813 | [
"Apache-2.0"
] | null | null | null | src/js/login.js | xiekecheng/MallDemo | 7191daebbcb45e07b6f1d70722aadd84c2fba813 | [
"Apache-2.0"
] | null | null | null | src/js/login.js | xiekecheng/MallDemo | 7191daebbcb45e07b6f1d70722aadd84c2fba813 | [
"Apache-2.0"
] | null | null | null | $(function () {
// 判断你是否有记住的用户名
var remusername = getCookie('remusername');
// 有保存的用户名则自动填充
if(remusername){
$('[name="username"]').val(remusername);
}
// console.log(111);
$('.jdlogin').on('click', function () {
// $('[type="button"]').on('click', function () {
// 验证用户名
if ($('[name="username"]').val() === '') {
layer.msg('用户名不能为空', {
icon: 2,
time: 1500
})
return false;
}
// 验证用户名
if ($('[name="password"]').val() === '') {
layer.msg('密码不能为空', {
icon: 2,
time: 1500
})
return false;
}
// 禁用按钮避免过多请求
$(this).prop('disabled', true)
// 遮罩层
var loadIndex = layer.load(0, {
shade: false
});
$.ajax({
method: "POST",
url: "./php/login.php",
data: $('form').serialize(),
dataType:'json',
success: res=>{
$(this).prop('disabled', false)
layer.close(loadIndex);
var {meta:{status,msg}} = res;
// 账号密码正确
if (status === 1) {
// 将用户名密码存储在cookie中
setCookie('username',$('[name="username" ]').val())
// setCookie('password',$('[name="password" ]').val())
if($('[name="remember"]').prop('checked')){
setCookie('remusername',$('[name="username" ]').val())
}
layer.msg(msg, {
icon: 1,
time: 1500
}, function () {
location.href = 'home.html';
})
} else {
layer.msg(msg, {
icon: 2,
time: 1500
}, function () {
// location.href = 'login.html';
})
}
}
})
})
}) | 28.118421 | 78 | 0.346748 |
12997faf7df981ada980b549248d4c03d3086b5a | 788 | js | JavaScript | plugins/eslint/index.js | arpowers/poi | 67f2f47e637ccaf07318d995490f6a825ce92c59 | [
"MIT"
] | 1 | 2021-05-22T22:36:07.000Z | 2021-05-22T22:36:07.000Z | plugins/eslint/index.js | arpowers/poi | 67f2f47e637ccaf07318d995490f6a825ce92c59 | [
"MIT"
] | null | null | null | plugins/eslint/index.js | arpowers/poi | 67f2f47e637ccaf07318d995490f6a825ce92c59 | [
"MIT"
] | null | null | null | exports.name = 'eslint'
exports.apply = api => {
api.hook('createWebpackChain', config => {
const { cacheIdentifier } = api.getCacheConfig('eslint-loader', {}, [
'.eslintrc.js',
'.eslintrc.yaml',
'.eslintrc.yml',
'.eslintrc.json',
'.eslintrc',
'package.json'
])
config.module
.rule('eslint')
.test([/\.jsx?$/, /\.vue$/])
.pre()
.exclude.add(filepath => /node_modules/.test(filepath))
.end()
.use('eslint-loader')
.loader(require.resolve('eslint-loader'))
.options({
cache: api.config.cache,
cacheKey: cacheIdentifier,
formatter: require('eslint/lib/formatters/codeframe'),
eslintPath: api.localResolve('eslint') || require.resolve('eslint')
})
})
}
| 27.172414 | 75 | 0.567259 |
129993b176897e03c0ffe0bd2215e74ee2b759bb | 1,048 | js | JavaScript | examples/backup.js | SaltwaterC/dynamo-streams | 377301d161b365c1f34f97542dad93085fa41d53 | [
"MIT"
] | null | null | null | examples/backup.js | SaltwaterC/dynamo-streams | 377301d161b365c1f34f97542dad93085fa41d53 | [
"MIT"
] | null | null | null | examples/backup.js | SaltwaterC/dynamo-streams | 377301d161b365c1f34f97542dad93085fa41d53 | [
"MIT"
] | null | null | null | 'use strict';
var fs = require('fs');
var zlib = require('zlib');
var AWS = require('aws-sdk');
var Backup = require('../lib/main').Backup;
var table = process.argv[2];
var bs = new Backup({
client: new AWS.DynamoDB(),
table: table,
capacityPercentage: 100,
concurrency: 2
});
var gzip = zlib.createGzip({
level: 9
});
var ws = fs.createWriteStream(table + '.json.gz');
bs.pipe(gzip).pipe(ws);
// outputs a lot less noise compared to listening for 'progress' events
var progress = setInterval(function() {
var percent = 0;
if (bs.itemsCount > 0 && bs.itemsProcessed > 0) {
percent = bs.itemsProcessed / bs.itemsCount * 100;
if (percent > 100) {
percent = 100;
}
if (percent === 100) {
clearInterval(progress);
}
}
console.log(table + ' progress: %f% - %d of %d; capacity %d - used: %d / %d', percent, bs.itemsProcessed, bs.itemsCount, bs.limit, bs.units.reduce(function(a, b) {
return a + b;
}, 0), bs.concurrency);
}, 1000);
bs.on('end', function() {
clearInterval(progress);
});
| 22.782609 | 165 | 0.625954 |
129a06291b2a1970995fdeba0b0c8cc30753fd7b | 1,431 | js | JavaScript | protocol-designer/src/components/StepEditForm/ButtonRow.js | ethguo/opentrons | 1965ef499b89e3dc882ccb0d6a95ba998fcab13a | [
"Apache-2.0"
] | null | null | null | protocol-designer/src/components/StepEditForm/ButtonRow.js | ethguo/opentrons | 1965ef499b89e3dc882ccb0d6a95ba998fcab13a | [
"Apache-2.0"
] | null | null | null | protocol-designer/src/components/StepEditForm/ButtonRow.js | ethguo/opentrons | 1965ef499b89e3dc882ccb0d6a95ba998fcab13a | [
"Apache-2.0"
] | null | null | null | // @flow
import * as React from 'react'
import {connect} from 'react-redux'
import {OutlineButton, PrimaryButton} from '@opentrons/components'
import {actions, selectors} from '../../steplist'
import type {BaseState, ThunkDispatch} from '../../types'
import styles from './StepEditForm.css'
type OP = {onDelete?: (event: SyntheticEvent<>) => mixed}
type SP = {canSave?: ?boolean}
type DP = {
onClickMoreOptions: (event: SyntheticEvent<>) => mixed,
onCancel: (event: SyntheticEvent<>) => mixed,
onSave: (event: SyntheticEvent<>) => mixed,
}
type Props = OP & SP & DP
const ButtonRow = (props: Props) => {
const {canSave, onDelete, onSave, onCancel, onClickMoreOptions} = props
return (
<div className={styles.button_row}>
<OutlineButton onClick={onDelete}>DELETE</OutlineButton>
<OutlineButton onClick={onClickMoreOptions}>NOTES</OutlineButton>
<PrimaryButton className={styles.cancel_button} onClick={onCancel}>CANCEL</PrimaryButton>
<PrimaryButton disabled={!canSave} onClick={onSave}>SAVE</PrimaryButton>
</div>
)
}
const STP = (state: BaseState): SP => ({ canSave: selectors.currentFormCanBeSaved(state) })
const DTP = (dispatch: ThunkDispatch<*>): DP => ({
onCancel: () => dispatch(actions.cancelStepForm()),
onSave: () => dispatch(actions.saveStepForm()),
onClickMoreOptions: () => dispatch(actions.openMoreOptionsModal())
})
export default connect(STP, DTP)(ButtonRow)
| 35.775 | 95 | 0.703005 |
129a0c6b6762d97d3be4dd85615ebc61938778ad | 480 | js | JavaScript | src/utils/request.js | lxyg06/vue-player | d7a57ee585c6faed15c439da37faeb5b32491b2e | [
"MIT"
] | 1 | 2020-12-14T11:09:11.000Z | 2020-12-14T11:09:11.000Z | src/utils/request.js | lxyg06/vue-player | d7a57ee585c6faed15c439da37faeb5b32491b2e | [
"MIT"
] | null | null | null | src/utils/request.js | lxyg06/vue-player | d7a57ee585c6faed15c439da37faeb5b32491b2e | [
"MIT"
] | 2 | 2020-12-14T11:09:12.000Z | 2021-01-03T13:38:08.000Z | import axios from 'axios'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api 的 base_url
timeout: 5000 // 请求超时时间
})
// request拦截器
service.interceptors.request.use(
config => config,
error => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
}
)
// response 拦截器
service.interceptors.response.use(
response => response.data,
error => Promise.reject(error)
)
export default service
| 18.461538 | 50 | 0.695833 |
129a7f5888e9fd7cbcd24221a7a9b26e9eb2d589 | 686 | js | JavaScript | karma.common.conf.js | cryptokat/semux-js | 98c078003fc119c03fcdab9d557c1928dc1d0f32 | [
"MIT"
] | null | null | null | karma.common.conf.js | cryptokat/semux-js | 98c078003fc119c03fcdab9d557c1928dc1d0f32 | [
"MIT"
] | null | null | null | karma.common.conf.js | cryptokat/semux-js | 98c078003fc119c03fcdab9d557c1928dc1d0f32 | [
"MIT"
] | null | null | null | module.exports = {
basePath: '.',
frameworks: ['mocha'],
reporters: ['mocha'],
port: 9876,
files: [
{ pattern: "test/index.ts", watched: false }
],
preprocessors: {
"test/index.ts": ['rollup', 'transformPath']
},
rollupPreprocessor: {
output: {
format: 'iife', // Helps prevent naming collisions.
name: 'SemuxTest', // Required for 'iife' format.
sourcemap: "inline"
},
plugins: [require('rollup-plugin-glob-import')()].concat(require('./rollup.config').plugins),
},
transformPathPreprocessor: {
transformer: path => path.replace(/\.ts$/i, ".js")
},
singleRun: true,
browserNoActivityTimeout: 100000
}; | 20.176471 | 97 | 0.603499 |
129aa010d5e0220b4102c3469945380da5ff68ef | 4,342 | js | JavaScript | packages/Hydrogen/node_modules/@jupyterlab/coreutils/lib/pageconfig.js | hasnain1230/Atom-Settings | ae1e30dbb572fa00228982a3aa937af6f53c8e36 | [
"MIT"
] | null | null | null | packages/Hydrogen/node_modules/@jupyterlab/coreutils/lib/pageconfig.js | hasnain1230/Atom-Settings | ae1e30dbb572fa00228982a3aa937af6f53c8e36 | [
"MIT"
] | null | null | null | packages/Hydrogen/node_modules/@jupyterlab/coreutils/lib/pageconfig.js | hasnain1230/Atom-Settings | ae1e30dbb572fa00228982a3aa937af6f53c8e36 | [
"MIT"
] | null | null | null | "use strict";
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", { value: true });
var coreutils_1 = require("@phosphor/coreutils");
var minimist = require("minimist");
var url_1 = require("./url");
/**
* The namespace for Page Config functions.
*/
var PageConfig;
(function (PageConfig) {
/**
* Get global configuration data for the Jupyter application.
*
* @param name - The name of the configuration option.
*
* @returns The config value or an empty string if not found.
*
* #### Notes
* All values are treated as strings.
* For browser based applications, it is assumed that the page HTML
* includes a script tag with the id `jupyter-config-data` containing the
* configuration as valid JSON.
* For node applications, it is assumed that the process was launched
* with a `--jupyter-config-data` option pointing to a JSON settings
* file.
*/
function getOption(name) {
if (configData) {
return configData[name] || '';
}
configData = Object.create(null);
var found = false;
// Use script tag if available.
if (typeof document !== 'undefined') {
var el = document.getElementById('jupyter-config-data');
if (el) {
configData = JSON.parse(el.textContent || '');
found = true;
}
}
// Otherwise use CLI if given.
if (!found && typeof process !== 'undefined') {
try {
var cli = minimist(process.argv.slice(2));
if ('jupyter-config-data' in cli) {
var path = require('path');
var fullPath = path.resolve(cli['jupyter-config-data']);
/* tslint:disable */
// Force Webpack to ignore this require.
configData = eval('require')(fullPath);
/* tslint:enable */
}
}
catch (e) {
console.error(e);
}
}
if (!coreutils_1.JSONExt.isObject(configData)) {
configData = Object.create(null);
}
else {
for (var key in configData) {
// Quote characters are escaped, unescape them.
configData[key] = String(configData[key]).split(''').join('"');
}
}
return configData[name] || '';
}
PageConfig.getOption = getOption;
/**
* Set global configuration data for the Jupyter application.
*
* @param name - The name of the configuration option.
* @param value - The value to set the option to.
*
* @returns The last config value or an empty string if it doesn't exist.
*/
function setOption(name, value) {
var last = getOption(name);
configData[name] = value;
return last;
}
PageConfig.setOption = setOption;
/**
* Get the base url for a Jupyter application.
*/
function getBaseUrl() {
var baseUrl = getOption('baseUrl');
if (!baseUrl || baseUrl === '/') {
baseUrl = (typeof location === 'undefined' ?
'http://localhost:8888/' : location.origin + '/');
}
return url_1.URLExt.parse(baseUrl).toString();
}
PageConfig.getBaseUrl = getBaseUrl;
/**
* Get the base websocket URLExt for a Jupyter application.
*/
function getWsUrl(baseUrl) {
var wsUrl = getOption('wsUrl');
if (!wsUrl) {
baseUrl = baseUrl || getBaseUrl();
if (baseUrl.indexOf('http') !== 0) {
if (typeof location !== 'undefined') {
baseUrl = url_1.URLExt.join(location.origin, baseUrl);
}
else {
baseUrl = url_1.URLExt.join('http://localhost:8888/', baseUrl);
}
}
wsUrl = 'ws' + baseUrl.slice(4);
}
return url_1.URLExt.parse(wsUrl).toString();
}
PageConfig.getWsUrl = getWsUrl;
/**
* Private page config data for the Jupyter application.
*/
var configData = null;
})(PageConfig = exports.PageConfig || (exports.PageConfig = {}));
| 35.300813 | 83 | 0.54514 |
129b0e57948486f2952650c07a77abc3f5021a7f | 2,280 | js | JavaScript | javascriptv3/example_code/lambda/lambda_create_function/src/mylamdbafunction.js | chatnish/aws-doc-sdk-examples | 8316d2096fdfc028363a0aeaa7c3ee3310a36f3b | [
"Apache-2.0"
] | null | null | null | javascriptv3/example_code/lambda/lambda_create_function/src/mylamdbafunction.js | chatnish/aws-doc-sdk-examples | 8316d2096fdfc028363a0aeaa7c3ee3310a36f3b | [
"Apache-2.0"
] | null | null | null | javascriptv3/example_code/lambda/lambda_create_function/src/mylamdbafunction.js | chatnish/aws-doc-sdk-examples | 8316d2096fdfc028363a0aeaa7c3ee3310a36f3b | [
"Apache-2.0"
] | null | null | null | /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
ABOUT THIS NODE.JS EXAMPLE: This example works with AWS SDK for JavaScript version 3 (v3),
which is available at https://github.com/aws/aws-sdk-js-v3. This example is in the 'AWS SDK for JavaScript v3 Developer Guide' at
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/using-lambda-ddb-setup.html.
Purpose:
mylambdafunction.ts demonstrates how to create a AWS Lambda function that creates an Amazon DynamoDB database table.
It is part of a tutorial demonstrating how create and deploy an AWS Lambda function. To run the full tutorial, see
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/lambda-create-table-example.html.
Inputs (replace in code):
- REGION
- TABLE_NAME
*/
// snippet-start:[lambda.JavaScript.general-examples-lambda-create-function.CreateTableV3]
"use strict";
// Load the required clients and packages.
const { CreateTableCommand } = require ( "@aws-sdk/client-dynamodb" );
const { dynamoClient } = require ( "./libs/dynamoClient" );
//Set the AWS Region.
const REGION = "REGION"; //e.g. "us-east-1"
// Set the parameters.
const params = {
AttributeDefinitions: [
{
AttributeName: "Season", //ATTRIBUTE_NAME_1
AttributeType: "N", //ATTRIBUTE_TYPE
},
{
AttributeName: "Episode", //ATTRIBUTE_NAME_2
AttributeType: "N", //ATTRIBUTE_TYPE
},
],
KeySchema: [
{
AttributeName: "Season", //ATTRIBUTE_NAME_1
KeyType: "HASH",
},
{
AttributeName: "Episode", //ATTRIBUTE_NAME_2
KeyType: "RANGE",
},
],
ProvisionedThroughput: {
ReadCapacityUnits: 1,
WriteCapacityUnits: 1,
},
TableName: "TABLE_NAME", //TABLE_NAME
StreamSpecification: {
StreamEnabled: false,
},
};
exports.handler = async(event, context, callback) => {
try {
const data = await dynamoClient.send(new CreateTableCommand(params));
console.log("Table Created", data);
} catch (err) {
console.log("Error", err);
}
};
// snippet-end:[lambda.JavaScript.general-examples-lambda-create-function.CreateTableV3]
| 33.043478 | 129 | 0.665789 |
129b5d87cfccd0fe4441ede62ce890223262024c | 447 | js | JavaScript | src/random-example.js | wintersummermint/lodash-fiddle-playgroung | 2ad64f8159e0285dacc2cf20381b8731f5def856 | [
"MIT"
] | 19 | 2016-04-24T11:20:45.000Z | 2020-03-07T18:12:23.000Z | src/random-example.js | wintersummermint/lodash-fiddle-playgroung | 2ad64f8159e0285dacc2cf20381b8731f5def856 | [
"MIT"
] | null | null | null | src/random-example.js | wintersummermint/lodash-fiddle-playgroung | 2ad64f8159e0285dacc2cf20381b8731f5def856 | [
"MIT"
] | 1 | 2019-09-28T08:35:59.000Z | 2019-09-28T08:35:59.000Z | window.lodashExample.random = {};
window.lodashExample.random.code = [
'// Get a random number between 15 and 20.',
'',
'// Naive utility method',
'function getRandomNumber(min, max){',
' return Math.floor(Math.random() * (max - min + 1)) + min;',
'}',
'',
'getRandomNumber(15, 20);',
'',
'// Lodash',
'let rand = _.random(15, 20);',
'',
'console.log(rand)'
].join('\n');
window.lodashExample.random.display = 'Random Function';
| 22.35 | 65 | 0.612975 |
129c0c10b612224759661de8c7db5849994633f8 | 5,448 | js | JavaScript | test/mutations.js | wifisher/vuex-easy-firestore | 37f0508248fe8937f9bad09e2abba7b35d979b17 | [
"MIT"
] | 225 | 2018-09-11T15:51:39.000Z | 2022-02-17T15:31:24.000Z | test/mutations.js | wifisher/vuex-easy-firestore | 37f0508248fe8937f9bad09e2abba7b35d979b17 | [
"MIT"
] | 278 | 2018-09-11T04:39:59.000Z | 2022-02-26T20:34:02.000Z | test/mutations.js | wifisher/vuex-easy-firestore | 37f0508248fe8937f9bad09e2abba7b35d979b17 | [
"MIT"
] | 31 | 2018-11-13T12:12:28.000Z | 2022-02-07T22:58:40.000Z | import test from 'ava'
import { store } from './helpers/index.cjs.js'
import firebase from 'firebase/app'
import 'firebase/firestore'
const char = store.state.mainCharacter
test('RESET_VUEX_EASY_FIRESTORE_STATE', t => {
// test('SET_PATHVARS', t => {
t.is(store.state.testMutationsNoStateProp._conf.firestorePath, 'coll/{name}')
t.deepEqual(store.state.testMutationsNoStateProp._sync.pathVariables, {})
t.is(store.getters['testMutationsNoStateProp/firestorePathComplete'], 'coll/{name}')
store.commit('testMutationsNoStateProp/SET_PATHVARS', { name: 'Satoshi' })
t.is(store.state.testMutationsNoStateProp._conf.firestorePath, 'coll/{name}')
t.is(store.getters['testMutationsNoStateProp/firestorePathComplete'], 'coll/Satoshi')
t.deepEqual(store.state.testMutationsNoStateProp._sync.pathVariables, { name: 'Satoshi' })
// test('RESET_VUEX_EASY_FIRESTORE_STATE', t => {
const defaultState = {
signedIn: false,
userId: null,
streaming: {},
unsubscribe: {},
pathVariables: {},
patching: false,
syncStack: {
inserts: [],
updates: {},
propDeletions: {},
deletions: [],
debounceTimer: null,
rejects: [],
resolves: [],
},
fetched: {},
stopPatchingTimeout: null,
}
const testState = {
unsubscribe: true,
pathVariables: { name: 'Luca' },
patching: true,
syncStack: {
inserts: [{ a: true }],
updates: { a: true },
propDeletions: { '2': { a: firebase.firestore.FieldValue.delete() } },
deletions: ['2'],
debounceTimer: true,
},
fetched: { a: true },
stopPatchingTimeout: 1,
}
// 1. WithStateProp (collection)
const statePropModule = store.state.testMutationsWithStateProp
// insert docs
const a = { id: '_a', name: 'Bulbasaur', type: { grass: true } }
const b = { id: '_b', name: 'Charmander', type: { fire: true } }
const docs = [a, b]
store.dispatch('testMutationsWithStateProp/insertBatch', docs).catch(console.error)
// check docs existence
t.deepEqual(statePropModule.putItHere['_a'], a)
t.deepEqual(statePropModule.putItHere['_b'], b)
// set _sync state
statePropModule._sync = testState
t.deepEqual(statePropModule._sync, testState)
// reset and check
store.commit('testMutationsWithStateProp/RESET_VUEX_EASY_FIRESTORE_STATE', { clearModule: true })
t.deepEqual(statePropModule._sync, defaultState)
t.deepEqual(statePropModule.putItHere, {})
// 2. NoStateProp (doc)
const noStatePropModule = store.state.testMutationsNoStateProp
// edit props
store.dispatch('testMutationsNoStateProp/set', { name: 'Miles Morales' })
store.dispatch('testMutationsNoStateProp/set', { items: ['Pokeball'] })
// add new props
store.dispatch('testMutationsNoStateProp/set', { golden: { birdy: true } })
store.dispatch('testMutationsNoStateProp/set', { umbrella: true })
store.dispatch('testMutationsNoStateProp/set', { rain: 'y day' })
// check props existence
t.is(noStatePropModule.name, 'Miles Morales')
t.deepEqual(noStatePropModule.items, ['Pokeball'])
t.deepEqual(noStatePropModule.golden, { birdy: true })
t.is(noStatePropModule.umbrella, true)
t.is(noStatePropModule.rain, 'y day')
// set _sync state
noStatePropModule._sync = testState
t.deepEqual(noStatePropModule._sync, testState)
// reset and check
store.commit('testMutationsNoStateProp/RESET_VUEX_EASY_FIRESTORE_STATE', { clearModule: true })
t.deepEqual(noStatePropModule._sync, defaultState)
t.is(noStatePropModule.name, 'Satoshi') // == module ini state
t.deepEqual(noStatePropModule.items, []) // == module ini state
t.falsy(noStatePropModule.golden)
t.falsy(noStatePropModule.umbrella)
t.falsy(noStatePropModule.rain)
})
test('SET_SYNCCLAUSES', t => {
const sync = char._conf.sync
t.deepEqual(sync.where, [])
t.deepEqual(sync.orderBy, [])
store.commit('mainCharacter/SET_SYNCCLAUSES', {
where: [
['hi.{userId}.docs.{nr}', '==', '{big}'],
['{userId}', '==', '{userId}'],
],
orderBy: ['date'],
})
t.deepEqual(sync.where, [
['hi.{userId}.docs.{nr}', '==', '{big}'],
['{userId}', '==', '{userId}'],
])
t.deepEqual(sync.orderBy, ['date'])
})
test('SET_PATHVARS', t => {
let res
res = char._sync.pathVariables
t.deepEqual(res, {})
store.commit('mainCharacter/SET_PATHVARS', { name: 'Satoshi' })
res = char._sync.pathVariables
t.deepEqual(res, { name: 'Satoshi' })
const types = { nr: 1, nulll: null, undef: undefined, date: new Date(), obj: {} }
store.commit('mainCharacter/SET_PATHVARS', types)
res = char._sync.pathVariables
t.deepEqual(res, { name: 'Satoshi', ...types })
})
const box = store.state.pokemonBox
test('SET_PATHVARS & where getter', async t => {
let res
box._conf.sync.where = [['hi.{userId}.docs.{name}', '==', '{big}']]
box._sync.userId = 'charlie'
// pokemonBox._sync.userId = 'charlie'
res = store.getters['pokemonBox/getWhereArrays']()
t.deepEqual(box._sync.pathVariables, {})
t.deepEqual(box._conf.sync.where, [['hi.{userId}.docs.{name}', '==', '{big}']])
t.deepEqual(res, [['hi.charlie.docs.{name}', '==', '{big}']])
store.commit('pokemonBox/SET_PATHVARS', { name: 'Satoshi' })
res = store.getters['pokemonBox/getWhereArrays']()
t.deepEqual(box._sync.pathVariables, { name: 'Satoshi' })
t.deepEqual(box._conf.sync.where, [['hi.{userId}.docs.{name}', '==', '{big}']])
t.deepEqual(res, [['hi.charlie.docs.Satoshi', '==', '{big}']])
})
| 37.315068 | 99 | 0.672907 |
129c7e8aeccc9bf92fb8f664a4a9cc48ebd64dff | 1,623 | js | JavaScript | node_modules/mdi-material-ui/Panda.js | Ashvith07/gwl-adventum-user | 4603a15afd6562b6e1cf77512a201114b8f8a5ff | [
"MIT"
] | null | null | null | node_modules/mdi-material-ui/Panda.js | Ashvith07/gwl-adventum-user | 4603a15afd6562b6e1cf77512a201114b8f8a5ff | [
"MIT"
] | 2 | 2021-05-11T05:44:20.000Z | 2022-01-27T16:09:36.000Z | node_modules/mdi-material-ui/Panda.js | Ashvith07/gwl-adventum-user | 4603a15afd6562b6e1cf77512a201114b8f8a5ff | [
"MIT"
] | 1 | 2020-07-20T20:50:01.000Z | 2020-07-20T20:50:01.000Z | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _createIcon = require('./util/createIcon');
var _createIcon2 = _interopRequireDefault(_createIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _createIcon2.default)(_react2.default.createElement(
'g',
null,
_react2.default.createElement('path', { d: 'M12,3C13.74,3 15.36,3.5 16.74,4.35C17.38,3.53 18.38,3 19.5,3C21.43,3 23,4.57 23,6.5C23,8 22.05,9.28 20.72,9.78C20.9,10.5 21,11.23 21,12C21,16.97 16.97,21 12,21C7.03,21 3,16.97 3,12C3,11.23 3.1,10.5 3.28,9.78C1.95,9.28 1,8 1,6.5C1,4.57 2.57,3 4.5,3C5.62,3 6.62,3.53 7.26,4.35C8.64,3.5 10.26,3 12,3M12,5C8.13,5 5,8.13 5,12C5,15.87 8.13,19 12,19C15.87,19 19,15.87 19,12C19,8.13 15.87,5 12,5M16.19,10.3C16.55,11.63 16.08,12.91 15.15,13.16C14.21,13.42 13.17,12.54 12.81,11.2C12.45,9.87 12.92,8.59 13.85,8.34C14.79,8.09 15.83,8.96 16.19,10.3M7.81,10.3C8.17,8.96 9.21,8.09 10.15,8.34C11.08,8.59 11.55,9.87 11.19,11.2C10.83,12.54 9.79,13.42 8.85,13.16C7.92,12.91 7.45,11.63 7.81,10.3M12,14C12.6,14 13.13,14.19 13.5,14.5L12.5,15.5C12.5,15.92 12.84,16.25 13.25,16.25C13.66,16.25 14,15.91 14,15.5C14,15.22 14.22,15 14.5,15C14.78,15 15,15.22 15,15.5C15,16.47 14.22,17.25 13.25,17.25C12.76,17.25 12.32,17.05 12,16.72C11.68,17.05 11.24,17.25 10.75,17.25C9.78,17.25 9,16.47 9,15.5C9,15.22 9.22,15 9.5,15C9.78,15 10,15.22 10,15.5C10,15.91 10.34,16.25 10.75,16.25C11.16,16.25 11.5,15.91 11.5,15.5L10.5,14.5C10.87,14.19 11.4,14 12,14Z' })
)); | 77.285714 | 1,166 | 0.686999 |
129cadcd2cc11ec9412cad40d1303d219f4f5754 | 1,101 | js | JavaScript | src/components/Search/SearchToggle.js | geops/trafimage-maps | 953241997094c37e18ccb7f2604a19b2eb057312 | [
"MIT"
] | 9 | 2019-07-10T12:30:57.000Z | 2022-03-04T15:50:23.000Z | src/components/Search/SearchToggle.js | geops/trafimage-maps | 953241997094c37e18ccb7f2604a19b2eb057312 | [
"MIT"
] | 962 | 2019-07-09T11:23:55.000Z | 2022-03-24T12:27:42.000Z | src/components/Search/SearchToggle.js | geops/trafimage-maps | 953241997094c37e18ccb7f2604a19b2eb057312 | [
"MIT"
] | 10 | 2019-07-09T08:59:16.000Z | 2020-10-21T08:28:13.000Z | import PropTypes from 'prop-types';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector, useDispatch } from 'react-redux';
import { setSearchOpen } from '../../model/app/actions';
import { ReactComponent as SearchIcon } from './Search.svg';
const propTypes = {
children: PropTypes.node,
};
const defaultProps = {
children: null,
};
function SearchToggle({ children }) {
const searchOpen = useSelector((state) => state.app.searchOpen);
const { t } = useTranslation();
const dispatch = useDispatch();
return (
<div>
<div
className={`wkp-search-toggle-container${searchOpen ? '--open' : ''}`}
>
{children}
</div>
{!searchOpen && (
<button
className="wkp-search-toggle-button"
type="button"
onClick={() => dispatch(setSearchOpen(true))}
>
<SearchIcon />
<span>{t('Suchen')}</span>
</button>
)}
</div>
);
}
SearchToggle.propTypes = propTypes;
SearchToggle.defaultProps = defaultProps;
export default SearchToggle;
| 23.934783 | 78 | 0.614896 |
129d7d1c055f16ecce080d3d00977c32da4cf02d | 245 | js | JavaScript | js-assessment/base10_34.js | lonelyhentai/nowcoder-collection | db795a5349b59f8cbb69e974adbb90ad30912558 | [
"WTFPL"
] | 1 | 2020-03-08T13:54:54.000Z | 2020-03-08T13:54:54.000Z | js-assessment/base10_34.js | lonelyhentai/nowcoder-collection | db795a5349b59f8cbb69e974adbb90ad30912558 | [
"WTFPL"
] | null | null | null | js-assessment/base10_34.js | lonelyhentai/nowcoder-collection | db795a5349b59f8cbb69e974adbb90ad30912558 | [
"WTFPL"
] | null | null | null | // [二进制转换](https://www.nowcoder.com/practice/4123561150114d119ba41f28219a454f)
function base10(str) {
return Number.prototype.toString.call(parseInt(str,2),10);
}
const assert = require('assert');
assert.deepEqual(base10('11000000'), 192); | 30.625 | 78 | 0.75102 |
129db6a17190fc729bb98255d86025472770ac9e | 1,062 | js | JavaScript | 4Frontend/src/taskpane/components/App.js | zaksel/NLG-System | 5989d276f766686de48dbaa18ad217872cdb2eeb | [
"MIT"
] | 2 | 2019-10-20T12:05:58.000Z | 2021-09-15T05:03:08.000Z | 4Frontend/src/taskpane/components/App.js | zaksel/NLG-System | 5989d276f766686de48dbaa18ad217872cdb2eeb | [
"MIT"
] | 4 | 2022-01-22T08:17:25.000Z | 2022-02-26T15:34:22.000Z | 4Frontend/src/taskpane/components/App.js | derEskimo/NLG-System | 5989d276f766686de48dbaa18ad217872cdb2eeb | [
"MIT"
] | null | null | null | import * as React from 'react';
import {Label, Pivot, PivotItem, PivotLinkFormat, PivotLinkSize} from 'office-ui-fabric-react';
import Content from './Content';
import Settings from './Settings';
import Instructions from './Instructions';
import About from './About';
export default class App extends React.Component {
render() {
return (
<div className='ms-welcome'>
<Pivot linkFormat={PivotLinkFormat.links} linkSize={PivotLinkSize.normal}>
<PivotItem headerText="Inputs">
<Content/>
</PivotItem>
<PivotItem headerText="Settings">
<Settings/>
</PivotItem>
<PivotItem headerText="Instructions">
<Instructions/>
</PivotItem>
<PivotItem headerText="About">
<About title="TDTG" logo="./assets/logo-filled.png" message="Technical Document Text Generator was created by Hannes-Christopher Zakes at ISW (Institut für Steuerungstechnik Universität Stuttgart)"/>
</PivotItem>
</Pivot>
</div>
);
}
}
| 34.258065 | 211 | 0.638418 |
129de01e8af181d0b908ec8639a82303a5263d75 | 457 | js | JavaScript | routes/apiRoutes.js | Jesse3421/Note-Taker-App | 7092732dea53e48d8d7dff9a55f99c1f28c3b4c9 | [
"MIT"
] | null | null | null | routes/apiRoutes.js | Jesse3421/Note-Taker-App | 7092732dea53e48d8d7dff9a55f99c1f28c3b4c9 | [
"MIT"
] | null | null | null | routes/apiRoutes.js | Jesse3421/Note-Taker-App | 7092732dea53e48d8d7dff9a55f99c1f28c3b4c9 | [
"MIT"
] | null | null | null | const router = require('express').Router();
const noteStore = require('../db/notestore');
router.get('/notes', (req, res) => {
noteStore.getNotes(req.body).then((notes) => {
res.json(notes);
}).catch((err) => res.status(500).json(err));
});
router.post('/notes', (req, res) => {
noteStore.saveNote(req.body)
.then((note) => res.json(note))
.catch((err) => res.status(500).json(err));
});
module.exports = router | 26.882353 | 52 | 0.579869 |
129df164a019c1dea31163e6e23eec2f824e6da9 | 16,078 | js | JavaScript | src/practice/MemorizationAid.js | melodyphu/idrama | 046a26138b16914ad55ebfea0dca4d4b4a1d0fc7 | [
"MIT"
] | null | null | null | src/practice/MemorizationAid.js | melodyphu/idrama | 046a26138b16914ad55ebfea0dca4d4b4a1d0fc7 | [
"MIT"
] | null | null | null | src/practice/MemorizationAid.js | melodyphu/idrama | 046a26138b16914ad55ebfea0dca4d4b4a1d0fc7 | [
"MIT"
] | null | null | null | import React, { useState, useEffect} from "react";
import SpeechRecognition, {
useSpeechRecognition,
} from "react-speech-recognition";
import { useSpeechSynthesis } from 'react-speech-kit';
import "./practice.css";
import "./memorize.css";
import Button from "@material-ui/core/Button";
import ListenIcon from "@material-ui/icons/Hearing";
import CancelIcon from "@material-ui/icons/Clear";
import VIDEO_SPECS from "./../constants/Video";
const MemorizationAid = (props) => {
// prop variables
const {script, selectedSpeaker, handRaised, totalLineCount} = props;
const {speak} = useSpeechSynthesis();
const [lineIdx, setLineIdx] = useState(0);
const [sectionIdx, setSectionIdx] = useState(0);
// whether or not the browser is listening to someone
const [listening, setListening] = useState(false);
// needs confirm
const [needsConfirm, setNeedsConfirm] = useState(false);
// voice "commands" aka detecting correctly spoken lines
const sectionMatches = script.map((sectionEntry, sidx) => {
let lines = sectionEntry.lines;
return lines.map((lineEntry, lidx) => {
return ({
command: lineEntry.line.join(" "),
isFuzzyMatch: true,
fuzzyMatchingThreshold: 0.7,
callback: (command, spokenPhrase) => {
if (needsConfirm) { return; }
if (sectionIdx === sidx && lineIdx === lidx) {
if (lidx + 1 >= lines.length) {
// move to next section
props.setLineIdx(0);
props.setSectionIdx(sectionIdx + 1);
setLineIdx(0);
setSectionIdx(sectionIdx + 1);
} else {
// move to next line of section
props.setLineIdx(lineIdx + 1);
setLineIdx(lineIdx + 1);
}
let message = "";
for (let word of lineEntry.line) {
if (spokenPhrase.split(" ").map((w) => {return w.toLowerCase()}).includes(word.toLowerCase())) {
message += word + " ";
} else {
message += "*" + word + " ";
}
}
props.setMessage(message);
setTimeout(function(){ props.setMessage("waiting for your next line!"); }, 1000);
}
}
})
})
})
// TODO: add restart section, previous section, and next sections
// also TODO: filter out the section specific ones if there are no sections given by the use
const simpleCommands = [
// asking iDrama for the current line
{
command: "line",
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
let {line} = script[sectionIdx].lines[lineIdx];
let newMessage = line.join(" ");
speak({text: newMessage});
props.setMessage(newMessage);
setTimeout(function(){ props.setMessage("waiting for the same line!"); }, 3000);
props.addToScore("line", sectionIdx, lineIdx);
}
},
{
command: "i drama line",
callback: () => {
if (needsConfirm) { return; }
let {line} = script[sectionIdx].lines[lineIdx];
let newMessage = line.join(" ");
speak({text: newMessage});
props.setMessage(newMessage);
props.addToScore("line", sectionIdx, lineIdx);
setTimeout(function(){ props.setMessage("waiting for the same line!"); }, 3000);
}
},
{
command: "previous line",
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
if (sectionIdx <= 0 && lineIdx <= 0) {
speak({text: "There are no previous lines"});
return;
}
let newLineIdx;
let newSectionIdx;
props.addToScore("previous line", sectionIdx, lineIdx);
// if at the begininning of a section
if (lineIdx === 0) {
newLineIdx = script[sectionIdx].lines.length - 1;
newSectionIdx = sectionIdx - 1;
} else {
newLineIdx = lineIdx - 1;
newSectionIdx = sectionIdx;
}
props.setLineIdx(newLineIdx);
props.setSectionIdx(newSectionIdx);
setLineIdx(newLineIdx);
setSectionIdx(newSectionIdx);
let {line} = script[newSectionIdx].lines[newLineIdx]
let newMessage = line.join(" ");
speak({text: newMessage});
props.setMessage(newMessage);
setTimeout(function(){ props.setMessage("Waiting for the previous line"); }, 3000);
}
},
{
command: "next line", // asking iDrama to move to the next line but with no hint
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
if (sectionIdx >= script.length - 1 && lineIdx >= script[sectionIdx].lines.length - 1) {
speak({text: "There are no upcoming lines"});
return;
}
speak({text: "Skipping to the next line"});
props.addToScore("next line", sectionIdx, lineIdx);
let newLineIdx;
let newSectionIdx;
// if at the end of the section
if (lineIdx >= script[sectionIdx].lines.length - 1) {
newSectionIdx = sectionIdx + 1;
newLineIdx = 0;
} else {
newSectionIdx = sectionIdx;
newLineIdx = lineIdx + 1;
}
props.setLineIdx(newLineIdx);
props.setSectionIdx(newSectionIdx);
setLineIdx(newLineIdx);
setSectionIdx(newSectionIdx);
props.setMessage("Waiting for the next line!");
}
},
{
command: "from beginning", // asking iDrama to restart the whole thing, needs confirmation
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
let message = "Are you sure you want to start at the very beginning? Answer with yes or no.";
speak({text: message});
props.setMessage(message);
setNeedsConfirm(true);
}
},
{
command: "restart section", // asking iDrama to restart the current section
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
let {section, lines} = script[sectionIdx];
let {line} = lines[0];
let newMessage = "Restarting " + section + ". Your first word is... " + line[0];
props.addToScore("restart section", sectionIdx, lineIdx);
speak({text: newMessage});
props.setMessage(newMessage);
props.setLineIdx(0);
setLineIdx(0);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
{
command: "previous section", // asking iDrama to move to the previous section
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
if (sectionIdx <= 0) {
speak({text: "There are no previous sections"});
return;
}
let {section, lines} = script[sectionIdx - 1];
let {line} = lines[0];
let newMessage = "Starting back at " + section + ". Your first word is... " + line[0];
props.addToScore("previous section", sectionIdx, lineIdx);
speak({text: newMessage});
props.setMessage(newMessage);
props.setLineIdx(0);
props.setSectionIdx(sectionIdx - 1);
setLineIdx(0);
setSectionIdx(sectionIdx - 1);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
{
command: "next section", // asking iDrama to move to the next section
callback: () => {
if (needsConfirm) { return; }
if (!handRaised) { return; }
if (sectionIdx >= script.length - 1) {
speak({text: "There are no previous sections"});
return;
}
let {section, lines} = script[sectionIdx + 1];
let {line} = lines[0];
let newMessage = "Skipping ahead to " + section + ". Your first word is... " + line[0];
speak({text: newMessage});
props.setMessage(newMessage);
props.addToScore("next section", sectionIdx, lineIdx);
props.setLineIdx(0);
props.setSectionIdx(sectionIdx + 1);
setLineIdx(0);
setSectionIdx(sectionIdx + 1);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
{
command: "yes",
callback: () => {
if (!needsConfirm) { return; }
// if (!handRaised) { return; }
speak({text: "Okay, starting at the beginning"});
props.setMessage("Restarting");
props.addToScore("from beginning", sectionIdx, lineIdx);
props.setLineIdx(0);
props.setSectionIdx(0);
setLineIdx(0);
setSectionIdx(0);
setNeedsConfirm(false);
setTimeout(function(){ props.setMessage("Waiting for your very first line!"); }, 1000);
}
},
{
command: "no",
callback: () => {
if (!handRaised) { return; }
if (needsConfirm) {
speak({text: "okay, we'll continue from here"});
setNeedsConfirm(false);
props.setMessage("waiting for your line!");
}
}
}
];
const iDramaCommands = [
{
command: "i drama previous line", // asking iDrama for the previous line, will need to repeat that one
callback: () => {
if (needsConfirm) { return; }
if (sectionIdx <= 0 && lineIdx <= 0) {
speak({text: "There are no previous lines"});
return;
}
let newLineIdx;
let newSectionIdx;
// if at the begininning of a section
if (lineIdx === 0) {
newLineIdx = script[sectionIdx].lines.length - 1;
newSectionIdx = sectionIdx - 1;
} else {
newLineIdx = lineIdx - 1;
newSectionIdx = sectionIdx;
}
props.setLineIdx(newLineIdx);
props.setSectionIdx(newSectionIdx);
props.addToScore("previous line", sectionIdx, lineIdx);
setLineIdx(newLineIdx);
setSectionIdx(newSectionIdx);
let {line} = script[newSectionIdx].lines[newLineIdx]
let newMessage = line.join(" ");
speak({text: newMessage});
props.setMessage(newMessage);
setTimeout(function(){ props.setMessage("Waiting for the previous line"); }, 3000);
}
},
{
command: "i drama next line", // asking iDrama to move to the next line but with no hint
callback: () => {
if (needsConfirm) { return; }
if (sectionIdx >= script.length - 1 && lineIdx >= script[sectionIdx].lines.length - 1) {
speak({text: "There are no upcoming lines"});
return;
}
speak({text: "Skipping to the next line"});
let newLineIdx;
let newSectionIdx;
// if at the end of the section
if (lineIdx >= script[sectionIdx].lines.length - 1) {
newSectionIdx = sectionIdx + 1;
newLineIdx = 0;
} else {
newSectionIdx = sectionIdx;
newLineIdx = lineIdx + 1;
}
props.setLineIdx(newLineIdx);
props.setSectionIdx(newSectionIdx);
props.addToScore("next line", sectionIdx, lineIdx);
setLineIdx(newLineIdx);
setSectionIdx(newSectionIdx);
props.setMessage("Waiting for the next line!");
}
},
{
command: "i drama from beginning", // asking iDrama to restart the whole thing, needs confirmation
callback: () => {
if (needsConfirm) { return; }
let message = "Are you sure you want to start at the very beginning? Answer with yes or no.";
speak({text: message});
props.setMessage(message);
setNeedsConfirm(true);
}
},
{
command: "i drama restart section", // asking iDrama to restart the current section
callback: () => {
if (needsConfirm) { return; }
let {section, lines} = script[sectionIdx];
let {line} = lines[0];
let newMessage = "Restarting " + section + ". Your first word is... " + line[0];
speak({text: newMessage});
props.setMessage(newMessage);
props.addToScore("restart section", sectionIdx, lineIdx);
props.setLineIdx(0);
setLineIdx(0);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
{
command: "i drama previous section", // asking iDrama to move to the previous section
callback: () => {
if (needsConfirm) { return; }
if (sectionIdx <= 0) {
speak({text: "There are no previous sections"});
return;
}
let {section, lines} = script[sectionIdx - 1];
let {line} = lines[0];
let newMessage = "Starting back at " + section + ". Your first word is... " + line[0];
speak({text: newMessage});
props.setMessage(newMessage);
props.addToScore("previous section", sectionIdx, lineIdx);
props.setLineIdx(0);
props.setSectionIdx(sectionIdx - 1);
setLineIdx(0);
setSectionIdx(sectionIdx - 1);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
{
command: "i drama next section", // asking iDrama to move to the next section
callback: () => {
if (needsConfirm) { return; }
if (sectionIdx >= script.length - 1) {
speak({text: "There are no previous sections"});
return;
}
let {section, lines} = script[sectionIdx + 1];
let {line} = lines[0];
let newMessage = "Skipping ahead to " + section + ". Your first word is... " + line[0];
speak({text: newMessage});
props.setMessage(newMessage);
props.addToScore("next section", sectionIdx, lineIdx);
props.setLineIdx(0);
props.setSectionIdx(sectionIdx + 1);
setLineIdx(0);
setSectionIdx(sectionIdx + 1);
let finalMessage = "Waiting for the first line of " + section;
setTimeout(function(){ props.setMessage(finalMessage); }, 3000);
}
},
];
// flatten section match commands first, then concat
const commands = sectionMatches.flat().concat(simpleCommands).concat(iDramaCommands);
var {
interimTranscript,
finalTranscript,
} = useSpeechRecognition({ commands });
// if speech recognition is not possible!
if (!SpeechRecognition.browserSupportsSpeechRecognition()) {
return (
<div> Your browser does not support speech recognition software!</div>
);
}
// continuous listening
const listenContinuously = () => {
console.log("start");
SpeechRecognition.startListening({
continuous: true,
language: "en-US",
});
};
return (
(!listening) ? (
<div className="enable">
<Button
variant="contained"
color="primary"
size="large"
endIcon={<ListenIcon />}
onClick={() => {
setListening(true);
props.setMessage("waiting for your first line!");
listenContinuously()
}}
>
Enable
</Button>
</div>
) : (
<div className="disable">
<Button
variant="contained"
color="primary"
size="large"
endIcon={<CancelIcon />}
onClick={() => {
setListening(false);
SpeechRecognition.abortListening();
props.setMessage("click enable to start!");
}}
>
Disable
</Button>
</div>
)
);
};
export default MemorizationAid;
| 29.179673 | 110 | 0.563627 |
129fff37b59042dd17926d1589c5b6a913c77351 | 3,612 | js | JavaScript | src/App.js | za1013/DashBoard_React_reDesign | 15e1c3ac54e55c4912da9fed648df5aa6ee46c15 | [
"MIT"
] | null | null | null | src/App.js | za1013/DashBoard_React_reDesign | 15e1c3ac54e55c4912da9fed648df5aa6ee46c15 | [
"MIT"
] | 4 | 2021-03-10T21:54:26.000Z | 2022-02-27T06:27:18.000Z | src/App.js | za1013/Dashboard_React_Redesign | 15e1c3ac54e55c4912da9fed648df5aa6ee46c15 | [
"MIT"
] | null | null | null | import GAListener from 'components/GAListener';
import { EmptyLayout, LayoutRoute, MainLayout } from 'components/Layout';
import PageSpinner from 'components/PageSpinner';
import AuthPage from 'pages/AuthPage';
import React, {useState, useEffect} from 'react';
import componentQueries from 'react-component-queries';
import { BrowserRouter, Redirect, Switch } from 'react-router-dom';
import './styles/reduction.scss';
import AuthRoute from './utils/AuthRoute'
import ReportPage from './pages/ReportPage';
const DashboardPage = React.lazy(() => import('pages/DashboardPage'));
const FormPage = React.lazy(() => import('pages/FormPage'));
const ModalPage = React.lazy(() => import('pages/ModalPage'));
const ProgressPage = React.lazy(() => import('pages/ProgressPage'));
const TablePage = React.lazy(() => import('pages/TablePage'));
const WidgetPage = React.lazy(() => import('pages/WidgetPage'));
const QuestionsPage = React.lazy(() => import('pages/QuestionsPage'))
const getBasename = () => {
return `/${process.env.PUBLIC_URL.split('/').pop()}`;
};
const App = (props) => {
const [isLogin, setIsLogin] = useState(false)
useEffect(() => {
const user = window.sessionStorage.getItem("user")
if(user !== null){
setIsLogin(true)
}
}, [])
const changeLayoutRoute = isLogin === true ? "" : (
<LayoutRoute
exact
path="/"
layout={EmptyLayout}
component={props => (
<AuthPage {...props} setIsLogin={setIsLogin} />
)}
/>
)
return (
<BrowserRouter basename={getBasename()}>
<GAListener>
<Switch>
{changeLayoutRoute}
<MainLayout breakpoint={props.breakpoint}>
<React.Suspense fallback={<PageSpinner />}>
<AuthRoute exact authenticated={isLogin} path="/" component={DashboardPage} />
<AuthRoute exact authenticated={isLogin} path="/widgets" component={WidgetPage} />
<AuthRoute exact authenticated={isLogin} path="/tables" component={TablePage} />
<AuthRoute exact authenticated={isLogin} path="/questions" component={QuestionsPage} />
<AuthRoute exact authenticated={isLogin} path="/progress" component={ProgressPage} />
<AuthRoute exact authenticated={isLogin} path="/modals" component={ModalPage} />
<AuthRoute exact authenticated={isLogin} path="/forms" component={FormPage} />
<AuthRoute exact authenticated={isLogin} path="/question_processing" render={() => <QuestionsPage qsType="processing" />} />
<AuthRoute exact authenticated={isLogin} path="/question_completion" render={() => <QuestionsPage qsType="completion" />} />
<AuthRoute exact authenticated={isLogin} path="/report_board" render={() => <ReportPage qsType="board" />} />
<AuthRoute exact authenticated={isLogin} path="/report_comment" render={() => <ReportPage qsType="comment" />} />
</React.Suspense>
</MainLayout>
<Redirect to="/" />
</Switch>
</GAListener>
</BrowserRouter>
);
}
const query = ({ width }) => {
if (width < 575) {
return { breakpoint: 'xs' };
}
if (576 < width && width < 767) {
return { breakpoint: 'sm' };
}
if (768 < width && width < 991) {
return { breakpoint: 'md' };
}
if (992 < width && width < 1199) {
return { breakpoint: 'lg' };
}
if (width > 1200) {
return { breakpoint: 'xl' };
}
return { breakpoint: 'xs' };
};
export default componentQueries(query)(App);
| 34.730769 | 140 | 0.61794 |
12a04cb13cb96eadce1d7c4fa122722484e4e9f9 | 1,517 | js | JavaScript | src/components/switch/__definition__.js | Ruaghain/carbon | eee64ce769d4254e8739a692b6dfa3f0f4ead47f | [
"Apache-2.0"
] | null | null | null | src/components/switch/__definition__.js | Ruaghain/carbon | eee64ce769d4254e8739a692b6dfa3f0f4ead47f | [
"Apache-2.0"
] | null | null | null | src/components/switch/__definition__.js | Ruaghain/carbon | eee64ce769d4254e8739a692b6dfa3f0f4ead47f | [
"Apache-2.0"
] | null | null | null | import Switch from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('switch', Switch, {
description: `Selects more than one option.`,
designerNotes: `
* Switches provide a way to efficiently toggle between two states. They are often used on settings pages to switch on and off individual features.
* Disabled or read-only Switches might be difficult for a user to distinguish visually, so try to avoid this.
* Consider ‘smart default’ selections, based on what your user is likely to choose. But, users may well leave the defaults in place, so make sure any consequences are easy to undo, and not harmful.
`,
relatedComponentsNotes: `
* Choosing more than one option? [Try Checkbox](/components/checkbox).
* Choosing one option from a longer list? [Try Radio Button](/components/radio-button).
* Choosing one option from a very long list? [Try Dropdown](/components/dropdown).
* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
`,
type: 'form',
propValues: {
value: false
},
propTypes: {
checked: 'Boolean',
reverse: 'Boolean',
value: 'Boolean',
loading: 'Boolean'
},
propDescriptions: {
checked: 'Sets the switch as on.',
reverse: 'Flips the input and label render order',
value: 'Set the switch as on.',
loading: 'When provided will show a spinner in place of the tick or cross while in a loading state.'
}
});
definition.isAnInput();
export default definition;
| 39.921053 | 197 | 0.721819 |
12a06298a37d3d53edef3b5f8be73f404229aa1f | 1,657 | js | JavaScript | src/components/packages/item.js | muescha/npm-bookmarks | 4890195695b545d5add143c59787b8c4d6cfc54f | [
"MIT"
] | null | null | null | src/components/packages/item.js | muescha/npm-bookmarks | 4890195695b545d5add143c59787b8c4d6cfc54f | [
"MIT"
] | null | null | null | src/components/packages/item.js | muescha/npm-bookmarks | 4890195695b545d5add143c59787b8c4d6cfc54f | [
"MIT"
] | null | null | null | import React from 'react'
import PropTypes from 'prop-types'
import {
faTags,
faDownload,
// faCalendar,
faSyncAlt,
} from '@fortawesome/free-solid-svg-icons'
import {
ListItem,
ItemLink,
ItemTitle,
ItemVersion,
ItemTags,
ItemDownloads,
DownloadsNumber,
DownloadsPeriod,
ItemAnalyzed,
Icon,
} from './item.styled'
import date from '../../utils/date'
const Item = ({ node, tags, show }) => {
if (!show) return false
const metadata = node.collected.metadata
const downloads = node.collected.npm.downloads[1]
const analyzedAt = date(node.analyzedAt)
return (
<ListItem>
<ItemLink
href={metadata.links.npm}
target="_blank"
rel="noopener noreferrer"
>
<ItemTitle>
{metadata.name}
{` `}
<ItemVersion>
v{metadata.version} <em>({date(metadata.date)})</em>
</ItemVersion>
</ItemTitle>
<ItemTags>
<Icon icon={faTags} />
{tags.join(`, `)}
</ItemTags>
<ItemDownloads>
<Icon icon={faDownload} />
<DownloadsNumber>{downloads.count.toLocaleString()}</DownloadsNumber>
<DownloadsPeriod>
{/* <Icon icon={faCalendar} /> */}
{date(downloads.from)} - {date(downloads.to)}
</DownloadsPeriod>
</ItemDownloads>
<ItemAnalyzed>
<Icon icon={faSyncAlt} />
{analyzedAt}
</ItemAnalyzed>
</ItemLink>
</ListItem>
)
}
Item.propTypes = {
node: PropTypes.object.isRequired,
tags: PropTypes.array.isRequired,
show: PropTypes.bool.isRequired,
}
export default Item
| 20.974684 | 79 | 0.589016 |
12a0f5636381b7c377d63f3ed39040637b57386a | 1,031 | js | JavaScript | admin-front-end/src/lib/ui-designer/enums/ud-operator-enum.js | wbpmrck/ui-designer-admin | b32ae8c550cb6089645623f52eb5d330e0c60f7c | [
"Apache-2.0"
] | null | null | null | admin-front-end/src/lib/ui-designer/enums/ud-operator-enum.js | wbpmrck/ui-designer-admin | b32ae8c550cb6089645623f52eb5d330e0c60f7c | [
"Apache-2.0"
] | null | null | null | admin-front-end/src/lib/ui-designer/enums/ud-operator-enum.js | wbpmrck/ui-designer-admin | b32ae8c550cb6089645623f52eb5d330e0c60f7c | [
"Apache-2.0"
] | null | null | null | /*
定义枚举:操作符 类型
*/
import {regEnums,regClass,createClassObject,Types} from "../ud-runtime"
/**
* 比较 操作符
*/
let UDCompareOperatorEnum=regEnums('UDCompareOperatorEnum',(iota)=>{
return {
GT:1, // 大于
GTE:2, // 大于等于
LE:3, // 小于
LTE:4, // 小于等于
E:5, // 等于
NE:6, // 不等于
}
});
/**
* 算数 操作符
*/
let UDArithmeticOperatorEnum=regEnums('UDArithmeticOperatorEnum',(iota)=>{
return {
ADD:1, // 加法
SUB:2, // 减法
MUL:3, // 乘法
DIV:4, // 除法
}
});
/**
* 逻辑 操作符
*/
let UDLogicOperatorEnum=regEnums('UDLogicOperatorEnum',(iota)=>{
return {
AND:1, // 与
OR:2, // 或
}
});
/**
* 关系 操作符
*/
let UDRelationOperatorEnum=regEnums('UDRelationOperatorEnum',(iota)=>{
return {
CONTAIN:1, // 包含
NOT_CONTAIN:2, // 不包含
}
});
export {
UDCompareOperatorEnum,
UDArithmeticOperatorEnum,
UDLogicOperatorEnum,
UDRelationOperatorEnum,
}
| 17.183333 | 74 | 0.512124 |
12a100a4a5177cf783e1be9d3bebdbb979eeeeaa | 201 | js | JavaScript | node_modules/@ava/babel-preset-stage-4/index.js | miladtelebot/te | f9277ae5d58739cfa5a027ed887f81709edfda97 | [
"MIT"
] | null | null | null | node_modules/@ava/babel-preset-stage-4/index.js | miladtelebot/te | f9277ae5d58739cfa5a027ed887f81709edfda97 | [
"MIT"
] | null | null | null | node_modules/@ava/babel-preset-stage-4/index.js | miladtelebot/te | f9277ae5d58739cfa5a027ed887f81709edfda97 | [
"MIT"
] | null | null | null | 'use strict';
/* eslint-disable import/no-dynamic-require */
module.exports = () => {
const plugins = require(`./plugins/best-match`)
.map(module => require(module));
return {plugins};
};
| 22.333333 | 49 | 0.631841 |
12a17e566dfb20f36415b229e180f156c7f98345 | 16,673 | js | JavaScript | tests/components/cursor.test.js | mikebolt/aframe | 26b8a0e5e1a4b6ec1007af1abc0768be28c7040c | [
"MIT"
] | 2 | 2017-02-08T03:07:32.000Z | 2018-11-21T16:01:16.000Z | tests/components/cursor.test.js | mikebolt/aframe | 26b8a0e5e1a4b6ec1007af1abc0768be28c7040c | [
"MIT"
] | null | null | null | tests/components/cursor.test.js | mikebolt/aframe | 26b8a0e5e1a4b6ec1007af1abc0768be28c7040c | [
"MIT"
] | 4 | 2016-05-11T07:23:05.000Z | 2020-04-18T17:57:51.000Z | /* global assert, process, setup, suite, test, CustomEvent */
var entityFactory = require('../helpers').entityFactory;
var once = require('../helpers').once;
suite('cursor', function () {
var cameraEl;
var component;
var el;
var intersection;
var intersectedEl;
var prevIntersection;
var prevIntersectedEl;
setup(function (done) {
cameraEl = entityFactory();
el = document.createElement('a-entity');
intersection = {distance: 10.5};
intersectedEl = document.createElement('a-entity');
prevIntersection = {distance: 12.5};
prevIntersectedEl = document.createElement('a-entity');
cameraEl.setAttribute('camera', 'active: true');
el.setAttribute('cursor', '');
// Wait for elements to load.
el.addEventListener('componentinitialized', function (evt) {
if (evt.detail.name !== 'cursor') { return; }
component = el.components.cursor;
done();
});
cameraEl.appendChild(el);
});
suite('init', function () {
test('initializes raycaster as a dependency', function () {
assert.ok(el.components.raycaster);
});
});
suite('remove', function () {
test('removes hover state', function (done) {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.ok(el.is('cursor-hovering'));
assert.ok(intersectedEl.is('cursor-hovered'));
el.removeAttribute('cursor');
process.nextTick(function () {
assert.notOk(el.is('cursor-hovering'));
assert.notOk(intersectedEl.is('cursor-hovered'));
done();
});
});
test('removes fuse state', function (done) {
el.setAttribute('cursor', {fuse: true});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.ok(el.is('cursor-fusing'));
el.removeAttribute('cursor');
process.nextTick(function () {
assert.notOk(el.is('cursor-fusing'));
done();
});
});
test('removes intersection listener', function (done) {
el.removeAttribute('cursor');
process.nextTick(function () {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.notOk(el.is('cursor-hovering'));
done();
});
});
suite('update', function () {
test('update mousemove event listeners when rayOrigin is the mouse', function () {
var updateSpy = this.sinon.spy(el.components.cursor, 'update');
var updateMouseEventListenersSpy = this.sinon.spy(el.components.cursor, 'updateMouseEventListeners');
el.setAttribute('cursor', 'rayOrigin', 'mouse');
assert.ok(updateSpy.called);
assert.ok(updateMouseEventListenersSpy.called);
});
});
});
suite('onCursorDown', function () {
test('emits mousedown event on el', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
once(el, 'mousedown', function () {
done();
});
component.onCursorDown({});
});
test('emits mousedown event on intersectedEl', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
once(intersectedEl, 'mousedown', function () {
done();
});
component.onCursorDown({});
});
test('sets cursorDownEl', function () {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
assert.notOk(component.cursorDownEl);
component.onCursorDown({});
assert.equal(component.cursorDownEl, intersectedEl);
});
});
suite('onCursorUp', function () {
test('emits mouseup event on el', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
once(el, 'mouseup', function () {
done();
});
component.onCursorUp();
});
test('emits mouseup event on intersectedEl', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
component.mouseDownEl = document.createElement('a-entity');
once(intersectedEl, 'mouseup', function () {
done();
});
component.onCursorUp();
});
test('emits click event on el', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
component.cursorDownEl = intersectedEl;
once(el, 'click', function () {
done();
});
component.onCursorUp();
});
test('emits click event on intersectedEl', function (done) {
component.intersection = intersection;
component.intersectedEl = intersectedEl;
component.cursorDownEl = intersectedEl;
once(intersectedEl, 'click', function () {
done();
});
component.onCursorUp();
});
});
suite('onIntersection', function () {
test('does not do anything if already intersecting', function () {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [el]
});
assert.notOk(intersectedEl.is('cursor-hovered'));
});
test('does not do anything if only the cursor is intersecting', function () {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [el]
});
assert.notOk(el.is('cursor-hovered'));
});
test('sets cursor-hovered state on intersectedEl', function () {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.ok(intersectedEl.is('cursor-hovered'));
});
test('emits mouseenter event on el', function (done) {
once(el, 'mouseenter', function (evt) {
assert.equal(evt.detail.intersectedEl, intersectedEl);
done();
});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
});
test('emits mouseenter event on intersectedEl', function (done) {
once(intersectedEl, 'mouseenter', function (evt) {
assert.equal(evt.detail.cursorEl, el);
done();
});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
});
test('emits mousenter event on intersectedEl, ignoring el intersection', function (done) {
once(intersectedEl, 'mouseenter', function (evt) {
assert.equal(evt.detail.cursorEl, el);
done();
});
el.emit('raycaster-intersection', {
intersections: [intersection, intersection],
els: [el, intersectedEl]
});
});
test('updates intersected entity when nearer intersection occurs', function (done, fail) {
var intersection1 = {distance: 10.5};
var intersection2 = {distance: 9.0};
var intersection3 = {distance: 12.0};
var nearerIntersectedEl = document.createElement('a-entity');
var furtherIntersectedEl = document.createElement('a-entity');
this.sinon.stub(el.components.raycaster, 'getIntersection', function (el) {
switch (el) {
case intersectedEl: return intersection1;
case nearerIntersectedEl: return intersection2;
case furtherIntersectedEl: return intersection3;
}
});
intersectedEl.addEventListener('mouseenter', function onMouseenter (evt) {
assert.shallowDeepEqual(evt.detail.intersection, intersection1);
intersectedEl.removeEventListener('mouseenter', onMouseenter);
intersectedEl.addEventListener('mouseenter', fail);
el.addEventListener('mouseenter', fail);
el.emit('raycaster-intersection', {
intersections: [intersection2],
els: [nearerIntersectedEl]
});
el.emit('raycaster-intersection', {
intersections: [intersection3],
els: [furtherIntersectedEl]
});
process.nextTick(function () {
assert.equal(el.components.cursor.intersectedEl, nearerIntersectedEl);
done();
});
});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.ok(el.is('cursor-hovering'));
});
test('emits a mouseleave event on the prevIntersectedEl', function (done) {
once(prevIntersectedEl, 'mouseleave', function (evt) {
done();
});
this.sinon.stub(el.components.raycaster, 'getIntersection', function (el) {
return el === intersectedEl ? intersection : prevIntersection;
});
el.emit('raycaster-intersection', {
intersections: [prevIntersection],
els: [prevIntersectedEl]
});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
});
test('does not set cursor-fusing state on cursor if not fuse', function () {
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.notOk(el.is('cursor-fusing'));
});
test('sets cursor-fusing state on cursor if fuse', function () {
el.setAttribute('cursor', 'fuse', true);
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
assert.ok(el.is('cursor-fusing'));
});
test('removes fuse state and emits event on fuse click', function (done) {
el.setAttribute('cursor', {fuse: true, fuseTimeout: 1});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
once(el, 'click', function () {
assert.notOk(el.is('cursor-fusing'));
done();
});
});
test('emits event on intersectedEl on fuse click', function (done) {
el.setAttribute('cursor', {fuse: true, fuseTimeout: 1});
el.emit('raycaster-intersection', {
intersections: [intersection],
els: [intersectedEl]
});
once(intersectedEl, 'click', function () {
done();
});
});
});
suite('onIntersectionCleared', function () {
test('does not do anything if not intersecting', function () {
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
});
test('does not do anything if only the cursor is intersecting', function () {
component.intersectedEl = intersectedEl;
el.emit('raycaster-intersection-cleared', {clearedEls: [el]});
assert.ok(component.intersectedEl);
});
test('unsets intersectedEl', function () {
component.intersectedEl = intersectedEl;
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
assert.notOk(component.intersectedEl);
});
test('removes cursor-hovered state on intersectedEl', function () {
component.intersectedEl = intersectedEl;
intersectedEl.addState('cursor-hovered');
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
assert.notOk(intersectedEl.is('cursor-hovered'));
});
test('emits mouseleave event on el', function (done) {
component.intersectedEl = intersectedEl;
once(el, 'mouseleave', function (evt) {
assert.equal(evt.detail.intersectedEl, intersectedEl);
done();
});
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
});
test('emits mouseleave event on intersectedEl', function (done) {
component.intersectedEl = intersectedEl;
once(intersectedEl, 'mouseleave', function (evt) {
assert.equal(evt.detail.cursorEl, el);
done();
});
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
});
test('removes cursor-hovering and cursor-fusing states on cursor', function () {
component.intersectedEl = intersectedEl;
el.addState('cursor-fusing');
el.addState('cursor-hovering');
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
assert.notOk(el.is('cursor-fusing'));
assert.notOk(el.is('cursor-hovering'));
});
test('sets another intersected element if any', function () {
var dummyEl = document.createElement('a-entity');
var dummyIntersection = {object: {el: dummyEl}};
component.intersectedEl = intersectedEl;
el.addState('cursor-fusing');
el.addState('cursor-hovering');
el.components.raycaster.intersections = [dummyIntersection];
el.emit('raycaster-intersection-cleared', {clearedEls: [intersectedEl]});
assert.notOk(el.is('cursor-fusing'));
assert.ok(el.is('cursor-hovering'));
assert.equal(dummyEl, el.components.cursor.intersectedEl);
});
});
suite('onMouseMove', function () {
test('update raycaster based on mouse coordinates', function (done) {
var event = new CustomEvent('mousemove');
event.clientX = 5;
event.clientY = 5;
el.setAttribute('cursor', 'rayOrigin', 'mouse');
el.sceneEl.canvas.dispatchEvent(event);
process.nextTick(function () {
var raycaster = el.getAttribute('raycaster');
assert.notEqual(raycaster.direction.x, 0);
done();
});
});
test('update raycaster based on touch coordinates', function (done) {
var event = new CustomEvent('touchstart');
event.touches = {item: function () { return {clientX: 5, clientY: 5}; }};
el.setAttribute('cursor', 'rayOrigin', 'mouse');
el.sceneEl.canvas.dispatchEvent(event);
process.nextTick(function () {
var raycaster = el.getAttribute('raycaster');
assert.notEqual(raycaster.direction.x, 0);
done();
});
});
test('casts ray at current touch location', function (done) {
var event = new CustomEvent('touchstart');
var target = el.sceneEl.appendChild(document.createElement('a-entity'));
var mouseDownSpy = this.sinon.spy();
el.addEventListener('mousedown', mouseDownSpy);
el.setAttribute('cursor', 'rayOrigin', 'mouse');
target.setAttribute('geometry', '');
target.setAttribute('position', '0 0 -5');
target.addEventListener('loaded', function () {
target.object3D.updateMatrixWorld();
el.components.raycaster.refreshObjects();
el.components.raycaster.tick();
assert.strictEqual(component.intersectedEl, target);
event.touches = {item: function () { return {clientX: 5, clientY: 5}; }};
el.sceneEl.canvas.dispatchEvent(event);
assert.isFalse(mouseDownSpy.calledWithMatch({detail: {intersectedEl: target}}));
done();
});
});
});
suite('canvas events', function () {
test('cursor responds to mouse events on canvas', function () {
// Cannot spy on onCursorDown/Up directly due to binding.
var cursorEmitSpy = this.sinon.spy(component, 'twoWayEmit');
var downEvt = new CustomEvent('mousedown');
var upEvt = new CustomEvent('mouseup');
assert.isFalse(cursorEmitSpy.calledWith('mousedown'));
el.sceneEl.canvas.dispatchEvent(downEvt);
assert.isTrue(cursorEmitSpy.calledWith('mousedown'));
assert.isFalse(cursorEmitSpy.calledWith('mouseup'));
el.sceneEl.canvas.dispatchEvent(upEvt);
assert.isTrue(cursorEmitSpy.calledWith('mouseup'));
});
test('cursor responds to touch events on canvas', function () {
// Cannot spy on onCursorDown/Up directly due to binding.
var cursorEmitSpy = this.sinon.spy(component, 'twoWayEmit');
var downEvt = new CustomEvent('touchstart');
downEvt.touches = [];
var upEvt = new CustomEvent('touchend');
upEvt.touches = [];
assert.isFalse(cursorEmitSpy.calledWith('mousedown'));
el.sceneEl.canvas.dispatchEvent(downEvt);
assert.isTrue(cursorEmitSpy.calledWith('mousedown'));
assert.isFalse(cursorEmitSpy.calledWith('mouseup'));
el.sceneEl.canvas.dispatchEvent(upEvt);
assert.isTrue(cursorEmitSpy.calledWith('mouseup'));
});
});
});
suite('cursor + raycaster', function () {
test('can use HTML-configured raycaster', function (done) {
var parentEl = entityFactory();
parentEl.addEventListener('child-attached', function (evt) {
var el = evt.detail.el;
el.addEventListener('loaded', function () {
assert.equal(el.components.raycaster.data.objects, '.clickable');
done();
});
});
parentEl.innerHTML = '<a-entity cursor raycaster="objects: .clickable"></a-entity>';
});
});
| 34.953878 | 109 | 0.628741 |
12a1c3941c5bca83aa1136be3dea975c2de97503 | 889 | js | JavaScript | web/js/site.js | CyanoFresh/SmartHomePHP | 856a89388e28603597e2218c6d096cb58eb680e3 | [
"BSD-3-Clause"
] | 2 | 2020-05-23T11:07:21.000Z | 2021-03-12T02:07:21.000Z | web/js/site.js | CyanoFresh/SmartHomePHP | 856a89388e28603597e2218c6d096cb58eb680e3 | [
"BSD-3-Clause"
] | 64 | 2016-08-12T15:00:02.000Z | 2017-08-18T22:14:26.000Z | web/js/site.js | CyanoFresh/SmartHomePHP | 856a89388e28603597e2218c6d096cb58eb680e3 | [
"BSD-3-Clause"
] | null | null | null | function showErrorMessage(message) {
return $.snackbar({
content: message,
timeout: 5000
});
}
function showSuccessMessage(message) {
return $.snackbar({
content: message,
timeout: 5000
});
}
$('.navbar-toggle-drawer').click(function (e) {
e.preventDefault();
$('body').toggleClass('drawer-open');
return false;
});
$('.ajax-call').click(function (e) {
e.preventDefault();
$.post($(this).attr('href'), function (data) {
if (data.success) {
showSuccessMessage('Успешно обновлено');
} else {
showErrorMessage('Не удалось обновить');
}
}).fail(function () {
showErrorMessage('Не удалось обновить');
});
});
$('.show-on-click').click(function (e) {
e.preventDefault();
$(this).text($(this).data('text')).addClass('open');
return false;
});
| 20.204545 | 56 | 0.564679 |
12a30205e6722e9a29cb170f38e5cdcf35c71e04 | 68 | js | JavaScript | assets/js/config.js | JMazick/Netflix-Analytics | b91b816d6a6e66a937621f9acc157a55cf3bf53a | [
"MIT"
] | null | null | null | assets/js/config.js | JMazick/Netflix-Analytics | b91b816d6a6e66a937621f9acc157a55cf3bf53a | [
"MIT"
] | null | null | null | assets/js/config.js | JMazick/Netflix-Analytics | b91b816d6a6e66a937621f9acc157a55cf3bf53a | [
"MIT"
] | null | null | null | // API key
var API_KEY = "AIzaSyARFxkL8XcBYKpRmRepTBO9D27v1Yl7nnE";
| 22.666667 | 56 | 0.808824 |
12a30e45824c2d3e21a4990530882f7721491dc3 | 22,125 | js | JavaScript | contact_edgeActions.js | MichaelMeow/dreamdreamdream | b5e61a90426a869e94507611b90d8fb8f646bc3a | [
"MIT"
] | null | null | null | contact_edgeActions.js | MichaelMeow/dreamdreamdream | b5e61a90426a869e94507611b90d8fb8f646bc3a | [
"MIT"
] | null | null | null | contact_edgeActions.js | MichaelMeow/dreamdreamdream | b5e61a90426a869e94507611b90d8fb8f646bc3a | [
"MIT"
] | null | null | null | /***********************
* Adobe Edge Animate Composition Actions
*
* Edit this file with caution, being careful to preserve
* function signatures and comments starting with 'Edge' to maintain the
* ability to interact with these actions from within Adobe Edge Animate
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
//Edge symbol: 'stage'
(function(symbolName) {
Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "play", function(sym, e) {
// insert code to be run at timeline play here
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_back}", "click", function(sym, e) {
// play the timeline from the given position (ms or label)
// Navigate to a new URL in the current window
// (replace "_self" with appropriate target attribute for a new window)
window.open("index.html", "_self");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
sym.stop();
});
//Edge binding end
})("stage");
//Edge symbol end:'stage'
//=========================================================
//Edge symbol: 'work'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 18496, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("work");
//Edge symbol end:'work'
//=========================================================
//Edge symbol: 'Camp'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 44737, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("Camp");
//Edge symbol end:'Camp'
//=========================================================
//Edge symbol: 'Theater'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 31682, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("Theater");
//Edge symbol end:'Theater'
//=========================================================
//Edge symbol: 'Clouds'
(function(symbolName) {
})("Clouds");
//Edge symbol end:'Clouds'
//=========================================================
//Edge symbol: 'nest'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 33496, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("nest");
//Edge symbol end:'nest'
//=========================================================
//Edge symbol: 'birds'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 3291, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("birds");
//Edge symbol end:'birds'
//=========================================================
//Edge symbol: 'shark'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 8128, function(sym, e) {
sym.play("loop");
});
//Edge binding end
})("shark");
//Edge symbol end:'shark'
//=========================================================
//Edge symbol: 'theater'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 23496, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("theater");
//Edge symbol end:'theater'
//=========================================================
//Edge symbol: 'book'
(function(symbolName) {
})("book");
//Edge symbol end:'book'
//=========================================================
//Edge symbol: 'campdeck'
(function(symbolName) {
})("campdeck");
//Edge symbol end:'campdeck'
//=========================================================
//Edge symbol: 'camppizza'
(function(symbolName) {
})("camppizza");
//Edge symbol end:'camppizza'
//=========================================================
//Edge symbol: 'theaterseats'
(function(symbolName) {
})("theaterseats");
//Edge symbol end:'theaterseats'
//=========================================================
//Edge symbol: 'workinside'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1502, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 588, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2331, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle3}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("workover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle3}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("workout");
});
//Edge binding end
})("workinside");
//Edge symbol end:'workinside'
//=========================================================
//Edge symbol: 'worksign'
(function(symbolName) {
})("worksign");
//Edge symbol end:'worksign'
//=========================================================
//Edge symbol: 'theaterinside'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "${_theater2}", "mouseover", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("theaterover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_theater2}", "mouseout", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("theaterout");
});
//Edge binding end
})("theaterinside");
//Edge symbol end:'theaterinside'
//=========================================================
//Edge symbol: 'sheet'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1410, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 854, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2246, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_theatersign2}", "mouseover", function(sym, e) {
// play the timeline from the given position (ms or label)
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle2}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("theaterover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle2}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("theaterout");
});
//Edge binding end
})("sheet");
//Edge symbol end:'sheet'
//=========================================================
//Edge symbol: 'campinside'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2557, function(sym, e) {
sym.stop();
// play the timeline from the given position (ms or label)
sym.play("camprainbow");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 845, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2948, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle4}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("campover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle4}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("campout");
});
//Edge binding end
})("campinside");
//Edge symbol end:'campinside'
//=========================================================
//Edge symbol: 'nestinside'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 890, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2733, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 3677, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle5}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("nestover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle5}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("nestout");
});
//Edge binding end
})("nestinside");
//Edge symbol end:'nestinside'
//=========================================================
//Edge symbol: 'store'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "${_store}", "click", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("store");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 895, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1832, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2879, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle6}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("storeover");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle6}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("storeout");
});
//Edge binding end
})("store");
//Edge symbol end:'store'
//=========================================================
//Edge symbol: 'sagansign'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 964, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2201, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2896, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle8}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle8}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
})("sagansign");
//Edge symbol end:'sagansign'
//=========================================================
//Edge symbol: 'picklereveal'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "${_Rectangle9}", "click", function(sym, e) {
// Navigate to a new URL in the current window
// (replace "_self" with appropriate target attribute for a new window)
window.open("http://www.kickstarter.com", "_self");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1938, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2375, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 883, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle9}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle9}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
})("picklereveal");
//Edge symbol end:'picklereveal'
//=========================================================
//Edge symbol: 'mushies'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 809, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1638, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 3617, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
})("mushies");
//Edge symbol end:'mushies'
//=========================================================
//Edge symbol: 'jets'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1204, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("jets");
//Edge symbol end:'jets'
//=========================================================
//Edge symbol: 'Symbol_1'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 10000, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("Symbol_1");
//Edge symbol end:'Symbol_1'
//=========================================================
//Edge symbol: 'austin'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 752, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1737, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2811, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
})("austin");
//Edge symbol end:'austin'
//=========================================================
//Edge symbol: 'jesse'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 752, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1737, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2811, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse2}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse2}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
})("jesse");
//Edge symbol end:'jesse'
//=========================================================
//Edge symbol: 'kinzi'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 752, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1737, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse3}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse3}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2758, function(sym, e) {
sym.stop();
});
//Edge binding end
})("kinzi");
//Edge symbol end:'kinzi'
//=========================================================
//Edge symbol: 'Michael'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 752, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1737, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse4}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse4}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2596, function(sym, e) {
sym.stop();
});
//Edge binding end
})("Michael");
//Edge symbol end:'Michael'
//=========================================================
//Edge symbol: 'Wes'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 752, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 14000, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 14859, function(sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse5}", "mouseenter", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("over");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Ellipse5}", "mouseleave", function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("out");
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 11596, function(sym, e) {
// play the timeline from the given position (ms or label)
sym.play("loop");
});
//Edge binding end
})("Wes");
//Edge symbol end:'Wes'
})(jQuery, AdobeEdge, "EDGE-1529726274");
| 24.528825 | 102 | 0.546893 |
12a383f84364801988ac11230932a7d8806c9fa2 | 132 | js | JavaScript | extras/apidoc/html/search/functions_2.js | pu2clr/PCF8574 | 96521a167c13572789b7872b70a43c107a4cacf9 | [
"MIT"
] | 2 | 2021-10-15T16:38:50.000Z | 2022-02-25T17:54:20.000Z | extras/apidoc/html/search/functions_2.js | pu2clr/PCF8574 | 96521a167c13572789b7872b70a43c107a4cacf9 | [
"MIT"
] | null | null | null | extras/apidoc/html/search/functions_2.js | pu2clr/PCF8574 | 96521a167c13572789b7872b70a43c107a4cacf9 | [
"MIT"
] | 1 | 2021-09-27T12:22:06.000Z | 2021-09-27T12:22:06.000Z | var searchData=
[
['lookfordevice_34',['lookForDevice',['../group__group01.html#gabb38aa941e8b607557fa8f3f98bf9fc5',1,'PCF']]]
];
| 26.4 | 110 | 0.742424 |
12a3d55906cb6fa8551af831bb4be7df0726d65c | 3,479 | js | JavaScript | dom-utils.test.js | ultraq/dom-utils | 23e1f801cce9ff2e67d5c3bbf7c9ebfbb012fe53 | [
"Apache-2.0"
] | null | null | null | dom-utils.test.js | ultraq/dom-utils | 23e1f801cce9ff2e67d5c3bbf7c9ebfbb012fe53 | [
"Apache-2.0"
] | null | null | null | dom-utils.test.js | ultraq/dom-utils | 23e1f801cce9ff2e67d5c3bbf7c9ebfbb012fe53 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2020, Emanuel Rabina (http://www.ultraq.net.nz/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-env jest */
import {
addEventDelegate,
clearChildren,
parseJsonFromElement,
serialize
} from './dom-utils.js';
import {$} from 'dumb-query-selector';
import {JSDOM} from 'jsdom';
/**
* Tests for the DOM utilities.
*/
describe('dom-utils', function() {
describe('#addEventDelegate', function() {
test('Calls the configured handler when the selector matches', function() {
let doc = new JSDOM(`
<!DOCTYPE html>
<div id="wrapper">
<button id="target">Click me!</button>
</div>
`).window.document;
let handler = jest.fn();
addEventDelegate(doc.querySelector('#wrapper'), 'click', '#target', handler);
doc.querySelector('#target').click();
expect(handler).toHaveBeenCalled();
});
test('Does nothing if the event happens outside of the selector', function() {
let doc = new JSDOM(`
<!DOCTYPE html>
<div id="wrapper">
<button id="target">Click me!</button>
<button id="other">I do nothing!</button>
</div>
`).window.document;
let handler = jest.fn();
addEventDelegate(doc.querySelector('#wrapper'), 'click', '#target', handler);
doc.querySelector('#other').click();
expect(handler).not.toHaveBeenCalled();
});
});
describe('#clearChildren', function() {
test('Removes all of the child elements', function() {
let doc = new JSDOM(`
<!DOCTYPE html>
<div id="parent">
<p>Child 1</p>
<p>Child 2</p>
</div>
`).window.document;
let parent = doc.querySelector('#parent');
clearChildren(parent);
expect(parent.childElementCount).toBe(0);
});
});
describe('#parseJsonFromElement', function() {
test('JSON data loaded', function() {
let testData = {
message: 'Hello!'
};
let doc = new JSDOM(`<!DOCTYPE html><div id="test-data">${JSON.stringify(testData)}</div>`).window.document;
let result = parseJsonFromElement('#test-data', doc);
expect(result).toEqual(testData);
});
test('null returned when element not present', function() {
let result = parseJsonFromElement('#test-data');
expect(result).toBe(null);
});
test('null returned when element contains no content', function() {
let doc = new JSDOM(`<!DOCTYPE html><div id="test-data"></div>`).window.document;
let result = parseJsonFromElement('#test-data', doc);
expect(result).toBe(null);
});
});
describe('#serialize', function() {
const htmlString = '<!DOCTYPE html><html><head></head><body><p>Hi!</p></body></html>';
test('Full document', function() {
let doc = new JSDOM(htmlString).window.document;
let result = serialize(doc);
expect(result).toBe(htmlString);
});
test('Partial document', function() {
let doc = new JSDOM(htmlString).window.document;
let fragment = $('p', doc);
let result = serialize(fragment);
expect(result).toBe('<p>Hi!</p>');
});
});
});
| 28.991667 | 111 | 0.655361 |
12a4bdc825ed9122e259cced2730808b3e3bffc9 | 1,007 | js | JavaScript | lib/cnpm_config.js | fossabot/npminstall | 18aa63cc19531d9e34b1d6f0ac963442f2da837f | [
"MIT"
] | 427 | 2016-02-01T16:47:35.000Z | 2022-03-29T07:30:33.000Z | lib/cnpm_config.js | fossabot/npminstall | 18aa63cc19531d9e34b1d6f0ac963442f2da837f | [
"MIT"
] | 365 | 2016-02-01T16:11:38.000Z | 2022-03-30T11:52:43.000Z | lib/cnpm_config.js | fossabot/npminstall | 18aa63cc19531d9e34b1d6f0ac963442f2da837f | [
"MIT"
] | 78 | 2016-02-28T17:00:55.000Z | 2022-03-18T02:12:49.000Z | 'use strict';
const path = require('path');
const fs = require('fs');
const os = require('os');
const config = {};
function createConfigs() {
let root;
if (process.platform === 'win32') {
root = process.env.USERPROFILE || process.env.APPDATA || process.env.TMP || process.env.TEMP;
} else {
root = process.env.HOME || process.env.TMPDIR || '/tmp';
}
const userConfig = path.join(root, '.cnpmrc');
if (!fs.existsSync(userConfig)) return;
const userConfigContent = fs.readFileSync(userConfig).toString();
const configs = typeof userConfigContent === 'string' && userConfigContent.split(os.EOL);
configs.reduce((pre, next) => {
if (typeof next === 'string') {
const map = next.split('=');
const key = map[0];
let value = map[1];
if (value === 'true') value = true;
if (value === 'false') value = false;
pre[key] = value;
}
return pre;
}, config);
}
createConfigs();
module.exports = {
get(key) {
return config[key];
},
};
| 25.820513 | 97 | 0.606753 |
12a53f0651801c8614458633bd64f00e37442b33 | 179 | js | JavaScript | .eslintrc.js | vigneshshanmugam/apm-agent-js-core | 647cf7288411e8c8e3d62de1ff8ac654aca160d8 | [
"MIT"
] | null | null | null | .eslintrc.js | vigneshshanmugam/apm-agent-js-core | 647cf7288411e8c8e3d62de1ff8ac654aca160d8 | [
"MIT"
] | null | null | null | .eslintrc.js | vigneshshanmugam/apm-agent-js-core | 647cf7288411e8c8e3d62de1ff8ac654aca160d8 | [
"MIT"
] | null | null | null | module.exports = {
env: {
es6: true
},
rules: {
'max-len': ['error', { code: 100 }],
'no-unused-vars': 'error',
'space-before-function-paren': 'error'
}
}
| 16.272727 | 42 | 0.513966 |
12a546983e6e470a62f34cad30f4c44c4562dd1c | 756 | js | JavaScript | web/test/funcunit/features/monitor_delete.js | smontanari/jashboard | 23a1c53f313b81f258e0ddcf0bcd59fc4b207e97 | [
"MIT"
] | 2 | 2015-06-24T00:58:00.000Z | 2015-12-28T03:08:07.000Z | web/test/funcunit/features/monitor_delete.js | smontanari/jashboard | 23a1c53f313b81f258e0ddcf0bcd59fc4b207e97 | [
"MIT"
] | null | null | null | web/test/funcunit/features/monitor_delete.js | smontanari/jashboard | 23a1c53f313b81f258e0ddcf0bcd59fc4b207e97 | [
"MIT"
] | null | null | null | funcunitHelper.testFeature("Delete a monitor", "monitor_actions", function() {
this.createTest("it deletes the monitor", function() {
F("#tab-dashboard_2").visible().click();
jashboardFeatureHelper.triggerMonitorAction("#monitor_2", "delete");
jashboardFeatureHelper.confirmAlert();
F("#monitor_2").size(0, "monitor_2 does not exist");
F("#monitor_3").size(1, "monitor_3 still exists");
});
this.createTest("it does not delete the monitor", function() {
F("#tab-dashboard_2").visible().click();
jashboardFeatureHelper.triggerMonitorAction("#monitor_2", "delete");
jashboardFeatureHelper.cancelAlert();
F("#monitor_2").visible("is still displayed");
F("#monitor_3").visible("is still displayed");
});
});
| 36 | 78 | 0.690476 |
12a5523059610a06125047289025aace7560e366 | 5,572 | js | JavaScript | demo/js/tables.js | JoeFu/studata.tk | 11a4f2e1a6fdc142e864d24d9a5c6f7af26fea9b | [
"MIT"
] | null | null | null | demo/js/tables.js | JoeFu/studata.tk | 11a4f2e1a6fdc142e864d24d9a5c6f7af26fea9b | [
"MIT"
] | null | null | null | demo/js/tables.js | JoeFu/studata.tk | 11a4f2e1a6fdc142e864d24d9a5c6f7af26fea9b | [
"MIT"
] | null | null | null | $('#activitynumber').load('../backend/APIs.php?option=LoadActivityNumber');
$('#studentsnumber').load('../backend/APIs.php?option=LoadStudentsNumber');
$('#coursesnumber').load('../backend/APIs.php?option=LoadCoursesNumber');
//Ajax Loading Assignment
$(document).ready(function () {
$.ajax({
type: "get",
async: true,
url: "../backend/APIs.php?option=LoadCourse",
dataType: "json",
success: function (result) {
var CourseName = [];
$.each(result, function (i, j) {
CourseName[i] = j['CourseName'];
$("#SelectCourse").append(
" <option id='" + CourseName[i] + "'>" + CourseName[i] + "</option>"
);
});
}
});
$("#SelectCourse").change(function () {
$("#SelectYear option").remove();
$("#SelectSemester option").remove();
$("#SelectAssignment option").remove();
$("#SelectYear").append(
" <option id='PleaseSelectYear'>Select Year</option>");
$("#SelectSemester").append(
" <option id='PleaseSelectSemester'>Select Semester</option>");
$("#SelectAssignment").append(
" <option id='PleaseSelectAssignment'>Select Assignment</option>");
var SelectCourseId = $("#SelectCourse option:selected").attr("id");
$.ajax({
type: "get",
async: true,
url: "../backend/APIs.php?option=LoadYear",
dataType: "json",
data: { "SelectCourseId": SelectCourseId },
success: function (result) {
var SchoolYear = [];
$.each(result, function (i, j) {
SchoolYear[i] = j['SchoolYear'];
$("#SelectYear").append(
" <option id='" + SchoolYear[i] + "'>" + SchoolYear[i] + "</option>"
);
});
}
});
});
$("#SelectYear").change(function () {
$("#SelectSemester option").remove();
$("#SelectAssignment option").remove();
$("#SelectSemester").append(
" <option id='PleaseSelectSemester'>Select Semester</option>");
$("#SelectAssignment").append(
" <option id='PleaseSelectSemester'>Select Assignment</option>");
var SelectCourseId = $("#SelectCourse option:selected").attr("id");
var SelectYearId = $("#SelectYear option:selected").attr("id");
$.ajax({
type: "get",
async: true,
url: "../backend/APIs.php?option=LoadSemester",
dataType: "json",
data: { "SelectCourseId": SelectCourseId, "SelectYearId": SelectYearId },
success: function (result) {
var Semester = [];
$.each(result, function (i, j) {
Semester[i] = j['Semester'];
$("#SelectSemester").append(" <option id='" + Semester[i] + "'>"
+ Semester[i] + "</option>");
});
}
});
});
$("#SelectSemester").change(function() {
$("#SelectAssignment option").remove();
$("#SelectAssignment").append("<option id='PleaseSelectSemester'>Select Assignment</option>");
var SelectCourseId=$("#SelectCourse option:selected").attr("id");
var SelectYearId=$("#SelectYear option:selected").attr("id");
var SelectSemesterId=$("#SelectSemester option:selected").attr("id");
$.ajax({
type: "get",
async: true,
url: "../backend/APIs.php?option=LoadAssignment",
dataType: "json",
data: {"SelectCourseId":SelectCourseId,"SelectYearId":SelectYearId,"SelectSemesterId":SelectSemesterId},
success: function(result) {
var AssignmentName = [];
$.each(result,function(i,j){
AssignmentName[i]=j['AssignmentName'];
$("#SelectAssignment").append(" <option id='" + AssignmentName[i] + "'>"+ AssignmentName[i] + "</option>");
});
}
});
});
})
$(document).ready(function(){
$("#table_search").click(function(){
loadData();
})
})
function loadData()
{
var SelectCourseId=$("#SelectCourse option:selected").attr("id");
var SelectYearId=$("#SelectYear option:selected").attr("id");
var SelectSemesterId=$("#SelectSemester option:selected").attr("id");
var SelectAssignmentId=$("#SelectAssignment option:selected").attr("id");
// console.log(SelectCourse);
$.ajax({
type: "get",
async: true,
url: "../backend/APIs.php?option=SearchTable",
dataType: "json",
data: {"SelectCourseId":SelectCourseId,"SelectYearId":SelectYearId,"SelectSemesterId":SelectSemesterId,"SelectAssignmentId":SelectAssignmentId},
success: function(result)
{
// console.log("Sucess");
loadTable(result);
}
});
}
function loadTable(data)
{
$('#TableResult').DataTable({
destroy: true,
data: data,
columns: [
{ title: "Stu_Name", data: "FKUserId" },
{ title: "Course", data: "CourseName" },
{ title: "Year", data: "SchoolYear" },
{ title: "Semster", data: "Semester"},
{ title: "Assignmnet", data: "AssignmentName" },
{ title: "Event Name", data: "Event Name" },
{ title: "Grade", data: "Grade" },
{ title: "Component", data: "Component" },
],
// dom: 'Bfrtip',
// buttons: [
// 'copy', 'csv', 'excel', 'pdf', 'print'
// ]
});
}
| 38.694444 | 152 | 0.531587 |
12a578fc313a7225fbfe47396a7e2739303b02c4 | 3,115 | js | JavaScript | lib/hd/common.js | Biscoint/bcoin | 900de1c98fcde564f37ad14f744871196d88f472 | [
"MIT"
] | null | null | null | lib/hd/common.js | Biscoint/bcoin | 900de1c98fcde564f37ad14f744871196d88f472 | [
"MIT"
] | null | null | null | lib/hd/common.js | Biscoint/bcoin | 900de1c98fcde564f37ad14f744871196d88f472 | [
"MIT"
] | null | null | null | /*!
* common.js - common functions for hd
* Copyright (c) 2015-2016, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcoin
*/
'use strict';
const assert = require('bsert');
const LRU = require('blru');
const common = exports;
/**
* Index at which hardening begins.
* @const {Number}
* @default
*/
common.HARDENED = 0x80000000;
/**
* Min entropy bits.
* @const {Number}
* @default
*/
common.MIN_ENTROPY = 128;
/**
* Max entropy bits.
* @const {Number}
* @default
*/
common.MAX_ENTROPY = 512;
/**
* LRU cache to avoid deriving keys twice.
* @type {LRU}
*/
common.cache = new LRU(500);
/**
* Parse a derivation path and return an array of indexes.
* @see https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
* @param {String} path
* @param {Boolean} hard
* @returns {Number[]}
*/
common.parsePath = function parsePath(path, hard) {
assert(typeof path === 'string');
assert(typeof hard === 'boolean');
assert(path.length >= 1);
assert(path.length <= 3062);
const parts = path.split('/');
const root = parts[0];
if (root !== 'm'
&& root !== 'M'
&& root !== 'm\''
&& root !== 'M\'') {
throw new Error('Invalid path root.');
}
const result = [];
for (let i = 1; i < parts.length; i++) {
let part = parts[i];
const hardened = part[part.length - 1] === '\'';
if (hardened)
part = part.slice(0, -1);
if (part.length > 10)
throw new Error('Path index too large.');
if (!/^\d+$/.test(part))
throw new Error('Path index is non-numeric.');
let index = parseInt(part, 10);
if ((index >>> 0) !== index)
throw new Error('Path index out of range.');
if (hardened) {
index |= common.HARDENED;
index >>>= 0;
}
if (!hard && (index & common.HARDENED))
throw new Error('Path index cannot be hardened.');
result.push(index);
}
return result;
};
/**
* Test whether the key is a master key.
* @param {HDPrivateKey|HDPublicKey} key
* @returns {Boolean}
*/
common.isMaster = function isMaster(key) {
return key.depth === 0
&& key.childIndex === 0
&& key.parentFingerPrint === 0;
};
/**
* Test whether the key is (most likely) a BIP44 account key.
* @param {HDPrivateKey|HDPublicKey} key
* @param {Number?} account
* @returns {Boolean}
*/
common.isAccount = function isAccount(key, account) {
if (account != null) {
const index = (common.HARDENED | account) >>> 0;
if (key.childIndex !== index)
return false;
}
return key.depth === 3 && (key.childIndex & common.HARDENED) !== 0;
};
/**
* A compressed pubkey of all zeroes.
* @const {Buffer}
* @default
*/
common.ZERO_KEY = Buffer.alloc(33, 0x00);
/**
* Purposes from extended key prefix bytes.
* @enum {Number}
* @default
*/
common.purposes = {
x: 0,
y: 1,
z: 2
};
/**
* Purposes by value.
* @enum {Number}
* @default
*/
common.purposesByVal = [
'x',
'y',
'z'
];
/**
* BIP44 "purpose" values by extended key prefix bytes
* @enum {Number}
* @default
*/
common.purposePath = {
x: 44,
y: 49,
z: 84
};
| 17.902299 | 70 | 0.591653 |
12a658d43a0e27c7a0648f0921b4b82821633eb2 | 389 | js | JavaScript | api/family/index.js | MattJStone/GoOutside | ff325a938401bc97a01814e615a2cd3baecbf302 | [
"MIT"
] | null | null | null | api/family/index.js | MattJStone/GoOutside | ff325a938401bc97a01814e615a2cd3baecbf302 | [
"MIT"
] | null | null | null | api/family/index.js | MattJStone/GoOutside | ff325a938401bc97a01814e615a2cd3baecbf302 | [
"MIT"
] | null | null | null | const router = require('express').Router();
const log = require('bole');
const fetch = require('node-fetch');
const auth = require('../shared/auth');
function postFamily(req, res) {
req.log = log(`postFamily...${uuid()}`);
}
router.post('/family', postFamily);
function getFamily(req, res) {
// confirm the user has logged in
}
module.exports = router; | 20.473684 | 45 | 0.622108 |
12a69ee8525e647b3b0e0878fa4cfb633c59cc56 | 2,281 | js | JavaScript | webapp/src/services/contaxy-client/model/UserInput.js | felixridinger/contaxy | e50401be4134818cb6df7764753860dcf944fe32 | [
"MIT"
] | 1 | 2022-02-16T11:13:08.000Z | 2022-02-16T11:13:08.000Z | webapp/src/services/contaxy-client/model/UserInput.js | felixridinger/contaxy | e50401be4134818cb6df7764753860dcf944fe32 | [
"MIT"
] | null | null | null | webapp/src/services/contaxy-client/model/UserInput.js | felixridinger/contaxy | e50401be4134818cb6df7764753860dcf944fe32 | [
"MIT"
] | null | null | null | /**
* Contaxy API
* Functionality to create and manage projects, services, jobs, and files.
*
* The version of the OpenAPI document: 0.0.6
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The UserInput model module.
* @module model/UserInput
* @version 0.0.6
*/
class UserInput {
/**
* Constructs a new <code>UserInput</code>.
* @alias module:model/UserInput
*/
constructor() {
UserInput.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {}
/**
* Constructs a <code>UserInput</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/UserInput} obj Optional instance to populate.
* @return {module:model/UserInput} The populated <code>UserInput</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new UserInput();
if (data.hasOwnProperty('username')) {
obj['username'] = ApiClient.convertToType(data['username'], 'String');
}
if (data.hasOwnProperty('email')) {
obj['email'] = ApiClient.convertToType(data['email'], 'String');
}
if (data.hasOwnProperty('disabled')) {
obj['disabled'] = ApiClient.convertToType(data['disabled'], 'Boolean');
}
}
return obj;
}
}
/**
* A unique username on the system.
* @member {String} username
*/
UserInput.prototype['username'] = undefined;
/**
* User email address.
* @member {String} email
*/
UserInput.prototype['email'] = undefined;
/**
* Indicates that user is disabled. Disabling a user will prevent any access to user-accesible resources.
* @member {Boolean} disabled
* @default false
*/
UserInput.prototype['disabled'] = false;
export default UserInput;
| 27.817073 | 117 | 0.670758 |
12a72c6e753ff0a3afc1e1208cf1a4e1d95ef1df | 2,268 | js | JavaScript | lib/components/popup/PopupButton.js | daitongda/video-react2 | 8f6e04193446ce89759c508157a704712ed868c3 | [
"MIT"
] | 1 | 2019-01-28T02:58:59.000Z | 2019-01-28T02:58:59.000Z | lib/components/popup/PopupButton.js | daitongda/video-react2 | 8f6e04193446ce89759c508157a704712ed868c3 | [
"MIT"
] | null | null | null | lib/components/popup/PopupButton.js | daitongda/video-react2 | 8f6e04193446ce89759c508157a704712ed868c3 | [
"MIT"
] | null | null | null | 'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _extends =
Object.assign ||
function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
exports.default = PopupButton;
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _ClickableComponent = require('../ClickableComponent');
var _ClickableComponent2 = _interopRequireDefault(_ClickableComponent);
var _Popup = require('./Popup');
var _Popup2 = _interopRequireDefault(_Popup);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
var propTypes = {
inline: _propTypes2.default.bool,
onClick: _propTypes2.default.func.isRequired,
onFocus: _propTypes2.default.func,
onBlur: _propTypes2.default.func,
className: _propTypes2.default.string
};
var defaultProps = {
inline: true
};
function PopupButton(props) {
var inline = props.inline,
className = props.className;
var ps = _extends({}, props);
delete ps.children;
delete ps.inline;
delete ps.className;
return _react2.default.createElement(
_ClickableComponent2.default,
_extends(
{
className: (0, _classnames2.default)(
className,
{
'video-react-menu-button-inline': !!inline,
'video-react-menu-button-popup': !inline
},
'video-react-control video-react-button video-react-menu-button'
)
},
ps
),
_react2.default.createElement(_Popup2.default, props)
);
}
PopupButton.propTypes = propTypes;
PopupButton.defaultProps = defaultProps;
PopupButton.displayName = 'PopupButton';
| 25.483146 | 84 | 0.61552 |
12a7984c993b1c1e80a0fb6a0aa6abd9bda1f47b | 247 | js | JavaScript | __tests__/codewars/twoFightersOneWinner.test.js | mirrdev/js-kata | 5ae7a70eb666a7146d4dcb529aedbfbdac9719ce | [
"MIT"
] | null | null | null | __tests__/codewars/twoFightersOneWinner.test.js | mirrdev/js-kata | 5ae7a70eb666a7146d4dcb529aedbfbdac9719ce | [
"MIT"
] | null | null | null | __tests__/codewars/twoFightersOneWinner.test.js | mirrdev/js-kata | 5ae7a70eb666a7146d4dcb529aedbfbdac9719ce | [
"MIT"
] | null | null | null | import { declareWinner2 as declareWinner, Fighter } from '../../src/codewars/twoFightersOneWinner';
it('twoFightersOneWinner test', () => {
expect(declareWinner(new Fighter('Lew', 10, 2), new Fighter('Harry', 5, 4), 'Lew')).toEqual('Lew');
});
| 41.166667 | 101 | 0.680162 |
12a82ac602c9a6cf231849d12b80d38788469de7 | 1,671 | js | JavaScript | packages/@react-aria/dnd/test/mocks.js | lukasbuenger/react-spectrum | fc8fda0c6902e2790cc92ab2d3f7fbb6ffc6f365 | [
"Apache-2.0"
] | null | null | null | packages/@react-aria/dnd/test/mocks.js | lukasbuenger/react-spectrum | fc8fda0c6902e2790cc92ab2d3f7fbb6ffc6f365 | [
"Apache-2.0"
] | null | null | null | packages/@react-aria/dnd/test/mocks.js | lukasbuenger/react-spectrum | fc8fda0c6902e2790cc92ab2d3f7fbb6ffc6f365 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export class DataTransferItem {
constructor(type, data, kind = 'string') {
this.kind = kind;
this.type = type;
this._data = data;
}
getAsString(callback) {
callback(this._data);
}
}
export class DataTransferItemList {
constructor(items = []) {
this._items = items;
}
add(data, type) {
this._items.push(new DataTransferItem(type, data));
}
*[Symbol.iterator]() {
yield* this._items;
}
}
export class DataTransfer {
constructor() {
this.items = new DataTransferItemList();
this.dropEffect = 'none';
this.effectAllowed = 'all';
}
setDragImage(dragImage, x, y) {
this._dragImage = {node: dragImage, x, y};
}
get types() {
return this.items._items.map(item => item.type);
}
getData(type) {
return this.items._items.find(item => item.type === type)?._data;
}
}
export class DragEvent extends MouseEvent {
constructor(type, init) {
super(type, {...init, bubbles: true, cancelable: true, composed: true});
this.dataTransfer = init.dataTransfer;
}
}
| 25.707692 | 89 | 0.681029 |
12a8437e1bfeac1b348db7a9873e067fc2f0f138 | 603 | js | JavaScript | bin/command/init.js | tears330/sketcher | 75356f4d397f25e79506b5a801f686bf3a9466b8 | [
"MIT"
] | 3 | 2017-01-11T07:33:09.000Z | 2017-02-18T15:45:11.000Z | bin/command/init.js | tears330/sketcher | 75356f4d397f25e79506b5a801f686bf3a9466b8 | [
"MIT"
] | 1 | 2017-01-17T06:29:46.000Z | 2017-02-17T18:56:36.000Z | bin/command/init.js | tears330/sketcher | 75356f4d397f25e79506b5a801f686bf3a9466b8 | [
"MIT"
] | null | null | null | const fs = require('fs');
const readline = require('readline');
const util = require('../lib/util');
var json = require('../lib/resume');
const init = () => {
util.questionSync('Name:')
.then((answer) => {
json.basics.name = answer;
return util.questionSync('Email:');
})
.then((answer) => {
json.basics.email = answer;
return util.writeFile('/resume.json', JSON.stringify(json, undefined, 2));
})
.then((data) => {
console.log('Checkout your resume.json!')
})
};
module.exports = init; | 25.125 | 86 | 0.53068 |
12a8e769404d3a99caf84ee94e7871690d1f5ca1 | 251 | js | JavaScript | client/views/includes/errors.js | telminov/meteor-score | f5fa7abd4cf23ed44f00d109a6747900ba814c20 | [
"MIT"
] | null | null | null | client/views/includes/errors.js | telminov/meteor-score | f5fa7abd4cf23ed44f00d109a6747900ba814c20 | [
"MIT"
] | null | null | null | client/views/includes/errors.js | telminov/meteor-score | f5fa7abd4cf23ed44f00d109a6747900ba814c20 | [
"MIT"
] | null | null | null | Template.errors.helpers({
errors: function() {
return Errors.find();
}
});
Template.error.render = function() {
var error = this.data;
Meteor.defer(function() {
Errors.update(error._id, {$set: {seen: true}});
})
}; | 20.916667 | 55 | 0.573705 |
12a956fbe05e7953b9400d350714b59680420c4f | 407 | js | JavaScript | buildScripts/srcServer.js | t1mtek/jsStarterKit | ccd1c5aa1dc3024dc2198db43c4749948bd645d8 | [
"MIT"
] | null | null | null | buildScripts/srcServer.js | t1mtek/jsStarterKit | ccd1c5aa1dc3024dc2198db43c4749948bd645d8 | [
"MIT"
] | null | null | null | buildScripts/srcServer.js | t1mtek/jsStarterKit | ccd1c5aa1dc3024dc2198db43c4749948bd645d8 | [
"MIT"
] | null | null | null | /**
* Created by timtek on 21/02/2018.
*/
var express = require('express');
var path = require('path');
var open = require('open');
var port = 3259;
var app = express();
app.get('/', function (req,res) {
res.sendfile(path.join(__dirname, '../src/index.html'));
});
app.listen(port,function (err) {
if(err){
console.log(err)
}else{
open('http://localhost:'+port);
}
});
| 17.695652 | 60 | 0.579853 |
12a96821ce2bdfc2c91fb23727edd387f2812e09 | 566 | js | JavaScript | react/src/flickering/example8/store/actions.js | CodingItWrong/cypress-flake-test | d93a209367738f80abcfd563107466b0f1f16bf1 | [
"MIT"
] | 19 | 2020-10-28T03:20:48.000Z | 2022-02-23T23:17:35.000Z | react/src/flickering/example8/store/actions.js | CodingItWrong/cypress-flake-test | d93a209367738f80abcfd563107466b0f1f16bf1 | [
"MIT"
] | null | null | null | react/src/flickering/example8/store/actions.js | CodingItWrong/cypress-flake-test | d93a209367738f80abcfd563107466b0f1f16bf1 | [
"MIT"
] | 4 | 2020-11-16T19:37:15.000Z | 2022-03-21T10:37:43.000Z | import axios from 'axios';
export const EXAMPLE8_REQUEST = 'EXAMPLE8_REQUEST';
export const EXAMPLE8_SET_COUNT = 'EXAMPLE8_SET_COUNT';
export const EXAMPLE8_INCREMENT = 'EXAMPLE8_INCREMENT';
export const loadCountFromServer = dispatch => {
dispatch(request());
axios.get('http://localhost:3001/count').then(({data}) => {
dispatch(setCount(data.count));
});
};
const request = () => ({
type: EXAMPLE8_REQUEST,
});
const setCount = count => ({
type: EXAMPLE8_SET_COUNT,
count,
});
export const increment = () => ({
type: EXAMPLE8_INCREMENT,
});
| 21.769231 | 61 | 0.69258 |
12a999554e0f37e3387c0e4f8b84c7568184f972 | 1,881 | js | JavaScript | divvy_tracker/assets/js/pages/reports.js | tpennock/divvy-tracker-app | 6896a19fd7380a827573231ff56ead8db04c66bf | [
"MIT"
] | null | null | null | divvy_tracker/assets/js/pages/reports.js | tpennock/divvy-tracker-app | 6896a19fd7380a827573231ff56ead8db04c66bf | [
"MIT"
] | 3 | 2018-12-11T00:07:41.000Z | 2018-12-11T00:09:36.000Z | divvy_tracker/assets/js/pages/reports.js | tpennock/divvy-tracker-app | 6896a19fd7380a827573231ff56ead8db04c66bf | [
"MIT"
] | null | null | null | import React from 'react'
import { compose } from 'redux';
import { connect } from 'react-redux'
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import Typography from '@material-ui/core/Typography';
import AreaGraph from '../components/charts/area-graph';
import LineGraph from '../components/charts/line-graph';
import RadialBarGraph from '../components/charts/radial-bar-graph';
const styles = theme => ({
chartContainer: {
marginLeft: -22,
}
});
const mapStateToProps = state => ({
...state
});
const mapDispatchToProps = dispatch => ({
});
class Reports extends React.Component {
hasData = () => this.props.transactions.transactions.length > 0;
render() {
const { classes } = this.props;
return (
<div>
<CssBaseline />
<main className={classes.content}>
<Typography variant="h4" gutterBottom component="h2">
Reports
</Typography>
{this.hasData() ? (
<div>
<Typography component="div" className={classes.chartContainer}>
<RadialBarGraph />
</Typography>
<Typography component="div" className={classes.chartContainer}>
<AreaGraph />
</Typography>
<Typography component="div" className={classes.chartContainer}>
<LineGraph />
</Typography>
</div>
) : (
<Typography variant="body1" gutterBottom>
No Transaction data found.
</Typography>
)}
</main>
</div>
);
}
}
Reports.propTypes = {
classes: PropTypes.object.isRequired,
};
export default compose(
withStyles(styles),
connect(mapStateToProps, mapDispatchToProps),
)(Reports);
| 26.871429 | 77 | 0.597554 |
12aa1c234eed6150e82ef1ff73522c99209d1af5 | 495 | js | JavaScript | src/features/questions/question-list-component.js | brianrlewis/rejection | 7f291d9f03265ac5c86774d4afba5d68f5fd350f | [
"MIT"
] | 1 | 2020-05-19T01:11:39.000Z | 2020-05-19T01:11:39.000Z | src/features/questions/question-list-component.js | brianrlewis/rejection | 7f291d9f03265ac5c86774d4afba5d68f5fd350f | [
"MIT"
] | null | null | null | src/features/questions/question-list-component.js | brianrlewis/rejection | 7f291d9f03265ac5c86774d4afba5d68f5fd350f | [
"MIT"
] | null | null | null | import { connect } from 'react-redux';
import QuestionList from './question-list-component-view';
import {
getQuestions,
removeQuestion,
updateQuestion,
} from './questions-reducer';
const mapStateToProps = state => ({
questions: getQuestions(state)
.sort((a, b) => b.timestamp - a.timestamp),
});
const mapDispatchToProps = {
removeQuestion,
updateQuestion,
};
export default connect(
mapStateToProps,
mapDispatchToProps,
)(QuestionList);
| 21.521739 | 59 | 0.672727 |
12aa3214c8c37ed64df482945c26fc595db66a76 | 3,097 | js | JavaScript | modules/admissionmanagements/server/controllers/admissionmanagements.server.controller.js | praiitt/adgit-sms | 7a6908b5df5c56a637d4891d3e49b667eda9ddf9 | [
"MIT"
] | null | null | null | modules/admissionmanagements/server/controllers/admissionmanagements.server.controller.js | praiitt/adgit-sms | 7a6908b5df5c56a637d4891d3e49b667eda9ddf9 | [
"MIT"
] | null | null | null | modules/admissionmanagements/server/controllers/admissionmanagements.server.controller.js | praiitt/adgit-sms | 7a6908b5df5c56a637d4891d3e49b667eda9ddf9 | [
"MIT"
] | null | null | null | 'use strict';
/**
* Module dependencies.
*/
var path = require('path'),
mongoose = require('mongoose'),
Admissionmanagement = mongoose.model('Admissionmanagement'),
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')),
_ = require('lodash');
/**
* Create a Admissionmanagement
*/
exports.create = function(req, res) {
var admissionmanagement = new Admissionmanagement(req.body);
admissionmanagement.user = req.user;
admissionmanagement.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(admissionmanagement);
}
});
};
/**
* Show the current Admissionmanagement
*/
exports.read = function(req, res) {
// convert mongoose document to JSON
var admissionmanagement = req.admissionmanagement ? req.admissionmanagement.toJSON() : {};
// Add a custom field to the Article, for determining if the current User is the "owner".
// NOTE: This field is NOT persisted to the database, since it doesn't exist in the Article model.
admissionmanagement.isCurrentUserOwner = req.user && admissionmanagement.user && admissionmanagement.user._id.toString() === req.user._id.toString();
res.jsonp(admissionmanagement);
};
/**
* Update a Admissionmanagement
*/
exports.update = function(req, res) {
var admissionmanagement = req.admissionmanagement;
admissionmanagement = _.extend(admissionmanagement, req.body);
admissionmanagement.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(admissionmanagement);
}
});
};
/**
* Delete an Admissionmanagement
*/
exports.delete = function(req, res) {
var admissionmanagement = req.admissionmanagement;
admissionmanagement.remove(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(admissionmanagement);
}
});
};
/**
* List of Admissionmanagements
*/
exports.list = function(req, res) {
Admissionmanagement.find().sort('-created').populate('user', 'displayName').exec(function(err, admissionmanagements) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(admissionmanagements);
}
});
};
/**
* Admissionmanagement middleware
*/
exports.admissionmanagementByID = function(req, res, next, id) {
if (!mongoose.Types.ObjectId.isValid(id)) {
return res.status(400).send({
message: 'Admissionmanagement is invalid'
});
}
Admissionmanagement.findById(id).populate('user', 'displayName').exec(function (err, admissionmanagement) {
if (err) {
return next(err);
} else if (!admissionmanagement) {
return res.status(404).send({
message: 'No Admissionmanagement with that identifier has been found'
});
}
req.admissionmanagement = admissionmanagement;
next();
});
};
| 26.245763 | 151 | 0.67517 |
12aa9f68627faa301e7dd2ab1857283cf51ef182 | 11,001 | js | JavaScript | iot-hub/node_modules/azure-iothub/test/_registry_test.js | weichmacher/node-red-contrib-azure | 515c379a0a32305d1d88f2eee71366e5ae7318cd | [
"MIT"
] | 20 | 2018-06-11T17:45:03.000Z | 2021-11-26T19:03:56.000Z | iot-hub/node_modules/azure-iothub/test/_registry_test.js | weichmacher/node-red-contrib-azure | 515c379a0a32305d1d88f2eee71366e5ae7318cd | [
"MIT"
] | 22 | 2018-04-24T01:25:01.000Z | 2021-03-11T10:49:49.000Z | iot-hub/node_modules/azure-iothub/test/_registry_test.js | weichmacher/node-red-contrib-azure | 515c379a0a32305d1d88f2eee71366e5ae7318cd | [
"MIT"
] | 28 | 2018-04-24T21:48:53.000Z | 2021-07-19T18:03:03.000Z | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
'use strict';
var assert = require('chai').assert;
var Registry = require('../lib/registry.js');
var SimulatedHttp = require('./registry_http_simulated.js');
var runTests = require('./_registry_common_testrun.js');
function bulkTests(Transport, goodConnectionString) {
describe('Registry', function () {
var testJobId = "";
describe('#importDevicesFromBlob', function (done) {
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_001: [A ReferenceError shall be thrown if inputBlobContainerUri is falsy]*/
[undefined, null, "", 0].forEach(function (inputBlobUri) {
it('throws when inputBlobContainerUri is ' + inputBlobUri, function () {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
assert.throws(function () {
registry.importDevicesFromBlob(inputBlobUri, "foo", done);
}, ReferenceError);
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_002: [A ReferenceError shall be thrown if outputBlobContainerUri is falsy]*/
[undefined, null, "", 0].forEach(function (outputBlobUri) {
it('throws when outputBlobContainerUri is ' + outputBlobUri, function () {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
assert.throws(function () {
registry.importDevicesFromBlob("foo", outputBlobUri, done);
}, ReferenceError);
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_003: [The ‘done’ callback shall be called with the job identifier as a parameter when the import job has been created]*/
it('calls the done callback with a job identifier', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.importDevicesFromBlob("foo", "bar", function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res.jobId);
done();
}
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_008: [The importDevicesFromBlob method should create a bulk import job using the transport associated with the Registry instance by giving it the correct URI path and an import request object as such:
{
'type': 'import',
'inputBlobContainerUri': <input container Uri given as parameter>,
'outputBlobContainerUri': <output container Uri given as parameter>
}] */
it('creates a correct import request', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
var inputUri = "foo";
var outputUri = "bar";
registry.importDevicesFromBlob(inputUri, outputUri, function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res.jobId);
testJobId = res.jobId;
assert.equal(res.type, 'import');
assert.equal(res.inputBlobContainerUri, inputUri);
assert.equal(res.outputBlobContainerUri, outputUri);
done();
}
});
});
});
describe('#exportDevicesToBlob', function (done) {
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_004: [A ReferenceError shall be thrown if outputBlobContainerUri is falsy] */
[undefined, null, "", 0].forEach(function (outputBlobUri) {
it('throws when outputBlobContainerUri is ' + outputBlobUri, function () {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
assert.throws(function () {
registry.exportDevicesToBlob(outputBlobUri, true, done);
}, ReferenceError);
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_005: [The ‘done’ callback shall be called with a null error parameter and the job status as a second parameter when the export job has been created] */
it('calls the done callback with a job identifier', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.exportDevicesToBlob("foo", true, function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res.jobId);
done();
}
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_009: [The exportDevicesFromBlob method should create a bulk export job using the transport associated with the Registry instance by giving it the correct path URI and export request object as such:
{
'type': 'export',
'outputBlobContainerUri': <output container Uri given as parameter>,
'excludeKeysInExport': <excludeKeys Boolean given as parameter>
}]*/
[true, false].forEach(function (excludeKeys) {
it('creates a correct export request when excludeKeys is ' + excludeKeys, function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
var outputUri = "bar";
registry.exportDevicesToBlob(outputUri, excludeKeys, function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res.jobId);
assert.equal(res.type, 'export');
assert.equal(res.outputBlobContainerUri, outputUri);
assert.equal(res.excludeKeysInExport, excludeKeys);
done();
}
});
});
});
});
describe('#listJobs', function () {
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_016: [The listJobs method should request a list of active and recent bulk import/export jobs using the transport associated with the Registry instance and give it the correct path URI.] */
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_010: [The ‘done’ callback shall be called with a null error parameter and list of recent jobs as a second parameter if the request is successful.]*/
it('calls the transport to request a list of jobs and succeeds', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.listJobs(function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res);
done();
}
});
});
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_011: [The ‘done’ callback shall be called with only an error object if the request fails.]*/
it('calls the transport to request a list of jobs and fails', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
if (registry._transport instanceof SimulatedHttp) {
registry._transport.fakeFailure = true;
registry.listJobs(function (err, res) {
assert.isOk(err);
assert.isUndefined(res);
done();
});
} else {
done();
}
});
});
describe('#getJob', function (done) {
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_006: [A ReferenceError shall be thrown if jobId is falsy] */
[undefined, null, "", 0].forEach(function (jobId) {
it('throws when jobId is ' + jobId, function () {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
assert.throws(function () {
registry.getJob(jobId, done);
}, ReferenceError);
});
});
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_017: [The getJob method should request status information of the bulk import/export job identified by the jobId parameter using the transport associated with the Registry instance and give it the correct path URI.]*/
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_015: [The ‘done’ callback shall be called with only an error object if the request fails.]*/
it('calls the transport to request a job status and succeeds', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.getJob(testJobId, function (err, res) {
if (err) {
done(err);
} else {
assert.isOk(res);
done();
}
});
});
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_007: [The ‘done’ callback shall be called with a null error parameter and the job status as second parameter if the request is successful.]*/
it('calls the transport to request a job status and fails', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.getJob("000-000", function (err, res) {
assert.isOk(err);
assert.isUndefined(res);
done();
});
});
});
describe('#cancelJob', function (done) {
/*Tests_SRS_NODE_IOTHUB_REGISTRY_16_012: [A ReferenceError shall be thrown if the jobId is falsy] */
[undefined, null, "", 0].forEach(function (jobId) {
it('throws when jobId is ' + jobId, function () {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
assert.throws(function () {
registry.cancelJob(jobId, done);
}, ReferenceError);
});
});
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_018: [The cancelJob method should request cancel the job identified by the jobId parameter using the transport associated with the Registry instance by giving it the correct path URI.]*/
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_013: [The ‘done’ callback shall be called with only an error object if the request fails.]*/
it('calls the transport to cancel a job and succeeds', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.cancelJob(testJobId, function (err) {
assert.isUndefined(err);
done();
});
});
/* Tests_SRS_NODE_IOTHUB_REGISTRY_16_014: [The ‘done’ callback shall be called with no parameters if the request is successful.]*/
it('calls the transport to cancel a job and fails', function (done) {
var registry = Registry.fromConnectionString(goodConnectionString, Transport);
registry.cancelJob("000-000", function (err) {
assert.isOk(err);
done();
});
});
});
});
}
function makeConnectionString(host, policy, key) {
return 'HostName=' + host + ';SharedAccessKeyName=' + policy + ';SharedAccessKey=' + key;
}
var connectionString = makeConnectionString('host', 'policy', 'key');
var badConnStrings = [
makeConnectionString('bad', 'policy', 'key'),
makeConnectionString('host', 'bad', 'key'),
makeConnectionString('host', 'policy', 'bad')
];
var deviceId = 'testDevice';
describe('Over simulated HTTPS', function () {
runTests(SimulatedHttp, connectionString, badConnStrings, deviceId);
bulkTests(SimulatedHttp, connectionString);
});
| 44.902041 | 259 | 0.646759 |
12abc26fd032dc08c0be06c3b3006b0e8b16315e | 5,819 | js | JavaScript | vcli/frontend_lecture/src/router/index.js | jihyun-1101/LectureContents | be5d60da325a4c7528279dc843063c138a461b33 | [
"MIT"
] | 31 | 2021-12-20T11:09:19.000Z | 2022-03-04T02:43:13.000Z | vcli/frontend_lecture/src/router/index.js | jihyun-1101/LectureContents | be5d60da325a4c7528279dc843063c138a461b33 | [
"MIT"
] | null | null | null | vcli/frontend_lecture/src/router/index.js | jihyun-1101/LectureContents | be5d60da325a4c7528279dc843063c138a461b33 | [
"MIT"
] | 17 | 2021-12-20T12:33:50.000Z | 2022-03-29T16:22:05.000Z | import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Test from '@/views/Test.vue'
import BoardListPage from '@/views/board/BoardListPage.vue'
import BoardRegisterPage from '@/views/board/BoardRegisterPage.vue'
import BoardReadPage from '@/views/board/BoardReadPage.vue'
import BoardModifyPage from '@/views/board/BoardModifyPage.vue'
import Concave from '@/views/game/Concave.vue'
import EventBusTestPage from '@/views/eventbus/EventBusTestPage.vue'
import ProductBoardListPage from '@/views/productBoard/ProductBoardListPage.vue'
import ProductBoardRegisterPage from '@/views/productBoard/ProductBoardRegisterPage.vue'
import ProductBoardReadPage from '@/views/productBoard/ProductBoardReadPage.vue'
import ProductBoardModifyPage from '@/views/productBoard/ProductBoardModifyPage.vue'
import VuetifyAllInOneTestPage from '@/views/ui/VuetifyAllInOneTestPage.vue'
import VuetifyImageTestPage from '@/views/ui/VuetifyImageTestPage.vue'
import CoverFlowTestPage from '@/views/ui/CoverFlowTestPage.vue'
import AwesomeSwiperTestPage from '@/views/ui/AwesomeSwiperTestPage.vue'
import ImageGalleryTestPage from '@/views/ui/ImageGalleryTestPage.vue'
import CalendarTestPage from '@/views/ui/CalendarTestPage.vue'
import VueFileUploadPage from '@/views/fileUpload/VueFileUploadPage.vue'
import VuetifyMemberRegisterPage from '@/views/jpaMember/VuetifyMemberRegisterPage.vue'
import VuetifyMemberJoinColumnTestPage from '@/views/jpaMember/VuetifyMemberJoinColumnTestPage.vue'
import LoginTestPage from '@/views/jpaMember/LoginTestPage.vue'
import JpaBoardListPage from '@/views/jpaBoard/JpaBoardListPage.vue'
import JpaBoardRegisterPage from '@/views/jpaBoard/JpaBoardRegisterPage.vue'
import JpaBoardReadPage from '@/views/jpaBoard/JpaBoardReadPage.vue'
import JpaBoardModifyPage from '@/views/jpaBoard/JpaBoardModifyPage.vue'
import JpaMemberAuthTestPage from '@/views/jpaMember/JpaMemberAuthTestPage.vue'
import DaumNewsCrawlerPage from '@/views/crawl/DaumNewsCrawlerPage.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/test',
name: 'Test',
component: Test
},
{
path: '/boardList',
name: 'BoardListPage',
component: BoardListPage
},
{
path: '/boardRegister',
name: 'BoardRegisterPage',
component: BoardRegisterPage
},
{
path: '/boardRead/:boardNo',
name: 'BoardReadPage',
components: {
default: BoardReadPage
},
props: {
default: true
}
},
{
path: '/boardModify/:boardNo',
name: 'BoardModifyPage',
components: {
default: BoardModifyPage
},
props: {
default: true
}
},
{
path: '/game/concave',
name: 'Concave',
component: Concave
},
{
path: '/eventbusTest',
name: 'EventBusTestPage',
component: EventBusTestPage
},
{
path: '/productBoardList',
name: 'ProductBoardListPage',
component: ProductBoardListPage
},
{
path: '/productBoardRegister',
name: 'ProductBoardRegisterPage',
component: ProductBoardRegisterPage
},
{
path: '/productBoardRead/:productNo',
name: 'ProductBoardReadPage',
components: {
default: ProductBoardReadPage
},
props: {
default: true
}
},
{
path: '/productBoardModify/:productNo',
name: 'ProductBoardModifyPage',
components: {
default: ProductBoardModifyPage
},
props: {
default: true
}
},
{
path: '/vuetifyTest',
name: 'VuetifyAllInOneTestPage',
component: VuetifyAllInOneTestPage
},
{
path: '/vuetifyImageTest',
name: 'VuetifyImageTestPage',
component: VuetifyImageTestPage
},
{
path: '/coverFlowTest',
name: 'CoverFlowTestPage',
components: {
default: CoverFlowTestPage
}
},
{
path: '/awesomeSwiperTest',
name: 'AwesomeSwiperTestPage',
components: {
default: AwesomeSwiperTestPage
}
},
{
path: '/imageGalleryTest',
name: 'ImageGalleryTestPage',
components: {
default: ImageGalleryTestPage
}
},
{
path: '/calendarTest',
name: 'CalendarTestPage',
components: {
default: CalendarTestPage
}
},
{
path: '/vueFileUploadTest',
name: 'VueFileUploadPage',
components: {
default: VueFileUploadPage
}
},
{
path: '/vuetifyMemberRegisterTest',
name: 'VuetifyMemberRegisterPage',
components: {
default: VuetifyMemberRegisterPage
}
},
{
path: '/vuetifyMemberJoinColumnTest',
name: 'VuetifyMemberJoinColumnTestPage',
components: {
default: VuetifyMemberJoinColumnTestPage
}
},
{
path: '/login',
name: 'LoginTestPage',
components: {
default: LoginTestPage
}
},
{
path: '/jpaBoardList',
name: 'JpaBoardListPage',
component: JpaBoardListPage
},
{
path: '/jpaBoardRegister',
name: 'JpaBoardRegisterPage',
component: JpaBoardRegisterPage
},
{
path: '/jpaBoardRead/:boardNo',
name: 'JpaBoardReadPage',
components: {
default: JpaBoardReadPage
},
props: {
default: true
}
},
{
path: '/jpaBoardModify/:boardNo',
name: 'JpaBoardModifyPage',
components: {
default: JpaBoardModifyPage
},
props: {
default: true
}
},
{
path: '/jpaMemberAuthTest',
name: 'JpaMemberAuthTestPage',
components: {
default: JpaMemberAuthTestPage
},
props: {
default: true
}
},
{
path: '/daumNewsCrawl',
name: 'DaumNewsCrawlerPage',
components: {
default: DaumNewsCrawlerPage
},
props: {
default: true
}
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router
| 23.09127 | 99 | 0.677436 |
12ac00dc6573dd848a4dede55109ed8605c0ecbe | 715 | js | JavaScript | DAY_8_TO_DAY_9/src/Components/DetailButton.js | alstn2468/Nomad_Coder_ReactJS_Challenge | 39111d381247a9c0f134c6d71c977384c0ac288a | [
"MIT"
] | 1 | 2020-08-09T04:28:31.000Z | 2020-08-09T04:28:31.000Z | DAY_8_TO_DAY_9/src/Components/DetailButton.js | alstn2468/Nomad_Coder_ReactJS_Challenge | 39111d381247a9c0f134c6d71c977384c0ac288a | [
"MIT"
] | null | null | null | DAY_8_TO_DAY_9/src/Components/DetailButton.js | alstn2468/Nomad_Coder_ReactJS_Challenge | 39111d381247a9c0f134c6d71c977384c0ac288a | [
"MIT"
] | 2 | 2021-06-18T17:53:40.000Z | 2021-08-18T10:50:00.000Z | import React from "react";
import styled from "styled-components";
import PropTypes from "prop-types";
import { Link } from "react-router-dom";
const Button = styled.button`
width: 120px;
height: 50px;
background-color: white;
border: 2px solid #6200ee;
color: #6200ee;
margin-right: 10px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
:hover {
background-color: #6200ee;
color: white;
}
`;
const DetailButton = ({ name, path }) => (
<Link to={path}>
<Button>{name}</Button>
</Link>
);
DetailButton.propTypes = {
name: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
};
export default DetailButton;
| 21.666667 | 42 | 0.643357 |
12ac02d1e76ca109f1e8292ecc8266845c827d1d | 3,470 | js | JavaScript | pages/projects.js | AbhinavMV/WebXDAO.github.io | 1584b9f80308f86fd402372aa38d3a7d74a7cb06 | [
"MIT"
] | 4 | 2022-01-18T06:58:49.000Z | 2022-02-05T01:03:13.000Z | pages/projects.js | AbhinavMV/WebXDAO.github.io | 1584b9f80308f86fd402372aa38d3a7d74a7cb06 | [
"MIT"
] | 19 | 2022-01-11T18:35:11.000Z | 2022-02-19T18:26:55.000Z | pages/projects.js | AbhinavMV/WebXDAO.github.io | 1584b9f80308f86fd402372aa38d3a7d74a7cb06 | [
"MIT"
] | 4 | 2022-01-14T14:02:35.000Z | 2022-02-15T14:00:50.000Z | import Head from 'next/head'
import { prefix } from '../constants'
export default function Projects({ projectsData }) {
return (
<>
<Head>
<title>Projects | WebXDAO</title>
</Head>
<section className='text-white text-center bg-[#00007f]'>
<div className='px-20 py-20'>
<h1 className='font-bold text-3xl md:text-5xl antialiased'>Resources/Projects</h1>
<div className='mt-6 text-xl font-light text-true-gray-500 antialiased'>
Here you can find a list of good projects and resources to learn about Blockchain and
Web 3.0
</div>
</div>
</section>
<div className='container max-w-screen-xl mx-auto my-8 grid pb-8 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mb-8 gap-6 px-8'>
{projectsData.map(({ name, imgUrl, type, title, text, tags }, index) => (
<div
key={name + index}
className='flex flex-col justify-between items-stretch col-span-3 md:col-span-1 cursor-pointer p-2 shadow rounded-md focus:outline-none focus:shadow-outline transform transition hover:shadow-lg hover:scale-105 duration-300 ease-in-out'
>
<div className='bg-white p-4 rounded-lg flex flex-col justify-between'>
<div className='relative mb-6'>
<img
className='lg:h-60 xl:h-56 md:h-64 h-72 w-full object-cover object-center rounded-md'
src={prefix + imgUrl}
alt={name}
/>
</div>
<div className='flex justify-between'>
<h2 className='text-xl text-gray-900 font-semibold mb-4'>{title}</h2>
<h3
className={`tracking-widest ${
type === 'FREE' ? 'text-green-500' : 'text-yellow-500'
} text-sm font-semibold title-font`}
>
{type}
</h3>
</div>
<p className='leading-relaxed text-base text-gray-800 mb-5'>{text}</p>
<div className='mt-auto justify-items-end text-sm flex flex-wrap gap-3'>
{tags.map((item, index) => (
<button
key={item + index}
className='whitespace-nowrap font-semibold bg-blue-100 text-blue-600 rounded-md py-2 px-4 focus:outline-none'
>
{item}
</button>
))}
</div>
</div>
</div>
))}
</div>
</>
)
}
export function getStaticProps() {
const data = [
{
name: 'InVision',
imgUrl: '/blogs_inVision.png',
type: 'PREMIUM',
title: 'Start Here',
text: 'InVision is the digital product design platform used to make the worlds best customer experiences.',
tags: ['Documentation']
},
{
name: 'Adobe XD',
imgUrl: '/blogs_xd.png',
type: 'FREE',
title: 'Blockchain Dev Path',
text: 'Adobe XD is your UI/UX design solution platform for website and mobile appcreation.',
tags: ['Documentation']
},
{
name: 'Figma',
imgUrl: '/blogs_figma.png',
type: 'FREE',
title: 'Website',
text: 'Figma helps the teams to create, test, and ship better designs from start to finish.',
tags: ['Tailwind Css', 'Eleventy', 'Alpine.js']
}
]
return {
props: {
projectsData: data
}
}
}
| 35.408163 | 247 | 0.537464 |
12ac3c66a22f25aec5d5f677d4ba8e257626dcd7 | 2,156 | js | JavaScript | src/containers/dashbot/index.js | thanh4890/react-examples | 949e97ac4e60bc2a65cbffe7c47e382f35a05e74 | [
"MIT"
] | 1 | 2018-07-26T09:53:36.000Z | 2018-07-26T09:53:36.000Z | src/containers/dashbot/index.js | thanh4890/react-examples | 949e97ac4e60bc2a65cbffe7c47e382f35a05e74 | [
"MIT"
] | null | null | null | src/containers/dashbot/index.js | thanh4890/react-examples | 949e97ac4e60bc2a65cbffe7c47e382f35a05e74 | [
"MIT"
] | null | null | null | import React from 'react'
import { Formik, Form, Field } from 'formik'
class Dashbot extends React.Component {
constructor() {
super()
this.state = {
response: ''
}
}
submit(values) {
console.log(values)
let type = values.type === 'user' ? 'incoming' : 'outgoing'
let data = {
text: values.text,
userId: values.userId,
platformJson: {
OS: 'Windows 10'
}
}
if (values.intent) {
data['intent'] = {
name: values.intent
}
}
window.fetch(
`https://tracker.dashbot.io/track?platform=generic&v=10.1.1-rest&type=${type}&apiKey=${
values.apiKey
}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
}
)
}
render() {
return (
<div>
<h1>Dashbot</h1>
<Formik
initialValues={{
api_key: '',
type: 'user',
text: '',
userId: '',
intent: ''
}}
onSubmit={(values, { setSubmitting }) => {
this.submit(values)
setSubmitting(false)
}}>
{({ isSubmitting }) => (
<Form>
<Field type="text" name="apiKey" placeholder="apiKey" />
<br />
<Field component="select" name="type">
<option value="user">User</option>
<option value="agent">Bot</option>
</Field>
<br />
<Field type="text" name="text" placeholder="message" />
<br />
<Field type="text" name="userId" placeholder="user id" />
<br />
<Field type="text" name="intent" placeholder="intent" />
<span>
Enter <strong>NotHandled</strong> if your bot doesn't understand
</span>
<br />
<button type="submit" disabled={isSubmitting}>
Submit
</button>
</Form>
)}
</Formik>
</div>
)
}
}
export default Dashbot
| 23.434783 | 93 | 0.455009 |
12aca6d231958f53e65ccc4a472593fe75a28ae9 | 616 | js | JavaScript | _scaffold/src/components/data/http.js | yura-chaikovsky/ruth | b74494f8e6776c3a92f7c9633c8408237e9b7762 | [
"MIT"
] | null | null | null | _scaffold/src/components/data/http.js | yura-chaikovsky/ruth | b74494f8e6776c3a92f7c9633c8408237e9b7762 | [
"MIT"
] | 5 | 2019-07-11T13:47:13.000Z | 2020-03-14T14:12:40.000Z | _scaffold/src/components/data/http.js | yura-chaikovsky/ruth | b74494f8e6776c3a92f7c9633c8408237e9b7762 | [
"MIT"
] | null | null | null | import Config from "./../../config/index";
import {RuthHttp} from "../../../src/http/index";
export {HttpForbidden, HttpUnauthorized, HttpNotFound, HttpServerUnavailable} from "../../../src/http";
export default class Http {
static fetch(url, method, body, headers = {}) {
return RuthHttp.fetch(url, method, body, headers);
}
static fetchApi(urlSuffix, method, body, headers = {}) {
return RuthHttp.fetch(Config.apiHost + urlSuffix, method, body, headers);
}
static upload(fileBase64) {
return RuthHttp.fetch(Config.apiHost + "/media", "POST", fileBase64);
}
}
| 28 | 103 | 0.647727 |
12acc2fc0b2b8ffdeab963926dd09215abe22efe | 2,533 | js | JavaScript | admin/src/api/fetch.js | RedLemonPie/cefan-all | 9c2830f6ceabd97e956f9f5c259fd151d38e68a3 | [
"MIT"
] | null | null | null | admin/src/api/fetch.js | RedLemonPie/cefan-all | 9c2830f6ceabd97e956f9f5c259fd151d38e68a3 | [
"MIT"
] | null | null | null | admin/src/api/fetch.js | RedLemonPie/cefan-all | 9c2830f6ceabd97e956f9f5c259fd151d38e68a3 | [
"MIT"
] | null | null | null | import Util from '../libs/util'
import qs from 'qs'
import Vue from 'vue'
import store from '../store/index'
Util.ajax.defaults.headers.common = {
'X-Requested-With': 'XMLHttpRequest'
};
Util.ajax.interceptors.request.use(config => {
/**
* 在这里做loading ...
* @type {string}
*/
if (config.shouldLoading) {
// 开启loading
// store.dispatch('loading/openLoading')
}
// 获取token
config.headers.common['Authorization'] = 'Bearer ' + Vue.ls.get("BOBLOG_ADMIN_TOKEN");
return config
}, error => {
return Promise.reject(error)
});
Util.ajax.interceptors.response.use(response => {
/**
* 在这里做loading 关闭
*/
// 如果后端有新的token则重新缓存
// let newToken = response.headers['new-token'];
//
// if (newToken) {
// Vue.ls.set("web-token", newToken);
// }
// 关闭loading
// closeLoading()
return response;
}, error => {
let response = error.response;
// 处理401错误
if (response.status == 401) {
Vue.ls.remove('BOBLOG_ADMIN_TOKEN');
window.location.href = '/login';
} else if (response.status == 403) {
// 处理403错误
} else if (response.status == 412) {
// 处理412错误
} else if (response.status == 413) {
// 处理413权限不足
}
// 关闭loading
closeLoading()
return Promise.reject(response)
});
export default {
post(url, params = {}) {
return Util.ajax({
method: 'post',
url: url,
data: qs.stringify(params),
timeout: 30000,
shouldLoading: params.shouldLoading === undefined ? true : params.shouldLoading,
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
})
},
get(url, params = {}) {
return Util.ajax({
method: 'get',
url: url,
params,
shouldLoading: params.shouldLoading === undefined ? true : params.shouldLoading,
})
},
delete(url, params = {}) {
return Util.ajax({
method: 'delete',
url: url,
params,
shouldLoading: params.shouldLoading === undefined ? true : params.shouldLoading,
})
},
put(url, params = {}) {
return Util.ajax({
method: 'put',
url: url,
data: qs.stringify(params),
shouldLoading: params.shouldLoading === undefined ? true : params.shouldLoading,
timeout: 30000,
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
})
}
}
/**
* 关闭loading
*/
function closeLoading() {
// 延迟100毫秒关闭
setTimeout(() => {
// 关闭loading
// store.dispatch('loading/closeLoading')
}, 100)
}
| 19.635659 | 88 | 0.596131 |
12ad964071620df0fb82cd177284e69e85be191c | 4,299 | js | JavaScript | app/containers/HeaderPage/index.js | hx6007/pic | eed77f32ff58da0ad36cc2a4c9232fb5b72c9c9e | [
"MIT"
] | null | null | null | app/containers/HeaderPage/index.js | hx6007/pic | eed77f32ff58da0ad36cc2a4c9232fb5b72c9c9e | [
"MIT"
] | null | null | null | app/containers/HeaderPage/index.js | hx6007/pic | eed77f32ff58da0ad36cc2a4c9232fb5b72c9c9e | [
"MIT"
] | null | null | null | /**
*
* HeaderPage
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
import styled from 'styled-components';
import { Link, Route } from 'react-router-dom';
import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer';
import { makeSelectLoginApp } from '../App/selectors';
import { showLoginForm, tlogout } from '../App/actions';
import makeSelectHeaderPage from './selectors';
import reducer from './reducer';
import saga from './saga';
import { FlexBody, HorizontalLayout, Layout } from '../../components/Layout/index';
import SearchBar from '../../components/SearchBar';
import Logo from '../../components/Logo';
import imgCode from './code.jpg';
import user from './user.png';
const Dive = styled.div `
display: flex;
min-width: 750px;
height: 80px;
border:1px solid transparent;
background: #fff;
box-shadow:0 0 6px 1px rgba(0,0,0,0.1);
`;
const SpanBox = styled(HorizontalLayout)`
position: relative;
`;
const MySpan = styled.span`
margin-right: 2em;
font-size: 13px;
font-family: MicrosoftYaHei;
color: rgba(21,21,21,1);
cursor: pointer;
@media (max-width: 1200px){
margin-right: 1em;
}
`;
const TinySpan = styled.span`
padding-left: 6px;
vertical-align: middle;
`;
const TinySpanA = styled(Link)`
font-size: 13px;
font-family: MicrosoftYaHei;
color: rgba(21,21,21,1);
cursor: pointer;
&:hover{
color: rgba(21,21,21,1);
}
`;
const Code = styled.img`
width: 154px;
height: 154px;
position: absolute;
left: -77px;
top: 23px;
z-index: 20;
box-shadow: 0px 0px 4px 0px rgba(170, 170, 170, 1);
padding: 10px;
background: #FFFFFF;
`;
const Span = styled.span`
margin-right: 15px;
`;
export class HeaderPage extends React.Component { // eslint-disable-line react/prefer-stateless-function
constructor() {
super();
this.state = {
shouldShowCode: false, // 显示二维码
shouldShowDiv: false, // 显示登录图层
};
}
changeVisibility(which, shouldShow) {
this.setState({
[which]: shouldShow,
});
}
changeVisibilityTwo() {
this.setState({
shouldShowDiv: !this.state.shouldShowDiv,
});
}
exit() {
this.props.dispatch(tlogout());
}
render() {
const { appData, dispatch, location } = this.props;
const showBtn = location.pathname !== '/';
return (
<Dive>
<FlexBody>
<HorizontalLayout margin="20px auto" >
{ showBtn && <Logo width="110px" /> }
{ showBtn && <Route component={SearchBar} /> }
<Layout flex="1" />
<SpanBox>
<MySpan
onMouseEnter={() => this.changeVisibility('shouldShowCode', true)}
onMouseLeave={() => this.changeVisibility('shouldShowCode', false)}
>
<TinySpan>小程序</TinySpan>
</MySpan>
<MySpan><TinySpanA to={'/tags'}>产品标签库</TinySpanA></MySpan>
<MySpan>
<img src={user} width="20px" alt="user" />
{ appData && appData.ttoken ? (<TinySpan>
<Span><TinySpanA to={'/user'}>{appData.tusername} </TinySpanA></Span><Span onClick={() => this.exit()}>退出</Span>
</TinySpan>) : <TinySpan onClick={() => dispatch(showLoginForm())}>登录</TinySpan>}
</MySpan>
{this.state.shouldShowCode && <Code src={imgCode} alt="icon" />}
</SpanBox>
</HorizontalLayout>
</FlexBody>
</Dive>
);
}
}
HeaderPage.propTypes = {
appData: PropTypes.any,
location: PropTypes.any,
// eslint-disable-next-line react/no-unused-prop-types
headerpage: PropTypes.any,
dispatch: PropTypes.func,
};
const mapStateToProps = createStructuredSelector({
appData: makeSelectLoginApp(),
headerpage: makeSelectHeaderPage(),
});
function mapDispatchToProps(dispatch) {
return {
dispatch,
};
}
const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withReducer = injectReducer({ key: 'headerPage', reducer });
const withSaga = injectSaga({ key: 'headerPage', saga });
export default compose(
withReducer,
withSaga,
withConnect,
)(HeaderPage);
| 26.537037 | 135 | 0.629681 |
12ae40c49784db184cdd91d59c9532ca1d2c2d8c | 2,201 | js | JavaScript | html/css/EjemploCss0006/web/lib/extjs/build/data/DirectProxy-min.js | iconojdiazch/accesibilidad | a542f480c1b3c6620ffc0aae28110cbd310e730c | [
"Apache-2.0"
] | null | null | null | html/css/EjemploCss0006/web/lib/extjs/build/data/DirectProxy-min.js | iconojdiazch/accesibilidad | a542f480c1b3c6620ffc0aae28110cbd310e730c | [
"Apache-2.0"
] | null | null | null | html/css/EjemploCss0006/web/lib/extjs/build/data/DirectProxy-min.js | iconojdiazch/accesibilidad | a542f480c1b3c6620ffc0aae28110cbd310e730c | [
"Apache-2.0"
] | null | null | null | /*
* Ext JS Library 3.0 RC2
* Copyright(c) 2006-2009, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.data.DirectProxy=function(config){Ext.apply(this,config);if(typeof this.paramOrder=='string'){this.paramOrder=this.paramOrder.split(/[\s,|]/);}
Ext.data.DirectProxy.superclass.constructor.call(this,config);};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(action,rs,params,reader,callback,scope,options){var args=[];var directFn=this.api[action]||this.directFn;switch(action){case Ext.data.Api.actions.create:args.push(params[reader.meta.root]);break;case Ext.data.Api.actions.read:if(this.paramOrder){for(var i=0,len=this.paramOrder.length;i<len;i++){args.push(params[this.paramOrder[i]]);}}else if(this.paramsAsHash){args.push(params);}
break;case Ext.data.Api.actions.update:args.push(params[reader.meta.idProperty]);args.push(params[reader.meta.root]);break;case Ext.data.Api.actions.destroy:args.push(params[reader.meta.root]);break;}
var trans={params:params||{},callback:callback,scope:scope,arg:options,reader:reader};args.push(this.createCallback(action,rs,trans),this);directFn.apply(window,args);},createCallback:function(action,rs,trans){return function(result,res){if(!res.status){if(action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,trans,res,null);}
this.fireEvent('exception',this,'remote',action,trans,res,null);trans.callback.call(trans.scope,null,trans.arg,false);return;}
if(action===Ext.data.Api.actions.read){this.onRead(action,trans,result,res);}else{this.onWrite(action,trans,result,res,rs);}}},onRead:function(action,trans,result,res){var records;try{records=trans.reader.readRecords(result);}
catch(ex){this.fireEvent("loadexception",this,trans,res,ex);this.fireEvent('exception',this,'response',action,trans,res,ex);trans.callback.call(trans.scope,null,trans.arg,false);return;}
this.fireEvent("load",this,res,trans.arg);trans.callback.call(trans.scope,records,trans.arg,true);},onWrite:function(action,trans,result,res,rs){this.fireEvent("write",this,action,result,res,rs,trans.arg);trans.callback.call(trans.scope,result,res,true);}}); | 129.470588 | 575 | 0.778737 |
12ae65abfaea09509261819c42e2f4b170828513 | 245 | js | JavaScript | packages/create-vite/template-vanilla/counter.js | HeyGarrison/vite | 9029d1a404919073e49e7231f9e693797488b166 | [
"MIT"
] | null | null | null | packages/create-vite/template-vanilla/counter.js | HeyGarrison/vite | 9029d1a404919073e49e7231f9e693797488b166 | [
"MIT"
] | 1 | 2022-03-07T04:19:56.000Z | 2022-03-07T04:19:56.000Z | packages/create-vite/template-vanilla/counter.js | TrickyPi/vite | eb47b1e2580cd6f8285dadba8f943e1b667ec390 | [
"MIT"
] | null | null | null | export function setupCounter(element) {
let counter = 0
const setCounter = (count) => {
counter = count
element.innerHTML = `count is ${counter}`
}
element.addEventListener('click', () => setCounter(++counter))
setCounter(0)
}
| 24.5 | 64 | 0.661224 |
12ae6a55603eca0e1591c0138ae6e38c4c174e5c | 936 | js | JavaScript | src/components/footer/Footer.js | anatolii331/thibmaek.github.io | e3a7827d48f2747aa0b246e78f8ffbeb282663cb | [
"MIT"
] | null | null | null | src/components/footer/Footer.js | anatolii331/thibmaek.github.io | e3a7827d48f2747aa0b246e78f8ffbeb282663cb | [
"MIT"
] | 4 | 2021-03-01T20:46:34.000Z | 2022-02-26T01:42:52.000Z | src/components/footer/Footer.js | anatolii331/thibmaek.github.io | e3a7827d48f2747aa0b246e78f8ffbeb282663cb | [
"MIT"
] | null | null | null | import React from 'react';
import { string, array } from 'prop-types';
import pickRandom from '../../lib/pickRandom';
import styles from './Footer.module.css';
const Footer = ({ author, oneliners }) => (
<footer className={styles.footer}>
<div>
<p>
Copyright <span aria-label='Copyright' role='img'>©</span> {new Date().getFullYear()} {author} All Rights Reserved.
</p>
<p>Made with {pickRandom(oneliners)}</p>
</div>
<a href='https://www.contentful.com/' rel='nofollow noopener noreferrer' target='_blank'>
<img
alt='Powered by Contentful'
className={styles.contentful}
src='https://images.contentful.com/fo9twyrwpveg/44baP9Gtm8qE2Umm8CQwQk/c43325463d1cb5db2ef97fca0788ea55/PoweredByContentful_LightBackground.svg'
/>
</a>
</footer>
);
Footer.propTypes = {
author: string.isRequired,
oneliners: array.isRequired,
};
export default Footer;
| 29.25 | 152 | 0.668803 |
12ae823bd8e5e15b6d1ad56f0ecf6e473c476975 | 1,945 | js | JavaScript | src/components/OrderFooter/OrderFooter.js | open-tender/open-tender-components-pos | 48428113e44ce665b3e98e141b4e0032402af0c5 | [
"MIT"
] | null | null | null | src/components/OrderFooter/OrderFooter.js | open-tender/open-tender-components-pos | 48428113e44ce665b3e98e141b4e0032402af0c5 | [
"MIT"
] | null | null | null | src/components/OrderFooter/OrderFooter.js | open-tender/open-tender-components-pos | 48428113e44ce665b3e98e141b4e0032402af0c5 | [
"MIT"
] | null | null | null | import React from 'react'
import propTypes from 'prop-types'
import styled from '@emotion/styled'
import { OrderButtons, OrderActions } from '.'
const OrderFooterContainer = styled('div')`
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem 0 1.5rem ${(props) => props.theme.layout.paddingSmall};
`
const OrderFooterLine = styled('div')`
position: absolute;
top: 0;
left: ${(props) => props.theme.layout.paddingSmall};
right: ${(props) => props.theme.layout.paddingSmall};
height: 0.1rem;
background-color: ${(props) => props.theme.colors.border};
`
const OrderFooter = ({
order,
doneOnPrint,
disableComplete,
hideDelay,
printReceipt,
printTickets,
updateOrder,
resetOrder,
delayOrder,
fireOrder,
style = null,
}) => {
return (
<>
<OrderFooterLine />
<OrderFooterContainer style={style}>
<OrderActions
order={order}
doneOnPrint={doneOnPrint}
disableComplete={disableComplete}
hideDelay={hideDelay}
updateOrder={updateOrder}
resetOrder={resetOrder}
delayOrder={delayOrder}
fireOrder={fireOrder}
/>
<OrderButtons
order={order}
doneOnPrint={doneOnPrint}
disableComplete={disableComplete}
printReceipt={printReceipt}
printTickets={printTickets}
updateOrder={updateOrder}
resetOrder={resetOrder}
/>
</OrderFooterContainer>
</>
)
}
OrderFooter.displayName = 'OrderFooter'
OrderFooter.propTypes = {
order: propTypes.object,
doneOnPrint: propTypes.bool,
disableComplete: propTypes.bool,
hideDelay: propTypes.bool,
printReceipt: propTypes.func,
printTickets: propTypes.func,
updateOrder: propTypes.func,
resetOrder: propTypes.func,
delayOrder: propTypes.func,
fireOrder: propTypes.func,
style: propTypes.object,
}
export default OrderFooter
| 24.620253 | 73 | 0.66581 |
12af3710de447ae553fb1692598ae6b2046f44b9 | 935 | js | JavaScript | src/client/createRoutes.js | jdart/fsImgur | f6c402682f48e785599001ffcfdaacf0cd5c5854 | [
"MIT"
] | null | null | null | src/client/createRoutes.js | jdart/fsImgur | f6c402682f48e785599001ffcfdaacf0cd5c5854 | [
"MIT"
] | null | null | null | src/client/createRoutes.js | jdart/fsImgur | f6c402682f48e785599001ffcfdaacf0cd5c5854 | [
"MIT"
] | null | null | null | import App from './app/App.react';
import NotFound from './notfound/Page.react';
import React from 'react';
import Home from './home/Home.react';
import Subreddit from './reader/Subreddit.react';
import User from './reader/User.react';
import Upvoted from './reader/Upvoted.react';
import Oauth from './auth/Oauth.react';
import {IndexRoute, Route} from 'react-router';
export default function createRoutes(getState) {
return (
<Route component={App} path="/">
<IndexRoute component={Home} />
<Route component={Oauth} path="r/oauth" />
<Route component={Subreddit} path="f/" />
<Route component={Subreddit} path="f/:sort" />
<Route component={Subreddit} path="r/:name" />
<Route component={Subreddit} path="r/:name/:sort" />
<Route component={User} path="u/:name" />
<Route component={Upvoted} path="upvoted" />
<Route component={NotFound} path="*" />
</Route>
);
}
| 33.392857 | 58 | 0.654545 |
12af6a499c93b43a13967be57b3e252e6fe76463 | 2,974 | js | JavaScript | src/components/fiq.js | MatieienkovMax/snp_matveenkov | 8ab83f076f823cfa86c3a3fef41184de9c44ec45 | [
"MIT"
] | null | null | null | src/components/fiq.js | MatieienkovMax/snp_matveenkov | 8ab83f076f823cfa86c3a3fef41184de9c44ec45 | [
"MIT"
] | null | null | null | src/components/fiq.js | MatieienkovMax/snp_matveenkov | 8ab83f076f823cfa86c3a3fef41184de9c44ec45 | [
"MIT"
] | null | null | null | import React from "react"
const Qestions = () => (
<>
<section className='qestions'>
<h3 className='qestions_title'>Часто задаваемые вопросы </h3>
<input type="checkbox"
name="rove"
id="qestions_one_bottum"
className='qestions_bottum'/>
<label for="qestions_one_bottum">
<h5 className="qvetion_title">
Сколько раз в день нужно заниматься?↓
</h5>
</label>
<div className='qestion_one_diskription' >
Один, два раза в день, желательно перед сном , до еды . Важна регулярность .
</div>
<input type="checkbox"
name="rove"
id="qestions_two_bottum"
className='qestions_bottum'/>
<label for="qestions_two_bottum">
<h5 className="qvetion_title">
Сколько минут можно "висеть" на тренажере? ↓
</h5>
</label>
<div className='qestion_two_diskription'>
Время и угол наклона мы рекомендуем выбирать по самочувствию, от 2х до 5 минут,
главное регулярность, После виса необходимо лечь на 30 мин,
а идеально делать растяжку перед сном .
</div>
<input type="checkbox"
name="rove"
id="qestions_tree_bottum"
className='qestions_bottum'/>
<label for="qestions_tree_bottum">
<h5 className="qvetion_title">
Есть ли гарантия на ваши товары? ↓
</h5>
</label>
<div className='qestion_tree_diskription'>
На металлический корпус инверсионного стола мы даем гарантию 3 года.
</div>
<input type="checkbox"
name="rove"
id="qestions_for_bottum"
className='qestions_bottum'/>
<label for="qestions_for_bottum">
<h5 className="qvetion_title">
Есть ли противопоказания для занятий ? ↓
</h5>
</label>
<div className='qestion_for_diskription'>
Да, есть:<br />
глаукома;<br />
гипертоническая болезнь 2 ст.;<br />
аритмия;<br />
аневризмы сосудов головного мозга;<br />
церебросклероз;<br />
хронические соединительнотканные заболевания;<br />
ИБС в приступном периоде;<br />
старческая деменция;<br />
вентральные грыжи;<br />
протезированные суставы;<br />
инвертофобии;<br />
отслоение сетчатки глаза;<br />
<br />
Перед использованием проконсультируйтесь со специалистом!
</div>
</section>
</>
)
export default Qestions; | 35.831325 | 92 | 0.511769 |
12b13ab29db29c5f31382fd4ecf0067aa29483f5 | 492 | js | JavaScript | server/src/middlewares/authentication/authMiddleware.js | el-Joft/Fast-Food-Fast | 5e9bc1093471893dec5c4ccf330a124e56d94348 | [
"MIT"
] | null | null | null | server/src/middlewares/authentication/authMiddleware.js | el-Joft/Fast-Food-Fast | 5e9bc1093471893dec5c4ccf330a124e56d94348 | [
"MIT"
] | 4 | 2018-09-28T10:56:21.000Z | 2018-09-28T23:14:31.000Z | server/src/middlewares/authentication/authMiddleware.js | el-Joft/Fast-Food-Fast | 5e9bc1093471893dec5c4ccf330a124e56d94348 | [
"MIT"
] | null | null | null | import jwt from 'jsonwebtoken';
import dotenv from 'dotenv';
dotenv.config();
export const ensureAutheticated = (req, res, next) => {
const token = req.body.token || req.headers.token || req.query.token;
try {
const verifiedToken = jwt.verify(token, process.env.secret);
req.userId = verifiedToken.id;
return next();
} catch (error) {
return res.status(403).json({
message: 'Unauthorized',
});
}
};
export const isAuthorize = (req, res, next) => next();
| 23.428571 | 71 | 0.650407 |
12b147c6a6fc0729b722acf898aeead36fd7e900 | 3,517 | js | JavaScript | lib/footer/src/footer.min.js | xiongqqjq/vxe-table-copy | fc0f37530a584a33cf39451b1831e8f2bca4f584 | [
"MIT"
] | null | null | null | lib/footer/src/footer.min.js | xiongqqjq/vxe-table-copy | fc0f37530a584a33cf39451b1831e8f2bca4f584 | [
"MIT"
] | null | null | null | lib/footer/src/footer.min.js | xiongqqjq/vxe-table-copy | fc0f37530a584a33cf39451b1831e8f2bca4f584 | [
"MIT"
] | null | null | null | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_tools=require("../../tools");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var _default={name:"VxeTableFooter",props:{footerData:Array,tableColumn:Array,visibleColumn:Array,fixedColumn:Array,size:String,fixedType:String},mounted:function(){var e=this.$parent,t=this.$el,l=this.$refs,o=this.fixedType,r=e.elemStore,n="".concat(o||"main","-footer-");r["".concat(n,"wrapper")]=t,r["".concat(n,"table")]=l.table,r["".concat(n,"colgroup")]=l.colgroup,r["".concat(n,"list")]=l.tfoot,r["".concat(n,"x-space")]=l.xSpace},render:function(x){var e=this._e,p=this.$parent,m=this.fixedType,t=this.fixedColumn,l=this.tableColumn,o=this.footerData,v=p.$listeners,r=p.footerRowClassName,b=p.footerCellClassName,n=p.scrollXLoad,h=p.columnKey,_=p.showOverflow,$=p.overflowX,y=p.getColumnIndex;return m&&_?l=t:n&&m&&(l=t),x("div",{class:["vxe-table--footer-wrapper",m?"fixed-".concat(m,"--wrapper"):"body--wrapper"],on:{scroll:this.scrollEvent}},[m?e():x("div",{class:"vxe-body--x-space",ref:"xSpace"}),x("table",{class:"vxe-table--footer",attrs:{cellspacing:0,cellpadding:0,border:0},ref:"table"},[x("colgroup",{ref:"colgroup"},l.map(function(e,t){return x("col",{attrs:{name:e.id},key:t})}).concat([x("col",{name:"col--gutter"})])),x("tfoot",{ref:"tfoot"},o.map(function(f,u){return x("tr",{class:["vxe-footer--row",r?_xeUtils.default.isFunction(r)?r({$rowIndex:u,fixed:m}):r:""]},l.map(function(t,l){var e,o=t.showOverflow,r=t.children&&t.children.length,n=m?t.fixed!==m&&!r:t.fixed&&$,i=_xeUtils.default.isUndefined(o)||_xeUtils.default.isNull(o)?_:o,c=!0===i||"tooltip"===i,a="title"===i||c||"ellipsis"===i,s={},d=y(t);return c&&(s.mouseover=function(e){p.triggerFooterTooltipEvent(e,{$table:p,$rowIndex:u,column:t,columnIndex:d,$columnIndex:l,fixed:m})},s.mouseout=function(e){p.clostTooltip()}),v["header-cell-click"]&&(s.click=function(e){_tools.UtilTools.emitEvent(p,"header-cell-click",[{$table:p,$rowIndex:u,column:t,columnIndex:d,$columnIndex:l,fixed:m,cell:e.currentTarget},e])}),v["header-cell-dblclick"]&&(s.dblclick=function(e){_tools.UtilTools.emitEvent(p,"header-cell-dblclick",[{$table:p,$rowIndex:u,column:t,columnIndex:d,$columnIndex:l,fixed:m,cell:e.currentTarget},e])}),x("td",{class:["vxe-footer--column",t.id,(e={},_defineProperty(e,"col--".concat(t.headerAlign),t.headerAlign),_defineProperty(e,"fixed--hidden",n),_defineProperty(e,"col--ellipsis",a),_defineProperty(e,"filter--active",t.filters.some(function(e){return e.checked})),e),b?_xeUtils.default.isFunction(b)?b({$rowIndex:u,column:t,columnIndex:d,$columnIndex:l,fixed:m}):b:""],attrs:{"data-colid":t.id},on:s,key:h?t.id:d},[x("div",{class:"vxe-cell"},_tools.UtilTools.formatText(f[p.tableColumn.indexOf(t)],1))])}).concat([x("td",{class:"col--gutter"})]))}))])])},methods:{scrollEvent:function(e){var t=this.$parent,l=this.fixedType,o=t.$refs,r=t.scrollXLoad,n=t.triggerScrollXEvent,i=t.lastScrollLeft,c=o.tableHeader,a=c?c.$el:null,s=o.tableBody.$el,d=o.tableFooter.$el.scrollLeft,f=d!==i;t.lastScrollLeft=d,t.lastScrollTime=Date.now(),a&&(a.scrollLeft=d),s&&(s.scrollLeft=d),r&&f&&n(e),_tools.UtilTools.emitEvent(t,"scroll",[{type:"footer",fixed:l,scrollTop:s.scrollTop,scrollLeft:d,isX:f,isY:!1,$table:t},e])}}};exports.default=_default; | 3,517 | 3,517 | 0.71851 |
12b228eb748aeda439bdc9b04e619cbdd61bc13d | 80 | js | JavaScript | node_modules/tinper-bee/lib/Upload/index.js | tinper-acs/ac-progress-bar | 37b3b760c46469a0d21499c337773266fc835fe9 | [
"MIT"
] | 604 | 2016-09-28T08:11:35.000Z | 2022-03-18T11:15:04.000Z | lib/Upload/index.js | iuap-design/neoui-react | 85fcee5dfaf442cd1ea4a3b3f0b734a2ce35aa5f | [
"MIT"
] | 662 | 2016-12-20T08:14:36.000Z | 2021-12-09T08:32:31.000Z | lib/Upload/index.js | iuap-design/neoui-react | 85fcee5dfaf442cd1ea4a3b3f0b734a2ce35aa5f | [
"MIT"
] | 78 | 2016-10-11T11:27:49.000Z | 2022-03-18T11:15:06.000Z | require('bee-upload/build/Upload.css');
module.exports = require('bee-upload');
| 26.666667 | 39 | 0.7375 |
12b355bbbb1d6708a549aa0e8d19712ea806738b | 2,336 | js | JavaScript | build/Gruntfile.js | noobiept/sc_guess_unit | 63194b856e7db9813a200f79fc3c28e1fa523a6c | [
"MIT"
] | null | null | null | build/Gruntfile.js | noobiept/sc_guess_unit | 63194b856e7db9813a200f79fc3c28e1fa523a6c | [
"MIT"
] | null | null | null | build/Gruntfile.js | noobiept/sc_guess_unit | 63194b856e7db9813a200f79fc3c28e1fa523a6c | [
"MIT"
] | null | null | null | module.exports = function( grunt )
{
var root = '../';
var dest = '../release/<%= pkg.name %> <%= pkg.version %>/';
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
// delete the destination folder
clean: {
options: {
force: true
},
release: [
dest
]
},
// compile to javascript
ts: {
release: {
src: [ root + 'scripts/*.ts' ],
dest: 'temp/code.js',
options: {
sourceMap: false
}
}
},
// copy the audio and libraries files
copy: {
release: {
expand: true,
cwd: root,
src: [
'audio/*.{mp3,ogg}',
'images/**',
'libraries/*.js',
'background.js',
'manifest.json'
],
dest: dest
}
},
uglify: {
release: {
files: [{
src: 'temp/code.js',
dest: dest + 'min.js'
}]
}
},
cssmin: {
release: {
files: [{
expand: true,
cwd: root,
src: 'style.css',
dest: dest
}]
},
options: {
advanced: false
}
},
processhtml: {
release: {
files: [{
expand: true,
cwd: root,
src: 'index.html',
dest: dest
}]
}
}
});
// load the plugins
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-processhtml' );
grunt.loadNpmTasks( 'grunt-ts' );
// tasks
grunt.registerTask( 'default', [ 'clean', 'ts', 'copy', 'uglify', 'cssmin', 'processhtml' ] );
};
| 25.391304 | 95 | 0.349315 |
12b39abc8238fe43b7148457a94bebd4beb56416 | 225 | js | JavaScript | juicebox/staging/q2d Solutions AB_1525256853/cms/.users.js | eclisauce/q2d-site | 04179c94652a9ce5fb5020bd54a2a4a25cbab8f5 | [
"MIT"
] | null | null | null | juicebox/staging/q2d Solutions AB_1525256853/cms/.users.js | eclisauce/q2d-site | 04179c94652a9ce5fb5020bd54a2a4a25cbab8f5 | [
"MIT"
] | null | null | null | juicebox/staging/q2d Solutions AB_1525256853/cms/.users.js | eclisauce/q2d-site | 04179c94652a9ce5fb5020bd54a2a4a25cbab8f5 | [
"MIT"
] | null | null | null | ({
users: [{
username: 'admin',
tags: [],
salt: 'bf62425eb119b87dccd58a4364b32bf2',
hash: '50ad736fc3743e4af4e8e40d0a8b1b10f6ff0bc7be42e0a0d0201b137e41e22e',
user_created_timestamp: 1523428793845
}]
}) | 25 | 77 | 0.715556 |
12b5067af6fa741ef200fcb301802974e5409e6e | 1,468 | js | JavaScript | gatsby/src/components/block-content/slideshow.js | rshurts/openwindow | 0eda05739a67e11a2117cbf2f3f276de0893e56f | [
"MIT"
] | null | null | null | gatsby/src/components/block-content/slideshow.js | rshurts/openwindow | 0eda05739a67e11a2117cbf2f3f276de0893e56f | [
"MIT"
] | null | null | null | gatsby/src/components/block-content/slideshow.js | rshurts/openwindow | 0eda05739a67e11a2117cbf2f3f276de0893e56f | [
"MIT"
] | null | null | null | import React, { useState } from 'react'
import { buildImageObj } from '../../lib/helpers'
import imageUrlFor from '../../lib/image-url'
import styles from './slideshow.module.css'
function Slideshow({ slides }) {
if (!slides) return null
const len = slides.length
const [index, setIndex] = useState(0)
function handlePrev() {
setIndex(Math.max(index - 1, 0))
}
function handleNext() {
setIndex(Math.min(index + 1, len - 1))
}
return (
<div className={styles.root}>
<div className={styles.nav}>
<button type="button" onClick={handlePrev} disabled={index === 0}>
Prev
</button>
<span>
{index + 1} of
{len}
</span>
<button type="button" onClick={handleNext} disabled={index === len - 1}>
Next
</button>
</div>
<ul
className={styles.carousel}
data-index={index}
style={{ transform: `translate3d(${index * -100}%, 0, 0)` }}
>
{slides.map(slide => (
<li key={slide._key} className={styles.slide}>
{slide.asset && (
<img
src={imageUrlFor(buildImageObj(slide))
.width(1200)
.height(Math.floor((9 / 16) * 1200))
.fit('crop')
.url()}
alt="Carousel"
/>
)}
</li>
))}
</ul>
</div>
)
}
export default Slideshow
| 26.214286 | 80 | 0.5 |
12b518514da6cb5c663a588d260ca25fcdda70fa | 1,353 | js | JavaScript | useConnect.js | MokiyCodes/electron-as-browser | 99c239f31c45b617e0f82dda73b92770ee914bec | [
"MIT"
] | null | null | null | useConnect.js | MokiyCodes/electron-as-browser | 99c239f31c45b617e0f82dda73b92770ee914bec | [
"MIT"
] | null | null | null | useConnect.js | MokiyCodes/electron-as-browser | 99c239f31c45b617e0f82dda73b92770ee914bec | [
"MIT"
] | null | null | null | const { ipcRenderer } = require("electron");
const { useEffect, useState } = require("react");
// Used in Renderer process
const noop = () => {};
/**
* A custom hook to create ipc connection between BrowserView and ControlView
*
* @param {object} options
* @param {function} options.onTabsUpdate - trigger after tabs updated(title, favicon, loading etc.)
* @param {function} options.onTabActive - trigger after active tab changed
*/
const useConnect = (options = {}) => {
const { onTabsUpdate = noop, onTabActive = noop } = options;
const [tabs, setTabs] = useState({});
const [tabIDs, setTabIDs] = useState([]);
const [activeID, setActiveID] = useState(null);
const channels = [
[
"tabs-update",
(e, v) => {
setTabIDs(v.tabs);
setTabs(v.confs);
onTabsUpdate(v);
},
],
[
"active-update",
(e, v) => {
setActiveID(v);
const activeTab = tabs[v] || {};
onTabActive(activeTab);
},
],
];
useEffect(() => {
ipcRenderer.send("control-ready");
channels.forEach(([name, listener]) => ipcRenderer.on(name, listener));
return () => {
channels.forEach(([name, listener]) =>
ipcRenderer.removeListener(name, listener)
);
};
}, []);
return { tabIDs, tabs, activeID };
};
module.exports = useConnect;
| 24.6 | 100 | 0.592018 |
12b520c563f52ebd35a72b284b5af042d4f4e782 | 3,139 | js | JavaScript | src/skills/ReturnPurpose/index.js | ticknical/munashiukun | c374b4d88bb73b023460254b8b4756ef6f2966c7 | [
"Apache-2.0"
] | null | null | null | src/skills/ReturnPurpose/index.js | ticknical/munashiukun | c374b4d88bb73b023460254b8b4756ef6f2966c7 | [
"Apache-2.0"
] | 226 | 2019-10-18T20:29:29.000Z | 2021-07-30T20:21:56.000Z | src/skills/ReturnPurpose/index.js | ticknical/munashiukun | c374b4d88bb73b023460254b8b4756ef6f2966c7 | [
"Apache-2.0"
] | null | null | null | "use strict";
import LINEBase from "../LINEBase"
import ChatWorkBase from "../ChatWorkBase"
import SlackBase from "../SlackBase"
const eol = require('eol')
/**
* 帰社日の目的のカンペ
* @type {String[]}
*/
const RETURN_PURPOSE = [
'【帰社日の目的】',
'今後も選ばれ続けるビジネスパーソンになるために',
'SESだし仕事なくなるよね'
]
/**
* 社名の由来のカンペ
* @type {String[]}
*/
const COMPANY_NAME_ORIGIN = [
'【社名の由来】',
'一燈照隅万燈照国 天台宗 最澄',
'一人ひとりが与えられた環境で役割を全うすることで組織は成り立っている'
]
/**
* 企業理念のカンペ
* @type {String[]}
*/
const CORPORATE_PHILOSOPHY = [
'【企業理念】',
'より遠くに向かって歩み始めるために歩み続けるために',
'長くエンジニアとして働いてもらうサポートをする会社',
]
/**
* 経営理念のカンペ
* @type {String[]}
*/
const MANAGEMENT_PHILOSOPHY = [
'【経営理念】',
'己を空しうする',
'目の前の人に全力で尽くす',
'☆他の人に奉仕しなさい(貢献をしなさい)'
]
/**
* 人材理念のカンペ
* @type {String[]}
*/
const HUMAN_RESOURCES_PHILOSOPHY = [
'【人材理念】',
'仁徳・義徳・礼徳',
'慈(いつく)しみの心をもって他人に無償で尽くしましょう',
'人を裏切らない',
'丁寧な言葉遣いを使うこと',
' 他の徳',
' ・智徳',
' 勉強しましょう',
' ・信徳',
' 人としての魅力',
' 他の徳を高めると信徳が高まる',
]
/**
* カンペの全体版を作る
* @return {String[]}
*/
const ALL = () => {
let all = []
Array.prototype.push.apply(all, RETURN_PURPOSE);
all.push('')
Array.prototype.push.apply(all, COMPANY_NAME_ORIGIN)
all.push('')
Array.prototype.push.apply(all, CORPORATE_PHILOSOPHY)
all.push('')
Array.prototype.push.apply(all, MANAGEMENT_PHILOSOPHY)
all.push('')
Array.prototype.push.apply(all, HUMAN_RESOURCES_PHILOSOPHY)
return all
}
/**
* 帰社日のカンペを出す
* @param {Base} BaseClass
* @return {ReturnPurpose}
*/
const ReturnPurpose = (BaseClass) => {
return class ReturnPurpose extends BaseClass {
execute()
{
if (this.intent.entities.length === 0) {
return this.replyMsg(ALL().join(eol.auto))
}
switch (this.intent.entities[0].entity.replace(/ /g, "")) {
case '帰社日の目的':
case '社内研修の目的':
return this.replyMsg(RETURN_PURPOSE.join(eol.auto))
break;
case '一燈の社名の由来':
case '社名の由来':
return this.replyMsg(COMPANY_NAME_ORIGIN.join(eol.auto))
break;
case '一燈の企業理念':
case '企業理念':
return this.replyMsg(CORPORATE_PHILOSOPHY.join(eol.auto))
break;
case '一燈の経営理念':
case '経営理念':
return this.replyMsg(MANAGEMENT_PHILOSOPHY.join(eol.auto))
break;
case '一燈の人材理念':
case '人材理念':
return this.replyMsg(HUMAN_RESOURCES_PHILOSOPHY.join(eol.auto))
break;
default:
return this.replyMsg('何が聞きたいのかはっきりしませんでした')
break;
}
}
}
}
/**
* LINE用の帰社日の目的スキル
*/
export class LINE extends ReturnPurpose(LINEBase)
{
}
/**
* ChatWork用の帰社日の目的スキル
*/
export class ChatWork extends ReturnPurpose(ChatWorkBase)
{
}
/**
* Slack用の帰社日の目的スキル
*/
export class Slack extends ReturnPurpose(SlackBase)
{
}
| 20.51634 | 83 | 0.553998 |
12b5276d96c4b6212e55c55ee4a3584bac7c6e9b | 3,195 | js | JavaScript | packages/ckeditor5-paste-from-office/tests/manual/integration.js | Joeycz/ckeditor5 | aa272552fa06e2320f8b7d3c4e0079b187260b36 | [
"MIT"
] | null | null | null | packages/ckeditor5-paste-from-office/tests/manual/integration.js | Joeycz/ckeditor5 | aa272552fa06e2320f8b7d3c4e0079b187260b36 | [
"MIT"
] | null | null | null | packages/ckeditor5-paste-from-office/tests/manual/integration.js | Joeycz/ckeditor5 | aa272552fa06e2320f8b7d3c4e0079b187260b36 | [
"MIT"
] | null | null | null | /**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* globals console, window, document */
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
import Table from '@ckeditor/ckeditor5-table/src/table';
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor';
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor';
import PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak';
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';
import PasteFromOffice from '../../src/pastefromoffice';
import { stringify as stringifyView } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
const htmlDiv = document.querySelector( '#html' );
const textDiv = document.querySelector( '#text' );
const dataDiv = document.querySelector( '#data' );
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [
ArticlePluginSet,
Strikethrough,
Underline,
Table,
TableToolbar,
PageBreak,
TableProperties,
TableCellProperties,
ImageUpload,
CloudServices,
EasyImage,
PasteFromOffice,
FontColor,
FontBackgroundColor
],
toolbar: [ 'heading', '|', 'bold', 'italic', 'strikethrough', 'underline', 'link',
'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'pageBreak', 'undo', 'redo' ],
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
const clipboard = editor.plugins.get( 'Clipboard' );
editor.editing.view.document.on( 'paste', ( evt, data ) => {
console.clear();
console.log( '----- paste -----' );
console.log( data );
console.log( 'text/html\n', data.dataTransfer.getData( 'text/html' ) );
console.log( 'text/plain\n', data.dataTransfer.getData( 'text/plain' ) );
htmlDiv.innerText = data.dataTransfer.getData( 'text/html' );
textDiv.innerText = data.dataTransfer.getData( 'text/plain' );
} );
clipboard.on( 'inputTransformation', ( evt, data ) => {
console.log( '----- clipboardInput -----' );
console.log( 'stringify( data.dataTransfer )\n', stringifyView( data.content ) );
dataDiv.innerText = stringifyView( data.content );
} );
} )
.catch( err => {
console.error( err.stack );
} );
| 37.151163 | 109 | 0.726135 |
12b5d46d3964b593495741cad28948f9205fa087 | 581 | js | JavaScript | examples/cra-kitchen-sink/.storybook/main.js | micros123/storybook | a51ebffdc897026d93caf04dadf8247c837c7680 | [
"MIT"
] | 3 | 2020-01-31T18:18:23.000Z | 2020-02-03T18:44:58.000Z | examples/cra-kitchen-sink/.storybook/main.js | micros123/storybook | a51ebffdc897026d93caf04dadf8247c837c7680 | [
"MIT"
] | null | null | null | examples/cra-kitchen-sink/.storybook/main.js | micros123/storybook | a51ebffdc897026d93caf04dadf8247c837c7680 | [
"MIT"
] | 1 | 2021-03-10T04:04:44.000Z | 2021-03-10T04:04:44.000Z | module.exports = {
presets: [
{
name: '@storybook/addon-docs/preset',
options: {
configureJSX: true,
},
},
],
addons: [
'@storybook/addon-actions/register',
'@storybook/addon-links/register',
'@storybook/addon-events/register',
'@storybook/addon-notes/register',
'@storybook/addon-options/register',
'@storybook/addon-knobs/register',
'@storybook/addon-backgrounds/register',
'@storybook/addon-a11y/register',
'@storybook/addon-jest/register',
],
stories: ['../src/stories/**/*.stories.(js|mdx)'],
};
| 25.26087 | 52 | 0.616179 |
12b5e71045263f282c71ab82ddc4a622c38f8730 | 119,680 | js | JavaScript | static/js/dashboard.js | Stanford-PERTS/yellowstone | d4b759c4640caccefb222fbd82df8a4405cc5548 | [
"CC0-1.0"
] | null | null | null | static/js/dashboard.js | Stanford-PERTS/yellowstone | d4b759c4640caccefb222fbd82df8a4405cc5548 | [
"CC0-1.0"
] | null | null | null | static/js/dashboard.js | Stanford-PERTS/yellowstone | d4b759c4640caccefb222fbd82df8a4405cc5548 | [
"CC0-1.0"
] | null | null | null | // Contains defintions for all the widgets (angular directives) that drive
// the dashboard.
var relationshipListNames = [
'owned_program_list',
'assc_program_list',
'owned_school_list',
'assc_school_list',
'owned_cohort_list',
'assc_cohort_list',
'owned_classroom_list',
'assc_classroom_list'
];
// x = 1, y = 5, returns '20%'
// x = 1, y = 0, returns '--'
function getPercentString(x, y, divideByZeroValue) {
'use strict';
if (divideByZeroValue === undefined) { divideByZeroValue = '--'; }
return y > 0 ? Math.round(x / y * 100) + '%' : divideByZeroValue;
}
function tableCellToValue(td) {
'use strict';
// We want to output a string in every case such that it is both
// sortable and searchable.
var value;
var selectResult = $('select', td);
var datepickrResult = $('input[class*="datepickr"]', td);
var textInputResult = $('input[type="text"]', td);
// Does this column contain a <select>? If so, sort on its displayed text,
// not the text of all its contents/children, and not its values.
if (selectResult.length > 0) {
value = $('option:selected', selectResult).text();
}
// Does this column contain a datepickr calendar? If so, sort on
// its value.
else if (datepickrResult.length > 0) {
var date = datepickrResult.get(0)._currentValue;
// ISO strings are good because they are correctly sortabe as-is. Also
// allow for dates not being defined yet.
value = date ? date.toISOString() : '';
}
// Does this column contain a text box? Sort on its value.
else if (textInputResult.length > 0) {
value = textInputResult.val();
}
// Otherwise just look at the text in the <td>
else {
value = $(td).text();
}
return value.toLowerCase();
}
function sortByFactory(scope, tableNode, tbodyOrTr) {
'use strict';
return function (col) {
// Only provide sorting on columns marked sortable.
if (!scope.columns[col].sortable) { return; }
var rowQuery, parentQuery;
if (tbodyOrTr === 'tr') {
// This means treat <tr>s as rows, for tables with one <tbody>
rowQuery = $.partial('tbody tr', tableNode);
parentQuery = $.partial('tbody', tableNode);
} else if (tbodyOrTr === 'tbody') {
// The other value, 'tbody', means treat <tbody>s as rows, for tables
// with many <tbody>s.
rowQuery = $.partial('tbody', tableNode);
parentQuery = $.partial(tableNode);
}
if (scope.reverseSort === undefined) {
scope.reverseSort = false;
}
if (scope.sortedColumn === col) {
scope.reverseSort = !scope.reverseSort;
}
var rows = rowQuery().get();
// The stability of javascript sorting is implementation-depedendent.
// http://blog.8thlight.com/will-warner/2013/03/26/stable-sorting-in-ruby.html
// http://stackoverflow.com/questions/3026281/array-sort-sorting-stability-in-different-browsers
// We can ensure stable sorting by sorting otherwise-equal elements
// by their original position in the list. So determine those original
// positions here.
forEach(rows, function (r, position) {
r._originalPosition = position;
});
rows.sort(function (a, b) {
// Include the :visible selector b/c sometimes I have tables doing
// tricky games where they have cells that are hidden in certain
// modes and visible in other modes. We want to pretend like the
// invisible cells aren't there otherwise counting columns from
// the left via col will be wrong.
var tdA = $(a).find('td:visible').eq(col);
var tdB = $(b).find('td:visible').eq(col);
var A = tableCellToValue(tdA);
var B = tableCellToValue(tdB);
// Are A and B numeric? If so, compare them as numbers, b/c
// '10' > '100', but 100 > 10.
if (util.isStringNumeric(A, 'strict') && util.isStringNumeric(B, 'strict')) {
A = Number(A);
B = Number(B);
}
var direction = scope.reverseSort ? -1 : 1;
if (A < B) { return direction * -1; }
if (A > B) { return direction; }
// These elements appear equal. To ensure stable sorting, sort by
// their original position before the sort started.
return (a._originalPosition - b._originalPosition) * direction;
});
// var x = 0;
forEach(rows, function (row) {
parentQuery().append(row);
// x++;
});
scope.sortedColumn = col;
};
}
function watchFilter(scope, element) {
'use strict';
// Whenever the user focuses on the search box to begin filtering the
// table, update the string representation of the row. We'll search on
// this string.
scope.$on('/dashboardTable/filterFocus', function (event) {
var valueArr = [];
$('td', element).each(function (index, td) {
valueArr.push(tableCellToValue(td));
});
scope.stringRepresentation = valueArr.join(' ');
});
scope.$watch('filterText', function (filterText) {
if (typeof filterText !== 'string') { return; }
filterText = filterText.toLowerCase();
if (
['', undefined, null].contains(filterText) ||
scope.stringRepresentation.contains(filterText)
) {
element.removeClass('ng-hide');
} else {
element.addClass('ng-hide');
}
});
}
function sortIconClassFactory($scope) {
'use strict';
return function (col) {
// Only provide sorting icons on columns marked sortable.
if (!$scope.columns[col].sortable) { return; }
var out = ['clickable_cursor'];
if ($scope.sortedColumn === col) {
if ($scope.reverseSort) {
out.push('reverse-sort');
} else {
out.push('normal-sort');
}
}
return out.join(' ');
};
}
function getAllReferencedIds(user, $window) {
'use strict';
var entityIds = [];
forEach($window.relationshipListNames, function (listName) {
entityIds = entityIds.concat(user[listName]);
});
// eliminate duplicates and remove falsy values
return util.arrayUnique(entityIds).filter(function (v) {
return Boolean(v);
});
}
function getInterpretedStatus(activity, forcedStatus) {
'use strict';
if (!activity) { return; }
// @todo:
// If multi-day activity:
// interpreted status = status
var today = new Date();
var scheduled_date;
if (!activity.scheduled_date) {
scheduled_date = false;
} else {
scheduled_date = Date.createFromString(activity.scheduled_date, 'local');
}
// Default to the activity's status, unless it was overwritten by the
// optional forcedStatus argument.
var status = forcedStatus ? forcedStatus : activity.status;
var interpretedStatus;
if (status === 'completed' || status === 'aborted') {
interpretedStatus = activity.status;
} else if (!scheduled_date) {
interpretedStatus = 'unscheduled';
} else if (Date.dayDifference(today, scheduled_date) > 3) {
interpretedStatus = 'behind';
} else {
interpretedStatus = 'scheduled';
}
return interpretedStatus;
}
function DashboardController($scope, $routeParams, $emptyPromise, $location, $window, $getStore) {
'use strict';
$scope.$root.userType = $window.userType;
$scope.$root.userId = $window.userId;
$scope.$root.programOutlines = [];
$scope.breadcrumbs = [];
if ($routeParams.level && $routeParams.entityId && $routeParams.page) {
$scope.$root.level = $routeParams.level;
$scope.$root.entityId = $routeParams.entityId;
$scope.$root.page = $routeParams.page;
} else { // The hash isn't right, or the user has just arrived and has none
// Signals certain widgets to redirect to more specific realms if they
// are only showing one thing.
$scope.$root.redirecting = true;
$location.path('/programs/all/program_progress');
return;
}
$scope.$root.levelLables = {
'programs': 'Global level',
'program': 'Study level',
'cohort': 'School level',
'classroom': 'Classroom level'
};
$scope.$root.programs = {id: 'all', name: 'Dashboard Home'};
if (['programs'].contains($routeParams.level)) {
// There's no entity to load, just provide a stub that fills in
// appropriate text to display
$scope.$root.user = $getStore.get($scope.$root.userId);
$scope.$root.currentEntity = $scope.$root[$routeParams.level];
} else {
// There is an entity providing context for this view; load it and its
// parents
$getStore.load([$scope.$root.userId, $scope.$root.entityId]);
$scope.$root.user = $getStore.get($scope.$root.userId);
$scope.$root.currentEntity = $getStore.get($scope.$root.entityId);
}
var programId, schoolId, cohortId;
var contextLoaded; // a promise to attach breadcrumb definition to
$scope.$watch('currentEntity', function (value) {
if (value.name !== undefined) {
// then the current entity has been loaded, and we can look at it...
if ($scope.$root.level === 'program') {
$scope.$root.program = $scope.$root.currentEntity;
if ($scope.$root.page === 'cohort_progress') {
$scope.$root.programList = [$scope.$root.program];
}
} else if ($scope.$root.level === 'cohort') {
$scope.$root.cohort = $scope.$root.currentEntity;
programId = $scope.$root.cohort.assc_program_list[0];
schoolId = $scope.$root.cohort.assc_school_list[0];
contextLoaded = $getStore.load([programId, schoolId]);
$scope.$root.program = $getStore.get(programId);
$scope.$root.school = $getStore.get(schoolId);
} else if ($scope.$root.level === 'classroom') {
$scope.$root.classroom = $scope.$root.currentEntity;
// schoolId = $scope.classroom.assc_school_list[0];
programId = $scope.classroom.assc_program_list[0];
cohortId = $scope.classroom.assc_cohort_list[0];
// contextLoaded = $getStore.load([schoolId, programId, cohortId]);
contextLoaded = $getStore.load([programId, cohortId]);
$scope.$root.cohort = $getStore.get(cohortId);
$scope.$root.program = $getStore.get(programId);
$scope.$root.school = $getStore.get(schoolId);
}
if (contextLoaded === undefined) {
contextLoaded = $emptyPromise();
}
contextLoaded.then(function () {
$scope.generateBreadcrumbs();
});
}
}, true); // true here means watch object value, not object reference
// (the entity store is specifically designed NOT to change object
// references)
// Configure navigation tabs
var tabConfig = {
programs: [
{id: 'program_progress', name: 'Tracking'}
],
program: [
{id: 'cohort_progress', name: 'Tracking'},
{id: 'educators', name: 'All Coordinators'}
],
cohort: [
{id: 'classroom_progress', name: 'Schedule'},
{id: 'roster', name: 'School Roster'},
{id: 'makeups', name: 'School Make-Ups'},
{id: 'educators', name: 'School Coordinators'},
{id: 'detail', name: 'Edit School Details'}
],
classroom: [
{id: 'roster', name: 'Classroom Roster'},
{id: 'makeups', name: 'Classroom Make-Ups'},
{id: 'detail', name: 'Edit Classroom Details'}
]
};
$scope.tabs = tabConfig[$scope.$root.level];
$scope.tabClass = function (tabId) {
return tabId === $scope.$root.page ? 'active' : '';
};
$scope.generateBreadcrumbs = function () {
var parents;
/*jshint ignore:start*/
switch ($scope.$root.level) {
case 'schools': parents = []; break;
case 'educators': parents = []; break;
case 'programs': parents = []; break;
case 'program': parents = [];
if ($scope.$root.userType === 'god') {
parents.unshift('programs');
}
break;
case 'cohort': parents = ['program'];
if ($scope.$root.userType === 'god') {
parents.unshift('programs');
}
break;
case 'classroom': parents = ['program', 'cohort'];
if ($scope.$root.userType === 'god') {
parents.unshift('programs');
}
break;
}
/*jshint ignore:end*/
var b = [];
if (parents === undefined) {
return {};
} else if (parents.length > 0) {
b = forEach(parents, function (lvl) {
if ($scope.$root[lvl]) {
return {
link: '/' + lvl +
'/' + $scope[lvl].id +
'/' + tabConfig[lvl][0].id,
name: $scope[lvl].name
};
}
});
}
b.push({name: $scope.$root.currentEntity.name});
$scope.breadcrumbs = b;
};
// The detail page changes template based on the level
$scope.detailTemplateUrl = '/static/dashboard_pages/' + $scope.$root.level + '_detail.html';
// b/c our current version of angular doesn't support dynamic templates,
// this is a little hack to change up the template based on the route.
// @todo: fix this when >= 1.1.2 becomes stable.
$scope.templateUrl = '/static/dashboard_pages/' + $scope.$root.page + '.html';
}
// ************************* //
// ******** WIDGETS ******** //
// ************************* //
PertsApp.directive('programAdmins', function () {
'use strict';
return {
scope: {
programId: '@programId'
},
controller: function ($scope, $seeStore, $getStore, $pertsAjax) {
$scope.$watch('programId', function (value) {
if (value) {
$scope.program = $getStore.get(value);
$scope.getAssociatedUsers();
}
});
$scope.getAssociatedUsers = function () {
// to display admins, we need to see all associated users
$pertsAjax({
url: '/api/see/user',
params: {
user_type: 'school_admin',
assc_program_list: $scope.program.id
}
}).then(function (response) {
$scope.adminList = forEach(response, function (admin) {
return $seeStore.set(admin);
});
});
};
},
templateUrl: '/static/dashboard_widgets/program_admins.html'
};
});
PertsApp.directive('programProgressList', function () {
'use strict';
return {
scope: {},
controller: function ($scope, $getStore, $pertsAjax, $location) {
// We'll need all the user's programs
$pertsAjax({url: '/api/get/program'}).then(function (response) {
$scope.programList = $getStore.setList(response);
var programIds = forEach($scope.programList, function (program) {
return program.id;
});
if ($scope.$root.redirecting) {
if ($scope.programList.length === 1) {
$location.path('/program/' + $scope.programList[0].id +
'/cohort_progress');
return;
} else {
// this is the right place to be; stop redirection
$scope.$root.redirecting = false;
}
}
// ... and all the cohorts associated with those programs.
$pertsAjax({
url: '/api/get/cohort',
params: {assc_program_list_json: programIds}
}).then(function (response) {
$scope.cohortList = $getStore.setList(response);
// Index the cohorts by program so they can be passed to
// the correct child.
$scope.cohortIndex = {};
forEach($scope.cohortList, function (cohort) {
var programId = cohort.assc_program_list[0];
util.initProp($scope.cohortIndex, programId, []);
$scope.cohortIndex[programId].push(cohort.id);
});
});
});
},
templateUrl: '/static/dashboard_widgets/program_progress_list.html'
};
});
PertsApp.directive('programProgress', function () {
'use strict';
var scope = {
programId: '@programId',
cohortIds: '@cohortIds'
};
var controller = function ($scope, $getStore, $pertsAjax, $window) {
$scope.$watch('programId', function (value) {
$scope.program = $getStore.get(value);
$scope.outline = $window.programInfo[$scope.program.id];
});
$scope.$watch('cohortIds', function (cohortIds) {
if (cohortIds) {
$scope.buildRows($scope.outline.student_outline);
}
});
$scope.buildRows = function (studentOutline) {
$scope.rows = [];
forEach(studentOutline, function (module) {
if (module.type === 'activity') {
$scope.rows.push({
cohortIds: $scope.cohortIds,
activityOrdinal: module.activity_ordinal,
name: module.name
});
}
});
};
$scope.columns = [
{name: "School", tooltip: "School name",
colClass: 'name', sortable: true}, // really a cohort name
{name: "#", tooltip: "Session number",
colClass: 'session', sortable: true},
// <classroom session status>
{name: "Unschd", tooltip: "Unscheduled: number of classrooms who haven't set a date for their session.",
colClass: 'unscheduled', sortable: true},
{name: "Bhnd", tooltip: "Behind: number of classrooms behind schedule.",
colClass: 'behind', sortable: true},
{name: "Schd/ Compl", tooltip: "Scheduled/Completed: Number of classrooms on track.",
colClass: 'scheduled_completed', sortable: true},
{name: "Total", tooltip: "Total number of classrooms.",
colClass: 'total', sortable: true},
// </classroom session status>
// <certified study eligible students>
{name: "Total", colClass: 'study_eligible', sortable: true,
tooltip: "All certified, study eligible students."},
{name: "Cmpl", colClass: 'completed', sortable: true,
tooltip: "Complete: students who have completed the session, as a percent of study eligible students."},
{name: "Makeup Inelg", colClass: 'makeup_ineligible', sortable: true,
tooltip: "Makeup Ineligible: students who may NOT participate in a make up session."},
{name: "Makeup Elg", colClass: 'makeup_eligible', sortable: true,
tooltip: "Makeup Eligible: students who MAY participate in a make up session."},
{name: "Not Coded", colClass: 'uncoded', sortable: true,
tooltip: "Students who should either 1) complete the session " +
"or 2) be given a code explaining why they haven't."}
// </certified study eligible students>
];
// Put in a kinda-crappy replacement of an input placeholder for
// browsers which don't support placeholders.
// The timeout lets us escape angular's digest loop, so setting
// the value of the input *won't* be recognized as an actual
// attempt to search, which is what we want.
if (!util.weHas.placeholder()) {
setTimeout(function () {
$('.dashboard-table-controls [placeholder]').val('Search...');
}, 1);
}
};
return {
scope: scope,
controller: controller,
link: function (scope, element, attrs) {
// running sortBy sets scope.reverseSort and scope.sortedColumn
scope.sortBy = sortByFactory(scope, element, 'tr');
scope.sortIconClass = sortIconClassFactory(scope);
},
templateUrl: '/static/dashboard_widgets/program_progress.html'
};
});
PertsApp.directive('cohortEntry', function () {
'use strict';
return {
scope: {
cohortId: '@cohortId'
},
controller: function ($scope, $getStore, $window) {
$scope.$watch('cohortId', function (value) {
$scope.cohort = $getStore.get(value);
// @todo: there's a lot of things we could try to load if we
// wanted, because there's a lot of widgets nested under here.
});
$scope.userType = $window.userType;
$scope.show = function () {
return $scope.$root.level === 'cohort' ||
$scope.$root.level === 'classroom';
};
},
templateUrl: '/static/dashboard_widgets/cohort_entry.html'
};
});
PertsApp.directive('cohortBasics', function () {
'use strict';
return {
scope: {
cohortId: '@cohortId'
},
controller: function ($scope, $getStore, $pertsAjax, $location) {
$scope.$watch('cohortId', function (value) {
$scope.cohort = $getStore.get(value);
});
$scope.$watch('cohort.assc_school_list', function () {
if (!$scope.cohort.assc_school_list) { return; }
$scope.school = $getStore.get($scope.cohort.assc_school_list[0]);
});
$scope.show = function () {
return $scope.$root.level === 'program' ||
$scope.$root.level === 'cohort' ||
$scope.$root.level === 'classroom';
};
$scope.deleteCohort = function (cohort) {
if (confirm("Are you sure you want to delete " + cohort.name + "?")) {
var url = '/api/delete/cohort/' + cohort.id;
$pertsAjax({url: url}).then(function () {
$location.path('/');
});
}
};
},
templateUrl: '/static/dashboard_widgets/cohort_basics.html'
};
});
PertsApp.directive('cohortAdmins', function () {
'use strict';
return {
scope: {
cohortId: '@cohortId'
},
controller: function ($scope, $getStore, $pertsAjax) {
$scope.$watch('cohortId', function (value) {
if (value) {
$scope.cohort = $getStore.get(value);
$scope.getAssociatedUsers();
}
});
$scope.getAssociatedUsers = function () {
// to display admins, we need to see all associated users
$pertsAjax({
url: '/api/get/user',
params: {
user_type: 'school_admin',
owned_cohort_list: $scope.cohort.id
}
}).then(function (response) {
$scope.adminList = forEach(response, function (admin) {
return $getStore.set(admin);
});
});
};
$scope.noAdmins = function () {
// to display admins, we need to see all associated users
if ($scope.adminList) {
return $scope.adminList.length === 0;
}
};
},
templateUrl: '/static/dashboard_widgets/cohort_admins.html'
};
});
// Displays statistics broken down by cohort for all the cohorts in a program.
// Calls aggregateCohortProgress for each item in the list.
PertsApp.directive('cohortProgressList', function () {
'use strict';
var controller = function ($scope, $getStore, $pertsAjax, $location, $window) {
$scope.identificationType = 'default';
// get all the cohorts visible to the user in this program
$pertsAjax({
url: '/api/get/cohort',
params: {
assc_program_list: $scope.$root.currentEntity.id,
order: 'name'
}
}).then(function (response) {
$scope.cohortList = $getStore.setList(response);
// Figure out if we should automatically redirect elsewhere
// because the user doesn't have any choices at this level.
if ($scope.$root.redirecting && $scope.$root.level === 'program') {
if ($scope.cohortList.length === 1) {
$location.path('/cohort/' + $scope.cohortList[0].id +
'/classroom_progress');
return;
} else {
// this is the right place to be; stop redirection
$scope.$root.redirecting = false;
}
}
// If we're not redirecting, use the program outline to figure
// out how to organize the cohorts' aggregated data by
// activity.
$scope.buildRows();
});
// Put in a kinda-crappy replacement of an input placeholder for
// browsers which don't support placeholders.
// The timeout lets us escape angular's digest loop, so setting
// the value of the input *won't* be recognized as an actual
// attempt to search, which is what we want.
if (!util.weHas.placeholder()) {
setTimeout(function () {
$('.dashboard-table-controls [placeholder]').val('Search...');
}, 1);
}
$scope.buildRows = function () {
var studentOutline = $window.programInfo[$scope.$root.program.id].student_outline;
$scope.rows = [];
$scope.sessions = [];
forEach($scope.cohortList, function (cohort) {
forEach(studentOutline, function (module) {
if (module.type === 'activity') {
$scope.rows.push({
cohortIds: [cohort.id],
activityOrdinal: module.activity_ordinal,
name: module.name
});
if (!$scope.sessions.contains(module)) {
$scope.sessions.push(module);
}
}
});
});
};
$scope.createSchool = function () {
return $pertsAjax({
url: '/api/put/school',
params: {name: $scope.schoolName}
});
};
$scope.createCohort = function (school) {
return $pertsAjax({
url: '/api/put/cohort',
params: {
name: $scope.schoolName,
program: $scope.$root.program.id,
school: school.id,
identification_type: $scope.identificationType
}
});
};
$scope.addSchool = function () {
$scope.createSchool()
.then($scope.createCohort)
.then(function (cohort) {
cohort = $getStore.set(cohort);
// Add the cohort to the table's list and rebuild it so the
// new cohort is displayed.
$scope.cohortList.push(cohort);
$scope.buildRows();
// Clear the school name input box.
$scope.schoolName = '';
});
};
$scope.columns = [
{name: "School", tooltip: "School name",
colClass: 'name', sortable: true}, // really a cohort name
{name: "#", tooltip: "Session number",
colClass: 'session', sortable: true},
// <classroom session status>
{name: "Unschd", tooltip: "Unscheduled: number of classrooms who haven't set a date for their session.",
colClass: 'unscheduled', sortable: true},
{name: "Bhnd", tooltip: "Behind: number of classrooms behind schedule.",
colClass: 'behind', sortable: true},
{name: "Schd/ Compl", tooltip: "Scheduled/Completed: Number of classrooms on track.",
colClass: 'scheduled_completed', sortable: true},
{name: "Total", tooltip: "Total number of classrooms.",
colClass: 'total', sortable: true},
// </classroom session status>
// <certified study eligible students>
{name: "Total", colClass: 'study_eligible', sortable: true,
tooltip: "All study eligible students."},
{name: "Cmpl", colClass: 'completed', sortable: true,
tooltip: "Complete: students who have completed the session, as a percent of study eligible students."},
{name: "Makeup Inelg", colClass: 'makeup_ineligible', sortable: true,
tooltip: "Makeup Ineligible: students who may NOT participate in a make up session."},
{name: "Makeup Elg", colClass: 'makeup_eligible', sortable: true,
tooltip: "Makeup Eligible: students who MAY participate in a make up session."},
{name: "Not Coded", colClass: 'uncoded', sortable: true,
tooltip: "Students who should either 1) complete the session " +
"or 2) be given a code explaining why they haven't."}
// </certified study eligible students>
];
};
return {
scope: {},
link: function (scope, element, attrs) {
// running sortBy sets scope.reverseSort and scope.sortedColumn
scope.sortBy = sortByFactory(scope, element, 'tr');
scope.sortIconClass = sortIconClassFactory(scope);
},
controller: controller,
templateUrl: '/static/dashboard_widgets/cohort_progress_list.html'
};
});
// Displays statistics of *one or more* cohorts, broken down by activity
// ordinal. Used in two dashboard views: program_progress and cohort_progress.
PertsApp.directive('aggregateCohortProgress', function () {
'use strict';
return {
scope: {
showCohortColumn: '@showCohortColumn',
cohortIds: '@cohortIds',
activityOrdinal: '@activityOrdinal',
name: '@name',
sessions: '=',
filterText: '='
},
controller: function ($scope, $getStore, $window) {
$scope.data = {all: {}, certified: {}};
$scope.$watch('cohortIds', function (value) {
if (value) {
value = $scope.$eval(value);
$scope.cohortList = $getStore.getList(value);
}
});
$scope.$watch('cohortList', function () {
var allLoaded = true;
forEach($scope.cohortList, function (cohort) {
if (!cohort.name) {
allLoaded = false;
}
});
if (allLoaded) {
$scope.aggregate();
}
}, true);
// Each cohort has aggregation data. But this widget/directive
// represents one activity ordinal out of a set of cohorts. That
// means we need to summarize subsets of the available aggregation
// data.
$scope.aggregate = function () {
// This will be the new summary
var data;
forEach($scope.cohortList, function (cohort) {
// Extract data relevant to just one activity ordinal.
var cData = cohort._aggregation_data[$scope.activityOrdinal] ||
$window.cohortAggregationDataTemplate;
// If the widget's data is currently blank, initialize it
// with whatever this current cohort has got. Otherwise,
// go through it and increment each stat.
if (data === undefined) {
data = angular.copy(cData);
} else {
forEach(cData, function (key1, value1) {
if (typeof value1 === 'number') {
data[key1] += value1;
} else {
forEach(value1, function (key2, value2) {
data[key1][key2] += value2;
});
}
});
}
});
// Now that the (potentially) multiple cohorts have been
// aggregated, calculate the stats users actually want to see.
$scope.unscheduled = data.unscheduled;
$scope.behind = data.behind;
$scope.scheduledCompleted = data.scheduled + data.completed;
$scope.totalClassrooms = data.unscheduled + data.behind +
data.completed + data.scheduled;
$scope.incompleteRosters = data.incomplete_rosters;
$scope.uncertified = data.total_students - data.certified_students;
$scope.studyEligible = data.certified_study_eligible_dict.n;
$scope.completed = data.certified_study_eligible_dict.completed;
$scope.pctCompleted = getPercentString(
$scope.completed, $scope.studyEligible);
$scope.makeupIneligible = data.certified_study_eligible_dict.makeup_ineligible;
$scope.makeupEligible = data.certified_study_eligible_dict.makeup_eligible;
$scope.uncoded = data.certified_study_eligible_dict.uncoded;
};
$scope.pctStartedCompleted = function () {
if (!$scope.data) { return; }
return getPercentString($scope.data.all.completed,
$scope.data.all.started);
};
$scope.pctStartedCertified = function () {
if (!$scope.data) { return; }
return getPercentString($scope.data.certified.started,
$scope.data.all.started);
};
$scope.pctCertifiedCompleted = function () {
if (!$scope.data) { return; }
return getPercentString($scope.data.certified.completed,
$scope.data.certified.total);
};
$scope.pctCertifiedAccountedFor = function () {
if (!$scope.data) { return; }
return getPercentString($scope.data.certified.accounted_for,
$scope.data.certified.total);
};
},
link: function (scope, element, attrs) {
watchFilter(scope, element);
},
templateUrl: '/static/dashboard_widgets/aggregate_cohort_progress.html'
};
});
PertsApp.directive('classroomEntryList', function () {
'use strict';
return {
scope: {},
controller: function ($scope, $getStore, $pertsAjax) {
$scope.rows = [];
$scope.classroomList = [$getStore.get($scope.$root.entityId)];
// load all the teachers of these classrooms
var classroomIds = forEach($scope.classroomList, function (c) {
return c.id;
});
$pertsAjax({
url: '/api/get/user',
params: {
user_type_json: ['teacher', 'school_admin'],
owned_classroom_list_json: classroomIds
}
}).then(function (response) {
$getStore.setList(response);
forEach($scope.classroomList, function (classroom) {
var row = {classroom: classroom.id};
forEach(response, function (teacher) {
if (teacher.owned_classroom_list.contains(classroom.id)) {
row.teacher = teacher.id;
}
});
$scope.rows.push(row);
});
});
},
templateUrl: '/static/dashboard_widgets/classroom_entry_list.html'
};
});
PertsApp.directive('classroomEntry', function () {
'use strict';
return {
scope: {
adminOptions: '@adminOptions',
classroomId: '@classroomId',
teacherId: '@teacherId'
},
controller: function ($scope, $getStore, $pertsAjax, $window) {
$scope.$watch('classroomId + teacherId + adminOptions',
function (value) {
if ($scope.classroomId === undefined ||
$scope.teacherId === undefined) {
return;
}
$scope.classroom = $getStore.get($scope.classroomId);
$scope.teacher = $getStore.get($scope.teacherId);
// if adminOptions is true (which is only the case on the
// dashboard, not in other places this widget is used, like a
// teacher panel) then look up who else we might want to assign
// this classroom to as owner.
if ($scope.adminOptions === 'true') {
// Because of our clever permissions-based filtering, we
// can be confident users can't re-assign inappropriately.
// We do want to limit to the current cohort so the list
// isn't too huge.
$pertsAjax({
url: '/api/get/user',
params: {
user_type_json: ['teacher', 'school_admin'],
assc_cohort_list: $scope.$root.cohort.id
}
}).then(function (data) {
$scope.otherAdmins = forEach(data, function (admin) {
// filter out the current teacher
if (admin.id !== $scope.teacher.id) {
return admin;
}
});
});
}
});
$scope.deleteClassroom = function () {
if (confirm("Are you sure you want to delete " + $scope.classroom.name + "?")) {
var url = '/api/delete/classroom/' + $scope.classroom.id;
$pertsAjax({url: url}).then(function () {
$window.location.reload();
});
}
};
$scope.reassignClassroom = function () {
// Someone with sufficient permission wants to change the owner
// of this classroom. That means we need to:
// * Break relationships
// - from old owner to classroom
// - from classroom to old owner
// * Create relationships
// - from new owner to classroom
// - from classroom to new owner
$pertsAjax({
url: '/api/disown/user/' + $scope.teacher.id +
'/classroom/' + $scope.classroom.id
});
$pertsAjax({
url: '/api/set_owner/user/' + $scope.newOwner.id +
'/classroom/' + $scope.classroom.id
});
// Chain these two so that the second doesn't take effect
// before the first. Otherwise the unassociate call may be
// overridden by the associate call, resulting in a double
// association.
$pertsAjax({
url: '/api/unassociate/classroom/' + $scope.classroom.id +
'/user/' + $scope.teacher.id
}).then(function () {
$pertsAjax({
url: '/api/associate/classroom/' + $scope.classroom.id +
'/user/' + $scope.newOwner.id
}).then(function () {
$window.location.reload();
});
});
};
},
templateUrl: '/static/dashboard_widgets/classroom_entry.html'
};
});
// Displays statistics broken down by classroom for all the classrooms in a
// cohort. Calls classroomProgress for each item in the list.
PertsApp.directive('classroomProgressList', function () {
'use strict';
return {
scope: {},
controller: function ($scope, $q, $seeStore, $getStore, $pertsAjax, $forEachAsync, $modal, $window, $sce) {
// If redirection gets this deep, it should stop.
$scope.$root.redirecting = false;
$scope.selectedClassrooms = [];
$scope.classroomParams = {};
// Group activities by classroom, sorting by activities by
// ordinal. Sorting by classroom name is taken care of in the
// markup.
$scope.indexClassrooms = function (activityList) {
var index = {};
forEach(activityList, function (a) {
var cId = a.assc_classroom_list[0];
util.initProp(index, cId, {activityList: []});
index[cId].activityList.push(a);
index[cId].classroomName = $getStore.get(cId).name;
});
forEach(index, function (cId, cInfo) {
cInfo.activityList.sort(function (a, b) {
return a.activity_ordinal - b.activity_ordinal;
});
});
$scope.classroomIndex = index;
};
// Get al the classrooms in this cohort.
$pertsAjax({
url: '/api/get/classroom',
params: {
assc_cohort_list: $scope.$root.currentEntity.id
}
}).then(function (response) {
$scope.classroomList = $getStore.setList(response);
// pre-load all the activities from this cohort
$pertsAjax({
url: '/api/get/activity',
params: {
user_type: 'student',
assc_cohort_list: $scope.$root.currentEntity.id
}
}).then(function (response) {
// Store activities.
$scope.studentActivityList = $getStore.setList(response);
// Index them by classroom and do some sorting.
$scope.indexClassrooms($scope.studentActivityList);
});
});
// See the other cohorts in this program we can move classrooms and
// students into; it will be used to populate the move menu.
$scope.$watch('$root.program', function (program) {
if (!program) { return; }
var programInfo = $window.programInfo[program.id];
$scope.aliasSchoolInstructions = $sce.trustAsHtml(
programInfo.alias_school_instructions);
$scope.normalSchoolInstructions = $sce.trustAsHtml(
programInfo.normal_school_instructions);
// Read sessions from server's program config and determine the
// number of session rows the student needs.
var studentOutline = $window.programInfo[program.id].student_outline;
$scope.sessions = forEach(studentOutline, function (module) {
if (module.type === 'activity') {
return module;
}
});
var params = {assc_program_list: program.id};
if ($scope.$root.userType !== 'god') {
// For non-gods, see the user's OWNED cohorts in this program.
params.id_json = $window.user.owned_cohort_list;
}
$pertsAjax({
url: '/api/see/cohort',
params: params
}).then(function (response) {
// Remove *this* cohort from the list b/c it doesn't
// make sense to move from and to the same place.
var cList = forEach(response, function (c) {
if (c.id !== $scope.$root.currentEntity.id) { return c; }
});
$scope.availableCohorts = $seeStore.setList(cList);
});
});
// Detect users clicking on the "move classroom to cohort" menu,
// confirm their choice, and launch the moving function.
$scope.$watch('moveToCohort', function (cohort) {
if (!cohort) { return; }
var msg = "Are you sure you want to move " +
$scope.selectedClassrooms.length + " classrooms to " +
cohort.name + "?" +
"\n\n" +
"This process will take about a minute. It is " +
"important not to leave the page before it is " +
"complete.";
if (confirm(msg)) {
$scope.moveClassrooms($scope.selectedClassrooms, cohort);
} else {
$scope.moveToCohort = undefined;
}
});
// Put in a kinda-crappy replacement of an input placeholder for
// browsers which don't support placeholders.
// The timeout lets us escape angular's digest loop, so setting
// the value of the input *won't* be recognized as an actual
// attempt to search, which is what we want.
if (!util.weHas.placeholder()) {
setTimeout(function () {
$('.dashboard-table-controls [placeholder]').val('Search...');
}, 1);
}
$scope.printSessionInstructions = function () {
var newWindow = window.open($scope.sessionInstructionsUrl());
newWindow.print();
};
$scope.moveClassrooms = function (classroomIds, newCohort) {
$scope.showMoveProgressMonitor = true;
$scope.totalMovedClassrooms = classroomIds.length;
$scope.totalMovedStudents = 0;
$scope.numMovedClassrooms = 0;
$scope.numMovedStudents = 0;
// Moving classrooms is so rare, we want to be alerted to it.
var logMove = function (msg) {
$pertsAjax({
url: '/api/log/error',
params: {
message: msg,
classrooms: classroomIds,
original_cohort: $scope.$root.cohort.id,
new_cohort: newCohort.id
}
});
};
logMove("This isn't necessarily an error; it's a hack to " +
"notify ourselves about a potentially sensitive " +
"operation: a user attempting to move classroom(s). " +
"Check for a follow-up message on the result.");
var moveSingleStudent = function (student) {
// It is important to unassociate the student from the
// cohort FIRST (before associating them to the new one),
// because it also (like associate) cascades the change
// through higher entities. Doing it second would erase any
// higher associations that overlap with the new
// association, like the program.
// tl;dr: if you don't do it this way, you get a student
// who has no program.
return $pertsAjax({
url: '/api/unassociate/user/' + student.id +
'/cohort/' + $scope.$root.cohort.id
}).then(function (response) {
return $pertsAjax({
url: '/api/associate/user/' + student.id +
'/cohort/' + newCohort.id
}).then(function () {
$scope.numMovedStudents += 1;
});
});
};
// Get all the students in all these classroom, then
// reassociate each of them.
var moveStudentsPromise = $pertsAjax({
url: '/api/see/user',
params: {assc_classroom_list_json: classroomIds}
}).then(function (students) {
$scope.totalMovedStudents = students.length;
return $forEachAsync(students, moveSingleStudent, 'serial');
});
// Also reassociate the classrooms themselves.
var moveSingleClassroom = function (classroomId) {
// It is important to unassociate the classroom from the
// cohort FIRST (before associating them to the new one),
// because it also (like associate) cascades the change
// through higher entities. Doing it second would erase any
// higher associations that overlap with the new
// association, like the program.
// tl;dr: if you don't do it this way, you get a classroom
// which has no program.
return $pertsAjax({
url: '/api/unassociate/classroom/' + classroomId +
'/cohort/' + $scope.$root.cohort.id
}).then(function (response) {
return $pertsAjax({
url: '/api/associate/classroom/' + classroomId +
'/cohort/' + newCohort.id
}).then(function () {
$scope.numMovedClassrooms += 1;
});
});
};
var moveClassroomsPromise = $forEachAsync(
classroomIds, moveSingleClassroom, 'serial');
// If anything goes wrong with the whole move, the
// errorCallback() will trigger.
$q.all([moveStudentsPromise, moveClassroomsPromise]).then(
function successCallback() {
$scope.showMoveProgressMonitor = false;
$scope.selectedClassrooms = [];
// remove those classrooms' activities from the list
$scope.studentActivityList = forEach($scope.studentActivityList, function (a) {
if (!classroomIds.contains(a.assc_classroom_list[0])) {
return a;
}
});
logMove('classroom(s) were successfully moved');
},
function errorCallback() {
$scope.displayMoveError = true;
logMove('classroom(s) were NOT successfully moved');
}
);
};
$scope.columns = [
{name: "", colClass: "select", sortable: false,
tooltip: ""},
{name: "Class Name", colClass: "name", sortable: true,
tooltip: ""},
{name: "#", colClass: "session", sortable: true,
tooltip: "Session Number"},
{name: "Date", colClass: "date", sortable: true,
tooltip: "When the session is scheduled to be done."},
{name: "Status", colClass: "status", sortable: true,
tooltip: ""},
{name: "Study Inelg", colClass: 'study_ineligible', sortable: true,
tooltip: "Study Ineligible: students with a participation code that makes " +
"them ineligible for the study."},
{name: "Study Elg", colClass: 'certified', sortable: true,
tooltip: "All study eligible students."},
{name: "Cmpl", colClass: 'completed', sortable: true,
tooltip: "Complete: students who have completed the session, as a percent of study eligible students."},
{name: "Makeup Inelg", colClass: 'makeup_ineligible', sortable: true,
tooltip: "Makeup Ineligible: students who may NOT participate in a make up session."},
{name: "Makeup Elg", colClass: 'makeup_eligible', sortable: true,
tooltip: "Makeup Eligible: students who MAY participate in a make up session."},
{name: "Not Coded", colClass: 'uncoded', sortable: true,
tooltip: "Students who should either 1) complete the session " +
"or 2) be given a code explaining why they haven't."}
];
$scope.constructNewClassroomName = function () {
var p = $scope.classroomParams;
if ([p.name, p.teacher_first_name, p.teacher_last_name].contains(undefined)) {
return '';
}
var firstInitial = p.teacher_first_name.substr(0, 1);
var paren = p.name_extra ? ' (' + p.name_extra + ')' : '';
return p.teacher_last_name + ' ' + firstInitial + '. - ' +
p.name + paren;
};
$scope.addClassroom = function (classroomParams) {
// takes a javascript object,
// {name: 'English 101', teacher: userObject}
$scope.showAddForm = false; // close the form
$pertsAjax({
url: '/api/put/classroom',
params: {
program: $scope.$root.program.id,
cohort: $scope.$root.cohort.id,
name: $scope.constructNewClassroomName(),
user: $window.userId,
teacher_name: classroomParams.teacher_first_name + ' ' + classroomParams.teacher_last_name,
teacher_email: classroomParams.teacher_email
}
}).then(function (classroom) {
classroom = $getStore.set(classroom);
$scope.classroomList =
$scope.classroomList.concat(classroom);
var newActivities = $getStore.setList(
classroom._student_activity_list);
// add it to the user list to it gets a row widget
$scope.studentActivityList =
$scope.studentActivityList.concat(newActivities);
$scope.indexClassrooms($scope.studentActivityList);
});
};
$scope.confirmDeleteClassrooms = function () {
// Make sure they didn't click by mistake.
var msg = "Are you sure you want to delete " +
$scope.selectedClassrooms.length + " classrooms?";
if (!confirm(msg)) { return; }
// First check to see if there are any students in these
// classrooms. Only allow empty classrooms to be deleted.
$pertsAjax({
url: '/api/get/user',
params: {
user_type: 'student',
assc_classroom_list_json: $scope.selectedClassrooms
}
}).then(function (students) {
if (students.length > 0) {
alert("There are still students in some of these " +
"classrooms. You may only delete empty " +
"classrooms.");
} else {
$scope.deleteSelectedClassrooms();
}
});
};
$scope.deleteSelectedClassrooms = function (classroomId) {
// Delete each classroom one by one.
$forEachAsync($scope.selectedClassrooms, function (classroomId) {
return $pertsAjax({url: '/api/delete/classroom/' + classroomId});
}, 'serial').then(function () {
// Rebuild the list of displayed activities based on which
// ones didn't just have their classrooms deleted.
$scope.studentActivityList = forEach($scope.studentActivityList, function (a) {
if (!$scope.selectedClassrooms.contains(a.assc_classroom_list[0])) {
return a;
}
});
// Uncheck all the select boxes.
$scope.selectedClassrooms = [];
});
};
// Build a dialog box for displaying email addresses of selected users.
$scope.openDialog = function () {
var testingDialogMarkup = '' +
'<div class="modal-header">' +
'<h3>Email Addresses: paste into "To:" field</h3>' +
'</div>' +
'<div class="modal-body">' +
'<p>' +
forEach($scope.classroomList, function (c) {
if ($scope.selectedClassrooms.contains(c.id)) {
return c.teacher_email;
}
}).join(', ') +
'</p>' +
'</div>' +
'<div class="modal-footer">' +
'<button ng-click="close()" class="btn btn-default">' +
'Close' +
'</button>' +
'</div>';
// See angular-ui docs for details on available options.
// http://angular-ui.github.io/bootstrap/#/modal
var modalInstance = $modal.open({
backdrop: true,
keyboard: true,
backdropClick: true,
backdropFade: true,
template: testingDialogMarkup,
controller: function ($scope, $modalInstance) {
$scope.close = function () {
$modalInstance.dismiss('close');
};
}
});
};
$scope.trackSelection = function (event, classroomId, isSelected) {
if (
isSelected === true &&
!$scope.selectedClassrooms.contains(classroomId)
) {
$scope.selectedClassrooms.push(classroomId);
} else if (isSelected === false) {
$scope.selectedClassrooms.remove(classroomId);
}
// Broadcast the change down to activity rows again, so sibling
// activities can stay in sync (b/c they both together
// represent the selected classroom).
$scope.$broadcast('/classroomProgressList/selectionChange',
classroomId, isSelected);
};
$scope.toggleSelectAll = function (checked) {
$scope.$broadcast('/classroomProgressList/toggleSelectAll', checked);
};
// Listen to rows whose checkboxes change and track them.
$scope.$on('/activityProgress/selectionChange',
$scope.trackSelection);
},
link: function (scope, element, attrs) {
// running sortBy sets scope.reverseSort and scope.sortedColumn
var table = element.children('table').get();
scope.sortBy = sortByFactory(scope, table, 'tbody');
scope.sortIconClass = sortIconClassFactory(scope);
},
templateUrl: '/static/dashboard_widgets/classroom_progress_list.html'
};
});
// Displays statistics for a given activity.
PertsApp.directive('activityProgress', function () {
'use strict';
return {
scope: {
id: '@activityId',
showProgress: '@showProgress',
sessions: '=',
filterText: '='
},
controller: function ($scope, $getStore, $scheduleRules, $timeout, $window) {
var module;
$scope.dateValid = undefined;
// The appropriate incomplete text label (e.g. "unscheduled")
// will be updated in a $watch of the activity's scheduled date.
$scope.statusOptions = [
{value: 'incomplete', text: ''},
{value: 'completed', text: 'completed'}
];
$scope.$watch('id + $root.program', function () {
if (!$scope.id || !$scope.$root.program) { return; }
//// a bunch of logic that depends on knowing the activity
$scope.activity = $getStore.get($scope.id);
// Used to display the classroom name
$scope.classroom = $getStore.get($scope.activity.assc_classroom_list[0]);
$scope.processScheduling();
$scope.calculateStats();
}, true);
// These variables control styling and tooltip text of certain
// table fields, which change based on various conditions.
var resetWarnings = function () {
$scope.certClass = '';
$scope.unaccountedClass = '';
$scope.mysteryClass = '';
$scope.certTooltip = '';
$scope.unaccountedTooltip = '';
$scope.mysteryTooltip = '';
};
resetWarnings();
// Monitor activity status and update styling and tooltips.
$scope.$watch('activity.status', function (status) {
if (status === 'completed') {
if (!$scope.classroom.roster_complete) {
$scope.certClass = 'warning';
$scope.certTooltip = "Roster not complete.";
}
if ($scope.uncertified > 0) {
$scope.uncertifiedClass = 'warning';
$scope.uncertifiedTooltip = "Students have signed in with unexpected names.";
}
if ($scope.makeupEligible > 0) {
$scope.makeupEligibleClass = 'warning';
$scope.makeupEligibleTooltip = "These students should make up the session.";
}
if ($scope.uncoded > 0) {
$scope.uncodedClass = 'warning';
$scope.uncodedTooltip = "Students who haven't finished the session should be given a non-participation code.";
}
} else {
resetWarnings();
}
});
// Announce changes to the selected checkbox to the table.
$scope.$watch('isSelected', function (isSelected) {
if (!$scope.classroom) { return; }
$scope.$emit('/activityProgress/selectionChange',
$scope.classroom.id, isSelected);
});
$scope.$on('/classroomProgressList/selectionChange', function (event, classroomId, isSelected) {
if ($scope.classroom && $scope.classroom.id === classroomId) {
$scope.isSelected = isSelected;
}
});
$scope.$on('/classroomProgressList/toggleSelectAll', function (event, checked) {
$scope.isSelected = checked;
});
$scope.$watch('dateValid', function () {
if ($scope.dateValid === false) {
$scope.datepickrTooltip = "This date conflicts with the " +
"other session(s).";
} else {
$scope.datepickrTooltip = "";
}
});
var schedulingProcessed = false;
$scope.processScheduling = function () {
if (schedulingProcessed) { return; }
schedulingProcessed = true;
// determine which part of the program config is relevant
var programId = $scope.activity.assc_program_list[0];
var userType = $scope.activity.user_type;
var outline = $window.programInfo[$scope.$root.program.id][userType + '_outline'];
forEach(outline, function (m) {
if (m.activity_ordinal === $scope.activity.activity_ordinal && m.type === 'activity') {
module = m;
}
});
// interpret relative open date logic
if (module.date_open_relative_to) {
// watch the referenced activities so we can dynamically
// adjust what dates are available
$scheduleRules.watch($scope.classroom.id, module.date_open_relative_to, function (date) {
var interval = module.date_open_relative_interval * Date.intervals.day;
// An activity is open if BOTH the relative delay is
// satisfied AND the absolute open date has passed. So
// a given date is valid if it is later than BOTH of
// these.
var relativeDateOpen = new Date(date.getTime() + interval);
var absoluteDateOpen = Date.createFromString(module.date_open, 'local');
var dateOpen = new Date(Math.max(relativeDateOpen, absoluteDateOpen));
$scope.datepickr.config.dateOpen = dateOpen.toDateString('local');
// the calendar's constraints have changed in response
// to others being set; re-draw
$scope.dateValid = $scope.datepickr.rebuild();
});
} else {
$scope.datepickr.config.dateOpen = module.date_open;
}
// interpret relative close date logic
if (module.date_closed_relative_to) {
// watch the referenced activities so we can dynamically
// adjust what dates are available
$scheduleRules.watch($scope.classroom.id, module.date_closed_relative_to, function (date) {
var interval = module.date_closed_relative_interval * Date.intervals.day;
// The effective closed date is either the relative
// close interval or the absolute close date, whichever
// is sooner.
var relativeDateClosed = new Date(date.getTime() + interval);
var absoluteDateClosed = Date.createFromString(module.date_closed, 'local');
var dateClosed = new Date(Math.min(relativeDateClosed, absoluteDateClosed));
$scope.datepickr.config.dateClosed = dateClosed.toDateString('local');
// the calendar's constraints have changed in response
// to others being set; re-draw
$scope.dateValid = $scope.datepickr.rebuild();
});
} else {
$scope.datepickr.config.dateClosed = module.date_closed;
}
// the calendar has initial constraints (based purely on page-
// load information) which it didn't have when it was first
// instantiated in the link() function; re-draw.
$scope.dateValid = $scope.datepickr.rebuild();
// monitor the calendar widget and send its value into the
// the activity when it changes; the getStore will do the put.
$scope.$watch('datepickr._currentValue', function () {
var date = $scope.datepickr.getValue();
if (date) {
$scope.activity.scheduled_date = date.toDateString('local');
}
});
if ($scope.activity.scheduled_date) {
// if the activity as loaded is already scheduled, tell the
// calendar widget
var date = Date.createFromString(
$scope.activity.scheduled_date, 'local');
$scope.datepickr.setDate(date);
// send an initial update to listening widgets that this
// activity knows its date; further updates will come
// from watching the data model
$scope.$emit('activitySchedule/scheduledAs',
$scope.id, $scope.activity.scheduled_date);
}
};
// It's critical that the $watch set here, which will communicate
// the calendar's value to the $scheduleRules service, only be
// called AFTER all other widgets have had a chance to set up their
// watchers with that service. Otherwise, widgets will not render
// correctly on page load because their watchers will not be called
// initially. The necessary delay is accomplished with this
// timeout.
$timeout(function () {
// when the activity's date changes
$scope.$watch('activity.scheduled_date', function (dateString) {
if (dateString) {
var dateObject = Date.createFromString(dateString, 'local');
// update the copy of dates that all widgets can see,
// so they can adjust their dynamic constraints
$scheduleRules.addDate($scope.activity, dateObject);
$scope.datepickr.setDate(dateObject);
// the user has changed the value of this calendar, it
// may have become valid or invalid in response; re-
// draw
$scope.dateValid = $scope.datepickr.rebuild();
// and inform the steps, which are waiting for all
// activities to be scheduled before moving on
$scope.$emit('activitySchedule/scheduled');
}
// Update the text label of the status dropdown.
var statusText = getInterpretedStatus($scope.activity,
'incomplete');
$scope.statusOptions[0].text = statusText;
// IE, that saintly savant of browsers, doesn't know how
// to update the displayed value of a select if it options
// change dynamically. Force it to update its display by
// waiting for the angular digest loop to complete and then
// writing the text directly to the DOM.
$timeout(function () {
$('tr[activity-id="' + $scope.id + '"] .status select').each(function (index, selectNode) {
selectNode.options[0].text = statusText;
}).trigger('change');
}, 1);
}, true);
}, 1);
$scope.interpretedStatus = getInterpretedStatus;
$scope.calculateStats = function () {
var data = $scope.activity._aggregation_data;
var studyEligibleData = data.certified_study_eligible_dict;
$scope.uncertified = data.total_students - data.certified_students;
$scope.studyIneligible = data.certified_students - studyEligibleData.n;
$scope.studyEligible = studyEligibleData.n;
$scope.completed = studyEligibleData.completed;
$scope.pctCompleted = getPercentString(
studyEligibleData.completed, studyEligibleData.n);
$scope.makeupIneligible = studyEligibleData.makeup_ineligible;
$scope.makeupEligible = studyEligibleData.makeup_eligible;
$scope.uncoded = studyEligibleData.uncoded;
// $scope.pctStartedCompleted = getPercentString(
// data.all.completed, data.all.started);
};
},
link: function (scope, element, attrs) {
// create datepickers
var node = $('.datepickr', element).get(0);
// Although it would be nice to rely on Date.toLocaleDateString(),
// IE likes to use the verbose style, e.g. "Wednesday, July 23rd,
// 2014", and we need a compact representation.
// var config = {dateFormat: 'byLocale'};
// So instead we manually format it in compact US-style as
// 1-or-2 digit month / 1-or-2 digit day / 2 digit year
var config = {dateFormat: 'n/j/y'};
scope.datepickr = new datepickr(node, config);
element.addClass('activity-progress');
// Activity rows are grouped by classroom into tbody tags.
// We want to filter at that level, so that a given tbody is
// switched on or off as a whole by the filter next. To do this,
// simply provide the tbody to the watch function. All table cells
// in the tbody will be converted to a string, which will be
// matched against the filter text. Then each activity widget in
// the tbody will receive the same signal: match or no match, and
// the whole set will turn on or off as a coordinated group.
watchFilter(scope, element.parent());
scope.$watch('activity.scheduled_date', function (dateString) {
});
},
templateUrl: '/static/dashboard_widgets/activity_progress.html'
};
});
PertsApp.directive('rosterTable', function () {
'use strict';
var controller = function ($scope, $seeStore, $getStore, $pertsAjax, $location, $forEachAsync, $window) {
$scope.selectedUsers = [];
$scope.userList = [];
$scope.summaryColumns = [
{name: "Session", colClass: 'session'},
// "Total" is really certified students, but all students are
// certified!
{name: "Total", colClass: 'total',
tooltip: "Total students in the classroom."},
{name: "Study Ineligible", colClass: 'study_ineligible',
tooltip: "Students with a non-participation code that makes " +
"them ineligible for the study."},
{name: "Completed", colClass: 'completed',
tooltip: "Students who have completed the session (100% progress)."},
{name: "Make-Up Ineligible", colClass: 'makeup_ineligible',
tooltip: "Students who may NOT participate in a make up session."},
{name: "Make-Up Eligible", colClass: 'makeup_eligible',
tooltip: "Students who MAY participate in a make up session."},
{name: "Uncoded", colClass: 'uncoded',
tooltip: "Students who should either 1) complete the session " +
"or 2) be given a code explaining why they haven't."}
];
$scope.columns = [
{name: "", colClass: 'select', sortable: false, tooltip: ""},
{name: "First Name", colClass: 'first_name', sortable: true, tooltip: ""},
{name: "Last Name", colClass: 'last_name', sortable: true, tooltip: ""},
{name: "Session - Progress%", colClass: 'session_progress', sortable: false, tooltip: ""},
// the css class 'progress' collides with bootstrap
// {name: "Progress", colClass: 'progress_pd', sortable: false, tooltip: ""},
{name: "Participation Code", colClass: 'status_code', sortable: false, tooltip: ""}
];
// Columns vary a little according to dashboard level.
var certifiedColumn = {name: "Certified?", colClass: 'cert',
sortable: true, tooltip: ""};
var classroomColumn = {name: "Classroom", colClass: 'classroom',
sortable: true, tooltip: ""};
var params = {user_type: 'student', order: 'last_name'};
if ($scope.$root.level === 'classroom') {
// At the classroom we want only students within the current
// classroom
params.assc_classroom_list = $scope.$root.currentEntity.id;
} else if ($scope.$root.level === 'cohort') {
// At the cohort level, instead of a certified setter, there's
// a link to the student's classroom.
$scope.columns.splice(1, 0, classroomColumn);
params.assc_cohort_list = $scope.$root.currentEntity.id;
}
// Get all the users in this classroom so we can build the roster.
$pertsAjax({
url: '/api/get/user',
params: params
}).then(function (response) {
$scope.userList = $getStore.setList(response);
});
// Read sessions from server's program config and determine the
// number of session rows the student needs.
$scope.$watch('$root.program', function (program) {
if (!program) { return; }
var studentOutline = $window.programInfo[program.id].student_outline;
$scope.sessions = forEach(studentOutline, function (module) {
if (module.type === 'activity') {
return module;
}
});
// Watch changes to user properties, and calculate stats on who's
// certified or not.
$scope.$watch('userList', function () {
if (!$scope.userList) { return; }
$scope.summary = {};
forEach($scope.sessions, function (s) {
var o = s.activity_ordinal;
$scope.summary[o] = $scope.summarizeStudents($scope.userList, o);
});
}, true);
});
// Get all the classrooms from this cohort so we can populate
// the moving dropdown.
$scope.$watch('$root.cohort', function (cohort) {
if (!cohort) { return; }
$pertsAjax({
url: '/api/see/classroom',
params: {
assc_cohort_list: cohort.id
}
}).then(function (response) {
var cList = $seeStore.setList(response);
// Remove *this* classroom from the list (if this is the
// classroom level) b/c it doesn't make sense to move from
// and to the same place.
if ($scope.classroom) {
$scope.availableClassrooms = forEach(cList, function (c) {
if (c.id !== $scope.classroom.id) { return c; }
});
} else {
$scope.availableClassrooms = cList;
}
});
});
// Put in a kinda-crappy replacement of an input placeholder for
// browsers which don't support placeholders.
// The timeout lets us escape angular's digest loop, so setting
// the value of the input *won't* be recognized as an actual
// attempt to search, which is what we want.
if (!util.weHas.placeholder()) {
setTimeout(function () {
// For the roster search field.
$('.dashboard-table-controls [placeholder]').val('Search...');
// For the add-students dialog.
$('form[name="addSingleUserForm"] input[placeholder="first name"]').val('first name');
$('form[name="addSingleUserForm"] input[placeholder="middle initial"]').val('middle_initial');
$('form[name="addSingleUserForm"] input[placeholder="last name"]').val('last name');
$('form[name="addCsvUsersForm"] textarea').val('first_name middle_initial last_name');
}, 1);
}
// Very similar to the summarize_students method of the
// Aggregator, but calculates extra stuff desired in the view.
$scope.summarizeStudents = function (students, activityOrdinal) {
var sessionSummary = {
uncertified: 0,
certified: 0,
studyIneligible: 0,
studyEligible: 0,
completed: 0,
makeupIneligible: 0,
makeupEligible: 0,
uncoded: 0
};
forEach(students, function (user) {
// Certain students aren't counted at all, regardless of the
// current activityOrdinal.
var excludeStudent = false;
forEach(user.status_codes, function (o, code) {
var info = $window.statusCodes[code];
if (info && info.exclude_from_counts) {
excludeStudent = true;
}
});
if (excludeStudent) {
// These students aren't counted at all.
return;
}
var aggData = user._aggregation_data[activityOrdinal] || {};
var statusCode = user.status_codes[activityOrdinal];
if (user.certified) {
sessionSummary.certified += 1;
} else {
sessionSummary.uncertified += 1;
// Uncertified students aren't counted in any other
// category.
return;
}
if (statusCode) {
var status = $window.statusCodes[statusCode];
if (!status.study_eligible) {
// Don't count this student in any other categories.
// Skip to next one.
sessionSummary.studyIneligible += 1;
return;
}
if (status.counts_as_completed) {
sessionSummary.completed += 1;
} else if (status.makeup_eligible) {
sessionSummary.makeupEligible += 1;
} else {
sessionSummary.makeupIneligible += 1;
}
} else if (aggData.progress === 100) {
sessionSummary.completed += 1;
} else {
sessionSummary.uncoded += 1;
}
sessionSummary.studyEligible += 1;
});
return sessionSummary;
};
$scope.rosterCompleteDate = function () {
if (!$scope.classroom || !$scope.classroom.roster_completed_datetime) {
// Don't freak out if the classroom isn't loaded yet.
return;
}
var dateStr = $scope.classroom.roster_completed_datetime;
var date = Date.createFromString(dateStr, 'UTC');
return date.toLocaleDateString();
};
$scope.trackSelection = function (event, userId, isSelected) {
if (
isSelected === true &&
!$scope.selectedUsers.contains(userId)
) {
$scope.selectedUsers.push(userId);
} else if (isSelected === false) {
$scope.selectedUsers.remove(userId);
}
};
$scope.toggleSelectAll = function (checked) {
$scope.$broadcast('/rosterTable/toggleSelectAll', checked);
};
// Listen to rows whose checkboxes change and track them.
$scope.$on('/rosterRow/selectionChange', $scope.trackSelection);
$scope.deleteSelectedUsers = function () {
if (!confirm("Are you sure you want to delete these " +
$scope.selectedUsers.length + " users?")) {
return;
}
var deleteUser = function (userId) {
return $pertsAjax({url: '/api/delete/user/' + userId});
};
var studentIds = $scope.selectedUsers.slice(0); // copy array
$scope.selectedUsers = [];
// Call deleteUser() for each student to be deleted, then
// update the view.
$forEachAsync(studentIds, deleteUser, 'serial').then(function () {
// Remove the deleted users from the table
$scope.userList = forEach($scope.userList, function (u) {
if (!studentIds.contains(u.id)) {
return u;
}
});
});
};
$scope.addUser = function (user) {
// takes a javascript object,
// e.g. {first_name: 'mister', last_name: 'ed'}
user.classroom = $scope.$root.classroom.id;
user.user_type = 'student';
user.certified = true;
return $pertsAjax({
url: '/api/put/user',
params: user
}).then(function (response) {
// Add it to the get store so the row widget can connect
// to the data. It's important to do this before adding it to
// the scope b/c part of what getStore does is manage
// references. The *result* of getStore.set() has its
// references set correctly, while reponse does not.
var newUser = $getStore.set(response);
// add it to the user list to it gets a row widget
$scope.userList.push(newUser);
});
};
$scope.addSingleUser = function () {
$scope.addUser($scope.newStudent).then(function () {
// clear the text fields
$scope.newStudent = {};
// show visual confirmation
$('#confirm_add_single_user').show().fadeOut(4000);
});
};
$scope.addCsvUsers = function () {
$scope.alert = false;
$scope.addCsvUsersBusy = true;
var sep = "\t"; // csv separator
var requiredColumns = [
"first_name",
"middle_initial",
"last_name"
];
var rows = $scope.userCsv.split("\n");
// remove the first row; make sure columns are right
var providedColumns = rows.splice(0, 1)[0].split(sep);
if (!util.arrayEqual(providedColumns, requiredColumns)) {
$scope.addCsvUsersBusy = false;
$scope.alert = {
type: 'danger',
msg: "Invalid headers. Must be tab-separated with " +
"columns " + requiredColumns.join("\t")
};
}
// build a list of user objects
var userList = forEach(rows, function (row) {
var fields = row.split(sep);
if (fields.length !== requiredColumns.length) {
$scope.addCsvUsersBusy = false;
$scope.alert = {
type: 'danger',
msg: "Invalid data. This row doesn't have " +
"the right number of fields: " + row
};
}
var user = {};
forEach(requiredColumns, function (col, index) {
user[col] = fields[index];
});
return user;
});
if (!$scope.alert) {
// Adding many users at once can take a long time if done one
// by one, so POST the whole batch.
$pertsAjax({
url: '/api/batch_put_user',
method: 'POST',
params: {
user_names: userList,
classroom: $scope.$root.classroom.id,
user_type: 'student',
certified: true
}
}).then(function (response) {
// Add new users to the get store so the row widget can
// connect to the data. It's important to do this before
// adding it to the scope b/c part of what getStore does
// is manage references. The *result* of getStore.set()
// has its references set correctly, while reponse does
// not.
var newUsers = $getStore.setList(response);
// add it to the user list to it gets a row widget
$scope.userList = $scope.userList.concat(newUsers);
// clear the text fields
$scope.userCsv = '';
// Trigger a change event on the textarea so that the
// autogrow plugin can do its work.
setTimeout(function () {
$('form[name="addCsvUsersForm"] textarea').trigger('change');
}, 1);
// show visual confirmation
$scope.addCsvUsersBusy = false;
$('#confirm_add_csv_users').show().fadeOut(4000);
});
}
};
$scope.markRosterAsComplete = function () {
// Most of these objects are linked through the getStore, so just
// changing their properies is sufficient to save to the server.
forEach($scope.userList, function (user) {
user.certified = true;
});
$scope.classroom.roster_complete = true;
var nowDateStr = (new Date()).toDateTimeString('UTC');
$scope.classroom.roster_completed_datetime = nowDateStr;
// But we need to redundantly store the roster completion on
// related activity entities as well, and since they're not loaded
// yet, that's more work. First look them up, then sent an update
// request to each.
$pertsAjax({
url: '/api/see/activity',
params: {
// Must specify a see property b/c activities don't have
// names, and name is the default. W/o specifying this,
// you would get no results.
see: 'id',
assc_classroom_list: $scope.classroom.id
}
}).then(function (response) {
forEach(response, function (activity) {
$pertsAjax({
url: '/api/put/activity/' + activity.id,
params: {roster_complete: true}
});
});
});
};
// Detect users clicking on the "move student to classroom" menu,
// confirm their choice, and launch the moving function.
$scope.$watch('moveToClassroom', function (classroom) {
if (!classroom) { return; }
var msg = "Are you sure you want to move " +
$scope.selectedUsers.length + " students to " +
classroom.name + "?";
if (confirm(msg)) {
$scope.moveStudents($scope.selectedUsers, classroom);
} else {
$scope.moveToClassroom = undefined;
}
});
// Re-associate students to another classroom.
$scope.moveStudents = function (studentIds, newClassroom) {
var moveSingleStudent = function (student_id) {
// It is important to unassociate the student from the
// classroom FIRST (before associating them to the new
// one), because it also (like associate) cascades the
// change through higher entities. Doing it second would
// erase any higher associations that overlap with the new
// association, like the cohort and program.
// tl;dr: if you don't do it this way, you get a student
// who has no program or cohort.
return $pertsAjax({
url: '/api/unassociate/user/' + student_id +
'/classroom/' + $scope.classroom.id
}).then(function (response) {
return $pertsAjax({
url: '/api/associate/user/' + student_id +
'/classroom/' + newClassroom.id
});
});
};
$forEachAsync(studentIds, moveSingleStudent, 'serial').then(function () {
$scope.selectedUsers = [];
// remove those users from the list
$scope.userList = forEach($scope.userList, function (u) {
if (!studentIds.contains(u.id)) {
return u;
}
});
});
};
};
return {
scope: {
classroom: '=classroom',
cohort: '=cohort',
makeups: '@makeups'
},
controller: controller,
link: function (scope, element, attrs) {
// running sortBy sets scope.reverseSort and scope.sortedColumn
var table = element.children('table.roster_table').get();
scope.sortBy = sortByFactory(scope, table, 'tbody');
scope.sortIconClass = sortIconClassFactory(scope);
},
templateUrl: '/static/dashboard_widgets/roster_table.html'
};
});
PertsApp.directive('rosterRow', function () {
'use strict';
return {
scope: {
id: '@userId',
filterText: '=filterText',
sessions: '=sessions',
classroom: '=classroom',
makeups: '=makeups',
makeupSession: '=makeupSession'
},
controller: function ($scope, $getStore, $seeStore, $pertsAjax, $location, $modal, $emptyPromise, $window) {
// Status codes keyed by ordinal number.
$scope.myCodes = {};
$scope.mergeTargets = {};
// Boot up the widget when the user's id is available.
$scope.$watch('id', function (value) {
$scope.user = $getStore.get($scope.id);
});
// Announce changes to the selected checkbox to the table.
$scope.$watch('isSelected', function (isSelected) {
$scope.$emit('/rosterRow/selectionChange', $scope.user.id,
isSelected);
});
// Synchronize status code details with the codes stored on the
// user object. These details control things like dropping students
// from the make-up list if they have a make-up ineligible code.
$scope.$watch('user.status_codes', function (newList) {
forEach(newList, function (activityOrdinal, code) {
$scope.myCodes[activityOrdinal] = $window.statusCodes[code];
});
}, true); // watch for object value, not just reference
// Load users who have been specified as merge targets so we can
// display their names in the view.
$scope.$watch('user.merge_ids', function (mergeIdObj) {
if (!mergeIdObj) { return; }
// Make one ajax transaction to get them all, then assign them
// to their respective sessions one at a time.
var mergeIds = forEach(mergeIdObj, function (sessionOrdinal, mergeId) {
return mergeId;
});
$getStore.load(mergeIds);
forEach(mergeIdObj, function (sessionOrdinal, mergeId) {
var mergeTarget = $getStore.get(mergeId);
$scope.mergeTargets[sessionOrdinal] = $getStore.get(mergeId);
});
}, true);
$scope.$on('/rosterTable/toggleSelectAll', function (event, checked) {
$scope.isSelected = checked;
});
// Wrangle status codes into a nice format for drop-down menus.
$scope.statusCodes = forEach($window.statusCodes, function (code, info) {
var group;
if (info.study_eligible) {
if (info.makeup_eligible) {
group = "Make-Up Eligible";
} else {
group = "Make-Up Ineligible";
}
} else {
group = "Study Ineligible";
}
return {
id: code,
label: info.label,
group: group
};
});
// Add a blank option so the drop down menu can be cleared.
// Javascript null will translate to python None.
$scope.statusCodes.unshift({id: null, label: ''});
// Handy access to the seeStore in markup. Used to display
// classroom names given their id.
$scope.see = function (id) {
return $seeStore.get(id);
};
// Translates certified true/false into display text for select.
$scope.getCertifiedLabel = function (b) {
return b ? 'Certified' : 'Uncertified';
};
$scope.progress = function (session) {
if (!$scope.user._aggregation_data || !session) { return; }
var d = $scope.user._aggregation_data[session.activity_ordinal] || {};
return d.progress || '0';
};
// Clear user merge ids if they don't apply. Javascript null is
// eventually translated to python None on the server.
$scope.$watch('user', function (user) {
forEach(user.merge_ids, function (sessionOrdinal, mergeId) {
var code = user.status_codes[sessionOrdinal];
if (mergeId && code !== 'MWN') {
user.merge_ids[sessionOrdinal] = null;
}
});
}, true);
$scope.openDialog = function (activityOrdinal) {
var parentScope = $scope;
var controller = function ($scope, $modalInstance) {
$scope.close = function () {
$modalInstance.dismiss('close');
};
};
var dialogMarkup = '' +
'<div class="modal-header">' +
'<h3>Merge With</h3>' +
'</div>' +
'<div class="modal-body">' +
'<p>' +
'Merge student <strong>' + $scope.user.first_name +
' ' + $scope.user.last_name + '</strong> with:' +
'</p>' +
'<p>' +
'<select chosen-select ' +
'data-placeholder="merge with student..." ' +
'select-options="mergeList" ' +
'ng-options="u.id as (u.first_name + \' \' + u.last_name) for u in mergeList" ' +
'ng-model="user.merge_ids[' + activityOrdinal + ']">' +
'</select>' +
'</p>' +
'</div>' +
'<div class="modal-footer">' +
'<button ng-click="close()">' +
'Close' +
'</button>' +
'</div>';
// To display this dialog correctly, we need a list of all the
// students in the cohort. Only load this when the dialog is
// first opened b/c most of the time we won't need it.
if ($scope.mergeList) {
var promise = $emptyPromise();
} else {
var promise = $pertsAjax({
url: '/api/get/user',
params: {
user_type: 'student',
assc_cohort_list: $scope.$root.cohort.id
}
}).then(function (mergeList) {
// Take the user represented by this row out of the
// list, because it doesn't make any sense to merge
// a student with themselves.
mergeList = mergeList.filter(function (user) {
return user.id !== $scope.user.id;
})
$scope.mergeList = $getStore.setList(mergeList);
});
}
promise.then(function () {
var modalInstance = $modal.open({
backdrop: true,
keyboard: true,
backdropFade: true,
scope: $scope,
template: dialogMarkup,
controller: controller
});
});
};
},
link: function (scope, element, attrs) {
watchFilter(scope, element);
},
templateUrl: '/static/dashboard_widgets/roster_row.html'
};
});
PertsApp.directive('userBasics', function () {
'use strict';
return {
scope: {
id: '@userId'
},
controller: function ($scope, $getStore, $pertsAjax) {
$scope.$watch('id', function (value) {
$scope.user = $getStore.get(value);
});
$scope.syncNames = function () {
if (!$scope.user.name) {
$scope.user.name = $scope.user.first_name;
}
};
$scope.deleteUser = function (user) {
if (confirm("Are you sure you want to delete " + user.login_email + "?")) {
var url = '/api/delete/user/' + user.id;
$pertsAjax({url: url}).then(function () {
window.location.reload();
});
}
};
},
templateUrl: '/static/dashboard_widgets/user_basics.html'
};
});
PertsApp.directive('changePassword', function () {
'use strict';
return {
scope: {
id: '@userId'
},
controller: function ($scope, $getStore, $pertsAjax) {
$scope.newPasswordBlurred = false;
$scope.repeatPasswordBlurred = false;
$scope.success = null;
// At least 8 characters, ascii only.
// http://stackoverflow.com/questions/5185326/java-script-regular-expression-for-detecting-non-ascii-characters.
$scope.passwordRegex = /^[\040-\176]{8,}$/;
$scope.$watch('id', function (value) {
$scope.user = $getStore.get(value);
});
$scope.isMe = function () {
return window.userId === $scope.id;
};
$scope.passwordsMatch = function () {
if (!$scope.newPassword || !$scope.repeatPassword) {
return false;
} else {
return $scope.newPassword === $scope.repeatPassword;
}
};
$scope.changePassword = function () {
$scope.success = null;
$pertsAjax({
url: '/api/change_password',
method: 'POST',
params: {
username: $scope.user.login_email,
current_password: $scope.currentPassword,
new_password: $scope.newPassword
}
}).then(function (response) {
if (response === 'changed') {
$scope.success = true;
$scope.successMessage = "Password changed.";
$scope.currentPassword = '';
$scope.newPassword = '';
$scope.repeatPassword = '';
$scope.newPasswordBlurred = false;
$scope.repeatPasswordBlurred = false;
} else if (response === 'invalid_credentials') {
$scope.success = false;
$scope.successMessage = "Incorrect password. Password has not been changed.";
}
});
};
},
templateUrl: '/static/dashboard_widgets/change_password.html'
};
});
PertsApp.directive('userEntryList', function () {
'use strict';
var controller = function ($scope, $seeStore, $getStore, $pertsAjax, $forEachAsync, $modal, $window) {
$scope.selectedUsers = [];
$scope.columns = [
{name: "", colClass: 'select', sortable: false},
{name: "First", colClass: 'first_name', sortable: true},
{name: "Last", colClass: 'last_name', sortable: true},
{name: "Phone #", colClass: 'phone', sortable: true},
{name: "Date Registered", colClass: 'registered', sortable: true},
{name: "Oversees Schools", colClass: 'owned_schools', sortable: false},
{name: "Verified?", colClass: 'verified', sortable: true}
];
var params = {user_type_json: ['school_admin', 'teacher']};
if ($scope.$root.level === 'program') {
// filter by given program
params.assc_program_list = $scope.$root.entityId;
} else if ($scope.$root.level === 'cohort') {
// filter by given cohort, but use 'owned' list b/c
// that's how school admins are related.
params.owned_cohort_list = $scope.$root.entityId;
}
// Query for relevant users.
$pertsAjax({
url: '/api/get/user',
params: params
}).then(function (response) {
$scope.userList = $getStore.setList(response);
});
// Get the names of all the owned cohorts so we can display them.
// We need them for both the owned-school tags in each row, and
// for the association drop-down.
var programId;
if ($scope.$root.level === 'program') {
programId = $scope.$root.currentEntity.id;
} else {
programId = $scope.$root.currentEntity.assc_program_list[0];
}
$pertsAjax({
url: '/api/see/cohort',
params: {assc_program_list: programId}
}).then(function (response) {
$scope.availableCohorts = $seeStore.setList(response);
});
$scope.$watch('newAdminCohort', function (cohort) {
if (!cohort) { return; }
// A cohort has been selected from the association dropdown.
// Make the selected users owners of this cohort.
$scope.$broadcast('/userEntryList/setOwner', cohort.id,
$scope.selectedUsers);
// Clear the select box so it can be used again.
$scope.newAdminCohort = undefined;
// Notify the chosen plugin of the change after the current digest
// has finished.
setTimeout(function () {
$('[chosen-select]').trigger('chosen:updated');
}, 1);
});
$scope.deleteSelectedUsers = function () {
// Make sure they didn't click by mistake.
var msg = "Are you sure you want to delete " +
$scope.selectedUsers.length + " users?";
if (!confirm(msg)) { return; }
// Delete each user one by one.
$forEachAsync($scope.selectedUsers, function (userId) {
return $pertsAjax({url: '/api/delete/user/' + userId});
}, 'serial').then(function () {
// Rebuild the list of displayed users based on which
// ones weren't just deleted.
$scope.userList = forEach($scope.userList, function (user) {
if (!$scope.selectedUsers.contains(user.id)) {
return user;
}
});
// Uncheck all the select boxes.
$scope.selectedUsers = [];
});
};
$scope.trackSelection = function (event, userId, isSelected) {
if (
isSelected === true &&
!$scope.selectedUsers.contains(userId)
) {
$scope.selectedUsers.push(userId);
} else if (isSelected === false) {
$scope.selectedUsers.remove(userId);
}
};
$scope.toggleSelectAll = function (checked) {
$scope.$broadcast('/userEntryList/toggleSelectAll', checked);
};
// Listen to rows whose checkboxes change and track them.
$scope.$on('/userEntry/selectionChange', $scope.trackSelection);
// Build a dialog box for displaying email addresses of selected users.
$scope.openDialog = function () {
var testingDialogMarkup = '' +
'<div class="modal-header">' +
'<h3>Email Addresses: paste into "To:" field</h3>' +
'</div>' +
'<div class="modal-body">' +
'<p>' +
forEach($scope.userList, function (u) {
if ($scope.selectedUsers.contains(u.id)) {
return u.login_email;
}
}).join(', ') +
'</p>' +
'</div>' +
'<div class="modal-footer">' +
'<button ng-click="close()" class="btn btn-default">' +
'Close' +
'</button>' +
'</div>';
// See angular-ui docs for details on available options.
// http://angular-ui.github.io/bootstrap/#/modal
var modalInstance = $modal.open({
backdrop: true,
keyboard: true,
backdropClick: true,
backdropFade: true,
template: testingDialogMarkup,
controller: function ($scope, $modalInstance) {
$scope.close = function () {
$modalInstance.dismiss('close');
};
}
});
};
};
return {
scope: {},
controller: controller,
link: function (scope, element, attrs) {
// running sortBy sets scope.reverseSort and scope.sortedColumn
var table = element.children('table').get();
scope.sortBy = sortByFactory(scope, table, 'tr');
scope.sortIconClass = sortIconClassFactory(scope);
},
templateUrl: '/static/dashboard_widgets/user_entry_list.html'
};
});
PertsApp.directive('userEntry', function () {
'use strict';
var controller = function ($scope, $pertsAjax, $seeStore, $getStore, $window) {
$scope.$watch('userId', function (userId) {
if (!userId) { return; }
$scope.user = $getStore.get(userId);
if ($scope.user.created) {
$scope.registered = Date.createFromString($scope.user.created, 'UTC')
.toLocaleDateString();
}
$scope.processRelationships();
}, true);
$scope.$watch('user.user_type', function (userType) {
if (userType === 'teacher') {
$scope.verifiedString = "No";
$scope.verifiedTooltip = "To verify this administrator, " +
"make them the owner of a school.";
} else {
$scope.verifiedString = "Yes";
$scope.verifiedTooltip = "";
}
});
// Announce changes to the selected checkbox to the table.
$scope.$watch('isSelected', function (isSelected) {
$scope.$emit('/userEntry/selectionChange', $scope.user.id,
isSelected);
});
$scope.$on('/userEntryList/toggleSelectAll', function (event, checked) {
$scope.isSelected = checked;
});
$scope.$on('/userEntryList/setOwner', function (event, cohortId, selectedUsers) {
// Don't execute if this broadcast doesn't apply to us.
if (!selectedUsers.contains($scope.user.id)) { return; }
$scope.makeSchoolAdmin(cohortId);
});
$scope.processRelationships = function () {
if (!$scope.user.owned_cohort_list) { return; }
$scope.ownedCohorts = $seeStore.getList($scope.user.owned_cohort_list);
};
$scope.makeSchoolAdmin = function (cohortId) {
// 1) Make this user a school admin
// 2) Make them the owner of the specified cohort
$pertsAjax({
url: '/api/set_owner/user/' + $scope.user.id +
'/cohort/' + cohortId
}).then(function (user) {
// Update local data model with new user associations.
$scope.user = $getStore.set(user);
$scope.processRelationships();
// $getStore will save this to the server for us.
$scope.user.user_type = 'school_admin';
});
};
$scope.disownCohort = function (cohortId) {
return $pertsAjax({
url: '/api/disown/user/' + $scope.user.id +
'/cohort/' + cohortId
}).then(function (user) {
$getStore.set(user);
$scope.processRelationships();
});
};
};
return {
scope: {
userId: '@userId',
filterText: '='
},
controller: controller,
link: function (scope, element, attrs) {
watchFilter(scope, element);
},
templateUrl: '/static/dashboard_widgets/user_entry.html'
};
});
// Helps scheduling widgets communicate with each other. Each widget records
// its date with the service. Widgets can also set up callbacks which are
// executed when an activity with the given user type and ordinal changes its
// date. Since multiple activities might meet this description, the latest one
// is provided to the callback.
PertsApp.factory('$scheduleRules', function () {
'use strict';
return {
_d: {},
_callbacks: {},
init: function (classroomId, userType, ordinal) {
forEach([['_d', {}], ['_callbacks', []]], function (i) {
var p = i[0], v = i[1],
blankClassroom = {teacher: {}, student: {}};
util.initProp(this[p], classroomId, blankClassroom);
util.initProp(this[p][classroomId][userType], ordinal, v);
}, this);
},
addDate: function (activity, date) {
// record the date
var classroomId = activity.assc_classroom_list[0];
var userType = activity.user_type;
var ordinal = activity.activity_ordinal;
this.init(classroomId, userType, ordinal);
var dates = this._d[classroomId][userType][ordinal];
dates[activity.id] = date;
// find the latest date from this set
var latestDate;
forEach(dates, function (activityId, date) {
if (latestDate === undefined) {
latestDate = date;
} else if (date > latestDate) {
latestDate = date;
}
});
// call the appropriate callbacks
var callbacks = this._callbacks[classroomId][userType][ordinal];
forEach(callbacks, function (f) {
f(latestDate);
});
},
watch: function (classroomId, relativeInfo, callback) {
var userType = relativeInfo[0];
var ordinal = relativeInfo[1];
this.init(classroomId, userType, ordinal);
this._callbacks[classroomId][userType][ordinal].push(callback);
}
};
});
// Will query the server and build appropriate user entry widgets based on
// response.
PertsApp.config(function ($routeProvider) {
'use strict';
$routeProvider.when('/:level/:entityId/:page', {
controller: DashboardController,
templateUrl: '/static/dashboard_pages/base.html'
}).otherwise({
controller: DashboardController,
templateUrl: '/static/dashboard_pages/base.html'
});
}).run(function ($seeStore, $getStore) {
'use strict';
// Runs every second, sends /api/put calls for updated entities.
$getStore.watchForUpdates();
$seeStore.watchForUpdates();
});
| 43.441016 | 134 | 0.502632 |
12b7354932d2fd1b4c27c76a2c0512369097b97c | 1,496 | js | JavaScript | docs/build/p-nbapm0iy.system.entry.js | leoruhland/stenciljs-ionic-menu | 6e2345be5ca3a4a5471814e9351cf534a17b54d1 | [
"MIT"
] | null | null | null | docs/build/p-nbapm0iy.system.entry.js | leoruhland/stenciljs-ionic-menu | 6e2345be5ca3a4a5471814e9351cf534a17b54d1 | [
"MIT"
] | null | null | null | docs/build/p-nbapm0iy.system.entry.js | leoruhland/stenciljs-ionic-menu | 6e2345be5ca3a4a5471814e9351cf534a17b54d1 | [
"MIT"
] | null | null | null | System.register(["./p-d4bf7031.system.js","./p-17730780.system.js"],function(t){"use strict";var e,r,n,s,c;return{setters:[function(t){e=t.r;r=t.c;n=t.h;s=t.H},function(t){c=t.c}],execute:function(){var u=function(){function t(t){e(this,t);this.translucent=false}t.prototype.hostData=function(){var t;var e=r(this);return{class:Object.assign({},c(this.color),(t={"card-header-translucent":this.translucent},t[e]=true,t))}};t.prototype.__stencil_render=function(){return n("slot",null)};t.prototype.render=function(){return n(s,this.hostData(),this.__stencil_render())};Object.defineProperty(t,"style",{get:function(){return":host{display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color) ::slotted(ion-card-subtitle),:host(.ion-color) ::slotted(ion-card-title){color:currentColor}:host{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host(.card-header-translucent){background-color:rgba(var(--ion-background-color-rgb,255,255,255),.9);-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px)}"},enumerable:true,configurable:true});return t}();t("ion_card_header",u)}}}); | 1,496 | 1,496 | 0.750668 |
12b77a6e24be5c2e764ba3319c2efe9ef8033449 | 3,799 | js | JavaScript | packages/website/storybook/2-apis/NetInfo/NetInfoScreen.js | sambulosenda/react-native-web | 45f94eb43daa3cb3d7fae0295877345a176c04c4 | [
"MIT"
] | 4 | 2018-09-21T02:04:11.000Z | 2021-01-16T22:07:26.000Z | packages/website/storybook/2-apis/NetInfo/NetInfoScreen.js | sambulosenda/react-native-web | 45f94eb43daa3cb3d7fae0295877345a176c04c4 | [
"MIT"
] | 12 | 2020-07-19T15:44:13.000Z | 2022-02-26T23:59:46.000Z | packages/website/storybook/2-apis/NetInfo/NetInfoScreen.js | sambulosenda/react-native-web | 45f94eb43daa3cb3d7fae0295877345a176c04c4 | [
"MIT"
] | 2 | 2019-07-29T12:07:53.000Z | 2020-09-06T03:15:29.000Z | /**
* @flow
*/
import React from 'react';
import UIExplorer, {
AppText,
Code,
Description,
DocItem,
ExternalLink,
Section,
storiesOf
} from '../../ui-explorer';
const NetInfoScreen = () => (
<UIExplorer title="NetInfo" url="2-apis/NetInfo">
<Description>
<AppText>
NetInfo asynchronously determines the online/offline status and additional connection
information (where available) of the application.
</AppText>
<AppText>
Note that connection type information is limited to how well the browser supports the{' '}
<ExternalLink href="https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation">
NetworkInformation API
</ExternalLink>. Connection types will be <Code>unknown</Code> when support is missing.
</AppText>
</Description>
<Section title="Types">
<DocItem
description={
<AppText>
One of <Code>bluebooth</Code>, <Code>cellular</Code>, <Code>ethernet</Code>,{' '}
<Code>mixed</Code>, <Code>mixed</Code>, <Code>none</Code>, <Code>other</Code>,{' '}
<Code>unknown</Code>, <Code>wifi</Code>, <Code>wimax</Code>
</AppText>
}
name="ConnectionType"
/>
<DocItem
description={
<AppText>
One of <Code>slow-2g</Code>, <Code>2g</Code>, <Code>3g</Code>, <Code>4g</Code>,{' '}
<Code>unknown</Code>.
</AppText>
}
name="EffectiveConnectionType"
/>
<DocItem
description={
<Code>{`{
effectiveType: EffectiveConnectionType;
type: ConnectionType;
downlink?: number;
downlinkMax?: number;
rtt?: number;
}`}</Code>
}
name="ConnectionEventType"
/>
</Section>
<Section title="Methods">
<DocItem
description={
<AppText>
Adds an event handler. The <Code>connectionChange</Code> event fires when the network
status changes. The argument to the event handler is an object of type{' '}
<Code>ConnectionEventType</Code>.
</AppText>
}
example={{
code: `NetInfo.addEventListener('connectionChange', ({ effectiveType, type }) => {
console.log('Effective connection type:', effectiveType);
console.log('Connection type:', type);
})`
}}
name="static addEventListener"
typeInfo="(eventName, handler) => void"
/>
<DocItem
description={
<AppText>
Returns a promise that resolves with an object of type <Code>ConnectionEventType</Code>.
</AppText>
}
example={{
code: `NetInfo.getConnectionInfo().then(({ effectiveType, type }) => {
console.log('Effective connection type:', effectiveType);
console.log('Connection type:', type);
});`
}}
name="static getConnectionInfo"
typeInfo="() => Promise<ConnectionEventType>"
/>
<DocItem
description="Removes the listener for network status changes."
name="static removeEventListener"
typeInfo="(eventName, handler) => void"
/>
</Section>
<Section title="Properties">
<DocItem
description="An object with similar methods as above but the listener receives a boolean which represents the internet connectivity. Use this if you are only interested with whether the device has internet connectivity."
example={{
code: `NetInfo.isConnected.fetch().then((isConnected) => {
console.log('Connection status:', (isConnected ? 'online' : 'offline'));
});`
}}
name="isConnected"
typeInfo="ObjectExpression"
/>
</Section>
</UIExplorer>
);
storiesOf('APIs', module).add('NetInfo', NetInfoScreen);
| 30.637097 | 228 | 0.599631 |
12b8a404374dd5d7e5bdf1ca087b4c818dc193fd | 931 | js | JavaScript | __tests__/Intern.test.js | rpgarde/team-profile-generator | 57cd5a9c8ae1fb20759110c3a3f1045edeee1387 | [
"MIT"
] | null | null | null | __tests__/Intern.test.js | rpgarde/team-profile-generator | 57cd5a9c8ae1fb20759110c3a3f1045edeee1387 | [
"MIT"
] | null | null | null | __tests__/Intern.test.js | rpgarde/team-profile-generator | 57cd5a9c8ae1fb20759110c3a3f1045edeee1387 | [
"MIT"
] | null | null | null | const Intern = require("../lib/Intern.js");
describe("Intern", () => {
describe("getName", () => {
it("Should return name", () => {
expect(new Intern('Paolo',10,'rpgarde@gmail.com','USyd').getName()).toBe('Paolo')
});
});
describe("getId", () => {
it("Should return Id", () => {
expect(new Intern('Paolo',10,'rpgarde@gmail.com','USyd').getId()).toBe(10)
});
});
describe("getEmail", () => {
it("Should return Email", () => {
expect(new Intern('Paolo',10,'rpgarde@gmail.com','USyd').getEmail()).toBe('rpgarde@gmail.com')
});
});
describe("getRole", () => {
it("Should return Role", () => {
expect(new Intern('Paolo',10,'rpgarde@gmail.com','USyd').getRole()).toBe("Intern")
});
});
describe("getSchool", () => {
it("Should return school", () => {
expect(new Intern('Paolo',10,'rpgarde@gmail.com','USyd').getSchool()).toBe('USyd')
});
});
});
| 31.033333 | 100 | 0.540279 |
12b96d500b2431b97114efcdf0f4727389521f42 | 458 | js | JavaScript | doc/api/peripheral/html/search/enums_0.js | emanuellucas2/OVPsimProject | 6c9f5bfaaa135fa63d63746bacf5759c6d6c0e9e | [
"TCL"
] | null | null | null | doc/api/peripheral/html/search/enums_0.js | emanuellucas2/OVPsimProject | 6c9f5bfaaa135fa63d63746bacf5759c6d6c0e9e | [
"TCL"
] | null | null | null | doc/api/peripheral/html/search/enums_0.js | emanuellucas2/OVPsimProject | 6c9f5bfaaa135fa63d63746bacf5759c6d6c0e9e | [
"TCL"
] | null | null | null | var searchData=
[
['bhmendiane',['bhmEndianE',['../bhm_8h.html#a76a50ca1febf1a6453a270a7f6412fce',1,'bhm.h']]],
['bhmrestartreasone',['bhmRestartReasonE',['../bhm_8h.html#a07288bd567779d843a86598ed90494dd',1,'bhm.h']]],
['bhmsaverestorestatuse',['bhmSaveRestoreStatusE',['../bhm_8h.html#a708a6c56004ba775bb5d73a5cb4dd748',1,'bhm.h']]],
['bhmsystemeventtypee',['bhmSystemEventTypeE',['../bhm_8h.html#a07cc0907e7a69507a6d9ed6081100df2',1,'bhm.h']]]
];
| 57.25 | 117 | 0.740175 |
12b9e21d0ddf42b85aa1ce5b8c296383211911cc | 933 | js | JavaScript | script.js | sahelibasu23/demo-trying-cache-js | b47c0a19c6194653d084c85d474dee180001505b | [
"Apache-2.0"
] | null | null | null | script.js | sahelibasu23/demo-trying-cache-js | b47c0a19c6194653d084c85d474dee180001505b | [
"Apache-2.0"
] | null | null | null | script.js | sahelibasu23/demo-trying-cache-js | b47c0a19c6194653d084c85d474dee180001505b | [
"Apache-2.0"
] | null | null | null | const form = document.querySelector('form');
const ul = document.querySelector('ul');
const button = document.querySelector('button');
const input = document.getElementById('item');
let itemsArray = localStorage.getItem('items') ? JSON.parse(localStorage.getItem('items')) : [];
localStorage.setItem('items', JSON.stringify(itemsArray));
const data = JSON.parse(localStorage.getItem('items'));
const liMaker = (text) => {
const li = document.createElement('li');
li.textContent = text;
ul.appendChild(li);
}
form.addEventListener('submit', function (e) {
e.preventDefault();
itemsArray.push(input.value);
localStorage.setItem('items', JSON.stringify(itemsArray));
liMaker(input.value);
input.value = "";
});
data.forEach(item => {
liMaker(item);
});
button.addEventListener('click', function () {
localStorage.clear();
while (ul.firstChild) {
ul.removeChild(ul.firstChild);
}
itemsArray = [];
});
| 25.916667 | 96 | 0.699893 |
12ba0ab0f249a3b5d13591523dc4076e33b89fc3 | 8,618 | js | JavaScript | js/app.1be112c5.js | Abd-Elrazek/clock-shop | cd9dc040cf73ad155c740eef5675af2bab02975d | [
"MIT"
] | 1 | 2019-04-16T08:13:44.000Z | 2019-04-16T08:13:44.000Z | js/app.1be112c5.js | Abd-Elrazek/clock-shop | cd9dc040cf73ad155c740eef5675af2bab02975d | [
"MIT"
] | null | null | null | js/app.1be112c5.js | Abd-Elrazek/clock-shop | cd9dc040cf73ad155c740eef5675af2bab02975d | [
"MIT"
] | null | null | null | (function(t){function e(e){for(var n,s,o=e[0],c=e[1],l=e[2],f=0,d=[];f<o.length;f++)s=o[f],i[s]&&d.push(i[s][0]),i[s]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(t[n]=c[n]);u&&u(e);while(d.length)d.shift()();return r.push.apply(r,l||[]),a()}function a(){for(var t,e=0;e<r.length;e++){for(var a=r[e],n=!0,o=1;o<a.length;o++){var c=a[o];0!==i[c]&&(n=!1)}n&&(r.splice(e--,1),t=s(s.s=a[0]))}return t}var n={},i={1:0},r=[];function s(e){if(n[e])return n[e].exports;var a=n[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=t,s.c=n,s.d=function(t,e,a){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(a,n,function(e){return t[e]}.bind(null,n));return a},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/clock-shop/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var l=0;l<o.length;l++)e(o[l]);var u=c;r.push([8,0]),a()})({8:function(t,e,a){t.exports=a("Vtdi")},"8z7e":function(t,e,a){},"92aI":function(t,e,a){},Bh4a:function(t,e,a){},G2l2:function(t,e,a){"use strict";var n=a("OWla"),i=a.n(n);i.a},HQzE:function(t,e,a){},OWla:function(t,e,a){},VFKH:function(t,e,a){},Vtdi:function(t,e,a){"use strict";a.r(e);a("VRzm");var n=a("Kw5r"),i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"app"}},[a("Header"),a("Banner"),a("Content"),a("Footer")],1)},r=[],s=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},o=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"main-navigation navbar-fixed-top"},[a("nav",{staticClass:"navbar navbar-default"},[a("div",{staticClass:"container"},[a("div",{staticClass:"navbar-header"},[a("button",{staticClass:"navbar-toggle",attrs:{type:"button","data-toggle":"collapse","data-target":"#myNavbar"}},[a("span",{staticClass:"icon-bar"}),a("span",{staticClass:"icon-bar"}),a("span",{staticClass:"icon-bar"})]),a("a",{staticClass:"navbar-brand",attrs:{href:"index.html"}},[t._v("Clock Shop")])]),a("div",{staticClass:"collapse navbar-collapse",attrs:{id:"myNavbar"}},[a("ul",{staticClass:"nav navbar-nav navbar-right"},[a("li",[a("a",{attrs:{href:"#portfolio"}},[t._v("Visit")])]),a("li",[a("a",{attrs:{href:"https://github.com/a-jie/clock-shop",target:"_blank"}},[t._v("Star Me")])]),a("li",[a("a",{attrs:{href:"https://github.com/a-jie/clock-shop/pulls",target:"_blank"}},[t._v("Submit Code")])])])])])])])}],c={name:"Header",props:{}},l=c,u=(a("eZ2R"),a("uMhA")),f=Object(u["a"])(l,s,o,!1,null,"2446b1ea",null),d=f.exports,p=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},v=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"section-padding",attrs:{id:"banner"}},[a("div",{staticClass:"container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"jumbotron"},[a("h1",{staticClass:"small"},[t._v("Welcome To "),a("span",{staticClass:"bold"},[t._v("Clock Shop")])]),a("p",{staticClass:"big"},[t._v("There are a variety of beautiful and unusual clock codes.")]),a("a",{staticClass:"btn btn-banner",attrs:{href:"https://github.com/a-jie/clock-shop",target:"_blank"}},[t._v("Star Me"),a("i",{staticClass:"fa fa-send"})])])])])])}],h={name:"Banner",props:{}},b=h,m=(a("Y/sk"),Object(u["a"])(b,p,v,!1,null,"85e5a94a",null)),g=m.exports,_=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},C=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"footer-bottom"},[a("div",{staticClass:"container"},[a("div",{staticClass:"col-md-12 text-center wow zoomIn",staticStyle:{visibility:"visible","animation-name":"zoomIn"}},[a("div",{staticClass:"footer_copyright"},[a("p",[t._v(" © Copyright, a-jie All Rights Reserved.")]),a("div",{staticClass:"credits"},[t._v("\n WebSite designed by "),a("a",{attrs:{href:"https://bootstrapmade.com/"}},[t._v("BootstrapMade.com")])])])])])])}],y={name:"Footer",props:{}},k=y,j=(a("G2l2"),Object(u["a"])(k,_,C,!1,null,"03f3773e",null)),w=j.exports,x=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"portfolio"}},[a("div",{staticClass:"container"},[t._m(0),a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-12"},[a("ul",{attrs:{id:"portfolio-flters"}},[a("Btn",{attrs:{active:"true"},nativeOn:{click:function(e){t.tabClick(0)}}},[t._v("Beautiful Style")]),a("Btn",{nativeOn:{click:function(e){t.tabClick(1)}}},[t._v("Creative Design")]),a("Btn",{nativeOn:{click:function(e){t.tabClick(2)}}},[t._v("Electronic Clock")])],1)])]),a("div",{staticClass:"row",attrs:{id:"portfolio-wrapper"}},t._l(t.items,function(e){return a("div",{key:e,staticClass:"col-lg-4 col-md-6 portfolio-item filter-app"},[a("iframe",{staticStyle:{width:"100%"},attrs:{height:"265",scrolling:"no",src:t.getHash(e),frameborder:"no",allowtransparency:"true",allowfullscreen:"true"}})])}))]),a("footer",{staticClass:"container"},[a("div",{staticClass:"float-left nbtn",class:{"nbtn-disabled":!t.isEnabled("prev")},on:{click:function(e){t.prevPage()}}},[t._v("\n Prev Page\n ")]),a("div",{staticClass:"float-right nbtn",class:{"nbtn-disabled":!t.isEnabled("next")},on:{click:function(e){t.nextPage()}}},[t._v("\n Next Page\n ")])])])},E=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page-title text-center"},[a("h1",[t._v("Clock Exhibition Counter")]),a("p",[t._v("All the code comes from the "),a("a",{attrs:{href:"https://codepen.io/",target:"_blank"}},[t._v("codepen")]),t._v(" site. They are really great. \n "),a("br"),t._v("I want to pay tribute to the original author. ")]),a("hr",{staticClass:"pg-titl-bdr-btm"})])}],O=(a("Vd3H"),a("pIFo"),a("rGqo"),a("vDqi")),I=a.n(O),B=a("ZR4k"),N=a.n(B),S=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",{staticClass:"nbtn",class:{"btn-active":t.isActive},on:{click:function(e){t.click()}}},[t._t("default")],2)},P=[],$=a("qUsI"),T=a.n($),H=new n["a"],M={name:"Btn",props:["active"],created:function(){var t=this;H.$on("BTN_CLICK",function(e){e!==t.id&&(t.isActive=!1)}),this.active&&(this.isActive=!0)},data:function(){return{id:T.a.uuid(),isActive:!1}},methods:{click:function(){this.isActive=!0,H.$emit("BTN_CLICK",this.id)}}},A=M,z=(a("Y8uE"),Object(u["a"])(A,S,P,!1,null,"0fdc95ec",null)),V=z.exports,F=9,R={name:"Content",components:{Btn:V},data:function(){return{currentTab:0,pageNum:0,data:[],get items(){var t=this.pageNum*F,e=t+F;return this.allItems?this.allItems.slice(t,e):null},get allItems(){return this.data[this.currentTab]||[]}}},created:function(){this.loadData()},methods:{loadData:function(){var t=this;I.a.get("./data.yaml").then(function(e){var a=N.a.safeLoad(e["data"]||e["_body"]);a.forEach(function(t){t.forEach(function(t,e,a){return a[e]=t.replace("https://codepen.io/","").replace(/^.{1,30}\/pen\//gi,"")}),t.sort(function(){return.5-Math.random()})}),t.data=a})},tabClick:function(t){this.pageNum=0,this.currentTab=parseInt(t)},getHash:function(t){return"//codepen.io/scorch/embed/".concat(t,"/?rerun-position=hidden&class=scale&height=265&theme-id=dark&default-tab=result&embed-version=2")},isEnabled:function(t){return"prev"===t?!(this.pageNum<=0):!((this.pageNum+1)*F>=this.allItems.length)||void 0},prevPage:function(){this.pageNum<=0||this.pageNum--},nextPage:function(){(this.pageNum+1)*F>=this.allItems.length||this.pageNum++}}},Y=R,G=Object(u["a"])(Y,x,E,!1,null,null,null),K=G.exports,L={name:"app",components:{Banner:g,Header:d,Footer:w,Content:K}},Z=L,D=(a("ZL7j"),Object(u["a"])(Z,i,r,!1,null,null,null)),W=D.exports;a("nttj"),a("HQzE"),a("8z7e");n["a"].config.productionTip=!1,new n["a"]({render:function(t){return t(W)}}).$mount("#app")},"Y/sk":function(t,e,a){"use strict";var n=a("VFKH"),i=a.n(n);i.a},Y8uE:function(t,e,a){"use strict";var n=a("YfsG"),i=a.n(n);i.a},YfsG:function(t,e,a){},ZL7j:function(t,e,a){"use strict";var n=a("Bh4a"),i=a.n(n);i.a},eZ2R:function(t,e,a){"use strict";var n=a("92aI"),i=a.n(n);i.a},nttj:function(t,e,a){}});
//# sourceMappingURL=app.1be112c5.js.map | 4,309 | 8,577 | 0.649223 |
12bb4d01ee0c407abe987df59661afdd2a7d1f0f | 1,826 | js | JavaScript | webapp/js/components/dialog/ConfirmDeleteNamespaceDialog.js | Glimlag/INF5750 | 32c79222521bf9684b1b03b8e2dde93d4f9e6a83 | [
"MIT"
] | null | null | null | webapp/js/components/dialog/ConfirmDeleteNamespaceDialog.js | Glimlag/INF5750 | 32c79222521bf9684b1b03b8e2dde93d4f9e6a83 | [
"MIT"
] | null | null | null | webapp/js/components/dialog/ConfirmDeleteNamespaceDialog.js | Glimlag/INF5750 | 32c79222521bf9684b1b03b8e2dde93d4f9e6a83 | [
"MIT"
] | null | null | null | import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import { closeConfirmDeleteNamespaceDialog } from 'actions/dialogActions';
import { deleteNamespace } from 'actions/actions';
export class ConfirmDeleteNamespaceDialog extends Component {
handleCancel() {
this.props.closeDialog();
}
handleConfirmed() {
this.props.deleteNamespace(this.props.dialogprops.namespace);
}
render() {
const actions = [<FlatButton
label="Cancel"
primary={false}
onTouchTap={this.handleCancel.bind(this)}
/>,
<FlatButton
label="Delete"
primary
onTouchTap={this.handleConfirmed.bind(this)}
/>,
];
return (
(<Dialog
actions={actions}
modal={false}
open
contentStyle={{ maxWidth: '400px' }}
onRequestClose={this.handleCancel.bind(this)}
>
Are you sure you want to delete '{this.props.dialogprops.namespace}'?
</Dialog>)
);
}
}
const mapDispatchToProps = (dispatch) => ({
closeDialog() {
dispatch(closeConfirmDeleteNamespaceDialog());
},
deleteNamespace(namespace) {
dispatch(deleteNamespace(namespace));
dispatch(closeConfirmDeleteNamespaceDialog());
},
});
ConfirmDeleteNamespaceDialog.propTypes = {
closeDialog: PropTypes.func,
dialogprops: PropTypes.shape({
namespace: PropTypes.string.isRequired,
}),
deleteNamespace: PropTypes.func,
};
export default connect(
null,
mapDispatchToProps
)(ConfirmDeleteNamespaceDialog);
| 27.666667 | 85 | 0.605148 |
12bb66690f40a4ffc30827707ae9cf7f344d71fa | 59 | js | JavaScript | apps/web/assets/javascripts/application.js | GabrielMalakias/Usgard | 2058cb91aaefc6b4e554b5074c0e464b303be0e0 | [
"MIT"
] | 5 | 2017-11-15T13:21:19.000Z | 2019-08-15T10:04:02.000Z | apps/web/assets/javascripts/application.js | GabrielMalakias/usgard | 2058cb91aaefc6b4e554b5074c0e464b303be0e0 | [
"MIT"
] | null | null | null | apps/web/assets/javascripts/application.js | GabrielMalakias/usgard | 2058cb91aaefc6b4e554b5074c0e464b303be0e0 | [
"MIT"
] | null | null | null | (function() {
this.App || (this.App = {});
}).call(this)
| 14.75 | 30 | 0.508475 |
12bc1789ba22afb8573e5e255a54e7b454be431b | 539 | js | JavaScript | aws-exports.js | justinmbaltazar/Mental-Health-Suggestor | d5b04b3e03b25573f08596ba581f63d176f62ca6 | [
"MIT"
] | null | null | null | aws-exports.js | justinmbaltazar/Mental-Health-Suggestor | d5b04b3e03b25573f08596ba581f63d176f62ca6 | [
"MIT"
] | null | null | null | aws-exports.js | justinmbaltazar/Mental-Health-Suggestor | d5b04b3e03b25573f08596ba581f63d176f62ca6 | [
"MIT"
] | 2 | 2021-07-14T02:13:38.000Z | 2021-07-27T19:34:01.000Z | /* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": "us-east-1:a995b748-145b-4b75-8cbb-b12277e95c5e",
"aws_cognito_region": "us-east-1",
"oauth": {},
"aws_bots": "enable",
"aws_bots_config": [
{
"name": "OrderFlowers_dev",
"alias": "$LATEST",
"region": "us-east-1"
}
]
};
export default awsmobile;
| 25.666667 | 101 | 0.599258 |