mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 18:10:09 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
cd20c5ab3e
commit
e938bbc5aa
@ -2224,20 +2224,10 @@ Object.assign(
|
|||||||
return this.dom?.querySelector('.toolbar') },
|
return this.dom?.querySelector('.toolbar') },
|
||||||
set toolbar(val){},
|
set toolbar(val){},
|
||||||
|
|
||||||
// XXX these are generic...
|
|
||||||
encode: function(text){
|
|
||||||
var span = document.createElement('span')
|
|
||||||
span.innerText = text
|
|
||||||
return span.innerHTML },
|
|
||||||
decode: function(text){
|
|
||||||
var span = document.createElement('span')
|
|
||||||
span.innerHTML = text
|
|
||||||
return span.innerText },
|
|
||||||
|
|
||||||
get code(){
|
get code(){
|
||||||
return this.hasAttribute('value') ?
|
return this.hasAttribute('value') ?
|
||||||
this.getAttribute('value')
|
this.getAttribute('value')
|
||||||
: this.decode(this.innerHTML) },
|
: HTMLElement.decode(this.innerHTML) },
|
||||||
set code(value){
|
set code(value){
|
||||||
if(value == null){
|
if(value == null){
|
||||||
return }
|
return }
|
||||||
@ -2245,7 +2235,7 @@ Object.assign(
|
|||||||
if(this.hasAttribute('value')){
|
if(this.hasAttribute('value')){
|
||||||
this.setAttribute('value', value)
|
this.setAttribute('value', value)
|
||||||
} else {
|
} else {
|
||||||
this.innerHTML = this.encode(value) } },
|
this.innerHTML = HTMLElement.encode(value) } },
|
||||||
|
|
||||||
// XXX do we need this???
|
// XXX do we need this???
|
||||||
// ...rename .code -> .value ???
|
// ...rename .code -> .value ???
|
||||||
|
|||||||
@ -22,6 +22,20 @@ Element.prototype.visibleInViewport = function(partial=false){
|
|||||||
&& right <= innerWidth) }
|
&& right <= innerWidth) }
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
|
// XXX should these be here???
|
||||||
|
HTMLElement.encode = function(str){
|
||||||
|
var span = document.createElement('span')
|
||||||
|
span.innerText = str
|
||||||
|
return span.innerHTML }
|
||||||
|
HTMLElement.decode = function(str){
|
||||||
|
var span = document.createElement('span')
|
||||||
|
span.innerHTML = str
|
||||||
|
return span.innerText }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
HTMLTextAreaElement.prototype.updateSize = function(){
|
HTMLTextAreaElement.prototype.updateSize = function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user