Ticket #901: 901_5.patch

File 901_5.patch, 28.4 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

Revised patch

  • _samples/assets/parsesample.css

     
     1body { background: #fff; color: #000; margin: 10px; padding: 0; }
     2body, th, td {
     3 font: normal 13px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;
     4}
     5h1, h2, h3, h4 {
     6 font-family: Arial,Verdana,'Bitstream Vera Sans',Helvetica,sans-serif;
     7 font-weight: bold;
     8 letter-spacing: -0.018em;
     9 page-break-after: avoid;
     10}
     11h1 { font-size: 19px; margin: .15em 1em 0.5em 0 }
     12h2 { font-size: 16px }
     13h3 { font-size: 14px }
     14hr { border: none;  border-top: 1px solid #ccb; margin: 2em 0 }
     15address { font-style: normal }
     16img { border: none }
     17
     18.underline { text-decoration: underline }
     19ol.loweralpha { list-style-type: lower-alpha }
     20ol.upperalpha { list-style-type: upper-alpha }
     21ol.lowerroman { list-style-type: lower-roman }
     22ol.upperroman { list-style-type: upper-roman }
     23ol.arabic     { list-style-type: decimal }
     24
     25/* Link styles */
     26:link, :visited {
     27 text-decoration: none;
     28 color: #b00;
     29 border-bottom: 1px dotted #bbb;
     30}
     31:link:hover, :visited:hover { background-color: #eee; color: #555 }
     32h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited,
     33h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited {
     34 color: inherit;
     35}
     36.trac-rawlink { border-bottom: none }
     37
     38/* Heading anchors */
     39.anchor:link, .anchor:visited {
     40 border: none;
     41 color: #d7d7d7;
     42 font-size: .8em;
     43 vertical-align: text-top;
     44}
     45* > .anchor:link, * > .anchor:visited {
     46 visibility: hidden;
     47}
     48h1:hover .anchor, h2:hover .anchor, h3:hover .anchor,
     49h4:hover .anchor, h5:hover .anchor, h6:hover .anchor {
     50 visibility: visible;
     51}
     52
     53@media screen {
     54 a.ext-link .icon {
     55  background: url(../extlink.gif) center center no-repeat;
     56  padding-left: 12px;
     57 }
     58 a.mail-link .icon {
     59  background: url(../envelope.png) center center no-repeat;
     60  padding-left: 14px;
     61 }
     62}
     63
     64/* Forms */
     65input, textarea, select { margin: 2px }
     66input, select { vertical-align: middle }
     67input[type=button], input[type=submit], input[type=reset] {
     68 background: #eee;
     69 color: #222;
     70 border: 1px outset #ccc;
     71 padding: .1em .5em;
     72}
     73input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
     74 background: #ccb;
     75}
     76input[type=button][disabled], input[type=submit][disabled],
     77input[type=reset][disabled] {
     78 background: #f6f6f6;
     79 border-style: solid;
     80 color: #999;
     81}
     82input[type=text], input.textwidget, textarea { border: 1px solid #d7d7d7 }
     83input[type=text], input.textwidget { padding: .25em .5em }
     84input[type=text]:focus, input.textwidget:focus, textarea:focus {
     85 border: 1px solid #886;
     86}
     87option { border-bottom: 1px dotted #d7d7d7 }
     88fieldset { border: 1px solid #d7d7d7; padding: .5em; margin: 1em 0 }
     89form p.hint, form span.hint { color: #666; font-size: 85%; font-style: italic; margin: .5em 0;
     90  padding-left: 1em;
     91}
     92fieldset.iefix {
     93  background: transparent;
     94  border: none;
     95  padding: 0;
     96  margin: 0;
     97}
     98* html fieldset.iefix { width: 98% }
     99fieldset.iefix p { margin: 0 }
     100legend { color: #999; padding: 0 .25em; font-size: 90%; font-weight: bold }
     101label.disabled { color: #d7d7d7 }
     102.buttons { margin: .5em .5em .5em 0 }
     103.buttons form, .buttons form div { display: inline }
     104.buttons input { margin: 1em .5em .1em 0 }
     105.inlinebuttons input {
     106 font-size: 70%;
     107 border-width: 1px;
     108 border-style: dotted;
     109 margin: 0 .1em;
     110 padding: 0.1em;
     111 background: none;
     112}
     113
     114/* Header */
     115#header hr { display: none }
     116#header h1 { margin: 1.5em 0 -1.5em; }
     117#header img { border: none; margin: 0 0 -3em }
     118#header :link, #header :visited, #header :link:hover, #header :visited:hover {
     119 background: transparent;
     120 color: #555;
     121 margin-bottom: 2px;
     122 border: none;
     123}
     124#header h1 :link:hover, #header h1 :visited:hover { color: #000 }
     125
     126/* Quick search */
     127#search {
     128 clear: both;
     129 font-size: 10px;
     130 height: 2.2em;
     131 margin: 0 0 1em;
     132 text-align: right;
     133}
     134#search input { font-size: 10px }
     135#search label { display: none }
     136
     137/* Navigation */
     138.nav h2, .nav hr { display: none }
     139.nav ul { font-size: 10px; list-style: none; margin: 0; text-align: right }
     140.nav li {
     141 border-right: 1px solid #d7d7d7;
     142 display: inline;
     143 padding: 0 .75em;
     144 white-space: nowrap;
     145}
     146.nav li.last { border-right: none }
     147
     148/* Main navigation bar */
     149#mainnav {
     150 background: #f7f7f7 url(../topbar_gradient.png) 0 0;
     151 border: 1px solid #000;
     152 font: normal 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
     153 margin: .66em 0 .33em;
     154 padding: .2em 0;
     155}
     156#mainnav li { border-right: none; padding: .25em 0 }
     157#mainnav :link, #mainnav :visited {
     158 background: url(../dots.gif) 0 0 no-repeat;
     159 border-right: 1px solid #fff;
     160 border-bottom: none;
     161 border-left: 1px solid #555;
     162 color: #000;
     163 padding: .2em 20px;
     164}
     165* html #mainnav :link, * html #mainnav :visited { background-position: 1px 0 }
     166#mainnav :link:hover, #mainnav :visited:hover {
     167 background-color: #ccc;
     168 border-right: 1px solid #ddd;
     169}
     170#mainnav .active :link, #mainnav .active :visited {
     171 background: #333 url(../topbar_gradient2.png) 0 0 repeat-x;
     172 border-top: none;
     173 border-right: 1px solid #000;
     174 color: #eee;
     175 font-weight: bold;
     176}
     177#mainnav .active :link:hover, #mainnav .active :visited:hover {
     178 border-right: 1px solid #000;
     179}
     180
     181/* Context-dependent navigation links */
     182#ctxtnav { height: 1em }
     183#ctxtnav li ul {
     184 background: #f7f7f7;
     185 color: #ccc;
     186 border: 1px solid;
     187 padding: 0;
     188 display: inline;
     189 margin: 0;
     190}
     191#ctxtnav li li { padding: 0; }
     192#ctxtnav li li :link, #ctxtnav li li :visited { padding: 0 1em }
     193#ctxtnav li li :link:hover, #ctxtnav li li :visited:hover {
     194 background: #bba;
     195 color: #fff;
     196}
     197
     198/* Alternate links */
     199#altlinks { clear: both; text-align: center }
     200#altlinks h3 { font-size: 12px; letter-spacing: normal; margin: 0 }
     201#altlinks ul { list-style: none; margin: 0; padding: 0 0 1em }
     202#altlinks li {
     203 border-right: 1px solid #d7d7d7;
     204 display: inline;
     205 font-size: 11px;
     206 line-height: 1.5;
     207 padding: 0 1em;
     208 white-space: nowrap;
     209}
     210#altlinks li.last { border-right: none }
     211#altlinks li :link, #altlinks li :visited {
     212 background-repeat: no-repeat;
     213 color: #666;
     214 border: none;
     215 padding: 0 0 2px;
     216}
     217#altlinks li a.ics { background-image: url(../ics.png); padding-left: 22px }
     218#altlinks li a.rss { background-image: url(../feed.png); padding-left: 20px }
     219
     220/* Footer */
     221#footer {
     222  clear: both;
     223  color: #bbb;
     224  font-size: 10px;
     225  border-top: 1px solid;
     226  height: 31px;
     227  padding: .25em 0;
     228}
     229#footer :link, #footer :visited { color: #bbb; }
     230#footer hr { display: none }
     231#footer #tracpowered { border: 0; float: left }
     232#footer #tracpowered:hover { background: transparent }
     233#footer p { margin: 0 }
     234#footer p.left {
     235  float: left;
     236  margin-left: 1em;
     237  padding: 0 1em;
     238  border-left: 1px solid #d7d7d7;
     239  border-right: 1px solid #d7d7d7;
     240}
     241#footer p.right {
     242  float: right;
     243  text-align: right;
     244}
     245
     246#content { padding-bottom: 2em; position: relative }
     247
     248#help {
     249 clear: both;
     250 color: #999;
     251 font-size: 90%;
     252 margin: 1em;
     253 text-align: right;
     254}
     255#help :link, #help :visited { cursor: help }
     256#help hr { display: none }
     257
     258/* Page preferences form */
     259#prefs {
     260 background: #f7f7f0;
     261 border: 1px outset #998;
     262 float: right;
     263 font-size: 9px;
     264 padding: .8em;
     265 position: relative;
     266 margin: 0 1em 1em;
     267}
     268* html #prefs { width: 26em } /* Set width only for IE */
     269#prefs input, #prefs select { font-size: 9px; vertical-align: middle }
     270#prefs fieldset {
     271 background: transparent;
     272 border: none;
     273 margin: .5em;
     274 padding: 0;
     275}
     276#prefs fieldset legend {
     277 background: transparent;
     278 color: #000;
     279 font-size: 9px;
     280 font-weight: normal;
     281 margin: 0 0 0 -1.5em;
     282 padding: 0;
     283}
     284#prefs .buttons { text-align: right }
     285
     286/* Version information (browser, wiki, attachments) */
     287#info {
     288 margin: 1em 0 0 0;
     289 background: #f7f7f0;
     290 border: 1px solid #d7d7d7;
     291 border-collapse: collapse;
     292 border-spacing: 0;
     293 clear: both;
     294 width: 100%;
     295}
     296#info th, #info td { font-size: 85%; padding: 2px .5em; vertical-align: top }
     297#info th { font-weight: bold; text-align: left; white-space: nowrap }
     298#info td.message { width: 100% }
     299#info .message ul { padding: 0; margin: 0 2em }
     300#info .message p { margin: 0; padding: 0 }
     301
     302/* Wiki */
     303.wikipage { padding-left: 18px }
     304.wikipage h1, .wikipage h2, .wikipage h3 { margin-left: -18px }
     305
     306a.missing:link, a.missing:visited, a.missing, span.missing,
     307a.forbidden, span.forbidden { color: #998 }
     308a.missing:hover { color: #000 }
     309a.closed:link, a.closed:visited, span.closed { text-decoration: line-through }
     310
     311/* User-selectable styles for blocks */
     312.important {
     313 background: #fcb;
     314 border: 1px dotted #d00;
     315 color: #500;
     316 padding: 0 .5em 0 .5em;
     317 margin: .5em;
     318}
     319
     320dl.wiki dt { font-weight: bold }
     321dl.compact dt { float: left; padding-right: .5em }
     322dl.compact dd { margin: 0; padding: 0 }
     323
     324pre.wiki, pre.literal-block {
     325 background: #f7f7f7;
     326 border: 1px solid #d7d7d7;
     327 margin: 1em 1.75em;
     328 padding: .25em;
     329 overflow: auto;
     330}
     331
     332blockquote.citation {
     333 margin: -0.6em 0;
     334 border-style: solid;
     335 border-width: 0 0 0 2px;
     336 padding-left: .5em;
     337 border-color: #b44;
     338}
     339.citation blockquote.citation { border-color: #4b4; }
     340.citation .citation blockquote.citation { border-color: #44b; }
     341.citation .citation .citation blockquote.citation { border-color: #c55; }
     342
     343table.wiki {
     344 border: 2px solid #ccc;
     345 border-collapse: collapse;
     346 border-spacing: 0;
     347}
     348table.wiki td { border: 1px solid #ccc;  padding: .1em .25em; }
     349
     350.wikitoolbar {
     351 margin-top: 0.3em;
     352 margin-left: 2px;
     353 border: solid #d7d7d7;
     354 border-width: 1px 1px 1px 0;
     355 height: 18px;
     356 width: 234px;
     357}
     358.wikitoolbar :link, .wikitoolbar :visited {
     359 background: transparent url(../edit_toolbar.png) no-repeat;
     360 border: 1px solid #fff;
     361 border-left-color: #d7d7d7;
     362 cursor: default;
     363 display: block;
     364 float: left;
     365 width: 24px;
     366 height: 16px;
     367}
     368.wikitoolbar :link:hover, .wikitoolbar :visited:hover {
     369 background-color: transparent;
     370 border: 1px solid #fb2;
     371}
     372.wikitoolbar a#em { background-position: 0 0 }
     373.wikitoolbar a#strong { background-position: 0 -16px }
     374.wikitoolbar a#heading { background-position: 0 -32px }
     375.wikitoolbar a#link { background-position: 0 -48px }
     376.wikitoolbar a#code { background-position: 0 -64px }
     377.wikitoolbar a#hr { background-position: 0 -80px }
     378.wikitoolbar a#np { background-position: 0 -96px }
     379.wikitoolbar a#br { background-position: 0 -112px }
     380.wikitoolbar a#img { background-position: 0 -128px }
     381
     382/* Styles for the form for adding attachments. */
     383#attachment .field { margin-top: 1.3em }
     384#attachment label { padding-left: .2em }
     385#attachment fieldset { margin-top: 2em }
     386#attachment fieldset .field { float: left; margin: 0 1em .5em 0 }
     387#attachment .options { float: left; padding: 0 0 1em 1em }
     388#attachment br { clear: left }
     389.attachment #preview { margin-top: 1em }
     390
     391/* Styles for the list of attachments. */
     392#attachments { border: 1px outset #996; padding: 1em }
     393#attachments .attachments { margin-left: 2em; padding: 0 }
     394#attachments dt { display: list-item; list-style: square; }
     395#attachments dd { font-style: italic; margin-left: 0; padding-left: 0; }
     396
     397/* Styles for tabular listings such as those used for displaying directory
     398   contents and report results. */
     399table.listing {
     400 clear: both;
     401 border-bottom: 1px solid #d7d7d7;
     402 border-collapse: collapse;
     403 border-spacing: 0;
     404 margin-top: 1em;
     405 width: 100%;
     406}
     407table.listing th { text-align: left; padding: 0 1em .1em 0; font-size: 12px }
     408table.listing thead { background: #f7f7f0 }
     409table.listing thead th {
     410 border: 1px solid #d7d7d7;
     411 border-bottom-color: #999;
     412 font-size: 11px;
     413 font-weight: bold;
     414 padding: 2px .5em;
     415 vertical-align: bottom;
     416}
     417table.listing thead th :link:hover, table.listing thead th :visited:hover {
     418 background-color: transparent;
     419}
     420table.listing thead th a { border: none; padding-right: 12px }
     421table.listing th.asc a, table.listing th.desc a { font-weight: bold }
     422table.listing th.asc a, table.listing th.desc a {
     423 background-position: 100% 50%;
     424 background-repeat: no-repeat;
     425}
     426table.listing th.asc a { background-image: url(../asc.png) }
     427table.listing th.desc a { background-image: url(../desc.png) }
     428table.listing tbody td, table.listing tbody th {
     429 border: 1px dotted #ddd;
     430 padding: .3em .5em;
     431 vertical-align: top;
     432}
     433table.listing tbody td a:hover, table.listing tbody th a:hover {
     434 background-color: transparent;
     435}
     436table.listing tbody tr { border-top: 1px solid #ddd }
     437table.listing tbody tr.even { background-color: #fcfcfc }
     438table.listing tbody tr.odd { background-color: #f7f7f7 }
     439table.listing tbody tr:hover { background: #eed !important }
     440table.listing tbody tr.focus { background: #ddf !important }
     441
     442/* Styles for the page history table
     443   (extends the styles for "table.listing") */
     444#fieldhist td { padding: 0 .5em }
     445#fieldhist td.date, #fieldhist td.diff, #fieldhist td.version,
     446#fieldhist td.author {
     447 white-space: nowrap;
     448}
     449#fieldhist td.version { text-align: center }
     450#fieldhist td.comment { width: 100% }
     451
     452/* Auto-completion interface */
     453.suggestions { background: #fff; border: 1px solid #886; color: #222; }
     454.suggestions ul {
     455  font-family: sans-serif;
     456  max-height: 20em;
     457  min-height: 3em;
     458  list-style: none;
     459  margin: 0;
     460  overflow: auto;
     461  padding: 0;
     462  width: 440px;
     463}
     464* html .suggestions ul { height: 10em; }
     465.suggestions li { background: #fff; cursor: pointer; padding: 2px 5px }
     466.suggestions li.selected { background: #b9b9b9 }
     467
     468/* Styles for the error page (and rst errors) */
     469#content.error .message, div.system-message {
     470 background: #fdc;
     471 border: 2px solid #d00;
     472 color: #500;
     473 padding: .5em;
     474 margin: 1em 0;
     475}
     476#content.error div.message pre, div.system-message pre {
     477  margin-left: 1em;
     478  overflow: hidden;
     479  white-space: normal;
     480}
     481div.system-message p { margin: 0; }
     482div.system-message p.system-message-title { font-weight: bold; }
     483
     484#warning.system-message { background: #ffb; border: 1px solid #000; }
     485#warning.system-message li { list-style-type: square; }
     486
     487#notice.system-message { background: #dfd; border: 1px solid #000; }
     488#notice.system-message li { list-style-type: square; }
     489
     490#content.error form.newticket { display: inline; }
     491#content.error form.newticket textarea { display: none; }
     492
     493#content.error #systeminfo { margin: 1em; width: auto; }
     494#content.error #systeminfo th { font-weight: bold; text-align: right; }
     495
     496#content.error #traceback { margin-left: 1em; }
     497#content.error #traceback :link, #content.error #traceback :visited {
     498  border: none;
     499}
     500#content.error #tbtoggle { font-size: 80%; }
     501#content.error #traceback div { margin-left: 1em; }
     502#content.error #traceback h3 { font-size: 95%; margin: .5em 0 0; }
     503#content.error #traceback :link var, #content.error #traceback :visited var {
     504  font-family: monospace;
     505  font-style: normal;
     506  font-weight: bold;
     507}
     508#content.error #traceback span.file { color: #666; font-size: 85%; }
     509#content.error #traceback ul { list-style: none; margin: .5em 0; padding: 0; }
     510#content.error #traceback ol {
     511  border: 1px dotted #d7d7d7;
     512  color: #999;
     513  font-size: 85%;
     514  line-height: 1;
     515  margin: .5em 0;
     516}
     517#content.error #traceback ol li { white-space: pre; }
     518#content.error #traceback ol li.current { background: #e6e6e6; color: #333; }
     519#content.error #traceback ol li code { color: #666; }
     520#content.error #traceback ol li.current code { color: #000; }
     521#content.error #traceback table { margin: .5em 0 1em;  }
     522#content.error #traceback th, #content.error #traceback td {
     523  font-size: 85%; padding: 1px;
     524}
     525#content.error #traceback th var {
     526  font-family: monospace;
     527  font-style: normal;
     528}
     529#content.error #traceback td code { white-space: pre; }
     530#content.error #traceback pre { font-size: 95%; }
     531
     532#content .paging { margin: 0 0 2em; padding: .5em 0 0;
     533  font-size: 85%; line-height: 2em; text-align: center;
     534}
     535#content .paging .current {
     536  padding: .1em .3em;
     537  border: 1px solid #333;
     538  background: #999; color: #fff;
     539}
     540
     541#content .paging :link, #content .paging :visited {
     542  padding: .1em .3em;
     543  border: 1px solid #666;
     544  background: transparent; color: #666;
     545}
     546#content .paging :link:hover, #content .paging :visited:hover {
     547  background: #999; color: #fff;  border-color: #333;
     548}
     549#content .paging .previous a,
     550#content .paging .next a {
     551  font-size: 150%; font-weight: bold; border: none;
     552}
     553#content .paging .previous a:hover,
     554#content .paging .next a:hover {
     555  background: transparent; color: #666;
     556}
     557
     558#content h2 .numresults { color: #666; font-size: 90%; }
     559
     560/* Styles for search word highlighting */
     561@media screen {
     562 .searchword0 { background: #ff9 }
     563 .searchword1 { background: #cfc }
     564 .searchword2 { background: #cff }
     565 .searchword3 { background: #ccf }
     566 .searchword4 { background: #fcf }
     567}
     568
     569@media print {
     570 #header, #altlinks, #footer, #help { display: none }
     571 .nav, form, .buttons form, form .buttons, form .inlinebuttons,
     572 .noprint, .trac-rawlink {
     573   display: none;
     574 }
     575 form.printableform { display: block }
     576}
  • _samples/index.html

     
    7979                <li><a class="samples" href="output_for_flash.html">Output for Flash</a><br />
    8080                        Configuring CKEditor to produce HTML code that can be used with Adobe Flash.
    8181                </li>
     82        </ul>
     83        <h2 class="samples">
     84                Additional plugins
     85        </h2>
     86        <ul class="samples">
    8287                <li><a class="samples" href="placeholder.html">Placeholder plugin</a><br />
    8388                        Using the Placeholder plugin to create uneditable sections that can only be created and modified with a proper dialog window.
    8489                </li>
    8590                <li><a class="samples" href="devtools.html">Developer Tools plugin</a><br />
    8691                        Using the Developer Tools plugin to display information about dialog window UI elements to allow for easier customization.
    8792                </li>
     93                <li><a class="samples" href="stylesheetparser.html">Stylesheet parser plugin</a><br />
     94                        The Stylesheet Parser plugin fills the Styles combo based on the css classes available in the document stylesheet.
     95                </li>
    8896        </ul>
    8997        <div id="footer">
    9098                <hr />
  • _samples/stylesheetparser.html

     
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2<!--
     3Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
     4For licensing, see LICENSE.html or http://ckeditor.com/license
     5-->
     6<html xmlns="http://www.w3.org/1999/xhtml">
     7<head>
     8        <title>Using Stylesheet Parser Plugin &mdash; CKEditor Sample</title>
     9        <meta content="text/html; charset=utf-8" http-equiv="content-type" />
     10        <!-- CKReleaser %REMOVE_LINE%
     11        <script type="text/javascript" src="../ckeditor.js"></script>
     12        CKReleaser %REMOVE_START% -->
     13        <script type="text/javascript" src="../ckeditor_source.js"></script>
     14        <!-- CKReleaser %REMOVE_END% -->
     15        <script src="sample.js" type="text/javascript"></script>
     16        <link href="sample.css" rel="stylesheet" type="text/css" />
     17</head>
     18<body>
     19        <h1 class="samples">
     20                CKEditor Sample &mdash; Using the Stylesheet Parser Plugin
     21        </h1>
     22        <div class="description">
     23        <p>
     24                This sample shows how to configure CKEditor instances to use the
     25                <strong>Stylesheet Parser</strong> (<code>stylesheetparser</code>) plugin that fills
     26                the Styles combo based on the CSS rules available in the document stylesheet.
     27        </p>
     28        <p>
     29                To add a CKEditor instance using the <strong>stylesheetparser</strong> plugin, insert
     30                the following JavaScript call into your code:
     31        </p>
     32        <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',
     33        {
     34                <strong>extraPlugins : 'stylesheetparser'</strong>
     35        });</pre>
     36        <p>
     37                Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
     38                the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
     39        </p>
     40        </div>
     41
     42        <!-- This <div> holds alert messages to be display in the sample page. -->
     43        <div id="alerts">
     44                <noscript>
     45                        <p>
     46                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
     47                                support, like yours, you should still see the contents (HTML data) and you should
     48                                be able to edit it normally, without a rich editor interface.
     49                        </p>
     50                </noscript>
     51        </div>
     52        <form action="sample_posteddata.php" method="post">
     53                <p>
     54                        <label for="editor1">
     55                                Editor 1:</label>
     56                        <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
     57                        <script type="text/javascript">
     58                        //<![CDATA[
     59
     60                                // This call can be placed at any point after the
     61                                // <textarea>, or inside a <head><script> in a
     62                                // window.onload event handler.
     63
     64                                // Replace the <textarea id="editor"> with an CKEditor
     65                                // instance, using default configurations.
     66                                CKEDITOR.replace( 'editor1' ,
     67                                {
     68                                        extraPlugins : 'stylesheetparser',
     69                                        /*
     70                                         * Style sheet for the contents
     71                                         */
     72                                        contentsCss : 'assets/parsesample.css',
     73                                        /*
     74                                         *  Don't load the default Styles configuration
     75                                         */
     76                                        stylesSet : []
     77                                });
     78
     79                        //]]>
     80                        </script>
     81                </p>
     82                <p>
     83                        <input type="submit" value="Submit" />
     84                </p>
     85        </form>
     86        <div id="footer">
     87                <hr />
     88                <p>
     89                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
     90                </p>
     91                <p id="copy">
     92                        Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
     93                        Knabben. All rights reserved.
     94                </p>
     95        </div>
     96</body>
     97</html>
  • _source/plugins/stylescombo/plugin.js

     
    1414                        var config = editor.config,
    1515                                lang = editor.lang.stylesCombo,
    1616                                styles = {},
    17                                 stylesList = [];
     17                                stylesList = [],
     18                                combo;
    1819
    1920                        function loadStylesSet( callback )
    2021                        {
     
    6263
    6364                                        init : function()
    6465                                        {
    65                                                 var combo = this;
     66                                                combo = this;
    6667
    6768                                                loadStylesSet( function()
    6869                                                        {
     
    181182
    182183                                                if ( !counter[ CKEDITOR.STYLE_OBJECT ] )
    183184                                                        this.hideGroup( lang[ 'panelTitle' + String( CKEDITOR.STYLE_OBJECT ) ] );
     185                                        },
     186
     187                                        // Force a reload of the data
     188                                        reset: function()
     189                                        {
     190                                                if ( combo )
     191                                                {
     192                                                        delete combo._.panel;
     193                                                        delete combo._.list;
     194                                                        combo._.committed = 0;
     195                                                        combo._.items = {};
     196                                                        combo._.state = CKEDITOR.TRISTATE_OFF;
     197                                                }
     198                                                styles = {};
     199                                                stylesList = [];
     200                                                loadStylesSet();
    184201                                        }
    185202                                });
    186203
  • _source/plugins/stylesheetparser/plugin.js

    Property changes on: _source\plugins\stylesheetparser
    ___________________________________________________________________
    Added: bugtraq:label
       + Ticket
    Added: bugtraq:url
       + http://dev.ckeditor.com/ticket/%BUGID%
    Added: webviewer:pathrevision
       + http://dev.fckeditor.net/browser/%PATH%?rev=%REVISION% 
    Added: webviewer:revision
       + http://dev.fckeditor.net/changeset/%REVISION%
    Added: bugtraq:logregex
       + (?:ticket: *|#)(\d+) *(?:, *(\d+))*
    
    
     
     1/*
     2Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6/**
     7 * @stylesheetParser plugin.
     8 */
     9
     10(function()
     11{
     12                // Rules that must be skipped
     13        var skipSelectors,
     14                // Rules that are valid
     15                validSelectors;
     16
     17        // We want to extract only the elements with classes defined in the stylesheets:
     18        function parseClasses( aRules )
     19        {
     20                // aRules are just the different rules in the style sheets
     21                // We want to merge them and them split them by commas, so we end up with only
     22                // the selectors
     23                var s = aRules.join(' ');
     24                // Remove selectors splitting the elements, leave only the class selector (.)
     25                s = s.replace( /(,|>|\+|~)/g, ' ' );
     26                // Remove attribute selectors: table[border="0"]
     27                s = s.replace( /\[[^\]]*/g, '' );
     28                // Remove Ids: div#main
     29                s = s.replace( /#[^\s]*/g, '' );
     30                // Remove pseudo-selectors and pseudo-elements: :hover :nth-child(2n+1) ::before
     31                s = s.replace( /\:{1,2}[^\s]*/g, '' );
     32
     33                s = s.replace( /\s+/g, ' ' );
     34                var aSelectors = s.split( ' ' ) ,
     35                        aClasses = [];
     36
     37                for( var i=0; i<aSelectors.length; i++ )
     38                {
     39                        var selector = aSelectors[ i ];
     40
     41                        if ( validSelectors.test( selector ) && !skipSelectors.test( selector ) )
     42                        {
     43                                // If we still don't know about this one, add it
     44                                if ( CKEDITOR.tools.indexOf( aClasses, selector ) == -1 )
     45                                        aClasses.push( selector );
     46                        }
     47                }
     48
     49                return aClasses;
     50        }
     51
     52        function LoadStylesCSS( theDoc )
     53        {
     54                var styles = [],
     55                        // It will hold all the rules of the applied stylesheets (except those internal to CKEditor)
     56                        aRules = [],
     57                        i;
     58                for( i = 0; i < theDoc.styleSheets.length; i++ )
     59                {
     60                        var sheet = theDoc.styleSheets[ i ],
     61                                node = sheet.ownerNode || sheet.owningElement;
     62
     63                        // Skip the internal stylesheets
     64                        if ( node.getAttribute( 'data-cke-temp' ) )
     65                                continue;
     66
     67                        // Exclude stylesheets injected by extensions
     68                        if ( sheet.href && sheet.href.substr(0, 9) == 'chrome://' )
     69                                continue;
     70
     71                        var sheetRules = (sheet.cssRules || sheet.rules);
     72                        for( var j = 0; j < sheetRules.length; j++ )
     73                                aRules.push( sheetRules[j].selectorText );
     74                }
     75
     76                var aClasses = parseClasses( aRules );
     77
     78                // Add each style to our "Styles" collection.
     79                for( i=0; i<aClasses.length; i++ )
     80                {
     81                        var oElement = aClasses[ i ].split( '.' ),
     82                                element = oElement[ 0 ].toLowerCase(),
     83                                sClassName = oElement[ 1 ];
     84
     85                        styles.push( {
     86                                name : aClasses[ i ],
     87                                element : element,
     88                                attributes : {'class' : sClassName}
     89                        });
     90                }
     91
     92                return styles;
     93        }
     94
     95        // Register a plugin named "stylesheetparser".
     96        CKEDITOR.plugins.add( 'stylesheetparser',
     97        {
     98                init : function( editor )
     99                {
     100                        skipSelectors = editor.config.stylesheetParser_skipSelectors || /(^body\.|^\.)/i;
     101                        validSelectors = editor.config.stylesheetParser_validSelectors || /\w+\.\w+/;
     102
     103                        editor.on( 'mode', function( e )
     104                        {
     105                                if ( editor.mode != 'wysiwyg' )
     106                                        return;
     107
     108                                // Do this only once
     109                                e.removeListener();
     110
     111                                editor.getStylesSet( function( stylesDefinitions )
     112                                        {
     113                                                // Add the styles found in the document
     114                                                editor._.stylesDefinitions = stylesDefinitions.concat(  LoadStylesCSS( editor.document.$ ) );
     115
     116                                                // Refresh the styles combo
     117                                                var combo = editor.ui._.items[ 'Styles' ];
     118                                                combo && combo.args[0].reset();
     119                                        } );
     120                        });
     121
     122                }
     123        });
     124})();
     125
     126
     127/**
     128 * Regular Expression to check if a css rule must be skipped by
     129 * the stylesheet parser plugin (so it's ignored and not available)
     130 * @name CKEDITOR.config.stylesheetParser_skipSelectors
     131 * @type RegExp
     132 * @default /(^body\.|^\.)/i
     133 * @since 3.6
     134 * @example
     135 * // Ignore rules for body, caption, only a class or classes starting with "high".
     136 * config.stylesheetParser_skipSelectors = /(^body\.|^caption\.|\.high|^\.)/i;
     137 */
     138
     139 /**
     140 * Regular Expression to check if a css rule must be allowed by
     141 * the stylesheet parser plugin
     142 * @name CKEDITOR.config.stylesheetParser_validSelectors
     143 * @type RegExp
     144 * @default /\w+\.\w+/
     145 * @since 3.6
     146 * @example
     147 * // Add only rules for p and span elements.
     148 * config.stylesheetParser_validSelectors = /\^(p|span)\.\w+/;
     149 */
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy