Skip to content

Commit

Permalink
Improved content styles. Updated replacebycode sample contents.
Browse files Browse the repository at this point in the history
* Added block container style.
* Added compact table style for content.
* Updated image styles.
  • Loading branch information
oleq committed Nov 20, 2012
1 parent c502643 commit c8b8caa
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 16 deletions.
17 changes: 15 additions & 2 deletions contents.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ body
background-color: #fff;

margin: 20px;
line-height: 1.6em;
}

blockquote
{
font-style: italic;
padding: 8px 8px 8px 20px;
padding: 2px 8px 2px 20px;
border-left: 5px solid #ccc;
font-family: Georgia, Times, "Times New Roman", serif;
}

a
Expand All @@ -41,9 +43,20 @@ ol,ul,dl
h1,h2,h3,h4,h5,h6
{
font-weight: normal;
line-height: 1.2em;
}

p,ul,ol,dl,blockquote
{
line-height: 1.6em;
}

hr
{
border: 0px;
border-top: 1px solid #ccc;
}

img:hover {
opacity: .9;
filter: alpha(opacity = 90);
}
12 changes: 6 additions & 6 deletions samples/replacebycode.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ <h1 class="samples">
</pre>
</div>
<textarea cols="80" id="editor1" name="editor1" rows="10">
<h1>
<img alt="Saturn V carrying Apollo 11" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Apollo_11_Launch2.jpg/160px-Apollo_11_Launch2.jpg" style="border: 1px solid rgb(204, 204, 204); margin-left: 10px; padding: 5px; float: right; width: 120px; height: 150px;" />
Apollo 11
</h1>
<h1><img alt="Saturn V carrying Apollo 11" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Apollo_11_Launch2.jpg/160px-Apollo_11_Launch2.jpg" style="border:1px solid #ccc;float:right;margin-left:15px;padding:5px;" /> Apollo 11</h1>

<p><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>

Expand All @@ -37,11 +34,11 @@ <h2>Broadcasting and <em>quotes</em> <a id="quotes" name="quotes"></a></h2>

<p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p>

<blockquote>One small step for [a] man, one giant leap for mankind.</blockquote>
<blockquote><p>One small step for [a] man, one giant leap for mankind.</p></blockquote>

<p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p>

<blockquote>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</blockquote>
<blockquote><p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p></blockquote>

<h2>Technical details <a id="tech-details" name="tech-details"></a></h2>

Expand Down Expand Up @@ -79,6 +76,8 @@ <h2>Technical details <a id="tech-details" name="tech-details"></a></h2>

<p>After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis" title="Mare Tranquillitatis">Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean">Pacific Ocean</a> on July 24.</p>

<hr />
<p style="text-align: right;"><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small></p>
</textarea>
<script>

Expand All @@ -88,6 +87,7 @@ <h2>Technical details <a id="tech-details" name="tech-details"></a></h2>

// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.

CKEDITOR.replace( 'editor1' );

</script>
Expand Down
46 changes: 38 additions & 8 deletions styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ CKEDITOR.stylesSet.add( 'default', [
{ name: 'Address', element: 'address' },
*/

{ name: 'Blue Title', element: 'h3', styles: { 'color': 'Blue' } },
{ name: 'Red Title', element: 'h3', styles: { 'color': 'Red' } },
{ name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
{ name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
{
name: 'Block container',
element: 'div',
styles: {
padding: '10px',
background: '#eee',
border: '1px solid #ccc',
'margin-bottom': '10px'
}
},

/* Inline Styles */

Expand Down Expand Up @@ -72,22 +82,42 @@ CKEDITOR.stylesSet.add( 'default', [
/* Object Styles */

{
name: 'Image on Left',
name: 'Styled image (left)',
element: 'img',
attributes: {
'style': 'padding: 5px; margin-right: 5px',
'border': '2',
'align': 'left'
},
styles: {
padding: '5px',
'margin-right': '10px',
border: '1px solid #ccc'
}
},

{
name: 'Image on Right',
name: 'Styled image (right)',
element: 'img',
attributes: {
'style': 'padding: 5px; margin-left: 5px',
'border': '2',
'align': 'right'
},
styles: {
padding: '5px',
'margin-left': '10px',
border: '1px solid #ccc'
}
},

{
name: 'Compact table',
element: 'table',
attributes: {
cellpadding: '5',
cellspacing: '0',
border: '1',
bordercolor: '#ccc'
},
styles: {
'border-collapse': 'collapse'
}
},

Expand Down

0 comments on commit c8b8caa

Please sign in to comment.