code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
techReady = function(){
this.player_.triggerReady();
// Manually track progress in cases where the browser/flash player doesn't report it.
if (!this.features['progressEvents']) {
this.player_.manualProgressOn();
}
// Manually track timeudpates in cases where the browser/flash player doesn't ... | Destroys the video player and does any necessary cleanup
myPlayer.dispose();
This is especially helpful if you are dynamically adding and removing videos
to/from the DOM. | techReady | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/video-js/video.dev.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/video-js/video.dev.js | MIT |
activateControls = function(){
if (player.controls() && !player.usingNativeControls()) {
tech.addControlsListeners();
}
} | Set up click and touch listeners for the playback element
On desktops, a click on the video itself will toggle playback,
on a mobile device a click on the video toggles controls.
(toggling controls is done by toggling the user state between active and
inactive)
A tap can signal that a user has become active, or has be... | activateControls | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/video-js/video.dev.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/video-js/video.dev.js | MIT |
function createMethod(methodName){
return function(){
throw new Error('The "'+methodName+'" method is not available on the playback technology\'s API');
};
} | List of default API methods for any MediaTechController
@type {String} | createMethod | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/video-js/video.dev.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/video-js/video.dev.js | MIT |
function walk(holder, key) {
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
... | parse the json
@memberof vjs.JSON
@return {Object|Array} The parsed JSON | walk | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/video-js/video.dev.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/video-js/video.dev.js | MIT |
function writeDHT()
{
writeWord(0xFFC4); // marker
writeWord(0x01A2); // length
writeByte(0); // HTYDCinfo
for (var i=0; i<16; i++) {
writeByte(std_dc_luminance_nrcodes[i+1]);
... | @fileOverview Fix android canvas.toDataUrl bug. | writeDHT | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/webuploader/webuploader.custom.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/webuploader/webuploader.custom.js | MIT |
function writeSOS()
{
writeWord(0xFFDA); // marker
writeWord(12); // length
writeByte(3); // nrofcomponents
writeByte(1); // IdY
writeByte(0); // HTY
writeByte(2); // IdU
... | @fileOverview Fix android canvas.toDataUrl bug. | writeSOS | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/webuploader/webuploader.custom.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/webuploader/webuploader.custom.js | MIT |
function writeDQT()
{
writeWord(0xFFDB); // marker
writeWord(132); // length
writeByte(0);
for (var i=0; i<64; i++) {
writeByte(YTable[i]);
}
writeByte(1);
... | @fileOverview Fix android canvas.toDataUrl bug. | writeDQT | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/webuploader/webuploader.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/webuploader/webuploader.js | MIT |
function writeDHT()
{
writeWord(0xFFC4); // marker
writeWord(0x01A2); // length
writeByte(0); // HTYDCinfo
for (var i=0; i<16; i++) {
writeByte(std_dc_luminance_nrcodes[i+1]);
... | @fileOverview Fix android canvas.toDataUrl bug. | writeDHT | javascript | gongfuxiang/shopxo | public/static/common/lib/ueditor/third-party/webuploader/webuploader.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ueditor/third-party/webuploader/webuploader.js | MIT |
insertColumn = function(mixed, columnNumber, insertBefore, properties) {
const obj = this;
// Configuration
if (obj.options.allowInsertColumn != false) {
// Records
var records = [];
// Data to be insert
let data = [];
// The insert could be lead by number of rows ... | Insert a new column
@param mixed - num of columns to be added or data to be added in one single column
@param int columnNumber - number of columns to be created
@param bool insertBefore
@param object properties - column properties
@return void | insertColumn | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
insertColumn = function(mixed, columnNumber, insertBefore, properties) {
const obj = this;
// Configuration
if (obj.options.allowInsertColumn != false) {
// Records
var records = [];
// Data to be insert
let data = [];
// The insert could be lead by number of rows ... | Insert a new column
@param mixed - num of columns to be added or data to be added in one single column
@param int columnNumber - number of columns to be created
@param bool insertBefore
@param object properties - column properties
@return void | insertColumn | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
deleteColumn = function(columnNumber, numOfColumns) {
const obj = this;
// Global Configuration
if (obj.options.allowDeleteColumn != false) {
if (obj.headers.length > 1) {
// Delete column definitions
if (columnNumber == undefined) {
const number = obj.getSel... | Delete a column by number
@param integer columnNumber - reference column to be excluded
@param integer numOfColumns - number of columns to be excluded from the reference column
@return void | deleteColumn | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
deleteColumn = function(columnNumber, numOfColumns) {
const obj = this;
// Global Configuration
if (obj.options.allowDeleteColumn != false) {
if (obj.headers.length > 1) {
// Delete column definitions
if (columnNumber == undefined) {
const number = obj.getSel... | Delete a column by number
@param integer columnNumber - reference column to be excluded
@param integer numOfColumns - number of columns to be excluded from the reference column
@return void | deleteColumn | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
getWidth = function(column) {
const obj = this;
let data;
if (typeof column === 'undefined') {
// Get all headers
data = [];
for (let i = 0; i < obj.headers.length; i++) {
data.push((obj.options.columns && obj.options.columns[i] && obj.options.columns[i].width) || obj.o... | Get the column width
@param int column column number (first column is: 0)
@return int current width | getWidth | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
getWidth = function(column) {
const obj = this;
let data;
if (typeof column === 'undefined') {
// Get all headers
data = [];
for (let i = 0; i < obj.headers.length; i++) {
data.push((obj.options.columns && obj.options.columns[i] && obj.options.columns[i].width) || obj.o... | Get the column width
@param int column column number (first column is: 0)
@return int current width | getWidth | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
setWidth = function (column, width, oldWidth) {
const obj = this;
if (width) {
if (Array.isArray(column)) {
// Oldwidth
if (! oldWidth) {
oldWidth = [];
}
// Set width
for (let i = 0; i < column.length; i++) {
i... | Set the column width
@param int column number (first column is: 0)
@param int new column width
@param int old column width | setWidth | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
setWidth = function (column, width, oldWidth) {
const obj = this;
if (width) {
if (Array.isArray(column)) {
// Oldwidth
if (! oldWidth) {
oldWidth = [];
}
// Set width
for (let i = 0; i < column.length; i++) {
i... | Set the column width
@param int column number (first column is: 0)
@param int new column width
@param int old column width | setWidth | javascript | jspreadsheet/ce | src/utils/columns.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/columns.js | MIT |
getComments = function(cell) {
const obj = this;
if (cell) {
if (typeof(cell) !== 'string') {
return getComments.call(obj);
}
cell = getIdFromColumnName(cell, true);
return obj.records[cell[1]][cell[0]].element.getAttribute('title') || '';
} else {
cons... | Get cell comments, null cell for all | getComments | javascript | jspreadsheet/ce | src/utils/comments.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/comments.js | MIT |
getComments = function(cell) {
const obj = this;
if (cell) {
if (typeof(cell) !== 'string') {
return getComments.call(obj);
}
cell = getIdFromColumnName(cell, true);
return obj.records[cell[1]][cell[0]].element.getAttribute('title') || '';
} else {
cons... | Get cell comments, null cell for all | getComments | javascript | jspreadsheet/ce | src/utils/comments.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/comments.js | MIT |
paste = function(x, y, data) {
const obj = this;
// Controls
const dataHash = hash(data);
let style = (dataHash == obj.hashString) ? obj.style : null;
// Depending on the behavior
if (dataHash == obj.hashString) {
data = obj.data;
}
// Split new line
data = parseCSV(data, ... | Jspreadsheet paste method
@param x target column
@param y target row
@param data paste data. if data hash is the same as the copied data, apply style from copied cells
@return string value | paste | javascript | jspreadsheet/ce | src/utils/copyPaste.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/copyPaste.js | MIT |
paste = function(x, y, data) {
const obj = this;
// Controls
const dataHash = hash(data);
let style = (dataHash == obj.hashString) ? obj.style : null;
// Depending on the behavior
if (dataHash == obj.hashString) {
data = obj.data;
}
// Split new line
data = parseCSV(data, ... | Jspreadsheet paste method
@param x target column
@param y target row
@param data paste data. if data hash is the same as the copied data, apply style from copied cells
@return string value | paste | javascript | jspreadsheet/ce | src/utils/copyPaste.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/copyPaste.js | MIT |
getValue = function(cell, processedValue) {
const obj = this;
let x;
let y;
if (typeof cell !== 'string') {
return null;
}
cell = getIdFromColumnName(cell, true);
x = cell[0];
y = cell[1];
let value = null;
if (x != null && y != null) {
if (obj.records[y] && ... | Get the value from a cell
@param object cell
@return string value | getValue | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getValue = function(cell, processedValue) {
const obj = this;
let x;
let y;
if (typeof cell !== 'string') {
return null;
}
cell = getIdFromColumnName(cell, true);
x = cell[0];
y = cell[1];
let value = null;
if (x != null && y != null) {
if (obj.records[y] && ... | Get the value from a cell
@param object cell
@return string value | getValue | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getValueFromCoords = function(x, y, processedValue) {
const obj = this;
let value = null;
if (x != null && y != null) {
if ((obj.records[y] && obj.records[y][x]) && processedValue) {
value = obj.records[y][x].element.innerHTML;
} else {
if (obj.options.data[y] && ob... | Get the value from a coords
@param int x
@param int y
@return string value | getValueFromCoords | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getValueFromCoords = function(x, y, processedValue) {
const obj = this;
let value = null;
if (x != null && y != null) {
if ((obj.records[y] && obj.records[y][x]) && processedValue) {
value = obj.records[y][x].element.innerHTML;
} else {
if (obj.options.data[y] && ob... | Get the value from a coords
@param int x
@param int y
@return string value | getValueFromCoords | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
setValue = function(cell, value, force) {
const obj = this;
const records = [];
if (typeof(cell) == 'string') {
const columnId = getIdFromColumnName(cell, true);
const x = columnId[0];
const y = columnId[1];
// Update cell
records.push(updateCell.call(obj, x, y, va... | Set a cell value
@param mixed cell destination cell
@param string value value
@return void | setValue | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
setValue = function(cell, value, force) {
const obj = this;
const records = [];
if (typeof(cell) == 'string') {
const columnId = getIdFromColumnName(cell, true);
const x = columnId[0];
const y = columnId[1];
// Update cell
records.push(updateCell.call(obj, x, y, va... | Set a cell value
@param mixed cell destination cell
@param string value value
@return void | setValue | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
setValueFromCoords = function(x, y, value, force) {
const obj = this;
const records = [];
records.push(updateCell.call(obj, x, y, value, force));
// Update all formulas in the chain
updateFormulaChain.call(obj, x, y, records);
// Update history
setHistory.call(obj, {
action:'setVa... | Set a cell value based on coordinates
@param int x destination cell
@param int y destination cell
@param string value
@return void | setValueFromCoords | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
setValueFromCoords = function(x, y, value, force) {
const obj = this;
const records = [];
records.push(updateCell.call(obj, x, y, value, force));
// Update all formulas in the chain
updateFormulaChain.call(obj, x, y, records);
// Update history
setHistory.call(obj, {
action:'setVa... | Set a cell value based on coordinates
@param int x destination cell
@param int y destination cell
@param string value
@return void | setValueFromCoords | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getData = function(highlighted, processed, delimiter, asJson) {
const obj = this;
// Control vars
const dataset = [];
let px = 0;
let py = 0;
// Column and row length
const x = Math.max(...obj.options.data.map(function(row) {
return row.length;
}));
const y = obj.options.da... | Get the whole table data
@param bool get highlighted cells only
@return array data | getData | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getData = function(highlighted, processed, delimiter, asJson) {
const obj = this;
// Control vars
const dataset = [];
let px = 0;
let py = 0;
// Column and row length
const x = Math.max(...obj.options.data.map(function(row) {
return row.length;
}));
const y = obj.options.da... | Get the whole table data
@param bool get highlighted cells only
@return array data | getData | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getDataFromRange = function(range, processed) {
const obj = this;
const coords = getCoordsFromRange(range);
const dataset = [];
for (let y = coords[1]; y <= coords[3]; y++) {
dataset.push([]);
for (let x = coords[0]; x <= coords[2]; x++) {
if (processed) {
... | Get the whole table data
@param bool get highlighted cells only
@return array data | getDataFromRange | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
getDataFromRange = function(range, processed) {
const obj = this;
const coords = getCoordsFromRange(range);
const dataset = [];
for (let y = coords[1]; y <= coords[3]; y++) {
dataset.push([]);
for (let x = coords[0]; x <= coords[2]; x++) {
if (processed) {
... | Get the whole table data
@param bool get highlighted cells only
@return array data | getDataFromRange | javascript | jspreadsheet/ce | src/utils/data.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/data.js | MIT |
prepareJson = function(data) {
const obj = this;
const rows = [];
for (let i = 0; i < data.length; i++) {
const x = data[i].x;
const y = data[i].y;
const k = obj.options.columns[x].name ? obj.options.columns[x].name : x;
// Create row
if (! rows[y]) {
ro... | Prepare JSON in the correct format | prepareJson | javascript | jspreadsheet/ce | src/utils/dispatch.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/dispatch.js | MIT |
prepareJson = function(data) {
const obj = this;
const rows = [];
for (let i = 0; i < data.length; i++) {
const x = data[i].x;
const y = data[i].y;
const k = obj.options.columns[x].name ? obj.options.columns[x].name : x;
// Create row
if (! rows[y]) {
ro... | Prepare JSON in the correct format | prepareJson | javascript | jspreadsheet/ce | src/utils/dispatch.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/dispatch.js | MIT |
openEditor = function(cell, empty, e) {
const obj = this;
// Get cell position
const y = cell.getAttribute('data-y');
const x = cell.getAttribute('data-x');
// On edition start
dispatch.call(obj, 'oneditionstart', obj, cell, parseInt(x), parseInt(y));
// Overflow
if (x > 0) {
... | Open the editor
@param object cell
@return void | openEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
openEditor = function(cell, empty, e) {
const obj = this;
// Get cell position
const y = cell.getAttribute('data-y');
const x = cell.getAttribute('data-x');
// On edition start
dispatch.call(obj, 'oneditionstart', obj, cell, parseInt(x), parseInt(y));
// Overflow
if (x > 0) {
... | Open the editor
@param object cell
@return void | openEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
createEditor = function(type) {
// Cell information
const info = cell.getBoundingClientRect();
// Create dropdown
const editor = document.createElement(type);
editor.style.width = (info.width) + 'px';
editor.style.height = (info.height - 2) + 'px';
editor.style.m... | Open the editor
@param object cell
@return void | createEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
createEditor = function(type) {
// Cell information
const info = cell.getBoundingClientRect();
// Create dropdown
const editor = document.createElement(type);
editor.style.width = (info.width) + 'px';
editor.style.height = (info.height - 2) + 'px';
editor.style.m... | Open the editor
@param object cell
@return void | createEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
closeEditor = function(cell, save) {
const obj = this;
const x = parseInt(cell.getAttribute('data-x'));
const y = parseInt(cell.getAttribute('data-y'));
let value;
// Get cell properties
if (save == true) {
// If custom editor
if (obj.options.columns && obj.options.columns[x] ... | Close the editor and save the information
@param object cell
@param boolean save
@return void | closeEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
closeEditor = function(cell, save) {
const obj = this;
const x = parseInt(cell.getAttribute('data-x'));
const y = parseInt(cell.getAttribute('data-y'));
let value;
// Get cell properties
if (save == true) {
// If custom editor
if (obj.options.columns && obj.options.columns[x] ... | Close the editor and save the information
@param object cell
@param boolean save
@return void | closeEditor | javascript | jspreadsheet/ce | src/utils/editor.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/editor.js | MIT |
updateCopySelection = function(x3, y3) {
const obj = this;
// Remove selection
removeCopySelection.call(obj);
// Get elements first and last
const x1 = obj.selectedContainer[0];
const y1 = obj.selectedContainer[1];
const x2 = obj.selectedContainer[2];
const y2 = obj.selectedContainer[3... | Update copy selection
@param int x, y
@return void | updateCopySelection | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
updateCopySelection = function(x3, y3) {
const obj = this;
// Remove selection
removeCopySelection.call(obj);
// Get elements first and last
const x1 = obj.selectedContainer[0];
const y1 = obj.selectedContainer[1];
const x2 = obj.selectedContainer[2];
const y2 = obj.selectedContainer[3... | Update copy selection
@param int x, y
@return void | updateCopySelection | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
mouseOverControls = function(e) {
e = e || window.event;
let mouseButton;
if (e.buttons) {
mouseButton = e.buttons;
} else if (e.button) {
mouseButton = e.button;
} else {
mouseButton = e.which;
}
if (! mouseButton) {
libraryBase.jspreadsheet.isMouseAction ... | Update copy selection
@param int x, y
@return void | mouseOverControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
mouseOverControls = function(e) {
e = e || window.event;
let mouseButton;
if (e.buttons) {
mouseButton = e.buttons;
} else if (e.button) {
mouseButton = e.button;
} else {
mouseButton = e.which;
}
if (! mouseButton) {
libraryBase.jspreadsheet.isMouseAction ... | Update copy selection
@param int x, y
@return void | mouseOverControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
doubleClickControls = function(e) {
// Jss is selected
if (libraryBase.jspreadsheet.current) {
// Corner action
if (e.target.classList.contains('jss_corner')) {
// Any selected cells
if (libraryBase.jspreadsheet.current.highlighted.length > 0) {
// Copy fr... | Update copy selection
@param int x, y
@return void | doubleClickControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
doubleClickControls = function(e) {
// Jss is selected
if (libraryBase.jspreadsheet.current) {
// Corner action
if (e.target.classList.contains('jss_corner')) {
// Any selected cells
if (libraryBase.jspreadsheet.current.highlighted.length > 0) {
// Copy fr... | Update copy selection
@param int x, y
@return void | doubleClickControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getCellCoords = function(element) {
if (element.parentNode) {
const x = element.getAttribute('data-x');
const y = element.getAttribute('data-y');
if (x && y) {
return element;
... | Update copy selection
@param int x, y
@return void | getCellCoords | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getCellCoords = function(element) {
if (element.parentNode) {
const x = element.getAttribute('data-x');
const y = element.getAttribute('data-y');
if (x && y) {
return element;
... | Update copy selection
@param int x, y
@return void | getCellCoords | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
pasteControls = function(e) {
if (libraryBase.jspreadsheet.current && libraryBase.jspreadsheet.current.selectedCell) {
if (! libraryBase.jspreadsheet.current.edition) {
if (libraryBase.jspreadsheet.current.options.editable != false) {
if (e && e.clipboardData) {
... | Update copy selection
@param int x, y
@return void | pasteControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
pasteControls = function(e) {
if (libraryBase.jspreadsheet.current && libraryBase.jspreadsheet.current.selectedCell) {
if (! libraryBase.jspreadsheet.current.edition) {
if (libraryBase.jspreadsheet.current.options.editable != false) {
if (e && e.clipboardData) {
... | Update copy selection
@param int x, y
@return void | pasteControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getRole = function(element) {
if (element.classList.contains('jss_selectall')) {
return 'select-all';
}
if (element.classList.contains('jss_corner')) {
return 'fill-handle';
}
let tempElement = element;
while (!tempElement.classList.contains('jss_spreadsheet')) {
if (t... | Update copy selection
@param int x, y
@return void | getRole | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getRole = function(element) {
if (element.classList.contains('jss_selectall')) {
return 'select-all';
}
if (element.classList.contains('jss_corner')) {
return 'fill-handle';
}
let tempElement = element;
while (!tempElement.classList.contains('jss_spreadsheet')) {
if (t... | Update copy selection
@param int x, y
@return void | getRole | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
defaultContextMenu = function(worksheet, x, y, role) {
const items = [];
if (role === 'header') {
// Insert a new column
if (worksheet.options.allowInsertColumn != false) {
items.push({
title: jSuites.translate('Insert a new column before'),
onclick:f... | Update copy selection
@param int x, y
@return void | defaultContextMenu | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
defaultContextMenu = function(worksheet, x, y, role) {
const items = [];
if (role === 'header') {
// Insert a new column
if (worksheet.options.allowInsertColumn != false) {
items.push({
title: jSuites.translate('Insert a new column before'),
onclick:f... | Update copy selection
@param int x, y
@return void | defaultContextMenu | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getElementIndex = function(element) {
const parentChildren = element.parentElement.children;
for (let i = 0; i < parentChildren.length; i++) {
const currentElement = parentChildren[i];
if (element === currentElement) {
return i;
}
}
return -1;
} | Update copy selection
@param int x, y
@return void | getElementIndex | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getElementIndex = function(element) {
const parentChildren = element.parentElement.children;
for (let i = 0; i < parentChildren.length; i++) {
const currentElement = parentChildren[i];
if (element === currentElement) {
return i;
}
}
return -1;
} | Update copy selection
@param int x, y
@return void | getElementIndex | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
contextMenuControls = function(e) {
e = e || window.event;
if ("buttons" in e) {
var mouseButton = e.buttons;
} else {
var mouseButton = e.which || e.button;
}
if (libraryBase.jspreadsheet.current) {
const spreadsheet = libraryBase.jspreadsheet.current.parent;
if (l... | Update copy selection
@param int x, y
@return void | contextMenuControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
contextMenuControls = function(e) {
e = e || window.event;
if ("buttons" in e) {
var mouseButton = e.buttons;
} else {
var mouseButton = e.which || e.button;
}
if (libraryBase.jspreadsheet.current) {
const spreadsheet = libraryBase.jspreadsheet.current.parent;
if (l... | Update copy selection
@param int x, y
@return void | contextMenuControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
touchStartControls = function(e) {
const jssTable = getElement(e.target);
if (jssTable[0]) {
if (libraryBase.jspreadsheet.current != jssTable[0].jssWorksheet) {
if (libraryBase.jspreadsheet.current) {
libraryBase.jspreadsheet.current.resetSelection();
}
... | Update copy selection
@param int x, y
@return void | touchStartControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
touchStartControls = function(e) {
const jssTable = getElement(e.target);
if (jssTable[0]) {
if (libraryBase.jspreadsheet.current != jssTable[0].jssWorksheet) {
if (libraryBase.jspreadsheet.current) {
libraryBase.jspreadsheet.current.resetSelection();
}
... | Update copy selection
@param int x, y
@return void | touchStartControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
touchEndControls = function(e) {
// Clear any time control
if (libraryBase.jspreadsheet.timeControl) {
clearTimeout(libraryBase.jspreadsheet.timeControl);
libraryBase.jspreadsheet.timeControl = null;
// Element
if (libraryBase.jspreadsheet.tmpElement && libraryBase.jspreadsheet.t... | Update copy selection
@param int x, y
@return void | touchEndControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
touchEndControls = function(e) {
// Clear any time control
if (libraryBase.jspreadsheet.timeControl) {
clearTimeout(libraryBase.jspreadsheet.timeControl);
libraryBase.jspreadsheet.timeControl = null;
// Element
if (libraryBase.jspreadsheet.tmpElement && libraryBase.jspreadsheet.t... | Update copy selection
@param int x, y
@return void | touchEndControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
cutControls = function(e) {
if (libraryBase.jspreadsheet.current) {
if (! libraryBase.jspreadsheet.current.edition) {
copy.call(libraryBase.jspreadsheet.current, true, undefined, undefined, undefined, undefined, true);
if (libraryBase.jspreadsheet.current.options.editable != false) {... | Update copy selection
@param int x, y
@return void | cutControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
cutControls = function(e) {
if (libraryBase.jspreadsheet.current) {
if (! libraryBase.jspreadsheet.current.edition) {
copy.call(libraryBase.jspreadsheet.current, true, undefined, undefined, undefined, undefined, true);
if (libraryBase.jspreadsheet.current.options.editable != false) {... | Update copy selection
@param int x, y
@return void | cutControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
copyControls = function(e) {
if (libraryBase.jspreadsheet.current && copyControls.enabled) {
if (! libraryBase.jspreadsheet.current.edition) {
copy.call(libraryBase.jspreadsheet.current, true);
}
}
} | Update copy selection
@param int x, y
@return void | copyControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
copyControls = function(e) {
if (libraryBase.jspreadsheet.current && copyControls.enabled) {
if (! libraryBase.jspreadsheet.current.edition) {
copy.call(libraryBase.jspreadsheet.current, true);
}
}
} | Update copy selection
@param int x, y
@return void | copyControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
isMac = function() {
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
} | Update copy selection
@param int x, y
@return void | isMac | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
isMac = function() {
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
} | Update copy selection
@param int x, y
@return void | isMac | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
isCtrl = function(e) {
if (isMac()) {
return e.metaKey;
} else {
return e.ctrlKey;
}
} | Update copy selection
@param int x, y
@return void | isCtrl | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
isCtrl = function(e) {
if (isMac()) {
return e.metaKey;
} else {
return e.ctrlKey;
}
} | Update copy selection
@param int x, y
@return void | isCtrl | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
keyDownControls = function(e) {
if (libraryBase.jspreadsheet.current) {
if (libraryBase.jspreadsheet.current.edition) {
if (e.which == 27) {
// Escape
if (libraryBase.jspreadsheet.current.edition) {
// Exit without saving
cl... | Update copy selection
@param int x, y
@return void | keyDownControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
keyDownControls = function(e) {
if (libraryBase.jspreadsheet.current) {
if (libraryBase.jspreadsheet.current.edition) {
if (e.which == 27) {
// Escape
if (libraryBase.jspreadsheet.current.edition) {
// Exit without saving
cl... | Update copy selection
@param int x, y
@return void | keyDownControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
wheelControls = function(e) {
const obj = this;
if (obj.options.lazyLoading == true) {
if (libraryBase.jspreadsheet.timeControlLoading == null) {
libraryBase.jspreadsheet.timeControlLoading = setTimeout(function() {
if (obj.content.scrollTop + obj.content.clientHeight >= obj... | Update copy selection
@param int x, y
@return void | wheelControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
wheelControls = function(e) {
const obj = this;
if (obj.options.lazyLoading == true) {
if (libraryBase.jspreadsheet.timeControlLoading == null) {
libraryBase.jspreadsheet.timeControlLoading = setTimeout(function() {
if (obj.content.scrollTop + obj.content.clientHeight >= obj... | Update copy selection
@param int x, y
@return void | wheelControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
updateFreezePosition = function() {
const obj = this;
scrollLeft = obj.content.scrollLeft;
let width = 0;
if (scrollLeft > 50) {
for (let i = 0; i < obj.options.freezeColumns; i++) {
if (i > 0) {
// Must check if the previous column is hidden or not to determin wheth... | Update copy selection
@param int x, y
@return void | updateFreezePosition | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
updateFreezePosition = function() {
const obj = this;
scrollLeft = obj.content.scrollLeft;
let width = 0;
if (scrollLeft > 50) {
for (let i = 0; i < obj.options.freezeColumns; i++) {
if (i > 0) {
// Must check if the previous column is hidden or not to determin wheth... | Update copy selection
@param int x, y
@return void | updateFreezePosition | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
scrollControls = function(e) {
const obj = this;
wheelControls.call(obj);
if (obj.options.freezeColumns > 0 && obj.content.scrollLeft != scrollLeft) {
updateFreezePosition.call(obj);
}
// Close editor
if (obj.options.lazyLoading == true || obj.options.tableOverflow == true) {
... | Update copy selection
@param int x, y
@return void | scrollControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
scrollControls = function(e) {
const obj = this;
wheelControls.call(obj);
if (obj.options.freezeColumns > 0 && obj.content.scrollLeft != scrollLeft) {
updateFreezePosition.call(obj);
}
// Close editor
if (obj.options.lazyLoading == true || obj.options.tableOverflow == true) {
... | Update copy selection
@param int x, y
@return void | scrollControls | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
setEvents = function(root) {
destroyEvents(root);
root.addEventListener("mouseup", mouseUpControls);
root.addEventListener("mousedown", mouseDownControls);
root.addEventListener("mousemove", mouseMoveControls);
root.addEventListener("mouseover", mouseOverControls);
root.addEventListener("dblclic... | Update copy selection
@param int x, y
@return void | setEvents | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
setEvents = function(root) {
destroyEvents(root);
root.addEventListener("mouseup", mouseUpControls);
root.addEventListener("mousedown", mouseDownControls);
root.addEventListener("mousemove", mouseMoveControls);
root.addEventListener("mouseover", mouseOverControls);
root.addEventListener("dblclic... | Update copy selection
@param int x, y
@return void | setEvents | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
destroyEvents = function(root) {
root.removeEventListener("mouseup", mouseUpControls);
root.removeEventListener("mousedown", mouseDownControls);
root.removeEventListener("mousemove", mouseMoveControls);
root.removeEventListener("mouseover", mouseOverControls);
root.removeEventListener("dblclick", do... | Update copy selection
@param int x, y
@return void | destroyEvents | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
destroyEvents = function(root) {
root.removeEventListener("mouseup", mouseUpControls);
root.removeEventListener("mousedown", mouseDownControls);
root.removeEventListener("mousemove", mouseMoveControls);
root.removeEventListener("mouseover", mouseOverControls);
root.removeEventListener("dblclick", do... | Update copy selection
@param int x, y
@return void | destroyEvents | javascript | jspreadsheet/ce | src/utils/events.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/events.js | MIT |
getHeader = function(column) {
const obj = this;
return obj.headers[column].textContent;
} | Get the column title
@param column - column number (first column is: 0)
@param title - new column title | getHeader | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
getHeader = function(column) {
const obj = this;
return obj.headers[column].textContent;
} | Get the column title
@param column - column number (first column is: 0)
@param title - new column title | getHeader | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
getHeaders = function (asArray) {
const obj = this;
const title = [];
for (let i = 0; i < obj.headers.length; i++) {
title.push(obj.getHeader(i));
}
return asArray ? title : title.join(obj.options.csvDelimiter);
} | Get the headers
@param asArray
@return mixed | getHeaders | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
getHeaders = function (asArray) {
const obj = this;
const title = [];
for (let i = 0; i < obj.headers.length; i++) {
title.push(obj.getHeader(i));
}
return asArray ? title : title.join(obj.options.csvDelimiter);
} | Get the headers
@param asArray
@return mixed | getHeaders | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
setHeader = function(column, newValue) {
const obj = this;
if (obj.headers[column]) {
const oldValue = obj.headers[column].textContent;
const onchangeheaderOldValue = (obj.options.columns && obj.options.columns[column] && obj.options.columns[column].title) || '';
if (! newValue) {
... | Set the column title
@param column - column number (first column is: 0)
@param title - new column title | setHeader | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
setHeader = function(column, newValue) {
const obj = this;
if (obj.headers[column]) {
const oldValue = obj.headers[column].textContent;
const onchangeheaderOldValue = (obj.options.columns && obj.options.columns[column] && obj.options.columns[column].title) || '';
if (! newValue) {
... | Set the column title
@param column - column number (first column is: 0)
@param title - new column title | setHeader | javascript | jspreadsheet/ce | src/utils/headers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/headers.js | MIT |
getCaretIndex = function (e) {
let d;
if (this.config.root) {
d = this.config.root;
} else {
d = window;
}
let pos = 0;
const s = d.getSelection();
if (s) {
if (s.rangeCount !== 0) {
const r = s.getRangeAt(0);
const p = r.cloneRange();
... | Get carret position for one element | getCaretIndex | javascript | jspreadsheet/ce | src/utils/helpers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/helpers.js | MIT |
getCaretIndex = function (e) {
let d;
if (this.config.root) {
d = this.config.root;
} else {
d = window;
}
let pos = 0;
const s = d.getSelection();
if (s) {
if (s.rangeCount !== 0) {
const r = s.getRangeAt(0);
const p = r.cloneRange();
... | Get carret position for one element | getCaretIndex | javascript | jspreadsheet/ce | src/utils/helpers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/helpers.js | MIT |
getColumnName = function (columnNumber){
let dividend = columnNumber+1;
let columnName = "";
let modulo;
while (dividend > 0) {
modulo = (dividend - 1) % 26;
columnName = String.fromCharCode(65 + modulo).toString() + columnName;
dividend = parseInt((dividend - modulo) / 26);
... | Get letter based on a number
@param {number} columnNumber
@return string letter | getColumnName | javascript | jspreadsheet/ce | src/utils/helpers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/helpers.js | MIT |
getColumnName = function (columnNumber){
let dividend = columnNumber+1;
let columnName = "";
let modulo;
while (dividend > 0) {
modulo = (dividend - 1) % 26;
columnName = String.fromCharCode(65 + modulo).toString() + columnName;
dividend = parseInt((dividend - modulo) / 26);
... | Get letter based on a number
@param {number} columnNumber
@return string letter | getColumnName | javascript | jspreadsheet/ce | src/utils/helpers.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/helpers.js | MIT |
setHistory = function(changes) {
const obj = this;
if (obj.ignoreHistory != true) {
// Increment and get the current history index
const index = ++obj.historyIndex;
// Slice the array to discard undone changes
obj.history = (obj.history = obj.history.slice(0, index + 1));
... | Initializes a new history record for undo/redo
@return null | setHistory | javascript | jspreadsheet/ce | src/utils/history.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/history.js | MIT |
setHistory = function(changes) {
const obj = this;
if (obj.ignoreHistory != true) {
// Increment and get the current history index
const index = ++obj.historyIndex;
// Slice the array to discard undone changes
obj.history = (obj.history = obj.history.slice(0, index + 1));
... | Initializes a new history record for undo/redo
@return null | setHistory | javascript | jspreadsheet/ce | src/utils/history.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/history.js | MIT |
parseNumber = function(value, columnNumber) {
const obj = this;
// Decimal point
const decimal = columnNumber && obj.options.columns[columnNumber].decimal ? obj.options.columns[columnNumber].decimal : '.';
// Parse both parts of the number
let number = ('' + value);
number = number.split(decim... | Trying to extract a number from a string | parseNumber | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
parseNumber = function(value, columnNumber) {
const obj = this;
// Decimal point
const decimal = columnNumber && obj.options.columns[columnNumber].decimal ? obj.options.columns[columnNumber].decimal : '.';
// Parse both parts of the number
let number = ('' + value);
number = number.split(decim... | Trying to extract a number from a string | parseNumber | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
updateCell = function(x, y, value, force) {
const obj = this;
let record;
// Changing value depending on the column type
if (obj.records[y][x].element.classList.contains('readonly') == true && ! force) {
// Do nothing
record = {
x: x,
y: y,
col: x,
... | Update cell content
@param object cell
@return void | updateCell | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
updateCell = function(x, y, value, force) {
const obj = this;
let record;
// Changing value depending on the column type
if (obj.records[y][x].element.classList.contains('readonly') == true && ! force) {
// Do nothing
record = {
x: x,
y: y,
col: x,
... | Update cell content
@param object cell
@return void | updateCell | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
getMask = function(o) {
if (o.format || o.mask || o.locale) {
const opt = {};
if (o.mask) {
opt.mask = o.mask;
} else if (o.format) {
opt.mask = o.format;
} else {
opt.locale = o.locale;
opt.options = o.options;
}
if (o... | Get the mask in the jSuites.mask format | getMask | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
getMask = function(o) {
if (o.format || o.mask || o.locale) {
const opt = {};
if (o.mask) {
opt.mask = o.mask;
} else if (o.format) {
opt.mask = o.format;
} else {
opt.locale = o.locale;
opt.options = o.options;
}
if (o... | Get the mask in the jSuites.mask format | getMask | javascript | jspreadsheet/ce | src/utils/internal.js | https://github.com/jspreadsheet/ce/blob/master/src/utils/internal.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.