';
return this.each(function() {
if ( $('> iframe.bgiframe', this).length == 0 )
this.insertBefore( document.createElement('html'), this.firstChild );
//this.insertBefore( document.createElement(html), this.firstChild );
});
}
return this;
};
$.fn.selectRange = function(start, end) {
return this.each(function() {
if(this.setSelectionRange) {
this.focus();
this.setSelectionRange(start, end);
} else if(this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
});
};
$.fn.multiline = function(text){
this.text(text);
this.html(this.html().replace(/\n/g,'
'));
return this;
}
$('.datepicker').each(function () {
var datepicker = $.UIkit.datepicker(this);
$(this).focus(function () {
datepicker.pick();
});
$(this).focusout(function () {
setTimeout(function() {datepicker.hide();}, 100);
});
});
$.fn.getCursorPosition = function() {
var input = this.get(0);
if (!input) return; // No (input) element found
if ('selectionStart' in input) {
// Standard-compliant browsers
return input.selectionStart;
} else if (document.selection) {
// IE
input.focus();
var sel = document.selection.createRange();
var selLen = document.selection.createRange().text.length;
sel.moveStart('character', -input.value.length);
return sel.text.length - selLen;
}
};
// 스크롤 유무 판단
$.fn.hasScrollBar = function() {
return this.get(0).scrollHeight > this.height();
}
})(jQuery);
function create_table(id, col_width, thead_data, tbody_data, width, height)
{
var table_txt = '', i=0,j=0;
var table_id = id+'-table';
table_txt += "
\n";
for(i=0; i\n";
}
table_txt += "\n";
table_txt += "\n";
for(i=0; i" + thead_data[i] + "\n";
}
table_txt += "
\n";
table_txt += "\n";
table_txt += "\n";
for(i=0; i\n";
for(j=0; j" + tbody_data[i][j] + "\n";
}
table_txt += "\n";
}
table_txt += "\n";
table_txt += "
\n";
$("#"+id).append(table_txt);
/////////////////////////////// Scroll Width Relocate /////////////////////////////////////
var diff_width = width - $("#"+table_id+">thead>tr").width();
if(diff_width>0)
$("#"+table_id+">thead>tr>th:last").width($("#"+table_id+">thead>tr>th:last").width()+diff_width);
if((!$("#"+table_id+">tbody").hasScrollBar()) || isMobile)
$("#"+table_id+">tbody").width(width);
$("#"+table_id+">thead>tr>th").each(function (index){
$("#"+table_id+">tbody>tr>td:eq("+index+")").width($(this).width());
});
//////////////////////////////// Table head Class Add ///////////////////////////////////////
$('#' + table_id + '>thead>tr>th:first').addClass('table-title-left');
$('#' + table_id + '>thead>tr>th:last').addClass('table-title-right');
/////////////////////////////////////// Table thead Class Add End ///////////////////////////////////////
//$('#' + id + ' tbody').addClass('table-tbody-scroll');
/////////////////////////////////////// Table tbody Class Basic Function Add ///////////////////////////////////////
$('#' + table_id + '>tbody>tr:odd').css("backgroundColor","#C7D3ED");
$('#' + table_id + '>tbody>tr:even').css("backgroundColor","#FFFFFF");
$('#' + table_id + '>tbody>tr').each(function(i){
if(i==0)
{
$(this).find('td:first').addClass('table-data-first-left');
$(this).find('td:last').addClass('table-data-first-right');
}
if(i == ($('#' + table_id + '>tbody>tr').length-1))
{
$(this).find('td:first').addClass('table-data-last-left');
$(this).find('td:last').addClass('table-data-last-right');
}
if((i%2 == 0))
$(this).find('td:eq(0)').addClass('table-data-left-even');
else
$(this).find('td:eq(0)').addClass('table-data-left-odd');
});
$('#' + table_id + '>tbody>tr').mouseover(function(){
$(this).css("backgroundColor","#CCC");
})
.mouseout(function(){
idx = $('#' + table_id + '>tbody>tr').index(this);
if((idx%2 == 0))
$(this).css("backgroundColor","#FFFFFF");
else
$(this).css("backgroundColor","#C7D3ED");
});
if(isOldIE_Browser())
{
$("#"+id).css("width",parseInt($("#"+id).width())+16);
$("#"+id).css("height",height);
$("#"+id).css("overflow-y","auto");
$("#"+id).css("overflow-x","hidden");
}
/////////////////////////////////////// Table tbody Class Basic Function Add End ///////////////////////////////////////
}
function isOldIE_Browser()
{
var isOldIE = false;
if(navigator.userAgent.indexOf("MSIE ") != -1)
{
var IEver = navigator.userAgent.match(/Trident\/(\d.\d)/i);
if(IEver)
{
if(parseFloat(IEver[1]) < 6)
{
isOldIE = true;
}
}
else
isOldIE = true;
}
return isOldIE;
}
// 숫자만 체크(숫자아닌문자가 있으면 공백으로 변경)
function NumberCheck(obj, prev_str){
var objTxt = obj.val();
var changeTxt = '';
var num_check=/^[0-9]*$/;
if(!num_check.test(objTxt))
{
obj.val(prev_str);
return false;
}
return true;
}
// Warning Dialog Open
function open_warning(popup_id, local_title, warn_text, add_icon)
{
$("#"+popup_id+">span:first").removeClass();
if(add_icon != "")
{
$("#"+popup_id+">span:first").addClass("ui-icon");
$("#"+popup_id+">span:first").addClass(add_icon);
}
else
$("#"+popup_id+">span:first").removeClass("ui-icon");
$("#"+popup_id).dialog( "option", "title", local_title);
$("#"+popup_id+"-msgTxt>h4").html(warn_text.replace("\n","
"));
$("#"+popup_id).dialog("open");
}
BNC Camera Count
IP Camera Count
Video Mode
Language
System Codec