strip tags in Ox.Editable

This commit is contained in:
rlx 2011-10-24 21:31:53 +00:00
parent 4dd5107a48
commit 19d5f811d6
5 changed files with 21 additions and 6 deletions

View file

@ -723,3 +723,8 @@ Miscellaneous
-o-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); -o-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
} }
.OxThemeClassic ::selection {
background: rgb(192, 192, 192);
//color: rgb(255, 255, 255);
}

View file

@ -736,7 +736,6 @@ Miscellaneous
background-image: -webkit-linear-gradient(top, rgba(32, 32, 32, 0.75), rgba(32, 32, 32, 1), rgba(32, 32, 32, 1)); background-image: -webkit-linear-gradient(top, rgba(32, 32, 32, 0.75), rgba(32, 32, 32, 1), rgba(32, 32, 32, 1));
} }
.OxThemeModern .OxTooltip { .OxThemeModern .OxTooltip {
border: 1px solid rgba(128, 128, 128, 0.96); border: 1px solid rgba(128, 128, 128, 0.96);
background: rgba(0, 0, 0, 0.96); background: rgba(0, 0, 0, 0.96);
@ -745,3 +744,8 @@ Miscellaneous
-o-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); -o-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
} }
.OxThemeModern ::selection {
background: rgb(192, 192, 192);
//color: rgb(255, 255, 255);
}

View file

@ -80,7 +80,7 @@ Ox.Editable = function(options, self) {
changeOnKeypress: true, changeOnKeypress: true,
style: 'square', style: 'square',
type: self.options.type, type: self.options.type,
value: self.options.value value: Ox.stripTags(self.options.value)
}, self.options.type == 'textarea' ? { }, self.options.type == 'textarea' ? {
width: self.options.width width: self.options.width
} : {})) } : {}))
@ -89,7 +89,7 @@ Ox.Editable = function(options, self) {
blur: submit, blur: submit,
cancel: cancel, cancel: cancel,
change: change, change: change,
submit: submit //submit: submit
}) })
//[self.options.editing ? 'show' : 'hide']() //[self.options.editing ? 'show' : 'hide']()
.hide() .hide()
@ -197,6 +197,9 @@ Ox.Editable = function(options, self) {
: self.options.value : self.options.value
); );
cancel(); cancel();
that.triggerEvent('submit', {
value: self.options.value
});
} }
that.css = function(obj) { that.css = function(obj) {

View file

@ -212,6 +212,7 @@ Ox.IconList = function(options, self) {
return that.$element.value(id, key); return that.$element.value(id, key);
} else { } else {
that.$element.value(id, key, value); that.$element.value(id, key, value);
// FIXME: Like TextList, handle unique id and selection change here
return that; return that;
} }
}; };

View file

@ -16,7 +16,8 @@ Ox.formatArea = function(num, dec) {
/*@ /*@
Ox.formatColor <f> (strange one) Ox.formatColor <f> (strange one)
@*/ @*/
Ox.formatColor = function(val, type) { // FIXME: implement invert
Ox.formatColor = function(val, type, invert) {
var background, color, element; var background, color, element;
if (type == 'hue') { if (type == 'hue') {
background = Ox.rgb(val, 1, 0.25).map(function(val) { background = Ox.rgb(val, 1, 0.25).map(function(val) {
@ -45,10 +46,11 @@ Ox.formatColor = function(val, type) {
} }
element = Ox.element('<div>') element = Ox.element('<div>')
.css({ .css({
borderRadius: '4px', borderRadius: '8px',
padding: '0 3px 1px 3px', padding: '0 4px 1px 4px',
color: 'rgb(' + color.join(', ') + ')', color: 'rgb(' + color.join(', ') + ')',
overflow: 'hidden', overflow: 'hidden',
textAlign: 'right',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
//textShadow: 'black 1px 1px 1px' //textShadow: 'black 1px 1px 1px'
}) })