Commit 98bb72e6 authored by platyhouse's avatar platyhouse

added band share & share percent - encrypted

parent be75cf83
...@@ -289,3 +289,45 @@ var needsCheckBeforeUnload = false; ...@@ -289,3 +289,45 @@ var needsCheckBeforeUnload = false;
}); });
</script> </script>
<div class="modal" id="ptyShowDialogByRemoteContentDlg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-purple">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 id="ptyShowDialogByRemoteContentDlg_title" class="modal-title"></h4>
</div>
<div class="modal-body">
<span id="ptyShowDialogByRemoteContentDlg_content">
</span>
<div class="modal-footer">
<button type="button" id="ptyShowDialogByRemoteContentDlg_yes" style='display: none' class="btn btn-primary" data-dismiss="modal">계속하기</button>
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">닫기</button>
</div>
</div>
<!-- /.modal-content -->
</div>
</div>
</div>
<div class="modal" id="ptyShowDialogDlg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-purple">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 id="ptyShowDialogDlg_title" class="modal-title"></h4>
</div>
<div class="modal-body">
<span id="ptyShowDialogDlg_content">
</span>
<div class="modal-footer">
<button type="button" id="ptyShowDialogDlg_positive" style='display: none' class="btn btn-primary">계속하기</button>
<button type="button" id="ptyShowDialogDlg_negative" class="btn btn-default pull-right" data-dismiss="modal">닫기</button>
</div>
</div>
<!-- /.modal-content -->
</div>
</div>
</div>
// platyFramework 의 공용 클래스 // platyFramework 의 공용 클래스
// <script src="<?=$this->request->systemUrl?>/modules/ptycommon/resources/ptyCommon.js?<?=time()?>"></script> // <script src="<?=$this->request->systemUrl?>/modules/ptycommon/resources/ptyCommon.js?<?=time()?>"></script>
$(document).on('click', '.ptySubmit', function (e) {
e.preventDefault();
$("#ptyShowDialogDlg").modal('hide');
var formId = $(this).attr('formId');
if (ptyIsEmpty(formId)) {
alert ("needs to set formId");
return;
}
var form = $("#" + $(this).attr('formId'))[0];
if (ptyIsNull(form)) {
alert ('cannot find formId = ' + formId);
return;
}
var data = new FormData(form);
$(this).prop("disabled", true);
var action = $(this).attr('action');
if (ptyIsEmpty(action)) {
action = form.action;
} else {
}
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: action, // form.action,
data: data,
dataType: 'json',
processData: false,
contentType: false,
cache: false,
timeout: 600000,
success: function (data) {
if (typeof data !== typeof undefined) {
if (typeof data.action !== typeof undefined && data.action !== false) {
if (data.action == "ptyShowDialog") {
ptyShowDialog(data.titleContentUrl, data.title, data.content, data.positiveTitle, data.positiveUrl, data.positiveJsonUrl, data.positiveButton);
return;
}
}
/*
if (typeof data.title !== typeof undefined && data.title !== false) {
$("#ptyShowDialogByRemoteContentDlg_title").text(data.title);
}
if (typeof data.content !== typeof undefined && data.content !== false) {
$("#ptyShowDialogByRemoteContentDlg_content").html(data.content);
}
$("#ptyShowDialogByRemoteContentDlg").fadeIn();
*/
}
$(this).prop("disabled", false);
},
error: function (e) {
console.log("ERROR : ", e);
$(this).prop("disabled", false);
alert("요청이 실패되었습니다.");
}
});
});
$(document).on('click', '.ptySubmitAndContent', function (e) {
e.preventDefault();
$("#ptyShowDialogDlg").modal('hide');
var form = $("#" + $(this).attr('formId'))[0];
var data = new FormData(form);
$(this).prop("disabled", true);
var action = $(this).attr('action');
if (typeof action === typeof undefined) {
action = form.action;
} else {
}
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: action, // form.action,
data: data,
dataType: 'json',
processData: false,
contentType: false,
cache: false,
timeout: 600000,
success: function (data) {
if (typeof data !== typeof undefined) {
if (typeof data.action !== typeof undefined && data.action !== false) {
if (data.action == "ptyShowDialog") {
ptyShowDialog(data.titleContentUrl, data.title, data.content, data.positiveTitle, data.positiveUrl, data.positiveJsonUrl);
return;
}
}
if (typeof data.title !== typeof undefined && data.title !== false) {
$("#ptyShowDialogByRemoteContentDlg_title").text(data.title);
}
if (typeof data.content !== typeof undefined && data.content !== false) {
$("#ptyShowDialogByRemoteContentDlg_content").html(data.content);
}
$("#ptyShowDialogByRemoteContentDlg").fadeIn();
}
$(this).prop("disabled", false);
},
error: function (e) {
console.log("ERROR : ", e);
$(this).prop("disabled", false);
alert("요청이 실패되었습니다.");
}
});
});
var ptyShowDialog_positiveJsonUrl = '';
var ptyShowDialog_positiveUrl = '';
$(document).on('click', '.ptyShowDialog', function (e) {
e.preventDefault();
ptyShowDialog(
$(this).attr('titleContentUrl'),
$(this).attr('title'),
$(this).attr('content'),
$(this).attr('positiveTitle'),
$(this).attr('positiveUrl'),
$(this).attr('positiveJsonUrl')
);
});
function ptyIsNull(str) {
if (str == typeof undefined || typeof str == "undefined" || str == null)
return true;
else
return false;
}
function ptyIsEmpty(str) {
if (str == typeof undefined || typeof str == "undefined" || str == null || str == '')
return true;
else
return false;
}
function ptyShowDialog(titleContentUrl, title, content, positiveTitle, positiveUrl, positiveJsonUrl, positiveButton) {
if (!ptyIsEmpty(titleContentUrl)) {
$.getJSON(titleContentUrl, function (data) {
ptyShowDialog('', data.title, data.content, data.positiveTitle, data.positiveUrl, data.positiveJsonUrl, data.positiveButton);
return;
});
return;
}
console.log("positiveTitle = " + positiveTitle);
console.log("positiveButton = " + positiveButton);
$("#ptyShowDialogDlg_title").text(title);
if (ptyIsEmpty(content)) {
$("#ptyShowDialogDlg_content").css("display", "none");
}
else {
$("#ptyShowDialogDlg_content").attr('disabled', false);
$("#ptyShowDialogDlg_content").text(content);
}
if (ptyIsEmpty(positiveButton)) {
console.log("hide positive");
$("#ptyShowDialogDlg_positive").css("display", "none");
}
else {
console.log("show positive");
$("#ptyShowDialogDlg_positive").attr('disabled', false);
$("#ptyShowDialogDlg_positive").css("display", "inline");
$("#ptyShowDialogDlg_positive").replaceWith(positiveButton);
}
/*
else if (ptyIsNull(positiveTitle)) {
$("#ptyShowDialogDlg_positive").css("display", "none");
} else {
$("#ptyShowDialogDlg_positive").attr('disabled', false);
$("#ptyShowDialogDlg_positive").css("display", "inline");
$("#ptyShowDialogDlg_positive").text(positiveTitle);
}
*/
ptyShowDialog_positiveUrl = positiveUrl;
ptyShowDialog_positiveJsonUrl = positiveJsonUrl;
ptyShowDialog_positiveButton = positiveButton;
$("#ptyShowDialogDlg_content").html(content);
$("#ptyShowDialogDlg").modal();
}
$(document).on('click', '#ptyShowDialogDlg_positive', function (e) {
e.preventDefault();
$(this).attr('disabled', true);
console.log("clicked positive. ptyShowDialog_positiveUrl = " + ptyShowDialog_positiveUrl + ", ptyShowDialog_positiveJsonUrl = " + ptyShowDialog_positiveJsonUrl);
if (!ptyIsEmpty(ptyShowDialog_positiveUrl)) {
window.location.href = ptyShowDialog_positiveUrl;
}
else {
$.getJSON(ptyShowDialog_positiveJsonUrl, function (data) {
$("#ptyShowDialogDlg").modal('hide');
// console.log("data = ");
// console.log(data);
if (typeof data !== typeof undefined) {
if (typeof data.action !== typeof undefined && data.action !== false) {
if (data.action == "ptyShowDialog") {
ptyShowDialog(data.titleContentUrl, data.title, data.content, data.positiveTitle, data.positiveUrl, data.positiveJsonUrl);
return;
}
}
if (typeof data.script !== typeof undefined && data.script !== false) {
eval(data.script);
return;
}
if (typeof data.title !== typeof undefined && data.title !== false) {
$("#ptyShowDialogByRemoteContentDlg_title").text(data.title);
}
if (typeof data.content !== typeof undefined && data.content !== false) {
$("#ptyShowDialogByRemoteContentDlg_content").html(data.content);
}
// $("#ptyShowDialogByRemoteContentDlg").modal();
}
// }).success(function () {
// $('input:text:visible:first').focus();
});
}
});
/** /**
* 라디오 버튼에 값을 설정합니다 * 라디오 버튼에 값을 설정합니다
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment