';
ShowLayeredDialog(sHTML);
}
function get_excluded_window(sUser, sGuid) {
var sHTML = '';
var iExclude = exclude_get(sGuid);
var sClipChecked = '';
var sCommentChecked = '';
var sCommentingChecked = '';
if ((iExclude & 1) == 1) { sClipChecked = 'checked'; }
if ((iExclude & 2) == 2) { sCommentChecked = 'checked'; }
if ((iExclude & 4) == 4) { sCommentingChecked = 'checked'; }
sHTML += '
User Management
';
sHTML += '
';
sHTML += 'We are passionate about maintaining a positive, civil environment at Clipmarks. While the great majority of Clipmarks users treat each other with respect, there may be rare cases where you feel the need to protect yourself from malicious actions or personal attacks.
Here are a few tools you can use if you feel necessary in order to maintain a positive Clipmarks experience.';
sHTML += '
';
if (bAuth) {
sHTML += '
';
//sHTML += '
';
sHTML += '
';
sHTML += '
This option is intended for use in cases where you recognize a pattern of malicious behavior that makes it impossible for you to enjoy your Clipmarks experience. It is not intended to prevent opposing views or as a way to personally punish someone you don\'t agree with.
';
}
return sHTML;
}
function process_excluded(sGuid) {
var iExclude = 0;
iExclude = (document.getElementById('chkBlockComments').checked ? 2 : 0) + (document.getElementById('chkBlockCommenting').checked ? 4 : 0);
exclude_set(sGuid, iExclude);
if (iExclude != 4) {
window.location.reload(true);
}
}
function PostDeleteClipmark(bPermanent) {
action_post('GET', '/xml_action.aspx?action=' + (bPermanent ? 'delete_clip' : 'remove_library_clip') + '&c=' + sActiveClipGUID, null, true);
if (!!Action_XMLHTTP.responseXML && bPermanent) {
if (Action_XMLHTTP.responseXML.documentElement.getAttribute('error') == '1') {
alert('This clip could not be deleted because it has already had action on it in the public. To remove this clip from your own collection, please choose the "Remove from My Clips" option in the Edit menu below the clip.\n\nIf you need help, please email support@clipmarks.com');
return false;
}
}
window.location.href = window.location.href;
}
function action_clip_moderate() {
if (confirm('Are you sure you want to make this clip Public Limited? Doing so will keep it public on the user\'s page and in their clipcast but will remove it from all public areas of clipmarks.com. Clipmarks support will be notified about this clip and may take further action on it and/or the user who posted it.')) {
action_post('GET', '/xml_action.aspx?action=clip_moderate&c=' + sActiveClipGUID, null, true);
alert('This clip has been set to Public Limited. Thank you for helping to moderate the environment on Clipmarks.');
/*if (confirm('Would you like to reload the page?')) {
window.location.href = window.location.href;
}*/
}
}
function PostSubComments() {
if (!!document.getElementById('chkSubComments')) {
bSubComments = document.getElementById('chkSubComments').checked;
action_post('GET', '/xml_action.aspx?action=sub_com&sub=' + bSubComments + '&c=' + sActiveClipGUID, null, false);
if (bSubComments) {
ShowDialog(' You have subscribed to receive email notifications each time this clip is commented on.
To unsubscribe, uncheck the box at the bottom of this clipmark, or click the unsubscribe link located at the bottom of each comments email.
', 0, 0, false, null, 290, 180);
} else {
ShowDialog(' You will no longer receive email notifications each time this clip is commented on. ');
}
}
}
function user_watch(sUserGUID) {
action_post('GET', '/xml_action.aspx?action=user_watch&u=' + sUserGUID + '&r=' + escape(prompt('Reason for watching this user')), null, false);
}
function user_ban(sUserGUID, bReturn, bShowPosting, bReload) {
var sReason = prompt('Reason for banning this user\nNOTE: This action can\'t be undone!')
if (!!sReason && sReason != '') {
if (bShowPosting) {
ShowLayeredDialog('Banning user, please wait....');
}
action_post('GET', '/xml_action.aspx?action=user_ban&u=' + sUserGUID + '&r=' + escape(sReason), null, false, (!!bReload ? user_ban_callback : null));
if (bReturn) {
return true;
}
}
if (bReturn) {
return false;
}
}
function user_ban_callback() {
//window.location.href = window.location.href;
}
function user_nipsa(sUserGUID) {
action_post('GET', '/xml_action.aspx?action=user_nipsa&u=' + sUserGUID + '&r=' + escape(prompt('Reason you nipsa\'d this user')), null, false);
}
var dtCommentLastCall = new Date(1,1,1970);
var bCommentLoading = false;
var bCommentPosted = false;
var Comment_XMLHTTP = false;
var dtCommentLastCall = new Date(1,1,1970);
var iTry = 0;
var lCommentTimeout = 0;
var bCommentFacebook = false;
var oCharsRemaining = null;
Comment_Init();
function comments_unload() {
if (lCommentTimeout != 0) {
clearTimeout(lCommentTimeout);
lCommentTimeout = 0;
}
if (!!Comment_XMLHTTP && Comment_XMLHTTP.readyState != 4) {
Comment_XMLHTTP.abort();
Comment_XMLHTTP = null;
}
}
function UpdateCommentCharsLeft(oCommentField) {
var thisChars;
var charsLeft = 2000 - oCommentField.value.length;
var charStatus = '';
if (charsLeft >= 0) {
charStatus = '(' + charsLeft + ' characters remaining)';
} else {
charStatus = '
NOTE: You are over the 2000 character maximum. Please reduce your comment by ' + (charsLeft * -1) + ' characters.
';
}
if (!oCharsRemaining) {
oCharsRemaining = document.getElementById('charsRemain');
}
oCharsRemaining.innerHTML = charStatus;
}
function SubmitComment() {
if (!ValidateComment()) {
return false;
}
setTimeout('PostComment()', 100);
return true;
}
function PostComment() {
var sComment = document.frmComment.comment.value;
sComment = sComment.replace(/&/g, '&');
sComment = sComment.replace(/>/g, '>');
sComment = sComment.replace(/';
sHTML += '
';
oElement.innerHTML = sHTML;
dvComments.appendChild(oElement);
oElement = null;
if (!!document.getElementById('txtComment')) {
UpdateCommentCharsLeft(document.getElementById('txtComment'));
}
var lCommentsBottom = dvComments.offsetTop + dvComments.offsetHeight;
if (!bCommentPosted && document.body.scrollTop > 10 && lCommentsBottom > document.body.scrollTop && lCommentsBottom <= document.body.scrollTop + document.body.clientHeight) {
document.body.scrollTop = document.body.scrollTop + 75;
}
}
function ValidateComment() {
if (document.frmComment.comment.value.length == 0) {
alert('Before you can submit a comment you must enter text in the comment box!');
return false;
}
document.frmComment.btnSubmitComment.disabled = true;
return true;
}
function Comment_Init() {
// wait 5s before feed checking
if (lCommentTimeout != 0) {
clearTimeout(lCommentTimeout);
lCommentTimeout = 0;
}
lCommentTimeout = setTimeout('Comment_Update()', 10000);
}
function Comment_Update(sComment) {
if (sActiveClipGUID == '') {
return;
}
//alert('phase Ib');
if (lCommentTimeout != 0) {
clearTimeout(lCommentTimeout);
lCommentTimeout = 0;
}
if (bCommentLoading) {
if (!!sComment) {
lCommentTimeout = setTimeout('Comment_Update(\'' + sComment.replace(/\'/,'\\\'') + '\')', 500);
} else {
lCommentTimeout = setTimeout('Comment_Update()', 500);
}
return;
}
bCommentLoading = true;
Comment_XMLHTTP = CreateXMLHTTP();
if (!Comment_XMLHTTP) {
return;
}
Comment_XMLHTTP.onreadystatechange = Comment_XMLStateChange;
if (!!sComment) {
iTry = 1;
try {
//alert('debug2:' + bCommentFacebook);
Comment_XMLHTTP.open('POST', '/comment_save.aspx?' + (bCommentFacebook ? 'o=FBK&' : '') + 'permalink=' + bIsPermalink, true);
Comment_XMLHTTP.send('\n' + unescape(sComment) + '' + sActiveClipGUID + 'true');
} catch(e) { }
} else {
Comment_XMLHTTP.open('GET', '/comment_feed.aspx?clip=' + sActiveClipGUID, true);
//window.open('/comment_feed.aspx?clip=' + sActiveClipGUID);
Comment_XMLHTTP.send(null);
}
}
function Comment_XMLStateChange() {
if (Comment_XMLHTTP.readyState != 4) {
return;
}
if (!Comment_XMLHTTP.responseXML || !Comment_XMLHTTP.responseXML.documentElement) {
if (bCommentPosted && iTry == 1) {
iTry = 0;
Comment_XMLHTTP.abort();
Comment_XMLHTTP = null;
bCommentLoading = false;
document.frmComment.btnSubmitComment.disabled = false;
bCommentPosted = false;
alert('Whoops. Looks like a connection problem has occured. This comment was not posted. Please check your connection and try again.');
}
return;
}
var xmlComment = Comment_XMLHTTP.responseXML.documentElement;
var oComments = null;
if (GetAttribute(xmlComment, 'error', '0') != '0') {
ShowDialog('
Hold your comments
To try to maintain balance on the Clipmarks site, there are some limits on the number of comments each user can post within certain time periods.
You will be able to comment again in ' + GetAttribute(xmlComment, 'timeout-minutes', '30') + ' minutes.
', 0, 0, false, null, 300, 190);
document.frmComment.btnSubmitComment.disabled = false;
bCommentPosted = false;
}
if (xmlComment.childNodes.length > 0) {
oComments = xmlComment.childNodes[0];
OutputComments(oComments);
}
Comment_XMLHTTP = null;
bCommentLoading = false;
if (lCommentTimeout == 0) {
lCommentTimeout = setTimeout('Comment_Update()', 60000);
}
}
function OutputComments(oComments) {
var oComment = null;
for (i = 0; i < oComments.childNodes.length; i++) {
oComment = oComments.childNodes[i];
if (bFacebookApp) {
// InsertFbComment(sUsername, sUserImage, sDate, sTime, sComment, iFbData, iFbId) {
var sDisplayName = oComment.childNodes[1].childNodes[0].nodeValue;
var sDisplaySrc = oComment.childNodes[4].childNodes[0].nodeValue;
var iFbData = 0;
var iFbId = 0;
if (oComment.childNodes[1].getAttribute('fbdata') == '1') {
sDisplayName = oComment.childNodes[1].getAttribute('fbname');
sDisplaySrc = oComment.childNodes[1].getAttribute('fbsrc');
if (sDisplaySrc.length == 0) { sDisplaySrc = 'http://static.ak.facebook.com/pics/q_default.gif'; }
iFbData = 1;
iFbId = oComment.childNodes[1].getAttribute('fbid');
}
//alert(oComment.childNodes[1].getAttribute('fbdata'));
InsertFbComment(sDisplayName, sDisplaySrc, oComment.childNodes[2].childNodes[0].nodeValue, oComment.childNodes[3].childNodes[0].nodeValue, oComment.childNodes[0].childNodes[0].nodeValue, iFbData, iFbId);
} else {
InsertComment(oComment.childNodes[1].childNodes[0].nodeValue, oComment.childNodes[4].childNodes[0].nodeValue, oComment.childNodes[2].childNodes[0].nodeValue, oComment.childNodes[3].childNodes[0].nodeValue, oComment.childNodes[0].childNodes[0].nodeValue, oComments.childNodes.length == i+1);
}
}
if (bCommentPosted) {
ScrollToBottom();
document.frmComment.comment.value = '';
document.frmComment.btnSubmitComment.disabled = false;
bCommentPosted = false;
}
}
function OpenPreview() {
var popW = 410;
var popH = 360;
var popX = parseInt((document.body.clientWidth - popW) / 2);
var popY = parseInt((document.body.clientHeight - popH) / 2);
var oPreviewWindow = window.open('/comment_preview.aspx?mode=1', 'Preview_Comment', 'width=' + popW + ',height=' + popH + ',top=' + popY + ',left=' + popX + ',resizable=yes,scrollbars=no');
oPreviewWindow.focus();
}
function OpenRTF(sGUID, sTitle) {
var popW = 410;
var popH = 356;
var popX = parseInt((document.body.clientWidth - popW) / 2);
var popY = parseInt((document.body.clientHeight - popH) / 2);
var oRTFWindow = window.open('/rtf_popup.aspx?guid=' + sGUID + '&ttl=' + escape(sTitle), 'Popup_RTF', 'width=' + popW + ',height=' + popH + ',top=' + popY + ',left=' + popX + ',resizable=yes,scrollbars=no');
oRTFWindow.focus();
}
function ShowFullText(iCommentId) {
document.getElementById('dvFullComment' + iCommentId).style.display='block';
document.getElementById('dvShortComment' + iCommentId).style.display='none';
}
function HideFullText(iCommentId) {
document.getElementById('dvFullComment' + iCommentId).style.display='none';
document.getElementById('dvShortComment' + iCommentId).style.display='block';
}
function DeleteComment(sCommentGUID, dvCommentHead, bClipper) {
if (!confirm('Are you sure you want to remove this comment? Please only remove comments that appear to be spam or that you believe to be unquestionably outside the bounds of civility. Clipmarks support will be notified about this comment and may take further action on it and/or the user who posted it.')) {
return;
}
var Action_XMLHTTP = CreateXMLHTTP();
Action_XMLHTTP.open("GET", "/xml_action.aspx?action=comment_remove&guid=" + sCommentGUID, false);
Action_XMLHTTP.send(null);
if (bClipper) {
dvCommentHead.innerHTML = '
— Comment removed by clipper —
';
} else {
dvCommentHead.innerHTML = '
— Comment removed by moderator —
';
}
dvCommentHead.nextSibling.innerHTML = '';
alert('This comment has been removed. Thank you for helping to moderate the environment on Clipmarks.');
}var xmlDialogHTTP = null;
var xmlDialog = null;
var oDialog = null;
var bDialogLoading = true;
var sPopGuid = null;
var sFollowedClipper = null;
var bBlockWindowOpen = false;
var bNoPop = false;
var bDatabaseWork = true;
var bFromPop = false;
var sDialogURL = '';
function dialog_load(sDialog, sParams, bNested) {
ShowLayeredDialog(null, 500, 350, bNested, true);
var fraDialogLoad = document.getElementById('fraDialogLoad');
if (!fraDialogLoad) {
fraDialogLoad = document.createElement('IFRAME');
fraDialogLoad.id = 'fraDialogLoad';
fraDialogLoad.setAttribute('name', 'fraDialogLoad');
fraDialogLoad.style.position = 'absolute';
fraDialogLoad.style.left = '-1000px';
fraDialogLoad.style.top = '-1000px';
fraDialogLoad.style.visibility = 'hidden';
fraDialogLoad.src = '/dialogs.aspx?d=' + sDialog + (!!sParams ? '&' + sParams : '');
document.body.appendChild(fraDialogLoad)
return;
}
window.frames['fraDialogLoad'].location.href = '/dialogs.aspx?d=' + sDialog + (!!sParams ? '&' + sParams : '');
}
function dialog_popped_open(sGUID, bPop, bFromPopAction) {
bDialogLoading = true;
bNoPop = bPop;
bFromPop = (!!bFromPopAction);
dialog_load('WhoPopped', 'c=' + sGUID + '&fp=' + bFromPop.toString());
}
function PopDialog() {
ShowDialog('What is a Pop?
When a user pops a clip it gets sent to the top of the clipmarks home page for other visitors to see. This creates a real-time community filter for promoting interesting clips. To ensure quality information in small portions, only clips that are under 1,000 characters can be popped.
', null, null, null, null, null, 190);
}
function BlogOverLimit(sGuid) {
ShowDialog(' Sorry, this clipmark can not be blogged because it exceeds the publishing limit of 1000 characters. ', null, null, null, null, null, 120);
}
function NoConnectionDialog() {
var sHTML = 'A connection error has occured.
Please check your connection and try again.';
if (bDatabaseWork) {
sHTML = 'We are currently doing work on the database.
Please try again in a few minutes.';
}
ShowDialog(sHTML, null, null, null, null, null, 180);
}
function ShowLayeredDialog(sHTML, lWidth, lHeight, bNested, bShare) {
HideScrollbars();
HideOpenMenus(true);
bNested = !!bNested;
var sDialogID = (!bNested ? 'dvDialogContent' : 'dvDialogNested');
if (!lHeight) {
lHeight = 352;
}
if (!lWidth) {
lWidth = 700;
}
var dvDialogBlackout = CreateIfNone('dvDialogBlackout', 'DIV');
var dvDialogContent = CreateIfNone(sDialogID, 'DIV');
dvDialogBlackout.style.height = document.body.scrollHeight + 'px';
if (!is_opera) {
dvDialogBlackout.style.display = 'block';
}
if (!sHTML) {
sHTML = '