Add 16 colors for color bbcode :(

Bypass Content-Security-Policy
#2
This commit is contained in:
Visman 2023-04-10 00:50:18 +07:00
parent 2a1af5ca23
commit 8a4e51c403
4 changed files with 133 additions and 3 deletions

View file

@ -112,7 +112,7 @@ HANDLER,
],
],
'handler' => <<<'HANDLER'
return "<span style=\"color:{$attrs['Def']};\">{$body}</span>";
return "<span class=\"f-bb-color\" data-bb=\"{$attrs['Def']}\">{$body}</span>";
HANDLER,
],
[
@ -124,7 +124,7 @@ HANDLER,
],
],
'handler' => <<<'HANDLER'
return "<span style=\"color:{$attrs['Def']};\">{$body}</span>";
return "<span class=\"f-bb-color\" data-bb=\"{$attrs['Def']}\">{$body}</span>";
HANDLER,
],
[

View file

@ -30,7 +30,8 @@ ForkBB.editor = (function (doc, win) {
'left,center,right,justify|font,size,color,removeformat|' +
'bulletlist,orderedlist,indent,outdent|' +
'table|code,quote|horizontalrule,image,email,link,unlink|' +
'emoticon,date,time|maximize,source'
'emoticon,date,time|maximize,source',
colors: '#000000,#808080,#C0C0C0,#FFFFFF|#FF00FF,#800080,#FF0000,#800000|#FFFF00,#808000,#00FF00,#008000|#00FFFF,#008080,#0000FF,#000080'
};
function initEditor()

View file

@ -1753,6 +1753,70 @@ body,
font-family: Verdana;
}
#fork .f-bb-color[data-bb="#000000"] {
color: #000000;
}
#fork .f-bb-color[data-bb="#808080"] {
color: #808080;
}
#fork .f-bb-color[data-bb="#C0C0C0"] {
color: #C0C0C0;
}
#fork .f-bb-color[data-bb="#FFFFFF"] {
color: #FFFFFF;
}
#fork .f-bb-color[data-bb="#FF00FF"] {
color: #FF00FF;
}
#fork .f-bb-color[data-bb="#800080"] {
color: #800080;
}
#fork .f-bb-color[data-bb="#FF0000"] {
color: #FF0000;
}
#fork .f-bb-color[data-bb="#800000"] {
color: #800000;
}
#fork .f-bb-color[data-bb="#FFFF00"] {
color: #FFFF00;
}
#fork .f-bb-color[data-bb="#808000"] {
color: #808000;
}
#fork .f-bb-color[data-bb="#00FF00"] {
color: #00FF00;
}
#fork .f-bb-color[data-bb="#008000"] {
color: #008000;
}
#fork .f-bb-color[data-bb="#00FFFF"] {
color: #00FFFF;
}
#fork .f-bb-color[data-bb="#008080"] {
color: #008080;
}
#fork .f-bb-color[data-bb="#0000FF"] {
color: #0000FF;
}
#fork .f-bb-color[data-bb="#000080"] {
color: #000080;
}
/****************/
/* Предпросмотр */
/****************/

View file

@ -528,3 +528,68 @@ body.sceditor-maximize {
right: auto;
left: 0;
}
/* forkbb */
.sceditor-color-option[data-color="#000000"] {
background-color: #000000;
}
.sceditor-color-option[data-color="#808080"] {
background-color: #808080;
}
.sceditor-color-option[data-color="#C0C0C0"] {
background-color: #C0C0C0;
}
.sceditor-color-option[data-color="#FFFFFF"] {
background-color: #FFFFFF;
}
.sceditor-color-option[data-color="#FF00FF"] {
background-color: #FF00FF;
}
.sceditor-color-option[data-color="#800080"] {
background-color: #800080;
}
.sceditor-color-option[data-color="#FF0000"] {
background-color: #FF0000;
}
.sceditor-color-option[data-color="#800000"] {
background-color: #800000;
}
.sceditor-color-option[data-color="#FFFF00"] {
background-color: #FFFF00;
}
.sceditor-color-option[data-color="#808000"] {
background-color: #808000;
}
.sceditor-color-option[data-color="#00FF00"] {
background-color: #00FF00;
}
.sceditor-color-option[data-color="#008000"] {
background-color: #008000;
}
.sceditor-color-option[data-color="#00FFFF"] {
background-color: #00FFFF;
}
.sceditor-color-option[data-color="#008080"] {
background-color: #008080;
}
.sceditor-color-option[data-color="#0000FF"] {
background-color: #0000FF;
}
.sceditor-color-option[data-color="#000080"] {
background-color: #000080;
}