';
$(this).append(pointer_html);
if ($('#noi_dung_huong_dan_' + dtttct).length) {
$("#noi_dung_chu_thich_" + chuthich_id).html($('#noi_dung_huong_dan_' + dtttct).html());
} else {
$.ajax({
type: 'POST',
url: '/ajax/vanban/chu-thich/',
data: {
'ndct': dtttct,
'id_ct': id_ct,
'dc_text': dc_text
},
success: function(response) {
$("#noi_dung_chu_thich_" + chuthich_id).html(response);
}
});
}
if ($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').length) {
$("#tieu_de_dc_" + chuthich_id).html($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').html());
}
if (!$('.row_vb_details .col-md-9').length) {
var pointy_width2 = $(window).width() - $('#box_noi_dung_vb').width() - 95;
} else {
pointy_width2 = $("#tctn-button").width() + $("#exco").width() + $(".tnpl-title").width() + $(".fa-expand").width() - 23;
}
var min_bg_num = 1;
var max_bg_num = 10;
var random_bg_num = Math.floor(Math.random() * (max_bg_num - min_bg_num + 1)) + min_bg_num;
var rnd_rgb_1 = Math.floor(Math.random() * (235 - 180)) + 180;
var rnd_rgb_2 = Math.floor(Math.random() * (230 - 170)) + 170;
var rnd_rgb_3 = Math.floor(Math.random() * (210 - 110)) + 110;
var rnd_rgb_1 = '#FBF0E1';
var rnd_rgb_2 = rnd_rgb_1;
var rnd_rgb_3 = rnd_rgb_1;
var canva_colors = new Array('', '#fff9ab', '#ffe8ba', '#edffc5', '#c8fad5', '#e7f2d0', '#dbd0f2', '#ecffc3', '#c3ffc3', '#e3e6dd', '#e7ffc3');
var canva_color = rnd_rgb_1;
$(chuthich_buble_id).css('width', $('#doc-right-col').width() - 10 + 'px');
$(chuthich_buble_id).css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
$(chuthich_buble_id).css('background', rnd_rgb_1);
$('.pointer').css('height', '');
$(this).find('.pointer [ui-nav] a span').on('click', function(e) {
var $this = $(e.target),
$active, $li;
$this.is('a') || ($this = $this.closest('a'));
$li = $this.parent();
$active = $li.siblings(".active");
$li.toggleClass('active');
$active.removeClass('active');
$(this).find('.pointer').removeAttr('height');
$('.pointer').css('height', '');
//$('.pointy').trigger('pointy-refresh');
setTimeout(function() {
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
$(chuthich_buble_id).css('height', '');
$(window).resize();
$(chuthich_buble_id).trigger('pointy-update');
}, 800);
});
}
if ($(chuthich_buble_id).length) {
$main = $(this);
$pointer = $(this).find(chuthich_buble_id);
if ($($pointer).is(":visible")) {
if (allow_close_pointy) {
$($pointer).hide();
$(this).trigger('pointy-hide');
}
} else {
$($pointer).show();
$(this).trigger('pointy-show');
$('#rightdocinfo').hide('slow');
$('#r-toc').hide('slow');
$('#download-file,a#attribute').show();
$('html,body').animate({
scrollTop: $(chuthich_buble_id).find('h3.tieu_de_dan_chieu').offset().top - 300
},
'slow');
}
data_pointy_show = $pointer.attr('data-pointy-show');
if (data_pointy_show == 'false') {
$close_link = $(chuthich_buble_id).find('i.close'),
x = $(this).offset();
this_top = x.top - 500;
$($pointer).css('top', this_top + 'px');
$('.pointer').css('z-index', '999');
$('canvas.pointy').css('z-index', '999');
$($pointer).css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
$(this).pointy({
pointer: $pointer,
defaultClass: '',
activeClass: 'pointy-active',
arrowWidth: 20,
//useOffset: true,
borderColor: '#edeee7',
backgroundColor: canva_color
});
$('.pointer *').on('click mouseover', function() {
$('.pointer').css('z-index', '1');
$(".nav-dropdown").css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
$('canvas.pointy').css('z-index', '1');
$(this).closest('.pointer').css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
});
$('.pointer, .pointer *').on('click mouseover', function() {
event.stopPropagation();
});
$($close_link).click(function() {
allow_close_pointy = true;
$(this).closest('.chu_thich').click();
});
$pointer.attr('data-pointy-show', 'true');
$(this).trigger('pointy-update');
$('.pointer').css('height', '');
}
$pointer.draggable({
containment: '#view',
drag: function() {
// update pointy while dragging
$(this).trigger('pointy-update');
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id).css('height', '');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
setTimeout(function() {
$(chuthich_buble_id).trigger('pointy-refresh');
}, 1000);
$(".nav-dropdown").css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
}
});
}
});
//dan_chieu cho Login
$('.dan_chieu').each(function() {
$(this).removeAttr('onmouseover');
$(this).removeAttr('onmouseout');
$(this).removeAttr('data-target');
$(this).attr('id', 'rnd_' + random_string_id(20));
if (!$(this).attr('class').includes('dan_chieu_tu_dong')) {
$(this).addClass('dan_chieu_tu_dong');
}
});
$('.dan_chieu').removeAttr('data-toggle');
$('.dan_chieu').click(function() {
if ($('#ajax_tra_cuu').is(':visible')) {
$('#ajax_tra_cuu').hide();
}
var text_html = $(this).text();
dtttct = $(this).attr('data-dc');
if (this.hasAttribute('o-title')) {
tieu_de_dan_chieu = $(this).attr('o-title');
} else {
tieu_de_dan_chieu = text_html;
}
var $this_pointer = $(this).find('.pointer');
if (typeof ct_html === 'undefined') {} else {
//$('html').prepend(ct_html);
}
if (typeof danchieu_id === 'undefined') {}
danchieu_id = 'dc_' + $(this).attr('id');
dcase = $(this).attr('data-dcase');
chuthich_buble_id = '#dan_chieu_bubble_' + danchieu_id;
danchieu_id_content = '#noi_dung_td_' + danchieu_id;
$(this).find('.dan_chieu').on('click', function() {
allow_close_pointy = false;
});
if (typeof allow_close_pointy === 'undefined') {
allow_close_pointy = true;
}
if (!$(chuthich_buble_id).length) {
so_dan_chieu = $(danchieu_id_content + ' .badge-round').length;
if (so_dan_chieu == 0) {
so_dan_chieu = $(danchieu_id_content + ' .panel-default').length;
}
pointer_html = '
';
$(this).append(pointer_html);
if ($('#noi_dung_huong_dan_' + dtttct).length) {
$("#noi_dung_dan_chieu_" + danchieu_id).html($('#noi_dung_huong_dan_' + dtttct).html());
} else {
if (dtttct.length == 32) {
$.ajax({
type: 'POST',
url: '/ajax/public/dan-chieu/' + dtttct,
data: {
'text_dan_chieu': text_html
},
success: function(response) {
$("#noi_dung_dan_chieu_" + danchieu_id).html(response);
}
});
} else {
$("#noi_dung_dan_chieu_" + danchieu_id).load('/ajax/public/dan-chieu/' + dtttct + '/');
}
}
if ($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').length) {
$("#tieu_de_dc_" + danchieu_id).html($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').html());
}
if (!$('.row_vb_details .col-md-9').length) {
var pointy_width2 = $(window).width() - $('#box_noi_dung_vb').width() - 95;
}
var min_bg_num = 1;
var max_bg_num = 10;
var random_bg_num = Math.floor(Math.random() * (max_bg_num - min_bg_num + 1)) + min_bg_num;
var rnd_rgb_1 = Math.floor(Math.random() * (235 - 180)) + 180;
var rnd_rgb_2 = Math.floor(Math.random() * (230 - 170)) + 170;
var rnd_rgb_3 = Math.floor(Math.random() * (210 - 110)) + 110;
var rnd_rgb_1 = '#FBF0E1';
var rnd_rgb_2 = rnd_rgb_1;
var rnd_rgb_3 = rnd_rgb_1;
var canva_colors = new Array('', '#fff9ab', '#ffe8ba', '#edffc5', '#c8fad5', '#e7f2d0', '#dbd0f2', '#ecffc3', '#c3ffc3', '#e3e6dd', '#e7ffc3');
var canva_color = rnd_rgb_1;
$(chuthich_buble_id).css('width', $('#doc-right-col').width() - 10 + 'px');
$(chuthich_buble_id).css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
$(chuthich_buble_id).css('background', rnd_rgb_1);
$('.pointer').css('height', '');
$(this).find('.pointer [ui-nav] a span').on('click', function(e) {
var $this = $(e.target),
$active, $li;
$this.is('a') || ($this = $this.closest('a'));
$li = $this.parent();
$active = $li.siblings(".active");
$li.toggleClass('active');
$active.removeClass('active');
$(this).find('.pointer').removeAttr('height');
$('.pointer').css('height', '');
//$('.pointy').trigger('pointy-refresh');
setTimeout(function() {
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
$(chuthich_buble_id).css('height', '');
$(window).resize();
$(chuthich_buble_id).trigger('pointy-update');
}, 800);
});
}
if ($(chuthich_buble_id).length) {
$main = $(this);
$pointer = $(this).find(chuthich_buble_id);
if ($($pointer).is(":visible")) {
if (allow_close_pointy) {
$($pointer).hide();
$(this).trigger('pointy-hide');
}
} else {
$($pointer).show();
$(this).trigger('pointy-show');
$('#rightdocinfo').hide('slow');
$('#r-toc').hide('slow');
$('#download-file,a#attribute').show();
$(chuthich_buble_id).css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
$('html,body').animate({
scrollTop: $(chuthich_buble_id).offset().top - 300
},
'slow');
}
data_pointy_show = $pointer.attr('data-pointy-show');
if (data_pointy_show == 'false') {
$close_link = $(chuthich_buble_id).find('i.close'),
x = $(this).offset();
this_top = x.top - 500;
$($pointer).css('top', this_top + 'px');
$('.pointer').css('z-index', '999');
$('canvas.pointy').css('z-index', '999');
$($pointer).css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
$(this).pointy({
pointer: $pointer,
defaultClass: '',
activeClass: 'pointy-active',
arrowWidth: 20,
//useOffset: true,
borderColor: '#edeee7',
backgroundColor: canva_color
});
$('.pointer *').on('click mouseover', function() {
$('.pointer').css('z-index', '1');
$('canvas.pointy').css('z-index', '1');
$(this).closest('.pointer').css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
});
$('.pointer, .pointer *').on('click mouseover', function() {
event.stopPropagation();
});
$($close_link).click(function() {
allow_close_pointy = true;
$(this).closest('.dan_chieu').click();
});
$pointer.attr('data-pointy-show', 'true');
$(this).trigger('pointy-update');
$('.pointer').css('height', '');
}
$pointer.draggable({
containment: '#view',
drag: function() {
$(this).trigger('pointy-update');
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id).css('height', '');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
setTimeout(function() {
$(chuthich_buble_id).trigger('pointy-refresh');
}, 1000);
$(".nav-dropdown").css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
}
});
}
});
//dan chieu tham khao
////chu thich cho Login
$('.dan_chieu_tham_khao').each(function() {
$(this).removeAttr('onmouseover');
$(this).removeAttr('onmouseout');
$(this).removeAttr('data-target');
$(this).attr('id', 'rnd_' + random_string_id(20));
});
$('.dan_chieu_tham_khao').removeAttr('data-toggle');
$('.dan_chieu_tham_khao').click(function() {
//
if ($('#ajax_tra_cuu').is(':visible')) {
$('#ajax_tra_cuu').hide();
}
dtttct = $(this).attr('data-ct');
id_ct = $(this).attr('id');
dc_text = $(this).html();
var $this_pointer = $(this).find('.pointer');
text_html = $(this).text();
if (typeof ct_html === 'undefined') {} else {
//$('html').prepend(ct_html);
}
if (typeof chuthich_id === 'undefined') {}
chuthich_id = 'dc_' + $(this).attr('id');
dcase = $(this).attr('data-dcase');
chuthich_buble_id = '#dan_chieu_tham_khao_bubble_' + chuthich_id;
chuthich_id_content = '#noi_dung_td_' + chuthich_id;
$(this).find('.dan_chieu_tham_khao').on('click', function() {
allow_close_pointy = false;
});
if (typeof allow_close_pointy === 'undefined') {
allow_close_pointy = true;
}
if (!$(chuthich_buble_id).length) {
so_chu_thich = $(chuthich_id_content + ' .badge-round').length;
if (so_chu_thich == 0) {
so_chu_thich = $(chuthich_id_content + ' .panel-default').length;
}
var buble_height = $(window).height() * 0.8;
pointer_html = '
';
$(this).append(pointer_html);
if ($('#noi_dung_huong_dan_' + dtttct).length) {
$("#noi_dung_dan_chieu_tham_khao_" + chuthich_id).html($('#noi_dung_huong_dan_' + dtttct).html());
} else {
$.ajax({
type: 'POST',
url: '/ajax/vanban/chu-thich/',
data: {
'ndct': dtttct,
'id_ct': id_ct,
'loai_hd': 'noi_dung_tham_khao',
'dc_text': dc_text
},
success: function(response) {
$("#noi_dung_dan_chieu_tham_khao_" + chuthich_id).html(response);
}
});
}
if ($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').length) {
$("#tieu_de_dc_" + chuthich_id).html($('.tieu_de_dc_' + dtttct + ' span.tieu_de_dc').html());
}
if (!$('.row_vb_details .col-md-9').length) {
var pointy_width2 = $(window).width() - $('#box_noi_dung_vb').width() - 95;
} else {
pointy_width2 = $("#tctn-button").width() + $("#exco").width() + $(".tnpl-title").width() + $(".fa-expand").width() - 23;
// alert(pointy_width2);
}
var min_bg_num = 1;
var max_bg_num = 10;
// and the formula is:
var random_bg_num = Math.floor(Math.random() * (max_bg_num - min_bg_num + 1)) + min_bg_num;
var rnd_rgb_1 = Math.floor(Math.random() * (235 - 180)) + 180;
var rnd_rgb_2 = Math.floor(Math.random() * (230 - 170)) + 170;
var rnd_rgb_3 = Math.floor(Math.random() * (210 - 110)) + 110;
var rnd_rgb_1 = '#FBF0E1';
var rnd_rgb_2 = rnd_rgb_1;
var rnd_rgb_3 = rnd_rgb_1;
var canva_colors = new Array('', '#fff9ab', '#ffe8ba', '#edffc5', '#c8fad5', '#e7f2d0', '#dbd0f2', '#ecffc3', '#c3ffc3', '#e3e6dd', '#e7ffc3');
var canva_color = rnd_rgb_1;
$(chuthich_buble_id).css('width', $('#doc-right-col').width() - 10 + 'px');
$(chuthich_buble_id).css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
$(chuthich_buble_id).css('background', rnd_rgb_1);
//$(chuthich_buble_id).css('background', +rnd_rgb_1);
//$(chuthich_buble_id).addClass('pointer_bg_'+random_bg_num);
$('.pointer').css('height', '');
$(this).find('.pointer [ui-nav] a span').on('click', function(e) {
var $this = $(e.target),
$active, $li;
$this.is('a') || ($this = $this.closest('a'));
$li = $this.parent();
$active = $li.siblings(".active");
$li.toggleClass('active');
$active.removeClass('active');
$(this).find('.pointer').removeAttr('height');
$('.pointer').css('height', '');
//$('.pointy').trigger('pointy-refresh');
setTimeout(function() {
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
$(chuthich_buble_id).css('height', '');
$(window).resize();
$(chuthich_buble_id).trigger('pointy-update');
}, 800);
});
}
//var check_bubble = setInterval(function(){ },100);
if ($(chuthich_buble_id).length) {
$main = $(this);
// fixed block
// draggable element
$pointer = $(this).find(chuthich_buble_id);
if ($($pointer).is(":visible")) {
if (allow_close_pointy) {
$($pointer).hide();
$(this).trigger('pointy-hide');
//$("#box_noi_dung_vb").removeClass('box-shadow-z3 col-md-12 box-shadow-z2 ng-scope m-b-10').addClass('col-md-7 box-shadow-z2 ng-scope m-b-10');
}
} else {
$($pointer).show();
$(this).trigger('pointy-show');
$('#rightdocinfo').hide('slow');
$('#r-toc').hide('slow');
$('#download-file,a#attribute').show();
if ($("#doc-right-col").not(':visible')) {
$('#doc-right-col').show();
}
$(chuthich_buble_id).css('left', $('#tab_noi_dung_vb').width() + 35 + "px");
//$(chuthich_buble_id).find('h3.tieu_de_dan_chieu').text('ok');
$('html,body').animate({
scrollTop: $(chuthich_buble_id).find('h3.tieu_de_dan_chieu').offset().top - 300
},
'slow');
}
data_pointy_show = $pointer.attr('data-pointy-show');
if (data_pointy_show == 'false') {
$close_link = $(chuthich_buble_id).find('i.close'),
x = $(this).offset();
//alert(x.top);
this_top = x.top - 500;
$($pointer).css('top', this_top + 'px');
$('.pointer').css('z-index', '999');
$('canvas.pointy').css('z-index', '999');
$($pointer).css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
// initialize pointy
$(this).pointy({
pointer: $pointer,
// additional class name added to the pointer & the arrow (canvas)
// to add a z-index of 1
defaultClass: '',
// "pointy-active" class is used to keep the last updated pointer on top
// this is the default value
activeClass: 'pointy-active',
// arrow base width (in pixels)
arrowWidth: 20,
//useOffset: true,
borderColor: '#edeee7',
backgroundColor: canva_color
});
$('.pointer *').on('click mouseover', function() {
$('.pointer').css('z-index', '1');
$(".nav-dropdown").css('width', $('#doc-right-col').width() +'px');
$('canvas.pointy').css('z-index', '1');
$(this).closest('.pointer').css('z-index', '999');
$(this).closest('canvas.pointy').css('z-index', '999');
});
$('.pointer, .pointer *').on('click mouseover', function() {
event.stopPropagation();
});
$($close_link).click(function() {
allow_close_pointy = true;
$(this).closest('.dan_chieu_tham_khao').click();
});
$pointer.attr('data-pointy-show', 'true');
$(this).trigger('pointy-update');
$('.pointer').css('height', '');
}
$pointer.draggable({
containment: '#view',
drag: function() {
// update pointy while dragging
$(this).trigger('pointy-update');
$(chuthich_buble_id).removeAttr('height');
$(chuthich_buble_id).css('height', '');
$(chuthich_buble_id + ' .list_tds').css('max-height', $(window).height() + 'px');
setTimeout(function() {
$(chuthich_buble_id).trigger('pointy-refresh');
}, 1000);
$(".nav-dropdown").css('left', $('#tab_noi_dung_vb').width() + 50 + "px");
}
});
}
});
//ket thuc dan chieu tham khao
$("cttd dctd dctk .dan_chieu_tham_khao").on('click mouseover', function(e) {
e.preventDefault();
e.stopPropagation();
});
$('dctd, cttd, chuthich, dctk').click(function() {
$('#customSidebar').animate({
right: '-280px'
}, 500);
$('#toggleSidebar').html('
');
});
});
function random_string_id(numstr) {
var text = "";
var possible = "abcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < numstr; i++) text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}