Skip to content

Commit

Permalink
Remove console.logs and update class applier demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim committed Feb 10, 2015
1 parent e78c6f4 commit d5fcd55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 17 additions & 9 deletions demos/classapplier.html
Expand Up @@ -14,6 +14,10 @@
color: red;
}

img.boldRed {
border: solid red 3px;
}

a.pinkLink {
color: #f66;
font-size: 1.2em;
Expand Down Expand Up @@ -49,10 +53,12 @@
// Next line is pure paranoia: it will only return false if the browser has no support for ranges,
// selections or TextRanges. Even IE 5 would pass this test.
if (rangy.supported && classApplierModule && classApplierModule.supported) {
boldRedApplier = rangy.createClassApplier("boldRed");
boldRedApplier = rangy.createClassApplier("boldRed", {
tagNames: ["span", "img"]
});

italicYellowBgApplier = rangy.createClassApplier("italicYellowBg", {
tagNames: ["span", "a", "b"]
tagNames: ["span", "a", "b", "img"]
});

pinkLinkApplier = rangy.createClassApplier("pinkLink", {
Expand Down Expand Up @@ -110,19 +116,21 @@ <h1>Rangy CSS Class Applier Module Demo</h1>
<!-- A comment -->

<p id="intro">
Please use your mouse and/or keyboard to make selections from the sample content below and use the buttons on
the left hand size to toggle CSS classes applied to text content within the selection.
Please use your mouse and/or keyboard to make selections from the sample content below and use the buttons
on the left hand size to toggle CSS classes applied to content (now also including images) within the
selection.
</p>

<p>
<b>Association football</b> is a sport played between two teams. It is usually called <b class="pinkLink">football</b>, but in
some countries, such as the United States, it is called <b>soccer</b>. In
<a href="http://simple.wikipedia.org/wiki/Japan">Japan</a>, New Zealand, South Africa, Australia, Canada and
Republic of Ireland, both words are commonly used.
<b>Association football</b> is a sport played between two teams. It is usually called
<b class="pinkLink">football</b>, but in some countries, such as the United States, it is called
<b>soccer</b>. In <a href="http://simple.wikipedia.org/wiki/Japan">Japan</a>, New Zealand, South Africa,
Australia, Canada and Republic of Ireland, both words are commonly used.
</p>
<p>
Each team has 11 players on the field. One of these players is the <i>goalkeeper</i>, and the other ten are
known as <i>"outfield players."</i> The game is played by <b>kicking a ball into the opponent's goal</b>. A
known as <i>"outfield players."</i> The game is played by <b>kicking a ball
<img src="football.png" width="100" height="100" alt="football"> into the opponent's goal</b>. A
match has 90 minutes of play, with a break of 15 minutes in the middle. The break in the middle is called
half-time.
</p>
Expand Down
4 changes: 0 additions & 4 deletions src/modules/rangy-classapplier.js
Expand Up @@ -882,8 +882,6 @@ rangy.createModule("ClassApplier", ["WrappedSelection"], function(api, module) {
// Apply classes to any appropriate empty elements
var emptyElements = applier.getEmptyElements(range);

console.log(emptyElements)

forEach(emptyElements, function(el) {
addClass(el, applier.className);
});
Expand Down Expand Up @@ -955,8 +953,6 @@ rangy.createModule("ClassApplier", ["WrappedSelection"], function(api, module) {
// Remove class from any appropriate empty elements
var emptyElements = applier.getEmptyElements(range);

console.log(emptyElements);

forEach(emptyElements, function(el) {
removeClass(el, applier.className);
});
Expand Down

0 comments on commit d5fcd55

Please sign in to comment.