FSN#35474 [PRE] is beter dan [XMP]. Ook [CODE] ondersteunen

svn path=/Website/trunk/; revision=28755
This commit is contained in:
Jos Groot Lipman
2016-04-05 13:29:34 +00:00
parent 55cc0a2e37
commit b80bc4d8cb
3 changed files with 82 additions and 22 deletions

View File

@@ -745,7 +745,7 @@ safe = {
// Pas die eventueel ook aan
fclthtml: function (waarde, mldlink)
{
var safepairs = "h1,h2,h3,h4,h5,h6,b,i,u,em,strong,small,big,th,td,tr,table,xmp".split(",");
var safepairs = "h1,h2,h3,h4,h5,h6,b,i,u,em,strong,small,big,th,td,tr,table,pre,code".split(",");
var safehtml = safe.html(waarde); // Let op: vervangt *alle* \n door <br>. Dat gaan we deels later nog terugdraaien
// We hebben het wel *nodig* omdat .* niet over meerdere regels werkt (hoewel dat
// weer oplosbaar schijnt te zijn met [\s\S])
@@ -776,13 +776,18 @@ safe = {
}
// Nu alle <br>'s binnen <pre> terugzetten
var matches = safehtml.match(/<xmp(?:.*?)>(?:.*?)<\/xmp>/g);
var matches = safehtml.match(/<pre(?:.*?)>(?:.*?)<\/pre>/g);
if (!matches)
matches = safehtml.match(/<code(?:.*?)>(?:.*?)<\/code>/g);
if (matches)
{
var len = matches.length;
var i;
for (i = 0; i < len; i++) {
safehtml = safehtml.replace(matches[i], matches[i].replace(/<br(?:.*?)>/g, '\n'));
for (i = 0; i < len; i++)
{
var pre = matches[i];
pre = pre.replace(/<br(?:.*?)>/g, '\n');
safehtml = safehtml.replace(matches[i], pre);
}
}
return safehtml;

View File

@@ -38,8 +38,12 @@ div {
table { /* om border om lege cellen te houden */
border-collapse: collapse;
}
pre {
line-height: 1.2em;
pre, xmp, code {
font-size: 1.3em;
line-height: 1.3em!important;
font-style: normal;
white-space: pre;
display:block; /* Zo gebruiken wij <code> die eigenlijk inline is */
}
strong{
}
@@ -1193,7 +1197,7 @@ input.details, span.details, a.details {
#mldBehandel a.details, #mldClose a.details {
color: ==blockheadercolor==;
}
}
label.cadselect {
cursor: pointer;
@@ -1276,6 +1280,44 @@ div#edit {
/* padding: 30px 10px 0 2px; */
}
.mldhandlinghead {
margin-top: 10px;
border-bottom: 1px solid #ddd;
filter: alpha(opacity=70);
opacity: 0.7;
}
.mldhandlingdiv {
background-color: #fefefe;
line-height: 1.6em;
}
.mldhandlingul li textarea#note {
vertical-align: top;
}
.mldhtime {
filter: alpha(opacity=50);
opacity: 0.5;
font-size: 0.7em;
text-align: center;
padding-top: 4px!important;
}
.mldnoteedit {
filter: alpha(opacity=100);
opacity: 1;
vertical-align: bottom;
}
.mldgotop {
float: right;
}
.mldhandlingfield {
font-weight: 600;
}
.mldhandlingnote {
font-style: italic;
}
/* headerstyles, usually to be overruled */
#header
{
@@ -1327,9 +1369,18 @@ div#edit {
border-bottom: 1px solid #eee;
padding: 4px 3px 7px 3px;
}
td.rsfooter
.rstable tfoot td
{
border: 0px;
background-color: ==blockheaderbackgroundcolor==;
color: ==blockheadercolor==;
cursor: auto;
}
.rstable tfoot .rsfooter
{
padding: 3px 3px 2px 3px;
color: ==frameheadercolor==;
background-color: ==frameheaderbackgroundcolor== !important;
}
.rstable input[type=text]
{
@@ -1346,13 +1397,6 @@ td.rsfooter
{
cursor:pointer;
}
.rstable tfoot td
{
border: 0px;
background-color: ==blockheaderbackgroundcolor==;
color: ==blockheadercolor==;
cursor: auto;
}
.rstable.sortable tfoot td img
{
/* margin-left:10px;*/
@@ -2057,6 +2101,7 @@ div#statusboxes {
#bezettingInfo,
#cntSplit,
#finItems,
#mldHistorie,
#mldBehandel,
#mldOmschrijving,
#mldUitvoerenInfo,
@@ -2273,7 +2318,7 @@ input.materiaal
width: 346px;
}
.fldflex, .fldflexC, .fldflexC50, .fldflexX, .fldflexL, .fldflexQ, .fldflexF, .fldflexM, .fldflexE, .fldflexS,
.fldSflex, .fldSflexC, .fldSflexX, .fldSflexL, .fldSflexQ, .fldSflexF, .fldSflexM, .fldSflexE, .fldSflexS,
.fldSflex, .fldSflexC, .fldSflexX, .fldSflexL, .fldSflexQ, .fldSflexF, .fldSflexM, .fldSflexE, .fldSflexS
{
width: 340px;
}

View File

@@ -87,7 +87,7 @@
function fclthtml(nodelist) {
var waarde = nodelist.nextNode().text;
var safepairs = "h1,h2,h3,h4,h5,h6,b,i,u,em,strong,small,big,th,td,tr,table,xmp".split(",");
var safepairs = "h1,h2,h3,h4,h5,h6,b,i,u,em,strong,small,big,th,td,tr,table,pre,code".split(",");
var safehtml = safe.html(waarde); // Let op: vervangt *alle* \n door <br>. Dat gaan we deels later nog terugdraaien
// We hebben het wel *nodig* omdat .* niet over meerdere regels werkt (hoewel dat
// weer oplosbaar schijnt te zijn met [\s\S])
@@ -117,13 +117,18 @@
}
// Nu de <br>'s binnen <pre> terugzetten
var matches = safehtml.match(/<xmp(?:.*?)>(?:.*?)<\/xmp>/g);
var matches = safehtml.match(/<pre(?:.*?)>(?:.*?)<\/pre>/g);
if (!matches)
matches = safehtml.match(/<code(?:.*?)>(?:.*?)<\/code>/g);
if (matches)
{
var len = matches.length;
var i;
for (i = 0; i < len; i++) {
safehtml = safehtml.replace(matches[i], matches[i].replace(/<br(?:.*?)>/g, '\r')); // een \n wordt toch een <br>?
for (i = 0; i < len; i++)
{
var pre = matches[i];
pre = pre.replace(/<br(?:.*?)>/g, '\r'); // een \n wordt toch een <br>?
safehtml = safehtml.replace(matches[i], pre);
}
}
return safehtml;
@@ -261,6 +266,11 @@
padding-left: 2px;
padding-right: 2px;
}
pre, xmp, code {
font-style: normal;
white-space: pre;
display:block;
}
</style>
</xsl:template>