Skip to content

Instantly share code, notes, and snippets.

@brunoais
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunoais/9a945a7c4d39d296f50a to your computer and use it in GitHub Desktop.
Save brunoais/9a945a7c4d39d296f50a to your computer and use it in GitHub Desktop.
generated javascript
(function($, window, document, undefined) { // Avoid conflicts with other libraries
xslt = xslt('<?xml version="1.0"?>' +
'<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
' <xsl:param name="defaulted"/>' +
' <xsl:param name="content"/>' +
' <xsl:param name="size"/>' +
' <xsl:param name="L_WROTE"/>' +
' <xsl:param name="author"/>' +
' <xsl:param name="type"/>' +
' <xsl:param name="L_IMAGE"/>' +
' <xsl:param name="src"/>' +
' <xsl:param name="S_VIEWIMG"/>' +
' <xsl:param name="url"/>' +
' <xsl:param name="height"/>' +
' <xsl:param name="width"/>' +
' <xsl:param name="S_VIEWFLASH"/>' +
' <xsl:param name="email"/>' +
' <xsl:param name="color"/>' +
' <xsl:param name="L_SELECT_ALL_CODE"/>' +
' <xsl:param name="L_COLON"/>' +
' <xsl:param name="L_CODE"/>' +
' <xsl:param name="filename"/>' +
' <xsl:output method="text" encoding="iso-8859-1" indent="yes"/>' +
' <xsl:template match="flash[@d=\'0\']">' +
' <xsl:choose>' +
' <xsl:when test="$S_VIEWFLASH">a</xsl:when>' +
' <xsl:otherwise>b</xsl:otherwise>' +
' </xsl:choose>' +
' </xsl:template>' +
' <xsl:template match="img[@d=\'0\']">' +
' <xsl:choose>' +
' <xsl:when test="$S_VIEWIMG">a</xsl:when>' +
' <xsl:otherwise>b</xsl:otherwise>' +
' </xsl:choose>' +
' </xsl:template>' +
' <xsl:template match="list[@d=\'0\']">' +
' <xsl:choose>' +
' <xsl:when test="not(@type)">a</xsl:when>' +
' <xsl:when test="contains(\'upperlowerdecim\',substring(@type,1,5))">b</xsl:when>' +
' <xsl:otherwise>c</xsl:otherwise>' +
' </xsl:choose>' +
' </xsl:template>' +
' <xsl:template match="quote[@d=\'1\']">' +
' <xsl:choose>' +
' <xsl:when test="@url">a</xsl:when>' +
' <xsl:otherwise>b</xsl:otherwise>' +
' </xsl:choose>' +
' </xsl:template>' +
' <xsl:template match="quote[@d=\'0\']">' +
' <xsl:choose>' +
' <xsl:when test="@author">a</xsl:when>' +
' <xsl:otherwise>b</xsl:otherwise>' +
' </xsl:choose>' +
' </xsl:template>' +
'</xsl:stylesheet>' +
'');
$.sceditor.plugins.bbcode.bbcode.set('attachment', {
tags: {
'div': {
'data-tag-id': "0"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["index"] &&
attributes["index"] !== = '' && attributes.defaultattr) {
attributes["index"] = attributes.defaultattr;
}
if (!attributes["filename"] &&
attributes["filename"] !== = '' &&
(content || content === '')
) {
attributes["filename"] = content;
usedContents.push("filename");
}
attributes['index'] =
editor.paramFilters['filterNumber'](attributes['index']);
if (attributes['index'] === false) {
console.warn("Attribute index from BBCode attachment failed to validate filterNumber");
}
if (!attributes['index'] && attributes['index'] !== '') {
return editor.revertBackToBBCode("attachment", originalAttributes, originalContent);
}
if (!attributes['filename'] && attributes['filename'] !== '') {
return editor.revertBackToBBCode("attachment", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var divTag = document.createElement('div');
divTag.setAttribute('class', 'inline-attachment');
mainContainerFragment.appendChild(divTag);
var textNode = document.createTextNode(attributes['filename']);
previousType = divTag.getAttribute('data-bbcode-type');
attrData = divTag.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "filename",
value: editorConstants.VALUE_IN_CONTENT
});
divTag.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
divTag.setAttribute('data-bbcode-data', JSON.stringify(attrData))
divTag.contentEditable = "true";
divTag.appendChild(textNode);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "0");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode attachment.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode attachment.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[attachment' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/attachment]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('b', {
tags: {
'span': {
'data-tag-id': "1"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var spanTag = document.createElement('span');
spanTag.setAttribute('style', 'font-weight: bold');
mainContainerFragment.appendChild(spanTag);
previousType = spanTag.getAttribute('data-bbcode-type');
spanTag.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
spanTag.contentEditable = "true";
spanTag.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "1");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode b.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode b.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[b' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/b]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('code', {
tags: {
'div': {
'data-tag-id': "2"
}
},
isInline: false,
allowedChildren: ['#', 'b', 'color', 'email', 'flash', 'i', 'img', 'size', 'u', 'url', 'bloat', 'bloats', 'bug', 'ranger', 'choicer', 'prefilter', 'postfilter', 'defaulted', 'e'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var divTag1 = document.createElement('div');
divTag1.setAttribute('class', 'codebox');
mainContainerFragment.appendChild(divTag1);
var pTag = document.createElement('p');
divTag1.appendChild(pTag);
var textNode1 = document.createTextNode(editorData.L_CODE);
pTag.appendChild(textNode1);
var textNode2 = document.createTextNode(editorData.L_COLON);
pTag.appendChild(textNode2);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode3 = document.createTextNode(' ');
textNode2.appendChild(textNode3);
var aTag = document.createElement('a');
aTag.setAttribute('href', '#');
aTag.setAttribute('onclick', 'selectCode(this); return false;');
pTag.appendChild(aTag);
var textNode4 = document.createTextNode(editorData.L_SELECT_ALL_CODE);
aTag.appendChild(textNode4);
var codeTag = document.createElement('code');
divTag1.appendChild(codeTag);
previousType = codeTag.getAttribute('data-bbcode-type');
codeTag.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
codeTag.contentEditable = "true";
codeTag.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "2");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode code.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode code.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[code' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/code]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('color', {
tags: {
'span': {
'data-tag-id': "3"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["color"] &&
attributes["color"] !== = '' && attributes.defaultattr) {
attributes["color"] = attributes.defaultattr;
}
attributes['color'] =
editor.paramFilters['filterColor'](attributes['color']);
if (attributes['color'] === false) {
console.warn("Attribute color from BBCode color failed to validate filterColor");
}
if (!attributes['color'] && attributes['color'] !== '') {
return editor.revertBackToBBCode("color", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var spanTag1 = document.createElement('span');
spanTag1.setAttribute('style', 'color: ' + attributes['color']);
mainContainerFragment.appendChild(spanTag1);
previousType = spanTag1.getAttribute('data-bbcode-type');
spanTag1.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
spanTag1.contentEditable = "true";
spanTag1.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "3");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode color.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode color.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[color' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/color]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('email', {
tags: {
'a': {
'data-tag-id': "4"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["email"] &&
attributes["email"] !== = '' && attributes.defaultattr) {
attributes["email"] = attributes.defaultattr;
}
if (!attributes["email"] &&
attributes["email"] !== = '' &&
(content || content === '')
) {
attributes["email"] = content;
usedContents.push("email");
}
attributes['email'] =
editor.paramFilters['filterEmail'](attributes['email']);
if (attributes['email'] === false) {
console.warn("Attribute email from BBCode email failed to validate filterEmail");
}
if (!attributes['email'] && attributes['email'] !== '') {
return editor.revertBackToBBCode("email", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var aTag1 = document.createElement('a');
aTag1.setAttribute('href', 'mailto:' + attributes['email']);
mainContainerFragment.appendChild(aTag1);
previousType = aTag1.getAttribute('data-bbcode-type');
aTag1.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
aTag1.contentEditable = "true";
aTag1.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "4");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode email.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode email.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[email' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/email]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('flash', {
tags: {
'': {
'data-tag-id': "5"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["flash"] &&
attributes["flash"] !== = '' && attributes.defaultattr) {
attributes["flash"] = attributes.defaultattr;
}
if (!attributes["url"] &&
attributes["url"] !== = '' &&
(content || content === '')
) {
attributes["url"] = content;
usedContents.push("url");
}
var searchResult;
searchResult = /^(\d+),(\d+)$/D.exec(attributes['flash']);
if (searchResult) {
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['width'] = searchResult[0];
}
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['height'] = searchResult[1];
}
}
attributes['width'] =
editor.paramFilters['filterNumber'](attributes['width']);
if (attributes['width'] === false) {
console.warn("Attribute width from BBCode flash failed to validate filterNumber");
}
if (!attributes['width'] && attributes['width'] !== '') {
return editor.revertBackToBBCode("flash", originalAttributes, originalContent);
}
attributes['height'] =
editor.paramFilters['filterNumber'](attributes['height']);
if (attributes['height'] === false) {
console.warn("Attribute height from BBCode flash failed to validate filterNumber");
}
if (!attributes['height'] && attributes['height'] !== '') {
return editor.revertBackToBBCode("flash", originalAttributes, originalContent);
}
attributes['url'] =
editor.paramFilters['filterUrl'](attributes['url']);
if (attributes['url'] === false) {
console.warn("Attribute url from BBCode flash failed to validate filterUrl");
}
if (!attributes['url'] && attributes['url'] !== '') {
return editor.revertBackToBBCode("flash", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var conditionResult = xslt.transformToFragment(
'<flash d="0"></flash>',
document
).firstChild.nodeValue;
switch (conditionResult[0]) {
case 'a':
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var objectTag = document.createElement('object');
objectTag.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11CF-96B8-444553540000');
objectTag.setAttribute('codebase', 'http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0');
objectTag.setAttribute('width', attributes['width']);
objectTag.setAttribute('height', attributes['height']);
mainContainerFragment.appendChild(objectTag);
var paramTag = document.createElement('param');
paramTag.setAttribute('name', 'movie');
paramTag.setAttribute('value', attributes['url']);
objectTag.appendChild(paramTag);
var paramTag1 = document.createElement('param');
paramTag1.setAttribute('name', 'play');
paramTag1.setAttribute('value', 'false');
objectTag.appendChild(paramTag1);
var paramTag2 = document.createElement('param');
paramTag2.setAttribute('name', 'loop');
paramTag2.setAttribute('value', 'false');
objectTag.appendChild(paramTag2);
var paramTag3 = document.createElement('param');
paramTag3.setAttribute('name', 'quality');
paramTag3.setAttribute('value', 'high');
objectTag.appendChild(paramTag3);
var paramTag4 = document.createElement('param');
paramTag4.setAttribute('name', 'allowScriptAccess');
paramTag4.setAttribute('value', 'never');
objectTag.appendChild(paramTag4);
var paramTag5 = document.createElement('param');
paramTag5.setAttribute('name', 'allowNetworking');
paramTag5.setAttribute('value', 'internal');
objectTag.appendChild(paramTag5);
var embedTag = document.createElement('embed');
embedTag.setAttribute('src', attributes['url']);
embedTag.setAttribute('type', 'application/x-shockwave-flash');
embedTag.setAttribute('pluginspage', 'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash');
embedTag.setAttribute('width', attributes['width']);
embedTag.setAttribute('height', attributes['height']);
embedTag.setAttribute('play', 'false');
embedTag.setAttribute('loop', 'false');
embedTag.setAttribute('quality', 'high');
embedTag.setAttribute('allowscriptaccess', 'never');
embedTag.setAttribute('allownetworking', 'internal');
objectTag.appendChild(embedTag);
break;
case 'b':
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
mainContainerFragment.contentEditable = "true";
mainContainerFragment.innerHTML += content;
break;
}
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "5");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode flash.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode flash.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[flash' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/flash]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('i', {
tags: {
'span': {
'data-tag-id': "6"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var spanTag2 = document.createElement('span');
spanTag2.setAttribute('style', 'font-style: italic');
mainContainerFragment.appendChild(spanTag2);
previousType = spanTag2.getAttribute('data-bbcode-type');
spanTag2.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
spanTag2.contentEditable = "true";
spanTag2.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "6");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode i.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode i.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[i' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/i]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('img', {
tags: {
'': {
'data-tag-id': "7"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["src"] &&
attributes["src"] !== = '' && attributes.defaultattr) {
attributes["src"] = attributes.defaultattr;
}
if (!attributes["src"] &&
attributes["src"] !== = '' &&
(content || content === '')
) {
attributes["src"] = content;
usedContents.push("src");
}
if (!attributes['src'] && attributes['src'] !== '') {
return editor.revertBackToBBCode("img", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var conditionResult = xslt.transformToFragment(
'<img d="0"></img>',
document
).firstChild.nodeValue;
switch (conditionResult[0]) {
case 'a':
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var imgTag = document.createElement('img');
imgTag.setAttribute('src', attributes['src']);
imgTag.setAttribute('alt', '{$L_IMAGE}');
mainContainerFragment.appendChild(imgTag);
break;
case 'b':
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
mainContainerFragment.contentEditable = "true";
mainContainerFragment.innerHTML += content;
break;
}
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "7");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode img.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode img.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[img' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/img]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('list', {
tags: {},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["type"] &&
attributes["type"] !== = '' && attributes.defaultattr) {
attributes["type"] = attributes.defaultattr;
}
attributes['type'] =
editor.paramFilters['filterHashmap'](attributes['type'], {
"A": "upper-alpha",
"I": "upper-roman",
"a": "lower-alpha",
"i": "lower-roman",
"1": "decimal"
}, false);
if (attributes['type'] === false) {
console.warn("Attribute type from BBCode list failed to validate filterHashmap");
}
attributes['type'] =
editor.paramFilters['filterSimpletext'](attributes['type']);
if (attributes['type'] === false) {
console.warn("Attribute type from BBCode list failed to validate filterSimpletext");
}
var mainContainerFragment = document.createDocumentFragment();
xslt.setParameter('type', attributes['type']);
var conditionResult = xslt.transformToFragment(
'<list d="0"></list>',
document
).firstChild.nodeValue;
switch (conditionResult[0]) {
case 'a':
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var ulTag = document.createElement('ul');
mainContainerFragment.appendChild(ulTag);
previousType = ulTag.getAttribute('data-bbcode-type');
ulTag.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
ulTag.contentEditable = "true";
ulTag.innerHTML += content;
break;
case 'b':
var olTag = document.createElement('ol');
olTag.setAttribute('style', 'list-style-type: ' + attributes['type']);
mainContainerFragment.appendChild(olTag);
previousType = olTag.getAttribute('data-bbcode-type');
olTag.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
olTag.contentEditable = "true";
olTag.innerHTML += content;
break;
case 'c':
var ulTag1 = document.createElement('ul');
ulTag1.setAttribute('style', 'list-style-type: ' + attributes['type']);
mainContainerFragment.appendChild(ulTag1);
previousType = ulTag1.getAttribute('data-bbcode-type');
ulTag1.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
ulTag1.contentEditable = "true";
ulTag1.innerHTML += content;
break;
}
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "8");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode list.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode list.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[list' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/list]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('*', {
tags: {
'li': {
'data-tag-id': "9"
}
},
isInline: false,
excludeClosing: true,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var liTag = document.createElement('li');
mainContainerFragment.appendChild(liTag);
previousType = liTag.getAttribute('data-bbcode-type');
liTag.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
liTag.contentEditable = "true";
liTag.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "9");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode *.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode *.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[*' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/*]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('quote', {
tags: {},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["author"] &&
attributes["author"] !== = '' && attributes.defaultattr) {
attributes["author"] = attributes.defaultattr;
}
var searchResult;
searchResult = /^\[url=(.*?)](.*)\[\/url]$/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["src"] && attributes["src"] !== = '') {
attributes['url'] = searchResult[0];
}
if (!attributes["src"] && attributes["src"] !== = '') {
attributes['author'] = searchResult[1];
}
}
searchResult = /^\[url]((.*?))\[\/url]$/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["src"] && attributes["src"] !== = '') {
attributes['author'] = searchResult[0];
}
if (!attributes["src"] && attributes["src"] !== = '') {
attributes['url'] = searchResult[1];
}
}
searchResult = /(https?:\/\/[^[\]]+)/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["src"] && attributes["src"] !== = '') {
attributes['url'] = searchResult[0];
}
}
attributes['url'] =
editor.paramFilters['filterUrl'](attributes['url']);
if (attributes['url'] === false) {
console.warn("Attribute url from BBCode quote failed to validate filterUrl");
}
var mainContainerFragment = document.createDocumentFragment();
xslt.setParameter('author', attributes['author']);
var conditionResult = xslt.transformToFragment(
'<quote d="0"></quote>',
document
).firstChild.nodeValue;
switch (conditionResult[0]) {
case 'a':
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var blockquoteTag = document.createElement('blockquote');
mainContainerFragment.appendChild(blockquoteTag);
var divTag2 = document.createElement('div');
blockquoteTag.appendChild(divTag2);
var citeTag = document.createElement('cite');
divTag2.appendChild(citeTag);
var spanTag3 = document.createElement('span');
citeTag.appendChild(spanTag3);
xslt.setParameter('url', attributes['url']);
var conditionResult = xslt.transformToFragment(
'<quote d="1"></quote>',
document
).firstChild.nodeValue;
switch (conditionResult[0]) {
case 'a':
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var aTag2 = document.createElement('a');
aTag2.setAttribute('href', attributes['url']);
aTag2.setAttribute('class', 'postlink');
spanTag3.appendChild(aTag2);
var textNode5 = document.createTextNode(attributes['author']);
previousType = aTag2.getAttribute('data-bbcode-type');
attrData = aTag2.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "author",
value: editorConstants.VALUE_IN_CONTENT
});
aTag2.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
aTag2.setAttribute('data-bbcode-data', JSON.stringify(attrData))
aTag2.contentEditable = "true";
aTag2.appendChild(textNode5);
break;
case 'b':
var textNode6 = document.createTextNode(attributes['author']);
previousType = spanTag3.getAttribute('data-bbcode-type');
attrData = spanTag3.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "author",
value: editorConstants.VALUE_IN_CONTENT
});
spanTag3.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
spanTag3.setAttribute('data-bbcode-data', JSON.stringify(attrData))
spanTag3.contentEditable = "true";
spanTag3.appendChild(textNode6);
break;
} < b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode7 = document.createTextNode(' ');
spanTag3.appendChild(textNode7);
var textNode8 = document.createTextNode(editorData.L_WROTE);
citeTag.appendChild(textNode8);
var textNode9 = document.createTextNode(editorData.L_COLON);
citeTag.appendChild(textNode9);
var divTag3 = document.createElement('div');
divTag2.appendChild(divTag3);
previousType = divTag3.getAttribute('data-bbcode-type');
divTag3.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
divTag3.contentEditable = "true";
divTag3.innerHTML += content;
break;
case 'b':
var blockquoteTag1 = document.createElement('blockquote');
blockquoteTag1.setAttribute('class', 'uncited');
mainContainerFragment.appendChild(blockquoteTag1);
var divTag4 = document.createElement('div');
blockquoteTag1.appendChild(divTag4);
var divTag5 = document.createElement('div');
divTag4.appendChild(divTag5);
previousType = divTag5.getAttribute('data-bbcode-type');
divTag5.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
divTag5.contentEditable = "true";
divTag5.innerHTML += content;
break;
}
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "10");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode quote.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode quote.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[quote' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/quote]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('size', {
tags: {
'span': {
'data-tag-id': "11"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["size"] &&
attributes["size"] !== = '' && attributes.defaultattr) {
attributes["size"] = attributes.defaultattr;
}
if (!attributes['size'] && attributes['size'] !== '') {
return editor.revertBackToBBCode("size", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var spanTag4 = document.createElement('span');
spanTag4.setAttribute('style', 'font-size: ' + attributes['size'] + '%; line-height: normal');
mainContainerFragment.appendChild(spanTag4);
previousType = spanTag4.getAttribute('data-bbcode-type');
spanTag4.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
spanTag4.contentEditable = "true";
spanTag4.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "11");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode size.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode size.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[size' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/size]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('u', {
tags: {
'span': {
'data-tag-id': "12"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var spanTag5 = document.createElement('span');
spanTag5.setAttribute('style', 'text-decoration: underline');
mainContainerFragment.appendChild(spanTag5);
previousType = spanTag5.getAttribute('data-bbcode-type');
spanTag5.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
spanTag5.contentEditable = "true";
spanTag5.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "12");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode u.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode u.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[u' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/u]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('url', {
tags: {
'a': {
'data-tag-id': "13"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["url"] &&
attributes["url"] !== = '' && attributes.defaultattr) {
attributes["url"] = attributes.defaultattr;
}
if (!attributes["url"] &&
attributes["url"] !== = '' &&
(content || content === '')
) {
attributes["url"] = content;
usedContents.push("url");
}
attributes['url'] =
editor.paramFilters['filterUrl'](attributes['url']);
if (attributes['url'] === false) {
console.warn("Attribute url from BBCode url failed to validate filterUrl");
}
if (!attributes['url'] && attributes['url'] !== '') {
return editor.revertBackToBBCode("url", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var aTag3 = document.createElement('a');
aTag3.setAttribute('href', attributes['url']);
aTag3.setAttribute('class', 'postlink');
mainContainerFragment.appendChild(aTag3);
previousType = aTag3.getAttribute('data-bbcode-type');
aTag3.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
aTag3.contentEditable = "true";
aTag3.innerHTML += content;
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "13");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode url.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode url.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[url' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/url]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('bloat', {
tags: {
'b': {
'data-tag-id': "14"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["author"] &&
attributes["author"] !== = '' && attributes.defaultattr) {
attributes["author"] = attributes.defaultattr;
}
var searchResult;
searchResult = /^\[url=(.*?)\](.*)\[\/url\]$/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['url'] = searchResult[0];
}
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['author'] = searchResult[1];
}
}
searchResult = /^\[url\]((.*?))\[\/url\]$/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['author'] = searchResult[0];
}
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['url'] = searchResult[1];
}
}
searchResult = /(https?:\/\/[^[\]]+)/i.exec(attributes['author']);
if (searchResult) {
if (!attributes["url"] && attributes["url"] !== = '') {
attributes['url'] = searchResult[0];
}
}
attributes['url'] =
editor.paramFilters['filterUrl'](attributes['url']);
if (attributes['url'] === false) {
console.warn("Attribute url from BBCode bloat failed to validate filterUrl");
}
var mainContainerFragment = document.createDocumentFragment();
var bTag = document.createElement('b');
mainContainerFragment.appendChild(bTag);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode10 = document.createTextNode('author:');
bTag.appendChild(textNode10);
var textNode11 = document.createTextNode(attributes['author']);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
attrData = mainContainerFragment.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "author",
value: editorConstants.VALUE_IN_CONTENT
});
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
mainContainerFragment.setAttribute('data-bbcode-data', JSON.stringify(attrData))
mainContainerFragment.contentEditable = "true";
mainContainerFragment.appendChild(textNode11);
var brTag = document.createElement('br');
mainContainerFragment.appendChild(brTag);
var bTag1 = document.createElement('b');
mainContainerFragment.appendChild(bTag1);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode12 = document.createTextNode('url:');
bTag1.appendChild(textNode12);
var textNode13 = document.createTextNode(attributes['url']);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
attrData = mainContainerFragment.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "url",
value: editorConstants.VALUE_IN_CONTENT
});
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
mainContainerFragment.setAttribute('data-bbcode-data', JSON.stringify(attrData))
mainContainerFragment.contentEditable = "true";
mainContainerFragment.appendChild(textNode13);
var brTag1 = document.createElement('br');
mainContainerFragment.appendChild(brTag1);
var bTag2 = document.createElement('b');
mainContainerFragment.appendChild(bTag2);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode14 = document.createTextNode('text:');
bTag2.appendChild(textNode14);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
mainContainerFragment.contentEditable = "true";
mainContainerFragment.innerHTML += content;
var brTag2 = document.createElement('br');
mainContainerFragment.appendChild(brTag2);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "14");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode bloat.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode bloat.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[bloat' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/bloat]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('bloats', {
tags: {
'b': {
'data-tag-id': "15"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["author"] &&
attributes["author"] !== = '' && attributes.defaultattr) {
attributes["author"] = attributes.defaultattr;
}
attributes['url'] =
editor.paramFilters['filterUrl'](attributes['url']);
if (attributes['url'] === false) {
console.warn("Attribute url from BBCode bloats failed to validate filterUrl");
}
var mainContainerFragment = document.createDocumentFragment();
var bTag3 = document.createElement('b');
mainContainerFragment.appendChild(bTag3);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode15 = document.createTextNode('author:');
bTag3.appendChild(textNode15);
var textNode16 = document.createTextNode(attributes['author']);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
attrData = mainContainerFragment.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "author",
value: editorConstants.VALUE_IN_CONTENT
});
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
mainContainerFragment.setAttribute('data-bbcode-data', JSON.stringify(attrData))
mainContainerFragment.contentEditable = "true";
mainContainerFragment.appendChild(textNode16);
var brTag3 = document.createElement('br');
mainContainerFragment.appendChild(brTag3);
var bTag4 = document.createElement('b');
mainContainerFragment.appendChild(bTag4);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode17 = document.createTextNode('url:');
bTag4.appendChild(textNode17);
var textNode18 = document.createTextNode(attributes['url']);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
attrData = mainContainerFragment.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "url",
value: editorConstants.VALUE_IN_CONTENT
});
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
mainContainerFragment.setAttribute('data-bbcode-data', JSON.stringify(attrData))
mainContainerFragment.contentEditable = "true";
mainContainerFragment.appendChild(textNode18);
var brTag4 = document.createElement('br');
mainContainerFragment.appendChild(brTag4);
var bTag5 = document.createElement('b');
mainContainerFragment.appendChild(bTag5);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode19 = document.createTextNode('text:');
bTag5.appendChild(textNode19);
previousType = mainContainerFragment.getAttribute('data-bbcode-type');
mainContainerFragment.setAttribute('data-bbcode-type', (previousType && previousType + '|content') || 'content');
mainContainerFragment.contentEditable = "true";
mainContainerFragment.innerHTML += content;
var brTag5 = document.createElement('br');
mainContainerFragment.appendChild(brTag5);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "15");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode bloats.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode bloats.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[bloats' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/bloats]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('hr', {
tags: {
'hr': {
'data-tag-id': "16"
}
},
isInline: false,
isSelfClosing: true,
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var hrTag = document.createElement('hr');
mainContainerFragment.appendChild(hrTag);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "16");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode hr.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode hr.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[hr' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/hr]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('bug', {
tags: {
'b': {
'data-tag-id': "17"
}
},
isInline: false,
isSelfClosing: true,
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
var mainContainerFragment = document.createDocumentFragment();
var bTag6 = document.createElement('b');
mainContainerFragment.appendChild(bTag6);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode20 = document.createTextNode('bug!');
bTag6.appendChild(textNode20);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "17");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode bug.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode bug.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[bug' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/bug]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('ranger', {
tags: {
'b': {
'data-tag-id': "18"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["content"] &&
attributes["content"] !== = '' && attributes.defaultattr) {
attributes["content"] = attributes.defaultattr;
}
if (!attributes["content"] &&
attributes["content"] !== = '' &&
(content || content === '')
) {
attributes["content"] = content;
usedContents.push("content");
}
attributes['content'] =
editor.paramFilters['filterRange'](attributes['content'], 1, 5);
if (attributes['content'] === false) {
console.warn("Attribute content from BBCode ranger failed to validate filterRange");
}
if (!attributes['content'] && attributes['content'] !== '') {
return editor.revertBackToBBCode("ranger", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var bTag7 = document.createElement('b');
mainContainerFragment.appendChild(bTag7);
var textNode21 = document.createTextNode(attributes['content']);
previousType = bTag7.getAttribute('data-bbcode-type');
attrData = bTag7.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "content",
value: editorConstants.VALUE_IN_CONTENT
});
bTag7.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
bTag7.setAttribute('data-bbcode-data', JSON.stringify(attrData))
bTag7.contentEditable = "true";
bTag7.appendChild(textNode21);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "18");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode ranger.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode ranger.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[ranger' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/ranger]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('choicer', {
tags: {
'b': {
'data-tag-id': "19"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["content"] &&
attributes["content"] !== = '' && attributes.defaultattr) {
attributes["content"] = attributes.defaultattr;
}
if (!attributes["content"] &&
attributes["content"] !== = '' &&
(content || content === '')
) {
attributes["content"] = content;
usedContents.push("content");
}
attributes['content'] =
editor.paramFilters['filterRegexp'](attributes['content'], {});
if (attributes['content'] === false) {
console.warn("Attribute content from BBCode choicer failed to validate filterRegexp");
}
if (!attributes['content'] && attributes['content'] !== '') {
return editor.revertBackToBBCode("choicer", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var bTag8 = document.createElement('b');
mainContainerFragment.appendChild(bTag8);
var textNode22 = document.createTextNode(attributes['content']);
previousType = bTag8.getAttribute('data-bbcode-type');
attrData = bTag8.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "content",
value: editorConstants.VALUE_IN_CONTENT
});
bTag8.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
bTag8.setAttribute('data-bbcode-data', JSON.stringify(attrData))
bTag8.contentEditable = "true";
bTag8.appendChild(textNode22);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "19");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode choicer.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode choicer.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[choicer' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/choicer]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('prefilter', {
tags: {
'b': {
'data-tag-id': "20"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["content"] &&
attributes["content"] !== = '' && attributes.defaultattr) {
attributes["content"] = attributes.defaultattr;
}
if (!attributes["content"] &&
attributes["content"] !== = '' &&
(content || content === '')
) {
attributes["content"] = content;
usedContents.push("content");
}
attributes['content'] =
(function(str) {
return str.replace(/["'\\]/g, '\\$&').replace(/\u0000/g, '\\0');
})(attributes['content']);
if (attributes['content'] === false) {
console.warn("Attribute content from BBCode prefilter failed to validate function(str)\n{\n return str.replace(/[\"'\\]/g, '\\$&').replace(/\u0000/g, '\\0');\n}");
}
if (!attributes['content'] && attributes['content'] !== '') {
return editor.revertBackToBBCode("prefilter", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var bTag9 = document.createElement('b');
mainContainerFragment.appendChild(bTag9);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode23 = document.createTextNode('prefiltered:');
bTag9.appendChild(textNode23);
var spanTag6 = document.createElement('span');
bTag9.appendChild(spanTag6);
var textNode24 = document.createTextNode(attributes['content']);
previousType = spanTag6.getAttribute('data-bbcode-type');
attrData = spanTag6.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "content",
value: editorConstants.VALUE_IN_CONTENT
});
spanTag6.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
spanTag6.setAttribute('data-bbcode-data', JSON.stringify(attrData))
spanTag6.contentEditable = "true";
spanTag6.appendChild(textNode24);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "20");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode prefilter.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode prefilter.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[prefilter' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/prefilter]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('postfilter', {
tags: {
'b': {
'data-tag-id': "21"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["content"] &&
attributes["content"] !== = '' && attributes.defaultattr) {
attributes["content"] = attributes.defaultattr;
}
if (!attributes["content"] &&
attributes["content"] !== = '' &&
(content || content === '')
) {
attributes["content"] = content;
usedContents.push("content");
}
attributes['content'] =
(function(str) {
return str.replace(/["'\\]/g, '\\$&').replace(/\u0000/g, '\\0');
})(attributes['content']);
if (attributes['content'] === false) {
console.warn("Attribute content from BBCode postfilter failed to validate function(str)\n{\n return str.replace(/[\"'\\]/g, '\\$&').replace(/\u0000/g, '\\0');\n}");
}
if (!attributes['content'] && attributes['content'] !== '') {
return editor.revertBackToBBCode("postfilter", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var bTag10 = document.createElement('b');
mainContainerFragment.appendChild(bTag10);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode25 = document.createTextNode('postfilter:');
bTag10.appendChild(textNode25);
var spanTag7 = document.createElement('span');
bTag10.appendChild(spanTag7);
var textNode26 = document.createTextNode(attributes['content']);
previousType = spanTag7.getAttribute('data-bbcode-type');
attrData = spanTag7.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "content",
value: editorConstants.VALUE_IN_CONTENT
});
spanTag7.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
spanTag7.setAttribute('data-bbcode-data', JSON.stringify(attrData))
spanTag7.contentEditable = "true";
spanTag7.appendChild(textNode26);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "21");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode postfilter.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode postfilter.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[postfilter' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/postfilter]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
$.sceditor.plugins.bbcode.bbcode.set('defaulted', {
tags: {
'b': {
'data-tag-id': "22"
}
},
isInline: false,
allowedChildren: ['#'],
allowsEmpty: true,
html: function(token, attributes, content) {
var originalAttributes = attributes;
var originalContent = content;
var previousType;
var attrData;
var usedContents = [];
if (!attributes["defaulted"] &&
attributes["defaulted"] !== = '' && attributes.defaultattr) {
attributes["defaulted"] = attributes.defaultattr;
}
if (!attributes["content"] &&
attributes["content"] !== = '' &&
(content || content === '')
) {
attributes["content"] = content;
usedContents.push("content");
}
attributes['defaulted'] =
editor.paramFilters['filterSimpletext'](attributes['defaulted']);
if (attributes['defaulted'] === false) {
console.warn("Attribute defaulted from BBCode defaulted failed to validate filterSimpletext");
}
if (!attributes['defaulted'] && attributes['defaulted'] !== '') {
attributes['defaulted'] = "NONE";
}
if (!attributes['defaulted'] && attributes['defaulted'] !== '') {
return editor.revertBackToBBCode("defaulted", originalAttributes, originalContent);
}
if (!attributes['content'] && attributes['content'] !== '') {
attributes['content'] = "Later!";
}
if (!attributes['content'] && attributes['content'] !== '') {
return editor.revertBackToBBCode("defaulted", originalAttributes, originalContent);
}
var mainContainerFragment = document.createDocumentFragment();
var bTag11 = document.createElement('b');
mainContainerFragment.appendChild(bTag11);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode27 = document.createTextNode('Default:');
bTag11.appendChild(textNode27);
var spanTag8 = document.createElement('span');
bTag11.appendChild(spanTag8);
var textNode28 = document.createTextNode(attributes['defaulted']);
previousType = spanTag8.getAttribute('data-bbcode-type');
attrData = spanTag8.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "defaulted",
value: editorConstants.VALUE_IN_CONTENT
});
spanTag8.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
spanTag8.setAttribute('data-bbcode-data', JSON.stringify(attrData))
spanTag8.contentEditable = "true";
spanTag8.appendChild(textNode28);
< b > [phpBB Debug] PHP Notice < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Undefined index: vars < /b><br / >
< b > [phpBB Debug] PHP Warning < /b>: in file <b>[ROOT]/phpbb / bbcode / convert_editor / sce.php < /b> on line <b>177</b > : < b > Invalid argument supplied
for foreach() < /b><br / >
var textNode29 = document.createTextNode('|||');
bTag11.appendChild(textNode29);
var spanTag9 = document.createElement('span');
bTag11.appendChild(spanTag9);
var textNode30 = document.createTextNode(attributes['content']);
previousType = spanTag9.getAttribute('data-bbcode-type');
attrData = spanTag9.getAttribute('data-bbcode-data') || [];
attrData.push({
name: "content",
value: editorConstants.VALUE_IN_CONTENT
});
spanTag9.setAttribute('data-bbcode-type', (previousType && previousType + '|attr') || 'attr');
spanTag9.setAttribute('data-bbcode-data', JSON.stringify(attrData))
spanTag9.contentEditable = "true";
spanTag9.appendChild(textNode30);
if (mainContainerFragment.firstChild.getAttribute('contentEditable') !== 'yes') {
mainContainerFragment.firstChild.contentEditable = 'false';
}
mainContainerFragment.firstChild.setAttribute('data-tag-id', "22");
return mainContainerFragment.firstChild.outerHTML;
},
format: function(element, content) {
var infos = element.querySelectorAll('[data-bbcode-type]');
var params = [];
var useContent = false;
for (var i = 0; i < infos.length; i++) {
var current = infos[i];
var type = current.getAttribute('data-bbcode-type');
var data = current.getAttribute('data-bbcode-data');
if (!type) {
console.error("To BBCode translation error at BBCode defaulted.\n" + "Unexpected empty data-bbcode-type parameter. Value and node as follows:");
console.error(type);
console.error(current);
return;
}
var types = type.split("|");
var data = JSON.parse(data);
var extraOffset = 0;
for (var j = 0; j < types.length; j++) {
if (types[j] === 'content') {
useContent = true;
extraOffset--;
} else if (types[j] === 'attr') {
var name = data[j + extraOffset].name;
var value = data[j + extraOffset].value;
if (value === editorConstants.VALUE_IN_CONTENT) {
value = current.textContent;
}
params.push(
name + '="' + value + '"'
);
} else {
console.warn("To BBCode translation warning at BBCode defaulted.\n" +
"Unexpected value for data-bbcode-type parameter." +
"Skipping to the next value. Value and node were as follows:");
console.warn(types[j]);
console.warn(types);
console.warn(current);
continue;
}
}
}
return '[defaulted' +
(params ? ' ' : '') +
params.join(' ') +
']' + (useContent ? content : '') + '[/defaulted]';
}
});
})(jQuery, window, document); // Avoid conflicts with other libraries
var editorData = {
'L_CODE': '{L_CODE}',
'L_COLON': '{L_COLON}',
'L_SELECT_ALL_CODE': '{L_SELECT_ALL_CODE}',
'S_VIEWFLASH': '{S_VIEWFLASH}',
'S_VIEWIMG': '{S_VIEWIMG}',
'L_IMAGE': '{L_IMAGE}',
'L_WROTE': '{L_WROTE}',
'': ''
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment