Skip to content

Commit

Permalink
closes #576
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Jun 20, 2011
1 parent 3896185 commit 755a75a
Show file tree
Hide file tree
Showing 36 changed files with 1,451 additions and 33 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
578 changes: 578 additions & 0 deletions css/smoothness-1.8.13/jquery-ui-1.8.13.custom.css

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
18 changes: 18 additions & 0 deletions js/jquery-1.6.1.min.js

Large diffs are not rendered by default.

784 changes: 784 additions & 0 deletions js/jquery-ui-1.8.13.custom.min.js

Large diffs are not rendered by default.

45 changes: 25 additions & 20 deletions src/ellib/js/eldialogform.js
Expand Up @@ -52,26 +52,34 @@ function elDialogForm(o) {
autoOpen : false,
modal : true,
resizable : false,
closeOnEscape : true,
buttons : {
Cancel : function() { self.close(); },
Ok : function() { self.form.trigger('submit'); }
}
}
};

this.opts = jQuery.extend(true, defaults, o, {dialog : { autoOpen : false, close : function() { self.close(); } }});
this.opts = jQuery.extend(true, {}, defaults, o);

this.opts.dialog.close = function() {
self.close();
}

// this.opts.dialog.autoOpen = true;
if (this.opts.rtl) {
this.opts['class'] += ' el-dialogform-rtl';
}

if (o && o.dialog && o.dialog.buttons && typeof(o.dialog.buttons) == 'object') {
this.opts.dialog.buttons = o.dialog.buttons;
}

this.ul = null;
this.tabs = {};
this._table = null;
this.dialog = jQuery('<div />').addClass(this.opts['class']).dialog(this.opts.dialog);

this.message = jQuery('<div class="el-dialogform-message rounded-5" />').hide().appendTo(this.dialog);
this.error = jQuery('<div class="el-dialogform-error rounded-5" />').hide().appendTo(this.dialog);
this.spinner = jQuery('<div class="spinner" />').hide().appendTo(this.dialog);
Expand Down Expand Up @@ -249,26 +257,23 @@ function elDialogForm(o) {
* @return elDialogForm
**/
this.open = function() {
this.ul && this.form.tabs(this.opts.tabs);
// this.form.find(':text').keyup(function(e) {
// if (e.keyCode == 13) {
// self.form.submit();
// }
// });

this.form.find(':text').keydown(function(e) {
if (e.keyCode == 13) {
e.preventDefault()
self.form.submit();
}
});

this.dialog.attr('unselectable', 'on').dialog('open');
var self = this;
if (this.form && this.form.find(':text').length) {
setTimeout(function() { self.form.find(':text')[0].focus(); }, 20);
}

this.ul && this.form.tabs(this.opts.tabs);

setTimeout(function() {
self.dialog.find(':text')
.keydown(function(e) {
if (e.keyCode == 13) {
e.preventDefault()
self.form.submit();
}
})
.filter(':first')[0].focus()
}, 100);

this.dialog.dialog('open');

return this;
}

Expand All @@ -280,7 +285,7 @@ function elDialogForm(o) {
if (typeof(this.opts.close) == 'function') {
this.opts.close();
}
this.dialog.dialog('destroy').remove();
this.dialog.dialog('destroy')//.remove();
}

}
Expand Down
5 changes: 3 additions & 2 deletions src/ellib/js/jquery.elborderselect.js
Expand Up @@ -96,14 +96,15 @@
this.val = function(v) {
if (!v && v !== '') {
var w = parseInt(width.val());

return {width : !isNaN(w) ? w+'px' : '', style : style.val(), color : color.val()};
} else {
var m, w, s, c, b = '';
if (v.nodeName || v.css) {
if (!v.css) {
v = $(v);
}
var b = v.css('border')
var b = v.css('border');
if ((b = v.css('border'))) {
w = s = c = b;
} else {
Expand All @@ -121,7 +122,7 @@
width.val(toPixels(w));
var m = s ? s.match(/(solid|dashed|dotted|double|groove|ridge|inset|outset)/i) :'';
style.val(m ? m[1] : '');
color.val(rgb2hex(c));
color.val(c.indexOf('#') === 0 ? c : rgb2hex(c));
return this;
}
}
Expand Down
12 changes: 11 additions & 1 deletion src/elrte.src.html
Expand Up @@ -7,9 +7,18 @@
<title>elRTE from source</title>

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


<!-- CSS for widgets -->
<link rel="stylesheet" href="ellib/css/elcommon.css" type="text/css" media="screen" charset="utf-8">
Expand Down Expand Up @@ -219,6 +228,7 @@
</textarea> -->
<!-- <textarea id="editor3"></textarea> -->
<div id="editor">
<img src="http://localhost/git/elfinder/files/wallpaper-10865%20copy1.jpg" width="300" height="200" style="border:2px solid #111111" />
<!-- BEGIN DO_NOT_EDIT -->
hello eldorado <!-- BEGIN DO_NOT_INNER -->inner<!-- END DO_NOT_INNER -->
<!-- END DO_NOT_EDIT -->
Expand Down
7 changes: 6 additions & 1 deletion src/elrte/js/elRTE.ui.js
Expand Up @@ -135,7 +135,12 @@ elRTE.prototype.ui.prototype.buttons = {
e.stopPropagation();
e.preventDefault();
if (!$(this).hasClass('disabled')) {
self.command();
try{
self.command();
} catch(e) {
self.rte.log(e)
}

}
self.rte.window.focus();
});
Expand Down
2 changes: 1 addition & 1 deletion src/elrte/js/ui/flash.js
Expand Up @@ -128,7 +128,7 @@


d.open();
setTimeout( function() {self.src.url.focus()}, 100)
// setTimeout( function() {self.src.url.focus()}, 100)


var fs = $('<fieldset />').append($('<legend />').text(this.rte.i18n('Preview')))
Expand Down
33 changes: 25 additions & 8 deletions src/elrte/js/ui/image.js
Expand Up @@ -97,6 +97,7 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
rtl : this.rte.rtl,
submit : function(e, d) { e.stopPropagation(); e.preventDefault(); self.set(); d.close(); },
dialog : {
autoOpen : true,
width : 570,
position : 'top',
title : this.rte.i18n('Image')
Expand Down Expand Up @@ -148,10 +149,11 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
}
};

d.open();


var fs = $('<fieldset />').append($('<legend />').text(this.rte.i18n('Preview')))
d.append(fs, 'main');
d.open();
var frame = document.createElement('iframe');
$(frame).attr('src', '#').addClass('el-rte-preview').appendTo(fs);

Expand Down Expand Up @@ -212,10 +214,10 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
**/
this.updateValues = function() {

var i = this.prevImg.get(0);
this.origW = this.prevImg.attr('width');
this.origH = this.prevImg.attr('height');
var i = this.prevImg.get(0), s;

this.origW = this.prevImg.width();
this.origH = this.prevImg.height();

this.src.main.src.val(this.rte.dom.attr(i, 'src'));
this.src.main.title.val(this.rte.dom.attr(i, 'title'));
Expand All @@ -226,7 +228,22 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
this.src.main.margin.val(this.prevImg)
var f = this.prevImg.css('float');
this.src.main.align.val(f == 'left' || f == 'right' ? f : (this.prevImg.css('vertical-align')||''));
this.src.main.border.val(this.prevImg)

s = this.rte.utils.parseStyle(this.prevImg.attr('style'));

var border = {}
if (s.border) {
var w = s.border.match(/(\d(px|em|%))/),
c = s.border.match(/(#[a-z0-9]+)/);

border = {
width : w ? w[1] : s.border,
style : s.border,
color : this.rte.utils.color2Hex(c ? c[1] : s.border)
}
}

this.src.main.border.val(border)
this.src.adv.style.val(this.rte.dom.attr(i, 'style'));
}

Expand Down Expand Up @@ -312,12 +329,12 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
.attr('src', this.rte.utils.absoluteURL(src))
.bind('load', function() {
setTimeout(function() {
self.updateValues();
self.updateValues();
}, 50)

})
this.preview.prepend(this.prevImg);
self.updateValues();
// self.updateValues();
}
} else { // update existsed image
this.updateImg();
Expand Down

0 comments on commit 755a75a

Please sign in to comment.