projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync
[roojs1]
/
roojs-bootstrap-debug.js
diff --git
a/roojs-bootstrap-debug.js
b/roojs-bootstrap-debug.js
index
42594c9
..
e66fdc2
100644
(file)
--- a/
roojs-bootstrap-debug.js
+++ b/
roojs-bootstrap-debug.js
@@
-27002,6
+27002,9
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
caption : '',
caption_display : 'block',
width : '100%',
caption : '',
caption_display : 'block',
width : '100%',
+ cls : '',
+ href: '',
+ video_url : '',
// margin: '2%', not used
// margin: '2%', not used
@@
-27170,8
+27173,9
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
var img = {
tag : 'img',
var img = {
tag : 'img',
+ contenteditable : 'false',
src : this.image_src,
src : this.image_src,
- alt : d.innerText.replace(/\n/g, " ")
, // removeHTML
..
+ alt : d.innerText.replace(/\n/g, " ")
.replace(/\s+/g, ' ').trim(), // removeHTML and reduce spaces
..
style: {
width : 'auto',
'max-width': '100%',
style: {
width : 'auto',
'max-width': '100%',
@@
-27188,10
+27192,11
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
'</div>',
*/
'</div>',
*/
- if (this.href) {
+ if (this.href
.length > 0
) {
img = {
tag : 'a',
href: this.href,
img = {
tag : 'a',
href: this.href,
+ contenteditable : 'true',
cn : [
img
]
cn : [
img
]
@@
-27199,7
+27204,7
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
}
}
- if (this.video_url) {
+ if (this.video_url
.length > 0
) {
img = {
tag : 'div',
cls : this.cls,
img = {
tag : 'div',
cls : this.cls,
@@
-27207,7
+27212,7
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
allowfullscreen : true,
width : 420, // these are for video tricks - that we replace the outer
height : 315,
allowfullscreen : true,
width : 420, // these are for video tricks - that we replace the outer
height : 315,
- src : this.video_
src
,
+ src : this.video_
url
,
cn : [
img
]
cn : [
img
]
@@
-27244,7
+27249,7
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
'font-style': 'italic',
display : this.caption_display
},
'font-style': 'italic',
display : this.caption_display
},
- cls : this.cls
+ '-thumbnail
',
+ cls : this.cls
.length > 0 ? (this.cls + '-thumbnail' ) : '
',
html : this.caption
}
html : this.caption
}
@@
-27256,7
+27261,7
@@
Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
readElement : function(node)
{
// this should not really come from the link...
readElement : function(node)
{
// this should not really come from the link...
- this.video_
src
= this.getVal(node, 'div', 'src');
+ this.video_
url
= this.getVal(node, 'div', 'src');
this.cls = this.getVal(node, 'div', 'class');
this.href = this.getVal(node, 'a', 'href');
this.cls = this.getVal(node, 'div', 'class');
this.href = this.getVal(node, 'a', 'href');
@@
-28718,14
+28723,16
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
st += '<style type="text/css">' +
'IMG { cursor: pointer } ' +
'</style>';
st += '<style type="text/css">' +
'IMG { cursor: pointer } ' +
'</style>';
-
- var cls = 'roo-htmleditor-body';
+
+ st += '<meta name="google" content="notranslate">';
+
+ var cls = 'notranslate roo-htmleditor-body';
if(this.bodyCls.length){
cls += ' ' + this.bodyCls;
}
if(this.bodyCls.length){
cls += ' ' + this.bodyCls;
}
- return '<html><head>' + st +
+ return '<html
class="notranslate" translate="no"
><head>' + st +
//<style type="text/css">' +
//'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}' +
//'</style>' +
//<style type="text/css">' +
//'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}' +
//'</style>' +
@@
-28852,7
+28859,8
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
* @param {String} html The HTML to be cleaned
* return {String} The cleaned HTML
*/
* @param {String} html The HTML to be cleaned
* return {String} The cleaned HTML
*/
- cleanHtml : function(html){
+ cleanHtml : function(html)
+ {
html = String(html);
if(html.length > 5){
if(Roo.isSafari){ // strip safari nonsense
html = String(html);
if(html.length > 5){
if(Roo.isSafari){ // strip safari nonsense
@@
-28881,18
+28889,27
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
var bd = (this.doc.body || this.doc.documentElement);
var bd = (this.doc.body || this.doc.documentElement);
+ var sel = this.win.getSelection();
var div = document.createElement('div');
div.innerHTML = bd.innerHTML;
var div = document.createElement('div');
div.innerHTML = bd.innerHTML;
-
+ var gtx = div.getElementsByClassName('gtx-trans-icon'); // google translate - really annoying and difficult to get rid of.
+ if (gtx.length > 0) {
+ var rm = gtx.item(0).parentNode;
+ rm.parentNode.removeChild(rm);
+ }
+
if (this.enableBlocks) {
new Roo.htmleditor.FilterBlock({ node : div });
}
//?? tidy?
if (this.enableBlocks) {
new Roo.htmleditor.FilterBlock({ node : div });
}
//?? tidy?
+ var tidy = new Roo.htmleditor.TidySerializer({
+ inner: true
+ });
+ var html = tidy.serialize(div);
- var html = div.innerHTML;
if(Roo.isSafari){
var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
var m = bs ? bs.match(/text-align:(.*?);/i) : false;
if(Roo.isSafari){
var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
var m = bs ? bs.match(/text-align:(.*?);/i) : false;
@@
-29031,9
+29048,11
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
//var ss = this.el.getStyles( 'background-image', 'background-repeat');
//ss['background-attachment'] = 'fixed'; // w3c
dbody.bgProperties = 'fixed'; // ie
//var ss = this.el.getStyles( 'background-image', 'background-repeat');
//ss['background-attachment'] = 'fixed'; // w3c
dbody.bgProperties = 'fixed'; // ie
+ dbody.setAttribute("translate", "no");
+
//Roo.DomHelper.applyStyles(dbody, ss);
Roo.EventManager.on(this.doc, {
//Roo.DomHelper.applyStyles(dbody, ss);
Roo.EventManager.on(this.doc, {
- //'mousedown': this.onEditorEvent,
+
'mouseup': this.onEditorEvent,
'dblclick': this.onEditorEvent,
'click': this.onEditorEvent,
'mouseup': this.onEditorEvent,
'dblclick': this.onEditorEvent,
'click': this.onEditorEvent,
@@
-29064,7
+29083,8
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
this.owner.fireEvent('initialize', this);
this.pushValue();
},
this.owner.fireEvent('initialize', this);
this.pushValue();
},
-
+ // this is to prevent a href clicks resulting in a redirect?
+
onPasteEvent : function(e,v)
{
// I think we better assume paste is going to be a dirty load of rubish from word..
onPasteEvent : function(e,v)
{
// I think we better assume paste is going to be a dirty load of rubish from word..
@@
-29223,6
+29243,7
@@
Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
onEditorEvent : function(e)
{
onEditorEvent : function(e)
{
+
if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) {
return; // we do not handle this.. (undo manager does..)
if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) {
return; // we do not handle this.. (undo manager does..)