init
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,252 @@
|
||||
// Create and return ajax communication object
|
||||
function createAjaxRequest() {
|
||||
var reqAjax = null ;
|
||||
try {
|
||||
reqAjax = new XMLHttpRequest();
|
||||
} catch ( trymicrosoft ) {
|
||||
try {
|
||||
reqAjax = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch ( othermicrosoft ) {
|
||||
try {
|
||||
reqAjax = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch( failed ) {
|
||||
reqAjax = null ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( reqAjax == null ) {
|
||||
alert("Error creating request object!");
|
||||
}
|
||||
|
||||
return reqAjax;
|
||||
}
|
||||
|
||||
// Because memory leak
|
||||
function purge(d) {
|
||||
/*
|
||||
var a = d.attributes, i, l, n;
|
||||
|
||||
if (a) {
|
||||
l = a.length;
|
||||
for (i = 0; i < l; i += 1) {
|
||||
n = a[i].name;
|
||||
|
||||
if (typeof d[n] === 'function') {
|
||||
d[n] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a = d.childNodes;
|
||||
|
||||
if (a) {
|
||||
l = a.length;
|
||||
|
||||
for (i = 0; i < l; i += 1) {
|
||||
purge(d.childNodes[i]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Insert comma per three bytes number
|
||||
function commify(n) {
|
||||
var reg = /(^[+-]?\d+)(\d{3})/; // 정규식
|
||||
n += ''; // 숫자를 문자열로 변환
|
||||
|
||||
while (reg.test(n))
|
||||
n = n.replace(reg, '$1' + ',' + '$2');
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
// Return number of comma string
|
||||
function commanum(s) {
|
||||
if( s == null || s == "" ) {
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
var re = /,/g;
|
||||
return parseInt(s.replace(re,""));
|
||||
}
|
||||
|
||||
|
||||
function toNumber(val) {
|
||||
var num = val.replace(/\,/gi, "");
|
||||
return Number(num);
|
||||
}
|
||||
|
||||
// Fill zero left
|
||||
function getLeftPadTime(n) {
|
||||
var s = n.toString(10);
|
||||
if( s.length == 1 ) {
|
||||
return "0" + s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function getWeekStr(d) {
|
||||
var week;
|
||||
if( d == 0 ) {week = "일";}
|
||||
else if( d == 1 ) {week = "월";}
|
||||
else if( d == 2 ) {week = "화";}
|
||||
else if( d == 3 ) {week = "수";}
|
||||
else if( d == 4 ) {week = "목";}
|
||||
else if( d == 5 ) {week = "금";}
|
||||
else if( d == 6 ) {week = "토";}
|
||||
else {week = "";}
|
||||
return week;
|
||||
}
|
||||
|
||||
function getFormTime() {
|
||||
var t = new Date();
|
||||
var year = t.getFullYear();
|
||||
var month = t.getMonth()+1;
|
||||
var date = t.getDate();
|
||||
var week = getWeekStr(t.getDay());
|
||||
var hour = t.getHours();
|
||||
var min = t.getMinutes();
|
||||
var sec = t.getSeconds();
|
||||
|
||||
month = getLeftPadTime(month);
|
||||
date = getLeftPadTime(date);
|
||||
hour = getLeftPadTime(hour);
|
||||
min = getLeftPadTime(min);
|
||||
sec = getLeftPadTime(sec);
|
||||
|
||||
// 2009.09.20(일) 12:20:30
|
||||
return (year + "." + month + "." + date + "(" + week + ") " + hour + ":" + min + ":" + sec) ;
|
||||
}
|
||||
|
||||
function getThisTime() {
|
||||
var t = new Date();
|
||||
var hour = t.getHours();
|
||||
var min = t.getMinutes();
|
||||
|
||||
hour = getLeftPadTime(hour);
|
||||
min = getLeftPadTime(min);
|
||||
|
||||
return ( hour + ":" + min );
|
||||
}
|
||||
|
||||
|
||||
function getServiceId( type, isFull ) {
|
||||
var ret = "" ;
|
||||
if( isFull == true ) {
|
||||
ret = "&service=" ;
|
||||
}
|
||||
return ret + type;
|
||||
/*
|
||||
var ret = "" ;
|
||||
if( isFull == true ) {
|
||||
ret = "&service=" ;
|
||||
}
|
||||
|
||||
if( type == "Comm" ) {
|
||||
return ret + "INST3" ;
|
||||
} else if( type == "In" ) {
|
||||
return ret + "INST2" ;
|
||||
} else if( type == "Out" ) {
|
||||
return ret + "INST1" ;
|
||||
} else if( type == "Dmz" ) {
|
||||
return ret + "INST4" ;
|
||||
} else if( type == "Batch" ) {
|
||||
return ret + "INST5" ;
|
||||
}
|
||||
return null ;
|
||||
*/
|
||||
}
|
||||
|
||||
function getDummyTime() {
|
||||
return "&t=" + ((new Date()).valueOf());
|
||||
}
|
||||
|
||||
function formdate1( d ) {
|
||||
if( d.length == 8 ) {
|
||||
return d.substring(0,4) + '.' + d.substring(4,6) + '.' + d.substring(6);
|
||||
}
|
||||
return d ;
|
||||
}
|
||||
|
||||
function formdate2( d ) {
|
||||
if( d.length == 14 ) {
|
||||
return d.substring(0,4) + '/' + d.substring(4,6) + '/' + d.substring(6,2) + ' ' + d.substring(8,10) + ':' + d.substring(10,12) + ':' + d.substring(12);
|
||||
}
|
||||
return d ;
|
||||
}
|
||||
|
||||
|
||||
function rollingScore(objID, val, old) {
|
||||
var iter = 8;
|
||||
if( old == '' )
|
||||
old = '0' ;
|
||||
|
||||
var currentScore = toNumber( old );
|
||||
var maxScore = toNumber( val );
|
||||
var step = Math.round((maxScore-currentScore)/iter);
|
||||
|
||||
setScore(currentScore, maxScore, iter, step, objID, false);
|
||||
}
|
||||
|
||||
function rollingScoreArrow(objID, val, old) {
|
||||
var iter = 8;
|
||||
if( old == '' )
|
||||
old = '0' ;
|
||||
|
||||
old = old.replace('▲ ', '');
|
||||
|
||||
var currentScore = toNumber( old );
|
||||
var maxScore = toNumber( val );
|
||||
var step = Math.round((maxScore-currentScore)/iter);
|
||||
|
||||
setScore(currentScore, maxScore, iter, step, objID, true);
|
||||
}
|
||||
|
||||
|
||||
function setScore(currentScore, maxScore, iter, step, objID, arrow) {
|
||||
|
||||
if(iter == 0) {
|
||||
if(currentScore != maxScore) {
|
||||
//document.getElementById(objID).innerHTML = '▲ ' + commify(maxScore);
|
||||
updateScoreObj( objID, maxScore, arrow );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(currentScore >= maxScore) {
|
||||
//document.getElementById(objID).innerHTML = '▲ ' + commify(maxScore);
|
||||
updateScoreObj( objID, maxScore, arrow );
|
||||
return;
|
||||
}
|
||||
|
||||
currentScore = Number(currentScore) + step;
|
||||
iter = iter - 1;
|
||||
window.setTimeout('setScore('+currentScore+','+maxScore+', '+iter+', '+step+', "'+objID+'", ' + arrow + ')', 50);
|
||||
|
||||
//document.getElementById(objID).innerHTML = '▲ ' + commify(currentScore);
|
||||
updateScoreObj( objID, currentScore, arrow );
|
||||
|
||||
/*
|
||||
alert("currentScore ="+currentScore
|
||||
+"\nmaxScore ="+maxScore
|
||||
+"\niter ="+iter
|
||||
+"\nstep ="+step);
|
||||
*/
|
||||
}
|
||||
|
||||
function updateScoreObj( id, val, arrow ) {
|
||||
if( arrow == true && val > 0) {
|
||||
document.getElementById(id).innerHTML = '▲ ' + commify(val);
|
||||
} else {
|
||||
document.getElementById(id).innerHTML = commify(val);
|
||||
}
|
||||
}
|
||||
|
||||
function setArrowTextBody( obj, t ) {
|
||||
if( t == null || t == '' || t == '0' || t.charAt(0) == '-' ) {
|
||||
obj.innerText = commify(t) ;
|
||||
} else {
|
||||
obj.innerText = '↑ ' + commify(t) ;
|
||||
}
|
||||
}
|
||||
Vendored
+7
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,561 @@
|
||||
|
||||
function defaultEditGrid(element, paramColumns, toolbarHtml, itemLevelColumnName, layoutData, screenMargin, flexColumns) {
|
||||
let jexcelInstance;
|
||||
let columns = paramColumns;
|
||||
let columnNames = [];
|
||||
for (let i = 0; i < paramColumns.length; i++) {
|
||||
columnNames[i] = paramColumns[i].name;
|
||||
}
|
||||
const itemLevelColumnIndex = columnNames.indexOf(itemLevelColumnName)
|
||||
|
||||
function stringToColour(stringInput, alpha) {
|
||||
let stringUniqueHash = [...stringInput].reduce((acc, char) => {
|
||||
return char.charCodeAt(0) + ((acc << 5) - acc);
|
||||
}, 0);
|
||||
return `hsla(${stringUniqueHash % 360}, 85%, 40%, ${alpha})`;
|
||||
}
|
||||
|
||||
var customUpdateTable = function(instance, cell, col, row, val, label, cellName) {
|
||||
if(col == 0 && val != null && val != ''){
|
||||
//cell.style.backgroundColor = '#f46e42';
|
||||
cell.style.textAlign = 'left';
|
||||
var rowData = jexcelInstance.getRowData(Number(row));
|
||||
if(rowData.length > 1){
|
||||
// const itemLenIndex = columnNames.indexOf('itemLevel');
|
||||
const depth = Number(rowData[itemLevelColumnIndex]);
|
||||
cell.style.textAlign = 'left';
|
||||
const padding = depth == 1 ? 5 : (depth*10);
|
||||
cell.style.paddingLeft = padding+'px';
|
||||
const colorVal = (padding*2)+'';
|
||||
const fromColor = stringToColour(colorVal, '20%');
|
||||
const toColor = stringToColour(colorVal, '60%');
|
||||
cell.style.background = `linear-gradient(to right, ${fromColor}, ${fromColor}, ${toColor}) no-repeat left`;
|
||||
cell.style.backgroundSize = (padding - 2) +'px 2px';
|
||||
}
|
||||
}else{
|
||||
const columnProp = columns[col];
|
||||
if (columnProp.align != null) {
|
||||
cell.style.textAlign = columnProp.align;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//JEXCEL 관련 함수 시작
|
||||
function getCellValue(columnName, rowNum){
|
||||
const index = columnNames.indexOf(columnName);
|
||||
//var cell = gridInstance.records[rowNum][index];
|
||||
//return cell.innerText;
|
||||
const cellId = String.fromCharCode(65+index) + rowNum;
|
||||
return jexcelInstance.getValue(cellId)
|
||||
}
|
||||
|
||||
const beforePaste = function (instance, data){
|
||||
console.log('beforePaste');
|
||||
|
||||
const selectedCell = jexcelInstance.selectedCell;
|
||||
const obj = jexcelInstance;
|
||||
|
||||
var ax = Number(selectedCell[0]),
|
||||
ay = Number(selectedCell[1]),
|
||||
bx = Number(selectedCell[2]),
|
||||
by = Number(selectedCell[3]);
|
||||
|
||||
// Paste filter
|
||||
var x = ax,
|
||||
y = ay,
|
||||
w = bx-x+1,
|
||||
h = by-y+1;
|
||||
|
||||
// change paste range if select is from right to left
|
||||
if (bx < ax){
|
||||
x = bx;
|
||||
w = ax-x+1;
|
||||
}
|
||||
// change paste range if select is from down to up
|
||||
if (by < ay){
|
||||
y = by;
|
||||
h = ay-y+1;
|
||||
}
|
||||
|
||||
// Controls
|
||||
var hash = obj.hash(data);
|
||||
var style = (hash == obj.hashString) ? obj.style : null;
|
||||
|
||||
// Depending on the behavior
|
||||
if (obj.options.copyCompatibility == true && hash == obj.hashString) {
|
||||
var data = obj.data;
|
||||
}
|
||||
|
||||
// Split new line
|
||||
var data = obj.parseCSV(data, "\t");
|
||||
|
||||
//modify data to allow wor extending paste range in multiples of input range
|
||||
if (w>1 & Number.isInteger(w/data[0].length )){
|
||||
style = null;
|
||||
repeats = w/data[0].length;
|
||||
|
||||
var arrayB = data.map(function(row,i){
|
||||
var arrayC = Array.apply(null, {length: repeats * row.length})
|
||||
.map(function(e,i){return row[i % row.length]});
|
||||
return arrayC
|
||||
});
|
||||
data = arrayB;
|
||||
|
||||
}
|
||||
if (h>1 & Number.isInteger(h/data.length )){
|
||||
style = null;
|
||||
var repeats = h/data.length;
|
||||
var arrayB = Array.apply(null, {length: repeats * data.length})
|
||||
.map(function(e,i){return data[i % data.length]});
|
||||
data = arrayB;
|
||||
}
|
||||
|
||||
if (x != null && y != null && data) {
|
||||
// Records
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var records = [];
|
||||
var newStyle = {};
|
||||
var oldStyle = {};
|
||||
var styleIndex = 0;
|
||||
|
||||
// Index
|
||||
var colIndex = parseInt(x);
|
||||
var rowIndex = parseInt(y);
|
||||
var row = null;
|
||||
|
||||
// Go through the columns to get the data
|
||||
while (row = data[j]) {
|
||||
i = 0;
|
||||
var colIndex = parseInt(x);
|
||||
|
||||
while (row[i] != null) {
|
||||
// Update and keep history
|
||||
var record = obj.updateCell(colIndex, rowIndex, row[i]);
|
||||
// Keep history
|
||||
records.push(record);
|
||||
// Style
|
||||
if (style) {
|
||||
var columnName = jexcel.getColumnNameFromId([colIndex, rowIndex]);
|
||||
newStyle[columnName] = style[styleIndex];
|
||||
oldStyle[columnName] = obj.getStyle(columnName);
|
||||
obj.records[rowIndex][colIndex].setAttribute('style', style[styleIndex]);
|
||||
styleIndex++
|
||||
}
|
||||
i++;
|
||||
if (row[i] != null) {
|
||||
if (colIndex >= obj.headers.length - 1) {
|
||||
obj.insertColumn();
|
||||
}
|
||||
colIndex = obj.right.get(colIndex, rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
j++;
|
||||
if (data[j]) {
|
||||
if (rowIndex >= obj.rows.length - 1) {
|
||||
obj.insertRow();
|
||||
}
|
||||
var rowIndex = obj.down.get(x, rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// Select the new cells
|
||||
obj.updateSelectionFromCoords(x, y, colIndex, rowIndex);
|
||||
|
||||
// Update history
|
||||
obj.setHistory({
|
||||
action: 'setValue',
|
||||
records: records,
|
||||
selection: obj.selectedCell,
|
||||
newStyle: newStyle,
|
||||
oldStyle: oldStyle,
|
||||
});
|
||||
|
||||
// Update table
|
||||
obj.updateTable();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function moveSelectionRow(up){
|
||||
const selectedCell = jexcelInstance.selectedCell;
|
||||
|
||||
const correction = up ? -1 : 1 ;
|
||||
const selectionCorrection = up ? 0 : 2 ;
|
||||
|
||||
if(selectedCell != null) {
|
||||
const x1 = Number(selectedCell[0]) ;
|
||||
const y1 = Number(selectedCell[1]) ;
|
||||
const x2 = Number(selectedCell[2]);
|
||||
const y2 = Number(selectedCell[3]);
|
||||
if(up){
|
||||
if(y1 === 0)
|
||||
return;
|
||||
jexcelInstance.moveRow(y1 + correction, y2);
|
||||
}else{
|
||||
const rowSize = jexcelInstance.getData().length;
|
||||
if(y2 + 1 === rowSize)
|
||||
return;
|
||||
jexcelInstance.moveRow(y2 + correction, y1);
|
||||
}
|
||||
|
||||
const CODE_A = 65;
|
||||
const x1Code = String.fromCharCode(CODE_A+x1);
|
||||
const x2Code = String.fromCharCode(CODE_A+x2);
|
||||
const startCellCode = x1Code + (y1+selectionCorrection);
|
||||
const endCellCode = x2Code + (y2+selectionCorrection);
|
||||
|
||||
jexcelInstance.updateSelection(jexcelInstance.getCell(startCellCode), jexcelInstance.getCell(endCellCode));
|
||||
}
|
||||
}
|
||||
|
||||
function updateSelectedDepth(increse){
|
||||
const selectedCell = jexcelInstance.selectedCell;
|
||||
const depthColumn = itemLevelColumnIndex;
|
||||
|
||||
if(selectedCell != null) {
|
||||
const y1 = Number(selectedCell[1]);
|
||||
const y2 = Number(selectedCell[3]);
|
||||
const top = y1 < y2 ? y1 : y2;
|
||||
const gap = (y1 < y2 ? y2 - y1 : y1 - y2) + 1;
|
||||
|
||||
const values = [];
|
||||
for (let i = 0; i < gap; i++) {
|
||||
const cellNum = 'C'+(top+i+1);
|
||||
let value = Number(jexcelInstance.getValue(cellNum));
|
||||
value = increse ? value + 1 : (value === 1 ? 1 : value - 1);
|
||||
values[i] = String(value);
|
||||
}
|
||||
updateValues(top, depthColumn, values);
|
||||
}
|
||||
}
|
||||
|
||||
// function updateSelectedColumn(colIndex, value){
|
||||
// const selectedCell = jexcelInstance.selectedCell;
|
||||
// if(selectedCell != null) {
|
||||
// const y1 = Number(selectedCell[1]);
|
||||
// const y2 = Number(selectedCell[3]);
|
||||
// const top = y1 < y2 ? y1 : y2;
|
||||
// const gap = (y1 < y2 ? y2 - y1 : y1 - y2) + 1;
|
||||
//
|
||||
// const values = [];
|
||||
// for (let i = 0; i < gap; i++) {
|
||||
// values[i] = value;
|
||||
// }
|
||||
// updateValues(top, colIndex, values);
|
||||
// }
|
||||
// }
|
||||
|
||||
function updateValues(x, y, values){
|
||||
var records = [];
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
const rowIndex = x + i;
|
||||
// Update and keep history
|
||||
var record = jexcelInstance.updateCell(y, rowIndex, values[i]);
|
||||
// Keep history
|
||||
records.push(record);
|
||||
}
|
||||
|
||||
// Update history
|
||||
jexcelInstance.setHistory({
|
||||
action: 'setValue',
|
||||
records: records,
|
||||
selection: jexcelInstance.selectedCell,
|
||||
});
|
||||
|
||||
// Update table
|
||||
jexcelInstance.updateTable();
|
||||
}
|
||||
|
||||
function onTabKey(event){
|
||||
const selectedCell = jexcelInstance.selectedCell;
|
||||
const x = Number(selectedCell[0]) + 1;
|
||||
const y = Number(selectedCell[1]) + 1;
|
||||
const rowSize = jexcelInstance.getData().length;
|
||||
const colSize = columnNames.length;
|
||||
|
||||
if(x === colSize){
|
||||
if(y === rowSize){
|
||||
jexcelInstance.insertRow();
|
||||
}
|
||||
const cellNum = 'A'+(y+1);
|
||||
jexcelInstance.updateSelection(jexcelInstance.getCell(cellNum));
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
console.log(x+','+y+','+rowSize+','+colSize);
|
||||
}
|
||||
|
||||
function jexcelContextMenu (obj, x, y, e) {
|
||||
var items = [];
|
||||
|
||||
if (y == null) {
|
||||
// Insert a new column
|
||||
if (obj.options.allowInsertColumn == true) {
|
||||
items.push({
|
||||
title: obj.options.text.insertANewColumnBefore,
|
||||
onclick: function () {
|
||||
obj.insertColumn(1, parseInt(x), 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (obj.options.allowInsertColumn == true) {
|
||||
items.push({
|
||||
title: obj.options.text.insertANewColumnAfter,
|
||||
onclick: function () {
|
||||
obj.insertColumn(1, parseInt(x), 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Delete a column
|
||||
if (obj.options.allowDeleteColumn == true) {
|
||||
items.push({
|
||||
title: obj.options.text.deleteSelectedColumns,
|
||||
onclick: function () {
|
||||
obj.deleteColumn(obj.getSelectedColumns().length ? undefined : parseInt(x));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Rename column
|
||||
if (obj.options.allowRenameColumn == true) {
|
||||
items.push({
|
||||
title: obj.options.text.renameThisColumn,
|
||||
onclick: function () {
|
||||
obj.setHeader(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting
|
||||
if (obj.options.columnSorting == true) {
|
||||
// Line
|
||||
items.push({type: 'line'});
|
||||
|
||||
items.push({
|
||||
title: obj.options.text.orderAscending,
|
||||
onclick: function () {
|
||||
obj.orderBy(x, 0);
|
||||
}
|
||||
});
|
||||
items.push({
|
||||
title: obj.options.text.orderDescending,
|
||||
onclick: function () {
|
||||
obj.orderBy(x, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Insert new row
|
||||
if (obj.options.allowInsertRow == true) {
|
||||
items.push({
|
||||
title: '행 삽입',
|
||||
onclick: function () {
|
||||
const selectedCell = obj.selectedCell;
|
||||
if (selectedCell == null) {
|
||||
obj.insertRow(1, parseInt(y), 1);
|
||||
} else {
|
||||
const y1 = Number(selectedCell[1]);
|
||||
const y2 = Number(selectedCell[3]);
|
||||
const top = y1 < y2 ? y1 : y2;
|
||||
const gap = (y1 < y2 ? y2 - y1 : y1 - y2) + 1;
|
||||
obj.insertRow(gap, top, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
items.push({
|
||||
title: 'Add Row',
|
||||
onclick: function () {
|
||||
const selectedCell = obj.selectedCell;
|
||||
if (selectedCell == null) {
|
||||
obj.insertRow(1, parseInt(y), 1);
|
||||
} else {
|
||||
const y1 = Number(selectedCell[1]);
|
||||
const y2 = Number(selectedCell[3]);
|
||||
const bottom = y1 > y2 ? y1 : y2;
|
||||
const gap = (y1 < y2 ? y2 - y1 : y1 - y2) + 1;
|
||||
obj.insertRow(gap, bottom);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (obj.options.allowDeleteRow == true) {
|
||||
items.push({
|
||||
title: 'Delete Row',
|
||||
onclick: function () {
|
||||
obj.deleteRow(obj.getSelectedRows().length ? undefined : parseInt(y));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Line
|
||||
items.push({type: 'line'});
|
||||
|
||||
// Copy
|
||||
items.push({
|
||||
title: obj.options.text.copy,
|
||||
shortcut: 'Ctrl + C',
|
||||
onclick: function () {
|
||||
obj.copy();
|
||||
}
|
||||
});
|
||||
// Paste
|
||||
items.push({
|
||||
title: obj.options.text.paste,
|
||||
shortcut: 'Ctrl + V',
|
||||
onclick: function () {
|
||||
obj.paste();
|
||||
}
|
||||
});
|
||||
// Line
|
||||
items.push({type: 'line'});
|
||||
items.push({
|
||||
title: '깊이',
|
||||
submenu: [
|
||||
{
|
||||
title: '깊이증가',
|
||||
shortcut: 'Alt + →',
|
||||
onclick: function () {
|
||||
updateSelectedDepth(true);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '깊이감소',
|
||||
shortcut: 'Alt + ←',
|
||||
onclick: function () {
|
||||
updateSelectedDepth(false);
|
||||
}
|
||||
},
|
||||
]
|
||||
});
|
||||
items.push({
|
||||
title: '행 이동',
|
||||
submenu: [
|
||||
{
|
||||
title: '위로이동',
|
||||
shortcut: 'Alt + ↑',
|
||||
onclick: function () {
|
||||
moveSelectionRow(true);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '아래로이동',
|
||||
shortcut: 'Alt + ↓',
|
||||
onclick: function () {
|
||||
moveSelectionRow(false);
|
||||
}
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
function createEditGrid(element, columns, toolbarHtml, layoutData) {
|
||||
|
||||
jexcelInstance = jexcel(element.get(0), {
|
||||
data: [[]],
|
||||
columns: columns,
|
||||
rowResize: false,
|
||||
rowDrag: true,
|
||||
columnResize: false,
|
||||
columnDrag: false,
|
||||
columnSorting: false,
|
||||
autoIncrement: false,
|
||||
allowInsertColumn: false,
|
||||
allowInsertOnTab: true,
|
||||
tableOverflow: true,
|
||||
allowManualInsertRow: false,
|
||||
tableHeight: 2500,
|
||||
onbeforepaste: beforePaste,
|
||||
allowDeletingAllRows: true,
|
||||
updateTable: customUpdateTable,
|
||||
contextMenu: jexcelContextMenu
|
||||
});
|
||||
|
||||
const superSetHistory = jexcelInstance.setHistory;
|
||||
jexcelInstance.setHistory = function(changes){
|
||||
if("setWidth" === changes.action){
|
||||
return ;
|
||||
}
|
||||
superSetHistory(changes);
|
||||
};
|
||||
|
||||
element.on("keydown", function (e) {
|
||||
if (e.altKey) {
|
||||
if (e.keyCode == 39) {
|
||||
updateSelectedDepth(true);
|
||||
return false;
|
||||
}
|
||||
if (e.keyCode == 37) {
|
||||
updateSelectedDepth(false);
|
||||
return false;
|
||||
}
|
||||
if (e.keyCode == 38) {
|
||||
moveSelectionRow(true);
|
||||
return false;
|
||||
}
|
||||
if (e.keyCode == 40) {
|
||||
moveSelectionRow(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!e.shiftKey && e.keyCode == 9) {
|
||||
onTabKey(e);
|
||||
}
|
||||
});
|
||||
|
||||
if(toolbarHtml != null && toolbarHtml != ''){
|
||||
element.children().first().before(toolbarHtml);
|
||||
}
|
||||
const gridInstanceData = [[]];
|
||||
for (let i = 0; i < layoutData.length; i++) {
|
||||
const row = layoutData[i];
|
||||
gridInstanceData[i] = row;
|
||||
}
|
||||
jexcelInstance.setData(gridInstanceData);
|
||||
resizeGridInstance();
|
||||
|
||||
return jexcelInstance;
|
||||
}
|
||||
|
||||
let resizing = false;
|
||||
|
||||
function resizeGridInstance(){
|
||||
let screenGap = screenMargin == null ? 113 : screenMargin;
|
||||
var screenWidth = $(window).width() - screenGap;
|
||||
var columnWidth = 0;
|
||||
columns.forEach( function (element){
|
||||
columnWidth += element.width;
|
||||
} );
|
||||
var gap = screenWidth - columnWidth;
|
||||
if(flexColumns == null) {
|
||||
var halfGap = gap / 2;
|
||||
jexcelInstance.setWidth(0, Number(columns[0].width) + halfGap);
|
||||
jexcelInstance.setWidth(1, Number(columns[1].width) + halfGap);
|
||||
}else{
|
||||
const cnt = flexColumns.length
|
||||
const columnGap = gap / cnt;
|
||||
for (let flexColumn of flexColumns) {
|
||||
const index = columnNames.indexOf(flexColumn);
|
||||
jexcelInstance.setWidth(index, Number(columns[index].width) + columnGap);
|
||||
}
|
||||
}
|
||||
resizing = false;
|
||||
}
|
||||
|
||||
$( window ).resize( function() {
|
||||
if(!resizing){
|
||||
resizing = true;
|
||||
setTimeout(resizeGridInstance, 10);
|
||||
}
|
||||
})
|
||||
|
||||
return createEditGrid(element, paramColumns, toolbarHtml, layoutData);
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
(function($) {
|
||||
// START of plugin definition
|
||||
$.fn.showModalDialog = function(options) {
|
||||
|
||||
// build main options and merge them with default ones
|
||||
var optns = $.extend({}, $.fn.showModalDialog.defaults, options);
|
||||
|
||||
// create the iframe which will open target page
|
||||
var $frame = $('<iframe />');
|
||||
$frame.attr({
|
||||
'src': optns.url,
|
||||
'scrolling': optns.scrolling
|
||||
});
|
||||
|
||||
// set the padding to 0 to eliminate any padding,
|
||||
// set padding-bottom: 10 so that it not overlaps with the resize element
|
||||
$frame.css({
|
||||
'padding': 0,
|
||||
'margin': 0,
|
||||
'padding-bottom': 10
|
||||
});
|
||||
|
||||
// create jquery dialog using recently created iframe
|
||||
var $modalWindow = $frame.dialog({
|
||||
autoOpen: true,
|
||||
modal: true,
|
||||
width: optns.width,
|
||||
height: optns.height,
|
||||
resizable: optns.resizable,
|
||||
position: optns.position,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
close: function() {
|
||||
// save the returnValue in options so that it is available in the callback function
|
||||
optns.returnValue = $frame[0].contentWindow.window.returnValue;
|
||||
optns.onClose();
|
||||
|
||||
if(optns.option && optns.option.fullScreenPopup){
|
||||
$('iframe[name=topFrame]',window.parent.document).css('display', 'block');
|
||||
$('iframe[name=leftFrame]',window.parent.document).css('display', 'block');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('padding-top','80px');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('width','calc(100% - 180px)');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('height','calc(100% - 80px)');
|
||||
}
|
||||
},
|
||||
resizeStop: function() { $frame.css("width", "100%"); }
|
||||
});
|
||||
|
||||
if(optns.option && optns.option.fullScreenPopup && optns.dialogArguments.parent){
|
||||
$('iframe[name=topFrame]',window.parent.document).css('display', 'none');
|
||||
$('iframe[name=leftFrame]',window.parent.document).css('display', 'none');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('padding-top','0px');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('width','calc(100%)');
|
||||
$('iframe[name=mainFrame]',window.parent.document).css('height','calc(100%)');
|
||||
}
|
||||
|
||||
// set the width of the frame to 100% right after the dialog was created
|
||||
// it will not work setting it before the dialog was created
|
||||
$frame.css("width", "100%");
|
||||
|
||||
// pass dialogArguments to target page
|
||||
$frame[0].contentWindow.window.dialogArguments = optns.dialogArguments;
|
||||
// override default window.close() function for target page
|
||||
$frame[0].contentWindow.window.close = function() { $modalWindow.dialog('close'); };
|
||||
|
||||
$frame.load(function() {
|
||||
if ($modalWindow) {
|
||||
|
||||
var maxTitleLength = 50; // max title length
|
||||
var title = $(this).contents().find("title").html(); // get target page's title
|
||||
|
||||
if (title.length > maxTitleLength) {
|
||||
// trim title to max length
|
||||
title = title.substring(0, maxTitleLength) + '...';
|
||||
}else if(optns.dialogArguments.title){
|
||||
title = optns.dialogArguments.title;
|
||||
}
|
||||
|
||||
// set the dialog title to be the same as target page's title
|
||||
$modalWindow.dialog('option', 'title', title);
|
||||
}
|
||||
});
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
// plugin defaults
|
||||
$.fn.showModalDialog.defaults = {
|
||||
url: null,
|
||||
dialogArguments: null,
|
||||
height: 'auto',
|
||||
width: 'auto',
|
||||
position: 'center',
|
||||
resizable: true,
|
||||
scrolling: 'yes',
|
||||
onClose: function() { },
|
||||
returnValue: null
|
||||
};
|
||||
// END of plugin
|
||||
})(jQuery);
|
||||
|
||||
// do so that the plugin can be called $.showModalDialog({options}) instead of $().showModalDialog({options})
|
||||
jQuery.showModalDialog = function(options) { $().showModalDialog(options); };
|
||||
|
||||
|
||||
(function ($) {
|
||||
var _ajax = $.ajax,
|
||||
A = $.ajax = function(options) {
|
||||
if(window.FormData!==undefined){
|
||||
if(options.data instanceof FormData){
|
||||
if(typeof A.data !== 'string'){
|
||||
$.each(A.data,function(key,value){
|
||||
options.data.append(key,value);
|
||||
});
|
||||
}else{
|
||||
$.each($.getQueryParameters(A.data),function(key,value){
|
||||
options.data.append(key,value);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if (A.data){
|
||||
if(options.data) {
|
||||
if(typeof options.data !== 'string')
|
||||
options.data = $.param(options.data);
|
||||
if(typeof A.data !== 'string')
|
||||
A.data = $.param(A.data);
|
||||
options.data += '&' + A.data;
|
||||
} else {
|
||||
options.data = A.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (A.data){
|
||||
if(options.data) {
|
||||
if(typeof options.data !== 'string')
|
||||
options.data = $.param(options.data);
|
||||
if(typeof A.data !== 'string')
|
||||
A.data = $.param(A.data);
|
||||
options.data += '&' + A.data;
|
||||
} else {
|
||||
options.data = A.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var originalError = options.error;
|
||||
options.error = function(xhr, status, error) {
|
||||
if(xhr.status === 401) {
|
||||
var location = getContextName() + '/';
|
||||
comloadError(xhr, status, error, location);
|
||||
return;
|
||||
}
|
||||
if(originalError) originalError(xhr, status, error);
|
||||
};
|
||||
|
||||
return _ajax(options);
|
||||
};
|
||||
})(jQuery);
|
||||
$.ajax.data = { serviceType: sessionStorage["serviceType"] };
|
||||
|
||||
|
||||
|
||||
jQuery.fn.tuiTableRowSpan = function(colIndexs){
|
||||
return this.each(function(){
|
||||
for(var i=0;i<colIndexs.length;i++){
|
||||
var colIdx = colIndexs[i];
|
||||
var that;
|
||||
var rowspan=1;
|
||||
var rowCount = $("tbody tr",this).length -1;
|
||||
$("tbody tr",this).each(function(row){
|
||||
$("td:eq("+colIdx+")",this).each(function(col){
|
||||
if(that != null && $(this).html()==$(that).html()){
|
||||
rowspan +=1;
|
||||
$(this).remove();
|
||||
if (rowCount==row){
|
||||
$(that).attr("rowSpan",rowspan);
|
||||
}
|
||||
}else{
|
||||
$(that).attr("rowSpan",rowspan);
|
||||
that =this;
|
||||
rowspan=1;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
jQuery.extend({
|
||||
getQueryParameters:function(str){
|
||||
return (str).replace(/(^\?)/,'').split("&").map(function(n){return n=n.split("="),this[n[0]]=n[1],this}.bind({}))[0];
|
||||
}
|
||||
});
|
||||
if(typeof String.prototype.trim !=='function'){
|
||||
String.prototype.trim = function(){
|
||||
return this.replace(/^\s+|\s+$/g,"");
|
||||
}
|
||||
}
|
||||
if (typeof console === "undefined" || typeof console.log === "undefined"){
|
||||
console ={};
|
||||
if(false){
|
||||
console.log = function(msg){
|
||||
alert(msg);
|
||||
}
|
||||
}else{
|
||||
console.log = function(){};
|
||||
}
|
||||
}
|
||||
jQuery.extend({
|
||||
isNull : function(str){
|
||||
if(str==null || str ==undefined){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
jQuery.extend(jQuery.jgrid.defaults, {
|
||||
loadBeforeSend : function (xhr,settings){
|
||||
if(this.p.url ==null || this.p.url == ""){
|
||||
this.p.loadBeforeSend = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
function cfInitXChart(oXChart)
|
||||
{
|
||||
//먼저 기존의 Series들을 클리어 한다
|
||||
// CollectGarbage();
|
||||
oXChart.RemoveAllSeries();
|
||||
|
||||
|
||||
// oXChart.Canvas.BackColor = oXChart.ToOLEColor("Green");
|
||||
|
||||
|
||||
//XChart의 보기,기울기등의 속성을 설정한다
|
||||
// oXChart.Aspect.View3D = true;
|
||||
// oXChart.Aspect.Chart3DPercent = 15;
|
||||
// oXChart.Aspect.Elevation = 30;
|
||||
oXChart.Aspect.Zoom = 120;
|
||||
|
||||
//Xchart의 타이틀에 관련된 속성을 설정한다
|
||||
//주의 : XChart에는 Title속성이 없고 대신 Header속성이 존재한다
|
||||
oXChart.Header.Alignment = 2;
|
||||
oXChart.Header.Text.Clear();
|
||||
oXChart.Header.Font.Size=8;
|
||||
oXChart.Header.Font.Name = "돋움";
|
||||
oXChart.Header.Font.Bold = true;
|
||||
oXChart.Header.Font.Color = oXChart.ToOLEColor("#D50064");
|
||||
|
||||
// Footer
|
||||
oXChart.Footer.Text.Clear();
|
||||
oXChart.Footer.Alignment = 1;
|
||||
oXChart.Footer.Font.Size = 8;
|
||||
oXChart.Footer.Font.Name = "돋움";
|
||||
oXChart.Footer.Font.Italic = false;
|
||||
oXChart.Footer.Font.Bold = true;
|
||||
oXChart.Footer.Font.Color=oXChart.ToOLEColor("#002499");
|
||||
|
||||
//XChart의 판넬의 속성을 설정한다
|
||||
//XChart가 표시되는 전체영역의 바탕을 설정하는것이다
|
||||
oXChart.Panel.Color = oXChart.ToOLEColor("#F5F5F5,#000000");
|
||||
oXChart.Panel.BevelOuter = 0;
|
||||
oXChart.Panel.BorderStyle = 0;
|
||||
|
||||
//XChart의 좌표축에 관련된 속성을 설정한다
|
||||
|
||||
|
||||
//툴팁(마우스를 Series위에 올렸을때 값을 보여 주기위한 설정
|
||||
var Toolsidx = oXChart.Tools.Add(8);
|
||||
oXChart.Tools.Items(Toolsidx).asMarksTip.MouseAction = 0;
|
||||
oXChart.Tools.Items(Toolsidx).asMarksTip.Style = 4;
|
||||
oXChart.Tools.Items(Toolsidx).asMarksTip.Delay = 0;
|
||||
|
||||
|
||||
oXChart.Legend.Visible = false; // 범례
|
||||
|
||||
oXChart.AutoRepaint = true; // 자동 재그리기
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
;(function($){
|
||||
/**
|
||||
* jqGrid English Translation
|
||||
* Tony Tomov tony@trirand.com
|
||||
* http://trirand.com/blog/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
**/
|
||||
$.jgrid = $.jgrid || {};
|
||||
$.extend($.jgrid,{
|
||||
defaults : {
|
||||
recordtext: "View {0} - {1} / {2}",
|
||||
emptyrecords: "No records to view",
|
||||
loadtext: "Loading...",
|
||||
pgtext: "Page {0} of {1}"
|
||||
},
|
||||
search : {
|
||||
caption: "Search...",
|
||||
Find: "Find",
|
||||
Reset: "Reset",
|
||||
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
|
||||
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
|
||||
matchText: " Match",
|
||||
rulesText: " Apply"
|
||||
},
|
||||
edit : {
|
||||
addCaption: "Add Record",
|
||||
editCaption: "Edit Record",
|
||||
bSubmit: "Submit",
|
||||
bCancel: "Cancel",
|
||||
bClose: "Close",
|
||||
saveData: "Data has been changed! Save changes?",
|
||||
bYes: "Yes",
|
||||
bNo: "No",
|
||||
bExit: "Cancel",
|
||||
msg: {
|
||||
required: "Field is required",
|
||||
number: "Please, enter valid number",
|
||||
minValue: "value must be greater than or equal to ",
|
||||
maxValue: "value must be less than or equal to",
|
||||
email: "is not a valid e-mail",
|
||||
integer: "Please, enter valid integer value",
|
||||
date: "Please, enter valid date value",
|
||||
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
|
||||
nodefined: " is not defined!",
|
||||
novalue: " return value is required!",
|
||||
customarray: "Custom function should return array!",
|
||||
customfcheck: "Custom function should be present in case of custom checking!"
|
||||
}
|
||||
},
|
||||
view : {
|
||||
caption: "View Record",
|
||||
bClose: "Close"
|
||||
},
|
||||
del : {
|
||||
caption: "Delete",
|
||||
msg: "Delete selected record(s)?",
|
||||
bSubmit: "Delete",
|
||||
bCancel: "Cancel"
|
||||
},
|
||||
nav : {
|
||||
edittitle: "Edit selected row",
|
||||
addtext: "",
|
||||
addtitle: "Add new row",
|
||||
deltext: "",
|
||||
deltitle: "Delete selected row",
|
||||
searchtext: "",
|
||||
searchtitle: "Find records",
|
||||
refreshtext: "",
|
||||
refreshtitle: "Reload Grid",
|
||||
alertcap: "Warning",
|
||||
alerttext: "Please, select row",
|
||||
viewtext: "",
|
||||
viewtitle: "View selected row",
|
||||
},
|
||||
col : {
|
||||
caption: "Select columns",
|
||||
bSubmit: "Ok",
|
||||
bCancel: "Cancel"
|
||||
},
|
||||
errors : {
|
||||
errcap: "Error",
|
||||
nourl: "No url is set",
|
||||
norecords: "No records to process",
|
||||
model: "Length of colNames <> colModel!"
|
||||
},
|
||||
formatter : {
|
||||
integer : {thousandsSeparator: ",", defaultValue: '0'},
|
||||
number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
|
||||
currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
|
||||
date : {
|
||||
dayNames: [
|
||||
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
||||
],
|
||||
monthNames: [
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
||||
],
|
||||
AmPm : ["am","pm","AM","PM"],
|
||||
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
|
||||
srcformat: 'Y-m-d',
|
||||
newformat: 'm-d-Y',
|
||||
masks : {
|
||||
ISO8601Long:"Y-m-d H:i:s",
|
||||
ISO8601Short:"Y-m-d",
|
||||
ShortDate: "Y/j/n",
|
||||
LongDate: "l, F d, Y",
|
||||
FullDateTime: "l, F d, Y g:i:s A",
|
||||
MonthDay: "F d",
|
||||
ShortTime: "g:i A",
|
||||
LongTime: "g:i:s A",
|
||||
SortableDateTime: "Y-m-d\\TH:i:s",
|
||||
UniversalSortableDateTime: "Y-m-d H:i:sO",
|
||||
YearMonth: "F, Y"
|
||||
},
|
||||
reformatAfterEdit : false
|
||||
},
|
||||
baseLinkUrl: '',
|
||||
showAction: '',
|
||||
target: '',
|
||||
checkbox : {disabled:true},
|
||||
idName : 'id'
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,129 @@
|
||||
;(function($){
|
||||
/**
|
||||
* jqGrid English Translation
|
||||
* Tony Tomov tony@trirand.com
|
||||
* http://trirand.com/blog/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
**/
|
||||
$.jgrid = $.jgrid || {};
|
||||
$.extend($.jgrid,{
|
||||
defaults : {
|
||||
recordtext: "보기 {0} - {1} / {2}",
|
||||
emptyrecords: "표시할 행이 없습니다",
|
||||
loadtext: "조회중...",
|
||||
pgtext : "페이지 {0} / {1}"
|
||||
},
|
||||
search : {
|
||||
caption: "검색...",
|
||||
Find: "찾기",
|
||||
Reset: "초기화",
|
||||
odata : ['같다', '같지 않다', '작다', '작거나 같다','크다','크거나 같다', '로 시작한다','로 시작하지 않는다','내에 있다','내에 있지 않다','로 끝난다','로 끝나지 않는다','내에 존재한다','내에 존재하지 않는다'],
|
||||
groupOps: [ { op: "AND", text: "전부" }, { op: "OR", text: "임의" } ],
|
||||
matchText: " 일치하다",
|
||||
rulesText: " 적용하다"
|
||||
},
|
||||
edit : {
|
||||
addCaption: "행 추가",
|
||||
editCaption: "행 수정",
|
||||
bSubmit: "전송",
|
||||
bCancel: "취소",
|
||||
bClose: "닫기",
|
||||
saveData: "자료가 변경되었습니다! 저장하시겠습니까?",
|
||||
bYes : "예",
|
||||
bNo : "아니오",
|
||||
bExit : "취소",
|
||||
msg: {
|
||||
required:"필수항목입니다",
|
||||
number:"유효한 번호를 입력해 주세요",
|
||||
minValue:"입력값은 크거나 같아야 합니다",
|
||||
maxValue:"입력값은 작거나 같아야 합니다",
|
||||
email: "유효하지 않은 이메일주소입니다",
|
||||
integer: "유효한 숫자를 입력하세요",
|
||||
date: "유효한 날짜를 입력하세요",
|
||||
url: "은 유효하지 않은 URL입니다. 문장앞에 다음단어가 필요합니다('http://' or 'https://')",
|
||||
nodefined : " 은 정의도지 않았습니다!",
|
||||
novalue : " 반환값이 필요합니다!",
|
||||
customarray : "사용자정의 함수는 배열을 반환해야 합니다!",
|
||||
customfcheck : "Custom function should be present in case of custom checking!"
|
||||
|
||||
}
|
||||
},
|
||||
view : {
|
||||
caption: "행 조회",
|
||||
bClose: "닫기"
|
||||
},
|
||||
del : {
|
||||
caption: "삭제",
|
||||
msg: "선택된 행을 삭제하시겠습니까?",
|
||||
bSubmit: "삭제",
|
||||
bCancel: "취소"
|
||||
},
|
||||
nav : {
|
||||
edittext: "",
|
||||
edittitle: "선택된 행 편집",
|
||||
addtext:"",
|
||||
addtitle: "행 삽입",
|
||||
deltext: "",
|
||||
deltitle: "선택된 행 삭제",
|
||||
searchtext: "",
|
||||
searchtitle: "행 찾기",
|
||||
refreshtext: "",
|
||||
refreshtitle: "그리드 갱신",
|
||||
alertcap: "경고",
|
||||
alerttext: "행을 선택하세요",
|
||||
viewtext: "",
|
||||
viewtitle: "선택된 행 조회"
|
||||
},
|
||||
col : {
|
||||
caption: "열을 선택하세요",
|
||||
bSubmit: "확인",
|
||||
bCancel: "취소"
|
||||
},
|
||||
errors : {
|
||||
errcap : "오류",
|
||||
nourl : "설정된 url이 없습니다",
|
||||
norecords: "처리할 행이 없습니다",
|
||||
model : "colNames의 길이가 colModel과 일치하지 않습니다!"
|
||||
},
|
||||
formatter : {
|
||||
integer : {thousandsSeparator: ",", defaultValue: '0'},
|
||||
number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
|
||||
currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
|
||||
date : {
|
||||
dayNames: [
|
||||
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
|
||||
"일", "월", "화", "수", "목", "금", "토"
|
||||
],
|
||||
monthNames: [
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
||||
"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
|
||||
],
|
||||
AmPm : ["am","pm","AM","PM"],
|
||||
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
|
||||
srcformat: 'Y-m-d',
|
||||
newformat: 'm-d-Y',
|
||||
masks : {
|
||||
ISO8601Long:"Y-m-d H:i:s",
|
||||
ISO8601Short:"Y-m-d",
|
||||
ShortDate: "Y/j/n",
|
||||
LongDate: "l, F d, Y",
|
||||
FullDateTime: "l, F d, Y g:i:s A",
|
||||
MonthDay: "F d",
|
||||
ShortTime: "g:i A",
|
||||
LongTime: "g:i:s A",
|
||||
SortableDateTime: "Y-m-d\\TH:i:s",
|
||||
UniversalSortableDateTime: "Y-m-d H:i:sO",
|
||||
YearMonth: "F, Y"
|
||||
},
|
||||
reformatAfterEdit : false
|
||||
},
|
||||
baseLinkUrl: '',
|
||||
showAction: '',
|
||||
target: '',
|
||||
checkbox : {disabled:true},
|
||||
idName : 'id'
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
Vendored
+326
@@ -0,0 +1,326 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
;(function(window, document) {
|
||||
/*jshint evil:true */
|
||||
/** version */
|
||||
var version = '3.7.3';
|
||||
|
||||
/** Preset options */
|
||||
var options = window.html5 || {};
|
||||
|
||||
/** Used to skip problem elements */
|
||||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||||
|
||||
/** Not all elements can be cloned in IE **/
|
||||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||||
|
||||
/** Detect whether the browser supports default html5 styles */
|
||||
var supportsHtml5Styles;
|
||||
|
||||
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
||||
var expando = '_html5shiv';
|
||||
|
||||
/** The id for the the documents expando */
|
||||
var expanID = 0;
|
||||
|
||||
/** Cached data for each document */
|
||||
var expandoData = {};
|
||||
|
||||
/** Detect whether the browser supports unknown elements */
|
||||
var supportsUnknownElements;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
var a = document.createElement('a');
|
||||
a.innerHTML = '<xyz></xyz>';
|
||||
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
||||
supportsHtml5Styles = ('hidden' in a);
|
||||
|
||||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||||
// assign a false positive if unable to shiv
|
||||
(document.createElement)('a');
|
||||
var frag = document.createDocumentFragment();
|
||||
return (
|
||||
typeof frag.cloneNode == 'undefined' ||
|
||||
typeof frag.createDocumentFragment == 'undefined' ||
|
||||
typeof frag.createElement == 'undefined'
|
||||
);
|
||||
}());
|
||||
} catch(e) {
|
||||
// assign a false positive if detection fails => unable to shiv
|
||||
supportsHtml5Styles = true;
|
||||
supportsUnknownElements = true;
|
||||
}
|
||||
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a style sheet with the given CSS text and adds it to the document.
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @param {String} cssText The CSS text.
|
||||
* @returns {StyleSheet} The style element.
|
||||
*/
|
||||
function addStyleSheet(ownerDocument, cssText) {
|
||||
var p = ownerDocument.createElement('p'),
|
||||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||||
|
||||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of `html5.elements` as an array.
|
||||
* @private
|
||||
* @returns {Array} An array of shived element node names.
|
||||
*/
|
||||
function getElements() {
|
||||
var elements = html5.elements;
|
||||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends the built-in list of html5 elements
|
||||
* @memberOf html5
|
||||
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
|
||||
* @param {Document} ownerDocument The context document.
|
||||
*/
|
||||
function addElements(newElements, ownerDocument) {
|
||||
var elements = html5.elements;
|
||||
if(typeof elements != 'string'){
|
||||
elements = elements.join(' ');
|
||||
}
|
||||
if(typeof newElements != 'string'){
|
||||
newElements = newElements.join(' ');
|
||||
}
|
||||
html5.elements = elements +' '+ newElements;
|
||||
shivDocument(ownerDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data associated to the given document
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @returns {Object} An object of data.
|
||||
*/
|
||||
function getExpandoData(ownerDocument) {
|
||||
var data = expandoData[ownerDocument[expando]];
|
||||
if (!data) {
|
||||
data = {};
|
||||
expanID++;
|
||||
ownerDocument[expando] = expanID;
|
||||
expandoData[expanID] = data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived element for the given nodeName and document
|
||||
* @memberOf html5
|
||||
* @param {String} nodeName name of the element
|
||||
* @param {Document|DocumentFragment} ownerDocument The context document.
|
||||
* @returns {Object} The shived element.
|
||||
*/
|
||||
function createElement(nodeName, ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createElement(nodeName);
|
||||
}
|
||||
if (!data) {
|
||||
data = getExpandoData(ownerDocument);
|
||||
}
|
||||
var node;
|
||||
|
||||
if (data.cache[nodeName]) {
|
||||
node = data.cache[nodeName].cloneNode();
|
||||
} else if (saveClones.test(nodeName)) {
|
||||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||||
} else {
|
||||
node = data.createElem(nodeName);
|
||||
}
|
||||
|
||||
// Avoid adding some elements to fragments in IE < 9 because
|
||||
// * Attributes like `name` or `type` cannot be set/changed once an element
|
||||
// is inserted into a document/fragment
|
||||
// * Link elements with `src` attributes that are inaccessible, as with
|
||||
// a 403 response, will cause the tab/window to crash
|
||||
// * Script elements appended to fragments will execute when their `src`
|
||||
// or `text` property is set
|
||||
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived DocumentFragment for the given document
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived DocumentFragment.
|
||||
*/
|
||||
function createDocumentFragment(ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createDocumentFragment();
|
||||
}
|
||||
data = data || getExpandoData(ownerDocument);
|
||||
var clone = data.frag.cloneNode(),
|
||||
i = 0,
|
||||
elems = getElements(),
|
||||
l = elems.length;
|
||||
for(;i<l;i++){
|
||||
clone.createElement(elems[i]);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
||||
* @private
|
||||
* @param {Document|DocumentFragment} ownerDocument The document.
|
||||
* @param {Object} data of the document.
|
||||
*/
|
||||
function shivMethods(ownerDocument, data) {
|
||||
if (!data.cache) {
|
||||
data.cache = {};
|
||||
data.createElem = ownerDocument.createElement;
|
||||
data.createFrag = ownerDocument.createDocumentFragment;
|
||||
data.frag = data.createFrag();
|
||||
}
|
||||
|
||||
|
||||
ownerDocument.createElement = function(nodeName) {
|
||||
//abort shiv
|
||||
if (!html5.shivMethods) {
|
||||
return data.createElem(nodeName);
|
||||
}
|
||||
return createElement(nodeName, ownerDocument, data);
|
||||
};
|
||||
|
||||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||||
'var n=f.cloneNode(),c=n.createElement;' +
|
||||
'h.shivMethods&&(' +
|
||||
// unroll the `createElement` calls
|
||||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
|
||||
data.createElem(nodeName);
|
||||
data.frag.createElement(nodeName);
|
||||
return 'c("' + nodeName + '")';
|
||||
}) +
|
||||
');return n}'
|
||||
)(html5, data.frag);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Shivs the given document.
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The document to shiv.
|
||||
* @returns {Document} The shived document.
|
||||
*/
|
||||
function shivDocument(ownerDocument) {
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
var data = getExpandoData(ownerDocument);
|
||||
|
||||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||||
// corrects block display not defined in IE6/7/8/9
|
||||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||||
// adds styling not present in IE6/7/8/9
|
||||
'mark{background:#FF0;color:#000}' +
|
||||
// hides non-rendered elements
|
||||
'template{display:none}'
|
||||
);
|
||||
}
|
||||
if (!supportsUnknownElements) {
|
||||
shivMethods(ownerDocument, data);
|
||||
}
|
||||
return ownerDocument;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `html5` object is exposed so that more elements can be shived and
|
||||
* existing shiving can be detected on iframes.
|
||||
* @type Object
|
||||
* @example
|
||||
*
|
||||
* // options can be changed before the script is included
|
||||
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
||||
*/
|
||||
var html5 = {
|
||||
|
||||
/**
|
||||
* An array or space separated string of node names of the elements to shiv.
|
||||
* @memberOf html5
|
||||
* @type Array|String
|
||||
*/
|
||||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
|
||||
|
||||
/**
|
||||
* current version of html5shiv
|
||||
*/
|
||||
'version': version,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the HTML5 style sheet should be inserted.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivCSS': (options.shivCSS !== false),
|
||||
|
||||
/**
|
||||
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
||||
* @memberOf html5
|
||||
* @type boolean
|
||||
*/
|
||||
'supportsUnknownElements': supportsUnknownElements,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
||||
* methods should be overwritten.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivMethods': (options.shivMethods !== false),
|
||||
|
||||
/**
|
||||
* A string to describe the type of `html5` object ("default" or "default print").
|
||||
* @memberOf html5
|
||||
* @type String
|
||||
*/
|
||||
'type': 'default',
|
||||
|
||||
// shivs the document according to the specified `html5` object options
|
||||
'shivDocument': shivDocument,
|
||||
|
||||
//creates a shived element
|
||||
createElement: createElement,
|
||||
|
||||
//creates a shived documentFragment
|
||||
createDocumentFragment: createDocumentFragment,
|
||||
|
||||
//extends list of elements
|
||||
addElements: addElements
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose html5
|
||||
window.html5 = html5;
|
||||
|
||||
// shiv the document
|
||||
shivDocument(document);
|
||||
|
||||
if(typeof module == 'object' && module.exports){
|
||||
module.exports = html5;
|
||||
}
|
||||
|
||||
}(typeof window !== "undefined" ? window : this, document));
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* 공통 UTIL 함수
|
||||
*/
|
||||
|
||||
var _jxcelEactiveCustom = {
|
||||
getEaColumnIndex : function (columnName) {
|
||||
const columns = this.options.columns;
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
const column = columns[i];
|
||||
if (column.name == columnName) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
},
|
||||
getEaColumnName : function (index) {
|
||||
var column = this.options.columns[index];
|
||||
return column.name;
|
||||
},
|
||||
getEaCellValue : function (row, columnName) {
|
||||
const col = this.getEaColumnIndex(columnName);
|
||||
const cellId = jexcel.getColumnNameFromId([col, row]);
|
||||
return this.getValue(cellId);
|
||||
},
|
||||
eaClearData : function () {
|
||||
this.setData([{}]);
|
||||
return this;
|
||||
},
|
||||
eaAutoResize : function (div_id) {
|
||||
// window에 resize 이벤트를 바인딩 한다.
|
||||
const _grid = this;
|
||||
$(window).bind('resize', function() {
|
||||
var totalWidth = $('#' + div_id).width();
|
||||
var columns = _grid.options.columns;
|
||||
/*
|
||||
* 윈도우 사이즈가 1150일 경우 작은 minWidth로 지정
|
||||
*/
|
||||
var smallWindow = totalWidth < 1150;
|
||||
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
var column = columns[i];
|
||||
if (smallWindow && Number.isInteger(column.minWidth)) {
|
||||
_grid.setWidth(i, column.minWidth);
|
||||
} else if (!smallWindow) {
|
||||
_grid.setWidth(i, column.maxWidth);
|
||||
}
|
||||
}
|
||||
|
||||
// 번호 컬럼 길이 50 기본 설정
|
||||
var othersWidth = 50;
|
||||
var resizeColumnCount = 0;
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
var column = columns[i];
|
||||
if (column.type == 'hidden') {
|
||||
continue;
|
||||
}
|
||||
if (!column.resize && Number.isInteger(column.width)) {
|
||||
// 가변 컬럼이 아닌 경우
|
||||
othersWidth += column.width;
|
||||
} else {
|
||||
// 컬럼길이가 가변으로 정해 진 경우
|
||||
resizeColumnCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (resizeColumnCount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 가변 컬럼의 길이는 전체 넓이에 나머지 컬럼의 길이를 뺀 후 가변 컬럼의 수로 나눈 값이 된다.
|
||||
var resizeColumnWidth = (totalWidth - othersWidth) / resizeColumnCount;
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
var column = columns[i];
|
||||
if (column.resize) {
|
||||
if (resizeColumnWidth < column.minWidth) {
|
||||
_grid.setWidth(i, column.minWidth);
|
||||
} else {
|
||||
_grid.setWidth(i, resizeColumnWidth);
|
||||
}
|
||||
} else {
|
||||
if (smallWindow && Number.isInteger(column.minWidth)) {
|
||||
_grid.setWidth(i, column.minWidth);
|
||||
} else if (!smallWindow) {
|
||||
_grid.setWidth(i, column.width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var gridTotalWidth = 0;
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
var column = columns[i];
|
||||
gridTotalWidth += column.width;
|
||||
}
|
||||
}).trigger('resize');
|
||||
return _grid;
|
||||
},
|
||||
setEaRowData : function (index, rowData) {
|
||||
try {
|
||||
var gridData = this.getJson()
|
||||
gridData[index] = rowData;
|
||||
this.setData(gridData);
|
||||
} catch (e) {
|
||||
console.log('setEaRowData error : ' + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function JexcelEactiveCustom(element, options) {
|
||||
var _jexcel = jexcel(element, options);
|
||||
$.extend(_jexcel, _jxcelEactiveCustom);
|
||||
return _jexcel;
|
||||
}
|
||||
+14107
File diff suppressed because it is too large
Load Diff
+3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(c){c.jqplot.EnhancedLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedLegendRenderer.prototype.constructor=c.jqplot.EnhancedLegendRenderer;c.jqplot.EnhancedLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedLegendRenderer.prototype.draw=function(m,y){var f=this;if(this.show){var r=this._series;var u;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";w+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";w+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";w+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";w+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('<table class="jqplot-table-legend" style="'+w+'"></table>');if(this.seriesToggle){this._elem.css("z-index","3")}var C=false,q=false,d,o;if(this.numberRows){d=this.numberRows;if(!this.numberColumns){o=Math.ceil(r.length/d)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;d=Math.ceil(r.length/this.numberColumns)}else{d=r.length;o=1}}var B,z,e,l,k,n,p,t,h,g;var v=0;for(B=r.length-1;B>=0;B--){if(o==1&&r[B]._stack||r[B].renderer.constructor==c.jqplot.BezierCurveRenderer){q=true}}for(B=0;B<d;B++){e=c(document.createElement("tr"));e.addClass("jqplot-table-legend");if(q){e.prependTo(this._elem)}else{e.appendTo(this._elem)}for(z=0;z<o;z++){if(v<r.length&&(r[v].show||r[v].showLabel)){u=r[v];n=this.labels[v]||u.label.toString();if(n){var x=u.color;if(!q){if(B>0){C=true}else{C=false}}else{if(B==d-1){C=false}else{C=true}}p=(C)?this.rowSpacing:"0";l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-swatch");l.css({textAlign:"center",paddingTop:p});h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch-outline");g=c(document.createElement("div"));g.addClass("jqplot-table-legend-swatch");g.css({backgroundColor:x,borderColor:x});l.append(h.append(g));k=c(document.createElement("td"));k.addClass("jqplot-table-legend jqplot-table-legend-label");k.css("paddingTop",p);if(this.escapeHtml){k.text(n)}else{k.html(n)}if(q){if(this.showLabels){k.prependTo(e)}if(this.showSwatches){l.prependTo(e)}}else{if(this.showSwatches){l.appendTo(e)}if(this.showLabels){k.appendTo(e)}}/* legend 클릭시 show/hide 기능 사용안함. if(this.seriesToggle){var A;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){A=this.seriesToggle}}if(this.showSwatches){l.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(this.showLabels){k.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);k.addClass("jqplot-seriesToggle")}if(!u.show&&u.showLabel){l.addClass("jqplot-series-hidden");k.addClass("jqplot-series-hidden")}}*/C=true}}v++}l=k=h=g=null}}return this._elem};var a=function(j){var i=j.data,m=i.series,k=i.replot,h=i.plot,f=i.speed,l=m.index,g=false;if(m.canvas._elem.is(":hidden")||!m.show){g=true}var e=function(){if(k){var n={};if(c.isPlainObject(k)){c.extend(true,n,k)}h.replot(n);if(g&&f){var d=h.series[l];if(d.shadowCanvas._elem){d.shadowCanvas._elem.hide().fadeIn(f)}d.canvas._elem.hide().fadeIn(f);d.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+d.index).hide().fadeIn(f)}}else{var d=h.series[l];if(d.canvas._elem.is(":hidden")||!d.show){if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).addClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).addClass("jqplot-series-hidden")}}else{if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).removeClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).removeClass("jqplot-series-hidden")}}}};m.toggleDisplay(j,e)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=-5;this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=false;this._elems=[];c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(j,h,f,g,i){var e=c.extend(true,{},f,g);e.pointLabels=e.pointLabels||{};if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"&&!e.pointLabels.location){e.pointLabels.location="e"}this.plugins.pointLabels=new c.jqplot.PointLabels(e.pointLabels);this.plugins.pointLabels.setLabels.call(this)};c.jqplot.PointLabels.prototype.setLabels=function(){var f=this.plugins.pointLabels;var h;if(f.seriesLabelIndex!=null){h=f.seriesLabelIndex}else{if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"){h=(this._plotData[0].length<3)?0:this._plotData[0].length-1}else{h=(this._plotData.length===0)?0:this._plotData[0].length-1}}f._labels=[];if(f.labels.length===0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){for(var e=0;e<this._plotData.length;e++){f._labels.push(this._plotData[e][h])}}}else{var g=this.data;if(this.renderer.constructor===c.jqplot.BarRenderer&&this.waterfall){g=this._data}if(g.length&&g[0].length){for(var e=0;e<g.length;e++){f._labels.push(g[e][h])}}g=null}}else{if(f.labels.length){f._labels=f.labels}}};c.jqplot.PointLabels.prototype.xOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerWidth(true)-this.xpadding;break;case"n":h=-f.outerWidth(true)/2;break;case"ne":h=this.xpadding;break;case"e":h=this.xpadding;break;case"se":h=this.xpadding;break;case"s":h=-f.outerWidth(true)/2;break;case"sw":h=-f.outerWidth(true)-this.xpadding;break;case"w":h=-f.outerWidth(true)-this.xpadding;break;default:h=-f.outerWidth(true)-this.xpadding;break}return h};c.jqplot.PointLabels.prototype.yOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerHeight(true)-this.ypadding;break;case"n":h=-f.outerHeight(true)-this.ypadding;break;case"ne":h=-f.outerHeight(true)-this.ypadding;break;case"e":h=-f.outerHeight(true)/2;break;case"se":h=this.ypadding;break;case"s":h=this.ypadding;break;case"sw":h=this.ypadding;break;case"w":h=-f.outerHeight(true)/2;break;default:h=-f.outerHeight(true)-this.ypadding;break}return h};c.jqplot.PointLabels.draw=function(x,j,v){var t=this.plugins.pointLabels;t.setLabels.call(this);for(var w=0;w<t._elems.length;w++){t._elems[w].emptyForce()}t._elems.splice(0,t._elems.length);if(t.show){var r="_"+this._stackAxis+"axis";if(!t.formatString){t.formatString=this[r]._ticks[0].formatString;t.formatter=this[r]._ticks[0].formatter}var E=this._plotData;var D=this._prevPlotData;var A=this._xaxis;var q=this._yaxis;var z,f;for(var w=0,u=t._labels.length;w<u;w++){var o=t._labels[w];if(o==null||(t.hideZeros&&parseInt(o,10)==0)){continue}o=t.formatter(t.formatString,o);f=document.createElement("div");t._elems[w]=c(f);z=t._elems[w];z.addClass("jqplot-point-label jqplot-series-"+this.index+" jqplot-point-"+w);z.css("position","absolute");z.insertAfter(x.canvas);if(t.escapeHTML){z.text(o)}else{z.html(o)}var g=t.location;if((this.fillToZero&&E[w][1]<0)||(this.fillToZero&&this._type==="bar"&&this.barDirection==="horizontal"&&E[w][0]<0)||(this.waterfall&&parseInt(o,10))<0){g=b[d[g]]}var n=A.u2p(E[w][0])+t.xOffset(z,g);var h=q.u2p(E[w][1])+t.yOffset(z,g);if(this._stack&&!t.stackedValue){if(this.barDirection==="vertical"){h=(this._barPoints[w][0][1]+this._barPoints[w][1][1])/2+v._gridPadding.top-0.5*z.outerHeight(true)}else{n=(this._barPoints[w][2][0]+this._barPoints[w][0][0])/2+v._gridPadding.left-0.5*z.outerWidth(true)}}if(this.renderer.constructor==c.jqplot.BarRenderer){if(this.barDirection=="vertical"){n+=this._barNudge}else{h-=this._barNudge}}z.css("left",n);z.css("top",h);var k=n+z.width();var s=h+z.height();var C=t.edgeTolerance;var e=c(x.canvas).position().left;var y=c(x.canvas).position().top;var B=x.canvas.width+e;var m=x.canvas.height+y;if(n-C<e||h-C<y||k+C>B||s+C>m){z.remove()}z=null;f=null}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery);
|
||||
Vendored
+5
File diff suppressed because one or more lines are too long
Vendored
+4
File diff suppressed because one or more lines are too long
Vendored
+18706
File diff suppressed because it is too large
Load Diff
Vendored
+13
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (value !== undefined && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
||||
Vendored
+11
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+11
File diff suppressed because one or more lines are too long
Vendored
+1687
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Vendored
+3
File diff suppressed because one or more lines are too long
Vendored
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
|
||||
jquery.layout 1.4.3
|
||||
$Date: 2014-08-30 08:00:00 (Sat, 30 Aug 2014) $
|
||||
$Rev: 1.0403 $
|
||||
|
||||
Copyright (c) 2014 Kevin Dalman (http://jquery-dev.com)
|
||||
Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
|
||||
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
|
||||
SEE: http://layout.jquery-dev.com/LICENSE.txt
|
||||
|
||||
Changelog: http://layout.jquery-dev.com/changelog.cfm
|
||||
|
||||
Docs: http://layout.jquery-dev.com/documentation.html
|
||||
Tips: http://layout.jquery-dev.com/tips.html
|
||||
Help: http://groups.google.com/group/jquery-ui-layout
|
||||
*/
|
||||
(function(d){var ua=Math.min,E=Math.max,ka=Math.floor,U=function(e){return"string"===d.type(e)},ha=function(e,t){if(d.isArray(t))for(var m=0,q=t.length;m<q;m++){var x=t[m];try{U(x)&&(x=eval(x)),d.isFunction(x)&&x(e)}catch(n){}}};d.layout={version:"1.4.3",revision:1.0403,browser:{},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},
|
||||
west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},config:{optionRootKeys:"effects panes north south west east center".split(" "),allPanes:["north","south","west","east","center"],borderPanes:["north","south","west","east"],oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},offscreenCSS:{left:"-99999px",right:"auto"},offscreenReset:"offscreenReset",hidden:{visibility:"hidden"},visible:{visibility:"visible"},
|
||||
resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",
|
||||
background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},
|
||||
center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},getParentPaneElem:function(e){e=d(e);if(e=e.data("layout")||e.data("parentLayout")){e=e.container;if(e.data("layoutPane"))return e;e=e.closest("."+d.layout.defaults.panes.paneClass);if(e.data("layoutPane"))return e}return null},getParentPaneInstance:function(e){return(e=d.layout.getParentPaneElem(e))?e.data("layoutPane"):null},getParentLayoutInstance:function(e){return(e=d.layout.getParentPaneElem(e))?
|
||||
e.data("parentLayout"):null},getEventObject:function(d){return"object"===typeof d&&d.stopPropagation?d:null},parsePaneName:function(e){var t=d.layout.getEventObject(e);t&&(t.stopPropagation(),e=d(this).data("layoutEdge"));e&&!/^(west|east|north|south|center)$/.test(e)&&(d.layout.msg('LAYOUT ERROR - Invalid pane-name: "'+e+'"'),e="error");return e},plugins:{draggable:!!d.fn.draggable,effects:{core:!!d.effects,slide:d.effects&&(d.effects.slide||d.effects.effect&&d.effects.effect.slide)}},onCreate:[],
|
||||
onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||d.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||d.layout.getScrollbarSize("height")},getScrollbarSize:function(e){var t=d('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; border: 0; overflow: scroll;"></div>').appendTo("body"),m={width:t.outerWidth-t[0].clientWidth,height:100-t[0].clientHeight};
|
||||
t.remove();window.scrollbarWidth=m.width;window.scrollbarHeight=m.height;return e.match(/^(width|height)$/)?m[e]:m},disableTextSelection:function(){var e=d(document);d.fn.disableSelection&&(e.data("textSelectionInitialized")||e.on("mouseup",d.layout.enableTextSelection).data("textSelectionInitialized",!0),e.data("textSelectionDisabled")||e.disableSelection().data("textSelectionDisabled",!0))},enableTextSelection:function(){var e=d(document);d.fn.enableSelection&&e.data("textSelectionDisabled")&&e.enableSelection().data("textSelectionDisabled",
|
||||
!1)},showInvisibly:function(d,t){if(d&&d.length&&(t||"none"===d.css("display"))){var m=d[0].style,m={display:m.display||"",visibility:m.visibility||""};d.css({display:"block",visibility:"hidden"});return m}return{}},getElementDimensions:function(e,t){var m={css:{},inset:{}},q=m.css,x={bottom:0},n=d.layout.cssNum,z=Math.round,C=e.offset(),F,L,N;m.offsetLeft=C.left;m.offsetTop=C.top;t||(t={});d.each(["Left","Right","Top","Bottom"],function(n,r){F=q["border"+r]=d.layout.borderWidth(e,r);L=q["padding"+
|
||||
r]=d.layout.cssNum(e,"padding"+r);N=r.toLowerCase();m.inset[N]=0<=t[N]?t[N]:L;x[N]=m.inset[N]+F});q.width=z(e.width());q.height=z(e.height());q.top=n(e,"top",!0);q.bottom=n(e,"bottom",!0);q.left=n(e,"left",!0);q.right=n(e,"right",!0);m.outerWidth=z(e.outerWidth());m.outerHeight=z(e.outerHeight());m.innerWidth=E(0,m.outerWidth-x.left-x.right);m.innerHeight=E(0,m.outerHeight-x.top-x.bottom);m.layoutWidth=z(e.innerWidth());m.layoutHeight=z(e.innerHeight());return m},getElementStyles:function(d,t){var m=
|
||||
{},q=d[0].style,x=t.split(","),n=["Top","Bottom","Left","Right"],z=["Color","Style","Width"],C,F,L,E,A,r;for(E=0;E<x.length;E++)if(C=x[E],C.match(/(border|padding|margin)$/))for(A=0;4>A;A++)if(F=n[A],"border"===C)for(r=0;3>r;r++)L=z[r],m[C+F+L]=q[C+F+L];else m[C+F]=q[C+F];else m[C]=q[C];return m},cssWidth:function(e,t){if(0>=t)return 0;var m=d.layout.browser,m=m.boxModel?m.boxSizing?e.css("boxSizing"):"content-box":"border-box",q=d.layout.borderWidth,x=d.layout.cssNum,n=t;"border-box"!==m&&(n-=q(e,
|
||||
"Left")+q(e,"Right"));"content-box"===m&&(n-=x(e,"paddingLeft")+x(e,"paddingRight"));return E(0,n)},cssHeight:function(e,t){if(0>=t)return 0;var m=d.layout.browser,m=m.boxModel?m.boxSizing?e.css("boxSizing"):"content-box":"border-box",q=d.layout.borderWidth,x=d.layout.cssNum,n=t;"border-box"!==m&&(n-=q(e,"Top")+q(e,"Bottom"));"content-box"===m&&(n-=x(e,"paddingTop")+x(e,"paddingBottom"));return E(0,n)},cssNum:function(e,t,m){e.jquery||(e=d(e));var q=d.layout.showInvisibly(e);t=d.css(e[0],t,!0);m=
|
||||
m&&"auto"==t?t:Math.round(parseFloat(t)||0);e.css(q);return m},borderWidth:function(e,t){e.jquery&&(e=e[0]);var m="border"+t.substr(0,1).toUpperCase()+t.substr(1);return"none"===d.css(e,m+"Style",!0)?0:Math.round(parseFloat(d.css(e,m+"Width",!0))||0)},isMouseOverElem:function(e,t){var m=d(t||this),q=m.offset(),x=q.top,q=q.left,n=q+m.outerWidth(),m=x+m.outerHeight(),z=e.pageX,C=e.pageY;return d.layout.browser.msie&&0>z&&0>C||z>=q&&z<=n&&C>=x&&C<=m},msg:function(e,t,m,q){d.isPlainObject(e)&&window.debugData?
|
||||
("string"===typeof t?(q=m,m=t):"object"===typeof m&&(q=m,m=null),m=m||"log( <object> )",q=d.extend({sort:!1,returnHTML:!1,display:!1},q),!0===t||q.display?debugData(e,m,q):window.console&&console.log(debugData(e,m,q))):t?alert(e):window.console?console.log(e):(t=d("#layoutLogger"),t.length||(t=d('<div id="layoutLogger" style="position: '+(d.support.fixedPosition?"fixed":"absolute")+'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);"><div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;"><span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div><ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul></div>').appendTo("body"),
|
||||
t.css("left",d(window).width()-t.outerWidth()-5),d.ui.draggable&&t.draggable({handle:":first-child"})),t.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+e.replace(/\</g,"<").replace(/\>/g,">")+"</li>"))}};(function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||
|
||||
[],e=t[1]||"",t=t[2]||0,m="msie"===e,q=document.compatMode,x=d.support,n=void 0!==x.boxSizing?x.boxSizing:x.boxSizingReliable,z=!m||!q||"CSS1Compat"===q||x.boxModel||!1,C=d.layout.browser={version:t,safari:"webkit"===e,webkit:"chrome"===e,msie:m,isIE6:m&&6==t,boxModel:z,boxSizing:!("function"===typeof n?!n():!n)};e&&(C[e]=!0);z||q||d(function(){C.boxModel=x.boxModel})})();d.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,
|
||||
resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",
|
||||
centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",
|
||||
contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,
|
||||
resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:d.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},
|
||||
showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,
|
||||
onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};d.layout.optionsMap=
|
||||
{layout:"name instanceKey stateManagement effects inset zIndexes errors zIndex scrollToBookmarkOnLoad showErrorMessages maskPanesEarly outset resizeWithWindow resizeWithWindowDelay resizeWithWindowMaxDelay onresizeall onresizeall_start onresizeall_end onload onload_start onload_end onunload onunload_start onunload_end".split(" "),center:"paneClass contentSelector contentIgnoreSelector findNestedContent applyDemoStyles triggerEventsOnLoad showOverflowOnHover maskContents maskObjects liveContentResizing containerSelector children initChildren resizeChildren destroyChildren onresize onresize_start onresize_end onsizecontent onsizecontent_start onsizecontent_end".split(" "),
|
||||
noDefault:["paneSelector","resizerCursor","customHotkey"]};d.layout.transformData=function(e,t){var m=t?{panes:{},center:{}}:{},q,x,n,z,C,F,E;if("object"!==typeof e)return m;for(x in e)for(q=m,C=e[x],n=x.split("__"),E=n.length-1,F=0;F<=E;F++)z=n[F],F===E?d.isPlainObject(C)?q[z]=d.layout.transformData(C):q[z]=C:(q[z]||(q[z]={}),q=q[z]);return m};d.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",
|
||||
resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain",
|
||||
"cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function t(d,n){for(var m=d.split("."),t=m.length-1,q={branch:e,key:m[t]},r=0,p;r<t;r++)p=m[r],q.branch=void 0==q.branch[p]?n?q.branch[p]={}:{}:q.branch[p];return q}var m=d.layout.backwardCompatibility.map,
|
||||
q,x,n,z;for(z in m)q=t(z),n=q.branch[q.key],void 0!==n&&(x=t(m[z],!0),x.branch[x.key]=n,delete q.branch[q.key])},renameAllOptions:function(e){var t=d.layout.backwardCompatibility.renameOptions;t(e);e.defaults&&("object"!==typeof e.panes&&(e.panes={}),d.extend(!0,e.panes,e.defaults),delete e.defaults);e.panes&&t(e.panes);d.each(d.layout.config.allPanes,function(d,q){e[q]&&t(e[q])});return e}};d.fn.layout=function(e){function t(a){if(!a)return!0;var b=a.keyCode;if(33>b)return!0;var c={38:"north",40:"south",
|
||||
37:"west",39:"east"},g=a.shiftKey,f=a.ctrlKey,u,h,l,k;f&&37<=b&&40>=b&&r[c[b]].enableCursorHotkey?k=c[b]:(f||g)&&d.each(n.borderPanes,function(a,c){u=r[c];h=u.customHotkey;l=u.customHotkeyModifier;if((g&&"SHIFT"==l||f&&"CTRL"==l||f&&g)&&h&&b===(isNaN(h)||9>=h?h.toUpperCase().charCodeAt(0):h))return k=c,!1});if(!k||!w[k]||!r[k].closable||p[k].isHidden)return!0;ca(k);a.stopPropagation();return a.returnValue=!1}function m(a){if(H()){this&&this.tagName&&(a=this);var b;U(a)?b=w[a]:d(a).data("layoutRole")?
|
||||
b=d(a):d(a).parents().each(function(){if(d(this).data("layoutRole"))return b=d(this),!1});if(b&&b.length){var c=b.data("layoutEdge");a=p[c];a.cssSaved&&q(c);if(a.isSliding||a.isResizing||a.isClosed)a.cssSaved=!1;else{var g={zIndex:r.zIndexes.resizer_normal+1},f={},u=b.css("overflow"),h=b.css("overflowX"),l=b.css("overflowY");"visible"!=u&&(f.overflow=u,g.overflow="visible");h&&!h.match(/(visible|auto)/)&&(f.overflowX=h,g.overflowX="visible");l&&!l.match(/(visible|auto)/)&&(f.overflowY=h,g.overflowY=
|
||||
"visible");a.cssSaved=f;b.css(g);d.each(n.allPanes,function(a,b){b!=c&&q(b)})}}}}function q(a){if(H()){this&&this.tagName&&(a=this);var b;U(a)?b=w[a]:d(a).data("layoutRole")?b=d(a):d(a).parents().each(function(){if(d(this).data("layoutRole"))return b=d(this),!1});if(b&&b.length){a=b.data("layoutEdge");a=p[a];var c=a.cssSaved||{};a.isSliding||a.isResizing||b.css("zIndex",r.zIndexes.pane_normal);b.css(c);a.cssSaved=!1}}}var x=d.layout.browser,n=d.layout.config,z=d.layout.cssWidth,C=d.layout.cssHeight,
|
||||
F=d.layout.getElementDimensions,L=d.layout.getElementStyles,N=d.layout.getEventObject,A=d.layout.parsePaneName,r=d.extend(!0,{},d.layout.defaults);r.effects=d.extend(!0,{},d.layout.effects);var p={id:"layout"+d.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},R={north:null,south:null,east:null,west:null,center:null},
|
||||
J={data:{},set:function(a,b,c){J.clear(a);J.data[a]=setTimeout(b,c)},clear:function(a){var b=J.data;b[a]&&(clearTimeout(b[a]),delete b[a])}},S=function(a,b,c){var g=r;(g.showErrorMessages&&!c||c&&g.showDebugMessages)&&d.layout.msg(g.name+" / "+a,!1!==b);return!1},D=function(a,b,c){var g=b&&U(b),f=g?p[b]:p,u=g?r[b]:r,h=r.name,l=a+(a.match(/_/)?"":"_end"),k=l.match(/_end$/)?l.substr(0,l.length-4):"",s=u[l]||u[k],e="NC",n=[],m=g?w[b]:0;if(g&&!m)return e;g||"boolean"!==d.type(b)||(c=b,b="");if(s)try{U(s)&&
|
||||
(s.match(/,/)?(n=s.split(","),s=eval(n[0])):s=eval(s)),d.isFunction(s)&&(e=n.length?s(n[1]):g?s(b,w[b],f,u,h):s(B,f,u,h))}catch(t){S(r.errors.callbackError.replace(/EVENT/,d.trim((b||"")+" "+l)),!1),"string"===d.type(t)&&string.length&&S("Exception: "+t,!1)}c||!1===e||(g?(u=r[b],f=p[b],m.triggerHandler("layoutpane"+l,[b,m,f,u,h]),k&&m.triggerHandler("layoutpane"+k,[b,m,f,u,h])):(v.triggerHandler("layout"+l,[B,f,u,h]),k&&v.triggerHandler("layout"+k,[B,f,u,h])));g&&"onresize_end"===a&&Fa(b+"",!0);
|
||||
return e},Ga=function(a){if(!x.mozilla){var b=w[a];"IFRAME"===p[a].tagName?b.css(n.hidden).css(n.visible):b.find("IFRAME").css(n.hidden).css(n.visible)}},la=function(a){var b=w[a];a=n[a].dir;b={minWidth:1001-z(b,1E3),minHeight:1001-C(b,1E3)};"horz"===a&&(b.minSize=b.minHeight);"vert"===a&&(b.minSize=b.minWidth);return b},Va=function(a,b,c){var g=a;U(a)?g=w[a]:a.jquery||(g=d(a));a=C(g,b);g.css({height:a,visibility:"visible"});0<a&&0<g.innerWidth()?c&&g.data("autoHidden")&&(g.show().data("autoHidden",
|
||||
!1),x.mozilla||g.css(n.hidden).css(n.visible)):c&&!g.data("autoHidden")&&g.hide().data("autoHidden",!0)},V=function(a,b,c){c||(c=n[a].dir);U(b)&&b.match(/%/)&&(b="100%"===b?-1:parseInt(b,10)/100);if(0===b)return 0;if(1<=b)return parseInt(b,10);var g=r,f=0;"horz"==c?f=y.innerHeight-(w.north?g.north.spacing_open:0)-(w.south?g.south.spacing_open:0):"vert"==c&&(f=y.innerWidth-(w.west?g.west.spacing_open:0)-(w.east?g.east.spacing_open:0));if(-1===b)return f;if(0<b)return ka(f*b);if("center"==a)return 0;
|
||||
c="horz"===c?"height":"width";g=w[a];a="height"===c?M[a]:!1;var f=d.layout.showInvisibly(g),u=g.css(c),h=a?a.css(c):0;g.css(c,"auto");a&&a.css(c,"auto");b="height"===c?g.outerHeight():g.outerWidth();g.css(c,u).css(f);a&&a.css(c,h);return b},W=function(a,b){var c=w[a],g=r[a],f=p[a],d=b?g.spacing_open:0,g=b?g.spacing_closed:0;return!c||f.isHidden?0:f.isClosed||f.isSliding&&b?g:"horz"===n[a].dir?c.outerHeight()+d:c.outerWidth()+d},P=function(a,b){if(H()){var c=r[a],g=p[a],f=n[a],d=f.dir;f.sizeType.toLowerCase();
|
||||
var f=void 0!=b?b:g.isSliding,h=c.spacing_open,l=n.oppositeEdge[a],k=p[l],s=w[l],e=!s||!1===k.isVisible||k.isSliding?0:"horz"==d?s.outerHeight():s.outerWidth(),l=(!s||k.isHidden?0:r[l][!1!==k.isClosed?"spacing_closed":"spacing_open"])||0,k="horz"==d?y.innerHeight:y.innerWidth,s=la("center"),s="horz"==d?E(r.center.minHeight,s.minHeight):E(r.center.minWidth,s.minWidth),f=k-h-(f?0:V("center",s,d)+e+l),d=g.minSize=E(V(a,c.minSize),la(a).minSize),f=g.maxSize=ua(c.maxSize?V(a,c.maxSize):1E5,f),g=g.resizerPosition=
|
||||
{},h=y.inset.top,e=y.inset.left,l=y.innerWidth,k=y.innerHeight,c=c.spacing_open;switch(a){case "north":g.min=h+d;g.max=h+f;break;case "west":g.min=e+d;g.max=e+f;break;case "south":g.min=h+k-f-c;g.max=h+k-d-c;break;case "east":g.min=e+l-f-c,g.max=e+l-d-c}}},va=function(a,b){var c=d(a),g=c.data("layoutRole"),f=c.data("layoutEdge"),u=r[f][g+"Class"],f="-"+f,h=c.hasClass(u+"-closed")?"-closed":"-open",l="-closed"===h?"-open":"-closed",h=u+"-hover "+(u+f+"-hover ")+(u+h+"-hover ")+(u+f+h+"-hover ");b&&
|
||||
(h+=u+l+"-hover "+(u+f+l+"-hover "));"resizer"==g&&c.hasClass(u+"-sliding")&&(h+=u+"-sliding-hover "+(u+f+"-sliding-hover "));return d.trim(h)},wa=function(a,b){var c=d(b||this);a&&"toggler"===c.data("layoutRole")&&a.stopPropagation();c.addClass(va(c))},T=function(a,b){var c=d(b||this);c.removeClass(va(c,!0))},Ha=function(a){a=d(this).data("layoutEdge");var b=p[a];d(document);b.isResizing||p.paneResizing||r.maskPanesEarly&&ia(a,{resizing:!0})},Ia=function(a,b){var c=b||this,g=d(c).data("layoutEdge"),
|
||||
f=g+"ResizerLeave";d(document);J.clear(g+"_openSlider");J.clear(f);b?r.maskPanesEarly&&!p.paneResizing&&ma():J.set(f,function(){Ia(a,c)},200)},H=function(){return p.initialized||p.creatingLayout?!0:na()},na=function(a){var b=r;if(!v.is(":visible"))return!a&&x.webkit&&"BODY"===v[0].tagName&&setTimeout(function(){na(!0)},50),!1;if(!Ja("center").length)return S(b.errors.centerPaneMissing);p.creatingLayout=!0;d.extend(y,F(v,b.inset));Wa();b.scrollToBookmarkOnLoad&&(a=self.location,a.hash&&a.replace(a.hash));
|
||||
B.hasParentLayout?b.resizeWithWindow=!1:b.resizeWithWindow&&d(window).bind("resize."+I,Xa);delete p.creatingLayout;p.initialized=!0;ha(B,d.layout.onReady);D("onload_end");return!0},xa=function(a,b){var c=A.call(this,a),g=w[c];if(g){var f=M[c],u=p[c],h=r[c],l=r.stateManagement||{},h=b?h.children=b:h.children;if(d.isPlainObject(h))h=[h];else if(!h||!d.isArray(h))return;d.each(h,function(a,b){d.isPlainObject(b)&&(b.containerSelector?g.find(b.containerSelector):f||g).each(function(){var a=d(this),f=a.data("layout");
|
||||
if(!f){Ka({container:a,options:b},u);if(l.includeChildren&&p.stateData[c]){var f=(p.stateData[c].children||{})[b.instanceKey],g=b.stateManagement||(b.stateManagement={autoLoad:!0});!0===g.autoLoad&&f&&(g.autoSave=!1,g.includeChildren=!0,g.autoLoad=d.extend(!0,{},f))}(f=a.layout(b))&&oa(c,f)}})})}},Ka=function(a,b){var c=a.container,g=a.options,f=g.stateManagement,d=g.instanceKey||c.data("layoutInstanceKey");d||(d=(f&&f.cookie?f.cookie.name:"")||g.name);d=d?d.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,
|
||||
"_"):"layout"+ ++b.childIdx;g.instanceKey=d;c.data("layoutInstanceKey",d);return d},oa=function(a,b){var c=w[a],g=R[a],f=p[a];d.isPlainObject(g)&&(d.each(g,function(a,b){b.destroyed&&delete g[a]}),d.isEmptyObject(g)&&(g=R[a]=null));b||g||(b=c.data("layout"));b&&(b.hasParentLayout=!0,c=b.options,Ka(b,f),g||(g=R[a]={}),g[c.instanceKey]=b.container.data("layout"));B[a].children=R[a];b||xa(a)},Xa=function(){var a=r,b=Number(a.resizeWithWindowDelay);10>b&&(b=100);J.clear("winResize");J.set("winResize",
|
||||
function(){J.clear("winResize");J.clear("winResizeRepeater");var b=F(v,a.inset);b.innerWidth===y.innerWidth&&b.innerHeight===y.innerHeight||da()},b);J.data.winResizeRepeater||La()},La=function(){var a=Number(r.resizeWithWindowMaxDelay);0<a&&J.set("winResizeRepeater",function(){La();da()},a)},Ma=function(){D("onunload_start");ha(B,d.layout.onUnload);D("onunload_end")},Na=function(a){a=a?a.split(","):n.borderPanes;d.each(a,function(a,c){var g=r[c];if(g.enableCursorHotkey||g.customHotkey)return d(document).bind("keydown."+
|
||||
I,t),!1})},Ya=function(){function a(a){var b=r[a],c=r.panes;b.fxSettings||(b.fxSettings={});c.fxSettings||(c.fxSettings={});d.each(["_open","_close","_size"],function(f,g){var h="fxName"+g,u="fxSpeed"+g,l="fxSettings"+g,e=b[h]=b[h]||c[h]||b.fxName||c.fxName||"none",p=d.effects&&(d.effects[e]||d.effects.effect&&d.effects.effect[e]);"none"!==e&&r.effects[e]&&p||(e=b[h]="none");e=r.effects[e]||{};h=e.all||null;e=e[a]||null;b[u]=b[u]||c[u]||b.fxSpeed||c.fxSpeed||null;b[l]=d.extend(!0,{},h,e,c.fxSettings,
|
||||
b.fxSettings,c[l],b[l])});delete b.fxName;delete b.fxSpeed;delete b.fxSettings}var b,c,g,f,u,h;e=d.layout.transformData(e,!0);e=d.layout.backwardCompatibility.renameAllOptions(e);if(!d.isEmptyObject(e.panes)){b=d.layout.optionsMap.noDefault;f=0;for(u=b.length;f<u;f++)g=b[f],delete e.panes[g];b=d.layout.optionsMap.layout;f=0;for(u=b.length;f<u;f++)g=b[f],delete e.panes[g]}b=d.layout.optionsMap.layout;var l=d.layout.config.optionRootKeys;for(g in e)f=e[g],0>d.inArray(g,l)&&0>d.inArray(g,b)&&(e.panes[g]||
|
||||
(e.panes[g]=d.isPlainObject(f)?d.extend(!0,{},f):f),delete e[g]);d.extend(!0,r,e);d.each(n.allPanes,function(f,l){n[l]=d.extend(!0,{},n.panes,n[l]);c=r.panes;h=r[l];if("center"===l)for(b=d.layout.optionsMap.center,f=0,u=b.length;f<u;f++)g=b[f],e.center[g]||!e.panes[g]&&h[g]||(h[g]=c[g]);else h=r[l]=d.extend(!0,{},c,h),a(l),h.resizerClass||(h.resizerClass="ui-layout-resizer"),h.togglerClass||(h.togglerClass="ui-layout-toggler");h.paneClass||(h.paneClass="ui-layout-pane")});f=e.zIndex;l=r.zIndexes;
|
||||
0<f&&(l.pane_normal=f,l.content_mask=E(f+1,l.content_mask),l.resizer_normal=E(f+2,l.resizer_normal));delete r.panes},Ja=function(a){a=r[a].paneSelector;if("#"===a.substr(0,1))return v.find(a).eq(0);var b=v.children(a).eq(0);return b.length?b:v.children("form:first").children(a).eq(0)},Wa=function(a){A(a);d.each(n.allPanes,function(a,c){Oa(c,!0)});ya();d.each(n.borderPanes,function(a,c){w[c]&&p[c].isVisible&&(P(c),X(c))});Y("center");d.each(n.allPanes,function(a,c){Pa(c)})},Oa=function(a,b){if(b||
|
||||
H()){var c=r[a],g=p[a],f=n[a],d=f.dir,h="center"===a,l={},k=w[a],e,ba;k?za(a,!1,!0,!1):M[a]=!1;k=w[a]=Ja(a);if(k.length){k.data("layoutCSS")||k.data("layoutCSS",L(k,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));B[a]={name:a,pane:w[a],content:M[a],options:r[a],state:p[a],children:R[a]};k.data({parentLayout:B,layoutPane:B[a],layoutEdge:a,layoutRole:"pane"}).css(f.cssReq).css("zIndex",r.zIndexes.pane_normal).css(c.applyDemoStyles?f.cssDemo:
|
||||
{}).addClass(c.paneClass+" "+c.paneClass+"-"+a).bind("mouseenter."+I,wa).bind("mouseleave."+I,T);f={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",
|
||||
resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(ba in f)k.bind("layoutpane"+ba.toLowerCase()+"."+I,B[f[ba]||ba]);Aa(a,!1);h||(e=g.size=V(a,c.size),h=V(a,c.minSize)||1,ba=V(a,c.maxSize)||1E5,0<e&&(e=E(ua(e,ba),h)),g.autoResize=c.autoResize,g.isClosed=!1,g.isSliding=!1,g.isResizing=!1,g.isHidden=!1,g.pins||(g.pins=[]));g.tagName=k[0].tagName;g.edge=a;g.noRoom=!1;g.isVisible=!0;Qa(a);"horz"===d?l.height=C(k,e):"vert"===d&&(l.width=z(k,e));k.css(l);"horz"!=d&&Y(a,!0);p.initialized&&(ya(a),Na(a));
|
||||
c.initClosed&&c.closable&&!c.initHidden?Z(a,!0,!0):c.initHidden||c.initClosed?Ba(a):g.noRoom||k.css("display","block");k.css("visibility","visible");c.showOverflowOnHover&&k.hover(m,q);p.initialized&&Pa(a)}else w[a]=!1}},Pa=function(a){var b=w[a],c=p[a],g=r[a];b&&(b.data("layout")&&oa(a,b.data("layout")),c.isVisible&&(p.initialized?da():ea(a),g.triggerEventsOnLoad?D("onresize_end",a):Fa(a,!0)),g.initChildren&&g.children&&xa(a))},Qa=function(a){a=a?a.split(","):n.borderPanes;d.each(a,function(a,c){var g=
|
||||
w[c],f=G[c],d=p[c],h=n[c].side,l={};if(g){switch(c){case "north":l.top=y.inset.top;l.left=y.inset.left;l.right=y.inset.right;break;case "south":l.bottom=y.inset.bottom;l.left=y.inset.left;l.right=y.inset.right;break;case "west":l.left=y.inset.left;break;case "east":l.right=y.inset.right}g.css(l);f&&d.isClosed?f.css(h,y.inset[h]):f&&!d.isHidden&&f.css(h,y.inset[h]+W(c))}})},ya=function(a){a=a?a.split(","):n.borderPanes;d.each(a,function(a,c){var g=w[c];G[c]=!1;K[c]=!1;if(g){var g=r[c],f=p[c],u="#"===
|
||||
g.paneSelector.substr(0,1)?g.paneSelector.substr(1):"",h=g.resizerClass,l=g.togglerClass,k="-"+c,e=B[c],m=e.resizer=G[c]=d("<div></div>"),e=e.toggler=g.closable?K[c]=d("<div></div>"):!1;!f.isVisible&&g.slidable&&m.attr("title",g.tips.Slide).css("cursor",g.sliderCursor);m.attr("id",u?u+"-resizer":"").data({parentLayout:B,layoutPane:B[c],layoutEdge:c,layoutRole:"resizer"}).css(n.resizers.cssReq).css("zIndex",r.zIndexes.resizer_normal).css(g.applyDemoStyles?n.resizers.cssDemo:{}).addClass(h+" "+h+k).hover(wa,
|
||||
T).hover(Ha,Ia).mousedown(d.layout.disableTextSelection).mouseup(d.layout.enableTextSelection).appendTo(v);d.fn.disableSelection&&m.disableSelection();g.resizerDblClickToggle&&m.bind("dblclick."+I,ca);e&&(e.attr("id",u?u+"-toggler":"").data({parentLayout:B,layoutPane:B[c],layoutEdge:c,layoutRole:"toggler"}).css(n.togglers.cssReq).css(g.applyDemoStyles?n.togglers.cssDemo:{}).addClass(l+" "+l+k).hover(wa,T).bind("mouseenter",Ha).appendTo(m),g.togglerContent_open&&d("<span>"+g.togglerContent_open+"</span>").data({layoutEdge:c,
|
||||
layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",c).addClass("content content-open").css("display","none").appendTo(e),g.togglerContent_closed&&d("<span>"+g.togglerContent_closed+"</span>").data({layoutEdge:c,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(e),Ra(c));Za(c);f.isVisible?Ca(c):(pa(c),aa(c,!0))}});fa()},Aa=function(a,b){if(H()){var c=r[a],g=c.contentSelector,f=B[a],d=w[a],h;g&&(h=f.content=M[a]=c.findNestedContent?
|
||||
d.find(g).eq(0):d.children(g).eq(0));h&&h.length?(h.data("layoutRole","content"),h.data("layoutCSS")||h.data("layoutCSS",L(h,"height")),h.css(n.content.cssReq),c.applyDemoStyles&&(h.css(n.content.cssDemo),d.css(n.content.cssDemoPane)),d.css("overflowX").match(/(scroll|auto)/)&&d.css("overflow","hidden"),p[a].content={},!1!==b&&ea(a)):f.content=M[a]=!1}},Za=function(a){var b=d.layout.plugins.draggable;a=a?a.split(","):n.borderPanes;d.each(a,function(a,f){var u=r[f];if(!b||!w[f]||!u.resizable)return u.resizable=
|
||||
!1,!0;var h=p[f],e=r.zIndexes,k=n[f],s="horz"==k.dir?"top":"left",m=G[f],O=u.resizerClass,t=0,q,y,x=O+"-drag",z=O+"-"+f+"-drag",C=O+"-dragging",B=O+"-"+f+"-dragging",A=O+"-dragging-limit",E=O+"-"+f+"-dragging-limit",F=!1;h.isClosed||m.attr("title",u.tips.Resize).css("cursor",u.resizerCursor);m.draggable({containment:v[0],axis:"horz"==k.dir?"y":"x",delay:0,distance:1,grid:u.resizingGrid,helper:"clone",opacity:u.resizerDragOpacity,addClasses:!1,zIndex:e.resizer_drag,start:function(a,b){u=r[f];h=p[f];
|
||||
y=u.livePaneResizing;if(!1===D("ondrag_start",f))return!1;h.isResizing=!0;p.paneResizing=f;J.clear(f+"_closeSlider");P(f);q=h.resizerPosition;t=b.position[s];m.addClass(x+" "+z);F=!1;ia(f,{resizing:!0})},drag:function(a,b){F||(b.helper.addClass(C+" "+B).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),F=!0,h.isSliding&&w[f].css("zIndex",e.pane_sliding));var g=0;b.position[s]<q.min?(b.position[s]=q.min,g=-1):b.position[s]>q.max&&(b.position[s]=q.max,g=1);g?(b.helper.addClass(A+
|
||||
" "+E),window.defaultStatus=0<g&&f.match(/(north|west)/)||0>g&&f.match(/(south|east)/)?u.tips.maxSizeWarning:u.tips.minSizeWarning):(b.helper.removeClass(A+" "+E),window.defaultStatus="");y&&Math.abs(b.position[s]-t)>=u.liveResizingTolerance&&(t=b.position[s],c(a,b,f))},stop:function(a,b){d("body").enableSelection();window.defaultStatus="";m.removeClass(x+" "+z);h.isResizing=!1;p.paneResizing=!1;c(a,b,f,!0)}})});var c=function(a,b,c,d){var e=b.position,k=n[c];a=r[c];b=p[c];var s;switch(c){case "north":s=
|
||||
e.top;break;case "west":s=e.left;break;case "south":s=y.layoutHeight-e.top-a.spacing_open;break;case "east":s=y.layoutWidth-e.left-a.spacing_open}s-=y.inset[k.side];d?(!1!==D("ondrag_end",c)&&qa(c,s,!1,!0),ma(!0),b.isSliding&&ia(c,{resizing:!0})):Math.abs(s-b.size)<a.liveResizingTolerance||(qa(c,s,!1,!0),Q.each(Sa))}},Sa=function(){var a=d(this),b=a.data("layoutMask"),b=p[b];"IFRAME"==b.tagName&&b.isVisible&&a.css({top:b.offsetTop,left:b.offsetLeft,width:b.outerWidth,height:b.outerHeight})},ia=function(a,
|
||||
b){var c=n[a],g=["center"],f=r.zIndexes,u=d.extend({objectsOnly:!1,animation:!1,resizing:!0,sliding:p[a].isSliding},b),h,e;u.resizing&&g.push(a);u.sliding&&g.push(n.oppositeEdge[a]);"horz"===c.dir&&(g.push("west"),g.push("east"));d.each(g,function(a,b){e=p[b];h=r[b];e.isVisible&&(h.maskObjects||!u.objectsOnly&&h.maskContents)&&$a(b).each(function(){Sa.call(this);this.style.zIndex=e.isSliding?f.pane_sliding+1:f.pane_normal+1;this.style.display="block"})})},ma=function(a){if(a||!p.paneResizing)Q.hide();
|
||||
else if(!a&&!d.isEmptyObject(p.panesSliding)){a=Q.length-1;for(var b,c;0<=a;a--)c=Q.eq(a),b=c.data("layoutMask"),r[b].maskObjects||c.hide()}},$a=function(a){for(var b=d([]),c,g=0,f=Q.length;g<f;g++)c=Q.eq(g),c.data("layoutMask")===a&&(b=b.add(c));if(b.length)return b;b=w[a];c=p[a];var g=r[a],f=r.zIndexes,u,h,e,k,s;if(g.maskContents||g.maskObjects){for(s=0;s<(g.maskObjects?2:1);s++)u=g.maskObjects&&0==s,h=document.createElement(u?"iframe":"div"),e=d(h).data("layoutMask",a),h.className="ui-layout-mask ui-layout-mask-"+
|
||||
a,k=h.style,k.background="#FFF",k.position="absolute",k.display="block",u?(h.src="about:blank",h.frameborder=0,k.border=0,k.opacity=0,k.filter="Alpha(Opacity='0')"):(k.opacity=.001,k.filter="Alpha(Opacity='1')"),"IFRAME"==c.tagName?(k.zIndex=f.pane_normal+1,v.append(h)):(e.addClass("ui-layout-mask-inside-pane"),k.zIndex=g.maskZindex||f.content_mask,k.top=0,k.left=0,k.width="100%",k.height="100%",b.append(h)),Q=Q.add(h);a=Q}else a=d([]);return a},za=function(a,b,c,g){if(H()){a=A.call(this,a);var f=
|
||||
w[a],u=M[a],h=G[a],e=K[a];f&&d.isEmptyObject(f.data())&&(f=!1);u&&d.isEmptyObject(u.data())&&(u=!1);h&&d.isEmptyObject(h.data())&&(h=!1);e&&d.isEmptyObject(e.data())&&(e=!1);f&&f.stop(!0,!0);var k=r[a],s=R[a],p=d.isPlainObject(s)&&!d.isEmptyObject(s);g=void 0!==g?g:k.destroyChildren;p&&g&&(d.each(s,function(a,b){b.destroyed||b.destroy(!0);b.destroyed&&delete s[a]}),d.isEmptyObject(s)&&(s=R[a]=null,p=!1));f&&b&&!p?f.remove():f&&f[0]&&(b=k.paneClass,g=b+"-"+a,b=[b,b+"-open",b+"-closed",b+"-sliding",
|
||||
g,g+"-open",g+"-closed",g+"-sliding"],d.merge(b,va(f,!0)),f.removeClass(b.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+I),p&&u?(u.width(u.width()),d.each(s,function(a,b){b.resizeAll()})):u&&u.css(u.data("layoutCSS")).removeData("layoutCSS").removeData("layoutRole"),f.data("layout")||f.css(f.data("layoutCSS")).removeData("layoutCSS"));e&&e.remove();h&&h.remove();B[a]=w[a]=M[a]=G[a]=K[a]=!1;c||da()}},
|
||||
ra=function(a){var b=w[a],c=b[0].style;r[a].useOffscreenClose?(b.data(n.offscreenReset)||b.data(n.offscreenReset,{left:c.left,right:c.right}),b.css(n.offscreenCSS)):b.hide().removeData(n.offscreenReset)},Ta=function(a){var b=w[a];a=r[a];var c=n.offscreenCSS,g=b.data(n.offscreenReset),f=b[0].style;b.show().removeData(n.offscreenReset);a.useOffscreenClose&&g&&(f.left==c.left&&(f.left=g.left),f.right==c.right&&(f.right=g.right))},Ba=function(a,b){if(H()){var c=A.call(this,a),g=r[c],f=p[c],d=w[c],h=G[c];
|
||||
"center"===c||!d||f.isHidden||p.initialized&&!1===D("onhide_start",c)||(f.isSliding=!1,delete p.panesSliding[c],h&&h.hide(),!p.initialized||f.isClosed?(f.isClosed=!0,f.isHidden=!0,f.isVisible=!1,p.initialized||ra(c),Y("horz"===n[c].dir?"":"center"),(p.initialized||g.triggerEventsOnLoad)&&D("onhide_end",c)):(f.isHiding=!0,Z(c,!1,b)))}},sa=function(a,b,c,g){if(H()){a=A.call(this,a);var f=p[a],d=w[a];"center"!==a&&d&&f.isHidden&&!1!==D("onshow_start",a)&&(f.isShowing=!0,f.isSliding=!1,delete p.panesSliding[a],
|
||||
!1===b?Z(a,!0):ga(a,!1,c,g))}},ca=function(a,b){if(H()){var c=N(a),g=A.call(this,a),f=p[g];c&&c.stopImmediatePropagation();f.isHidden?sa(g):f.isClosed?ga(g,!!b):Z(g)}},ab=function(a,b){var c=p[a];ra(a);c.isClosed=!0;c.isVisible=!1;b&&pa(a)},Z=function(a,b,c,g){function f(){k.isMoving=!1;aa(d,!0);var a=n.oppositeEdge[d];p[a].noRoom&&(P(a),X(a));g||!p.initialized&&!e.triggerEventsOnLoad||(m||D("onclose_end",d),m&&D("onshow_end",d),O&&D("onhide_end",d))}var d=A.call(this,a);if("center"!==d)if(!p.initialized&&
|
||||
w[d])ab(d,!0);else if(H()){var h=w[d],e=r[d],k=p[d],s,m,O;v.queue(function(a){if(!h||!e.closable&&!k.isShowing&&!k.isHiding||!b&&k.isClosed&&!k.isShowing)return a();var g=!k.isShowing&&!1===D("onclose_start",d);m=k.isShowing;O=k.isHiding;delete k.isShowing;delete k.isHiding;if(g)return a();s=!c&&!k.isClosed&&"none"!=e.fxName_close;k.isMoving=!0;k.isClosed=!0;k.isVisible=!1;O?k.isHidden=!0:m&&(k.isHidden=!1);k.isSliding?ja(d,!1):Y("horz"===n[d].dir?"":"center",!1);pa(d);s?(ta(d,!0),h.hide(e.fxName_close,
|
||||
e.fxSettings_close,e.fxSpeed_close,function(){ta(d,!1);k.isClosed&&f();a()})):(ra(d),f(),a())})}},pa=function(a){if(G[a]){var b=G[a],c=K[a],g=r[a],f=p[a],e=n[a].side,h=g.resizerClass,l=g.togglerClass,k="-"+a;b.css(e,y.inset[e]).removeClass(h+"-open "+h+k+"-open").removeClass(h+"-sliding "+h+k+"-sliding").addClass(h+"-closed "+h+k+"-closed");f.isHidden&&b.hide();g.resizable&&d.layout.plugins.draggable&&b.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");
|
||||
c&&(c.removeClass(l+"-open "+l+k+"-open").addClass(l+"-closed "+l+k+"-closed").attr("title",g.tips.Open),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));Da(a,!1);p.initialized&&fa()}},ga=function(a,b,c,d){function f(){k.isMoving=!1;Ga(e);k.isSliding||Y("vert"==n[e].dir?"center":"",!1);Ca(e)}if(H()){var e=A.call(this,a),h=w[e],l=r[e],k=p[e],s,m;"center"!==e&&v.queue(function(a){if(!h||!l.resizable&&!l.closable&&!k.isShowing||k.isVisible&&!k.isSliding)return a();
|
||||
if(k.isHidden&&!k.isShowing)a(),sa(e,!0);else{k.autoResize&&k.size!=l.size?$(e,l.size,!0,!0,!0):P(e,b);var p=D("onopen_start",e);if("abort"===p)return a();"NC"!==p&&P(e,b);if(k.minSize>k.maxSize)return Da(e,!1),!d&&l.tips.noRoomToOpen&&alert(l.tips.noRoomToOpen),a();b?ja(e,!0):k.isSliding?ja(e,!1):l.slidable&&aa(e,!1);k.noRoom=!1;X(e);m=k.isShowing;delete k.isShowing;s=!c&&k.isClosed&&"none"!=l.fxName_open;k.isMoving=!0;k.isVisible=!0;k.isClosed=!1;m&&(k.isHidden=!1);s?(ta(e,!0),h.show(l.fxName_open,
|
||||
l.fxSettings_open,l.fxSpeed_open,function(){ta(e,!1);k.isVisible&&f();a()})):(Ta(e),f(),a())}})}},Ca=function(a,b){var c=w[a],g=G[a],f=K[a],e=r[a],h=p[a],l=n[a].side,k=e.resizerClass,s=e.togglerClass,m="-"+a;g.css(l,y.inset[l]+W(a)).removeClass(k+"-closed "+k+m+"-closed").addClass(k+"-open "+k+m+"-open");h.isSliding?g.addClass(k+"-sliding "+k+m+"-sliding"):g.removeClass(k+"-sliding "+k+m+"-sliding");T(0,g);e.resizable&&d.layout.plugins.draggable?g.draggable("enable").css("cursor",e.resizerCursor).attr("title",
|
||||
e.tips.Resize):h.isSliding||g.css("cursor","default");f&&(f.removeClass(s+"-closed "+s+m+"-closed").addClass(s+"-open "+s+m+"-open").attr("title",e.tips.Close),T(0,f),f.children(".content-closed").hide(),f.children(".content-open").css("display","block"));Da(a,!h.isSliding);d.extend(h,F(c));p.initialized&&(fa(),ea(a,!0));!b&&(p.initialized||e.triggerEventsOnLoad)&&c.is(":visible")&&(D("onopen_end",a),h.isShowing&&D("onshow_end",a),p.initialized&&D("onresize_end",a))},Ua=function(a){function b(){f.isClosed?
|
||||
f.isMoving||ga(d,!0):ja(d,!0)}if(H()){var c=N(a),d=A.call(this,a),f=p[d];a=r[d].slideDelay_open;"center"!==d&&(c&&c.stopImmediatePropagation(),f.isClosed&&c&&"mouseenter"===c.type&&0<a?J.set(d+"_openSlider",b,a):b())}},Ea=function(a){function b(){f.isClosed?ja(g,!1):f.isMoving||Z(g)}if(H()){var c=N(a),g=A.call(this,a);a=r[g];var f=p[g],e=f.isMoving?1E3:300;"center"===g||f.isClosed||f.isResizing||("click"===a.slideTrigger_close?b():a.preventQuickSlideClose&&f.isMoving||a.preventPrematureSlideClose&&
|
||||
c&&d.layout.isMouseOverElem(c,w[g])||(c?J.set(g+"_closeSlider",b,E(a.slideDelay_close,e)):b()))}},ta=function(a,b){var c=w[a],d=p[a],f=r[a],e=r.zIndexes;b?(ia(a,{animation:!0,objectsOnly:!0}),c.css({zIndex:e.pane_animate}),"south"==a?c.css({top:y.inset.top+y.innerHeight-c.outerHeight()}):"east"==a&&c.css({left:y.inset.left+y.innerWidth-c.outerWidth()})):(ma(),c.css({zIndex:d.isSliding?e.pane_sliding:e.pane_normal}),"south"==a?c.css({top:"auto"}):"east"!=a||c.css("left").match(/\-99999/)||c.css({left:"auto"}),
|
||||
x.msie&&f.fxOpacityFix&&"slide"!=f.fxName_open&&c.css("filter")&&1==c.css("opacity")&&c[0].style.removeAttribute("filter"))},aa=function(a,b){var c=r[a],d=G[a],f=c.slideTrigger_open.toLowerCase();if(d&&(!b||c.slidable)){f.match(/mouseover/)?f=c.slideTrigger_open="mouseenter":f.match(/(click|dblclick|mouseenter)/)||(f=c.slideTrigger_open="click");if(c.resizerDblClickToggle&&f.match(/click/))d[b?"unbind":"bind"]("dblclick."+I,ca);d[b?"bind":"unbind"](f+"."+I,Ua).css("cursor",b?c.sliderCursor:"default").attr("title",
|
||||
b?c.tips.Slide:"")}},ja=function(a,b){function c(b){J.clear(a+"_closeSlider");b.stopPropagation()}var d=r[a],f=p[a],e=r.zIndexes,h=d.slideTrigger_close.toLowerCase(),l=b?"bind":"unbind",k=w[a],s=G[a];J.clear(a+"_closeSlider");b?(f.isSliding=!0,p.panesSliding[a]=!0,aa(a,!1)):(f.isSliding=!1,delete p.panesSliding[a]);k.css("zIndex",b?e.pane_sliding:e.pane_normal);s.css("zIndex",b?e.pane_sliding+2:e.resizer_normal);h.match(/(click|mouseleave)/)||(h=d.slideTrigger_close="mouseleave");s[l](h,Ea);"mouseleave"===
|
||||
h&&(k[l]("mouseleave."+I,Ea),s[l]("mouseenter."+I,c),k[l]("mouseenter."+I,c));b?"click"!==h||d.resizable||(s.css("cursor",b?d.sliderCursor:"default"),s.attr("title",b?d.tips.Close:"")):J.clear(a+"_closeSlider")},X=function(a,b,c,g){b=r[a];var f=p[a],e=n[a],h=w[a],l=G[a],k="vert"===e.dir,s=!1;if("center"===a||k&&f.noVerticalRoom)(s=0<=f.maxHeight)&&f.noRoom?(Ta(a),l&&l.show(),f.isVisible=!0,f.noRoom=!1,k&&(f.noVerticalRoom=!1),Ga(a)):s||f.noRoom||(ra(a),l&&l.hide(),f.isVisible=!1,f.noRoom=!0);"center"!==
|
||||
a&&(f.minSize<=f.maxSize?(f.size>f.maxSize?$(a,f.maxSize,c,!0,g):f.size<f.minSize?$(a,f.minSize,c,!0,g):l&&f.isVisible&&h.is(":visible")&&(c=f.size+y.inset[e.side],d.layout.cssNum(l,e.side)!=c&&l.css(e.side,c)),f.noRoom&&(f.wasOpen&&b.closable?b.autoReopen?ga(a,!1,!0,!0):f.noRoom=!1:sa(a,f.wasOpen,!0,!0))):f.noRoom||(f.noRoom=!0,f.wasOpen=!f.isClosed&&!f.isSliding,f.isClosed||(b.closable?Z(a,!0,!0):Ba(a,!0))))},qa=function(a,b,c,d,f){if(H()){a=A.call(this,a);var e=r[a],h=p[a];f=f||e.livePaneResizing&&
|
||||
!h.isResizing;"center"!==a&&(h.autoResize=!1,$(a,b,c,d,f))}},$=function(a,b,c,g,f){function e(){for(var a="width"===q?s.outerWidth():s.outerHeight(),a=[{pane:h,count:1,target:b,actual:a,correct:b===a,attempt:b,cssSize:J}],g=a[0],l={},u="Inaccurate size after resizing the "+h+"-pane.";!g.correct;){l={pane:h,count:g.count+1,target:b};l.attempt=g.actual>b?E(0,g.attempt-(g.actual-b)):E(0,g.attempt+(b-g.actual));l.cssSize=("horz"==n[h].dir?C:z)(w[h],l.attempt);s.css(q,l.cssSize);l.actual="width"==q?s.outerWidth():
|
||||
s.outerHeight();l.correct=b===l.actual;1===a.length&&(S(u,!1,!0),S(g,!1,!0));S(l,!1,!0);if(3<a.length)break;a.push(l);g=a[a.length-1]}k.size=b;d.extend(k,F(s));k.isVisible&&s.is(":visible")&&(m&&m.css(t,b+y.inset[t]),ea(h));!c&&!x&&p.initialized&&k.isVisible&&D("onresize_end",h);c||(k.isSliding||Y("horz"==n[h].dir?"":"center",x,f),fa());g=n.oppositeEdge[h];b<I&&p[g].noRoom&&(P(g),X(g,!1,c));1<a.length&&S(u+"\nSee the Error Console for details.",!0,!0)}if(H()){var h=A.call(this,a),l=r[h],k=p[h],s=
|
||||
w[h],m=G[h],t=n[h].side,q=n[h].sizeType.toLowerCase(),x=k.isResizing&&!l.triggerEventsDuringLiveResize,B=!0!==g&&l.animatePaneSizing,I,J;"center"!==h&&v.queue(function(a){P(h);I=k.size;b=V(h,b);b=E(b,V(h,l.minSize));b=ua(b,k.maxSize);if(b<k.minSize)a(),X(h,!1,c);else{if(!f&&b===I)return a();k.newSize=b;!c&&p.initialized&&k.isVisible&&D("onresize_start",h);J=("horz"==n[h].dir?C:z)(w[h],b);if(B&&s.is(":visible")){var g=d.layout.effects.size[h]||d.layout.effects.size.all,g=l.fxSettings_size.easing||
|
||||
g.easing,m=r.zIndexes,t={};t[q]=J+"px";k.isMoving=!0;s.css({zIndex:m.pane_animate}).show().animate(t,l.fxSpeed_size,g,function(){s.css({zIndex:k.isSliding?m.pane_sliding:m.pane_normal});k.isMoving=!1;delete k.newSize;e();a()})}else s.css(q,J),delete k.newSize,s.is(":visible")?e():k.size=b,a()}})}},Y=function(a,b,c){a=(a?a:"east,west,center").split(",");d.each(a,function(a,f){if(w[f]){var e=r[f],h=p[f],l=w[f],k=!0,s={},m=d.layout.showInvisibly(l),n={top:W("north",!0),bottom:W("south",!0),left:W("west",
|
||||
!0),right:W("east",!0),width:0,height:0};n.width=y.innerWidth-n.left-n.right;n.height=y.innerHeight-n.bottom-n.top;n.top+=y.inset.top;n.bottom+=y.inset.bottom;n.left+=y.inset.left;n.right+=y.inset.right;d.extend(h,F(l));if("center"===f){if(!c&&h.isVisible&&n.width===h.outerWidth&&n.height===h.outerHeight)return l.css(m),!0;d.extend(h,la(f),{maxWidth:n.width,maxHeight:n.height});s=n;h.newWidth=s.width;h.newHeight=s.height;s.width=z(l,s.width);s.height=C(l,s.height);k=0<=s.width&&0<=s.height;if(!p.initialized&&
|
||||
e.minWidth>n.width){var e=e.minWidth-h.outerWidth,n=r.east.minSize||0,t=r.west.minSize||0,q=p.east.size,v=p.west.size,B=q,A=v;0<e&&p.east.isVisible&&q>n&&(B=E(q-n,q-e),e-=q-B);0<e&&p.west.isVisible&&v>t&&(A=E(v-t,v-e),e-=v-A);if(0===e){q&&q!=n&&$("east",B,!0,!0,c);v&&v!=t&&$("west",A,!0,!0,c);Y("center",b,c);l.css(m);return}}}else{h.isVisible&&!h.noVerticalRoom&&d.extend(h,F(l),la(f));if(!c&&!h.noVerticalRoom&&n.height===h.outerHeight)return l.css(m),!0;s.top=n.top;s.bottom=n.bottom;h.newSize=n.height;
|
||||
s.height=C(l,n.height);h.maxHeight=s.height;k=0<=h.maxHeight;k||(h.noVerticalRoom=!0)}k?(!b&&p.initialized&&D("onresize_start",f),l.css(s),"center"!==f&&fa(f),!h.noRoom||h.isClosed||h.isHidden||X(f),h.isVisible&&(d.extend(h,F(l)),p.initialized&&ea(f))):!h.noRoom&&h.isVisible&&X(f);l.css(m);delete h.newSize;delete h.newWidth;delete h.newHeight;if(!h.isVisible)return!0;"center"===f&&(h=x.isIE6||!x.boxModel,w.north&&(h||"IFRAME"==p.north.tagName)&&w.north.css("width",z(w.north,y.innerWidth)),w.south&&
|
||||
(h||"IFRAME"==p.south.tagName)&&w.south.css("width",z(w.south,y.innerWidth)));!b&&p.initialized&&D("onresize_end",f)}})},da=function(a){A(a);if(v.is(":visible"))if(p.initialized){if(!0===a&&d.isPlainObject(r.outset)&&v.css(r.outset),d.extend(y,F(v,r.inset)),y.outerHeight){!0===a&&Qa();if(!1===D("onresizeall_start"))return!1;var b,c,g;d.each(["south","north","east","west"],function(a,b){w[b]&&(c=r[b],g=p[b],g.autoResize&&g.size!=c.size?$(b,c.size,!0,!0,!0):(P(b),X(b,!1,!0,!0)))});Y("",!0,!0);fa();
|
||||
d.each(n.allPanes,function(a,c){(b=w[c])&&p[c].isVisible&&D("onresize_end",c)});D("onresizeall_end")}}else na()},Fa=function(a,b){var c=A.call(this,a);r[c].resizeChildren&&(b||oa(c),c=R[c],d.isPlainObject(c)&&d.each(c,function(a,b){b.destroyed||b.resizeAll()}))},ea=function(a,b){if(H()){var c=A.call(this,a),c=c?c.split(","):n.allPanes;d.each(c,function(a,c){function d(a){return E(m.css.paddingBottom,parseInt(a.css("marginBottom"),10)||0)}function e(){var a=r[c].contentIgnoreSelector,a=k.nextAll().not(".ui-layout-mask").not(a||
|
||||
":lt(0)"),b=a.filter(":visible"),g=b.filter(":last");q={top:k[0].offsetTop,height:k.outerHeight(),numFooters:a.length,hiddenFooters:a.length-b.length,spaceBelow:0};q.spaceAbove=q.top;q.bottom=q.top+q.height;q.spaceBelow=g.length?g[0].offsetTop+g.outerHeight()-q.bottom+d(g):d(k)}var l=w[c],k=M[c],n=r[c],m=p[c],q=m.content;if(!l||!k||!l.is(":visible"))return!0;if(!k.length&&(Aa(c,!1),!k))return;if(!1!==D("onsizecontent_start",c)){if(!m.isMoving&&!m.isResizing||n.liveContentResizing||b||void 0==q.top)e(),
|
||||
0<q.hiddenFooters&&"hidden"===l.css("overflow")&&(l.css("overflow","visible"),e(),l.css("overflow","hidden"));l=m.innerHeight-(q.spaceAbove-m.css.paddingTop)-(q.spaceBelow-m.css.paddingBottom);k.is(":visible")&&q.height==l||(Va(k,l,!0),q.height=l);p.initialized&&D("onsizecontent_end",c)}})}},fa=function(a){a=(a=A.call(this,a))?a.split(","):n.borderPanes;d.each(a,function(a,c){var g=r[c],f=p[c],e=w[c],h=G[c],l=K[c],k;if(e&&h){var m=n[c].dir,q=f.isClosed?"_closed":"_open",t=g["spacing"+q],v=g["togglerAlign"+
|
||||
q],q=g["togglerLength"+q],x;if(0===t)h.hide();else{f.noRoom||f.isHidden||h.show();"horz"===m?(x=y.innerWidth,f.resizerLength=x,e=d.layout.cssNum(e,"left"),h.css({width:z(h,x),height:C(h,t),left:-9999<e?e:y.inset.left})):(x=e.outerHeight(),f.resizerLength=x,h.css({height:C(h,x),width:z(h,t),top:y.inset.top+W("north",!0)}));T(g,h);if(l){if(0===q||f.isSliding&&g.hideTogglerOnSlide){l.hide();return}l.show();if(!(0<q)||"100%"===q||q>x)q=x,v=0;else if(U(v))switch(v){case "top":case "left":v=0;break;case "bottom":case "right":v=
|
||||
x-q;break;default:v=ka((x-q)/2)}else e=parseInt(v,10),v=0<=v?e:x-q+e;if("horz"===m){var B=z(l,q);l.css({width:B,height:C(l,t),left:v,top:0});l.children(".content").each(function(){k=d(this);k.css("marginLeft",ka((B-k.outerWidth())/2))})}else{var A=C(l,q);l.css({height:A,width:z(l,t),top:v,left:0});l.children(".content").each(function(){k=d(this);k.css("marginTop",ka((A-k.outerHeight())/2))})}T(0,l)}p.initialized||!g.initHidden&&!f.isHidden||(h.hide(),l&&l.hide())}}})},Ra=function(a){if(H()){var b=
|
||||
A.call(this,a);a=K[b];var c=r[b];a&&(c.closable=!0,a.bind("click."+I,function(a){a.stopPropagation();ca(b)}).css("visibility","visible").css("cursor","pointer").attr("title",p[b].isClosed?c.tips.Open:c.tips.Close).show())}},Da=function(a,b){d.layout.plugins.buttons&&d.each(p[a].pins,function(c,g){d.layout.buttons.setPinState(B,d(g),a,b)})},v=d(this).eq(0);if(!v.length)return S(r.errors.containerMissing);if(v.data("layoutContainer")&&v.data("layout"))return v.data("layout");var w={},M={},G={},K={},
|
||||
Q=d([]),y=p.container,I=p.id,B={options:r,state:p,container:v,panes:w,contents:M,resizers:G,togglers:K,hide:Ba,show:sa,toggle:ca,open:ga,close:Z,slideOpen:Ua,slideClose:Ea,slideToggle:function(a){a=A.call(this,a);ca(a,!0)},setSizeLimits:P,_sizePane:$,sizePane:qa,sizeContent:ea,swapPanes:function(a,b){function c(a){var b=w[a],c=M[a];return b?{pane:a,P:b?b[0]:!1,C:c?c[0]:!1,state:d.extend(!0,{},p[a]),options:d.extend(!0,{},r[a])}:!1}function g(a,b){if(a){var c=a.P,f=a.C,e=a.pane,g=n[b],h=d.extend(!0,
|
||||
{},p[b]),m=r[b],q={resizerCursor:m.resizerCursor};d.each(["fxName","fxSpeed","fxSettings"],function(a,b){q[b+"_open"]=m[b+"_open"];q[b+"_close"]=m[b+"_close"];q[b+"_size"]=m[b+"_size"]});w[b]=d(c).data({layoutPane:B[b],layoutEdge:b}).css(n.hidden).css(g.cssReq);M[b]=f?d(f):!1;r[b]=d.extend(!0,{},a.options,q);p[b]=d.extend(!0,{},a.state);c.className=c.className.replace(new RegExp(m.paneClass+"-"+e,"g"),m.paneClass+"-"+b);ya(b);g.dir!=n[e].dir?(c=l[b]||0,P(b),c=E(c,p[b].minSize),qa(b,c,!0,!0)):G[b].css(g.side,
|
||||
y.inset[g.side]+(p[b].isVisible?W(b):0));a.state.isVisible&&!h.isVisible?Ca(b,!0):(pa(b),aa(b,!0));a=null}}if(H()){var f=A.call(this,a);p[f].edge=b;p[b].edge=f;if(!1===D("onswap_start",f)||!1===D("onswap_start",b))p[f].edge=f,p[b].edge=b;else{var e=c(f),h=c(b),l={};l[f]=e?e.state.size:0;l[b]=h?h.state.size:0;w[f]=!1;w[b]=!1;p[f]={};p[b]={};K[f]&&K[f].remove();K[b]&&K[b].remove();G[f]&&G[f].remove();G[b]&&G[b].remove();G[f]=G[b]=K[f]=K[b]=!1;g(e,b);g(h,f);e=h=l=null;w[f]&&w[f].css(n.visible);w[b]&&
|
||||
w[b].css(n.visible);da();D("onswap_end",f);D("onswap_end",b)}}},showMasks:ia,hideMasks:ma,initContent:Aa,addPane:Oa,removePane:za,createChildren:xa,refreshChildren:oa,enableClosable:Ra,disableClosable:function(a,b){if(H()){var c=A.call(this,a),d=K[c];d&&(r[c].closable=!1,p[c].isClosed&&ga(c,!1,!0),d.unbind("."+I).css("visibility",b?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable:function(a){if(H()){a=A.call(this,a);var b=G[a];b&&b.data("draggable")&&(r[a].slidable=!0,
|
||||
p[a].isClosed&&aa(a,!0))}},disableSlidable:function(a){if(H()){a=A.call(this,a);var b=G[a];b&&(r[a].slidable=!1,p[a].isSliding?Z(a,!1,!0):(aa(a,!1),b.css("cursor","default").attr("title",""),T(null,b[0])))}},enableResizable:function(a){if(H()){a=A.call(this,a);var b=G[a],c=r[a];b&&b.data("draggable")&&(c.resizable=!0,b.draggable("enable"),p[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.tips.Resize))}},disableResizable:function(a){if(H()){a=A.call(this,a);var b=G[a];b&&b.data("draggable")&&
|
||||
(r[a].resizable=!1,b.draggable("disable").css("cursor","default").attr("title",""),T(null,b[0]))}},allowOverflow:m,resetOverflow:q,destroy:function(a,b){d(window).unbind("."+I);d(document).unbind("."+I);"object"===typeof a?A(a):b=a;v.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(r.containerClass).unbind("."+I);Q.remove();d.each(n.allPanes,function(a,c){za(c,!1,!0,b)});v.data("layoutCSS")&&!v.data("layoutRole")&&v.css(v.data("layoutCSS")).removeData("layoutCSS");"BODY"===
|
||||
y.tagName&&(v=d("html")).data("layoutCSS")&&v.css(v.data("layoutCSS")).removeData("layoutCSS");ha(B,d.layout.onDestroy);Ma();for(var c in B)c.match(/^(container|options)$/)||delete B[c];B.destroyed=!0;return B},initPanes:H,resizeAll:da,runCallbacks:D,hasParentLayout:!1,children:R,north:!1,south:!1,west:!1,east:!1,center:!1};return"cancel"===function(){Ya();var a=r,b=p;b.creatingLayout=!0;ha(B,d.layout.onCreate);if(!1===D("onload_start"))return"cancel";var c=v[0],e=d("html"),f=y.tagName=c.tagName,
|
||||
m=y.id=c.id,h=y.className=c.className,c=r,l=c.name,k={},n=v.data("parentLayout"),q=v.data("layoutEdge"),t=n&&q,w=d.layout.cssNum,z;y.selector=v.selector.split(".slice")[0];y.ref=(c.name?c.name+" layout / ":"")+f+(m?"#"+m:h?".["+h+"]":"");y.isBody="BODY"===f;t||y.isBody||(f=v.closest("."+d.layout.defaults.panes.paneClass),n=f.data("parentLayout"),q=f.data("layoutEdge"),t=n&&q);v.data({layout:B,layoutContainer:I}).addClass(c.containerClass);f={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};
|
||||
for(l in f)v.bind("layout"+l.toLowerCase()+"."+I,B[f[l]||l]);t&&(B.hasParentLayout=!0,n.refreshChildren(q,B));v.data("layoutCSS")||(y.isBody?(v.data("layoutCSS",d.extend(L(v,"position,margin,padding,border"),{height:v.css("height"),overflow:v.css("overflow"),overflowX:v.css("overflowX"),overflowY:v.css("overflowY")})),e.data("layoutCSS",d.extend(L(e,"padding"),{height:"auto",overflow:e.css("overflow"),overflowX:e.css("overflowX"),overflowY:e.css("overflowY")}))):v.data("layoutCSS",L(v,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY")));
|
||||
try{k={overflow:"hidden",overflowX:"hidden",overflowY:"hidden"};v.css(k);c.inset&&!d.isPlainObject(c.inset)&&(z=parseInt(c.inset,10)||0,c.inset={top:z,bottom:z,left:z,right:z});if(y.isBody)c.outset?d.isPlainObject(c.outset)||(z=parseInt(c.outset,10)||0,c.outset={top:z,bottom:z,left:z,right:z}):c.outset={top:w(e,"paddingTop"),bottom:w(e,"paddingBottom"),left:w(e,"paddingLeft"),right:w(e,"paddingRight")},e.css(k).css({height:"100%",border:"none",padding:0,margin:0}),x.isIE6?(v.css({width:"100%",height:"100%",
|
||||
border:"none",padding:0,margin:0,position:"relative"}),c.inset||(c.inset=F(v).inset)):(v.css({width:"auto",height:"auto",margin:0,position:"absolute"}),v.css(c.outset)),d.extend(y,F(v,c.inset));else{var A=v.css("position");A&&A.match(/(fixed|absolute|relative)/)||v.css("position","relative");v.is(":visible")&&(d.extend(y,F(v,c.inset)),1>y.innerHeight&&S(c.errors.noContainerHeight.replace(/CONTAINER/,y.ref)))}w(v,"minWidth")&&v.parent().css("overflowX","auto");w(v,"minHeight")&&v.parent().css("overflowY",
|
||||
"auto")}catch(C){}Na();d(window).bind("unload."+I,Ma);ha(B,d.layout.onLoad);a.initPanes&&na();delete b.creatingLayout;return p.initialized}()?null:B}})(jQuery);
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// jQuery Mask Plugin v1.11.4
|
||||
// github.com/igorescobar/jQuery-Mask-Plugin
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?module.exports=b(require("jquery")):b(jQuery||Zepto)})(function(b){var y=function(a,d,e){a=b(a);var g=this,k=a.val(),l;d="function"===typeof d?d(a.val(),void 0,a,e):d;var c={invalid:[],getCaret:function(){try{var q,v=0,b=a.get(0),f=document.selection,c=b.selectionStart;if(f&&-1===navigator.appVersion.indexOf("MSIE 10"))q=f.createRange(),q.moveStart("character",a.is("input")?-a.val().length:-a.text().length),
|
||||
v=q.text.length;else if(c||"0"===c)v=c;return v}catch(d){}},setCaret:function(q){try{if(a.is(":focus")){var b,c=a.get(0);c.setSelectionRange?c.setSelectionRange(q,q):c.createTextRange&&(b=c.createTextRange(),b.collapse(!0),b.moveEnd("character",q),b.moveStart("character",q),b.select())}}catch(f){}},events:function(){a.on("keyup.mask",c.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){a.keydown().keyup()},100)}).on("change.mask",function(){a.data("changed",!0)}).on("blur.mask",
|
||||
function(){k===a.val()||a.data("changed")||a.triggerHandler("change");a.data("changed",!1)}).on("keydown.mask, blur.mask",function(){k=a.val()}).on("focus.mask",function(a){!0===e.selectOnFocus&&b(a.target).select()}).on("focusout.mask",function(){e.clearIfNotMatch&&!l.test(c.val())&&c.val("")})},getRegexMask:function(){for(var a=[],b,c,f,e,h=0;h<d.length;h++)(b=g.translation[d.charAt(h)])?(c=b.pattern.toString().replace(/.{1}$|^.{1}/g,""),f=b.optional,(b=b.recursive)?(a.push(d.charAt(h)),e={digit:d.charAt(h),
|
||||
pattern:c}):a.push(f||b?c+"?":c)):a.push(d.charAt(h).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));a=a.join("");e&&(a=a.replace(RegExp("("+e.digit+"(.*"+e.digit+")?)"),"($1)?").replace(RegExp(e.digit,"g"),e.pattern));return RegExp(a)},destroyEvents:function(){a.off("keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(b){var c=a.is("input")?"val":"text";if(0<arguments.length){if(a[c]()!==b)a[c](b);c=a}else c=a[c]();return c},getMCharsBeforeCount:function(a,b){for(var c=0,
|
||||
f=0,e=d.length;f<e&&f<a;f++)g.translation[d.charAt(f)]||(a=b?a+1:a,c++);return c},caretPos:function(a,b,e,f){return g.translation[d.charAt(Math.min(a-1,d.length-1))]?Math.min(a+e-b-f,e):c.caretPos(a+1,b,e,f)},behaviour:function(a){a=a||window.event;c.invalid=[];var e=a.keyCode||a.which;if(-1===b.inArray(e,g.byPassKeys)){var d=c.getCaret(),f=c.val().length,n=d<f,h=c.getMasked(),k=h.length,m=c.getMCharsBeforeCount(k-1)-c.getMCharsBeforeCount(f-1);c.val(h);!n||65===e&&a.ctrlKey||(8!==e&&46!==e&&(d=c.caretPos(d,
|
||||
f,k,m)),c.setCaret(d));return c.callbacks(a)}},getMasked:function(a){var b=[],k=c.val(),f=0,n=d.length,h=0,l=k.length,m=1,p="push",t=-1,s,w;e.reverse?(p="unshift",m=-1,s=0,f=n-1,h=l-1,w=function(){return-1<f&&-1<h}):(s=n-1,w=function(){return f<n&&h<l});for(;w();){var x=d.charAt(f),u=k.charAt(h),r=g.translation[x];if(r)u.match(r.pattern)?(b[p](u),r.recursive&&(-1===t?t=f:f===s&&(f=t-m),s===t&&(f-=m)),f+=m):r.optional?(f+=m,h-=m):r.fallback?(b[p](r.fallback),f+=m,h-=m):c.invalid.push({p:h,v:u,e:r.pattern}),
|
||||
h+=m;else{if(!a)b[p](x);u===x&&(h+=m);f+=m}}a=d.charAt(s);n!==l+1||g.translation[a]||b.push(a);return b.join("")},callbacks:function(b){var g=c.val(),l=g!==k,f=[g,b,a,e],n=function(a,b,c){"function"===typeof e[a]&&b&&e[a].apply(this,c)};n("onChange",!0===l,f);n("onKeyPress",!0===l,f);n("onComplete",g.length===d.length,f);n("onInvalid",0<c.invalid.length,[g,b,a,c.invalid,e])}};g.mask=d;g.options=e;g.remove=function(){var b=c.getCaret();c.destroyEvents();c.val(g.getCleanVal());c.setCaret(b-c.getMCharsBeforeCount(b));
|
||||
return a};g.getCleanVal=function(){return c.getMasked(!0)};g.init=function(d){d=d||!1;e=e||{};g.byPassKeys=b.jMaskGlobals.byPassKeys;g.translation=b.jMaskGlobals.translation;g.translation=b.extend({},g.translation,e.translation);g=b.extend(!0,{},g,e);l=c.getRegexMask();!1===d?(e.placeholder&&a.attr("placeholder",e.placeholder),a.attr("autocomplete","off"),c.destroyEvents(),c.events(),d=c.getCaret(),c.val(c.getMasked()),c.setCaret(d+c.getMCharsBeforeCount(d,!0))):(c.events(),c.val(c.getMasked()))};
|
||||
g.init(!a.is("input"))};b.maskWatchers={};var A=function(){var a=b(this),d={},e=a.attr("data-mask");a.attr("data-mask-reverse")&&(d.reverse=!0);a.attr("data-mask-clearifnotmatch")&&(d.clearIfNotMatch=!0);"true"===a.attr("data-mask-selectonfocus")&&(d.selectOnFocus=!0);if(z(a,e,d))return a.data("mask",new y(this,e,d))},z=function(a,d,e){e=e||{};var g=b(a).data("mask"),k=JSON.stringify;a=b(a).val()||b(a).text();try{return"function"===typeof d&&(d=d(a)),"object"!==typeof g||k(g.options)!==k(e)||g.mask!==
|
||||
d}catch(l){}};b.fn.mask=function(a,d){d=d||{};var e=this.selector,g=b.jMaskGlobals,k=b.jMaskGlobals.watchInterval,l=function(){if(z(this,a,d))return b(this).data("mask",new y(this,a,d))};b(this).each(l);e&&(""!==e&&g.watchInputs)&&(clearInterval(b.maskWatchers[e]),b.maskWatchers[e]=setInterval(function(){b(document).find(e).each(l)},k));return this};b.fn.unmask=function(){clearInterval(b.maskWatchers[this.selector]);delete b.maskWatchers[this.selector];return this.each(function(){var a=b(this).data("mask");
|
||||
a&&a.remove().removeData("mask")})};b.fn.cleanVal=function(){return this.data("mask").getCleanVal()};b.applyDataMask=function(a){a=a||b.jMaskGlobals.maskElements;(a instanceof b?a:b(a)).filter(b.jMaskGlobals.dataMaskAttr).each(A)};var p={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},
|
||||
S:{pattern:/[a-zA-Z]/}}};b.jMaskGlobals=b.jMaskGlobals||{};p=b.jMaskGlobals=b.extend(!0,{},p,b.jMaskGlobals);p.dataMask&&b.applyDataMask();setInterval(function(){b.jMaskGlobals.watchDataMask&&b.applyDataMask()},p.watchInterval)});
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,720 @@
|
||||
/**
|
||||
* JQuery Searchable DropDown Plugin
|
||||
*
|
||||
* @required jQuery 1.3.x or above
|
||||
* @author Sascha Woo <xhaggi@users.sourceforge.net>
|
||||
* $Id: jquery.searchabledropdown.js 53 2012-11-22 08:48:14Z xhaggi $
|
||||
*
|
||||
* Copyright (c) 2012 xhaggi
|
||||
* https://sourceforge.net/projects/jsearchdropdown/
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
// register plugin
|
||||
var plugin = register("searchable");
|
||||
|
||||
// defaults
|
||||
plugin.defaults = {
|
||||
maxListSize: 100,
|
||||
maxMultiMatch: 50,
|
||||
exactMatch: false,
|
||||
wildcards: true,
|
||||
ignoreCase: true,
|
||||
warnMultiMatch: "top {0} matches ...",
|
||||
warnNoMatch: "no matches ...",
|
||||
latency: 200,
|
||||
zIndex: "auto"
|
||||
};
|
||||
|
||||
/**
|
||||
* Execute function
|
||||
* element-specific code here
|
||||
* @param {Options} settings Settings
|
||||
*/
|
||||
plugin.execute = function(settings, zindex) {
|
||||
|
||||
var timer = null;
|
||||
var searchCache = null;
|
||||
var search = null;
|
||||
|
||||
// do not attach on IE6 or lower
|
||||
if ($.browser.msie && parseInt(jQuery.browser.version) < 7)
|
||||
return this;
|
||||
|
||||
// only active select elements with drop down capability
|
||||
if (this.nodeName != "SELECT" || this.size > 1)
|
||||
return this;
|
||||
|
||||
var self = $(this);
|
||||
var storage = {index: -1, options: null}; // holds data for restoring
|
||||
var idxAttr = "lang";
|
||||
var enabled = false;
|
||||
|
||||
// detecting chrome
|
||||
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
|
||||
if($.browser.chrome) $.browser.safari = false;
|
||||
|
||||
// lets you override the options
|
||||
// inside the dom objects class property
|
||||
// requires the jQuery metadata plugin
|
||||
// <div class="hello {color: 'red'}">ddd</div>
|
||||
if ($.meta){
|
||||
settings = $.extend({}, options, self.data());
|
||||
}
|
||||
|
||||
// objects
|
||||
var wrapper = $("<div/>");
|
||||
var overlay = $("<div/>");
|
||||
var input = $("<input/>");
|
||||
var selector = $("<select/>");
|
||||
|
||||
// matching option items
|
||||
var topMatchItem = $("<option>"+settings.warnMultiMatch.replace(/\{0\}/g, settings.maxMultiMatch)+"</option>").attr("disabled", "true");
|
||||
var noMatchItem = $("<option>"+settings.warnNoMatch+"</option>").attr("disabled", "true");
|
||||
|
||||
|
||||
var selectorHelper = {
|
||||
/**
|
||||
* Return DOM options of selector element
|
||||
*/
|
||||
option: function(idx) {
|
||||
return $(selector.get(0).options[idx]);
|
||||
},
|
||||
/**
|
||||
* Returns the selected item of selector element
|
||||
*/
|
||||
selected: function() {
|
||||
return selector.find(":selected");
|
||||
},
|
||||
/**
|
||||
* Get or Set the selectedIndex of the selector element
|
||||
* @param {int} idx SelectedIndex
|
||||
*/
|
||||
selectedIndex: function(idx) {
|
||||
if(idx > -1)
|
||||
selector.get(0).selectedIndex = idx;
|
||||
return selector.get(0).selectedIndex;
|
||||
},
|
||||
/**
|
||||
* Resize selector depends on the parameter size
|
||||
* @param {Number} size Size
|
||||
*/
|
||||
size: function(size) {
|
||||
selector.attr("size", Math.max(2, Math.min(size, 20)));
|
||||
},
|
||||
/**
|
||||
* Reset the entries, which can be choose to it's inital state depends on selectedIndex and maxMultiMatch
|
||||
*/
|
||||
reset: function() {
|
||||
// return if selector has data and stored index equal selectedIndex of source select element
|
||||
if((self.get(0).selectedIndex-1) == self.data("index"))
|
||||
return;
|
||||
|
||||
// calc start and length of iteration
|
||||
var idx = self.get(0).selectedIndex;
|
||||
var len = self.get(0).length;
|
||||
var mc = Math.floor(settings.maxMultiMatch / 2);
|
||||
var begin = Math.max(1, (idx - mc));
|
||||
var end = Math.min(len, Math.max(settings.maxMultiMatch, (idx + mc)));
|
||||
var si = idx - begin;
|
||||
|
||||
// clear selector select element
|
||||
selector.empty();
|
||||
this.size(end-begin);
|
||||
|
||||
// append options
|
||||
for (var i=begin; i < end; i++)
|
||||
selector.append($(self.get(0).options[i]).clone().attr(idxAttr, i-1));
|
||||
|
||||
// append top match item if length exceeds
|
||||
if(end > settings.maxMultiMatch)
|
||||
selector.append(topMatchItem);
|
||||
|
||||
// set selectedIndex of selector
|
||||
selector.get(0).selectedIndex = si;
|
||||
}
|
||||
};
|
||||
|
||||
// draw it
|
||||
draw();
|
||||
|
||||
/*
|
||||
* EVENT HANDLING
|
||||
*/
|
||||
var suspendBlur = false;
|
||||
overlay.mouseover(function() {
|
||||
suspendBlur = true;
|
||||
});
|
||||
overlay.mouseout(function() {
|
||||
suspendBlur = false;
|
||||
});
|
||||
selector.mouseover(function() {
|
||||
suspendBlur = true;
|
||||
});
|
||||
selector.mouseout(function() {
|
||||
suspendBlur = false;
|
||||
});
|
||||
input.click(function(e) {
|
||||
if(!enabled)
|
||||
enable(e, true);
|
||||
else
|
||||
disable(e, true);
|
||||
});
|
||||
input.blur(function(e) {
|
||||
if(!suspendBlur && enabled)
|
||||
disable(e, true);
|
||||
});
|
||||
self.keydown(function(e) {
|
||||
if(e.keyCode != 9 && !e.shiftKey && !e.ctrlKey && !e.altKey)
|
||||
input.click();
|
||||
});
|
||||
self.click(function(e) {
|
||||
selector.focus();
|
||||
});
|
||||
selector.click(function(e) {
|
||||
if (selectorHelper.selectedIndex() < 0)
|
||||
return;
|
||||
disable(e);
|
||||
});
|
||||
selector.focus(function(e) {
|
||||
input.focus();
|
||||
});
|
||||
selector.blur(function(e) {
|
||||
if(!suspendBlur)
|
||||
disable(e, true);
|
||||
});
|
||||
selector.mousemove(function(e) {
|
||||
// Disabled on opera because of <select> elements always return scrollTop of 0
|
||||
// Affects up to Opera 10 beta 1, can be removed if bug is fixed
|
||||
// http://www.greywyvern.com/code/opera/bugs/selectScrollTop
|
||||
return true; //jun's
|
||||
if($.browser.opera && parseFloat(jQuery.browser.version) >= 9.8)
|
||||
return true;
|
||||
|
||||
// get font-size of option
|
||||
var fs = Math.floor(parseFloat(/([0-9\.]+)px/.exec(selectorHelper.option(0).css("font-size"))));
|
||||
// calc line height depends on browser
|
||||
var fsdiff = 4;
|
||||
if($.browser.opera)
|
||||
fsdiff = 2.5;
|
||||
if($.browser.safari || $.browser.chrome)
|
||||
fsdiff = 3;
|
||||
fs += Math.round(fs / fsdiff);
|
||||
// set selectedIndex depends on mouse position and line height
|
||||
selectorHelper.selectedIndex(Math.floor((e.pageY - selector.offset().top + this.scrollTop) / fs));
|
||||
});
|
||||
|
||||
// toggle click event on overlay div
|
||||
overlay.click(function(e) {
|
||||
input.click();
|
||||
});
|
||||
|
||||
// trigger event keyup
|
||||
input.keyup(function(e) {
|
||||
|
||||
// break searching while using navigation keys
|
||||
if(jQuery.inArray(e.keyCode, new Array(9, 13, 16, 33, 34, 35, 36, 38, 40)) > -1)
|
||||
return true;
|
||||
|
||||
// set search text
|
||||
search = $.trim(input.val().toLowerCase());
|
||||
|
||||
// if a previous timer is running, stop it
|
||||
clearSearchTimer();
|
||||
|
||||
// start new timer
|
||||
timer = setTimeout(searching, settings.latency);
|
||||
});
|
||||
|
||||
// trigger keydown event for keyboard usage
|
||||
input.keydown(function(e) {
|
||||
|
||||
// tab stop
|
||||
if(e.keyCode == 9) {
|
||||
disable(e);
|
||||
}
|
||||
|
||||
// return on shift, ctrl, alt key mode
|
||||
if(e.shiftKey || e.ctrlKey || e.altKey)
|
||||
return;
|
||||
|
||||
// which key is pressed
|
||||
switch(e.keyCode) {
|
||||
case 13: // enter
|
||||
disable(e);
|
||||
self.focus();
|
||||
break;
|
||||
case 27: // escape
|
||||
disable(e, true);
|
||||
self.focus();
|
||||
break;
|
||||
case 33: // pgup
|
||||
if (selectorHelper.selectedIndex() - selector.attr("size") > 0) {
|
||||
selectorHelper.selectedIndex(selectorHelper.selectedIndex() - selector.attr("size"));
|
||||
}
|
||||
else {
|
||||
selectorHelper.selectedIndex(0);
|
||||
}
|
||||
synchronize();
|
||||
break;
|
||||
case 34: // pgdown
|
||||
if (selectorHelper.selectedIndex() + selector.attr("size") < selector.get(0).options.length - 1) {
|
||||
selectorHelper.selectedIndex(selectorHelper.selectedIndex() + selector.attr("size"));
|
||||
}
|
||||
else {
|
||||
selectorHelper.selectedIndex(selector.get(0).options.length-1);
|
||||
}
|
||||
synchronize();
|
||||
break;
|
||||
case 38: // up
|
||||
if (selectorHelper.selectedIndex() > 0){
|
||||
selectorHelper.selectedIndex(selectorHelper.selectedIndex()-1);
|
||||
synchronize();
|
||||
}
|
||||
break;
|
||||
case 40: // down
|
||||
if (selectorHelper.selectedIndex() < selector.get(0).options.length - 1){
|
||||
selectorHelper.selectedIndex(selectorHelper.selectedIndex()+1);
|
||||
synchronize();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
// we handled the key.stop
|
||||
// doing anything with it!
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* Draw the needed elements
|
||||
*/
|
||||
function draw() {
|
||||
|
||||
// fix some styles
|
||||
self.css("text-decoration", "none");
|
||||
self.width(self.outerWidth());
|
||||
self.height(self.outerHeight());
|
||||
|
||||
// wrapper styles
|
||||
wrapper.css("position", "relative");
|
||||
wrapper.css("width", self.outerWidth());
|
||||
// relative div needs an z-index (related to IE z-index bug)
|
||||
if($.browser.msie)
|
||||
wrapper.css("z-index", zindex);
|
||||
|
||||
// overlay div to block events of source select element
|
||||
overlay.css({
|
||||
"position": "absolute",
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"width": self.outerWidth(),
|
||||
"height": self.outerHeight(),
|
||||
"background-color": "#FFFFFF",
|
||||
"opacity": "0.01"
|
||||
});
|
||||
|
||||
// overlay text field for searching capability
|
||||
input.attr("type", "text");
|
||||
input.hide();
|
||||
input.height(self.outerHeight());
|
||||
|
||||
// default styles for text field
|
||||
input.css({
|
||||
"position": "absolute",
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"margin": "0px",
|
||||
"padding": "0px",
|
||||
"outline-style": "none",
|
||||
"border-style": "solid",
|
||||
"border-bottom-style": "none",
|
||||
"border-color": "transparent",
|
||||
"background-color": "transparent"
|
||||
// "background-color": "red"
|
||||
});
|
||||
|
||||
// copy selected styles to text field
|
||||
var sty = new Array();
|
||||
sty.push("border-left-width");
|
||||
sty.push("border-top-width");
|
||||
//sty.push("font-family");
|
||||
sty.push("font-size");
|
||||
sty.push("font-stretch");
|
||||
sty.push("font-variant");
|
||||
sty.push("font-weight");
|
||||
sty.push("color");
|
||||
sty.push("text-align");
|
||||
sty.push("text-indent");
|
||||
sty.push("text-shadow");
|
||||
sty.push("text-transform");
|
||||
sty.push("padding-left");
|
||||
sty.push("padding-top");
|
||||
for(var i=0; i < sty.length;i++)
|
||||
input.css(sty[i], self.css(sty[i]));
|
||||
|
||||
// adjust search text field
|
||||
// IE7
|
||||
if($.browser.msie && parseInt(jQuery.browser.version) < 8) {
|
||||
input.css("padding", "0px");
|
||||
input.css("padding-left", "3px");
|
||||
input.css("border-left-width", "2px");
|
||||
input.css("border-top-width", "3px");
|
||||
}
|
||||
// chrome
|
||||
else if($.browser.chrome) {
|
||||
input.height(self.innerHeight());
|
||||
input.css("text-transform", "none");
|
||||
input.css("padding-left", parseFloatPx(input.css("padding-left"))+3);
|
||||
input.css("padding-top", 2);
|
||||
}
|
||||
// safari
|
||||
else if($.browser.safari) {
|
||||
input.height(self.innerHeight());
|
||||
input.css("padding-top", 2);
|
||||
input.css("padding-left", 3);
|
||||
input.css("text-transform", "none");
|
||||
}
|
||||
// opera
|
||||
else if($.browser.opera) {
|
||||
input.height(self.innerHeight());
|
||||
var pl = parseFloatPx(self.css("padding-left"));
|
||||
input.css("padding-left", pl == 1 ? pl+1 : pl);
|
||||
input.css("padding-top", 0);
|
||||
}
|
||||
else if($.browser.mozilla) {
|
||||
input.css("padding-top", "0px");
|
||||
input.css("border-top", "0px");
|
||||
input.css("padding-left", parseFloatPx(self.css("padding-left"))+3);
|
||||
}
|
||||
// all other browsers
|
||||
else {
|
||||
input.css("padding-left", parseFloatPx(self.css("padding-left"))+3);
|
||||
input.css("padding-top", parseFloatPx(self.css("padding-top"))+1);
|
||||
}
|
||||
|
||||
// adjust width of search field
|
||||
var offset = parseFloatPx(self.css("padding-left")) + parseFloatPx(self.css("padding-right")) +
|
||||
parseFloatPx(self.css("border-left-width")) + parseFloatPx(self.css("border-left-width")) + 23;
|
||||
input.width(self.outerWidth() - offset);
|
||||
|
||||
// store css width of source select object then set width
|
||||
// to auto to obtain the maximum width depends on the longest entry.
|
||||
// this is nessesary to set the width of the selector, because min-width
|
||||
// do not work in all browser.
|
||||
var w = self.css("width");
|
||||
var ow = self.outerWidth();
|
||||
self.css("width", "auto");
|
||||
ow = ow > self.outerWidth() ? ow : self.outerWidth();
|
||||
self.css("width", w);
|
||||
|
||||
// entries selector replacement
|
||||
selector.hide();
|
||||
selectorHelper.size(self.get(0).length);
|
||||
selector.css({
|
||||
"position": "absolute",
|
||||
"top": self.outerHeight(),
|
||||
"left": 0,
|
||||
"width": ow,
|
||||
"border": "1px solid #333",
|
||||
"font-weight": "normal",
|
||||
"padding": 0,
|
||||
"background-color": self.css("background-color"),
|
||||
"text-transform": self.css("text-transform")
|
||||
});
|
||||
|
||||
// z-index handling
|
||||
var zIndex = /^\d+$/.test(self.css("z-index")) ? self.css("z-index") : 1;
|
||||
// if z-index option is defined, use it instead of select element z-index
|
||||
if (settings.zIndex && /^\d+$/.test(settings.zIndex))
|
||||
zIndex = settings.zIndex;
|
||||
overlay.css("z-index", (zIndex).toString(10));
|
||||
input.css("z-index", (zIndex+1).toString(10));
|
||||
selector.css("z-index", (zIndex+2).toString(10));
|
||||
|
||||
// append to container
|
||||
self.wrap(wrapper);
|
||||
self.after(overlay);
|
||||
self.after(input);
|
||||
self.after(selector);
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable the search facilities
|
||||
*
|
||||
* @param {Object} e Event
|
||||
* @param {boolean} s Show selector
|
||||
* @param {boolean} v Verbose enabling
|
||||
*/
|
||||
function enable(e, s, v) {
|
||||
|
||||
// exit event on disabled select element
|
||||
if(self.attr("disabled"))
|
||||
return false;
|
||||
|
||||
// prepend empty option
|
||||
self.prepend("<option />");
|
||||
|
||||
// set state to enabled
|
||||
if(typeof v == "undefined")
|
||||
enabled = !enabled;
|
||||
|
||||
// reset selector
|
||||
selectorHelper.reset();
|
||||
|
||||
// synchronize select and dropdown replacement
|
||||
synchronize();
|
||||
|
||||
// store search result
|
||||
store();
|
||||
|
||||
// show selector
|
||||
if(s)
|
||||
selector.show();
|
||||
|
||||
// show search field
|
||||
input.show();
|
||||
input.focus();
|
||||
input.select();
|
||||
|
||||
// select empty option
|
||||
self.get(0).selectedIndex = 0;
|
||||
|
||||
if(typeof e != "undefined")
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
/**
|
||||
* Disable the search facilities
|
||||
*
|
||||
* @param {Object} e Event
|
||||
* @param {boolean} rs Restore last results
|
||||
*/
|
||||
function disable(e, rs) {
|
||||
|
||||
// set state to disabled
|
||||
enabled = false;
|
||||
|
||||
// remove empty option
|
||||
self.find(":first").remove();
|
||||
|
||||
// clear running search timer
|
||||
clearSearchTimer();
|
||||
|
||||
// hide search field and selector
|
||||
input.hide();
|
||||
selector.hide();
|
||||
|
||||
// restore last results
|
||||
if(typeof rs != "undefined")
|
||||
restore();
|
||||
|
||||
// populate changes
|
||||
populate();
|
||||
|
||||
if(typeof e != "undefined")
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears running search timer
|
||||
*/
|
||||
function clearSearchTimer() {
|
||||
// clear running timer
|
||||
if(timer != null)
|
||||
clearTimeout(timer);
|
||||
};
|
||||
|
||||
/**
|
||||
* Populate changes to select element
|
||||
*/
|
||||
function populate() {
|
||||
// invalid selectedIndex or disabled elements do not be populate
|
||||
if(selectorHelper.selectedIndex() < 0 || selectorHelper.selected().get(0).disabled)
|
||||
return;
|
||||
|
||||
// store selectedIndex
|
||||
self.get(0).selectedIndex = parseInt(selector.find(":selected").attr(idxAttr));
|
||||
|
||||
// trigger change event
|
||||
self.change();
|
||||
|
||||
// store selected index
|
||||
self.data("index", new Number(self.get(0).selectedIndex));
|
||||
};
|
||||
|
||||
/**
|
||||
* Synchronize selected item on dropdown replacement with source select element
|
||||
*/
|
||||
function synchronize() {
|
||||
if(selectorHelper.selectedIndex() > -1 && !selectorHelper.selected().get(0).disabled)
|
||||
input.val(selector.find(":selected").text());
|
||||
else
|
||||
input.val(self.find(":selected").text());
|
||||
};
|
||||
|
||||
/**
|
||||
* Stores last results of selector
|
||||
*/
|
||||
function store() {
|
||||
storage.index = selectorHelper.selectedIndex();
|
||||
storage.options = new Array();
|
||||
for(var i=0;i<selector.get(0).options.length;i++)
|
||||
storage.options.push(selector.get(0).options[i]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Restores last results of selector previously stored by store function
|
||||
*/
|
||||
function restore() {
|
||||
selector.empty();
|
||||
for(var i=0;i<storage.options.length;i++)
|
||||
selector.append(storage.options[i]);
|
||||
selectorHelper.selectedIndex(storage.index);
|
||||
selectorHelper.size(storage.options.length);
|
||||
};
|
||||
|
||||
/**
|
||||
* Escape regular expression string
|
||||
*
|
||||
* @param str String
|
||||
* @return escaped regexp string
|
||||
*/
|
||||
function escapeRegExp(str) {
|
||||
var specials = ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "^", "$"];
|
||||
var regexp = new RegExp("(\\" + specials.join("|\\") + ")", "g");
|
||||
return str.replace(regexp, "\\$1");
|
||||
};
|
||||
|
||||
/**
|
||||
* The actual searching gets done here
|
||||
*/
|
||||
function searching() {
|
||||
if (searchCache == search) { // no change ...
|
||||
timer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var matches = 0;
|
||||
searchCache = search;
|
||||
selector.hide();
|
||||
selector.empty();
|
||||
|
||||
// escape regexp characters
|
||||
var regexp = escapeRegExp(search);
|
||||
// exact match
|
||||
if(settings.exactMatch)
|
||||
regexp = "^" + regexp;
|
||||
// wildcard support
|
||||
if(settings.wildcards) {
|
||||
regexp = regexp.replace(/\\\*/g, ".*");
|
||||
regexp = regexp.replace(/\\\?/g, ".");
|
||||
}
|
||||
// ignore case sensitive
|
||||
var flags = null;
|
||||
if(settings.ignoreCase)
|
||||
flags = "i";
|
||||
|
||||
// RegExp object
|
||||
search = new RegExp(regexp, flags);
|
||||
|
||||
// for each item in list
|
||||
for(var i=1;i<self.get(0).length && matches < settings.maxMultiMatch;i++){
|
||||
// search
|
||||
if(search.length == 0 || search.test(self.get(0).options[i].text)){
|
||||
var opt = $(self.get(0).options[i]).clone().attr(idxAttr, i-1);
|
||||
if(self.data("index") == i)
|
||||
opt.text(self.data("text"));
|
||||
selector.append(opt);
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
||||
// result actions
|
||||
if(matches >= 1){
|
||||
selectorHelper.selectedIndex(0);
|
||||
}
|
||||
else if(matches == 0){
|
||||
selector.append(noMatchItem);
|
||||
}
|
||||
|
||||
// append top match item if matches exceeds maxMultiMatch
|
||||
if(matches >= settings.maxMultiMatch){
|
||||
selector.append(topMatchItem);
|
||||
}
|
||||
|
||||
// resize selector
|
||||
selectorHelper.size(matches);
|
||||
selector.show();
|
||||
timer = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse a given pixel size value to a float value
|
||||
* @param value Pixel size value
|
||||
*/
|
||||
function parseFloatPx(value) {
|
||||
try {
|
||||
value = parseFloat(value.replace(/[\s]*px/, ""));
|
||||
if(!isNaN(value))
|
||||
return value;
|
||||
}
|
||||
catch(e) {}
|
||||
return 0;
|
||||
};
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Register plugin under given namespace
|
||||
*
|
||||
* Plugin Pattern informations
|
||||
* The function creates the namespace under jQuery
|
||||
* and bind the function to execute the plugin code.
|
||||
* The plugin code goes to the plugin.execute function.
|
||||
* The defaults can setup under plugin.defaults.
|
||||
*
|
||||
* @param {String} nsp Namespace for the plugin
|
||||
* @return {Object} Plugin object
|
||||
*/
|
||||
function register(nsp) {
|
||||
|
||||
// init plugin namespace
|
||||
var plugin = $[nsp] = {};
|
||||
|
||||
// bind function to jQuery fn object
|
||||
$.fn[nsp] = function(settings) {
|
||||
// extend default settings
|
||||
settings = $.extend(plugin.defaults, settings);
|
||||
|
||||
var elmSize = this.size();
|
||||
return this.each(function(index) {
|
||||
plugin.execute.call(this, settings, elmSize-index);
|
||||
});
|
||||
};
|
||||
|
||||
return plugin;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,949 @@
|
||||
/**
|
||||
* (c) jSuites Javascript Web Components (v3.9.3)
|
||||
*
|
||||
* Website: https://jsuites.net
|
||||
* Description: Create amazing web based applications.
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
*/
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
global.jSuites = factory();
|
||||
}(this, (function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
jSuites.app = (function(el, options) {
|
||||
var obj = {};
|
||||
obj.options = {};
|
||||
|
||||
// Default configuration
|
||||
var defaults = {
|
||||
path: 'views',
|
||||
onbeforechangepage: null,
|
||||
onchangepage: null,
|
||||
onbeforecreatepage: null,
|
||||
oncreatepage: null,
|
||||
onloadpage: null,
|
||||
toolbar: null,
|
||||
detachHiddenPages: false
|
||||
}
|
||||
|
||||
// Loop through our object
|
||||
for (var property in defaults) {
|
||||
if (options && options.hasOwnProperty(property)) {
|
||||
obj.options[property] = options[property];
|
||||
} else {
|
||||
obj.options[property] = defaults[property];
|
||||
}
|
||||
}
|
||||
|
||||
// App
|
||||
el.classList.add('japp');
|
||||
|
||||
// Toolbar
|
||||
var toolbar = document.createElement('div');
|
||||
|
||||
obj.setToolbar = function(o) {
|
||||
if (o) {
|
||||
obj.options.toolbar = o;
|
||||
}
|
||||
obj.toolbar = jSuites.toolbar(toolbar, {
|
||||
app: obj,
|
||||
items: obj.options.toolbar,
|
||||
});
|
||||
el.appendChild(toolbar);
|
||||
}
|
||||
|
||||
obj.hideToolbar = function() {
|
||||
if (toolbar.style.display == '') {
|
||||
toolbar.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
obj.showToolbar = function() {
|
||||
if (toolbar.style.display == 'none') {
|
||||
toolbar.style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pages
|
||||
*/
|
||||
obj.pages = function() {
|
||||
/**
|
||||
* Create or access a page
|
||||
*/
|
||||
var component = function(route, o, callback) {
|
||||
var options = {};
|
||||
|
||||
if (o) {
|
||||
if (typeof(o) == 'object') {
|
||||
var options = o;
|
||||
} else {
|
||||
if (! callback && typeof(o) == 'function') {
|
||||
callback = o;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If exists just open
|
||||
if (component.container[route]) {
|
||||
component.show(component.container[route], options, callback);
|
||||
} else {
|
||||
// Create a new page
|
||||
if (! route) {
|
||||
console.error('JSUITES: Error, no route provided');
|
||||
} else {
|
||||
// Closed
|
||||
options.closed = options.closed ? 1 : 0;
|
||||
// Keep Route
|
||||
options.route = route;
|
||||
|
||||
// New page url
|
||||
if (! options.url) {
|
||||
options.url = obj.options.path + route + '.html';
|
||||
}
|
||||
|
||||
// Create new page
|
||||
component.create(options, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new page
|
||||
*/
|
||||
component.create = function(o, callback) {
|
||||
// Create page
|
||||
var page = document.createElement('div');
|
||||
page.classList.add('page');
|
||||
|
||||
// Container
|
||||
component.container[o.route] = page;
|
||||
|
||||
// Keep options
|
||||
page.options = o ? o : {};
|
||||
|
||||
// Always hidden when created
|
||||
page.style.display = 'none';
|
||||
|
||||
var updateDOM = function() {
|
||||
// Remove to avoid id conflicts
|
||||
if (component.current && obj.options.detachHiddenPages == true) {
|
||||
while (component.element.children[0]) {
|
||||
component.element.children[0].parentNode.removeChild(component.element.children[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (! component.current) {
|
||||
component.element.appendChild(page);
|
||||
} else {
|
||||
component.element.insertBefore(page, component.current.nextSibling);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.options.detachHiddenPages == false) {
|
||||
updateDOM();
|
||||
}
|
||||
|
||||
// Create page overwrite
|
||||
var ret = null;
|
||||
if (typeof(obj.options.onbeforecreatepage) == 'function') {
|
||||
var ret = obj.options.onbeforecreatepage(obj, page);
|
||||
if (ret === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
jSuites.ajax({
|
||||
url: o.url,
|
||||
method: 'GET',
|
||||
dataType: 'html',
|
||||
queue: true,
|
||||
success: function(result) {
|
||||
if (! page.parentNode) {
|
||||
// Update DOM
|
||||
updateDOM();
|
||||
}
|
||||
|
||||
// Create page overwrite
|
||||
var ret = null;
|
||||
if (typeof(obj.options.oncreatepage) == 'function') {
|
||||
ret = obj.options.oncreatepage(obj, page, result);
|
||||
}
|
||||
|
||||
// Push to refresh controls
|
||||
if (typeof(page.options.onpush) == 'function') {
|
||||
jSuites.refresh(page, page.options.onpush);
|
||||
}
|
||||
|
||||
// Ignore create page actions
|
||||
if (ret !== false) {
|
||||
// Open page
|
||||
page.innerHTML = result;
|
||||
// Get javascript
|
||||
try {
|
||||
parseScript(page);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Navbar
|
||||
if (page.querySelector('.navbar')) {
|
||||
page.classList.add('with-navbar');
|
||||
}
|
||||
|
||||
// Global onload callback
|
||||
if (typeof(obj.options.onloadpage) == 'function') {
|
||||
obj.options.onloadpage(page);
|
||||
}
|
||||
|
||||
// Specific online callback
|
||||
if (typeof(o.onload) == 'function') {
|
||||
o.onload(page);
|
||||
}
|
||||
|
||||
// Show page
|
||||
if (! page.options.closed) {
|
||||
component.show(page, o, callback);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
component.show = function(page, o, callback) {
|
||||
var pageIsReady = function() {
|
||||
if (component.current) {
|
||||
component.current.style.display = 'none';
|
||||
|
||||
if (component.current && obj.options.detachHiddenPages == true) {
|
||||
if (component.current.parentNode) {
|
||||
component.current.parentNode.removeChild(component.current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// New page
|
||||
if (typeof(obj.options.onchangepage) == 'function') {
|
||||
obj.options.onchangepage(obj, component.current, page, o);
|
||||
}
|
||||
|
||||
// Enter event
|
||||
if (typeof(page.options.onenter) == 'function') {
|
||||
page.options.onenter(obj, page, component.current);
|
||||
}
|
||||
|
||||
// Callback
|
||||
if (typeof(callback) == 'function') {
|
||||
callback(obj, page);
|
||||
}
|
||||
|
||||
// Current page
|
||||
component.current = page;
|
||||
}
|
||||
|
||||
// Append page in case was detached
|
||||
if (! page.parentNode) {
|
||||
component.element.appendChild(page);
|
||||
}
|
||||
|
||||
if (component.current) {
|
||||
if (component.current != page) {
|
||||
// Show page
|
||||
page.style.display = '';
|
||||
|
||||
var a = Array.prototype.indexOf.call(component.element.children, component.current);
|
||||
var b = Array.prototype.indexOf.call(component.element.children, page);
|
||||
|
||||
// Before leave the page
|
||||
if (typeof(obj.options.onbeforechangepage) == 'function') {
|
||||
var ret = obj.options.onbeforechangepage(obj, component.current, page, o);
|
||||
if (ret === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Leave event
|
||||
if (typeof(page.options.onleave) == 'function') {
|
||||
page.options.onleave(obj, component.current);
|
||||
}
|
||||
|
||||
// Animation only on mobile
|
||||
var rect = component.element.getBoundingClientRect();
|
||||
|
||||
// Move to the top
|
||||
window.scrollTo({ top: 0 });
|
||||
|
||||
// Page is ready
|
||||
if (rect.width < 800 && obj.options.detachHiddenPages == false) {
|
||||
jSuites.animation.slideLeft(component.element, (a < b ? 0 : 1), function() {
|
||||
if (component.current != page) {
|
||||
pageIsReady();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (component.current != page) {
|
||||
pageIsReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Show
|
||||
page.style.display = '';
|
||||
|
||||
// Page is ready
|
||||
pageIsReady();
|
||||
}
|
||||
|
||||
// Select toolbar item
|
||||
if (page.options.toolbarItem) {
|
||||
obj.toolbar.selectItem(page.options.toolbarItem);
|
||||
}
|
||||
|
||||
// Add history
|
||||
if (! o || ! o.ignoreHistory) {
|
||||
// Add history
|
||||
window.history.pushState({ route: page.options.route }, page.options.title, page.options.route);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a page by route
|
||||
*/
|
||||
component.get = function(route) {
|
||||
if (component.container[route]) {
|
||||
return component.container[route];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the page container
|
||||
*/
|
||||
component.reset = function() {
|
||||
// Container
|
||||
component.element.innerHTML = '';
|
||||
// Current
|
||||
component.current = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the page container
|
||||
*/
|
||||
component.destroy = function() {
|
||||
// Reset container
|
||||
component.reset();
|
||||
// Destroy references
|
||||
component.container = {};
|
||||
}
|
||||
/**
|
||||
* Page container controller
|
||||
*/
|
||||
component.container = {};
|
||||
|
||||
/**
|
||||
* Pages DOM container
|
||||
*/
|
||||
var pagesContainer = el.querySelector('.pages');
|
||||
if (pagesContainer) {
|
||||
component.element = pagesContainer;
|
||||
} else {
|
||||
component.element = document.createElement('div');
|
||||
component.element.className = 'pages';
|
||||
}
|
||||
|
||||
// Prefetched content
|
||||
if (el.innerHTML) {
|
||||
// Create with the prefetched content
|
||||
var page = document.createElement('div');
|
||||
page.classList.add('page');
|
||||
while (el.childNodes[0]) {
|
||||
page.appendChild(el.childNodes[0]);
|
||||
}
|
||||
if (el.innerHTML) {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = component.element.innerHTML;
|
||||
page.appendChild(div);
|
||||
}
|
||||
// Container
|
||||
var route = window.location.pathname;
|
||||
component.container[route] = page;
|
||||
|
||||
// Keep options
|
||||
page.options = {};
|
||||
page.options.route = route;
|
||||
|
||||
// Current page
|
||||
component.current = page;
|
||||
|
||||
// Place the page to the right container
|
||||
if (! component.current) {
|
||||
component.element.appendChild(page);
|
||||
} else {
|
||||
component.element.insertBefore(page, component.current.nextSibling);
|
||||
}
|
||||
}
|
||||
|
||||
// Append page container to the application
|
||||
el.appendChild(component.element);
|
||||
|
||||
return component;
|
||||
}();
|
||||
|
||||
/**
|
||||
* Panel methods
|
||||
*/
|
||||
obj.panel = function() {
|
||||
var panel = null;
|
||||
|
||||
var component = function(route, o) {
|
||||
if (! panel) {
|
||||
// Create element
|
||||
panel = document.createElement('div');
|
||||
panel.classList.add('panel');
|
||||
panel.classList.add('panel-left');
|
||||
panel.style.display = 'none';
|
||||
|
||||
// Bind to the app
|
||||
el.appendChild(panel);
|
||||
}
|
||||
|
||||
// Remote content
|
||||
if (route) {
|
||||
// URL
|
||||
if (! o) {
|
||||
o = {};
|
||||
}
|
||||
if (! o.url) {
|
||||
o.url = obj.options.path + route + '.html';
|
||||
}
|
||||
// Route
|
||||
o.route = route;
|
||||
// Panel
|
||||
panel.options = o;
|
||||
|
||||
// Request remote data
|
||||
jSuites.ajax({
|
||||
url: o.url,
|
||||
method: 'GET',
|
||||
dataType: 'html',
|
||||
success: function(result) {
|
||||
// Create page overwrite
|
||||
var ret = null;
|
||||
if (typeof(obj.options.oncreatepage) == 'function') {
|
||||
ret = obj.options.oncreatepage(obj, panel, result);
|
||||
}
|
||||
|
||||
// Ignore create page actions
|
||||
if (ret !== false) {
|
||||
// Open page
|
||||
panel.innerHTML = result;
|
||||
// Get javascript
|
||||
parseScript(page);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
component.show();
|
||||
}
|
||||
}
|
||||
|
||||
component.show = function() {
|
||||
// Show panel
|
||||
if (panel && panel.style.display == 'none') {
|
||||
panel.style.display = '';
|
||||
// Add animation
|
||||
if (panel.classList.contains('panel-left')) {
|
||||
jSuites.animation.slideLeft(panel, 1);
|
||||
} else {
|
||||
jSuites.animation.slideRight(panel, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component.hide = function() {
|
||||
if (panel && panel.style.display == '') {
|
||||
// Animation
|
||||
if (panel.classList.contains('panel-left')) {
|
||||
jSuites.animation.slideLeft(panel, 0, function() {
|
||||
panel.style.display = 'none';
|
||||
});
|
||||
} else {
|
||||
jSuites.animation.slideRight(panel, 0, function() {
|
||||
panel.animation.style.display = 'none';
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component.get = function() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
component.destroy = function() {
|
||||
el.removeChild(panel);
|
||||
panel = null;
|
||||
}
|
||||
|
||||
return component;
|
||||
}();
|
||||
|
||||
// Actionsheet
|
||||
obj.actionsheet = jSuites.actionsheet(el, obj);
|
||||
|
||||
/*
|
||||
* Parse javascript from an element
|
||||
*/
|
||||
var parseScript = function(element) {
|
||||
// Get javascript
|
||||
var script = element.getElementsByTagName('script');
|
||||
// Run possible inline scripts
|
||||
for (var i = 0; i < script.length; i++) {
|
||||
// Get type
|
||||
var type = script[i].getAttribute('type');
|
||||
if (! type || type == 'text/javascript' || type == 'text/loader') {
|
||||
eval(script[i].text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var controlSwipeLeft = function(e) {
|
||||
var element = jSuites.findElement(e.target, 'option');
|
||||
|
||||
if (element && element.querySelector('.option-actions')) {
|
||||
element.scrollTo({
|
||||
left: 100,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
} else {
|
||||
obj.panel.hide();
|
||||
}
|
||||
}
|
||||
|
||||
var controlSwipeRight = function(e) {
|
||||
var element = jSuites.findElement(e.target, 'option');
|
||||
if (element && element.querySelector('.option-actions')) {
|
||||
element.scrollTo({
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
} else {
|
||||
obj.panel.show();
|
||||
}
|
||||
}
|
||||
|
||||
var actionElement = null;
|
||||
|
||||
var actionDown = function(e) {
|
||||
// Grouped options
|
||||
if (e.target.classList.contains('option-title')) {
|
||||
if (e.target.classList.contains('selected')) {
|
||||
e.target.classList.remove('selected');
|
||||
} else {
|
||||
e.target.classList.add('selected');
|
||||
}
|
||||
}
|
||||
|
||||
// Grouped buttons
|
||||
if (e.target.parentNode.classList.contains('jbuttons-group')) {
|
||||
for (var j = 0; j < e.target.parentNode.children.length; j++) {
|
||||
e.target.parentNode.children[j].classList.remove('selected');
|
||||
}
|
||||
e.target.classList.add('selected');
|
||||
}
|
||||
|
||||
// App links
|
||||
actionElement = jSuites.findElement(e.target, function(e) {
|
||||
return e.tagName == 'A' && e.getAttribute('href') ? e : false;
|
||||
});
|
||||
|
||||
if (actionElement) {
|
||||
var link = actionElement.getAttribute('href');
|
||||
if (link == '#back') {
|
||||
window.history.back();
|
||||
} else if (link == '#panel') {
|
||||
obj.panel();
|
||||
} else {
|
||||
if (actionElement.classList.contains('link')) {
|
||||
actionElement = null;
|
||||
} else {
|
||||
obj.pages(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var actionUp = function(e) {
|
||||
obj.actionsheet.close();
|
||||
|
||||
if (actionElement) {
|
||||
e.preventDefault();
|
||||
actionElement = null;
|
||||
}
|
||||
}
|
||||
|
||||
el.addEventListener('swipeleft', controlSwipeLeft);
|
||||
el.addEventListener('swiperight', controlSwipeRight);
|
||||
|
||||
if ('ontouchstart' in document.documentElement === true) {
|
||||
document.addEventListener('touchstart', actionDown);
|
||||
document.addEventListener('touchend', actionUp);
|
||||
} else {
|
||||
document.addEventListener('mousedown', actionDown);
|
||||
document.addEventListener('click', function(e) {
|
||||
actionUp(e);
|
||||
});
|
||||
}
|
||||
|
||||
window.onpopstate = function(e) {
|
||||
if (e.state && e.state.route) {
|
||||
if (obj.pages.get(e.state.route)) {
|
||||
obj.pages(e.state.route, { ignoreHistory: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.options.toolbar) {
|
||||
obj.setToolbar();
|
||||
}
|
||||
|
||||
el.app = obj;
|
||||
|
||||
return obj;
|
||||
});
|
||||
|
||||
jSuites.actionsheet = (function(el, component) {
|
||||
var obj = function(options) {
|
||||
// Reset container
|
||||
actionContent.innerHTML = '';
|
||||
|
||||
// Create new elements
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
var actionGroup = document.createElement('div');
|
||||
actionGroup.className = 'jactionsheet-group';
|
||||
|
||||
for (var j = 0; j < options[i].length; j++) {
|
||||
var v = options[i][j];
|
||||
var actionItem = document.createElement('div');
|
||||
var actionInput = document.createElement('input');
|
||||
actionInput.type = 'button';
|
||||
actionInput.value = v.title;
|
||||
if (v.className) {
|
||||
actionInput.className = v.className;
|
||||
}
|
||||
if (v.onclick) {
|
||||
actionInput.event = v.onclick;
|
||||
actionInput.onclick = function() {
|
||||
this.event(component, this);
|
||||
}
|
||||
}
|
||||
if (v.action == 'cancel') {
|
||||
actionInput.style.color = 'red';
|
||||
}
|
||||
actionItem.appendChild(actionInput);
|
||||
actionGroup.appendChild(actionItem);
|
||||
}
|
||||
|
||||
actionContent.appendChild(actionGroup);
|
||||
}
|
||||
|
||||
// Show
|
||||
actionsheet.style.display = '';
|
||||
|
||||
// Animation
|
||||
jSuites.animation.slideBottom(actionContent, true);
|
||||
}
|
||||
|
||||
obj.close = function() {
|
||||
if (actionsheet.style.display != 'none') {
|
||||
// Remove any existing actionsheet
|
||||
jSuites.animation.slideBottom(actionContent, false, function() {
|
||||
actionsheet.style.display = 'none';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
obj.get = function() {
|
||||
return actionsheet;
|
||||
}
|
||||
|
||||
// Init action sheet
|
||||
var actionsheet = document.createElement('div');
|
||||
actionsheet.className = 'jactionsheet';
|
||||
actionsheet.style.display = 'none';
|
||||
|
||||
var actionContent = document.createElement('div');
|
||||
actionContent.className = 'jactionsheet-content';
|
||||
actionsheet.appendChild(actionContent);
|
||||
|
||||
// Append actionsheet container to the application
|
||||
el.appendChild(actionsheet);
|
||||
|
||||
el.actionsheet = obj;
|
||||
|
||||
return obj;
|
||||
});
|
||||
|
||||
jSuites.dialog = (function() {
|
||||
var obj = {};
|
||||
obj.options = {};
|
||||
|
||||
var dialog = null;
|
||||
var dialogTitle = null;
|
||||
var dialogHeader = null;
|
||||
var dialogMessage = null;
|
||||
var dialogFooter = null;
|
||||
var dialogContainer = null;
|
||||
var dialogConfirm = null;
|
||||
var dialogConfirmButton = null;
|
||||
var dialogCancel = null;
|
||||
var dialogCancelButton = null;
|
||||
|
||||
obj.open = function(options) {
|
||||
if (! jSuites.dialog.hasEvents) {
|
||||
obj.init();
|
||||
|
||||
jSuites.dialog.hasEvents = true;
|
||||
}
|
||||
obj.options = options;
|
||||
|
||||
if (obj.options.title) {
|
||||
dialogTitle.innerHTML = obj.options.title;
|
||||
}
|
||||
|
||||
if (obj.options.message) {
|
||||
dialogMessage.innerHTML = obj.options.message;
|
||||
}
|
||||
|
||||
if (! obj.options.confirmLabel) {
|
||||
obj.options.confirmLabel = 'OK';
|
||||
}
|
||||
dialogConfirmButton.value = obj.options.confirmLabel;
|
||||
|
||||
if (! obj.options.cancelLabel) {
|
||||
obj.options.cancelLabel = 'Cancel';
|
||||
}
|
||||
dialogCancelButton.value = obj.options.cancelLabel;
|
||||
|
||||
if (obj.options.type == 'confirm') {
|
||||
dialogCancelButton.parentNode.style.display = '';
|
||||
} else {
|
||||
dialogCancelButton.parentNode.style.display = 'none';
|
||||
}
|
||||
|
||||
// Append element to the app
|
||||
dialog.style.opacity = 100;
|
||||
|
||||
// Append to the page
|
||||
if (jSuites.el) {
|
||||
jSuites.el.appendChild(dialog);
|
||||
} else {
|
||||
document.body.appendChild(dialog);
|
||||
}
|
||||
|
||||
// Focus
|
||||
dialog.focus();
|
||||
|
||||
// Show
|
||||
setTimeout(function() {
|
||||
dialogContainer.style.opacity = 100;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
obj.close = function() {
|
||||
dialog.style.opacity = 0;
|
||||
dialogContainer.style.opacity = 0;
|
||||
setTimeout(function() {
|
||||
dialog.remove();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
obj.init = function() {
|
||||
dialog = document.createElement('div');
|
||||
dialog.setAttribute('tabindex', '901');
|
||||
dialog.className = 'jdialog';
|
||||
dialog.id = 'dialog';
|
||||
|
||||
dialogHeader = document.createElement('div');
|
||||
dialogHeader.className = 'jdialog-header';
|
||||
|
||||
dialogTitle = document.createElement('div');
|
||||
dialogTitle.className = 'jdialog-title';
|
||||
dialogHeader.appendChild(dialogTitle);
|
||||
|
||||
dialogMessage = document.createElement('div');
|
||||
dialogMessage.className = 'jdialog-message';
|
||||
dialogHeader.appendChild(dialogMessage);
|
||||
|
||||
dialogFooter = document.createElement('div');
|
||||
dialogFooter.className = 'jdialog-footer';
|
||||
|
||||
dialogContainer = document.createElement('div');
|
||||
dialogContainer.className = 'jdialog-container';
|
||||
dialogContainer.appendChild(dialogHeader);
|
||||
dialogContainer.appendChild(dialogFooter);
|
||||
|
||||
// Confirm
|
||||
dialogConfirm = document.createElement('div');
|
||||
dialogConfirmButton = document.createElement('input');
|
||||
dialogConfirmButton.value = obj.options.confirmLabel;
|
||||
dialogConfirmButton.type = 'button';
|
||||
dialogConfirmButton.onclick = function() {
|
||||
if (typeof(obj.options.onconfirm) == 'function') {
|
||||
obj.options.onconfirm();
|
||||
}
|
||||
obj.close();
|
||||
};
|
||||
dialogConfirm.appendChild(dialogConfirmButton);
|
||||
dialogFooter.appendChild(dialogConfirm);
|
||||
|
||||
// Cancel
|
||||
dialogCancel = document.createElement('div');
|
||||
dialogCancelButton = document.createElement('input');
|
||||
dialogCancelButton.value = obj.options.cancelLabel;
|
||||
dialogCancelButton.type = 'button';
|
||||
dialogCancelButton.onclick = function() {
|
||||
if (typeof(obj.options.oncancel) == 'function') {
|
||||
obj.options.oncancel();
|
||||
}
|
||||
obj.close();
|
||||
}
|
||||
dialogCancel.appendChild(dialogCancelButton);
|
||||
dialogFooter.appendChild(dialogCancel);
|
||||
|
||||
// Dialog
|
||||
dialog.appendChild(dialogContainer);
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.which == 13) {
|
||||
if (typeof(obj.options.onconfirm) == 'function') {
|
||||
jSuites.dialog.options.onconfirm();
|
||||
}
|
||||
obj.close();
|
||||
} else if (e.which == 27) {
|
||||
obj.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return obj;
|
||||
})();
|
||||
|
||||
jSuites.confirm = (function(message, onconfirm) {
|
||||
if (jSuites.getWindowWidth() < 800) {
|
||||
jSuites.dialog.open({
|
||||
type: 'confirm',
|
||||
message: message,
|
||||
title: 'Confirmation',
|
||||
onconfirm: onconfirm,
|
||||
});
|
||||
} else {
|
||||
if (confirm(message)) {
|
||||
onconfirm();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
jSuites.refresh = (function(el, options) {
|
||||
// Controls
|
||||
var touchPosition = null;
|
||||
var pushToRefresh = null;
|
||||
|
||||
// Page touch move
|
||||
var pageTouchMove = function(e, page) {
|
||||
if (typeof(page.options.onpush) == 'function') {
|
||||
if (page.scrollTop < 5) {
|
||||
if (! touchPosition) {
|
||||
touchPosition = {};
|
||||
touchPosition.x = e.touches[0].clientX;
|
||||
touchPosition.y = e.touches[0].clientY;
|
||||
}
|
||||
|
||||
var height = e.touches[0].clientY - touchPosition.y;
|
||||
if (height > 70) {
|
||||
if (! pushToRefresh.classList.contains('ready')) {
|
||||
pushToRefresh.classList.add('ready');
|
||||
}
|
||||
} else {
|
||||
if (pushToRefresh.classList.contains('ready')) {
|
||||
pushToRefresh.classList.remove('ready');
|
||||
}
|
||||
pushToRefresh.style.height = height + 'px';
|
||||
|
||||
if (height > 20) {
|
||||
if (! pushToRefresh.classList.contains('holding')) {
|
||||
pushToRefresh.classList.add('holding');
|
||||
page.insertBefore(pushToRefresh, page.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page touch end
|
||||
var pageTouchEnd = function(e, page) {
|
||||
if (typeof(page.options.onpush) == 'function') {
|
||||
// Remove holding
|
||||
pushToRefresh.classList.remove('holding');
|
||||
// Refresh or not refresh
|
||||
if (! pushToRefresh.classList.contains('ready')) {
|
||||
// Reset and not refresh
|
||||
pushToRefresh.style.height = '';
|
||||
obj.hide();
|
||||
} else {
|
||||
pushToRefresh.classList.remove('ready');
|
||||
// Loading indication
|
||||
setTimeout(function() {
|
||||
obj.hide();
|
||||
}, 1000);
|
||||
|
||||
// Refresh
|
||||
if (typeof(page.options.onpush) == 'function') {
|
||||
page.options.onpush(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var obj = function(element, callback) {
|
||||
if (! pushToRefresh) {
|
||||
pushToRefresh = document.createElement('div');
|
||||
pushToRefresh.className = 'jrefresh';
|
||||
}
|
||||
|
||||
element.addEventListener('touchmove', function(e) {
|
||||
pageTouchMove(e, element);
|
||||
});
|
||||
element.addEventListener('touchend', function(e) {
|
||||
pageTouchEnd(e, element);
|
||||
});
|
||||
if (! element.options) {
|
||||
element.options = {};
|
||||
}
|
||||
if (typeof(callback) == 'function') {
|
||||
element.options.onpush = callback;
|
||||
}
|
||||
}
|
||||
|
||||
obj.hide = function() {
|
||||
if (pushToRefresh.parentNode) {
|
||||
pushToRefresh.parentNode.removeChild(pushToRefresh);
|
||||
}
|
||||
touchPosition = null;
|
||||
}
|
||||
|
||||
return obj;
|
||||
})();
|
||||
|
||||
|
||||
|
||||
return jSuites;
|
||||
|
||||
})));
|
||||
@@ -0,0 +1,501 @@
|
||||
|
||||
/**
|
||||
* (c) jSuites Javascript Web Components (v3.9.0)
|
||||
*
|
||||
* Website: https://jsuites.net
|
||||
* Description: Create amazing web based applications.
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
*/
|
||||
|
||||
class JsuitesCalendar extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
// Create element
|
||||
this.input = document.createElement('input');
|
||||
// Append to the DOM
|
||||
o.appendChild(this.input);
|
||||
// Place holder
|
||||
var placeholder = o.getAttribute('placeholder');
|
||||
// Place holder
|
||||
var format = o.getAttribute('format');
|
||||
// Place holder
|
||||
var time = o.getAttribute('time');
|
||||
// Initial value
|
||||
var value = o.getAttribute('value');
|
||||
if (value) {
|
||||
this.input.value = value;
|
||||
o.value = value;
|
||||
}
|
||||
// Component
|
||||
jSuites.calendar(this.input, {
|
||||
value: value ? value : null,
|
||||
placeholder: placeholder ? placeholder : null,
|
||||
format: format ? format : 'YYYY-MM-DD',
|
||||
time: time ? true : false,
|
||||
onchange: function(el, val) {
|
||||
// Change value of the element
|
||||
el.setAttribute('value', val);
|
||||
o.setAttribute('value', val);
|
||||
o.value = val;
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onchange');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onchange");
|
||||
el.parentNode.dispatchEvent(e);
|
||||
},
|
||||
onclose: function(el) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onclose');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onclose");
|
||||
el.parentNode.dispatchEvent(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.input) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-calendar', JsuitesCalendar);
|
||||
|
||||
class JsuitesColor extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
// Create element
|
||||
this.input = document.createElement('input');
|
||||
// Append to the DOM
|
||||
o.appendChild(this.input);
|
||||
// Place holder
|
||||
var placeholder = o.getAttribute('placeholder');
|
||||
// Initial value
|
||||
var value = o.getAttribute('value');
|
||||
if (value) {
|
||||
o.value = value;
|
||||
}
|
||||
// Component
|
||||
jSuites.color(this.input, {
|
||||
value: value ? value : null,
|
||||
placeholder: placeholder ? placeholder : null,
|
||||
onchange: function(el, color) {
|
||||
// Change value of the element
|
||||
o.setAttribute('value', color);
|
||||
o.value = color;
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onchange');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onchange");
|
||||
el.parentNode.dispatchEvent(e);
|
||||
},
|
||||
onclose: function(el) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onclose');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onclose");
|
||||
el.parentNode.dispatchEvent(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.input) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-color', JsuitesColor);
|
||||
|
||||
class JsuitesContextmenu extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
this.el = jSuites.contextmenu(o, {
|
||||
items: null,
|
||||
onclick: function(a) {
|
||||
a.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.el) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-contextmenu', JsuitesContextmenu);
|
||||
|
||||
class JsuitesEditor extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
this.el = document.createElement('div');
|
||||
|
||||
// Options
|
||||
var options = {};
|
||||
// Initial values
|
||||
var toolbar = o.getAttribute('toolbar');
|
||||
if (toolbar) {
|
||||
options.toolbar = toolbar;
|
||||
}
|
||||
|
||||
// Events
|
||||
options.onload = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onload');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onload");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
options.onclick = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onclick');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onclick");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
options.onfocus = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onfocus');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onfocus");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
options.onblur = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onblur');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onblur");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
options.onclose = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onclose');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onclose");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
jSuites.editor(o, options);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.el) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-editor', JsuitesEditor);
|
||||
|
||||
class JsuitesModal extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
this.el = document.createElement('div');
|
||||
|
||||
// Options
|
||||
var options = {};
|
||||
// Initial values
|
||||
var title = o.getAttribute('title');
|
||||
if (title) {
|
||||
options.title = title;
|
||||
}
|
||||
var width = o.getAttribute('width');
|
||||
if (width) {
|
||||
options.width = parseInt(width) + 'px';
|
||||
}
|
||||
var height = o.getAttribute('height');
|
||||
if (height) {
|
||||
options.height = parseInt(height) + 'px';
|
||||
}
|
||||
var closed = o.getAttribute('closed');
|
||||
if (closed) {
|
||||
options.closed = closed;
|
||||
}
|
||||
|
||||
// Events
|
||||
options.onopen = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onopen');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onopen");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
options.onclose = function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onclose');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onclose");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
jSuites.modal(o, options);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.el) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-modal', JsuitesModal);
|
||||
|
||||
class JsuitesRating extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
// Initial values
|
||||
var value = o.getAttribute('value') ? o.getAttribute('value') : null;
|
||||
var number = o.getAttribute('number') ? o.getAttribute('number') : 5;
|
||||
var tooltip = o.getAttribute('tooltip') ? o.getAttribute('tooltip') : null;
|
||||
if (tooltip) {
|
||||
tooltip = tooltip.split(',');
|
||||
} else {
|
||||
tooltip = [ 'Very bad', 'Bad', 'Average', 'Good', 'Very good' ];
|
||||
}
|
||||
|
||||
jSuites.rating(o, {
|
||||
value: value,
|
||||
number: number,
|
||||
tooltip: tooltip,
|
||||
onchange: function(el, v) {
|
||||
// Change value of the element
|
||||
o.setAttribute('value', v);
|
||||
o.value = v;
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onchange');
|
||||
if (s) {
|
||||
eval(s);
|
||||
}
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onchange");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
});
|
||||
|
||||
// Initiated
|
||||
this.initiated = true;
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.initiated) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-rating', JsuitesRating);
|
||||
|
||||
class JsuitesTags extends HTMLElement {
|
||||
constructor() {
|
||||
// always call super() first
|
||||
super();
|
||||
}
|
||||
|
||||
init(o) {
|
||||
// Initial values
|
||||
var value = o.getAttribute('value') ? o.getAttribute('value') : null;
|
||||
var limit = o.getAttribute('limit') ? o.getAttribute('limit') : null;
|
||||
var search = o.getAttribute('search') ? o.getAttribute('search') : null;
|
||||
var placeholder = o.getAttribute('placeholder') ? o.getAttribute('placeholder') : null;
|
||||
|
||||
jSuites.tags(o, {
|
||||
value: value,
|
||||
limit: limit,
|
||||
search: search,
|
||||
placeholder: placeholder,
|
||||
onbeforechange: function(el, obj, v) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onbeforechange');
|
||||
if (s) {
|
||||
var newValue = eval(s);
|
||||
if (newValue != null) {
|
||||
return newValue;
|
||||
}
|
||||
} else {
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onbeforechange");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
},
|
||||
onchange: function(el, obj, v) {
|
||||
var newValue = obj.getValue();
|
||||
// Change value of the element
|
||||
o.setAttribute('value', newValue);
|
||||
o.value = newValue;
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onchange');
|
||||
if (s) {
|
||||
eval(s);
|
||||
} else {
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onchange");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
},
|
||||
onfocus: function(el, obj, v) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onfocus');
|
||||
if (s) {
|
||||
eval(s);
|
||||
} else {
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onfocus");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
},
|
||||
onblur: function(el, obj, v) {
|
||||
var newValue = obj.getValue();
|
||||
// Change value of the element
|
||||
o.setAttribute('value', newValue);
|
||||
o.value = newValue;
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onblur');
|
||||
if (s) {
|
||||
eval(s);
|
||||
} else {
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onblur");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
},
|
||||
onload: function(el, obj) {
|
||||
// Basic HTML event
|
||||
var s = o.getAttribute('onload');
|
||||
if (s) {
|
||||
eval(s);
|
||||
} else {
|
||||
// Trigger event
|
||||
var e = new CustomEvent("onload");
|
||||
el.dispatchEvent(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Initiated
|
||||
this.initiated = true;
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
if (! this.initiated) {
|
||||
this.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, oldVal, newVal) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('jsuites-tags', JsuitesTags);
|
||||
|
||||
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* StyleFix 1.0.3 & PrefixFree 1.0.7
|
||||
* @author Lea Verou
|
||||
* MIT license
|
||||
*/
|
||||
(function(){function k(a,b){return[].slice.call((b||document).querySelectorAll(a))}if(window.addEventListener){var e=window.StyleFix={link:function(a){try{if("stylesheet"!==a.rel||a.hasAttribute("data-noprefix"))return}catch(b){return}var c=a.href||a.getAttribute("data-href"),d=c.replace(/[^\/]+$/,""),h=(/^[a-z]{3,10}:/.exec(d)||[""])[0],l=(/^[a-z]{3,10}:\/\/[^\/]+/.exec(d)||[""])[0],g=/^([^?]*)\??/.exec(c)[1],m=a.parentNode,f=new XMLHttpRequest,n;f.onreadystatechange=function(){4===f.readyState&&
|
||||
n()};n=function(){var b=f.responseText;if(b&&a.parentNode&&(!f.status||400>f.status||600<f.status)){b=e.fix(b,!0,a);if(d)var b=b.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi,function(b,a,c){return/^([a-z]{3,10}:|#)/i.test(c)?b:/^\/\//.test(c)?'url("'+h+c+'")':/^\//.test(c)?'url("'+l+c+'")':/^\?/.test(c)?'url("'+g+c+'")':'url("'+d+c+'")'}),c=d.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"),b=b.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+c,"gi"),"$1");c=document.createElement("style");c.textContent=
|
||||
b;c.media=a.media;c.disabled=a.disabled;c.setAttribute("data-href",a.getAttribute("href"));m.insertBefore(c,a);m.removeChild(a);c.media=a.media}};try{f.open("GET",c),f.send(null)}catch(p){"undefined"!=typeof XDomainRequest&&(f=new XDomainRequest,f.onerror=f.onprogress=function(){},f.onload=n,f.open("GET",c),f.send(null))}a.setAttribute("data-inprogress","")},styleElement:function(a){if(!a.hasAttribute("data-noprefix")){var b=a.disabled;a.textContent=e.fix(a.textContent,!0,a);a.disabled=b}},styleAttribute:function(a){var b=
|
||||
a.getAttribute("style"),b=e.fix(b,!1,a);a.setAttribute("style",b)},process:function(){k('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);k("style").forEach(StyleFix.styleElement);k("[style]").forEach(StyleFix.styleAttribute)},register:function(a,b){(e.fixers=e.fixers||[]).splice(void 0===b?e.fixers.length:b,0,a)},fix:function(a,b,c){for(var d=0;d<e.fixers.length;d++)a=e.fixers[d](a,b,c)||a;return a},camelCase:function(a){return a.replace(/-([a-z])/g,function(b,a){return a.toUpperCase()}).replace("-",
|
||||
"")},deCamelCase:function(a){return a.replace(/[A-Z]/g,function(b){return"-"+b.toLowerCase()})}};(function(){setTimeout(function(){k('link[rel="stylesheet"]').forEach(StyleFix.link)},10);document.addEventListener("DOMContentLoaded",StyleFix.process,!1)})()}})();
|
||||
(function(k){function e(b,c,d,h,l){b=a[b];b.length&&(b=RegExp(c+"("+b.join("|")+")"+d,"gi"),l=l.replace(b,h));return l}if(window.StyleFix&&window.getComputedStyle){var a=window.PrefixFree={prefixCSS:function(b,c,d){var h=a.prefix;-1<a.functions.indexOf("linear-gradient")&&(b=b.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig,function(b,a,c,d){return a+(c||"")+"linear-gradient("+(90-d)+"deg"}));b=e("functions","(\\s|:|,)","\\s*\\(","$1"+h+"$2(",b);b=e("keywords","(\\s|:)","(\\s|;|\\}|$)",
|
||||
"$1"+h+"$2$3",b);b=e("properties","(^|\\{|\\s|;)","\\s*:","$1"+h+"$2:",b);if(a.properties.length){var l=RegExp("\\b("+a.properties.join("|")+")(?!:)","gi");b=e("valueProperties","\\b",":(.+?);",function(a){return a.replace(l,h+"$1")},b)}c&&(b=e("selectors","","\\b",a.prefixSelector,b),b=e("atrules","@","\\b","@"+h+"$1",b));b=b.replace(RegExp("-"+h,"g"),"-");return b=b.replace(/-\*-(?=[a-z]+)/gi,a.prefix)},property:function(b){return(0<=a.properties.indexOf(b)?a.prefix:"")+b},value:function(b,c){b=
|
||||
e("functions","(^|\\s|,)","\\s*\\(","$1"+a.prefix+"$2(",b);b=e("keywords","(^|\\s)","(\\s|$)","$1"+a.prefix+"$2$3",b);0<=a.valueProperties.indexOf(c)&&(b=e("properties","(^|\\s|,)","($|\\s|,)","$1"+a.prefix+"$2$3",b));return b},prefixSelector:function(b){return b.replace(/^:{1,2}/,function(b){return b+a.prefix})},prefixProperty:function(b,c){var d=a.prefix+b;return c?StyleFix.camelCase(d):d}};(function(){var b={},c=[],d=getComputedStyle(document.documentElement,null),h=document.createElement("div").style,
|
||||
l=function(a){if("-"===a.charAt(0)){c.push(a);a=a.split("-");var d=a[1];for(b[d]=++b[d]||1;3<a.length;)a.pop(),d=a.join("-"),StyleFix.camelCase(d)in h&&-1===c.indexOf(d)&&c.push(d)}};if(0<d.length)for(var g=0;g<d.length;g++)l(d[g]);else for(var e in d)l(StyleFix.deCamelCase(e));var g=0,f,k;for(k in b)d=b[k],g<d&&(f=k,g=d);a.prefix="-"+f+"-";a.Prefix=StyleFix.camelCase(a.prefix);a.properties=[];for(g=0;g<c.length;g++)e=c[g],0===e.indexOf(a.prefix)&&(f=e.slice(a.prefix.length),StyleFix.camelCase(f)in
|
||||
h||a.properties.push(f));!("Ms"!=a.Prefix||"transform"in h||"MsTransform"in h)&&"msTransform"in h&&a.properties.push("transform","transform-origin");a.properties.sort()})();(function(){function b(a,b){h[b]="";h[b]=a;return!!h[b]}var c={"linear-gradient":{property:"backgroundImage",params:"red, teal"},calc:{property:"width",params:"1px + 5%"},element:{property:"backgroundImage",params:"#foo"},"cross-fade":{property:"backgroundImage",params:"url(a.png), url(b.png), 50%"}};c["repeating-linear-gradient"]=
|
||||
c["repeating-radial-gradient"]=c["radial-gradient"]=c["linear-gradient"];var d={initial:"color","zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display",flex:"display","inline-flex":"display",grid:"display","inline-grid":"display","max-content":"width","min-content":"width","fit-content":"width","fill-available":"width"};a.functions=[];a.keywords=[];var h=document.createElement("div").style,e;for(e in c){var g=c[e],k=g.property,g=e+"("+g.params+")";!b(g,k)&&
|
||||
b(a.prefix+g,k)&&a.functions.push(e)}for(var f in d)k=d[f],!b(f,k)&&b(a.prefix+f,k)&&a.keywords.push(f)})();(function(){function b(a){e.textContent=a+"{}";return!!e.sheet.cssRules.length}var c={":read-only":null,":read-write":null,":any-link":null,"::selection":null},d={keyframes:"name",viewport:null,document:'regexp(".")'};a.selectors=[];a.atrules=[];var e=k.appendChild(document.createElement("style")),l;for(l in c){var g=l+(c[l]?"("+c[l]+")":"");!b(g)&&b(a.prefixSelector(g))&&a.selectors.push(l)}for(var m in d)g=
|
||||
m+" "+(d[m]||""),!b("@"+g)&&b("@"+a.prefix+g)&&a.atrules.push(m);k.removeChild(e)})();a.valueProperties=["transition","transition-property"];k.className+=" "+a.prefix;StyleFix.register(a.prefixCSS)}})(document.documentElement);
|
||||
Vendored
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,358 @@
|
||||
/**
|
||||
* vkBeautify - javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats.
|
||||
*
|
||||
* Version - 0.99.00.beta
|
||||
* Copyright (c) 2012 Vadim Kiryukhin
|
||||
* vkiryukhin @ gmail.com
|
||||
* http://www.eslinstructor.net/vkbeautify/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Pretty print
|
||||
*
|
||||
* vkbeautify.xml(text [,indent_pattern]);
|
||||
* vkbeautify.json(text [,indent_pattern]);
|
||||
* vkbeautify.css(text [,indent_pattern]);
|
||||
* vkbeautify.sql(text [,indent_pattern]);
|
||||
*
|
||||
* @text - String; text to beatufy;
|
||||
* @indent_pattern - Integer | String;
|
||||
* Integer: number of white spaces;
|
||||
* String: character string to visualize indentation ( can also be a set of white spaces )
|
||||
* Minify
|
||||
*
|
||||
* vkbeautify.xmlmin(text [,preserve_comments]);
|
||||
* vkbeautify.jsonmin(text);
|
||||
* vkbeautify.cssmin(text [,preserve_comments]);
|
||||
* vkbeautify.sqlmin(text);
|
||||
*
|
||||
* @text - String; text to minify;
|
||||
* @preserve_comments - Bool; [optional];
|
||||
* Set this flag to true to prevent removing comments from @text ( minxml and mincss functions only. )
|
||||
*
|
||||
* Examples:
|
||||
* vkbeautify.xml(text); // pretty print XML
|
||||
* vkbeautify.json(text, 4 ); // pretty print JSON
|
||||
* vkbeautify.css(text, '. . . .'); // pretty print CSS
|
||||
* vkbeautify.sql(text, '----'); // pretty print SQL
|
||||
*
|
||||
* vkbeautify.xmlmin(text, true);// minify XML, preserve comments
|
||||
* vkbeautify.jsonmin(text);// minify JSON
|
||||
* vkbeautify.cssmin(text);// minify CSS, remove comments ( default )
|
||||
* vkbeautify.sqlmin(text);// minify SQL
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
function createShiftArr(step) {
|
||||
|
||||
var space = ' ';
|
||||
|
||||
if ( isNaN(parseInt(step)) ) { // argument is string
|
||||
space = step;
|
||||
} else { // argument is integer
|
||||
switch(step) {
|
||||
case 1: space = ' '; break;
|
||||
case 2: space = ' '; break;
|
||||
case 3: space = ' '; break;
|
||||
case 4: space = ' '; break;
|
||||
case 5: space = ' '; break;
|
||||
case 6: space = ' '; break;
|
||||
case 7: space = ' '; break;
|
||||
case 8: space = ' '; break;
|
||||
case 9: space = ' '; break;
|
||||
case 10: space = ' '; break;
|
||||
case 11: space = ' '; break;
|
||||
case 12: space = ' '; break;
|
||||
}
|
||||
}
|
||||
|
||||
var shift = ['\n']; // array of shifts
|
||||
for(ix=0;ix<100;ix++){
|
||||
shift.push(shift[ix]+space);
|
||||
}
|
||||
return shift;
|
||||
}
|
||||
|
||||
function vkbeautify(){
|
||||
this.step = ' '; // 4 spaces
|
||||
this.shift = createShiftArr(this.step);
|
||||
};
|
||||
|
||||
vkbeautify.prototype.xml = function(text,step) {
|
||||
|
||||
var ar = text.replace(/>\s{0,}</g,"><")
|
||||
.replace(/</g,"~::~<")
|
||||
.replace(/\s*xmlns\:/g,"~::~xmlns:")
|
||||
.replace(/\s*xmlns\=/g,"~::~xmlns=")
|
||||
.split('~::~'),
|
||||
len = ar.length,
|
||||
inComment = false,
|
||||
deep = 0,
|
||||
str = '',
|
||||
ix = 0,
|
||||
shift = step ? createShiftArr(step) : this.shift;
|
||||
|
||||
for(ix=0;ix<len;ix++) {
|
||||
// start comment or <![CDATA[...]]> or <!DOCTYPE //
|
||||
if(ar[ix].search(/<!/) > -1) {
|
||||
str += shift[deep]+ar[ix];
|
||||
inComment = true;
|
||||
// end comment or <![CDATA[...]]> //
|
||||
if(ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1 || ar[ix].search(/!DOCTYPE/) > -1 ) {
|
||||
inComment = false;
|
||||
}
|
||||
} else
|
||||
// end comment or <![CDATA[...]]> //
|
||||
if(ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1) {
|
||||
str += ar[ix];
|
||||
inComment = false;
|
||||
} else
|
||||
// <elm></elm> //
|
||||
if( /^<\w/.exec(ar[ix-1]) && /^<\/\w/.exec(ar[ix]) &&
|
||||
/^<[\w:\-\.\,]+/.exec(ar[ix-1]) == /^<\/[\w:\-\.\,]+/.exec(ar[ix])[0].replace('/','')) {
|
||||
str += ar[ix];
|
||||
if(!inComment) deep--;
|
||||
} else
|
||||
// <elm> //
|
||||
if(ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) == -1 && ar[ix].search(/\/>/) == -1 ) {
|
||||
str = !inComment ? str += shift[deep++]+ar[ix] : str += ar[ix];
|
||||
} else
|
||||
// <elm>...</elm> //
|
||||
if(ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) > -1) {
|
||||
str = !inComment ? str += shift[deep]+ar[ix] : str += ar[ix];
|
||||
} else
|
||||
// </elm> //
|
||||
if(ar[ix].search(/<\//) > -1) {
|
||||
str = !inComment ? str += shift[--deep]+ar[ix] : str += ar[ix];
|
||||
} else
|
||||
// <elm/> //
|
||||
if(ar[ix].search(/\/>/) > -1 ) {
|
||||
str = !inComment ? str += shift[deep]+ar[ix] : str += ar[ix];
|
||||
} else
|
||||
// <? xml ... ?> //
|
||||
if(ar[ix].search(/<\?/) > -1) {
|
||||
str += shift[deep]+ar[ix];
|
||||
} else
|
||||
// xmlns //
|
||||
if( ar[ix].search(/xmlns\:/) > -1 || ar[ix].search(/xmlns\=/) > -1) {
|
||||
str += shift[deep]+ar[ix];
|
||||
}
|
||||
|
||||
else {
|
||||
str += ar[ix];
|
||||
}
|
||||
}
|
||||
|
||||
return (str[0] == '\n') ? str.slice(1) : str;
|
||||
}
|
||||
|
||||
vkbeautify.prototype.json = function(text,step) {
|
||||
|
||||
var step = step ? step : this.step;
|
||||
|
||||
if (typeof JSON === 'undefined' ) return text;
|
||||
|
||||
if ( typeof text === "string" ) return JSON.stringify(JSON.parse(text), null, step);
|
||||
if ( typeof text === "object" ) return JSON.stringify(text, null, step);
|
||||
|
||||
return text; // text is not string nor object
|
||||
}
|
||||
|
||||
vkbeautify.prototype.css = function(text, step) {
|
||||
|
||||
var ar = text.replace(/\s{1,}/g,' ')
|
||||
.replace(/\{/g,"{~::~")
|
||||
.replace(/\}/g,"~::~}~::~")
|
||||
.replace(/\;/g,";~::~")
|
||||
.replace(/\/\*/g,"~::~/*")
|
||||
.replace(/\*\//g,"*/~::~")
|
||||
.replace(/~::~\s{0,}~::~/g,"~::~")
|
||||
.split('~::~'),
|
||||
len = ar.length,
|
||||
deep = 0,
|
||||
str = '',
|
||||
ix = 0,
|
||||
shift = step ? createShiftArr(step) : this.shift;
|
||||
|
||||
for(ix=0;ix<len;ix++) {
|
||||
|
||||
if( /\{/.exec(ar[ix])) {
|
||||
str += shift[deep++]+ar[ix];
|
||||
} else
|
||||
if( /\}/.exec(ar[ix])) {
|
||||
str += shift[--deep]+ar[ix];
|
||||
} else
|
||||
if( /\*\\/.exec(ar[ix])) {
|
||||
str += shift[deep]+ar[ix];
|
||||
}
|
||||
else {
|
||||
str += shift[deep]+ar[ix];
|
||||
}
|
||||
}
|
||||
return str.replace(/^\n{1,}/,'');
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function isSubquery(str, parenthesisLevel) {
|
||||
return parenthesisLevel - (str.replace(/\(/g,'').length - str.replace(/\)/g,'').length )
|
||||
}
|
||||
|
||||
function split_sql(str, tab) {
|
||||
|
||||
return str.replace(/\s{1,}/g," ")
|
||||
|
||||
.replace(/ AND /ig,"~::~"+tab+tab+"AND ")
|
||||
.replace(/ BETWEEN /ig,"~::~"+tab+"BETWEEN ")
|
||||
.replace(/ CASE /ig,"~::~"+tab+"CASE ")
|
||||
.replace(/ ELSE /ig,"~::~"+tab+"ELSE ")
|
||||
.replace(/ END /ig,"~::~"+tab+"END ")
|
||||
.replace(/ FROM /ig,"~::~FROM ")
|
||||
.replace(/ GROUP\s{1,}BY/ig,"~::~GROUP BY ")
|
||||
.replace(/ HAVING /ig,"~::~HAVING ")
|
||||
//.replace(/ SET /ig," SET~::~")
|
||||
.replace(/ IN /ig," IN ")
|
||||
|
||||
.replace(/ JOIN /ig,"~::~JOIN ")
|
||||
.replace(/ CROSS~::~{1,}JOIN /ig,"~::~CROSS JOIN ")
|
||||
.replace(/ INNER~::~{1,}JOIN /ig,"~::~INNER JOIN ")
|
||||
.replace(/ LEFT~::~{1,}JOIN /ig,"~::~LEFT JOIN ")
|
||||
.replace(/ RIGHT~::~{1,}JOIN /ig,"~::~RIGHT JOIN ")
|
||||
|
||||
.replace(/ ON /ig,"~::~"+tab+"ON ")
|
||||
.replace(/ OR /ig,"~::~"+tab+tab+"OR ")
|
||||
.replace(/ ORDER\s{1,}BY/ig,"~::~ORDER BY ")
|
||||
.replace(/ OVER /ig,"~::~"+tab+"OVER ")
|
||||
|
||||
.replace(/\(\s{0,}SELECT /ig,"~::~(SELECT ")
|
||||
.replace(/\)\s{0,}SELECT /ig,")~::~SELECT ")
|
||||
|
||||
.replace(/ THEN /ig," THEN~::~"+tab+"")
|
||||
.replace(/ UNION /ig,"~::~UNION~::~")
|
||||
.replace(/ USING /ig,"~::~USING ")
|
||||
.replace(/ WHEN /ig,"~::~"+tab+"WHEN ")
|
||||
.replace(/ WHERE /ig,"~::~WHERE ")
|
||||
.replace(/ WITH /ig,"~::~WITH ")
|
||||
|
||||
//.replace(/\,\s{0,}\(/ig,",~::~( ")
|
||||
//.replace(/\,/ig,",~::~"+tab+tab+"")
|
||||
|
||||
.replace(/ ALL /ig," ALL ")
|
||||
.replace(/ AS /ig," AS ")
|
||||
.replace(/ ASC /ig," ASC ")
|
||||
.replace(/ DESC /ig," DESC ")
|
||||
.replace(/ DISTINCT /ig," DISTINCT ")
|
||||
.replace(/ EXISTS /ig," EXISTS ")
|
||||
.replace(/ NOT /ig," NOT ")
|
||||
.replace(/ NULL /ig," NULL ")
|
||||
.replace(/ LIKE /ig," LIKE ")
|
||||
.replace(/\s{0,}SELECT /ig,"SELECT ")
|
||||
.replace(/\s{0,}UPDATE /ig,"UPDATE ")
|
||||
.replace(/ SET /ig," SET ")
|
||||
|
||||
.replace(/~::~{1,}/g,"~::~")
|
||||
.split('~::~');
|
||||
}
|
||||
|
||||
vkbeautify.prototype.sql = function(text,step) {
|
||||
|
||||
var ar_by_quote = text.replace(/\s{1,}/g," ")
|
||||
.replace(/\'/ig,"~::~\'")
|
||||
.split('~::~'),
|
||||
len = ar_by_quote.length,
|
||||
ar = [],
|
||||
deep = 0,
|
||||
tab = this.step,//+this.step,
|
||||
inComment = true,
|
||||
inQuote = false,
|
||||
parenthesisLevel = 0,
|
||||
str = '',
|
||||
ix = 0,
|
||||
shift = step ? createShiftArr(step) : this.shift;;
|
||||
|
||||
for(ix=0;ix<len;ix++) {
|
||||
if(ix%2) {
|
||||
ar = ar.concat(ar_by_quote[ix]);
|
||||
} else {
|
||||
ar = ar.concat(split_sql(ar_by_quote[ix], tab) );
|
||||
}
|
||||
}
|
||||
|
||||
len = ar.length;
|
||||
for(ix=0;ix<len;ix++) {
|
||||
|
||||
parenthesisLevel = isSubquery(ar[ix], parenthesisLevel);
|
||||
|
||||
if( /\s{0,}\s{0,}SELECT\s{0,}/.exec(ar[ix])) {
|
||||
ar[ix] = ar[ix].replace(/\,/g,",\n"+tab+tab+"")
|
||||
}
|
||||
|
||||
if( /\s{0,}\s{0,}SET\s{0,}/.exec(ar[ix])) {
|
||||
ar[ix] = ar[ix].replace(/\,/g,",\n"+tab+tab+"")
|
||||
}
|
||||
|
||||
if( /\s{0,}\(\s{0,}SELECT\s{0,}/.exec(ar[ix])) {
|
||||
deep++;
|
||||
str += shift[deep]+ar[ix];
|
||||
} else
|
||||
if( /\'/.exec(ar[ix]) ) {
|
||||
if(parenthesisLevel<1 && deep) {
|
||||
deep--;
|
||||
}
|
||||
str += ar[ix];
|
||||
}
|
||||
else {
|
||||
str += shift[deep]+ar[ix];
|
||||
if(parenthesisLevel<1 && deep) {
|
||||
deep--;
|
||||
}
|
||||
}
|
||||
var junk = 0;
|
||||
}
|
||||
|
||||
str = str.replace(/^\n{1,}/,'').replace(/\n{1,}/g,"\n");
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
vkbeautify.prototype.xmlmin = function(text, preserveComments) {
|
||||
|
||||
var str = preserveComments ? text
|
||||
: text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"")
|
||||
.replace(/[ \r\n\t]{1,}xmlns/g, ' xmlns');
|
||||
return str.replace(/>\s{0,}</g,"><");
|
||||
}
|
||||
|
||||
vkbeautify.prototype.jsonmin = function(text) {
|
||||
|
||||
if (typeof JSON === 'undefined' ) return text;
|
||||
|
||||
return JSON.stringify(JSON.parse(text), null, 0);
|
||||
|
||||
}
|
||||
|
||||
vkbeautify.prototype.cssmin = function(text, preserveComments) {
|
||||
|
||||
var str = preserveComments ? text
|
||||
: text.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g,"") ;
|
||||
|
||||
return str.replace(/\s{1,}/g,' ')
|
||||
.replace(/\{\s{1,}/g,"{")
|
||||
.replace(/\}\s{1,}/g,"}")
|
||||
.replace(/\;\s{1,}/g,";")
|
||||
.replace(/\/\*\s{1,}/g,"/*")
|
||||
.replace(/\*\/\s{1,}/g,"*/");
|
||||
}
|
||||
|
||||
vkbeautify.prototype.sqlmin = function(text) {
|
||||
return text.replace(/\s{1,}/g," ").replace(/\s{1,}\(/,"(").replace(/\s{1,}\)/,")");
|
||||
}
|
||||
|
||||
window.vkbeautify = new vkbeautify();
|
||||
|
||||
})();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user