Skip to content

Adding Bootstrap styled theme support + customizable resizing rule #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,479 changes: 4,479 additions & 0 deletions css/bootstrap.css

Large diffs are not rendered by default.

Binary file added css/bootstrap/images/ui-bg_flat_0_aaaaaa_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-bg_glass_55_fbf9ee_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-bg_glass_65_ffffff_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-bg_glass_75_dadada_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-bg_glass_75_e6e6e6_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-bg_glass_75_ffffff_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_222222_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_2e83ff_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_454545_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_888888_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_cd0a0a_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/bootstrap/images/ui-icons_f6cf3b_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,337 changes: 1,337 additions & 0 deletions css/bootstrap/jquery-ui-1.8.16.custom.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions css/bootstrap/jquery.ui.1.8.16.ie.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-left, .ui-corner-bottom{ border-radius:0px;}
.ui-state-active,.ui-tabs-selected { border-radius:0px;}
.ui-tabs-selected { border-radius:0px;}
.ui-tabs .ui-tabs-nav li{ filter:none;}
.ui-tabs .ui-tabs-nav li a { border-radius:0px; }
92 changes: 92 additions & 0 deletions elrte-bootstrap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>elRTE</title>

<!-- jQuery and jQuery UI -->
<script src="js/jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-ui-1.8.13.custom.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="css/bootstrap/jquery-ui-1.8.16.custom.css" type="text/css" media="screen"
charset="utf-8">

<!-- elRTE -->
<script src="js/elrte.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/elrte.min.css" type="text/css" media="screen" charset="utf-8">

<!-- elRTE translation messages -->
<script src="js/i18n/elrte.ru.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript" charset="utf-8">
$().ready(function () {
var opts = {
cssClass:'el-rte',
// lang : 'ru',
height:450,
toolbar:'complete',
cssfiles:['css/elrte-inner.css']
};
$('#editor').elrte(opts);
})
</script>

<style type="text/css" media="screen">
body {
padding: 20px;
}
</style>

</head>
<body>
<div id="editor">
<h2>ДУГЛАС АДАМС - Путеводитель "Автостопом по Галактике"<br>
DOUGLAS ADAMS - The Hitchhiker's Guide to the Galaxy</h2><img
src="http://upload.wikimedia.org/wikipedia/en/1/1c/Hitchhiker%27s_Guide_%28book_cover%29.jpg"
style="float: left; margin-top: 0px; margin-right: 20px; margin-left: 20px;" title="" alt="" height="229"
width="140">

<h3>Вот что сообщает Галактический Путеводитель на предмет <span style="background-color: rgb(255, 255, 153);">полотенец</span>:
</h3>

<div style="text-align: justify; padding-left: 0px;">&nbsp;&nbsp;<span
style="background-color: rgb(255, 255, 153);">Полотенце</span>, возможно, самый необходимый предмет для
межзвездного путешественника. Оно имеет некоторую практическую ценность - вы можете: завернуться в него, чтобы
согреться, прыгая по холодным лунам Джаглан-Беты; использовать его, как подстилку, лежа на мраморном песке
пляжей Сантрагинуса V, и вдыхая пьянящий &nbsp;морской воздух; спать на нем под огненно-красными звездами на
пустынной планете Какрафун; сделать из него парус, чтобы спуститься на плоту по ленивой реке Мотт; намочить его
и завязать узлом, чтобы использовать, как оружие в рукопашной; обвязать им голову, чтобы избежать ядовитого дыма
или взгляда Прожорного Заглотозавера с Трааля (умопомрачительно глупое животное: оно считает, что раз вы его не
видите, то и оно вас не видит; тупое, как сапог от скафандра, но очень, очень прожорливое); <span
style="background-color: rgb(255, 255, 153);">полотенцем</span> можно размахивать, подавая сигнал
бедствия; и, разумеется, вытираться, если оно все еще чистое.
</div>
<br><br>
<hr style="width: 100%; height: 1px;" noshade="true">
<br>

<div style="padding: 15px; margin-left: 10px; float: right; width: 150px; background-color: rgb(255, 255, 153); color: rgb(255, 51, 0); text-align: center; font-size: xx-large;">
<strong>DON'T<br>PANIC</strong></div>
<div style="text-align: justify;">&nbsp;&nbsp;In many of the more relaxed civilizations on the Outer Eastern Rim of
the Galaxy, the <span class="" style="text-decoration: underline;">Hitch-Hiker's Guide</span> has already
supplanted the great Encyclopaedia Galactica as the standard repository of all knowledge and wisdom, for though
it has many omissions and contains much that is apocryphal, or at least wildly inaccurate, it scores over the
older, more pedestrian work in two important respects. First, it is slightly cheaper; and secondly it has the
words <i>DON'T PANIC</i> inscribed in large friendly letters on its cover.<br><br></div>
<p style="padding-left: 40px; color: rgb(0, 51, 102);">"And the wheel," <span style="color: rgb(0, 0, 0);">said the Captain,</span>
"What about this wheel thingy? It sounds a terribly interesting project."</p>

<p style="padding-left: 40px; color: rgb(153, 51, 51);">"Ah," <span style="color: rgb(0, 0, 0);">said the marketing girl, </span>"Well,
we're having a little difficulty there."</p>

<p style="padding-left: 40px; color: rgb(0, 51, 102);">"Difficulty?"&nbsp;<span style="color: rgb(0, 0, 0);">exclaimed Ford.</span>
"Difficulty? What do you mean, difficulty? It's the single simplest machine in the entire Universe!"</p>

<p style="padding-left: 40px;">The marketing girl soured him with a look.</p>

<p style="padding-left: 40px;"><span style="color: rgb(153, 51, 51);">"Alright, Mr. Wiseguy,"</span> she said, <span
style="color: rgb(153, 51, 51);">"if you're so clever, you tell us what colour it should be."</span></p>
<br>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ IMG= ${DST}/images

# YUI Compressor
COMPRESSOR= 1
COMPRESSOR_JS= java -jar ../../../_old/yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar \
COMPRESSOR_JS= java -jar ../../yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar \
--charset utf8 --type js --line-break 500 \
-o ${elrte_js_min} ${elrte_js}
COMPRESSOR_CSS= java -jar ../../../_old/yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar \
COMPRESSOR_CSS= java -jar ../../yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar \
--charset utf8 --type css --line-break 1 \
-o ${elrte_css_min} ${elrte_css}

Expand Down
3 changes: 0 additions & 3 deletions src/ellib/css/elcommon.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ a { outline: none; }
.rounded-bottom-7 { -moz-border-radius-bottomleft:7px; -moz-border-radius-bottomright:7px; -webkit-border-bottom-left-radius: 7px;-webkit-border-bottom-right-radius: 7px; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px;}


.ui-widget { font-size:.9em;}
.ui-dialog .ui-dialog-buttonpane button { padding: .1em .6em .2em .6em; }

6 changes: 1 addition & 5 deletions src/ellib/css/elselect.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* container for elselect */
.el-select {
height:17px;
width : 110px;
border:1px solid #ccc;
cursor: default;
Expand All @@ -12,10 +11,7 @@

/* selected element */
.el-select label {
height:17px;
line-height:17px;
/* font-size:.92em;*/
padding: 0 5px;
padding: 4px 5px;
margin: 0 12px 0 0;
display:block;
white-space:nowrap;
Expand Down
14 changes: 7 additions & 7 deletions src/ellib/js/jquery.elborderselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@
} else {
b = '';
if (v.nodeName || v.css) {
if (!v.css) {
v = $(v);
if (v.css) {
v = v.get(0);
}
b = v.css('border');
if ((b = v.css('border'))) {
b = v.style.border;
if (b) {
w = s = c = b;
} else {
w = v.css('border-width');
s = v.css('border-style');
c = v.css('border-color');
w = v.style.borderWidth;
s = v.style.borderStyle;
c = v.style.borderColor;
}

} else {
Expand Down
10 changes: 5 additions & 5 deletions src/ellib/js/jquery.elpaddinginput.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
self[this].append('<option value="%">%</option>');
}
});

this.empty().addClass(opts['class'])
.append(this.left).append(this.uleft).append(' x ')
.append(this.top).append(this.utop).append(' x ')
.append(this.right).append(this.uright).append(' x ')
.append(this.left).append(this.uleft).append(' ')
.append(this.top).append(this.utop).append(' ')
.append(this.right).append(this.uright).append(' ')
.append(this.bottom).append(this.ubottom);

this.val = function(v) {
if (!v && v!=='') {
var l = parseNum(this.left.val());
Expand Down
31 changes: 25 additions & 6 deletions src/elrte/css/elrte.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
.el-rte .toolbar ul li.anchor {background-position:-296px -30px}
.el-rte .toolbar ul li.image {background-position:-384px -2px}
.el-rte .toolbar ul li.flash {background-position:-410px -2px}
.el-rte .toolbar ul li.embedmedia {background-position:-410px -2px}
.el-rte .toolbar ul li.file {background-position:-436px -3px}
.el-rte .toolbar ul li.table {background-position:-421px -30px}
.el-rte .toolbar ul li.tableprops {background-position:-602px -29px}
Expand Down Expand Up @@ -188,7 +189,7 @@
/* выпадающие меню */
/* container for elselect */
.el-rte .toolbar ul li.el-select {
height:22px;
height: 22px;
width : 120px;
border:1px solid #ccc;
font-size:.82em;
Expand Down Expand Up @@ -231,10 +232,7 @@
/* colors palette */
.el-palette { top:20px; }

.el-dialogform, .el-dialogform td { font-size:.9em; }
.el-dialogform select { font-size:.9em;}
.ui-dialog .ui-dialog-buttonpane { padding: .4em, 1em;}
.ui-dialog .ui-dialog-buttonpane button { margin: .3em .4em .1em 0; font-size:.9em;}
.ui-dialog .ui-dialog-titlebar { padding: .3em 1em .3em; }
/*.ui-dialog-buttonset { padding:0; background-color:#333;}*/
/* диалоговые окна */
Expand All @@ -253,11 +251,13 @@
padding : 0;
}
.el-dialogform fieldset legend {
font-size:.9em;
font-size: 12px;
line-height: 1.2em;
padding: .1em .5em;
margin: 0 0 5px 1em;
border:1px solid #ccc;
background-color: #eee;
width: auto;
}
.el-dialogform p { padding:.2em .3em;}
.el-dialogform h3 { color:#555; padding:1.2em 0 0 0; margin:0; font-size:1.2em; }
Expand Down Expand Up @@ -296,6 +296,25 @@ table.elrte-authors td { border-bottom:1px solid #eee; }
font-size:.7em;
overflow:auto;
height:240px;
width:480px;
width:530px;
}

/* bootstrap fixes */
.el-dialogform input,
.el-palette input,
.el-dialogform select,
.el-palette select {
width: auto;
margin: 2px 0;
padding-left: 0;
padding-right: 0;
}

.el-paddinginput input,
.el-borderselect input {
width: 3em;
}

.elrte-image-preview img {
max-width: none;
}
8 changes: 7 additions & 1 deletion src/elrte/js/elRTE.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ elRTE = function(target, opts) {
var self = this;
if (this.options.resizable && $.fn.resizable) {
if (r) {
this.editor.resizable({handles : 'se', alsoResize : this.workzone, minWidth :300, minHeight : 200 }).bind('resize', self.updateHeight);
this.editor.resizable({handles : this.options.resizeHandle, alsoResize : this.workzone, minWidth :300, minHeight : 200 }).bind('resize', self.updateHeight);
} else {
this.editor.resizable('destroy').unbind('resize', self.updateHeight);
}
Expand Down Expand Up @@ -128,6 +128,9 @@ elRTE = function(target, opts) {
this.window = this.iframe.contentWindow;
this.doc = this.iframe.contentWindow.document;
this.$doc = $(this.doc);
if(!this.doc.body.firstChild) {
this.doc.body.appendChild(document.createTextNode(''));
}

/* put content into iframe */
html = '<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
Expand Down Expand Up @@ -376,6 +379,9 @@ elRTE.prototype.val = function(v) {
if ($.browser.msie) {
this.doc.body.innerHTML = '<br />'+this.filter.wysiwyg(v);
this.doc.body.removeChild(this.doc.body.firstChild);
if(!this.doc.body.firstChild) {
this.doc.body.appendChild(document.createTextNode(''));
}
} else {
this.doc.body.innerHTML = this.filter.wysiwyg(v);
}
Expand Down
5 changes: 3 additions & 2 deletions src/elrte/js/elRTE.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ elRTE.prototype.options = {
cssfiles : [],
height : null,
resizable : true,
resizeHandle : 'se',
lang : 'en',
toolbar : 'normal',
absoluteURLs : true,
Expand Down Expand Up @@ -74,7 +75,7 @@ elRTE.prototype.options = {
'superscript' : 'Superscript',
'subscript' : 'Subscript',
'justifyleft' : 'Align left',
'justifyright' : 'Ailgn right',
'justifyright' : 'Align right',
'justifycenter' : 'Align center',
'justifyfull' : 'Align full',
'indent' : 'Indent',
Expand Down Expand Up @@ -132,7 +133,7 @@ elRTE.prototype.options = {
direction : ['ltr', 'rtl'],
links : ['link', 'unlink', 'anchor'],
images : ['image'],
media : ['image', 'flash'],
media : ['image', 'flash', 'embedmedia'],
tables : ['table', 'tableprops', 'tablerm', 'tbrowbefore', 'tbrowafter', 'tbrowrm', 'tbcolbefore', 'tbcolafter', 'tbcolrm', 'tbcellprops', 'tbcellsmerge', 'tbcellsplit'],
elfinder : ['elfinder'],
fullscreen : ['fullscreen', 'about']
Expand Down
8 changes: 4 additions & 4 deletions src/elrte/js/elRTE.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ elRTE.prototype.utils = function(rte) {

if (s['background-image']) {
s.background = (s['background-color']+' ')||''+s['background-image']+' '+s['background-position']||'0 0'+' '+s['background-repeat']||'repeat';
delete s['background-color'];
delete s['background-image'];
delete['background-image'];
delete['background-position'];
delete['background-repeat'];
delete s['background-position'];
delete s['background-repeat'];
}

if (s['margin-top'] && s['margin-right'] && s['margin-bottom'] && s['margin-left']) {
Expand Down Expand Up @@ -393,4 +393,4 @@ elRTE.prototype.utils = function(rte) {

}

})(jQuery);
})(jQuery);
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.YOUR_LANG.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ elRTE.prototype.i18Messages.LANG_CODE = {
'Superscript' : '',
'Subscript' : '',
'Align left' : '',
'Ailgn right' : '',
'Align right' : '',
'Align center' : '',
'Align full' : '',
'Font color' : '',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ elRTE.prototype.i18Messages.ar = {
'Superscript' : 'يعلوه خط',
'Subscript' : 'تحته خط',
'Align left' : 'محاذاة إلى اليسار',
'Ailgn right' : 'محاذاة إلى اليمين ',
'Align right' : 'محاذاة إلى اليمين ',
'Align center' : 'محاذاة إلى المنتصف',
'Align full' : 'محاذاة بعرض الصفحة',
'Font color' : 'لون الخط',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ elRTE.prototype.i18Messages.ca = {
'Superscript' : 'Superíndex',
'Subscript' : 'Subíndex',
'Align left' : 'Alinea a l\'esquerra',
'Ailgn right' : 'Alinea a la dreta',
'Align right' : 'Alinea a la dreta',
'Align center' : 'Centra',
'Align full' : 'Justifica',
'Font color' : 'Color del text',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ elRTE.prototype.i18Messages.cs = {
'Superscript' : 'Horní index',
'Subscript' : 'Dolní index',
'Align left' : 'Zarovnat vlevo',
'Ailgn right' : 'Zarovna vpravo',
'Align right' : 'Zarovna vpravo',
'Align center' : 'Zarovnat na střed',
'Align full' : 'Do bloku',
'Font color' : 'Barva písma',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.da.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ elRTE.prototype.i18Messages.da = {
'Superscript' : 'Hævet skrift',
'Subscript' : 'Sænket skrift',
'Align left' : 'Venstrejusteret',
'Ailgn right' : 'Højrejusteret',
'Align right' : 'Højrejusteret',
'Align center' : 'Centreret',
'Align full' : 'Lige margner',
'Font color' : 'Tekst farve',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.de.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ elRTE.prototype.i18Messages.de = {
'Superscript' : 'Hochgestellt',
'Subscript' : 'Tiefgestellt',
'Align left' : 'Linksbündig',
'Ailgn right' : 'Rechtsbündig',
'Align right' : 'Rechtsbündig',
'Align center' : 'Zentriert',
'Align full' : 'Blocksatz',
'Font color' : 'Textfarbe',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ elRTE.prototype.i18Messages.es = {
'Superscript' : 'Superíndice',
'Subscript' : 'Subíndice',
'Align left' : 'Alinear a la izquierda',
'Ailgn right' : 'Alinear a la derecha',
'Align right' : 'Alinear a la derecha',
'Align center' : 'Centrar',
'Align full' : 'Justificado',
'Font color' : 'Color de texto',
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/i18n/elrte.fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ elRTE.prototype.i18Messages.fa = {
'Superscript' : 'بالانویس',
'Subscript' : 'زیرنویس',
'Align left' : 'چپ چین',
'Ailgn right' : 'راست چین',
'Align right' : 'راست چین',
'Align center' : 'وسط چین',
'Align full' : 'به صورت کشده و کامل',
'Font color' : 'رنگ قلم ها',
Expand Down
Loading