inital commit

This commit is contained in:
2026-06-19 20:08:01 +06:00
commit 8a5abeeae4
13128 changed files with 3192007 additions and 0 deletions

View File

@@ -0,0 +1,571 @@
$(function ($) {
'use strict';
var mybbCmd = {
align: ['left', 'center', 'right', 'justify'],
fsStr: ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'],
fSize: [9, 12, 15, 17, 23, 31],
video: {
'Dailymotion': {
'match': /(dailymotion\.com\/video\/|dai\.ly\/)([^\/]+)/,
'url': '//www.dailymotion.com/embed/video/',
'html': '<iframe frameborder="0" width="480" height="270" src="{url}" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Facebook': {
'match': /facebook\.com\/(?:photo.php\?v=|video\/video.php\?v=|video\/embed\?video_id=|v\/?)(\d+)/,
'url': 'https://www.facebook.com/video/embed?video_id=',
'html': '<iframe src="{url}" width="625" height="350" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Liveleak': {
'match': /liveleak\.com\/(?:view\?[a-z]=)([^\/]+)/,
'url': 'http://www.liveleak.com/ll_embed?i=',
'html': '<iframe width="500" height="300" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'MetaCafe': {
'match': /metacafe\.com\/watch\/([^\/]+)/,
'url': 'http://www.metacafe.com/embed/',
'html': '<iframe src="{url}" width="440" height="248" frameborder=0 data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Mixer': {
'match': /mixer\.com\/([^\/]+)/,
'url': '//mixer.com/embed/player/',
'html': '<iframe allowfullscreen="true" src="{url}" width="620" height="349" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Vemio': {
'match': /vimeo.com\/(\d+)($|\/)/,
'url': '//player.vimeo.com/video/',
'html': '<iframe src="{url}" width="500" height="281" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Youtube': {
'match': /(?:v=|v\/|embed\/|youtu\.be\/)(.{11})/,
'url': '//www.youtube.com/embed/',
'html': '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Twitch': {
'match': /twitch\.tv\/(?:[\w+_-]+)\/v\/(\d+)/,
'url': '//player.twitch.tv/?video=v',
'html': '<iframe src="{url}" frameborder="0" scrolling="no" height="378" width="620" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
}
}
};
// Add custom MyBB CSS
$('<style type="text/css">' +
'.sceditor-dropdown { text-align: ' + ($('body').css('direction') === 'rtl' ? 'right' : 'left') + '; }' +
'</style>').appendTo('body');
// Update editor to use align= as alignment
$.sceditor.formats.bbcode
.set('align', {
html: function (element, attrs, content) {
return '<div align="' + (attrs.defaultattr || 'left') + '">' + content + '</div>';
},
isInline: false
});
$.each(mybbCmd.align, function (i, val) {
$.sceditor.formats.bbcode.set(val, {
format: '[align=' + val + ']{0}[/align]'
});
$.sceditor.command
.set(val, {
txtExec: ['[align=' + val + ']', '[/align]']
});
});
// Update font to support MyBB's BBCode dialect
$.sceditor.formats.bbcode
.set('list', {
html: function (element, attrs, content) {
var type = (attrs.defaultattr === '1' ? 'ol' : 'ul');
if (attrs.defaultattr === 'a')
type = 'ol type="a"';
return '<' + type + '>' + content + '</' + type + '>';
},
breakAfter: false
})
.set('ul', {
format: '[list]{0}[/list]'
})
.set('ol', {
format: function ($elm, content) {
var type = ($($elm).attr('type') === 'a' ? 'a' : '1');
return '[list=' + type + ']' + content + '[/list]';
}
})
.set('li', {
format: '[*]{0}',
excludeClosing: true
})
.set('*', {
excludeClosing: true,
isInline: true
});
$.sceditor.command
.set('bulletlist', {
txtExec: ['[list]\n[*]', '\n[/list]']
})
.set('orderedlist', {
txtExec: ['[list=1]\n[*]', '\n[/list]']
});
// Update size tag to use xx-small-xx-large instead of 1-7
$.sceditor.formats.bbcode.set('size', {
format: function ($elm, content) {
var fontSize,
size = $($elm).attr('size');
if (!size) {
fontSize = $($elm).css('fontSize');
// Most browsers return px value but IE returns 1-7
if (fontSize.indexOf('px') > -1) {
// convert size to an int
fontSize = parseInt(fontSize);
size = 1;
$.each(mybbCmd.fSize, function (i, val) {
if (fontSize > val) size = i + 2;
});
} else {
size = (~~fontSize) + 1;
}
size = (size >= 7) ? mybbCmd.fsStr[6] : ((size <= 1) ? mybbCmd.fsStr[0] : mybbCmd.fsStr[size - 1]);
} else {
size = mybbCmd.fsStr[size - 1];
}
return '[size=' + size + ']' + content + '[/size]';
},
html: function (token, attrs, content) {
var size = $.inArray(attrs.defaultattr, mybbCmd.fsStr) + 1;
if (!isNaN(attrs.defaultattr)) {
size = attrs.defaultattr;
if (size > 7)
size = 7;
if (size < 1)
size = 1;
}
if (size < 0) {
size = 0;
}
return '<font data-scefontsize="' + attrs.defaultattr + '" size="' + size + '">' + content + '</font>';
}
});
$.sceditor.command.set('size', {
_dropDown: function (editor, caller, callback) {
var content = $('<div />'),
clickFunc = function (e) {
callback($(this).data('size'));
editor.closeDropDown(true);
e.preventDefault();
};
for (var i = 1; i <= 7; i++)
content.append($('<a class="sceditor-fontsize-option" data-size="' + i + '" href="#"><font size="' + i + '">' + i + '</font></a>').on('click', clickFunc));
editor.createDropDown(caller, 'fontsize-picker', content.get(0));
},
exec: function (caller) {
var editor = this;
$.sceditor.command.get('size')._dropDown(
editor,
caller,
function (fontSize) {
editor.execCommand('fontsize', fontSize);
}
);
},
txtExec: function (caller) {
var editor = this;
$.sceditor.command.get('size')._dropDown(
editor,
caller,
function (size) {
size = (~~size);
size = (size > 7) ? 7 : ((size < 1) ? 1 : size);
editor.insertText('[size=' + mybbCmd.fsStr[size - 1] + ']', '[/size]');
}
);
}
});
// Update quote to support pid and dateline
$.sceditor.formats.bbcode.set('quote', {
format: function (element, content) {
var author = '',
$elm = $(element),
$cite = $elm.children('cite').first();
$cite.html($cite.text());
if ($cite.length === 1 || $elm.data('author')) {
author = $cite.text() || $elm.data('author');
$elm.data('author', author);
$cite.remove();
content = this.elementToBbcode(element);
author = '=' + author.replace(/(^\s+|\s+$)/g, '');
$elm.prepend($cite);
}
if ($elm.data('pid'))
author += " pid='" + $elm.data('pid') + "'";
if ($elm.data('dateline'))
author += " dateline='" + $elm.data('dateline') + "'";
return '[quote' + author + ']' + content + '[/quote]';
},
html: function (token, attrs, content) {
var data = '';
if (attrs.pid)
data += ' data-pid="' + attrs.pid + '"';
if (attrs.dateline)
data += ' data-dateline="' + attrs.dateline + '"';
if (typeof attrs.defaultattr !== "undefined")
content = '<cite>' + attrs.defaultattr.replace(/ /g, '&nbsp;') + '</cite>' + content;
return '<blockquote' + data + '>' + content + '</blockquote>';
},
quoteType: function (val, name) {
return "'" + val.replace("'", "\\'") + "'";
},
breakStart: true,
breakEnd: true
});
// Update font tag to allow limiting to only first in stack
$.sceditor.formats.bbcode.set('font', {
format: function (element, content) {
var font;
if (element.nodeName.toLowerCase() !== 'font' || !(font = $(element).attr('face')))
font = $(element).css('font-family');
if (typeof font == 'string' && font != '' && font != 'defaultattr') {
return '[font=' + this.stripQuotes(font) + ']' + content + '[/font]';
} else {
return content;
}
},
html: function (token, attrs, content) {
if (typeof attrs.defaultattr == 'string' && attrs.defaultattr != '' && attrs.defaultattr != '{defaultattr}') {
return '<font face="' +
attrs.defaultattr +
'">' + content + '</font>';
} else {
return content;
}
}
});
// Add MyBB PHP command
$.sceditor.formats.bbcode.set('php', {
allowsEmpty: true,
isInline: false,
allowedChildren: ['#', '#newline'],
format: '[php]{0}[/php]',
html: '<code class="phpcodeblock">{0}</code>'
});
$.sceditor.command.set("php", {
_dropDown: function (editor, caller) {
var $content;
$content = $(
'<div>' +
'<div>' +
'<label for="php">' + editor._('PHP') + ':</label> ' +
'<textarea type="text" id="php" />' +
'</div>' +
'<div><input type="button" class="button" value="' + editor._('Insert') + '" /></div>' +
'</div>'
);
setTimeout(function () {
$content.find('#php').trigger('focus');
}, 100);
$content.find('.button').on('click', function (e) {
var val = $content.find('#php').val(),
before = '[php]',
end = '[/php]';
if (val) {
before = before + val + end;
end = null;
}
editor.insert(before, end);
editor.closeDropDown(true);
e.preventDefault();
});
editor.createDropDown(caller, 'insertphp', $content.get(0));
},
exec: function (caller) {
if ($.trim(this.getRangeHelper().selectedRange())) {
this.insert('[php]', '[/php]');
return;
}
$.sceditor.command.get('php')._dropDown(this, caller);
},
txtExec: ['[php]', '[/php]'],
tooltip: "PHP"
});
// Update code to support PHP
$.sceditor.formats.bbcode.set('code', {
allowsEmpty: true,
tags: {
code: null
},
isInline: false,
allowedChildren: ['#', '#newline'],
format: function (element, content) {
if ($(element).hasClass('phpcodeblock')) {
return '[php]' + content + '[/php]';
}
return '[code]' + content + '[/code]';
},
html: '<code>{0}</code>'
});
$.sceditor.command.set("code", {
_dropDown: function (editor, caller) {
var $content;
$content = $(
'<div>' +
'<div>' +
'<label for="code">' + editor._('Code') + ':</label> ' +
'<textarea type="text" id="code" />' +
'</div>' +
'<div><input type="button" class="button" value="' + editor._('Insert') + '" /></div>' +
'</div>'
);
setTimeout(function () {
$content.find('#code').trigger('focus');
}, 100);
$content.find('.button').on('click', function (e) {
var val = $content.find('#code').val(),
before = '[code]',
end = '[/code]';
if (val) {
before = before + val + end;
end = null;
}
editor.insert(before, end);
editor.closeDropDown(true);
e.preventDefault();
});
editor.createDropDown(caller, 'insertcode', $content.get(0));
},
exec: function (caller) {
if ($.trim(this.getRangeHelper().selectedRange())) {
this.insert('[code]', '[/code]');
return;
}
$.sceditor.command.get('code')._dropDown(this, caller);
},
txtExec: ['[code]', '[/code]'],
});
// Update email to support description
$.sceditor.command.set('email', {
_dropDown: function (editor, caller) {
var $content;
$content = $(
'<div>' +
'<div>' +
'<label for="email">' + editor._('E-mail:') + '</label> ' +
'<input type="text" id="email" />' +
'</div>' +
'<div>' +
'<label for="des">' + editor._('Description (optional):') + '</label> ' +
'<input type="text" id="des" />' +
'</div>' +
'<div><input type="button" class="button" value="' + editor._('Insert') + '" /></div>' +
'</div>'
);
$content.find('.button').on('click', function (e) {
var val = $content.find('#email').val(),
description = $content.find('#des').val();
if (val) {
// needed for IE to reset the last range
$(editor).trigger('focus');
if (!editor.getRangeHelper().selectedHtml() || description) {
if (!description)
description = val;
editor.insert('[email=' + val + ']' + description + '[/email]');
} else
editor.execCommand('createlink', 'mailto:' + val);
}
editor.closeDropDown(true);
e.preventDefault();
});
editor.createDropDown(caller, 'insertemail', $content.get(0));
},
exec: function (caller) {
$.sceditor.command.get('email')._dropDown(this, caller);
}
});
// Add MyBB video command
$.sceditor.formats.bbcode.set('video', {
allowsEmpty: true,
allowedChildren: ['#', '#newline'],
tags: {
iframe: {
'data-mybb-vt': null
}
},
format: function ($element, content) {
return '[video=' + $($element).data('mybb-vt') + ']' + $($element).data('mybb-vsrc') + '[/video]';
},
html: function (token, attrs, content) {
var params = mybbCmd.video[Object.keys(mybbCmd.video).find(key => key.toLowerCase() === attrs.defaultattr)];
var matches, url;
var n = (attrs.defaultattr == 'dailymotion') ? 2 : 1;
if (params['html']) {
matches = content.match(params['match']);
url = matches ? params['url'] + matches[n] : false;
}
if (url) {
return params['html'].replace('{url}', url).replace('{src}', content).replace('{type}', attrs.defaultattr);
}
return $.sceditor.escapeEntities(token.val + content + (token.closing ? token.closing.val : ''));
}
});
$.sceditor.command.set('video', {
_dropDown: function (editor, caller) {
var $content, videourl, videotype, videoOpts;
$.each(mybbCmd.video, function (provider, data) {
videoOpts += '<option value="' + provider.toLowerCase() + '">' + editor._(provider) + '</option>';
});
$content = $(
'<div>' +
'<div>' +
'<label for="videotype">' + editor._('Video Type:') + '</label> ' +
'<select id="videotype">' + videoOpts + '</select>' +
'</div>' +
'<div>' +
'<label for="link">' + editor._('Video URL:') + '</label> ' +
'<input type="text" id="videourl" value="http://" />' +
'</div>' +
'<div><input type="button" class="button" value="' + editor._('Insert') + '" /></div>' +
'</div>'
);
$content.find('.button').on('click', function (e) {
videourl = $content.find('#videourl').val();
videotype = $content.find('#videotype').val();
if (videourl !== '' && videourl !== 'http://')
editor.insert('[video=' + videotype + ']' + videourl + '[/video]');
editor.closeDropDown(true);
e.preventDefault();
});
editor.createDropDown(caller, 'insertvideo', $content.get(0));
},
exec: function (caller) {
$.sceditor.command.get('video')._dropDown(this, caller);
},
txtExec: function (caller) {
$.sceditor.command.get('video')._dropDown(this, caller);
},
tooltip: 'Insert a video'
});
// Remove last bits of table, superscript/subscript, youtube and ltr/rtl support
$.sceditor.command
.remove('table').remove('subscript').remove('superscript').remove('youtube').remove('ltr').remove('rtl');
$.sceditor.formats.bbcode
.remove('table').remove('tr').remove('th').remove('td').remove('sub').remove('sup').remove('youtube').remove('ltr').remove('rtl');
// Remove code and quote if in partial mode
if (partialmode) {
$.sceditor.formats.bbcode.remove('code').remove('php').remove('quote').remove('video').remove('img');
$.sceditor.command
.set('image', {
exec: function (caller) {
var editor = this,
content = $(this._('<form><div><label for="link">{0}</label> <input type="text" id="image" value="http://" /></div>' +
'<div><label for="width">{1}</label> <input type="text" id="width" size="2" /></div>' +
'<div><label for="height">{2}</label> <input type="text" id="height" size="2" /></div></form>',
this._("URL:"),
this._("Width (optional):"),
this._("Height (optional):")
))
.submit(function () {
return false;
});
content.append($(this._('<div><input type="button" class="button" value="Insert" /></div>',
this._("Insert")
)).on('click', function (e) {
var $form = $(this).parent('form'),
val = $form.find('#image').val(),
width = $form.find('#width').val(),
height = $form.find('#height').val(),
attrs = '';
if (width && height) {
attrs = '=' + width + 'x' + height;
}
if (val && val !== 'http://') {
editor.wysiwygEditorInsertHtml('[img' + attrs + ']' + val + '[/img]');
}
editor.closeDropDown(true);
e.preventDefault();
}));
editor.createDropDown(caller, 'insertimage', content.get(0));
}
})
.set('quote', {
exec: function () {
this.insert('[quote]', '[/quote]');
}
});
}
// Fix url code
$.sceditor.formats.bbcode.set('url', {
html: function (token, attrs, content) {
if (!attrs.defaultattr)
attrs.defaultattr = content;
return '<a href="' + $.sceditor.escapeUriScheme($.sceditor.escapeEntities(attrs.defaultattr)) + '">' + content + '</a>';
}
});
});

View File

@@ -0,0 +1,39 @@
var captcha = {
refresh: function()
{
var imagehash_value = $('#imagehash').val();
$.ajax(
{
url: 'xmlhttp.php?action=refresh_captcha&imagehash='+imagehash_value,
method: 'get',
dataType: 'json',
complete: function (request)
{
captcha.refresh_complete(request);
}
});
return false;
},
refresh_complete: function(request)
{
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.captcha_fetch_failure + ' ' + message, {theme:'jgrowl_error'});
});
}
else if(json.imagehash)
{
$("#captcha_img").attr("src", "captcha.php?action=regimage&imagehash=" + json.imagehash);
$('#imagehash').val(json.imagehash);
}
$('#imagestring').removeClass('error valid').val('').prop('aria-invalid', null).removeData('previousValue')
.next('label').remove();
}
};

View File

@@ -0,0 +1,784 @@
var MyBB = {
init: function()
{
$(function()
{
MyBB.pageLoaded();
});
return true;
},
pageLoaded: function()
{
expandables.init();
/* Create the Check All feature */
$('[name="allbox"]').each(function(key, value) {
var allbox = this;
var checked = $(this).is(':checked');
var checkboxes = $(this).closest('form').find(':checkbox').not('[name="allbox"]');
checkboxes.on('change', function() {
if(checked && !$(this).prop('checked'))
{
checked = false;
$(allbox).trigger('change', ['item']);
}
});
$(this).on('change', function(event, origin) {
checked = $(this).is(':checked');
if(typeof(origin) == "undefined")
{
checkboxes.each(function() {
if(checked != $(this).is(':checked'))
{
$(this).prop('checked', checked).trigger('change');
}
});
}
});
});
// Initialise "initial focus" field if we have one
var initialfocus = $(".initial_focus");
if(initialfocus.length)
{
initialfocus.trigger('focus');
}
if(typeof(use_xmlhttprequest) != "undefined" && use_xmlhttprequest == 1)
{
mark_read_imgs = $(".ajax_mark_read");
mark_read_imgs.each(function()
{
var element = $(this);
if(element.hasClass('forum_off') || element.hasClass('forum_offclose') || element.hasClass('forum_offlink') || element.hasClass('subforum_minioff') || element.hasClass('subforum_minioffclose') || element.hasClass('subforum_miniofflink') || (element.attr("title") && element.attr("title") == lang.no_new_posts)) return;
element.on('click', function()
{
MyBB.markForumRead(this);
});
element.css("cursor", "pointer");
if(element.attr("title"))
{
element.attr("title", element.attr("title") + " - ");
}
element.attr("title", element.attr("title") + lang.click_mark_read);
});
}
if(typeof $.modal !== "undefined")
{
$(document).on($.modal.OPEN, function(event, modal) {
$("body").css("overflow", "hidden");
if(initialfocus.length > 0)
{
initialfocus.trigger('focus');
}
});
$(document).on($.modal.CLOSE, function(event, modal) {
$("body").css("overflow", "auto");
});
}
$("a.referralLink").on('click', MyBB.showReferrals);
if($('.author_avatar').length)
{
$(".author_avatar img").on('error', function () {
$(this).unbind("error").closest('.author_avatar').remove();
});
}
},
popupWindow: function(url, options, root)
{
if(!options) options = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }
if(root != true)
url = rootpath + url;
$.get(url, function(html)
{
$(html).appendTo('body').modal(options);
});
},
prompt: function(message, options)
{
var defaults = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) };
var buttonsText = '';
for (var i in options.buttons)
{
buttonsText += templates.modal_button.replace('__title__', options.buttons[i].title);
}
var html = templates.modal.replace('__buttons__', buttonsText).replace('__message__', message);
var modal = $(html);
modal.modal($.extend(defaults, options));
var buttons = modal.find('.modal_buttons > .button');
buttons.on('click', function(e)
{
e.preventDefault();
var index = $(this).index();
if (options.submit(e, options.buttons[index].value) == false)
return;
$.modal.close();
});
if (buttons[0])
{
modal.on($.modal.OPEN, function()
{
$(buttons[0]).trigger('focus');
});
}
return modal;
},
deleteEvent: function(eid)
{
MyBB.prompt(deleteevent_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
var form = $("<form />",
{
method: "post",
action: "calendar.php",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "action",
type: "hidden",
value: "do_deleteevent"
})
);
if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}
form.append(
$("<input />",
{
name: "eid",
type: "hidden",
value: eid
})
);
form.append(
$("<input />",
{
name: "delete",
type: "hidden",
value: 1
})
);
$("body").append(form);
form.trigger('submit');
}
}
});
},
reputation: function(uid, pid)
{
if(!pid)
{
var pid = 0;
}
MyBB.popupWindow("/reputation.php?action=add&uid="+uid+"&pid="+pid+"&modal=1");
},
viewNotes: function(uid)
{
MyBB.popupWindow("/member.php?action=viewnotes&uid="+uid+"&modal=1");
},
getIP: function(pid)
{
MyBB.popupWindow("/moderation.php?action=getip&pid="+pid+"&modal=1");
},
getPMIP: function(pmid)
{
MyBB.popupWindow("/moderation.php?action=getpmip&pmid="+pmid+"&modal=1");
},
deleteReputation: function(uid, rid)
{
MyBB.prompt(delete_reputation_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
var form = $("<form />",
{
method: "post",
action: "reputation.php?action=delete",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "rid",
type: "hidden",
value: rid
})
);
if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}
form.append(
$("<input />",
{
name: "uid",
type: "hidden",
value: uid
})
);
$("body").append(form);
form.trigger('submit');
}
}
});
return false;
},
whoPosted: function(tid, sortby)
{
var sort = "", url, body;
if(typeof sortby === "undefined")
{
sortby = "";
}
if(sortby == "username")
{
sort = "&sort=" + sortby;
}
url = "/misc.php?action=whoposted&tid="+tid+sort+"&modal=1";
// if the modal is already open just replace the contents
if($.modal.isActive())
{
// don't waste a query if we are already sorted correctly
if(sortby == MyBB.whoPostedSort)
{
return;
}
MyBB.whoPostedSort = sortby;
$.get(rootpath + url, function(html)
{
// just replace the inner div
body = $(html).children("div");
$("div.modal").children("div").replaceWith(body);
});
return;
}
MyBB.whoPostedSort = "";
MyBB.popupWindow(url);
},
markForumRead: function(event)
{
var element = $(event);
if(!element.length)
{
return false;
}
var fid = element.attr("id").replace("mark_read_", "");
if(!fid)
{
return false;
}
$.ajax(
{
url: 'misc.php?action=markread&fid=' + fid + '&ajax=1&my_post_key=' + my_post_key,
async: true,
success: function (request)
{
MyBB.forumMarkedRead(fid, request);
}
});
},
forumMarkedRead: function(fid, request)
{
if(request == 1)
{
var markreadfid = $("#mark_read_"+fid);
if(markreadfid.hasClass('subforum_minion'))
{
markreadfid.removeClass('subforum_minion').addClass('subforum_minioff');
}
else
{
markreadfid.removeClass('forum_on').addClass('forum_off');
}
markreadfid.css("cursor", "default").attr("title", lang.no_new_posts);
}
},
unHTMLchars: function(text)
{
text = text.replace(/&lt;/g, "<");
text = text.replace(/&gt;/g, ">");
text = text.replace(/&nbsp;/g, " ");
text = text.replace(/&quot;/g, "\"");
text = text.replace(/&amp;/g, "&");
return text;
},
HTMLchars: function(text)
{
text = text.replace(new RegExp("&(?!#[0-9]+;)", "g"), "&amp;");
text = text.replace(/</g, "&lt;");
text = text.replace(/>/g, "&gt;");
text = text.replace(/"/g, "&quot;");
return text;
},
changeLanguage: function()
{
form = $("#lang_select");
if(!form.length)
{
return false;
}
form.trigger('submit');
},
changeTheme: function()
{
form = $("#theme_select");
if(!form.length)
{
return false;
}
form.trigger('submit');
},
detectDSTChange: function(timezone_with_dst)
{
var date = new Date();
var local_offset = date.getTimezoneOffset() / 60;
if(Math.abs(parseInt(timezone_with_dst) + local_offset) == 1)
{
$.ajax(
{
url: 'misc.php?action=dstswitch&ajax=1',
async: true,
method: 'post',
error: function (request)
{
if(use_xmlhttprequest != 1)
{
var form = $("<form />",
{
method: "post",
action: "misc.php",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "action",
type: "hidden",
value: "dstswitch"
})
);
$("body").append(form);
form.trigger('submit');
}
}
});
}
},
dismissPMNotice: function(bburl)
{
var pm_notice = $("#pm_notice");
if(!pm_notice.length)
{
return false;
}
if(use_xmlhttprequest != 1)
{
return true;
}
$.ajax(
{
type: 'post',
url: bburl + 'private.php?action=dismiss_notice',
data: { ajax: 1, my_post_key: my_post_key },
async: true
});
pm_notice.remove();
return false;
},
submitReputation: function(uid, pid, del)
{
// Get form, serialize it and send it
var datastring = $(".reputation_"+uid+"_"+pid).serialize();
if(del == 1)
datastring = datastring + '&delete=1';
$.ajax({
type: "POST",
url: "reputation.php?modal=1",
data: datastring,
dataType: "html",
success: function(data) {
// Replace modal HTML (we have to access by class because the modals are appended to the end of the body, and when we get by class we get the last element of that class - which is what we want)
$(".modal_"+uid+"_"+pid).fadeOut('slow', function() {
$(".modal_"+uid+"_"+pid).html(data);
$(".modal_"+uid+"_"+pid).fadeIn('slow');
$(".modal").fadeIn('slow');
});
},
error: function(){
alert(lang.unknown_error);
}
});
return false;
},
deleteAnnouncement: function(data)
{
MyBB.prompt(announcement_quickdelete_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
window.location=data.href.replace('action=delete_announcement','action=do_delete_announcement');
}
}
});
return false;
},
showReferrals: function(e)
{
var idPieces, uid;
e.preventDefault();
if(typeof this.id == "undefined")
{
return false;
}
idPieces = this.id.split("_");
uid = parseInt(idPieces[idPieces.length - 1], 10);
if(uid <= 0)
{
return false;
}
MyBB.popupWindow("/xmlhttp.php?action=get_referrals&uid="+uid);
},
// Fixes https://github.com/mybb/mybb/issues/1232
select2: function()
{
if(typeof $.fn.select2 !== "undefined")
{
$.extend($.fn.select2.defaults, {
formatMatches: function (matches) {
if(matches == 1)
{
return lang.select2_match;
}
else
{
return lang.select2_matches.replace('{1}',matches);
}
},
formatNoMatches: function () {
return lang.select2_nomatches;
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if( n == 1)
{
return lang.select2_inputtooshort_single;
}
else
{
return lang.select2_inputtooshort_plural.replace('{1}', n);
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if( n == 1)
{
return lang.select2_inputtoolong_single;
}
else
{
return lang.select2_inputtoolong_plural.replace('{1}', n);
}
},
formatSelectionTooBig: function (limit) {
if( limit == 1)
{
return lang.select2_selectiontoobig_single;
}
else
{
return lang.select2_selectiontoobig_plural.replace('{1}', limit);
}
},
formatLoadMore: function (pageNumber) {
return lang.select2_loadmore;
},
formatSearching: function () {
return lang.select2_searching;
}
});
}
}
};
var Cookie = {
get: function(name)
{
name = cookiePrefix + name;
return Cookies.get(name);
},
set: function(name, value, expires)
{
name = cookiePrefix + name;
if(!expires)
{
expires = 315360000; // 10*365*24*60*60 => 10 years
}
expire = new Date();
expire.setTime(expire.getTime()+(expires*1000));
options = {
expires: expire,
path: cookiePath,
domain: cookieDomain,
secure: cookieSecureFlag == true,
};
return Cookies.set(name, value, options);
},
unset: function(name)
{
name = cookiePrefix + name;
options = {
path: cookiePath,
domain: cookieDomain
};
return Cookies.remove(name, options);
}
};
var expandables = {
init: function()
{
var expanders = $(".expcolimage .expander");
if(expanders.length)
{
expanders.each(function()
{
var expander = $(this);
if(expander.attr("id") == false)
{
return;
}
expander.on('click', function()
{
controls = expander.attr("id").replace("_img", "");
expandables.expandCollapse(this, controls);
});
if(MyBB.browser == "ie")
{
expander.css("cursor", "hand");
}
else
{
expander.css("cursor", "pointer");
}
});
}
},
expandCollapse: function(e, controls)
{
element = $(e);
if(!element || controls == false)
{
return false;
}
var expandedItem = $("#"+controls+"_e");
var collapsedItem = $("#"+controls+"_c");
if(expandedItem.length && collapsedItem.length)
{
// Expanding
if(expandedItem.is(":hidden"))
{
expandedItem.toggle("fast");
collapsedItem.toggle("fast");
this.saveCollapsed(controls);
}
// Collapsing
else
{
expandedItem.toggle("fast");
collapsedItem.toggle("fast");
this.saveCollapsed(controls, 1);
}
}
else if(expandedItem.length && !collapsedItem.length)
{
// Expanding
if(expandedItem.is(":hidden"))
{
expandedItem.toggle("fast");
element.attr("src", element.attr("src").replace(/collapse_collapsed\.(gif|jpg|jpeg|bmp|png)$/i, "collapse.$1"))
.attr("alt", "[-]")
.attr("title", "[-]");
element.parent().parent('td').removeClass('tcat_collapse_collapsed');
element.parent().parent('.thead').removeClass('thead_collapsed');
this.saveCollapsed(controls);
}
// Collapsing
else
{
expandedItem.toggle("fast");
element.attr("src", element.attr("src").replace(/collapse\.(gif|jpg|jpeg|bmp|png)$/i, "collapse_collapsed.$1"))
.attr("alt", "[+]")
.attr("title", "[+]");
element.parent().parent('td').addClass('tcat_collapse_collapsed');
element.parent().parent('.thead').addClass('thead_collapsed');
this.saveCollapsed(controls, 1);
}
}
return true;
},
saveCollapsed: function(id, add)
{
var saved = [];
var newCollapsed = [];
var collapsed = Cookie.get('collapsed');
if(collapsed)
{
saved = collapsed.split("|");
$.each(saved, function(intIndex, objValue)
{
if(objValue != id && objValue != "")
{
newCollapsed[newCollapsed.length] = objValue;
}
});
}
if(add == 1)
{
newCollapsed[newCollapsed.length] = id;
}
Cookie.set('collapsed', newCollapsed.join("|"));
}
};
/* Lang this! */
var lang = {
};
/* add keepelement to jquery-modal plugin */
(function($) {
if(typeof $.modal != 'undefined')
{
$.modal.defaults.keepelement = false;
$.modal.prototype.oldCloseFunction = $.modal.prototype.close;
$.modal.prototype.close = function()
{
this.oldCloseFunction();
// Deletes the element (multi-modal feature: e.g. when you click on multiple report buttons, you will want to see different content for each)
if(!this.options.keepelement)
{
this.$elm.remove();
}
};
}
})(jQuery);
MyBB.init();

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

View File

@@ -0,0 +1,90 @@
var inlineEditor = {
timeouts: [],
init: function()
{
$(function()
{
inlineEditor.bindSubjects();
});
},
bindSubjects: function()
{
$('.subject_editable').each(function()
{
// Take tid out of the id attribute
id = $(this).attr('id');
tid = id.replace( /[^\d.]/g, '');
$(this).editable("xmlhttp.php?action=edit_subject&my_post_key=" + my_post_key + "&tid=" + tid,
{
indicator: spinner,
type: "text",
submit: '',
cancel: '',
tooltip: lang.inline_edit_description,
onblur: "submit",
event: "hold"+tid,
callback: function(values, settings)
{
id = $(this).attr('id');
tid = id.replace( /[^\d.]/g, '');
values = JSON.parse(values);
if(typeof values == 'object')
{
if(values.hasOwnProperty("errors"))
{
$.each(values.errors, function(i, message)
{
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'});
});
$(this).html($('#tid_' + tid + '_temp').html());
}
else
{
// Change subject
$(this).html(values.subject);
}
}
$('#tid_' + tid + '_temp').remove();
},
data: function(value, settings)
{
return $(value).text();
}
});
// Hold event
$(this).on("mousedown", function(e)
{
// Take tid out of the id attribute
id = $(this).attr('id');
tid = id.replace( /[^\d.]/g, '');
// We may click again in the textbox and we'd be adding a new (invalid) clone - we don't want that!
if(!$('#tid_' + tid + '_temp').length)
$(this).clone().attr('id','tid_' + tid + '_temp').hide().appendTo("body");
inlineEditor.timeouts[tid] = setTimeout(inlineEditor.jeditableTimeout, 700, tid);
});
$(this).on('mouseup mouseleave', function()
{
window.clearTimeout(inlineEditor.timeouts[tid]);
});
});
return false;
},
jeditableTimeout : function(tid)
{
$('#tid_' + tid).trigger("hold" + tid);
$('#tid_' + tid + ' input').width('98%');
}
};
inlineEditor.init();

View File

@@ -0,0 +1,423 @@
var inlineModeration = {
init: function()
{
if(!inlineType || !inlineId)
{
return false;
}
inlineModeration.cookieName = 'inlinemod_'+inlineType+inlineId;
var inputs = $('input');
if(!inputs.length)
{
return false;
}
var inlineIds = inlineModeration.getCookie(inlineModeration.cookieName);
var removedIds = inlineModeration.getCookie(inlineModeration.cookieName+'_removed');
var allChecked = true;
$(inputs).each(function() {
var element = $(this);
if((element.attr('name') != 'allbox') && (element.attr('type') == 'checkbox') && (element.attr('id')) && (element.attr('id').split('_')[0] == 'inlinemod'))
{
$(element).on('click', inlineModeration.checkItem);
}
if(element.attr('id'))
{
var inlineCheck = element.attr('id').split('_');
var id = inlineCheck[1];
if(inlineCheck[0] == 'inlinemod')
{
if(inlineIds.indexOf(id) != -1 || (inlineIds.indexOf('ALL') != -1 && removedIds.indexOf(id) == -1))
{
element.prop('checked', true);
var post = element.parents('.post');
var thread = element.parents('.inline_row');
var fieldset = element.parents('fieldset');
if(post.length)
{
post.addClass('trow_selected');
}
else if(thread.length)
{
thread.addClass('trow_selected');
}
if(fieldset.length)
{
fieldset.addClass('inline_selected');
}
}
else
{
element.prop('checked', false);
var post = element.parents('.post');
var thread = element.parents('.inline_row');
if(post.length)
{
post.removeClass('trow_selected');
}
else if(thread.length)
{
thread.removeClass('trow_selected');
}
}
allChecked = false;
}
}
});
inlineModeration.updateCookies(inlineIds, removedIds);
if(inlineIds.indexOf('ALL') != -1 && removedIds.length == 0)
{
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.show();
}
}
else if(inlineIds.indexOf('ALL') == -1 && allChecked == true)
{
var selectRow = $('#selectAllrow');
if(selectRow)
{
selectRow.show();
}
}
return true;
},
checkItem: function()
{
var element = $(this);
if(!element || !element.attr('id'))
{
return false;
}
var inlineCheck = element.attr('id').split('_');
var id = inlineCheck[1];
if(!id)
{
return false;
}
var inlineIds = inlineModeration.getCookie(inlineModeration.cookieName);
var removedIds = inlineModeration.getCookie(inlineModeration.cookieName+'_removed');
if(element.prop('checked') == true)
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineModeration.addId(inlineIds, id);
}
else
{
removedIds = inlineModeration.removeId(removedIds, id);
if(removedIds.length == 0)
{
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.show();
}
}
}
var post = element.parents('.post');
var thread = element.parents('.inline_row');
if(post.length)
{
post.addClass('trow_selected');
}
else if(thread.length)
{
thread.addClass('trow_selected');
}
}
else
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineModeration.removeId(inlineIds, id);
var selectRow = $('#selectAllrow');
if(selectRow)
{
selectRow.hide();
}
}
else
{
removedIds = inlineModeration.addId(removedIds, id);
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.hide();
}
}
var post = element.parents('.post');
var thread = element.parents('.inline_row');
if(post.length)
{
post.removeClass('trow_selected');
}
else if(thread.length)
{
thread.removeClass('trow_selected');
}
}
inlineModeration.updateCookies(inlineIds, removedIds);
return true;
},
clearChecked: function()
{
$('#selectAllrow').hide();
$('#allSelectedrow').hide();
var inputs = $('input');
if(!inputs.length)
{
return false;
}
$(inputs).each(function() {
var element = $(this);
if(!element.val()) return;
if(element.attr('type') == 'checkbox' && ((element.attr('id') && element.attr('id').split('_')[0] == 'inlinemod') || element.attr('name') == 'allbox'))
{
element.prop('checked', false);
}
});
$('.trow_selected').each(function() {
$(this).removeClass('trow_selected');
});
$('fieldset.inline_selected').each(function() {
$(this).removeClass('inline_selected');
});
$('#inline_go').val(go_text+' (0)');
Cookie.unset(inlineModeration.cookieName);
Cookie.unset(inlineModeration.cookieName + '_removed');
return true;
},
checkAll: function(master)
{
inputs = $('input');
master = $(master);
if(!inputs.length)
{
return false;
}
var inlineIds = inlineModeration.getCookie(inlineModeration.cookieName);
var removedIds = inlineModeration.getCookie(inlineModeration.cookieName+'_removed');
var newIds = new Array();
$(inputs).each(function() {
var element = $(this);
if(!element.val() || !element.attr('id')) return;
inlineCheck = element.attr('id').split('_');
if((element.attr('name') != 'allbox') && (element.attr('type') == 'checkbox') && (inlineCheck[0] == 'inlinemod'))
{
var id = inlineCheck[1];
var changed = (element.prop('checked') != master.prop('checked'));
var post = element.parents('.post');
var fieldset = element.parents('fieldset');
var thread = element.parents('.inline_row');
if(post.length)
{
if(master.prop('checked') == true)
{
post.addClass('trow_selected');
}
else
{
post.removeClass('trow_selected');
}
}
else if(thread.length)
{
if(master.prop('checked') == true)
{
thread.addClass('trow_selected');
}
else
{
thread.removeClass('trow_selected');
}
}
if(fieldset.length)
{
if(master.prop('checked') == true)
{
fieldset.addClass('inline_selected');
}
else
{
fieldset.removeClass('inline_selected');
}
}
if(changed)
{
element.trigger('click');
if(master.prop('checked') == true)
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineModeration.addId(inlineIds, id);
}
else
{
removedIds = inlineModeration.removeId(removedIds, id);
}
}
else
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineModeration.removeId(inlineIds, id);
}
else
{
removedIds = inlineModeration.addId(removedIds, id);
}
}
}
}
});
var count = inlineModeration.updateCookies(inlineIds, removedIds);
if(count < all_text)
{
var selectRow = $('#selectAllrow');
if(selectRow.length)
{
if(master.prop('checked') == true)
{
selectRow.show();
}
else
{
selectRow.hide();
}
}
}
if(inlineIds.indexOf('ALL') == -1 || removedIds.length != 0)
{
$('#allSelectedrow').hide();
}
else if(inlineIds.indexOf('ALL') != -1 && removedIds.length == 0)
{
$('#allSelectedrow').show();
}
},
selectAll: function()
{
inlineModeration.updateCookies(new Array('ALL'), new Array());
$('#selectAllrow').hide();
$('#allSelectedrow').show();
},
getCookie: function(name)
{
var inlineCookie = Cookie.get(name);
var ids = new Array();
if(inlineCookie)
{
var inlineIds = inlineCookie.split('|');
$.each(inlineIds, function(index, item) {
if(item != '' && item != null)
{
ids.push(item);
}
});
}
return ids;
},
setCookie: function(name, array)
{
if(array.length != 0)
{
var data = '|'+array.join('|')+'|';
Cookie.set(name, data, 60 * 60 * 1000);
}
else
{
Cookie.unset(name);
}
},
updateCookies: function(inlineIds, removedIds)
{
if(inlineIds.indexOf('ALL') != -1)
{
var count = all_text - removedIds.length;
}
else
{
var count = inlineIds.length;
}
if(count < 0)
{
count = 0;
}
$('#inline_go').val(go_text+' ('+count+')');
if(count == 0)
{
inlineModeration.clearChecked();
}
else
{
inlineModeration.setCookie(inlineModeration.cookieName, inlineIds);
inlineModeration.setCookie(inlineModeration.cookieName+'_removed', removedIds);
}
return count;
},
addId: function(array, id)
{
if(array.indexOf(id) == -1)
{
array.push(id);
}
return array;
},
removeId: function(array, id)
{
var position = array.indexOf(id);
if(position != -1)
{
array.splice(position, 1);
}
return array;
}
};
$(inlineModeration.init);

View File

@@ -0,0 +1,361 @@
var inlineReports = {
init: function()
{
inlineReports.cookieName = 'inlinereports';
var inputs = $('input');
if(!inputs.length)
{
return false;
}
var inlineIds = inlineReports.getCookie(inlineReports.cookieName);
var removedIds = inlineReports.getCookie(inlineReports.cookieName+'_removed');
var allChecked = true;
$(inputs).each(function() {
var element = $(this);
if((element.attr('name') != 'allbox') && (element.attr('type') == 'checkbox') && (element.attr('id')) && (element.attr('id').split('_')[0] == 'reports'))
{
$(element).on('click', inlineReports.checkItem);
}
if(element.attr('id'))
{
var inlineCheck = element.attr('id').split('_');
var id = inlineCheck[1];
if(inlineCheck[0] == 'reports')
{
if(inlineIds.indexOf(id) != -1 || (inlineIds.indexOf('ALL') != -1 && removedIds.indexOf(id) == -1))
{
element.prop('checked', true);
var report = element.parents('.inline_row');
if(report.length)
{
report.addClass('trow_selected');
}
}
else
{
element.prop('checked', false);
var report = element.parents('.inline_row');
if(report.length)
{
report.removeClass('trow_selected');
}
}
allChecked = false;
}
}
});
inlineReports.updateCookies(inlineIds, removedIds);
if(inlineIds.indexOf('ALL') != -1 && removedIds.length == 0)
{
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.show();
}
}
else if(inlineIds.indexOf('ALL') == -1 && allChecked == true)
{
var selectRow = $('#selectAllrow');
if(selectRow)
{
selectRow.show();
}
}
return true;
},
checkItem: function()
{
var element = $(this);
if(!element || !element.attr('id'))
{
return false;
}
var inlineCheck = element.attr('id').split('_');
var id = inlineCheck[1];
if(!id)
{
return false;
}
var inlineIds = inlineReports.getCookie(inlineReports.cookieName);
var removedIds = inlineReports.getCookie(inlineReports.cookieName+'_removed');
if(element.prop('checked') == true)
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineReports.addId(inlineIds, id);
}
else
{
removedIds = inlineReports.removeId(removedIds, id);
if(removedIds.length == 0)
{
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.show();
}
}
}
var report = element.parents('.inline_row');
if(report.length)
{
report.addClass('trow_selected');
}
}
else
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineReports.removeId(inlineIds, id);
var selectRow = $('#selectAllrow');
if(selectRow)
{
selectRow.hide();
}
}
else
{
removedIds = inlineReports.addId(removedIds, id);
var allSelectedRow = $('#allSelectedrow');
if(allSelectedRow)
{
allSelectedRow.hide();
}
}
var report = element.parents('.inline_row');
if(report.length)
{
report.removeClass('trow_selected');
}
}
inlineReports.updateCookies(inlineIds, removedIds);
return true;
},
clearChecked: function()
{
$('#selectAllrow').hide();
$('#allSelectedrow').hide();
var inputs = $('input');
if(!inputs.length)
{
return false;
}
$(inputs).each(function() {
var element = $(this);
if(!element.val()) return;
if(element.attr('type') == 'checkbox' && ((element.attr('id') && element.attr('id').split('_')[0] == 'reports') || element.attr('name') == 'allbox'))
{
element.prop('checked', false);
}
});
$('.trow_selected').each(function() {
$(this).removeClass('trow_selected');
});
$('#inline_read').val(mark_read_text+' (0)');
Cookie.unset(inlineReports.cookieName);
Cookie.unset(inlineReports.cookieName + '_removed');
return true;
},
checkAll: function(master)
{
inputs = $('input');
master = $(master);
if(!inputs.length)
{
return false;
}
var inlineIds = inlineReports.getCookie(inlineReports.cookieName);
var removedIds = inlineReports.getCookie(inlineReports.cookieName+'_removed');
var newIds = new Array();
$(inputs).each(function() {
var element = $(this);
if(!element.val() || !element.attr('id')) return;
inlineCheck = element.attr('id').split('_');
if((element.attr('name') != 'allbox') && (element.attr('type') == 'checkbox') && (inlineCheck[0] == 'reports'))
{
var id = inlineCheck[1];
var changed = (element.prop('checked') != master.prop('checked'));
element.prop('checked', master.prop('checked'));
var report = element.parents('.inline_row');
if(report.length)
{
if(master.prop('checked') == true)
{
report.addClass('trow_selected');
}
else
{
report.removeClass('trow_selected');
}
}
if(changed)
{
if(master.prop('checked') == true)
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineReports.addId(inlineIds, id);
}
else
{
removedIds = inlineReports.removeId(removedIds, id);
}
}
else
{
if(inlineIds.indexOf('ALL') == -1)
{
inlineIds = inlineReports.removeId(inlineIds, id);
}
else
{
removedIds = inlineReports.addId(removedIds, id);
}
}
}
}
});
var count = inlineReports.updateCookies(inlineIds, removedIds);
if(count < all_text)
{
var selectRow = $('#selectAllrow');
if(selectRow.length)
{
if(master.prop('checked') == true)
{
selectRow.show();
}
else
{
selectRow.hide();
}
}
}
if(inlineIds.indexOf('ALL') == -1 || removedIds.length != 0)
{
$('#allSelectedrow').hide();
}
else if(inlineIds.indexOf('ALL') != -1 && removedIds.length == 0)
{
$('#allSelectedrow').show();
}
},
selectAll: function()
{
inlineReports.updateCookies(new Array('ALL'), new Array());
$('#selectAllrow').hide();
$('#allSelectedrow').show();
},
getCookie: function(name)
{
var inlineCookie = Cookie.get(name);
var ids = new Array();
if(inlineCookie)
{
var inlineIds = inlineCookie.split('|');
$.each(inlineIds, function(index, item) {
if(item != '' && item != null)
{
ids.push(item);
}
});
}
return ids;
},
setCookie: function(name, array)
{
if(array.length != 0)
{
var data = '|'+array.join('|')+'|';
Cookie.set(name, data, 60 * 60 * 1000);
}
else
{
Cookie.unset(name);
}
},
updateCookies: function(inlineIds, removedIds)
{
if(inlineIds.indexOf('ALL') != -1)
{
var count = all_text - removedIds.length;
}
else
{
var count = inlineIds.length;
}
if(count < 0)
{
count = 0;
}
$('#inline_read').val(mark_read_text+' ('+count+')');
if(count == 0)
{
inlineReports.clearChecked();
}
else
{
inlineReports.setCookie(inlineReports.cookieName, inlineIds);
inlineReports.setCookie(inlineReports.cookieName+'_removed', removedIds);
}
return count;
},
addId: function(array, id)
{
if(array.indexOf(id) == -1)
{
array.push(id);
}
return array;
},
removeId: function(array, id)
{
var position = array.indexOf(id);
if(position != -1)
{
array.splice(position, 1);
}
return array;
}
};
$(inlineReports.init);

View File

@@ -0,0 +1,38 @@
(function($){$.fn.editable=function(target,options){if('disable'==target){$(this).data('disabled.editable',true);return;}
if('enable'==target){$(this).data('disabled.editable',false);return;}
if('destroy'==target){$(this).unbind($(this).data('event.editable')).removeData('disabled.editable').removeData('event.editable');return;}
var settings=$.extend({},$.fn.editable.defaults,{target:target},options);var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types['defaults'].buttons;var content=$.editable.types[settings.type].content||$.editable.types['defaults'].content;var element=$.editable.types[settings.type].element||$.editable.types['defaults'].element;var reset=$.editable.types[settings.type].reset||$.editable.types['defaults'].reset;var callback=settings.callback||function(){};var onedit=settings.onedit||function(){};var onsubmit=settings.onsubmit||function(){};var onreset=settings.onreset||function(){};var onerror=settings.onerror||reset;if(settings.tooltip){$(this).attr('title',settings.tooltip);}
settings.autowidth='auto'==settings.width;settings.autoheight='auto'==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();$(this).data('event.editable',settings.event);if(!$.trim($(this).html())){$(this).html(settings.placeholder);}
$(this).bind(settings.event,function(e){if(true===$(this).data('disabled.editable')){return;}
if(self.editing){return;}
if(false===onedit.apply(this,[settings,self])){return;}
e.preventDefault();e.stopPropagation();if(settings.tooltip){$(self).removeAttr('title');}
if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight;}else{if(settings.width!='none'){settings.width=settings.autowidth?$(self).width():settings.width;}
if(settings.height!='none'){settings.height=settings.autoheight?$(self).height():settings.height;}}
if($(this).html().toLowerCase().replace(/(;|")/g,'')==settings.placeholder.toLowerCase().replace(/(;|")/g,'')){$(this).html('');}
self.editing=true;self.revert=$(self).html();$(self).html('');var form=$('<form />');if(settings.cssclass){if('inherit'==settings.cssclass){form.attr('class',$(self).attr('class'));}else{form.attr('class',settings.cssclass);}}
if(settings.style){if('inherit'==settings.style){form.attr('style',$(self).attr('style'));form.css('display',$(self).css('display'));}else{form.attr('style',settings.style);}}
var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self]);},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]));}else{$.extend(loaddata,settings.loaddata);}
$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false;}});}else if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings]);}}else{input_content=self.revert;}
content.apply(form,[input_content,settings,self]);input.attr('name',settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(':input:visible:enabled:first',form).focus();if(settings.select){input.select();}
input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self]);}});var t;if('cancel'==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self]);},500);});}else if('submit'==settings.onblur){input.blur(function(e){t=setTimeout(function(){form.submit();},200);});}else if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings]);});}else{input.blur(function(e){});}
form.submit(function(e){if(t){clearTimeout(t);}
e.preventDefault();if(false!==onsubmit.apply(form,[settings,self])){if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]));}else{$.extend(submitdata,settings.submitdata);}
if('PUT'==settings.method){submitdata['_method']='put';}
$(self).html(settings.indicator);var ajaxoptions={type:'POST',data:submitdata,dataType:'html',url:settings.target,success:function(result,status){if(ajaxoptions.dataType=='html'){$(self).html(result);}
self.editing=false;callback.apply(self,[result,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}},error:function(xhr,status,error){onerror.apply(form,[settings,self,xhr]);}};$.extend(ajaxoptions,settings.ajaxoptions);$.ajax(ajaxoptions);}}}
$(self).attr('title',settings.tooltip);return false;});});this.reset=function(form){if(this.editing){if(false!==onreset.apply(form,[settings,self])){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder);}
if(settings.tooltip){$(self).attr('title',settings.tooltip);}}}};});};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden"></input>');$(this).append(input);return(input);},content:function(string,settings,original){$(':input:first',this).val(string);},reset:function(settings,original){original.reset(this);},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){if(submit.attr("type")!="submit"){form.submit();}});}else{var submit=$('<button type="submit" />');submit.html(settings.submit);}
$(this).append(submit);}
if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel);}else{var cancel=$('<button type="cancel" />');cancel.html(settings.cancel);}
$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset;}else{var reset=$.editable.types['defaults'].reset;}
reset.apply(form,[settings,original]);return false;});}}},text:{element:function(settings,original){var input=$('<input />');if(settings.width!='none'){input.width(settings.width);}
if(settings.height!='none'){input.height(settings.height);}
input.attr('autocomplete','off');$(this).append(input);return(input);}},textarea:{element:function(settings,original){var textarea=$('<textarea />');if(settings.rows){textarea.attr('rows',settings.rows);}else if(settings.height!="none"){textarea.height(settings.height);}
if(settings.cols){textarea.attr('cols',settings.cols);}else if(settings.width!="none"){textarea.width(settings.width);}
$(this).append(textarea);return(textarea);}},select:{element:function(settings,original){var select=$('<select />');$(this).append(select);return(select);},content:function(data,settings,original){if(String==data.constructor){eval('var json = '+data);}else{var json=data;}
for(var key in json){if(!json.hasOwnProperty(key)){continue;}
if('selected'==key){continue;}
var option=$('<option />').val(key).append(json[key]);$('select',this).append(option);}
$('select',this).children().each(function(){if($(this).val()==json['selected']||$(this).text()==$.trim(original.revert)){$(this).attr('selected','selected');}});}}},addInputType:function(name,input){$.editable.types[name]=input;}};$.fn.editable.defaults={name:'value',id:'id',type:'text',width:'auto',height:'auto',event:'click.editable',onblur:'cancel',loadtype:'GET',loadtext:'Loading...',placeholder:'Click to edit',loaddata:{},submitdata:{},ajaxoptions:{}};})(jQuery);

2
webroot/forum/jscripts/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,734 @@
/**
* jGrowl 1.4.5
*
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Written by Stan Lemon <stosh1985@gmail.com>
* Last updated: 2015.02.01
*/
(function($) {
/** jGrowl Wrapper - Establish a base jGrowl Container for compatibility with older releases. **/
$.jGrowl = function( m , o ) {
// To maintain compatibility with older version that only supported one instance we'll create the base container.
if ( $('#jGrowl').length === 0 )
$('<div id="jGrowl"></div>').addClass( (o && o.position) ? o.position : $.jGrowl.defaults.position ).appendTo( (o && o.appendTo) ? o.appendTo : $.jGrowl.defaults.appendTo );
// Create a notification on the container.
$('#jGrowl').jGrowl(m,o);
};
/** Raise jGrowl Notification on a jGrowl Container **/
$.fn.jGrowl = function( m , o ) {
// Short hand for passing in just an object to this method
if ( o === undefined && $.isPlainObject(m) ) {
o = m;
m = o.message;
}
if ( $.isFunction(this.each) ) {
var args = arguments;
return this.each(function() {
/** Create a jGrowl Instance on the Container if it does not exist **/
if ( $(this).data('jGrowl.instance') === undefined ) {
$(this).data('jGrowl.instance', $.extend( new $.fn.jGrowl(), { notifications: [], element: null, interval: null } ));
$(this).data('jGrowl.instance').startup( this );
}
/** Optionally call jGrowl instance methods, or just raise a normal notification **/
if ( $.isFunction($(this).data('jGrowl.instance')[m]) ) {
$(this).data('jGrowl.instance')[m].apply( $(this).data('jGrowl.instance') , $.makeArray(args).slice(1) );
} else {
$(this).data('jGrowl.instance').create( m , o );
}
});
}
};
$.extend( $.fn.jGrowl.prototype , {
/** Default JGrowl Settings **/
defaults: {
pool: 0,
header: '',
group: '',
sticky: false,
position: 'top-right',
appendTo: 'body',
glue: 'after',
theme: 'default',
themeState: 'highlight',
corners: '10px',
check: 250,
life: 3000,
closeDuration: 'normal',
openDuration: 'normal',
easing: 'swing',
closer: true,
closeTemplate: '&times;',
closerTemplate: '<div>[ close all ]</div>',
log: function() {},
beforeOpen: function() {},
afterOpen: function() {},
open: function() {},
beforeClose: function() {},
close: function() {},
click: function() {},
animateOpen: {
opacity: 'show'
},
animateClose: {
opacity: 'hide'
}
},
notifications: [],
/** jGrowl Container Node **/
element: null,
/** Interval Function **/
interval: null,
/** Create a Notification **/
create: function( message , options ) {
var o = $.extend({}, this.defaults, options);
/* To keep backward compatibility with 1.24 and earlier, honor 'speed' if the user has set it */
if (typeof o.speed !== 'undefined') {
o.openDuration = o.speed;
o.closeDuration = o.speed;
}
this.notifications.push({ message: message , options: o });
o.log.apply( this.element , [this.element,message,o] );
},
render: function( n ) {
var self = this;
var message = n.message;
var o = n.options;
// Support for jQuery theme-states, if this is not used it displays a widget header
o.themeState = (o.themeState === '') ? '' : 'ui-state-' + o.themeState;
var notification = $('<div/>')
.addClass('jGrowl-notification alert ' + o.themeState + ' ui-corner-all' + ((o.group !== undefined && o.group !== '') ? ' ' + o.group : ''))
.append($('<button/>').addClass('jGrowl-close').html(o.closeTemplate))
.append($('<div/>').addClass('jGrowl-header').html(o.header))
.append($('<div/>').addClass('jGrowl-message').html(message))
.data("jGrowl", o).addClass(o.theme).children('.jGrowl-close').bind("click.jGrowl", function() {
$(this).parent().trigger('jGrowl.beforeClose');
return false;
})
.parent();
/** Notification Actions **/
$(notification).bind("mouseover.jGrowl", function() {
$('.jGrowl-notification', self.element).data("jGrowl.pause", true);
}).bind("mouseout.jGrowl", function() {
$('.jGrowl-notification', self.element).data("jGrowl.pause", false);
}).bind('jGrowl.beforeOpen', function() {
if ( o.beforeOpen.apply( notification , [notification,message,o,self.element] ) !== false ) {
$(this).trigger('jGrowl.open');
}
}).bind('jGrowl.open', function() {
if ( o.open.apply( notification , [notification,message,o,self.element] ) !== false ) {
if ( o.glue == 'after' ) {
$('.jGrowl-notification:last', self.element).after(notification);
} else {
$('.jGrowl-notification:first', self.element).before(notification);
}
$(this).animate(o.animateOpen, o.openDuration, o.easing, function() {
// Fixes some anti-aliasing issues with IE filters.
if ($.support.opacity === false)
this.style.removeAttribute('filter');
if ( $(this).data("jGrowl") !== null && typeof $(this).data("jGrowl") !== 'undefined') // Happens when a notification is closing before it's open.
$(this).data("jGrowl").created = new Date();
$(this).trigger('jGrowl.afterOpen');
});
}
}).bind('jGrowl.afterOpen', function() {
o.afterOpen.apply( notification , [notification,message,o,self.element] );
}).bind('click', function() {
o.click.apply( notification, [notification,message,o,self.element] );
}).bind('jGrowl.beforeClose', function() {
if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) !== false )
$(this).trigger('jGrowl.close');
}).bind('jGrowl.close', function() {
// Pause the notification, lest during the course of animation another close event gets called.
$(this).data('jGrowl.pause', true);
$(this).animate(o.animateClose, o.closeDuration, o.easing, function() {
if ( $.isFunction(o.close) ) {
if ( o.close.apply( notification , [notification,message,o,self.element] ) !== false )
$(this).remove();
} else {
$(this).remove();
}
});
}).trigger('jGrowl.beforeOpen');
/** Optional Corners Plugin **/
if ( o.corners !== '' && $.fn.corner !== undefined ) $(notification).corner( o.corners );
/** Add a Global Closer if more than one notification exists **/
if ($('.jGrowl-notification:parent', self.element).length > 1 &&
$('.jGrowl-closer', self.element).length === 0 && this.defaults.closer !== false ) {
$(this.defaults.closerTemplate).addClass('jGrowl-closer ' + this.defaults.themeState + ' ui-corner-all').addClass(this.defaults.theme)
.appendTo(self.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing)
.bind("click.jGrowl", function() {
$(this).siblings().trigger("jGrowl.beforeClose");
if ( $.isFunction( self.defaults.closer ) ) {
self.defaults.closer.apply( $(this).parent()[0] , [$(this).parent()[0]] );
}
});
}
},
/** Update the jGrowl Container, removing old jGrowl notifications **/
update: function() {
$(this.element).find('.jGrowl-notification:parent').each( function() {
if ($(this).data("jGrowl") !== undefined && $(this).data("jGrowl").created !== undefined &&
($(this).data("jGrowl").created.getTime() + parseInt($(this).data("jGrowl").life, 10)) < (new Date()).getTime() &&
$(this).data("jGrowl").sticky !== true &&
($(this).data("jGrowl.pause") === undefined || $(this).data("jGrowl.pause") !== true) ) {
// Pause the notification, lest during the course of animation another close event gets called.
$(this).trigger('jGrowl.beforeClose');
}
});
if (this.notifications.length > 0 &&
(this.defaults.pool === 0 || $(this.element).find('.jGrowl-notification:parent').length < this.defaults.pool) )
this.render( this.notifications.shift() );
if ($(this.element).find('.jGrowl-notification:parent').length < 2 ) {
$(this.element).find('.jGrowl-closer').animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function() {
$(this).remove();
});
}
},
/** Setup the jGrowl Notification Container **/
startup: function(e) {
this.element = $(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');
this.interval = setInterval( function() {
// some error in chage ^^
var instance = $(e).data('jGrowl.instance');
if (undefined !== instance) {
instance.update();
}
}, parseInt(this.defaults.check, 10));
},
/** Shutdown jGrowl, removing it and clearing the interval **/
shutdown: function() {
$(this.element).removeClass('jGrowl')
.find('.jGrowl-notification').trigger('jGrowl.close')
.parent().empty()
;
clearInterval(this.interval);
},
close: function() {
$(this.element).find('.jGrowl-notification').each(function(){
$(this).trigger('jGrowl.beforeClose');
});
}
});
/** Reference the Defaults Object for compatibility with older versions of jGrowl **/
$.jGrowl.defaults = $.fn.jGrowl.prototype.defaults;
})(jQuery);
/*
A simple jQuery modal (http://github.com/kylefox/jquery-modal)
Version 0.8.0
*/
(function (factory) {
// Making your jQuery plugin work better with npm tools
// http://blog.npmjs.org/post/112712169830/making-your-jquery-plugin-work-better-with-npm
if(typeof module === "object" && typeof module.exports === "object") {
factory(require("jquery"), window, document);
}
else {
factory(jQuery, window, document);
}
}(function($, window, document, undefined) {
var modals = [],
getCurrent = function() {
return modals.length ? modals[modals.length - 1] : null;
},
selectCurrent = function() {
var i,
selected = false;
for (i=modals.length-1; i>=0; i--) {
if (modals[i].$blocker) {
modals[i].$blocker.toggleClass('current',!selected).toggleClass('behind',selected);
selected = true;
}
}
};
$.modal = function(el, options) {
var remove, target;
this.$body = $('body');
this.options = $.extend({}, $.modal.defaults, options);
this.options.doFade = !isNaN(parseInt(this.options.fadeDuration, 10));
this.$blocker = null;
if (this.options.closeExisting)
while ($.modal.isActive())
$.modal.close(); // Close any open modals.
modals.push(this);
if (el.is('a')) {
target = el.attr('href');
//Select element by id from href
if (/^#/.test(target)) {
this.$elm = $(target);
if (this.$elm.length !== 1) return null;
this.$body.append(this.$elm);
this.open();
//AJAX
} else {
this.$elm = $('<div>');
this.$body.append(this.$elm);
remove = function(event, modal) { modal.elm.remove(); };
this.showSpinner();
el.trigger($.modal.AJAX_SEND);
$.get(target).done(function(html) {
if (!$.modal.isActive()) return;
el.trigger($.modal.AJAX_SUCCESS);
var current = getCurrent();
current.$elm.empty().append(html).on($.modal.CLOSE, remove);
current.hideSpinner();
current.open();
el.trigger($.modal.AJAX_COMPLETE);
}).fail(function() {
el.trigger($.modal.AJAX_FAIL);
var current = getCurrent();
current.hideSpinner();
modals.pop(); // remove expected modal from the list
el.trigger($.modal.AJAX_COMPLETE);
});
}
} else {
this.$elm = el;
this.$body.append(this.$elm);
this.open();
}
};
$.modal.prototype = {
constructor: $.modal,
open: function() {
var m = this;
this.block();
if(this.options.doFade) {
setTimeout(function() {
m.show();
}, this.options.fadeDuration * this.options.fadeDelay);
} else {
this.show();
}
$(document).off('keydown.modal').on('keydown.modal', function(event) {
var current = getCurrent();
if (event.which == 27 && current.options.escapeClose) current.close();
});
if (this.options.clickClose)
this.$blocker.on('click',function(e) {
if (e.target==this)
$.modal.close();
});
},
close: function() {
modals.pop();
this.unblock();
this.hide();
if (!$.modal.isActive())
$(document).off('keydown.modal');
},
block: function() {
this.$elm.trigger($.modal.BEFORE_BLOCK, [this._ctx()]);
this.$body.css('overflow','hidden');
this.$blocker = $('<div class="jquery-modal blocker current"></div>').appendTo(this.$body);
selectCurrent();
if(this.options.doFade) {
this.$blocker.css('opacity',0).animate({opacity: 1}, this.options.fadeDuration);
}
this.$elm.trigger($.modal.BLOCK, [this._ctx()]);
},
unblock: function(now) {
if (!now && this.options.doFade)
this.$blocker.fadeOut(this.options.fadeDuration, this.unblock.bind(this,true));
else {
this.$blocker.children().appendTo(this.$body);
this.$blocker.remove();
this.$blocker = null;
selectCurrent();
if (!$.modal.isActive())
this.$body.css('overflow','');
}
},
show: function() {
this.$elm.trigger($.modal.BEFORE_OPEN, [this._ctx()]);
if (this.options.showClose) {
this.closeButton = $('<a href="#close-modal" rel="modal:close" class="close-modal ' + this.options.closeClass + '">' + this.options.closeText + '</a>');
this.$elm.append(this.closeButton);
}
this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker);
if(this.options.doFade) {
this.$elm.css('opacity',0).show().animate({opacity: 1}, this.options.fadeDuration);
} else {
this.$elm.show();
}
this.$elm.trigger($.modal.OPEN, [this._ctx()]);
},
hide: function() {
this.$elm.trigger($.modal.BEFORE_CLOSE, [this._ctx()]);
if (this.closeButton) this.closeButton.remove();
var _this = this;
if(this.options.doFade) {
this.$elm.fadeOut(this.options.fadeDuration, function () {
_this.$elm.trigger($.modal.AFTER_CLOSE, [_this._ctx()]);
});
} else {
this.$elm.hide(0, function () {
_this.$elm.trigger($.modal.AFTER_CLOSE, [_this._ctx()]);
});
}
this.$elm.trigger($.modal.CLOSE, [this._ctx()]);
},
showSpinner: function() {
if (!this.options.showSpinner) return;
this.spinner = this.spinner || $('<div class="' + this.options.modalClass + '-spinner"></div>')
.append(this.options.spinnerHtml);
this.$body.append(this.spinner);
this.spinner.show();
},
hideSpinner: function() {
if (this.spinner) this.spinner.remove();
},
//Return context for custom events
_ctx: function() {
return { elm: this.$elm, $blocker: this.$blocker, options: this.options };
}
};
$.modal.close = function(event) {
if (!$.modal.isActive()) return;
if (event) event.preventDefault();
var current = getCurrent();
current.close();
return current.$elm;
};
// Returns if there currently is an active modal
$.modal.isActive = function () {
return modals.length > 0;
}
$.modal.getCurrent = getCurrent;
$.modal.defaults = {
closeExisting: true,
escapeClose: true,
clickClose: true,
closeText: 'Close',
closeClass: '',
modalClass: "modal",
spinnerHtml: null,
showSpinner: true,
showClose: true,
fadeDuration: null, // Number of milliseconds the fade animation takes.
fadeDelay: 1.0 // Point during the overlay's fade-in that the modal begins to fade in (.5 = 50%, 1.5 = 150%, etc.)
};
// Event constants
$.modal.BEFORE_BLOCK = 'modal:before-block';
$.modal.BLOCK = 'modal:block';
$.modal.BEFORE_OPEN = 'modal:before-open';
$.modal.OPEN = 'modal:open';
$.modal.BEFORE_CLOSE = 'modal:before-close';
$.modal.CLOSE = 'modal:close';
$.modal.AFTER_CLOSE = 'modal:after-close';
$.modal.AJAX_SEND = 'modal:ajax:send';
$.modal.AJAX_SUCCESS = 'modal:ajax:success';
$.modal.AJAX_FAIL = 'modal:ajax:fail';
$.modal.AJAX_COMPLETE = 'modal:ajax:complete';
$.fn.modal = function(options){
if (this.length === 1) {
new $.modal(this, options);
}
return this;
};
// Automatically bind links with rel="modal:close" to, well, close the modal.
$(document).on('click.modal', 'a[rel="modal:close"]', $.modal.close);
$(document).on('click.modal', 'a[rel="modal:open"]', function(event) {
event.preventDefault();
$(this).modal();
});
}));
/*
Conversion of 1.6.x popup_menu.js
*/
(function($){
var current_popup = '';
var PopupMenu = function(el, close_in_popupmenu)
{
var el = $(el);
var popup = this;
var popup_menu = $("#" + el.attr('id') + "_popup");
if(typeof close_in_popupmenu == 'undefined')
{
var close_in_popupmenu = true;
}
// Opening Popup
this.open = function(e)
{
e.preventDefault();
if(popup_menu.is(':visible'))
{
popup.close();
return;
}
// Setup popup menu
var offset = el.offset();
offset.top += el.outerHeight();
// We only adjust if it goes out of the page (?)
if((el.offset().left + popup_menu.outerWidth()) > $(window).width())
var adjust = popup_menu.outerWidth() - el.outerWidth();
else
var adjust = 0;
popup_menu.css({
position: 'absolute',
top: offset.top,
left: offset.left-adjust
});
popup_menu.show();
// Closes the popup if we click outside the button (this doesn't seem to work properly - couldn't find any solutions that actually did - if we click the first item on the menu)
// Credits: http://stackoverflow.com/questions/1160880/detect-click-outside-element
$('body, .popup_item').bind('click.close_popup', function(e) {
if(close_in_popupmenu)
{
if($(e.target).closest("#" + el.attr('id')).length == 0) {
popup.close();
}
}
else
{
if($(e.target).closest("#" + el.attr('id')).length == 0 && $(e.target).closest("#" + el.attr('id') + '_popup').length == 0) {
popup.close();
}
}
});
}
this.close = function(e)
{
popup_menu.hide();
}
}
$.fn.popupMenu = function(close_in_popupmenu)
{
return this.each(function()
{
var popup = new PopupMenu(this, close_in_popupmenu);
$(this).on('click',popup.open);
});
}
})(jQuery);
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);
registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();
registeredInModuleLoader = true;
}
if (!registeredInModuleLoader) {
var OldCookies = window.Cookies;
var api = window.Cookies = factory();
api.noConflict = function () {
window.Cookies = OldCookies;
return api;
};
}
}(function () {
function extend () {
var i = 0;
var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {
result[key] = attributes[key];
}
}
return result;
}
function init (converter) {
function api (key, value, attributes) {
var result;
if (typeof document === 'undefined') {
return;
}
// Write
if (arguments.length > 1) {
attributes = extend({
path: '/'
}, api.defaults, attributes);
if (typeof attributes.expires === 'number') {
var expires = new Date();
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
attributes.expires = expires;
}
// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
try {
result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
if (!converter.write) {
value = encodeURIComponent(String(value))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
} else {
value = converter.write(value, key);
}
key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
stringifiedAttributes += '=' + attributes[attributeName];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
}
// Read
if (!key) {
result = {};
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()"
var cookies = document.cookie ? document.cookie.split('; ') : [];
var rdecode = /(%[0-9A-Z]{2})+/g;
var i = 0;
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var cookie = parts.slice(1).join('=');
if (cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1);
}
try {
var name = parts[0].replace(rdecode, decodeURIComponent);
cookie = converter.read ?
converter.read(cookie, name) : converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent);
if (this.json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
}
if (key === name) {
result = cookie;
break;
}
if (!key) {
result[name] = cookie;
}
} catch (e) {}
}
return result;
}
api.set = api;
api.get = function (key) {
return api.call(api, key);
};
api.getJSON = function () {
return api.apply({
json: true
}, [].slice.call(arguments));
};
api.defaults = {};
api.remove = function (key, attributes) {
api(key, '', extend(attributes, {
expires: -1
}));
};
api.withConverter = init;
return api;
}
return init(function () {});
}));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,194 @@
var Post = {
init: function()
{
$(function()
{
Post.initAttachments();
});
},
loadMultiQuoted: function()
{
if(use_xmlhttprequest == 1)
{
tid = document.input.tid.value;
$.ajax(
{
url: 'xmlhttp.php?action=get_multiquoted&tid='+tid,
type: 'get',
complete: function (request, status)
{
Post.multiQuotedLoaded(request, status);
}
});
return false;
}
else
{
return true;
}
},
loadMultiQuotedAll: function()
{
if(use_xmlhttprequest == 1)
{
$.ajax(
{
url: 'xmlhttp.php?action=get_multiquoted&load_all=1',
type: 'get',
complete: function (request, status)
{
Post.multiQuotedLoaded(request, status);
}
});
return false;
}
else
{
return true;
}
},
multiQuotedLoaded: function(request)
{
var json = JSON.parse(request.responseText);
if(typeof response == 'object')
{
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'});
});
return false;
}
}
var id = 'message';
if(typeof $('textarea').sceditor != 'undefined')
{
$('textarea').sceditor('instance').insert(json.message);
}
else
{
if($('#' + id).value)
{
$('#' + id).value += "\n";
}
$('#' + id).val($('#' + id).val() + json.message);
}
$('#multiquote_unloaded').hide();
document.input.quoted_ids.value = 'all';
},
clearMultiQuoted: function()
{
$('#multiquote_unloaded').hide();
Cookie.unset('multiquote');
},
removeAttachment: function(aid)
{
MyBB.prompt(removeattach_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
document.input.attachmentaid.value = aid;
document.input.attachmentact.value = "remove";
var form = $('input[name=rem]').parents('form');
if(use_xmlhttprequest != 1)
{
form.append('<input type="submit" id="rem_submit" class="hidden" />');
$('#rem_submit').trigger('click');
return false;
}
$.ajax({
type: 'POST',
url: form.attr('action') + '&ajax=1',
data: form.serialize(),
success: function(data) {
if(data.hasOwnProperty("errors"))
{
$.each(data.errors, function(i, message)
{
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'});
});
return false;
}
else if (data.success)
{
$('#attachment_'+aid).hide(500, function()
{
$(this).remove();
});
}
}
});
}
}
});
return false;
},
attachmentAction: function(aid,action)
{
document.input.attachmentaid.value = aid;
document.input.attachmentact.value = action;
},
initAttachments: function()
{
$('form').on('submit', Post.checkAttachments);
},
checkAttachments: function()
{
var files = $("input[type='file']");
var file = files.get(0);
if (!file)
{
return true;
}
if (file.files.length > php_max_file_uploads && php_max_file_uploads != 0)
{
alert(lang.attachment_too_many_files.replace('{1}', php_max_file_uploads));
file.value="";
return false;
}
var totalSize = 0;
files.each(function()
{
for (var i = 0; i < this.files.length; i++)
{
totalSize += this.files[i].size;
}
});
if (totalSize > php_max_upload_size && php_max_upload_size > 0)
{
var php_max_upload_size_pretty = Math.round(php_max_upload_size / 1e4) / 1e2;
alert(lang.attachment_too_big_upload.replace('{1}', php_max_upload_size_pretty));
file.value="";
return false;
}
return true;
}
};
Post.init();

View File

@@ -0,0 +1,39 @@
var question = {
refresh: function()
{
var question_id = $('#question_id').val();
$.ajax(
{
url: 'xmlhttp.php?action=refresh_question&question_id='+question_id,
method: 'get',
dataType: 'json',
complete: function (request)
{
question.refresh_complete(request);
}
});
return false;
},
refresh_complete: function(request)
{
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.question_fetch_failure + ' ' + message, {theme:'jgrowl_error'});
});
}
else if(json.question && json.sid)
{
$("#question").html(json.question);
$("#question_id").val(json.sid);
}
$('#answer').removeClass('error valid').val('').prop('aria-invalid', null).removeData('previousValue')
.next('label').remove();
}
};

View File

@@ -0,0 +1,136 @@
var Rating = {
init: function()
{
var rating_elements = $(".star_rating");
rating_elements.each(function()
{
var rating_element = $(this);
var elements = rating_element.find("li a");
if(rating_element.hasClass("star_rating_notrated"))
{
elements.each(function()
{
var element = $(this);
element.on('click', function()
{
var parameterString = element.attr("href").replace(/.*\?(.*)/, "$1");
return Rating.add_rating(parameterString);
});
});
}
else
{
elements.each(function()
{
var element = $(this);
element.attr("onclick", "return false;");
element.css("cursor", "default");
var element_id = element.attr("href").replace(/.*\?(.*)/, "$1").match(/tid=(.*)&(.*)&/)[1];
element.attr("title", $("#current_rating_"+element_id).text());
});
}
});
},
build_forumdisplay: function(tid, options)
{
var list = $("#rating_thread_"+tid);
if(!list.length)
{
return;
}
list.addClass("star_rating")
.addClass(options.extra_class);
list_classes = new Array();
list_classes[1] = 'one_star';
list_classes[2] = 'two_stars';
list_classes[3] = 'three_stars';
list_classes[4] = 'four_stars';
list_classes[5] = 'five_stars';
for(var i = 1; i <= 5; i++)
{
var list_element = $("<li></li>");
var list_element_a = $("<a></a>");
list_element_a.addClass(list_classes[i])
.attr("title", lang.stars[i])
.attr("href", "./ratethread.php?tid="+tid+"&rating="+i+"&my_post_key="+my_post_key)
.html(i);
list_element.append(list_element_a);
list.append(list_element);
}
},
add_rating: function(parameterString)
{
var tid = parameterString.match(/tid=(.*)&(.*)&/)[1];
var rating = parameterString.match(/rating=(.*)&(.*)/)[1];
$.ajax(
{
url: 'ratethread.php?ajax=1&my_post_key='+my_post_key+'&tid='+tid+'&rating='+rating,
async: true,
method: 'post',
dataType: 'json',
complete: function (request)
{
Rating.rating_added(request, tid);
}
});
return false;
},
rating_added: function(request, element_id)
{
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, error)
{
$.jGrowl(lang.ratings_update_error + ' ' + error, {theme:'jgrowl_error'});
});
}
else if(json.hasOwnProperty("success"))
{
var element = $("#rating_thread_"+element_id);
element.parent().before(element.next());
element.removeClass("star_rating_notrated");
$.jGrowl(json.success, {theme:'jgrowl_success'});
if(json.hasOwnProperty("average"))
{
$("#current_rating_"+element_id).html(json.average);
}
var rating_elements = $(".star_rating");
rating_elements.each(function()
{
var rating_element = $(this);
var elements = rating_element.find("li a");
if(rating_element.hasClass('star_rating_notrated'))
{
elements.each(function()
{
var element = $(this);
if(element.attr("id") == "rating_thread_" + element_id)
{
element.attr("onclick", "return false;")
.css("cursor", "default")
.attr("title", $("#current_rating_"+element_id).text());
}
});
}
});
$("#current_rating_"+element_id).css("width", json.width+"%");
}
}
};
if(use_xmlhttprequest == 1)
{
$(function()
{
Rating.init();
});
}

View File

@@ -0,0 +1,49 @@
var Report = {
init: function()
{
$(function(){
});
},
reportPost: function(pid)
{
MyBB.popupWindow("/report.php?modal=1&type=post&pid="+pid);
},
reportUser: function(pid)
{
MyBB.popupWindow("/report.php?modal=1&type=profile&pid="+pid);
},
reportReputation: function(pid)
{
MyBB.popupWindow("/report.php?modal=1&type=reputation&pid="+pid);
},
submitReport: function(pid)
{
// Get form, serialize it and send it
var datastring = $(".reportData_"+pid).serialize();
$.ajax({
type: "POST",
url: "report.php?modal=1",
data: datastring,
dataType: "html",
success: function(data) {
// Replace modal HTML
$('.modal_'+pid).fadeOut('slow', function() {
$('.modal_'+pid).html(data);
$('.modal_'+pid).fadeIn('slow');
$('.modal').fadeIn('slow');
});
},
error: function(){
alert(lang.unknown_error);
}
});
return false;
}
};
Report.init();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
!function(i){"use strict";i.plugins.format=function(){var n,a,c={p:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",address:"Address",pre:"Preformatted Text"};this.init=function(){var e=this.opts,t=e.paragraphformat;e.format&&"bbcode"===e.format||(t&&(t.tags&&(c=t.tags),t.excludeTags&&t.excludeTags.forEach(function(e){delete c[e]})),this.commands.format||(this.commands.format={exec:a,txtExec:a,tooltip:"Format Paragraph"}),e.toolbar===i.defaultOptions.toolbar&&(e.toolbar=e.toolbar.replace(",color,",",color,format,")))},n=function(e,t){e.sourceMode()?e.insert("<"+t+">","</"+t+">"):e.execCommand("formatblock","<"+t+">")},a=function(e){var o=this,r=document.createElement("div");i.utils.each(c,function(t,a){var e=document.createElement("a");e.className="sceditor-option",e.textContent=a.name||a,e.addEventListener("click",function(e){o.closeDropDown(!0),a.exec?a.exec(o):n(o,t),e.preventDefault()}),r.appendChild(e)}),o.createDropDown(e,"format",r)}}}(sceditor);

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

View File

@@ -0,0 +1,3 @@
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
!function(e){"use strict";sceditor.plugins.undo=function(){var r,o,e=this,u=0,a=50,n=[],c=[],s=!1,l=function(e){s=!0,o=e.value,r.sourceMode(e.sourceMode),r.val(e.value,!1),r.focus(),e.sourceMode?r.sourceEditorCaret(e.caret):r.getRangeHelper().restoreRange(),s=!1};e.init=function(){a=(r=this).undoLimit||a,r.addShortcut("ctrl+z",e.undo),r.addShortcut("ctrl+shift+z",e.redo),r.addShortcut("ctrl+y",e.redo)},e.undo=function(){var e=c.pop(),t=r.val(null,!1);return e&&!n.length&&t===e.value&&(e=c.pop()),e&&(n.length||n.push({caret:r.sourceEditorCaret(),sourceMode:r.sourceMode(),value:t}),n.push(e),l(e)),!1},e.redo=function(){var e=n.pop();return c.length||(c.push(e),e=n.pop()),e&&(c.push(e),l(e)),!1},e.signalReady=function(){var e=r.val(null,!1);o=e,c.push({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:e})},e.signalValuechangedEvent=function(e){var t=e.detail.rawValue;0<a&&c.length>a&&c.shift(),!s&&o&&o!==t&&(n.length=0,(u+=function(e,t){var r,o,u,a,n=e.length,c=t.length,s=Math.max(n,c);for(r=0;r<s&&e.charAt(r)===t.charAt(r);r++);for(u=n<c?c-n:0,a=c<n?n-c:0,o=s-1;0<=o&&e.charAt(o-u)===t.charAt(o-a);o--);return o-r+1}(o,t))<20||u<50&&!/\s$/g.test(e.rawValue)||(c.push({caret:r.sourceEditorCaret(),sourceMode:r.sourceMode(),value:t}),u=0,o=t))}}}();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #111;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #111;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #333;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #111;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #111;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1,143 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
html, body, p, code:before, table {
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, Arial, Sans-Serif;
font-size: 14px;
color: #111;
}
html {
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
height: 100%;
/* Needed for iOS scrolling bug fix */
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
/* Needed for iOS scrolling bug fix */
position: relative;
overflow: auto;
/* Needed so the cursor will be placed at the end of the content
when the there isn't enought content to fill the full viewport */
min-height: 100%;
word-wrap: break-word;
}
table, td {
border: 1px dotted #000;
/* Show empty cells so they can be edited */
empty-cells: show;
}
code:before {
font-weight: bold;
content: 'Code:';
display: block;
border-bottom: 1px solid #ccc;
padding: 4px 0 3px 0;
margin-bottom: 10px;
}
code.phpcodeblock:before {
content: 'PHP Code:' !important;
}
code {
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px !important;
padding: 10px;
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
white-space: pre;
display: block;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.ie6 code, .ie7 code {
margin-top: 0;
}
code:before, code {
display: block;
text-align: left;
}
blockquote {
position: relative;
background: white;
margin: .25em .05em 0 0;
border: 1px solid #ccc;
padding: 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
/* prevent divs from being collapsed */
div {
min-height: 1.25em;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: 0;
}
ul, ol {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
img {
max-width: 100%;
}
font[size="1"] {
font-size: xx-small;
}
font[size="2"] {
font-size: x-small;
}
font[size="3"] {
font-size: small;
}
font[size="4"] {
font-size: medium;
}
font[size="5"] {
font-size: large;
}
font[size="6"] {
font-size: x-large;
}
font[size="7"] {
font-size: xx-large;
}

View File

@@ -0,0 +1 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */body,code:before,html,p,table{margin:0;padding:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;color:#111;line-height:1.25;overflow:visible}html{height:100%}.ios{overflow:auto;-webkit-overflow-scrolling:touch}.ios body{position:relative;overflow:auto}body{min-height:100%;word-wrap:break-word}body.placeholder::before{content:attr(placeholder);color:#555;font-style:italic}ol,ul{margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0}table,td{border:1px dotted #000;empty-cells:show}table td{min-width:5px}code{display:block;background:#f1f1f1;white-space:pre;padding:1em;text-align:left;margin:.25em 0;direction:ltr}blockquote{background:#fff7d9;margin:.25em 0;border-left:.3em solid #f4e59f;padding:.5em .5em .5em .75em}blockquote cite{font-weight:700;display:block;font-size:1em;margin:0 -.5em .25em -.75em;padding:0 .5em .15em .75em;border-bottom:1px solid #f4e59f}h1,h2,h3,h4,h5,h6{padding:0;margin:0}div,p{min-height:1.25em}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,8 @@
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,624 @@
/*! SCEditor | (C) 2011-2016, Sam Clarke | sceditor.com/license */
.sceditor-button div,
div.sceditor-grip {
background-image: url(famfamfam.png);
background-repeat: no-repeat;
width: 16px;
height: 16px
}
.sceditor-button-youtube div {
background-position: 0 0
}
.sceditor-button-link div {
background-position: 0 -16px
}
.sceditor-button-unlink div {
background-position: 0 -32px
}
.sceditor-button-underline div {
background-position: 0 -48px
}
.sceditor-button-time div {
background-position: 0 -64px
}
.sceditor-button-table div {
background-position: 0 -80px
}
.sceditor-button-superscript div {
background-position: 0 -96px
}
.sceditor-button-subscript div {
background-position: 0 -112px
}
.sceditor-button-strike div {
background-position: 0 -128px
}
.sceditor-button-source div {
background-position: 0 -144px
}
.sceditor-button-size div {
background-position: 0 -160px
}
.sceditor-button-rtl div {
background-position: 0 -176px
}
.sceditor-button-right div {
background-position: 0 -192px
}
.sceditor-button-removeformat div {
background-position: 0 -208px
}
.sceditor-button-quote div {
background-position: 0 -224px
}
.sceditor-button-print div {
background-position: 0 -240px
}
.sceditor-button-pastetext div {
background-position: 0 -256px
}
.sceditor-button-paste div {
background-position: 0 -272px
}
.sceditor-button-outdent div {
background-position: 0 -288px
}
.sceditor-button-orderedlist div {
background-position: 0 -304px
}
.sceditor-button-maximize div {
background-position: 0 -320px
}
.sceditor-button-ltr div {
background-position: 0 -336px
}
.sceditor-button-left div {
background-position: 0 -352px
}
.sceditor-button-justify div {
background-position: 0 -368px
}
.sceditor-button-italic div {
background-position: 0 -384px
}
.sceditor-button-indent div {
background-position: 0 -400px
}
.sceditor-button-image div {
background-position: 0 -416px
}
.sceditor-button-horizontalrule div {
background-position: 0 -432px
}
.sceditor-button-format div {
background-position: 0 -448px
}
.sceditor-button-font div {
background-position: 0 -464px
}
.sceditor-button-emoticon div {
background-position: 0 -480px
}
.sceditor-button-email div {
background-position: 0 -496px
}
.sceditor-button-date div {
background-position: 0 -512px
}
.sceditor-button-cut div {
background-position: 0 -528px
}
.sceditor-button-copy div {
background-position: 0 -544px
}
.sceditor-button-color div {
background-position: 0 -560px
}
.sceditor-button-code div {
background-position: 0 -576px
}
.sceditor-button-center div {
background-position: 0 -592px
}
.sceditor-button-bulletlist div {
background-position: 0 -608px
}
.sceditor-button-bold div {
background-position: 0 -624px
}
div.sceditor-grip {
background-position: 0 -640px
}
.rtl div.sceditor-grip {
background-position: 0 -650px;
right: auto;
left: 0
}
.sceditor-container {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-direction: column;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
position: relative;
background: padding-box #fff;
border: 1px solid #d9d9d9;
font-size: 13px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
color: #333;
line-height: 1;
font-weight: 700;
height: 250px;
border-radius: 4px
}
.sceditor-container *,
.sceditor-container :after,
.sceditor-container :before {
-webkit-box-sizing: content-box;
box-sizing: content-box
}
.sceditor-container,
.sceditor-container div,
div.sceditor-dropdown,
div.sceditor-dropdown div {
padding: 0;
margin: 0;
z-index: 3
}
.sceditor-container iframe,
.sceditor-container textarea {
display: block;
-ms-flex: 1 1 0%;
-webkit-box-flex: 1;
flex: 1 1 0%;
line-height: 1.25;
border: 0;
outline: 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #111;
padding: 0;
margin: 5px;
resize: none;
background: #fff;
height: auto !important;
width: auto !important;
width: calc(100% - 10px) !important;
min-height: 1px
}
.sceditor-container textarea {
margin: 7px 5px
}
div.sceditor-dnd-cover {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(255, 255, 255, .2);
border: 5px dashed #aaa;
z-index: 200;
font-size: 2em;
text-align: center;
color: #aaa
}
div.sceditor-dnd-cover p {
position: relative;
top: 45%;
pointer-events: none
}
div.sceditor-resize-cover {
position: absolute;
top: 0;
left: 0;
background: #000;
width: 100%;
height: 100%;
z-index: 10;
opacity: .3
}
div.sceditor-grip {
overflow: hidden;
width: 10px;
height: 10px;
cursor: pointer;
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
line-height: 0
}
div.sceditor-grip.has-icon {
background-image: none
}
.sceditor-maximize {
position: fixed;
top: 0;
left: 0;
height: 100% !important;
width: 100% !important;
border-radius: 0;
background-clip: padding-box;
z-index: 2000
}
body.sceditor-maximize,
html.sceditor-maximize {
height: 100%;
width: 100%;
padding: 0;
margin: 0;
overflow: hidden
}
.sceditor-maximize div.sceditor-grip {
display: none
}
.sceditor-maximize div.sceditor-toolbar {
border-radius: 0;
background-clip: padding-box
}
div.sceditor-dropdown {
position: absolute;
border: 1px solid #ccc;
background: padding-box #fff;
z-index: 4000;
padding: 10px;
font-weight: 400;
font-size: 15px;
border-radius: 2px;
-webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, .2);
box-shadow: 1px 2px 4px rgba(0, 0, 0, .2)
}
div.sceditor-dropdown *,
div.sceditor-dropdown :after,
div.sceditor-dropdown :before {
-webkit-box-sizing: border-box;
box-sizing: border-box
}
div.sceditor-dropdown a,
div.sceditor-dropdown a:link {
color: #333
}
div.sceditor-dropdown form {
margin: 0
}
div.sceditor-dropdown label {
display: block;
font-weight: 700;
color: #3c3c3c;
padding: 4px 0
}
div.sceditor-dropdown input,
div.sceditor-dropdown textarea {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
outline: 0;
padding: 4px;
border: 1px solid #ccc;
border-top-color: #888;
margin: 0 0 .75em;
border-radius: 1px;
background-clip: padding-box
}
div.sceditor-dropdown textarea {
padding: 6px
}
div.sceditor-dropdown input:focus,
div.sceditor-dropdown textarea:focus {
border-color: #666 #aaa #aaa;
-webkit-box-shadow: inset 0 1px 5px rgba(0, 0, 0, .1);
box-shadow: inset 0 1px 5px rgba(0, 0, 0, .1)
}
div.sceditor-dropdown .button {
font-weight: 700;
color: #444;
padding: 6px 12px;
background: padding-box #ececec;
border: 1px solid #ccc;
border-radius: 2px;
cursor: pointer;
margin: .3em 0 0
}
div.sceditor-dropdown .button:hover {
background: #f3f3f3;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .15);
box-shadow: 0 1px 1px rgba(0, 0, 0, .15)
}
div.sceditor-font-picker,
div.sceditor-fontsize-picker,
div.sceditor-format {
padding: 6px 0
}
div.sceditor-color-picker {
padding: 4px
}
div.sceditor-emoticons,
div.sceditor-more-emoticons {
padding: 0
}
.sceditor-pastetext textarea {
border: 1px solid #bbb;
width: 20em
}
.sceditor-emoticons img,
.sceditor-more-emoticons img {
padding: 0;
cursor: pointer;
margin: 2px
}
.sceditor-more {
border-top: 1px solid #bbb;
display: block;
text-align: center;
cursor: pointer;
font-weight: 700;
padding: 6px 0
}
.sceditor-dropdown a:hover {
background: #eee
}
.sceditor-font-option,
.sceditor-fontsize-option,
.sceditor-format a {
display: block;
padding: 7px 10px;
cursor: pointer;
text-decoration: none;
color: #222
}
.sceditor-fontsize-option {
padding: 7px 13px
}
.sceditor-color-column {
float: left
}
.sceditor-color-option {
display: block;
border: 2px solid #fff;
height: 18px;
width: 18px;
overflow: hidden
}
.sceditor-color-option:hover {
border: 1px solid #aaa
}
div.sceditor-toolbar {
overflow: hidden;
padding: 2px 2px 1px;
background: #f7f7f7;
border-bottom: 1px solid #c0c0c0;
line-height: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
div.sceditor-group {
display: inline-block;
background: #eee;
margin: 1px 5px 1px 0;
padding: 1px;
border-bottom: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.sceditor-button {
float: left;
cursor: pointer;
padding: 3px 5px;
width: 16px;
height: 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border: 1px solid #eee;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.ie6 .sceditor-button, .ie7 .sceditor-button {
float: none!important;
display: inline;
zoom: 1;
}
.ie6 .sceditor-button {
padding: 0;
}
.ie6 .sceditor-button div {
margin: 5px;
}
.ie7 .sceditor-button div {
margin: 5px 0;
}
.sceditor-button:hover, .sceditor-button:active, .sceditor-button.active {
background: #fff;
/*-webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2)*/border: 1px solid #ddd;
}
.sceditor-button:active {
background: #fff;
-webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.3);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.3);
}
.sceditor-button.disabled:hover {
background: inherit;
cursor: default;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.sceditor-button, .sceditor-button div {
display: block;
}
.sceditor-button div {
display: inline-block;
margin: 2px 0;
padding: 0;
overflow: hidden;
line-height: 0;
font-size: 0;
color: transparent;
}
.sceditor-button.disabled div {
opacity: .3;
}
.sceditor-button svg {
display: inline-block;
height: 16px;
width: 16px;
margin: 2px 0;
fill: #111;
text-decoration: none;
pointer-events: none;
line-height: 1
}
.sceditor-button.disabled svg {
fill: #888
}
.sceditor-button.has-icon div {
display: none
}
.sceditor-button.text,
.sceditor-button.text div,
.sceditor-button.text-icon,
.sceditor-button.text-icon div,
.text .sceditor-button,
.text .sceditor-button div,
.text-icon .sceditor-button,
.text-icon .sceditor-button div {
display: inline-block;
width: auto;
line-height: 16px;
font-size: 1em;
color: inherit;
text-indent: 0
}
.sceditor-button.has-icon div,
.sceditor-button.text div,
.text .sceditor-button div,
.text-icon .sceditor-button.has-icon div {
padding: 0 2px;
background: 0 0
}
.sceditor-button.text svg,
.text .sceditor-button svg {
display: none
}
.sceditor-button.text-icon div,
.text-icon .sceditor-button div {
padding: 0 2px 0 20px
}
.rtl div.sceditor-toolbar {
text-align: right
}
.rtl .sceditor-button {
float: right
}
.sceditor-button-video div {
background-image: url(video.png)
}
.sceditor-button-php div {
background-image: url(php.png)
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,696 @@
/*
Version: 3.5.3 Timestamp: Wed Aug 19 21:55:46 EDT 2015
*/
.select2-container {
margin: 0;
position: relative;
display: inline-block;
vertical-align: middle;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input {
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-webkit-box-sizing: border-box; /* webkit */
-moz-box-sizing: border-box; /* firefox */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
border-radius: 4px;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
}
html[dir="rtl"] .select2-container .select2-choice {
padding: 0 8px 0 0;
}
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
border-radius: 0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
}
.select2-container.select2-allowclear .select2-choice .select2-chosen {
margin-right: 42px;
}
.select2-container .select2-choice > .select2-chosen {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: none;
width: auto;
/* MyBB modification start - Search container min-width */
min-width: 120px;
/* MyBB modification end */
}
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
margin-left: 26px;
margin-right: 0;
}
.select2-container .select2-choice abbr {
display: none;
width: 12px;
height: 12px;
position: absolute;
right: 24px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
.select2-container.select2-allowclear .select2-choice abbr {
display: inline-block;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop-mask {
border: 0;
margin: 0;
padding: 0;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 9998;
/* styles required for IE to work */
background-color: #fff;
filter: alpha(opacity=0);
}
.select2-drop {
width: 100%;
margin-top: -1px;
position: absolute;
z-index: 9999;
top: 100%;
background: #fff;
color: #000;
border: 1px solid #aaa;
border-top: 0;
border-radius: 0 0 4px 4px;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
}
.select2-drop.select2-drop-above {
margin-top: 1px;
border-top: 1px solid #aaa;
border-bottom: 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-drop-active {
border: 1px solid #5897fb;
border-top: none;
}
.select2-drop.select2-drop-above.select2-drop-active {
border-top: 1px solid #5897fb;
}
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-container .select2-choice .select2-arrow {
display: inline-block;
width: 18px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: 1px solid #aaa;
border-radius: 0 4px 4px 0;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
left: 0;
right: auto;
border-left: none;
border-right: 1px solid #aaa;
border-radius: 4px 0 0 4px;
}
.select2-container .select2-choice .select2-arrow b {
display: block;
width: 100%;
height: 100%;
background: url('select2.png') no-repeat 0 1px;
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
background-position: 2px 1px;
}
.select2-search {
display: inline-block;
width: 100%;
min-height: 26px;
margin: 0;
padding: 4px 4px 0 4px;
position: relative;
z-index: 10000;
white-space: nowrap;
}
.select2-search input {
width: 100%;
height: auto !important;
min-height: 26px;
padding: 4px 20px 4px 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: #fff url('select2.png') no-repeat 100% -22px;
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
html[dir="rtl"] .select2-search input {
padding: 4px 5px 4px 20px;
background: #fff url('select2.png') no-repeat -37px -22px;
background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-search input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100%;
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
box-shadow: 0 1px 0 #fff inset;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to top, #fff 0%, #eee 50%);
}
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices {
border: 1px solid #5897fb;
border-top-color: transparent;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
}
.select2-dropdown-open .select2-choice .select2-arrow {
background: transparent;
border-left: none;
filter: none;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
border-right: none;
}
.select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -18px 1px;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -16px 1px;
}
.select2-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/* results */
.select2-results {
max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html[dir="rtl"] .select2-results {
padding: 0 4px 0 0;
margin: 4px 0 4px 4px;
}
.select2-results ul.select2-result-sub {
margin: 0;
padding-left: 0;
}
.select2-results li {
list-style: none;
display: list-item;
background-image: none;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
min-height: 1em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select2-results-dept-1 .select2-result-label { padding-left: 20px }
.select2-results-dept-2 .select2-result-label { padding-left: 40px }
.select2-results-dept-3 .select2-result-label { padding-left: 60px }
.select2-results-dept-4 .select2-result-label { padding-left: 80px }
.select2-results-dept-5 .select2-result-label { padding-left: 100px }
.select2-results-dept-6 .select2-result-label { padding-left: 110px }
.select2-results-dept-7 .select2-result-label { padding-left: 120px }
.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-highlighted ul {
background: #fff;
color: #000;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-ajax-error,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
padding-left: 5px;
}
/*
disabled look for disabled choices in the results dropdown
*/
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-selected {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
}
.select2-results .select2-ajax-error {
background: rgba(255, 50, 50, .2);
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice .select2-arrow {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
.select2-container.select2-container-disabled .select2-choice abbr {
display: none;
}
/* multiselect */
.select2-container-multi .select2-choices {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
border: 1px solid #aaa;
cursor: text;
overflow: hidden;
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
}
html[dir="rtl"] .select2-container-multi .select2-choices {
padding: 0 0 0 5px;
}
.select2-locked {
padding: 3px 5px 3px 5px !important;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
html[dir="rtl"] .select2-container-multi .select2-choices li
{
float: right;
}
.select2-container-multi .select2-choices .select2-search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 5px;
margin: 1px 0;
font-family: sans-serif;
font-size: 100%;
color: #666;
outline: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: transparent !important;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
{
margin: 3px 5px 3px 0;
padding: 3px 18px 3px 5px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 4px;
font-size: 1px;
outline: none;
background: url('select2.png') right top no-repeat;
}
html[dir="rtl"] .select2-search-choice-close {
right: auto;
left: 3px;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
left: auto;
right: 2px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
padding: 3px 5px 3px 5px;
border: 1px solid #ddd;
background-image: none;
background-color: #f4f4f4;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
background: none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-match {
text-decoration: underline;
}
.select2-offscreen, .select2-offscreen:focus {
clip: rect(0 0 0 0) !important;
width: 1px !important;
height: 1px !important;
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
position: absolute !important;
outline: 0 !important;
left: 0px !important;
top: 0px !important;
}
.select2-display-none {
display: none;
}
.select2-measure-scrollbar {
position: absolute;
top: -10000px;
left: -10000px;
width: 100px;
height: 100px;
overflow: scroll;
}
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
.select2-search input,
.select2-search-choice-close,
.select2-container .select2-choice abbr,
.select2-container .select2-choice .select2-arrow b {
background-image: url('select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

View File

@@ -0,0 +1,589 @@
var Thread = {
init: function()
{
$(function(){
Thread.quickEdit();
Thread.initQuickReply();
Thread.initMultiQuote();
// Set spinner image
$('#quickreply_spinner img').attr('src', spinner_image);
});
},
initMultiQuote: function()
{
var quoted = Cookie.get('multiquote');
if(quoted)
{
var post_ids = quoted.split("|");
$.each(post_ids, function(key, value) {
var mquote_a = $("#multiquote_"+value).closest('a');
if(mquote_a.length)
{
mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
});
var mquote_quick = $('#quickreply_multiquote');
if(mquote_quick.length)
{
mquote_quick.show();
}
}
return true;
},
multiQuote: function(pid)
{
var new_post_ids = new Array();
var quoted = Cookie.get("multiquote");
var is_new = true;
var deleted = false;
if($("#pid" + pid).next("div.post").hasClass('deleted_post'))
{
$.jGrowl(lang.post_deleted_error, {theme:'jgrowl_error'});
deleted = true;
}
if(quoted && !deleted)
{
var post_ids = quoted.split("|");
$.each(post_ids, function(key, post_id) {
if(post_id != pid && post_id != '')
{
new_post_ids[new_post_ids.length] = post_id;
}
else if(post_id == pid)
{
is_new = false;
}
});
}
var mquote_a = $("#multiquote_"+pid).closest('a')
if(is_new == true && !deleted)
{
new_post_ids[new_post_ids.length] = pid;
mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
else
{
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}
var mquote_quick = $('#quickreply_multiquote');
if(mquote_quick.length)
{
if(new_post_ids.length)
{
mquote_quick.show();
}
else
{
mquote_quick.hide();
}
}
Cookie.set("multiquote", new_post_ids.join("|"));
},
loadMultiQuoted: function()
{
if(use_xmlhttprequest == 1)
{
// Spinner!
var mquote_spinner = $('#quickreply_spinner');
mquote_spinner.show();
$.ajax(
{
url: 'xmlhttp.php?action=get_multiquoted&load_all=1',
type: 'get',
complete: function (request, status)
{
Thread.multiQuotedLoaded(request, status);
// Get rid of spinner
mquote_spinner.hide();
}
});
return false;
}
else
{
return true;
}
},
multiQuotedLoaded: function(request)
{
var json = JSON.parse(request.responseText);
if(typeof json == 'object')
{
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'});
});
return false;
}
}
if(typeof $('textarea').sceditor != 'undefined')
{
$('textarea').sceditor('instance').insert(json.message);
}
else
{
var id = $('#message');
if(id.value)
{
id.value += "\n";
}
id.val(id.val() + json.message);
}
Thread.clearMultiQuoted();
$('#quickreply_multiquote').hide();
$('#quoted_ids').val('all');
$('#message').trigger('focus');
},
clearMultiQuoted: function()
{
$('#quickreply_multiquote').hide();
var quoted = Cookie.get("multiquote");
if(quoted)
{
var post_ids = quoted.split("|");
$.each(post_ids, function(key, post_id) {
var mquote_a = $("#multiquote_"+post_id).closest('a');
if(mquote_a.length)
{
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}
});
}
Cookie.unset('multiquote');
},
quickEdit: function(el)
{
if(typeof el === 'undefined' || !el.length) el = '.post_body';
$(el).each(function()
{
// Take pid out of the id attribute
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');
$('#pid_' + pid).editable("xmlhttp.php?action=edit_post&do=update_post&pid=" + pid + '&my_post_key=' + my_post_key,
{
indicator: spinner,
loadurl: "xmlhttp.php?action=edit_post&do=get_post&pid=" + pid,
type: "textarea",
rows: 12,
submit: lang.save_changes,
cancel: lang.cancel_edit,
event: "edit" + pid, // Triggered by the event "edit_[pid]",
onblur: "ignore",
dataType: "json",
submitdata: function (values, settings)
{
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');
$("#quickedit_" + pid + "_editreason_original").val($("#quickedit_" + pid + "_editreason").val());
return {
editreason: $("#quickedit_" + pid + "_editreason").val()
}
},
callback: function(values, settings)
{
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');
var json = JSON.parse(values);
if(typeof json == 'object')
{
if(json.hasOwnProperty("errors"))
{
$(".jGrowl").jGrowl("close");
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.quick_edit_update_error + ' ' + message, {theme:'jgrowl_error'});
});
$(this).html($('#pid_' + pid + '_temp').html());
}
else if(json.hasOwnProperty("moderation_post"))
{
$(".jGrowl").jGrowl("close");
$(this).html(json.message);
// No more posts on this page? (testing for "1" as the last post would be removed here)
if($('.post').length == 1)
{
alert(json.moderation_post);
window.location = json.url;
}
else
{
$.jGrowl(json.moderation_post, {theme:'jgrowl_success'});
$('#post_' + pid).slideToggle();
}
}
else if(json.hasOwnProperty("moderation_thread"))
{
$(".jGrowl").jGrowl("close");
$(this).html(json.message);
alert(json.moderation_thread);
// Redirect user to forum
window.location = json.url;
}
else
{
// Change html content
$(this).html(json.message);
$('#edited_by_' + pid).html(json.editedmsg);
}
}
else
{
// Change html content
$(this).html(json.message);
$('#edited_by_' + pid).html(json.editedmsg);
}
$('#pid_' + pid + '_temp').remove();
}
});
});
$('.quick_edit_button').each(function()
{
$(this).on("click", function(e)
{
e.preventDefault();
// Take pid out of the id attribute
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');
if($("#pid" + pid).next("div.post").hasClass('deleted_post'))
{
$.jGrowl(lang.post_deleted_error, {theme:'jgrowl_error'});
return false;
}
// Create a copy of the post
if($('#pid_' + pid + '_temp').length == 0)
{
$('#pid_' + pid).clone().attr('id','pid_' + pid + '_temp').appendTo("body").hide();
}
// Trigger the edit event
$('#pid_' + pid).trigger("edit" + pid);
// Edit Reason
$('#pid_' + pid + ' textarea').attr('id', 'quickedit_' + pid);
if(allowEditReason == 1 && $('#quickedit_' + pid + '_editreason').length == 0)
{
edit_el = $('#editreason_' + pid + '_original').clone().attr('id','editreason_' + pid);
edit_el.children('#quickedit_' + pid + '_editreason_original').attr('id','quickedit_' + pid + '_editreason');
edit_el.insertAfter('#quickedit_' + pid).show();
}
});
});
return false;
},
initQuickReply: function()
{
if($('#quick_reply_form').length && use_xmlhttprequest == 1)
{
// Bind closing event to our popup menu
$('#quick_reply_submit').on('click', function(e) {
return Thread.quickReply(e);
});
}
},
quickReply: function(e)
{
e.stopPropagation();
if(this.quick_replying)
{
return false;
}
this.quick_replying = 1;
var post_body = $('#quick_reply_form').serialize();
// Spinner!
var qreply_spinner = $('#quickreply_spinner');
qreply_spinner.show();
$.ajax(
{
url: 'newreply.php?ajax=1',
type: 'post',
data: post_body,
dataType: 'html',
complete: function (request, status)
{
Thread.quickReplyDone(request, status);
// Get rid of spinner
qreply_spinner.hide();
}
});
return false;
},
quickReplyDone: function(request, status)
{
this.quick_replying = 0;
var json = JSON.parse(request.responseText);
if(typeof json == 'object')
{
if(json.hasOwnProperty("errors"))
{
$(".jGrowl").jGrowl("close");
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.quick_reply_post_error + ' ' + message, {theme:'jgrowl_error'});
});
$('#quickreply_spinner').hide();
}
}
if($('#captcha_trow').length)
{
cap = json.data.match(/^<captcha>([0-9a-zA-Z]+)(\|([0-9a-zA-Z]+)|)<\/captcha>/);
if(cap)
{
json.data = json.data.replace(/^<captcha>(.*)<\/captcha>/, '');
if($("#captcha_img").length)
{
if(cap[1])
{
imghash = cap[1];
$('#imagehash').val(imghash);
if(cap[3])
{
$('#imagestring').attr('type', 'hidden').val(cap[3]);
// hide the captcha
$('#captcha_trow').hide();
}
else
{
$('#captcha_img').attr('src', "captcha.php?action=regimage&imagehash="+imghash);
$('#imagestring').attr('type', 'text').val('');
$('#captcha_trow').show();
}
}
}
}
}
if(json.hasOwnProperty("errors"))
return false;
if(json.data.match(/id="post_([0-9]+)"/))
{
var pid = json.data.match(/id="post_([0-9]+)"/)[1];
var post = document.createElement("div");
$('#posts').append(json.data);
if (typeof inlineModeration != "undefined") // Guests don't have this object defined
$("#inlinemod_" + pid).on('change', inlineModeration.checkItem);
Thread.quickEdit("#pid_" + pid);
// Eval javascript
$(json.data).filter("script").each(function(e) {
eval($(this).text());
});
$('#quick_reply_form')[0].reset();
var lastpid = $('#lastpid');
if(lastpid.length)
{
lastpid.val(pid);
}
}
else
{
// Eval javascript
$(json.data).filter("script").each(function(e) {
eval($(this).text());
});
}
$(".jGrowl").jGrowl("close");
},
showIgnoredPost: function(pid)
{
$('#ignored_post_'+pid).slideToggle("slow");
$('#post_'+pid).slideToggle("slow");
},
showDeletedPost: function(pid)
{
$('#deleted_post_'+pid).slideToggle("slow");
$('#post_'+pid).slideToggle("slow");
},
deletePost: function(pid)
{
MyBB.prompt(quickdelete_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
$.ajax(
{
url: 'editpost.php?ajax=1&action=deletepost&delete=1&my_post_key='+my_post_key+'&pid='+pid,
type: 'post',
complete: function (request, status)
{
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.quick_delete_error + ' ' + message, {theme:'jgrowl_error'});
});
}
else if(json.hasOwnProperty("data"))
{
// Soft deleted
if(json.data == 1)
{
// Change CSS class of div 'post_[pid]'
$("#post_"+pid).addClass("unapproved_post deleted_post");
if(json.first == 1)
{
$("#quick_reply_form, .thread_tools, .new_reply_button, .inline_rating").hide();
$("#moderator_options_selector option.option_mirage").attr("disabled","disabled");
$("#moderator_options_selector option[value='softdeletethread']").val("restorethread").text(lang.restore_thread);
}
$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'});
}
else if(json.data == 2)
{
// Actually deleted
$('#post_'+pid).slideToggle("slow");
$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'});
} else if(json.data == 3)
{
// deleted thread --> redirect
if(!json.hasOwnProperty("url"))
{
$.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
}
// set timeout for redirect
window.setTimeout(function()
{
window.location = json.url;
}, 3000);
// print success message
$.jGrowl(lang.quick_delete_thread_success, {theme:'jgrowl_success'});
}
}
else
{
$.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
}
}
});
}
}
});
return false;
},
restorePost: function(pid)
{
MyBB.prompt(quickrestore_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
$.ajax(
{
url: 'editpost.php?ajax=1&action=restorepost&restore=1&my_post_key='+my_post_key+'&pid='+pid,
type: 'post',
complete: function (request, status)
{
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.quick_restore_error + ' ' + message, {theme:'jgrowl_error'});
});
}
else if(json.hasOwnProperty("data"))
{
// Change CSS class of div 'post_[pid]'
$("#post_"+pid).removeClass("unapproved_post deleted_post");
if(json.first == 1)
{
$("#quick_reply_form, .thread_tools, .new_reply_button, .inline_rating").show();
$("#moderator_options_selector option.option_mirage").prop("disabled", false);
$("#moderator_options_selector option[value='restorethread']").val("softdeletethread").text(lang.softdelete_thread);
}
$.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'});
}
else
{
$.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
}
}
});
}
}
});
return false;
},
viewNotes: function(tid)
{
MyBB.popupWindow("/moderation.php?action=viewthreadnotes&tid="+tid+"&modal=1");
}
};
Thread.init();

View File

@@ -0,0 +1,258 @@
var UserCP = {
init: function()
{
},
openBuddySelect: function(field)
{
if(!$("#"+field).length)
{
return false;
}
this.buddy_field = '#'+field;
if($("#buddyselect_container").length)
{
UserCP.buddySelectLoaded();
return false;
}
if(use_xmlhttprequest == 1)
{
$.ajax(
{
url: 'xmlhttp.php?action=get_buddyselect',
async: true,
complete: function (request)
{
UserCP.buddySelectLoaded(request);
}
});
}
},
buddySelectLoaded: function(request)
{
var buddyselect_container = $("#buddyselect_container");
// Using new copy
if(request)
{
try {
var json = JSON.parse(request.responseText);
if(json.hasOwnProperty("errors"))
{
$.each(json.errors, function(i, message)
{
$.jGrowl(lang.buddylist_error + message, {theme:'jgrowl_error'});
});
return false;
}
} catch (e) {
if(request.responseText)
{
if(buddyselect_container.length)
{
buddyselect_container.remove();
}
var container = $("<div />");
container.attr("id", "buddyselect_container");
container.hide();
container.html(request.responseText);
$("body").append(container);
}
}
}
else
{
buddyselect_container.hide();
$("#buddyselect_container input:checked").each(function()
{
$(this).attr("checked", false);
});
$("#buddyselect_buddies").html("");
container = buddyselect_container;
}
// Clone off screen
var clone = container.clone(true);
$("body").append(clone);
clone.css("width", "300px")
.css("top", "-10000px")
.css("display", "block")
.remove();
// Center it on the page
$("#buddyselect_container").css("top", "50%")
.css("left", "50%")
.css("position", "fixed")
.css("display", "block")
.css("z-index", "1000")
.css("text-align", "left")
.css("margin-left", -$("#buddyselect_container").outerWidth() / 2 + 'px')
.css("margin-top", -$("#buddyselect_container").outerHeight() / 2 + 'px');
},
selectBuddy: function(uid, username)
{
var checkbox = $("#checkbox_"+uid);
var buddyselect_buddies_uid = $("#buddyselect_buddies_"+uid);
var buddyselect_buddies = $("#buddyselect_buddies");
// Buddy already in list - remove
if(buddyselect_buddies_uid.length)
{
buddyselect_buddies_uid.remove();
var buddies = buddyselect_buddies.text();
if(buddies.charAt(0) == ",")
{
first_buddy = buddyselect_buddies.children()[0];
first_buddy.innerHTML = first_buddy.innerHTML.substr(1, first_buddy.innerHTML.length);
}
}
// Add buddy to list
else
{
var buddies = buddyselect_buddies.text();
if(buddies != "")
{
username = ", "+username;
}
var buddy = $("<span />");
buddy.attr("id", "buddyselect_buddies_"+uid)
.html(username);
buddyselect_buddies.append(buddy);
}
},
closeBuddySelect: function(canceled)
{
if(canceled != true)
{
var buddies = $("#buddyselect_buddies").text();
existing_buddies = $(this.buddy_field).select2("data");
if(existing_buddies.length)
{
// We already have stuff in our text box we must merge it with the new array we're going to create from the selected buddies
// We don't need to care about having dupes because Select2 treats items by ID and we two items have the same ID, there are no dupes because only one exists
// ^At least according to my tests :D (Pirata Nervo - so blame me for that if something goes wrong)
var newbuddies = [];
exp_buddies = buddies.split(",");
$.each(exp_buddies, function(index, buddy)
{
buddy = buddy.replace(/^\s+|\s+$/g, "");
var newbuddy = { id: buddy, text: buddy };
newbuddies.push(newbuddy);
});
// Merge both
var newarray = $.merge(existing_buddies, newbuddies);
// Update data
$(this.buddy_field).select2("data", newarray);
}
else
{
var newbuddies = [];
exp_buddies = buddies.split(",");
$.each(exp_buddies, function(index, value ){
var newbuddy = { id: value.replace(/,\s?/g, ", "), text: value.replace(/,\s?/g, ", ") };
newbuddies.push(newbuddy);
});
$(this.buddy_field).select2("data", newbuddies);
}
$(this.buddy_field).select2("focus");
}
$("#buddyselect_container").hide();
},
addBuddy: function(type)
{
var type_submit = $("#"+type+"_submit");
var type_add_username = $("#"+type+"_add_username");
if(type_add_username.val().length == 0)
{
return false;
}
if(use_xmlhttprequest != 1)
{
return true;
}
var old_value = type_submit.val();
type_add_username.attr("disabled", true);
type_submit.attr("disabled", true);
if(type == "ignored")
{
type_submit.attr("value", lang.adding_ignored);
var list = "ignore";
}
else
{
type_submit.attr("value", lang.adding_buddy);
var list = "buddy";
}
$.ajax(
{
type: 'post',
url: 'usercp.php?action=do_editlists&my_post_key='+my_post_key+'&manage='+type,
data: { ajax: 1, add_username: type_add_username.val() },
async: false,
complete: function (request)
{
if(request.responseText.indexOf("buddy_count") >= 0 || request.responseText.indexOf("ignored_count") >= 0)
{
$("#"+list+"_list").html(request.responseText);
}
else
{
$("#sentrequests").html(request.responseText);
}
type_submit.prop("disabled", false);
type_add_username.prop("disabled", false);
type_submit.attr("value", old_value);
type_add_username.val("");
type_add_username.trigger('focus');
type_add_username.select2('data', null);
}
});
return false;
},
removeBuddy: function(type, uid)
{
if(type == "ignored")
{
var message = lang.remove_ignored;
}
else
{
var message = lang.remove_buddy;
}
MyBB.prompt(message, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
$.ajax(
{
type: 'post',
url: 'usercp.php?action=do_editlists&my_post_key='+my_post_key+'&manage='+type+'&delete='+uid,
data: { ajax: 1 },
async: false
});
}
}
});
return false;
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long