http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89838
Revision: 89838
Author: tparscal
Date: 2011-06-10 18:31:44 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
* Added tab rendering as arrow symbols
* Made demo show selection in monospaced/preformatted text
Modified Paths:
--------------
trunk/parsers/wikidom/demos/surface/index.html
trunk/parsers/wikidom/lib/jquery.editSurface.css
trunk/parsers/wikidom/lib/jquery.flow.js
Modified: trunk/parsers/wikidom/demos/surface/index.html
===================================================================
--- trunk/parsers/wikidom/demos/surface/index.html 2011-06-10 18:24:18 UTC
(rev 89837)
+++ trunk/parsers/wikidom/demos/surface/index.html 2011-06-10 18:31:44 UTC
(rev 89838)
@@ -30,7 +30,8 @@
{ 'text': "The soft
returns are usually placed after the ends of complete words, or after the
punctuation that follows complete words. However, word wrap may also occur
following a hyphen." },
{ 'text': "Word wrap
following hyphens is sometimes not desired, and can be avoided by using a
so-called non-breaking hyphen instead of a regular hyphen. On the other hand,
when using word processors, invisible hyphens, called soft hyphens, can also be
inserted inside words so that word wrap can occur following the soft hyphens."
},
{ 'text': "Sometimes,
word wrap is not desirable between words. In such cases, word wrap can usually
be avoided by using a hard space or non-breaking space between the words,
instead of regular spaces." },
- { 'text':
"OccasionallyThereAreWordsThatAreSoLongTheyExceedTheWidthOfTheLineAndEndUpWrappingBetweenMultipleLines."
}
+ { 'text':
"OccasionallyThereAreWordsThatAreSoLongTheyExceedTheWidthOfTheLineAndEndUpWrappingBetweenMultipleLines."
},
+ { 'text': "Text might
have \ttabs\t in it too." }
]
} ] }
} );
Modified: trunk/parsers/wikidom/lib/jquery.editSurface.css
===================================================================
--- trunk/parsers/wikidom/lib/jquery.editSurface.css 2011-06-10 18:24:18 UTC
(rev 89837)
+++ trunk/parsers/wikidom/lib/jquery.editSurface.css 2011-06-10 18:31:44 UTC
(rev 89838)
@@ -10,6 +10,8 @@
border: solid 1px Highlight;
line-height: 1.5em;
cursor: text;
+ font-family: "Courier New", monospace;
+ white-space: pre-wrap;
}
#selection p {
@@ -35,14 +37,15 @@
line-height: 1.5em;
cursor: text;
white-space: nowrap;
- background-color: rgba(204, 204, 204, 0.25);
}
+
.editSurface-line.empty {
display: block;
width: 0px;
}
-.editSurface-line .invisible {
- color: green;
+
+.editSurface-line .editSurface-whitespace {
+ color: #888888;
padding: 0 0.25em;
}
@@ -59,4 +62,4 @@
width: 1px;
height: 1.5em;
display: none;
-}
\ No newline at end of file
+}
Modified: trunk/parsers/wikidom/lib/jquery.flow.js
===================================================================
--- trunk/parsers/wikidom/lib/jquery.flow.js 2011-06-10 18:24:18 UTC (rev
89837)
+++ trunk/parsers/wikidom/lib/jquery.flow.js 2011-06-10 18:31:44 UTC (rev
89838)
@@ -77,7 +77,8 @@
.replace( '>', '>' )
.replace( '\'', ''' )
.replace( '"', '"' )
- .replace( '\n', '<span
class="invisible">⏎</span>' );
+ .replace( '\n', '<span
class="editSurface-whitespace">⏎</span>' )
+ .replace( '\t', '<span
class="editSurface-whitespace">⇥</span>' );
word.html += charHtml;
if ( $.flow.charCache[char] === undefined ) {
// Cache miss
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs