linkkf 로직수정중
This commit is contained in:
3845
lib/framework/static/js/chartjs-utils.js
Normal file
3845
lib/framework/static/js/chartjs-utils.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ if (tmp.length == 2) {
|
||||
var PACKAGE_NAME = tmp[1];
|
||||
var MODULE_NAME = tmp[2];
|
||||
var PAGE_NAME = "";
|
||||
} else if (tmp.length == 4){
|
||||
} else if (tmp.length > 3){
|
||||
var PACKAGE_NAME = tmp[1];
|
||||
var MODULE_NAME = tmp[2];
|
||||
var PAGE_NAME = tmp[3];
|
||||
@@ -23,8 +23,6 @@ $(window).on("load resize", function (event) {
|
||||
});
|
||||
|
||||
$('#command_modal').on('show.bs.modal', function (event) {
|
||||
console.log('111111111')
|
||||
console.log(event);
|
||||
})
|
||||
|
||||
///////////////////////////////////////
|
||||
@@ -113,7 +111,6 @@ function showModal(data='EMPTY', title='JSON', json=true) {
|
||||
data = JSON.stringify(data, null, 2);
|
||||
}
|
||||
document.getElementById("modal_body").innerHTML = '<pre style="white-space: pre-wrap;">' +data + '</pre>';
|
||||
|
||||
$("#large_modal").modal();
|
||||
}
|
||||
|
||||
@@ -168,7 +165,22 @@ function use_collapse(div, reverse=false) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// jquery extend function
|
||||
// post로 요청하면서 리다이렉트
|
||||
$.extend(
|
||||
{
|
||||
redirectPost: function(location, args)
|
||||
{
|
||||
var form = '';
|
||||
$.each( args, function( key, value ) {
|
||||
console.log(key);
|
||||
console.log(value);
|
||||
value = value.split('"').join('\"')
|
||||
form += '<input type="hidden" name="'+key+'" value="'+value+'">';
|
||||
});
|
||||
$('<form action="' + location + '" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -282,20 +294,3 @@ function pad(n, width) {
|
||||
return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
|
||||
}
|
||||
|
||||
// jquery extend function
|
||||
// post로 요청하면서 리다이렉트
|
||||
// 푹 자동에서 푹 기본 검색할때 사용
|
||||
$.extend(
|
||||
{
|
||||
redirectPost: function(location, args)
|
||||
{
|
||||
var form = '';
|
||||
$.each( args, function( key, value ) {
|
||||
console.log(key);
|
||||
console.log(value);
|
||||
value = value.split('"').join('\"')
|
||||
form += '<input type="hidden" name="'+key+'" value="'+value+'">';
|
||||
});
|
||||
$('<form action="' + location + '" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
|
||||
}
|
||||
});
|
||||
@@ -15,11 +15,10 @@ $(document).ready(function(){
|
||||
|
||||
var protocol = window.location.protocol;
|
||||
var frameSocket = io.connect(protocol + "//" + document.domain + ":" + location.port + "/framework");
|
||||
console.log(frameSocket);
|
||||
|
||||
frameSocket.on('notify', function(data){
|
||||
$.notify({
|
||||
message : data['msg'],
|
||||
message : '<strong>' + data['msg'] + '</strong>',
|
||||
url: data['url'],
|
||||
target: '_self'
|
||||
},{
|
||||
@@ -29,7 +28,7 @@ frameSocket.on('notify', function(data){
|
||||
});
|
||||
|
||||
frameSocket.on('modal', function(data){
|
||||
m_modal(data.data, data.title, false);
|
||||
showModal(data.data, data.title, false);
|
||||
});
|
||||
|
||||
frameSocket.on('loading_hide', function(data){
|
||||
@@ -37,14 +36,12 @@ frameSocket.on('loading_hide', function(data){
|
||||
});
|
||||
|
||||
frameSocket.on('refresh', function(data){
|
||||
console.log('data')
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
|
||||
$('#command_modal').on('hide.bs.modal', function (e) {
|
||||
//e.preventDefault(); 있으면 동작 안함.
|
||||
console.log("ff global command_modal hide.bs.modal CATCH")
|
||||
$.ajax({
|
||||
url: `/global/ajax/command_modal_hide`,
|
||||
type: 'POST',
|
||||
@@ -74,13 +71,27 @@ $("body").on('click', '#globalLinkBtn', function(e) {
|
||||
window.location.href = url;
|
||||
});
|
||||
|
||||
$("body").on('click', '#globalReloadBtn', function(e) {
|
||||
e.preventDefault();
|
||||
location.reload();
|
||||
});
|
||||
// global_link_btn 모두 찾아 변경
|
||||
|
||||
$("body").on('click', '#globalSettingSaveBtn', function(e){
|
||||
e.preventDefault();
|
||||
globalSettingSave();
|
||||
if (globalSettingSaveBefore()) {
|
||||
globalSettingSave();
|
||||
}
|
||||
});
|
||||
|
||||
function globalSettingSaveBefore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function globalSettingSaveAfter() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function globalSettingSave() {
|
||||
var formData = getFormdata('#setting');
|
||||
$.ajax({
|
||||
@@ -94,6 +105,7 @@ function globalSettingSave() {
|
||||
$.notify('<strong>설정을 저장하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
globalSettingSaveAfter();
|
||||
} else {
|
||||
$.notify('<strong>설정 저장에 실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
@@ -106,7 +118,10 @@ function globalSettingSave() {
|
||||
$("body").on('click', '#globalEditBtn', function(e) {
|
||||
e.preventDefault();
|
||||
file = $(this).data('file');
|
||||
console.log(file);
|
||||
if (file == null) {
|
||||
var tag = $(this).data('tag');
|
||||
file = $('#' + tag).val();
|
||||
}
|
||||
$.ajax({
|
||||
url: '/global/ajax/is_available_edit',
|
||||
type: "POST",
|
||||
@@ -236,107 +251,188 @@ $("body").on('click', '#globalImmediatelyExecutePageBtn', function(e){
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#globalDbDeleteDayBtn', function(e){
|
||||
e.preventDefault();
|
||||
var tag_id = $(this).data('tag_id');
|
||||
var day = $('#' + tag_id).val();
|
||||
globalConfirmModal('DB 삭제', "최근 " + day + "일 이내 데이터를 제외하고 삭제 하시겠습니까?", function() {
|
||||
globalDbDelete(day);
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#globalDbDeleteBtn', function(e){
|
||||
e.preventDefault();
|
||||
document.getElementById("confirm_title").innerHTML = "DB 삭제";
|
||||
document.getElementById("confirm_body").innerHTML = "전체 목록을 삭제 하시겠습니까?";
|
||||
$('#confirm_button').attr('onclick', "globalDbDelete();");
|
||||
$("#confirm_modal").modal();
|
||||
return;
|
||||
globalConfirmModal('DB 삭제', "전체 목록을 삭제 하시겠습니까?", function() {
|
||||
globalDbDelete(0);
|
||||
});
|
||||
});
|
||||
|
||||
function globalDbDelete() {
|
||||
function globalDbDelete(day) {
|
||||
$.ajax({
|
||||
url: '/'+PACKAGE_NAME+'/ajax/' + MODULE_NAME + '/reset_db',
|
||||
url: '/'+PACKAGE_NAME+'/ajax/' + MODULE_NAME + '/db_delete',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
data: {day:day},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>삭제하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
if (data == -1) {
|
||||
$.notify('<strong>삭제에 실패하였습니다.</strong>',{
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>'+data+'개를 삭제하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
globalRequestSearch('1');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
$("body").on('click', '#globalDbDeleteDayPageBtn', function(e){
|
||||
e.preventDefault();
|
||||
var tag_id = $(this).data('tag_id');
|
||||
var day = $('#' + tag_id).val();
|
||||
globalConfirmModal('DB 삭제', day + "일 제외 목록을 삭제 하시겠습니까?", function() {
|
||||
globalDbDeletePage(day);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#globalDbDeletePageBtn', function(e){
|
||||
e.preventDefault();
|
||||
document.getElementById("confirm_title").innerHTML = "DB 삭제";
|
||||
document.getElementById("confirm_body").innerHTML = "전체 목록을 삭제 하시겠습니까?";
|
||||
$('#confirm_button').attr('onclick', "globalDbDeletePage();");
|
||||
$("#confirm_modal").modal();
|
||||
return;
|
||||
globalConfirmModal('DB 삭제', "최근 " + day + "일 이내 데이터를 제외하고 삭제 하시겠습니까?", function() {
|
||||
globalDbDeletePage(0);
|
||||
});
|
||||
});
|
||||
|
||||
function globalDbDeletePage() {
|
||||
function globalDbDeletePage(day) {
|
||||
$.ajax({
|
||||
url: '/'+PACKAGE_NAME+'/ajax/' + MODULE_NAME + '/' + PAGE_NAME + '/reset_db',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {sub:sub},
|
||||
data: {day:day},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>삭제하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
if (data == -1) {
|
||||
$.notify('<strong>삭제에 실패하였습니다.</strong>',{
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>'+data+'개를 삭제하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
globalRequestSearch('1');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click', '#globalDbDeleteItemBtn', function(e){
|
||||
e.preventDefault();
|
||||
var db_id = $(this).data('id');
|
||||
$.ajax({
|
||||
url: '/'+PACKAGE_NAME+'/ajax/' + MODULE_NAME + '/db_delete_item',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {db_id:db_id},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret) {
|
||||
notify('삭제하였습니다.', 'success');
|
||||
globalRequestSearch(current_page);
|
||||
} else {
|
||||
notify('삭제에 실패하였습니다.', 'warning');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#globalDbDeleteItemPageBtn', function(e){
|
||||
e.preventDefault();
|
||||
var db_id = $(this).data('id');
|
||||
$.ajax({
|
||||
url: '/'+PACKAGE_NAME+'/ajax/' + MODULE_NAME + '/' + PAGE_NAME + '/db_delete_item',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {db_id:db_id},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret) {
|
||||
notify('삭제하였습니다.', 'success');
|
||||
globalRequestSearch(current_page);
|
||||
} else {
|
||||
notify('삭제에 실패하였습니다.', 'warning');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#globalJsonBtn', function(e){
|
||||
e.preventDefault();
|
||||
showModal(current_data.list[$(this).data('idx')]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// Global - 함수
|
||||
///////////////////////////////////////
|
||||
|
||||
function globalSendCommand(command, arg1, arg2, arg3, modal_title, callback) {
|
||||
console.log("globalSendCommand [" + command + '] [' + arg1 + '] [' + arg2 + '] [' + arg3 + '] [' + modal_title + '] [' + callback + ']');
|
||||
console.log('/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/command');
|
||||
function globalSendCommand(command, arg1, arg2, arg3, callback) {
|
||||
var url = '/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/command';
|
||||
return globalSendCommandByUrl(url, command, arg1, arg2, arg3, callback);
|
||||
}
|
||||
|
||||
function globalSendCommandByUrl(url, command, arg1, arg2, arg3, callback) {
|
||||
$.ajax({
|
||||
url: '/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/command',
|
||||
url: url,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{command:command, arg1:arg1, arg2:arg2, arg3},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
console.log(ret)
|
||||
if (ret.msg != null) notify(ret.msg, ret.ret);
|
||||
if (ret.modal != null) showModal(ret.modal, modal_title, false);
|
||||
if (ret.json != null) showModal(ret.json, modal_title, true);
|
||||
if (ret.modal != null) showModal(ret.modal, ret.title, false);
|
||||
if (ret.json != null) showModal(ret.json, ret.title, true);
|
||||
if (callback != null) callback(ret);
|
||||
if (ret.reload) location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function globalSendCommandPage(command, arg1, arg2, arg3, modal_title, callback) {
|
||||
console.log("globalSendCommandPage [" + command + '] [' + arg1 + '] [' + arg2 + '] [' + arg3 + '] [' + modal_title + '] [' + callback + ']');
|
||||
console.log('/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/command');
|
||||
function globalSendCommandPage(command, arg1, arg2, arg3, callback) {
|
||||
var url = '/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/' + PAGE_NAME + '/command';
|
||||
return globalSendCommandPageByUrl(url, command, arg1, arg2, arg3, callback);
|
||||
}
|
||||
|
||||
function globalSendCommandPageByUrl(url, command, arg1, arg2, arg3, callback) {
|
||||
$.ajax({
|
||||
url: '/' + PACKAGE_NAME + '/ajax/' + MODULE_NAME + '/' + PAGE_NAME + '/command',
|
||||
url: url,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{command:command, arg1:arg1, arg2:arg2, arg3},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.msg != null) notify(ret.msg, ret.ret);
|
||||
if (ret.modal != null) m_modal(ret.modal, modal_title, false);
|
||||
if (ret.json != null) m_modal(ret.json, modal_title, true);
|
||||
if (ret.modal != null) showModal(ret.modal, ret.title, false);
|
||||
if (ret.json != null) showModal(ret.json, ret.title, true);
|
||||
if (callback != null) callback(ret);
|
||||
if (ret.reload) location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -400,6 +496,10 @@ function make_page_html(data) {
|
||||
str += '<button id="gloablSearchPageBtn" data-page="' + (data.last_page+1) + '" type="button" class="btn btn-secondary">»</button>'
|
||||
}
|
||||
|
||||
if (data.last_page != data.total_page) {
|
||||
str += '<button id="gloablSearchPageBtn" data-page="' + (data.total_page) + '" type="button" class="btn btn-secondary">'+data.total_page+'</button>'
|
||||
}
|
||||
|
||||
str += '</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
@@ -431,6 +531,22 @@ $("body").on('click', '#globalSearchResetBtn', function(e){
|
||||
});
|
||||
|
||||
|
||||
$("body").on('change', '#option1', function(e){
|
||||
e.preventDefault();
|
||||
globalRequestSearch(1);
|
||||
});
|
||||
|
||||
$("body").on('change', '#option2', function(e){
|
||||
e.preventDefault();
|
||||
globalRequestSearch(1);
|
||||
});
|
||||
|
||||
$("body").on('change', '#order', function(e){
|
||||
e.preventDefault();
|
||||
globalRequestSearch(1);
|
||||
});
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// 파일 선택 모달
|
||||
@@ -483,7 +599,6 @@ let listdir = (path = '/', only_dir = true) => {
|
||||
},
|
||||
dataType: 'json'
|
||||
}).done((datas) => {
|
||||
console.log(datas)
|
||||
if (datas.length == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -510,8 +625,6 @@ let listdir = (path = '/', only_dir = true) => {
|
||||
} else {
|
||||
//new_path = (path !== path_spliter) ? path + path_spliter + $(evt.currentTarget).text() : path + $(evt.currentTarget).text();
|
||||
new_path = $(evt.currentTarget).data('value');
|
||||
console.log(new_path)
|
||||
console.log(evt)
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -587,3 +700,23 @@ function ResizeTextArea() {
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// Confirm MODAL
|
||||
///////////////////////////////////////
|
||||
|
||||
function globalConfirmModal(title, body, func) {
|
||||
$("#confirm_title").html(title);
|
||||
$("#confirm_body").html(body);
|
||||
//$('#confirm_button').attr('onclick', func);
|
||||
$("body").on('click', '#confirm_button', function(e){
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
func();
|
||||
});
|
||||
$("#confirm_modal").modal();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
14
lib/framework/static/js/ff_global_plugin.js
Normal file
14
lib/framework/static/js/ff_global_plugin.js
Normal file
@@ -0,0 +1,14 @@
|
||||
///////////////////////////////////////
|
||||
// 자주 사용하는 플러그인에 전용 명령
|
||||
|
||||
function pluginRcloneLs(remote_path) {
|
||||
var url = '/rclone/ajax/config/command';
|
||||
globalSendCommandByUrl(url, "ls", remote_path);
|
||||
}
|
||||
|
||||
function pluginRcloneSize(remote_path) {
|
||||
var url = '/rclone/ajax/config/command';
|
||||
globalSendCommandByUrl(url, "size", remote_path);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@ function j_button_group(h) {
|
||||
}
|
||||
|
||||
// primary, secondary, success, danger, warning, info, light, dark, white
|
||||
function j_button(id, text, data={}, color='primary', outline=true, small=false) {
|
||||
function j_button(id, text, data={}, color='primary', outline=true, small=false, _class='') {
|
||||
var str = '<button id="'+id+'" name="'+id+'" class="btn btn-sm btn';
|
||||
if (outline) {
|
||||
str += '-outline';
|
||||
}
|
||||
str += '-' + color+'';
|
||||
str += ' ' + _class;
|
||||
if (small) {
|
||||
str += ' py-0" style="font-size: 0.8em;"';
|
||||
} else {
|
||||
@@ -35,9 +36,14 @@ function j_button_small(id, text, data={}, color='primary', outline=true) {
|
||||
|
||||
|
||||
function j_row_start(padding='10', align='center') {
|
||||
var str = '<div class="row" style="padding-top: '+padding+'px; padding-bottom:'+padding+'px; align-items:'+align+';">';
|
||||
var str = '<div class="row chover" style="padding-top: '+padding+'px; padding-bottom:'+padding+'px; align-items:'+align+';">';
|
||||
return str;
|
||||
}
|
||||
function j_row_start_hover(padding='10', align='center') {
|
||||
var str = '<div class="row my_hover" style="padding-top: '+padding+'px; padding-bottom:'+padding+'px; align-items:'+align+';">';
|
||||
return str;
|
||||
}
|
||||
|
||||
function j_col(w, h, align='left') {
|
||||
var str = '<div class="col-sm-' + w + ' " style="text-align: '+align+'; word-break:break-all;">';
|
||||
str += h;
|
||||
@@ -45,6 +51,13 @@ function j_col(w, h, align='left') {
|
||||
return str;
|
||||
}
|
||||
|
||||
function j_col_with_class(w, h, align='left', _class='context_menu') {
|
||||
var str = '<div class="col-sm-' + w + ' '+_class+'" style="text-align: '+align+'; word-break:break-all;">';
|
||||
str += h;
|
||||
str += '</div>';
|
||||
return str;
|
||||
}
|
||||
|
||||
function j_col_wide(w, h, align='left') {
|
||||
var str = '<div class="col-sm-' + w + ' " style="padding:0px; margin:0px; text-align: '+align+'; word-break:break-all;">';
|
||||
str += h;
|
||||
@@ -87,57 +100,101 @@ function j_row_info(left, right, l=2, r=8) {
|
||||
function j_progress(id, width, label) {
|
||||
var str = '';
|
||||
str += '<div class="progress" style="height: 25px;">'
|
||||
str += '<div id="'+id+'" class="progress-bar" style="background-color:yellow;width:'+width+'%"></div>';
|
||||
str += '<div id="'+id+'_label" class="justify-content-center d-flex w-100 " style="margin-top:2px">'+label+'</div>';
|
||||
str += '<div id="'+id+'" class="progress-bar bg-success" style="width:'+width+'%"></div>';
|
||||
str += '<div id="'+id+'_label" class="justify-content-center d-flex w-100 position-absolute" style="margin-top:2px">'+label+'</div>';
|
||||
str += '</div>'
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
function j_td(text, width='10', align='center', colspan='1') {
|
||||
str = '<td scope="col" colspan="'+colspan+'" style="width:'+width+'%; text-align:'+align+';">'+ text + '</td>';
|
||||
return str;
|
||||
}
|
||||
|
||||
function j_th(text, width='10', align='center', colspan='1') {
|
||||
str = '<th scope="col" colspan="'+colspan+'" style="width:'+width+'%; text-align:'+align+';">'+ text + '</td>';
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function make_log(key, value, left=2, right=10) {
|
||||
row = m_col(left, key, aligh='right');
|
||||
row += m_col(right, value, aligh='left');
|
||||
function j_info_text(key, value, left=2, right=10) {
|
||||
row = j_row_start(0);
|
||||
row += j_col(left, '<strong>' + key + '</strong>', aligh='right');
|
||||
row += j_col(right, value, aligh='left');
|
||||
row += j_row_end();
|
||||
return row;
|
||||
}
|
||||
|
||||
function j_info_text_left(key, value, left=3, right=9) {
|
||||
row = j_row_start(0);
|
||||
row += j_col(left, '<strong>' + key + '</strong>', aligh='left');
|
||||
row += j_col(right, value, aligh='left');
|
||||
row += j_row_end();
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
function j_tab_make(data) {
|
||||
str = '<nav><div class="nav nav-tabs" id="nav-tab" role="tablist">';
|
||||
for (i in data) {
|
||||
if (data[i][2]) {
|
||||
str += '<a class="nav-item nav-link active" id="tab_head_'+data[i][0]+'" data-toggle="tab" href="#tab_content_'+data[i][0]+'" role="tab">'+data[i][1]+'</a>';
|
||||
} else {
|
||||
str += '<a class="nav-item nav-link" id="tab_head_'+data[i][0]+'" data-toggle="tab" href="#tab_content_'+data[i][0]+'" role="tab">'+data[i][1]+'</a>';
|
||||
}
|
||||
}
|
||||
str += '</div></nav>';
|
||||
str += '<div class="tab-content" id="nav-tabContent">';
|
||||
for (i in data) {
|
||||
if (data[i][2]) {
|
||||
str += '<div class="tab-pane fade show active" id="tab_content_'+data[i][0]+'" role="tabpanel" ></div>';
|
||||
} else {
|
||||
str += '<div class="tab-pane fade show" id="tab_content_'+data[i][0]+'" role="tabpanel" ></div>';
|
||||
}
|
||||
}
|
||||
str += '</div>';
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
// javascript에서 화면 생성
|
||||
function text_color(text, color='red') {
|
||||
return '<span style="color:'+color+'; font-weight:bold">' + text + '</span>';
|
||||
}
|
||||
|
||||
|
||||
function j_pre(text) {
|
||||
return '<pre style="word-wrap: break-word;white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-break:break-all;">'+text+'</pre>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -277,10 +334,7 @@ document.addEventListener("DOMContentLoaded", function(){
|
||||
|
||||
|
||||
|
||||
function m_row_start_hover(padding='10', align='center') {
|
||||
var str = '<div class="row my_hover" style="padding-top: '+padding+'px; padding-bottom:'+padding+'px; align-items:'+align+';">';
|
||||
return str;
|
||||
}
|
||||
|
||||
function m_row_start_top(padding='10') {
|
||||
return m_row_start(padding, 'top');
|
||||
}
|
||||
@@ -309,46 +363,5 @@ function m_row_start_color2(padding='10', align='center') {
|
||||
|
||||
|
||||
|
||||
function m_tab_head(name, active) {
|
||||
if (active) {
|
||||
var str = '<a class="nav-item nav-link active" id="id_'+name+'" data-toggle="tab" href="#'+name+'" role="tab">'+name+'</a>';
|
||||
} else {
|
||||
var str = '<a class="nav-item nav-link" id="id_'+name+'" data-toggle="tab" href="#'+name+'" role="tab">'+name+'</a>';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function m_tab_content(name, content, active) {
|
||||
if (active) {
|
||||
var str = '<div class="tab-pane fade show active" id="'+name+'" role="tabpanel" >';
|
||||
} else {
|
||||
var str = '<div class="tab-pane fade show" id="'+name+'" role="tabpanel" >';
|
||||
}
|
||||
str += content;
|
||||
str += '</div>'
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function m_progress2(id, width, label) {
|
||||
var str = '';
|
||||
str += '<div class="progress" style="height: 25px;">'
|
||||
str += '<div id="'+id+'" class="progress-bar" style="background-color:yellow;width:'+width+'%"></div>';
|
||||
str += '<div id="'+id+'_label" class="justify-content-center d-flex w-100 position-absolute" style="margin:0px; margin-top:2px">'+label+'</div>';
|
||||
str += '</div>'
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
35
lib/framework/static/js/showdown-prettify.js
Normal file
35
lib/framework/static/js/showdown-prettify.js
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Google Prettify
|
||||
// A showdown extension to add Google Prettify (http://code.google.com/p/google-code-prettify/)
|
||||
// hints to showdown's HTML output.
|
||||
//
|
||||
|
||||
(function () {
|
||||
|
||||
var prettify = function () {
|
||||
return [
|
||||
{
|
||||
type: 'output',
|
||||
filter: function (source) {
|
||||
return source.replace(/(<pre[^>]*>)?[\n\s]?<code([^>]*)>/gi, function (match, pre, codeClass) {
|
||||
if (pre) {
|
||||
return '<pre class="prettyprint linenums"><code' + codeClass + '>';
|
||||
} else {
|
||||
return ' <code class="prettyprint">';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
// Client-side export
|
||||
if (typeof window !== 'undefined' && window.showdown && window.showdown.extensions) {
|
||||
window.showdown.extensions.prettify = prettify;
|
||||
}
|
||||
// Server-side export
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = prettify;
|
||||
}
|
||||
|
||||
}());
|
||||
3
lib/framework/static/js/showdown_2.1.0.js
Normal file
3
lib/framework/static/js/showdown_2.1.0.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user