Skip to content

Commit

Permalink
refs #1725 : enhanced - modal pop-up comment related windows.
Browse files Browse the repository at this point in the history
 -
  • Loading branch information
inureyes committed Dec 17, 2014
1 parent 470a15b commit 529855d
Show file tree
Hide file tree
Showing 13 changed files with 260 additions and 162 deletions.
7 changes: 5 additions & 2 deletions framework/id/textcube/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
define('TEXTCUBE_NAME', 'Textcube');
define('TEXTCUBE_VERSION_ID', '1.10.1');
define('TEXTCUBE_REVISION', 'root-main-branch1.10-r34');
define('TEXTCUBE_CODENAME', ': beta 2');
define('TEXTCUBE_CODENAME', ': beta 3');
define('TEXTCUBE_VERSION', TEXTCUBE_VERSION_ID.' : '.TEXTCUBE_CODENAME);
define('TEXTCUBE_COPYRIGHT', 'Copyright © 2004-2014. Needlworks / Tatter Network Foundation. All rights reserved. Licensed under the GPL.');
define('TEXTCUBE_HOMEPAGE', 'http://www.textcube.org/');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.10.0');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.10.1');
define('TEXTCUBE_NOTICE_URL','http://feeds.feedburner.com/textcube/');
define('CRLF', "\r\n");
define('TAB', " ");
define('INT_MAX',2147483647);
define('JQUERY_VERSION','1.11.1.min');
define('JQUERY_UI_VERSION','1.11.2.min');
define('JQUERY_BPOPUP_VERSION','0.10.0.min');

if( strstr( PHP_OS, "WIN") !== false ) {
define('DS', "\\");
} else {
Expand Down
152 changes: 80 additions & 72 deletions framework/legacy/Textcube.Function.Respond.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static function ResultPage($errorResult) {
print ("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<response>\n<error>$error</error>\n<message><![CDATA[$errorMsg]]></message></response>");
exit;
}

static function PrintResult($result, $useCDATA=true) {
header('Content-Type: text/xml; charset=utf-8');
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
Expand All @@ -31,105 +31,113 @@ static function PrintResult($result, $useCDATA=true) {
$xml .= "</response>\n";
die($xml);
}

static function NotFoundPage($isAjaxCall = false) {
if($isAjaxCall) {Respond::ResultPage(-1);exit;}
header('HTTP/1.1 404 Not Found');
header("Connection: close");
exit;
}

static function ForbiddenPage() {
header('HTTP/1.1 403 Forbidden');
header("Connection: close");
exit;
}

static function MessagePage($message) {
global $service;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php echo $service['path'];?>/resources/style/owner.css" />
</head>
<body id="body-message-page">
<div class="message-box">
<h1><?php echo TEXTCUBE_NAME;?></h1>

<div class="message"><?php echo $message;?></div>
<div class="button-box">
<input type="button" class="input-button" value="<?php echo _text('이전');?>" onclick="window.history.go(-1)" />
</div>
<!DOCTYPE html>
<html>
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="<?php echo $service['path'];?>/resources/style/owner.css" />
</head>
<body id="body-message-page">
<div class="message-box">
<h1><?php echo TEXTCUBE_NAME;?></h1>

<div class="message"><?php echo $message;?></div>
<div class="button-box">
<input type="button" class="input-button" value="<?php echo _text('이전');?>" onclick="window.history.go(-1)" />
</div>
</body>
</html>
<?php
</div>
</body>
</html>
<?php
exit;
}

static function AlertPage($message) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[
alert("<?php echo $message;?>");
//]]>
</script>
</head>
</html>
<?php
<!DOCTYPE html>
<html>
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
//<![CDATA[
alert("<?php echo $message;?>");
//]]>
</script>
</head>
</html>
<?php
exit;
}
static function ErrorPage($message=NULL, $buttonValue=NULL, $buttonLink=NULL, $isAjaxCall = false) {

static function ErrorPage($message=null, $buttonValue=null, $buttonLink=null, $isAjaxCall = false) {
global $service;
if($isAjaxCall) {Respond::ResultPage(-1);exit;}
if($isAjaxCall) {
Respond::ResultPage(-1);
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php echo $service['path'];?>/resources/style/owner.css" />
</head>
<body id="body-message-page">
<div class="message-box">
<h1><?php echo TEXTCUBE_NAME;?></h1>

<div class="message"><?php echo $message;?></div>
<div class="button-box">
<input type="button" class="input-button" value="<?php echo !empty($buttonValue) ? $buttonValue : _text('이전');?>" onclick="<?php echo !empty($buttonLink) ? 'window.location.href=\''.$buttonLink.'\'' : 'window.history.go(-1)';?>" />
</div>
<!DOCTYPE html>
<html>
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="<?php echo $service['path'];?>/resources/style/owner.css" />
<script type="text/javascript">
//<![CDATA[
var scope = (window.location !== window.parent.location ? window.parent : window);
//]]>
</script>
</head>
<body id="body-message-page">
<div class="message-box">
<h1><?php echo TEXTCUBE_NAME;?></h1>

<div class="message"><?php echo $message;?></div>
<div class="button-box">
<input type="button" class="input-button" value="<?php echo !empty($buttonValue) ? $buttonValue : _text('이전');?>" onclick="<?php echo !empty($buttonLink) ? 'scope.location.href=\''.$buttonLink.'\'' : 'scope.history.go(-1)';?>" />
</div>
</body>
</html>
</div>
</body>
</html>
<?php
exit;
}

static function NoticePage($message, $redirection) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[
alert("<?php echo $message;?>");
window.location.href = "<?php echo $redirection;?>";
//]]>
</script>
</head>
</html>
<?php
<!DOCTYPE html>
<html>
<head>
<title><?php echo TEXTCUBE_NAME;?></title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
//<![CDATA[
alert("<?php echo $message;?>");
window.location.href = "<?php echo $redirection;?>";
//]]>
</script>
</head>
</html>
<?php
exit;
}

Expand All @@ -155,7 +163,7 @@ static function PrintValue($array, $useCDATA=true) {
}
return $xml;
}

static function escapeJSInAttribute($str) {
return htmlspecialchars(str_replace(array('\\', '\r', '\n', '\''), array('\\\\', '\\r', '\\n', '\\\''), $str));
}
Expand Down
38 changes: 23 additions & 15 deletions interface/blog/comment/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

if (!Setting::getBlogSettingGlobal('acceptComments',0) && !doesHaveOwnership()) {
Respond::PrintResult(array('error' => 0, 'commentBlock' => '', 'recentCommentBlock' => ''));
exit;
exit;
}
if ((doesHaveMembership() || !empty($_POST['name'])) && !empty($_POST['comment']) && !empty($_POST['mode']) && ($_POST['mode'] == 'commit')) {
if (!empty($_POST['name']))
Expand Down Expand Up @@ -60,10 +60,10 @@
alert("<?php echo _text('본문을 입력해 주십시오.');?>");
//]]>
</script>
<?php
<?php
} else if (addComment($blogid, $comment) !== false) {
if(!$comment['secret']) {
if($row = POD::queryRow("SELECT * FROM {$database['prefix']}Entries
if($row = POD::queryRow("SELECT * FROM {$database['prefix']}Entries
WHERE blogid = $blogid AND id = {$comment['entry']} AND draft = 0 AND visibility = 3 AND acceptcomment = 1"))
sendCommentPing($comment['entry'], "$defaultURL/".($blog['useSloganOnPost'] ? "entry/{$row['slogan']}": $comment['entry']), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
}
Expand All @@ -73,7 +73,6 @@
<script type="text/javascript">
//<![CDATA[
alert("<?php echo _text('댓글이 등록되었습니다.');?>");

<?php
notifyComment();
$entry = array();
Expand All @@ -82,32 +81,41 @@
$tempComments = revertTempTags(removeAllTags(getCommentView($entry, $skin)));
$tempRecentComments = revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem));
?>
if (opener == null) {
loader = parent;
} else {
loader = opener;
}
try {
var obj = opener.document.getElementById("entry<?php echo $comment['entry'];?>Comment");
obj.innerHTML = "<?php echo str_innerHTML($tempComments);?>";
var obj = loader.document.getElementById("entry<?php echo $comment['entry'];?>Comment");
obj.innerHTML = "<?php echo str_innerHTML($tempComments);?>";
} catch(e) { }
try {
obj = opener.document.getElementById("recentComments");
obj.innerHTML = "<?php echo str_innerHTML($tempRecentComments);?>";
obj = loader.document.getElementById("recentComments");
obj.innerHTML = "<?php echo str_innerHTML($tempRecentComments);?>";
} catch(e) { }
try {
<?php
$commentCount = getCommentCount($blogid, $comment['entry']);
list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
$commentCount = ($commentCount > 0) ? "($commentCount)" : '';
?>
obj = opener.document.getElementById("commentCount<?php echo $comment['entry'];?>");
if (obj != null) obj.innerHTML = "<?php echo str_innerHTML($commentView);?>";
obj = loader.document.getElementById("commentCount<?php echo $comment['entry'];?>");
if (obj != null) obj.innerHTML = "<?php echo str_innerHTML($commentView);?>";
} catch(e) { }
try {
obj = opener.document.getElementById("commentCountOnRecentEntries<?php echo $comment['entry'];?>");
if (obj != null) obj.innerHTML = "<?php echo str_innerHTML($commentCount);?>";
obj = loader.document.getElementById("commentCountOnRecentEntries<?php echo $comment['entry'];?>");
if (obj != null) obj.innerHTML = "<?php echo str_innerHTML($commentCount);?>";
} catch(e) { }
try {
obj = opener.document.getElementById('list-form');
if(obj != null) opener.document.getElementById('list-form').submit();
obj = loader.document.getElementById('list-form');
if(obj != null) loader.document.getElementById('list-form').submit();
} catch(e) { }
window.close();
if (opener == null) {
parent.tcDialog.close();
} else {
window.close();
}
//]]>
</script>
<?php
Expand Down
Loading

0 comments on commit 529855d

Please sign in to comment.