commit
stringlengths 40
40
| subject
stringlengths 1
3.25k
| old_file
stringlengths 4
311
| new_file
stringlengths 4
311
| old_contents
stringlengths 0
26.3k
| lang
stringclasses 3
values | proba
float64 0
1
| diff
stringlengths 0
7.82k
|
---|---|---|---|---|---|---|---|
24496b610b4f262f85a8b5041fd1d39efd6771be | Fix guest pool inquiry taking | packages/rocketchat-livechat/client/views/sideNav/livechat.js | packages/rocketchat-livechat/client/views/sideNav/livechat.js | /* globals LivechatInquiry, KonchatNotification */
Template.livechat.helpers({
isActive() {
const query = {
t: 'l',
f: { $ne: true },
open: true,
rid: Session.get('openedRoom')
};
const options = { fields: { _id: 1 } };
if (ChatSubscription.findOne(query, options)) {
return 'active';
}
},
rooms() {
const query = {
t: 'l',
open: true
};
const user = RocketChat.models.Users.findOne(Meteor.userId(), {
fields: { 'settings.preferences.unreadRoomsMode': 1 }
});
if (user && user.settings && user.settings.preferences && user.settings.preferences.unreadRoomsMode) {
query.alert = { $ne: true };
}
return ChatSubscription.find(query, { sort: {
't': 1,
'name': 1
}});
},
inquiries() {
// get all inquiries of the department
const inqs = LivechatInquiry.find({
agents: Meteor.userId(),
status: 'open'
}, {
sort: {
'ts' : 1
}
});
// for notification sound
inqs.forEach((inq) => {
KonchatNotification.newRoom(inq.rid);
});
return inqs;
},
guestPool() {
return RocketChat.settings.get('Livechat_Routing_Method') === 'Guest_Pool';
},
available() {
const statusLivechat = Template.instance().statusLivechat.get();
return {
status: statusLivechat === 'available' ? 'status-online' : '',
icon: statusLivechat === 'available' ? 'icon-toggle-on' : 'icon-toggle-off',
hint: statusLivechat === 'available' ? t('Available') : t('Not_Available')
};
},
isLivechatAvailable() {
return Template.instance().statusLivechat.get() === 'available';
},
showQueueLink() {
if (RocketChat.settings.get('Livechat_Routing_Method') !== 'Least_Amount') {
return false;
}
return RocketChat.authz.hasRole(Meteor.userId(), 'livechat-manager') || (Template.instance().statusLivechat.get() === 'available' && RocketChat.settings.get('Livechat_show_queue_list_link'));
},
activeLivechatQueue() {
FlowRouter.watchPathChange();
if (FlowRouter.current().route.name === 'livechat-queue') {
return 'active';
}
}
});
Template.livechat.events({
'click .livechat-status'() {
Meteor.call('livechat:changeLivechatStatus', (err /*, results*/) => {
if (err) {
return handleError(err);
}
});
},
'click .inquiries .open-room'(event) {
event.preventDefault();
event.stopPropagation();
swal({
title: t('Livechat_Take_Confirm'),
text: `${ t('Message') }: ${ this.message }`,
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: t('Take_it')
}, (isConfirm) => {
if (isConfirm) {
Meteor.call('livechat:takeInquiry', this._id, (error, result) => {
if (!error) {
RocketChat.roomTypes.openRouteLink(result.t, result);
}
});
}
});
}
});
Template.livechat.onCreated(function() {
this.statusLivechat = new ReactiveVar();
this.autorun(() => {
if (Meteor.userId()) {
const user = RocketChat.models.Users.findOne(Meteor.userId(), { fields: { statusLivechat: 1 } });
this.statusLivechat.set(user.statusLivechat);
} else {
this.statusLivechat.set();
}
});
this.subscribe('livechat:inquiry');
});
| JavaScript | 0 | @@ -2238,16 +2238,19 @@
es .
-open-roo
+sidebar-ite
m'(e
|
5de40384aaff3f9de3f0fc647451ca5be5b909db | test device | a/d/deviceSets.js | a/d/deviceSets.js | var deviceSets = [
{
name : 'Simple Devices',
devices : [
{ name: 'iPhone 4', w: 320, h:480, type:'phone', rotated: { w:416, h:320} },
{ name: 'Small Tablet', w: 600, h: 1000, type:'tablet' },
{ name: 'Apple iPad', w: 768, h:1024, type:'tablet' },
{ name: '15"', w: 1024, h:768, type:'desktop' },
{ name: 'Macbook 13"', w: 1280, h:800, type:'laptop' }, ]
},
{
name : 'Common Devices',
devices : [
{ name: 'iPhone 4', w: 320, h:480, type:'phone', rotated: { w:416, h:320} },
{ name: 'iPhone 5', w: 320, h:568, type:'phone', rotated: { w:568, h:320} },
{ name: 'BlackBerry Curve', w: 480, h:360, type:'phone' },
{ name: 'Nexus 4', w: 382, h:592, type:'phone', rotated: { w:416, h:320} },
{ name: 'Galaxy S', w: 480, h:800, type:'phone', rotated: { w:800, h:480} },
{ name: 'Nexus 7', w: 600, h:960, type:'tablet' },
{ name: 'Nexus 10', w: 752, h:1280, type:'tablet' },
{ name: 'Apple iPad', w: 768, h:1024, type:'tablet' },
{ name: '15"', w: 1024, h:768, type:'desktop' },
{ name: 'Macbook 13"', w: 1280, h:800, type:'laptop' },
{ name: 'Macbook 15"', w: 1440, h:900, type:'laptop' },
{ name: '27" Cinema Display', w: 2560, h:1440, type:'desktop' },
]
},
{
name : 'Breakpoints',
devices : [
{ name: '1', w: 320, h: 480, type:'phone' },
{ name: '2', w: 600, h: 1000, type:'tablet' },
{ name: '3', w: 760, h: 1024 },
{ name: '4', w: 1024, h: 768 },
]
}
]; | JavaScript | 0.000001 | @@ -12,16 +12,182 @@
ets = %5B%0A
+/*%0A %7B%0A name : 'One Device',%0A devices : %5B%0A %7B name: 'iPhone 4', w: 320, h:480, type:'phone', rotated: %7B w:416, h:320%7D %7D%0A %5D%0A %7D,%0A*/%0A
%7B%0A
@@ -591,16 +591,25 @@
ptop' %7D,
+ %0A
|
a9fa59c88f28c589bf2f12e31ce67264607de5a6 | Add classname to table element | src/main/webapp/components/BuilderDataTable.js | src/main/webapp/components/BuilderDataTable.js | import * as React from 'react';
const HEADERS = ['no', 'text', 'log'];
export const BuilderDataTable = props => {
return (
<table>
<thead>
<BuilderRow
header={true}
data={HEADERS}
/>
</thead>
<tbody>
<BuilderRow data={} />
</tbody>
</table>
);
} | JavaScript | 0.000002 | @@ -46,16 +46,17 @@
S = %5B'no
+.
', 'text
@@ -127,24 +127,47 @@
(%0A %3Ctable
+ className='data-table'
%3E%0A %3Cthe
|
1d8582589e826a2a62aba4f690488c62675a797b | Remove clutter message in Eslint plugin (#434) | lib/ExecutionControlEpic/Plugins/Eslint/Process/lsp.js | lib/ExecutionControlEpic/Plugins/Eslint/Process/lsp.js | /* eslint-disable */
const {
createMessageConnection,
StreamMessageReader,
StreamMessageWriter,
} = require("vscode-jsonrpc");
const { exec } = require("child_process");
const connection = createMessageConnection(
new StreamMessageReader(process.stdin),
new StreamMessageWriter(process.stdout),
);
function getDiagnostics(openedPath) {
exec(
`${process.env.ESLINT_BINARY} ${openedPath} -f json`,
{ cwd: process.env.ESLINT_CWD },
(err, stdout, stderr) => {
// Note: If eslint finds diagnostics in the code, it will return 1, and
// err will be non-null; actual execution errors will be tested in stderr
if (stderr) {
void err;
console.error("Error running Eslint: ", stderr.toString());
} else {
try {
const json = JSON.parse(stdout.toString());
connection.sendNotification("textDocument/publishDiagnostics", {
uri: openedPath,
diagnostics: json[0].messages.map(message => ({
source: "eslint",
severity: message.severity > 1 ? 1 : 2,
message: message.message,
range: {
start: {
line: message.line - 1,
character: message.column - 1,
},
end: {
line: message.endLine - 1,
character: message.endColumn - 1,
},
},
})),
});
} catch (e) {
console.error("Error in Eslint Language Server: ", e);
}
}
},
);
}
connection.onRequest("initialize", async () => {
connection.onNotification("textDocument/didOpen", didOpenEvent => {
console.error(didOpenEvent.textDocument.uri);
getDiagnostics(didOpenEvent.textDocument.uri);
});
connection.onNotification("textDocument/didSave", didSaveEvent => {
getDiagnostics(didSaveEvent.textDocument.uri);
});
});
connection.listen();
| JavaScript | 0 | @@ -486,19 +486,59 @@
-// Note: If
+if (stderr) %7B%0A // Note: err is non-null when
esl
@@ -574,32 +574,57 @@
code
-, it will
+%0A // (because the executable
return
+s
1
-, and%0A
+)%0A
@@ -632,29 +632,20 @@
//
-err will be non-null;
+To check for
act
@@ -668,53 +668,32 @@
rors
+,
w
-ill be tested in stderr%0A if (
+e need to read
stderr
-) %7B
%0A
@@ -1736,58 +1736,8 @@
%3E %7B%0A
- console.error(didOpenEvent.textDocument.uri);%0A
|
625bb1167d63829a941992d77455cbce650d2abd | Update config.js | bot/config.js | bot/config.js | // The WEBSOCKET server and port the bot should connect to.
// Most of the time this isn't the same as the URL, check the `Request URL` of
// the websocket.
// If you really don't know how to do this... Run `node getserver.js URL`.
// Fill in the URL of the client where `URL` is.
// For example: `node getserver.js http://example-server.psim.us/`
exports.server = 'cbc.pokecommunity.com';
exports.port = 8000;
// This is the server id.
// To know this one, you should check where the AJAX call 'goes' to when you
// log in.
// For example, on the Smogon server, it will say somewhere in the URL
// ~~showdown, meaning that the server id is 'showdown'.
// If you really don't know how to check this... run the said script above.
exports.serverid = 'pokecommunity';
// The nick and password to log in with
// If no password is required, leave pass empty
exports.nick = 'PokeCommBot';
exports.pass = 'filler';
// The rooms that should be joined.
// Joining Smogon's Showdown's Lobby is not allowed.
exports.rooms = ['lobby'];
// Any private rooms that should be joined.
// Private rooms will be moderated differently (since /warn doesn't work in them).
// The bot will also avoid leaking the private rooms through .seen
exports.privaterooms = ['staff'];
// The character text should start with to be seen as a command.
// Note that using / and ! might be 'dangerous' since these are used in
// Showdown itself.
// Using only alphanumeric characters and spaces is not allowed.
exports.commandcharacter = '.';
// The default rank is the minimum rank that can use a command in a room when
// no rank is specified in settings.json
exports.defaultrank = '%';
// Whether this file should be watched for changes or not.
// If you change this option, the server has to be restarted in order for it to
// take effect.
exports.watchconfig = true;
// Secondary websocket protocols should be defined here, however, Showdown
// doesn't support that yet, so it's best to leave this empty.
exports.secprotocols = [];
// What should be logged?
// 0 = error, ok, info, debug, recv, send
// 1 = error, ok, info, debug, cmdr, send
// 2 = error, ok, info, debug (recommended for development)
// 3 = error, ok, info (recommended for production)
// 4 = error, ok
// 5 = error
exports.debuglevel = 3;
// Users who can use all commands regardless of their rank. Be very cautious
// with this, especially on servers other than main.
exports.excepts = [];
// Whitelisted users are those who the bot will not enforce moderation for.
exports.whitelist = ['PokeCommBot'];
// Users in this list can use the regex autoban commands. Only add users who know how to write regular expressions and have your complete trust not to abuse the commands.
exports.regexautobanwhitelist = [];
// Add a link to the help for the bot here. When there is a link here, .help and .guide
// will link to it.
exports.botguide = '';
// Add a link to the git repository for the bot here for .git to link to.
exports.fork = 'https://github.com/awolffromspace/PC-Battle-Server-Bot';
// This allows the bot to act as an automated moderator. If enabled, the bot will
// mute users who send 6 lines or more in 6 or fewer seconds for 7 minutes. NOTE: THIS IS
// BY NO MEANS A PERFECT MODERATOR OR SCRIPT. It is a bot and so cannot think for itself or
// exercise moderator discretion. In addition, it currently uses a very simple method of
// determining who to mute and so may miss people who should be muted, or mute those who
// shouldn't. Use with caution.
exports.allowmute = true;
// The punishment values system allows you to customise how you want the bot to deal with
// rulebreakers. Spamming has a points value of 2, all caps has a points value of 1, etc.
exports.punishvals = {
1: 'warn',
2: 'mute',
3: 'hourmute',
4: 'hourmute',
5: 'lock'
};
//This key is used to deliver requests from Google Spreadsheets. Used by the wifi room.
exports.googleapikey = '';
| JavaScript | 0.000002 | @@ -2424,24 +2424,30 @@
.excepts = %5B
+'wolf'
%5D;%0A%0A// White
@@ -2888,16 +2888,77 @@
uide = '
+http://www.pokecommunity.com/showthread.php?t=289012#botguide
';%0A%0A// A
|
e29e91c0924fe6225fd627da896b2f2b365cda15 | Remove requireOptions | AbstractFilter.js | AbstractFilter.js | /*
backgrid-filter
http://github.com/wyuenho/backgrid
Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
Licensed under the MIT @license.
*/
(function (factory) {
// CommonJS
if (typeof exports == "object") {
module.exports = factory(require("underscore"),
require("backbone"),
require("backgrid"));
}
// Browser
else if (typeof _ !== "underscore" &&
typeof Backbone !== "undefined" &&
typeof Backgrid !== "undefined") {
factory(_, Backbone, Backgrid);
}
}(function (_, Backbone, Backgrid) {
"use strict";
/**
AbstractFilter is a search form widget whose subclasses filter the current collection.
@class Backgrid.Extension.AbstractFilter
*/
Backgrid.Extension.AbstractFilter = Backbone.View.extend({
/** @property */
tagName: "form",
/** @property */
className: "backgrid-filter form-search",
/** @property {function(Object, ?Object=): string} template */
template: _.template('<div class="input-prepend input-append"><span class="add-on"><i class="icon-search"></i></span><input class="searchbox" type="text" <% if (placeholder) { %> placeholder="<%- placeholder %>" <% } %> name="<%- name %>" /><span class="add-on"><a class="close" href="#">×</a></span></div>'),
/** @property */
events: {
"click .close": "handleClickClear",
"submit": "handleSubmit"
},
/**
@property [wait=149] The time in milliseconds to wait since for since the
last change to the search box's value before searching. This value can be
adjusted depending on how often the search box is used and how large the
search index is.
*/
wait: 149,
/** @property {string} [name='q'] Query key */
name: "q",
/**
@property {string} [placeholder] The HTML5 placeholder to appear beneath
the search box.
*/
placeholder: null,
/**
Debounces the #search and #clear methods.
@param {Object} options
@param {Backbone.Collection} options.collection
@param {string} [options.name]
@param {string} [options.placeholder]
@param {string} [options.wait=149]
*/
initialize: function (options) {
Backgrid.requireOptions(options, ["collection"]);
Backbone.View.prototype.initialize.apply(this, arguments);
this.wait = options.wait || this.wait;
this.name = options.name || this.name;
this.placeholder = options.placeholder || this.placeholder;
// These methods should always be debounced
},
searchBox: function () {
return this.$el.find("input.searchbox");
},
setQuery: function(newValue) {
this.searchBox().val(newValue);
},
clearQuery: function() {
this.searchBox().val(null);
},
getQuery: function() {
return this.searchBox().val();
},
handleSubmit: function (e) {
e.preventDefault();
this.search();
},
handleClickClear: function (e) {
e.preventDefault();
this.clear();
},
/**
Renders a search form with a text box, optionally with a placeholder and
a preset value if supplied during initialization.
*/
render: function () {
this.$el.empty().append(this.template({
name: this.name,
placeholder: this.placeholder,
value: this.value
}));
this.delegateEvents();
return this;
},
_debounceMethods: function (methodNames) {
if (_.isString(methodNames)) methodNames = [methodNames];
this.undelegateEvents();
var methodName, method;
for (var i = 0, l = methodNames.length; i < l; i++) {
methodName = methodNames[i];
method = this[methodName];
this[methodName] = _.debounce(method, this.wait);
}
this.delegateEvents();
},
/**
* Apply this filter.
* @abstract
*/
search: function() {
throw new Error('must be implemented by subclass!');
},
/**
* Un-apply this filter.
* @abstract
*/
clear: function() {
throw new Error('must be implemented by subclass!');
}
});
}));
| JavaScript | 0.000002 | @@ -2315,68 +2315,8 @@
) %7B%0A
- Backgrid.requireOptions(options, %5B%22collection%22%5D);%0A
|
eb3d2d0423b79478d9d28ab092d4c7d28fd36846 | Return in case of no data(no select query) | debug-db/src/main/assets/debugDbHome/js/app.js | debug-db/src/main/assets/debugDbHome/js/app.js | $( document ).ready(function() {
getDBList();
$("#query").keypress(function(e){
if(e.which == 13) {
queryFunction();
}
});
//update currently selected database
$( document ).on( "click", "#db-list .list-group-item", function() {
$("#db-list .list-group-item").each(function() {
$(this).removeClass('selected');
});
$(this).addClass('selected');
});
//update currently table database
$( document ).on( "click", "#table-list .list-group-item", function() {
$("#table-list .list-group-item").each(function() {
$(this).removeClass('selected');
});
$(this).addClass('selected');
});
});
var isDatabaseSelected = true;
function getData(tableName) {
$.ajax({url: "getAllDataFromTheTable?tableName="+tableName, success: function(result){
result = JSON.parse(result);
inflateData(result);
}});
}
function queryFunction() {
var query = $('#query').val();
$.ajax({url: "query?query="+escape(query), success: function(result){
result = JSON.parse(result);
inflateData(result);
}});
}
function downloadDb() {
if (isDatabaseSelected) {
$.ajax({url: "downloadDb", success: function(){
window.location = 'downloadDb';
}});
}
}
function getDBList() {
$.ajax({url: "getDbList", success: function(result){
result = JSON.parse(result);
var dbList = result.rows;
$('#db-list').empty();
var isSelectionDone = false;
for(var count = 0; count < dbList.length; count++){
if(dbList[count].indexOf("journal") == -1){
$("#db-list").append("<a href='#' id=" +dbList[count] + " class='list-group-item' onClick='openDatabaseAndGetTableList(\""+ dbList[count] + "\");'>" +dbList[count] + "</a>");
if(!isSelectionDone){
isSelectionDone = true;
$('#db-list').find('a').trigger('click');
}
}
}
}});
}
function openDatabaseAndGetTableList(db) {
if("APP_SHARED_PREFERENCES" == db) {
$('#run-query').removeClass('active');
$('#run-query').addClass('disabled');
$('#selected-db-info').removeClass('active');
$('#selected-db-info').addClass('disabled');
isDatabaseSelected = false;
$("#selected-db-info").text("SharedPreferences");
} else {
$('#run-query').removeClass('disabled');
$('#run-query').addClass('active');
$('#selected-db-info').removeClass('disabled');
$('#selected-db-info').addClass('active');
isDatabaseSelected = true;
$("#selected-db-info").text("Export Selected Database : "+db);
}
$.ajax({url: "getTableList?database="+db, success: function(result){
result = JSON.parse(result);
var tableList = result.rows;
var dbVersion = result.dbVersion;
if("APP_SHARED_PREFERENCES" != db) {
$("#selected-db-info").text("Export Selected Database : "+db +" Version : "+dbVersion);
}
$('#table-list').empty()
for(var count = 0; count < tableList.length; count++){
var tableName = tableList[count];
$("#table-list").append("<a href='#' data-db-name='"+db+"' data-table-name='"+tableName+"' class='list-group-item' onClick='getData(\""+ tableName + "\");'>" +tableName + "</a>");
}
}});
}
function inflateData(result){
if(result.isSuccessful){
if(!result.isSelectQuery){
showSuccessInfo("Query Executed Successfully");
}
var columnHeader = result.tableInfos;
// set function to return cell data for different usages like set, display, filter, search etc..
for(var i = 0; i < columnHeader.length; i++) {
columnHeader[i]['targets'] = i;
columnHeader[i]['data'] = function(row, type, val, meta) {
var dataType = row[meta.col].dataType;
if (type == "sort" && dataType == "boolean") {
return row[meta.col].value ? 1 : 0;
}
return row[meta.col].value;
}
}
var columnData = result.rows;
var tableId = "#db-data";
if ($.fn.DataTable.isDataTable(tableId) ) {
$(tableId).DataTable().destroy();
}
$("#db-data-div").remove();
$("#parent-data-div").append('<div id="db-data-div"><table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered display" id="db-data"></table></div>');
$(tableId).dataTable({
"data": columnData,
"columnDefs": columnHeader,
'bPaginate': true,
'searching': true,
'bFilter': true,
'bInfo': true,
"bSort" : true,
"scrollX": true,
"iDisplayLength": 10,
"dom": "Bfrtip",
select: 'single',
responsive: true,
altEditor: true, // Enable altEditor
buttons: [
{
extend: 'selected', // Bind to Selected row
text: 'Edit',
name: 'edit' // do not change name
}
]
})
//attach row-updated listener
$(tableId).on('update-row.dt', function (e, updatedRowData, callback) {
var updatedRowDataArray = JSON.parse(updatedRowData);
//add value for each column
var data = columnHeader;
for(var i = 0; i < data.length; i++) {
data[i].value = updatedRowDataArray[i].value;
data[i].dataType = updatedRowDataArray[i].dataType;
}
//send update table data request to server
updateTableData(data, callback);
});
// hack to fix alignment issue when scrollX is enabled
$(".dataTables_scrollHeadInner").css({"width":"100%"});
$(".table ").css({"width":"100%"});
}else{
if(!result.isSelectQuery){
showSuccessInfo("Query Execution Failed");
}else {
showErrorInfo("Some Error Occurred");
}
}
}
//send update database request to server
function updateTableData(updatedData, callback) {
//get currently selected element
var selectedTableElement = $("#table-list .list-group-item.selected");
var filteredUpdatedData = updatedData.map(function(columnData){
return {
title: columnData.title,
isPrimary: columnData.isPrimary,
value: columnData.value,
dataType: columnData.dataType
}
});
//build request parameters
var requestParameters = {};
requestParameters.dbName = selectedTableElement.attr('data-db-name');
requestParameters.tableName = selectedTableElement.attr('data-table-name');;
requestParameters.updatedData = encodeURIComponent(JSON.stringify(filteredUpdatedData));
//execute request
$.ajax({
url: "updateTableData",
type: 'GET',
data: requestParameters,
success: function(response) {
response = JSON.parse(response);
if(response.isSuccessful){
console.log("Data updated successfully");
callback(true);
showSuccessInfo("Data Updated Successfully");
} else {
console.log("Data updated failed");
callback(false);
}
}
})
}
function showSuccessInfo(message){
var snackbar = document.getElementById("snackbar")
snackbar.className = "show";
snackbar.style.backgroundColor = "#5cb85c";
snackbar.innerHTML = message;
setTimeout(function(){ snackbar.className = snackbar.className.replace("show", ""); }, 2000);
}
function showErrorInfo(message){
var snackbar = document.getElementById("snackbar")
snackbar.className = "show";
snackbar.style.backgroundColor = "#d9534f";
snackbar.innerHTML = message;
setTimeout(function(){ snackbar.className = snackbar.className.replace("show", ""); }, 2000);
}
| JavaScript | 0.001765 | @@ -3683,24 +3683,41 @@
essfully%22);%0A
+ return;%0A
%7D%0A%0A
|
3ac80b882464c338fe586905a9ddbf7a2cd347d8 | Integrate DocSearch (Algolia) | docs/.vuepress/config.js | docs/.vuepress/config.js | module.exports = {
title: 'chartjs-plugin-datalabels',
description: 'Display labels on data for any type of charts.',
ga: 'UA-99068522-2',
head: [
['link', { rel: 'icon', href: `/favicon.png` }],
],
themeConfig: {
repo: 'chartjs/chartjs-plugin-datalabels',
logo: '/favicon.png',
lastUpdated: 'Last Updated',
editLinks: true,
docsDir: 'docs',
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/' },
{ text: 'Samples', link: 'https://chartjs-plugin-datalabels.netlify.com/samples/' }
],
sidebar: [
'/guide/',
'/guide/getting-started',
'/guide/options',
'/guide/positioning',
'/guide/formatting',
'/guide/events'
]
}
}
| JavaScript | 0.000007 | @@ -403,24 +403,161 @@
ir: 'docs',%0A
+ algolia: %7B%0A apiKey: '7224f458f773f7cf4cbbc4c53621d30c',%0A indexName: 'chartjs-plugin-datalabels'%0A %7D,%0A
nav:
|
427b80bda3c386e70a11e409c4a6b8c2f445d714 | configure http client with current selected engine | webapps/client/scripts/api/index.js | webapps/client/scripts/api/index.js | 'use strict';
define([
'angular',
'camunda-bpm-sdk',
'camunda-bpm-sdk-mock'
],
function(
angular,
CamSDK,
MockClient
) {
var apiModule = angular.module('cam.tasklist.client', []);
apiModule.value('HttpClient', CamSDK.Client);
apiModule.value('CamForm', CamSDK.Form);
apiModule.value('MockHttpClient', MockClient);
apiModule.factory('camAPIHttpClient', [
'MockHttpClient', '$rootScope', '$location', '$translate', 'Notifications',
function(MockHttpClient, $rootScope, $location, $translate, Notifications) {
function AngularClient(config) {
var Client = (config.mock === true ? MockHttpClient : CamSDK.Client.HttpClient);
this._wrapped = new Client(config);
}
angular.forEach(['post', 'get', 'load', 'put', 'del', 'options', 'head'], function(name) {
AngularClient.prototype[name] = function(path, options) {
if (!options.done) {
return;
}
if (!$rootScope.authentication) {
return options.done(new Error('Not authenticated'));
}
var original = options.done;
options.done = function(err, result) {
$rootScope.$apply(function() {
// in case the session expired
if (err && err.status === 401) {
// broadcast that the authentication changed
$rootScope.$broadcast('authentication.changed', null);
// set authentication to null
$rootScope.authentication = null;
$translate([
'SESSION_EXPIRED',
'SESSION_EXPIRED_MESSAGE'
]).then(function(translations) {
Notifications.addError({
status: translations.SESSION_EXPIRED,
message: translations.SESSION_EXPIRED_MESSAGE,
exclusive: true
});
});
// broadcast event that a login is required
// proceeds a redirect to /login
$rootScope.$broadcast('authentication.login.required');
return;
}
original(err, result);
});
};
this._wrapped[name](path, options);
};
});
angular.forEach(['on', 'once', 'off', 'trigger'], function(name) {
AngularClient.prototype[name] = function() {
this._wrapped[name].apply(this, arguments);
};
});
return AngularClient;
}]);
apiModule.factory('camAPI', [
'camAPIHttpClient',
function(camAPIHttpClient) {
var conf = {
apiUri: 'engine-rest/engine',
HttpClient: camAPIHttpClient
};
if (window.tasklistConf) {
for (var c in window.tasklistConf) {
conf[c] = window.tasklistConf[c];
}
}
return new CamSDK.Client(conf);
}]);
// apiModule.factory('camForm', ['CamForm', function(CamEmbeddedForm) {
// return
// }]);
return apiModule;
});
| JavaScript | 0 | @@ -2509,16 +2509,37 @@
lient',%0A
+ '$window',%0A
functi
@@ -2557,19 +2557,292 @@
tpClient
-) %7B
+, $window) %7B%0A%0A function getCurrentEngine() %7B%0A var uri = $window.location.href;%0A%0A var match = uri.match(/%5C/app%5C/tasklist%5C/(%5Cw+)(%7C%5C/)/);%0A if (match) %7B%0A return match%5B1%5D;%0A %7D else %7B%0A throw new Error('no process engine selected');%0A %7D%0A %7D%0A
%0A var
@@ -2882,16 +2882,20 @@
ne-rest/
+api/
engine',
@@ -2929,16 +2929,50 @@
tpClient
+,%0A engine: getCurrentEngine()
%0A %7D;%0A
@@ -2980,16 +2980,17 @@
if (
+$
window.t
@@ -3024,16 +3024,17 @@
ar c in
+$
window.t
@@ -3066,16 +3066,17 @@
nf%5Bc%5D =
+$
window.t
@@ -3154,107 +3154,8 @@
);%0A%0A
- // apiModule.factory('camForm', %5B'CamForm', function(CamEmbeddedForm) %7B%0A // return%0A // %7D%5D);%0A%0A
re
|
7f09678728564e1ac3963f96b27c0cbd79885366 | Add upgrading doc in the doc menu | docs/.vuepress/config.js | docs/.vuepress/config.js | var Prism = require('prismjs');
var loadLanguages = require('prismjs/components/');
loadLanguages(['php']);
module.exports = {
title: 'Sharp',
base: '/docs/',
themeConfig: {
nav: [
{ text: 'Home', link: '/' },
{ text: 'Documentation', link: '/guide/' },
{ text: 'Demo', link: 'http://sharp.code16.fr/sharp/' },
{ text: 'Github', link:'https://github.com/code16/sharp' },
{ text: 'Medium', link:'https://medium.com/code16/tagged/sharp' },
],
sidebar: {
'/guide/': [
{
title: 'Introduction',
collapsable: false,
children: [
'',
'authentication',
]
},
{
title: 'Entity Lists',
collapsable: false,
children: [
'building-entity-list',
'filters',
'commands',
'entity-states',
'reordering-instances',
]
},
{
title: 'Entity Forms',
collapsable: false,
children: [
'building-entity-form',
'entity-authorizations',
'multiforms',
'single-form',
'custom-form-fields'
]
},
{
title: 'Entity Shows',
collapsable: false,
children: [
'building-entity-show',
'single-show',
'custom-show-fields'
]
},
{
title: 'Dashboards',
collapsable: false,
children: [
'dashboard',
...[
'graph',
'panel',
'ordered-list',
].map(page => `dashboard-widgets/${page}`),
],
},
{
title: 'Generalities',
collapsable: false,
children: [
'building-menu',
'how-to-transform-data',
'context',
'sharp-built-in-solution-for-uploads',
'form-data-localization',
'testing-with-sharp',
'artisan-generators',
'style-visual-theme'
]
},
{
title: 'Form fields',
collapsable: false,
children: [
'text',
'textarea',
'markdown',
'wysiwyg',
'number',
'html',
'check',
'date',
'upload',
'select',
'autocomplete',
'tags',
'list',
'autocomplete-list',
'geolocation',
].map(page => `form-fields/${page}`),
},
{
title: 'Show fields',
collapsable: false,
children: [
'text',
'picture',
'list',
'file',
'embedded-entity-list',
].map(page => `show-fields/${page}`),
},
{
title: 'Migrations guide',
collapsable: false,
children: [
'upgrading/4.2',
'upgrading/4.1.3',
'upgrading/4.1',
],
},
]
},
algolia: {
apiKey: 'd88cea985d718328d4b892ff6a05dba8',
indexName: 'code16_sharp',
// debug: true,
algoliaOptions: {
hitsPerPage: 5,
},
}
},
markdown: {
extendMarkdown: md => {
md.renderer.rules['code_inline'] = (tokens, idx, options, env, slf) => {
let token = tokens[idx];
return '<code class="inline">' +
Prism.highlight(token.content, Prism.languages.php) +
'</code>';
};
}
},
scss: {
implementation: require('sass'),
}
}; | JavaScript | 0 | @@ -4118,32 +4118,73 @@
children: %5B%0A
+ 'upgrading/5.0',%0A
|
ddff29a9b4060e144dbdab2d2757d6e91157b091 | fix require in shopper example | example/shopper.js | example/shopper.js | 'use strict';
var Monito = require('../lib/index');
let chimp = new Monito({
register: (monito, next) => {
next(null, 'getProfile');
},
getProfile: (monito, next) => {
next(null, {
browse: 4
}, 'shop');
},
browse: (monito, next) => {
next(null, {
browse: 6
}, 'shop');
},
shop: (monito, next) => {
next(null, 'logout');
},
logout: (monito, next) => {
// next(null, 'register'); -- Uncomment to have it running forever
next();
}
}, 'register');
chimp.on('error', function (err) {
console.log('An error has occurred');
console.log(err);
});
chimp.on('state', function (state) {
console.log('New state:', state);
});
chimp.on('end', function () {
console.log('Ok bye!');
});
chimp.start();
| JavaScript | 0.000013 | @@ -41,13 +41,14 @@
lib/
-index
+monito
');%0A
|
337771fb02274120ca4b584050446a4df84edfa8 | build for publish | memoizerific.min.gzip.js | memoizerific.min.gzip.js | JXWM6W>8$Le0LHBRlmEIlm
p<K+X$(R4W)%WiJ[X+y0uur#lUE8ၳ?[VYq~v{bWs:IȃzG4ocR<ݺfP/E*A]܄c '"VZݷ"D"E̙ة_f0:_*v=bp돁;d9)Zi4Il )oKfZ=U_>vǧ?~N˩ۚFǺ]>LX+72mQwv%؊伳A[-X3g ^DunushX-X"@Cqh۲/ ϿOxX؆1.c1\+9.)$)ywz2ʳ-U
VL2WYYauF]cV{Vg/Fqj7H6`ǫcsyjF$&cr
L6H:p{Ln>%{O=9>tyhh<3ЋzM'7סLւcack3UCBMuR+\#&vkN{Kr4~pl¯p~o) -]oiŎwYgG> 0t3
tU7,w,~ll#KX>
dcU|.r]@r9|@b(B\ɘ2 a)Θy34q:^
N/*;^ ]%$\Smq,X,]~۰'Pq^|ȀqiPK[©zlWUJKiM)<Ψ{Cc5nDt3Զ%-%!@N lt4swd݈ӏ4gkГ/3ֱSyvz0sT]FP$
K$嫛Xz}vѡ>Nyܺ))j_[&/E`LY):_GZmr9
T0f¬
.iQ[mHBi͞Q+_JCY9@
_C*nFˇ><LU!`{6ܑl
< |