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);
-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));
}
.OxThemeModern .OxTooltip {
border: 1px solid rgba(128, 128, 128, 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);
-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,
style: 'square',
type: self.options.type,
value: self.options.value
value: Ox.stripTags(self.options.value)
}, self.options.type == 'textarea' ? {
width: self.options.width
} : {}))
@ -89,7 +89,7 @@ Ox.Editable = function(options, self) {
blur: submit,
cancel: cancel,
change: change,
submit: submit
//submit: submit
})
//[self.options.editing ? 'show' : 'hide']()
.hide()
@ -197,6 +197,9 @@ Ox.Editable = function(options, self) {
: self.options.value
);
cancel();
that.triggerEvent('submit', {
value: self.options.value
});
}
that.css = function(obj) {

View file

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

View file

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