Commit d2d0c27e authored by Akikonata's avatar Akikonata

format

parent f0cb4ee8
...@@ -7,26 +7,26 @@ ...@@ -7,26 +7,26 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。"> <meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<script src="lib/jquery-2.1.0.min.js?_=1399627592968" charset="utf-8"></script> <script src="lib/jquery-2.1.0.min.js?_=1399630445671" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1399627592968" charset="utf-8"></script> <script src="lib/ZeroClipboard.min.js?_=1399630445671" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } ); ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script> </script>
<script src="lib/kitygraph.all.min.js?_=1399627592968" charset="utf-8"></script> <script src="lib/kitygraph.all.min.js?_=1399630445671" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399627592968" charset="utf-8"></script> <script src="kityminder.all.min.js?_=1399630445671" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399627592968" charset="utf-8"></script> <script src="kityminder.config.js?_=1399630445671" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1399627592968" charset="utf-8"></script> <script src="lang/zh-cn/zh-cn.js?_=1399630445671" charset="utf-8"></script>
<script src="lib/zip.js?_=1399627592968" charset="utf-8"></script> <script src="lib/zip.js?_=1399630445671" charset="utf-8"></script>
<script> <script>
zip.inflateJSPath = 'lib/inflate.js'; zip.inflateJSPath = 'lib/inflate.js';
</script> </script>
<script src="lib/jquery.xml2json.js?_=1399627592968" charset="utf-8"></script> <script src="lib/jquery.xml2json.js?_=1399630445671" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399627592968" charset="utf-8"></script> <script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399630445671" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399627592968" charset="utf-8"></script> <script src="social/draftmanager.js?_=1399630445671" charset="utf-8"></script>
<script src="social/social.js?_=1399627592968" charset="utf-8"></script> <script src="social/social.js?_=1399630445671" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet"> <link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" /> <link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
......
...@@ -5406,10 +5406,10 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5406,10 +5406,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
_div.setAttribute( 'contenteditable', true ); _div.setAttribute( 'contenteditable', true );
_div.className = 'km_receiver'; _div.className = 'km_receiver';
this.container = document.body.insertBefore( _div, document.body.firstChild ); this.container = document.body.insertBefore( _div, document.body.firstChild );
if(browser.ie && browser.version == 11){ if ( browser.ie && browser.version == 11 ) {
utils.listen(this.container,'keydown keypress keyup',function(e){ utils.listen( this.container, 'keydown keypress keyup', function ( e ) {
me.keyboardEvents.call(me,new MinderEvent(e.type == 'keyup' ? "beforekeyup": e.type,e)) me.keyboardEvents.call( me, new MinderEvent( e.type == 'keyup' ? "beforekeyup" : e.type, e ) )
}) } )
} }
utils.addCssRule( 'km_receiver_css', ' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}' ); // utils.addCssRule( 'km_receiver_css', ' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}' ); //
this.km.on( 'textedit.beforekeyup textedit.keydown textedit.keypress textedit.paste', utils.proxy( this.keyboardEvents, this ) ); this.km.on( 'textedit.beforekeyup textedit.keydown textedit.keypress textedit.paste', utils.proxy( this.keyboardEvents, this ) );
...@@ -5435,7 +5435,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5435,7 +5435,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
textShape = new kity.Text(); textShape = new kity.Text();
} }
this.textShape = textShape; this.textShape = textShape;
this.container.innerHTML = utils.unhtml(textShape.getContent()); this.container.innerHTML = utils.unhtml( textShape.getContent() );
return this; return this;
}, },
setTextShapeSize: function ( size ) { setTextShapeSize: function ( size ) {
...@@ -5530,7 +5530,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5530,7 +5530,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
setTimeout( function () { setTimeout( function () {
me.range.updateNativeRange().insertNode( $( '<span>$$_kityminder_bookmark_$$</span>' )[ 0 ] ); me.range.updateNativeRange().insertNode( $( '<span>$$_kityminder_bookmark_$$</span>' )[ 0 ] );
me.container.innerHTML = utils.unhtml(me.container.textContent.replace( /[\u200b\t\r\n]/g, '' )); me.container.innerHTML = utils.unhtml( me.container.textContent.replace( /[\u200b\t\r\n]/g, '' ) );
var index = me.container.textContent.indexOf( '$$_kityminder_bookmark_$$' ); var index = me.container.textContent.indexOf( '$$_kityminder_bookmark_$$' );
me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' ); me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' );
me.range.setStart( me.container.firstChild, index ).collapse( true ).select(); me.range.setStart( me.container.firstChild, index ).collapse( true ).select();
...@@ -5619,10 +5619,10 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5619,10 +5619,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}, },
getBaseOffset: function ( refer ) { getBaseOffset: function ( refer ) {
var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() ); var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() );
// if(!this.pr) { // if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green')); // this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// } // }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y); // this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
return rb; return rb;
}, },
setBaseOffset: function () { setBaseOffset: function () {
...@@ -5630,18 +5630,18 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5630,18 +5630,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this; return this;
}, },
setContainerStyle: function () { setContainerStyle: function () {
var textShapeBox = this.getBaseOffset('screen'); var textShapeBox = this.getBaseOffset( 'screen' );
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 35 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;'; this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 35 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
if(!this.selection.isShow()){ if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper(); var paperContainer = this.km.getPaper();
var width = paperContainer.node.parentNode.clientWidth; var width = paperContainer.node.parentNode.clientWidth;
var height = paperContainer.node.parentNode.clientHeight; var height = paperContainer.node.parentNode.clientHeight;
if(width < this.container.offsetWidth + this.container.offsetLeft){ if ( width < this.container.offsetWidth + this.container.offsetLeft ) {
this.km.getRenderContainer().translate(width/-3, 0); this.km.getRenderContainer().translate( width / -3, 0 );
this.setContainerStyle(); this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){ } else if ( height < this.container.offsetTop + this.container.offsetHeight ) {
this.km.getRenderContainer().translate(0, height/-3); this.km.getRenderContainer().translate( 0, height / -3 );
this.setContainerStyle() this.setContainerStyle()
} }
} }
...@@ -5657,7 +5657,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5657,7 +5657,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
try { try {
var box = this.textShape.getExtentOfChar( i ); var box = this.textShape.getExtentOfChar( i );
} catch ( e ) { } catch ( e ) {
console.log(e) console.log( e )
} }
this.textData.push( { this.textData.push( {
...@@ -5753,15 +5753,15 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -5753,15 +5753,15 @@ Minder.Receiver = kity.createClass( 'Receiver', {
endOffset = this.textData[ this.selection.endOffset ], endOffset = this.textData[ this.selection.endOffset ],
width = 0; width = 0;
if ( this.selection.collapsed ) { if ( this.selection.collapsed ) {
this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ],1 ); this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ], 1 );
return this; return this;
} }
if ( !endOffset ) { if ( !endOffset ) {
try{ try {
var lastOffset = this.textData[ this.textData.length - 1 ]; var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width; width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){ } catch ( e ) {
console.log('e') console.log( 'e' )
} }
} else { } else {
......
...@@ -23,10 +23,10 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -23,10 +23,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
_div.setAttribute( 'contenteditable', true ); _div.setAttribute( 'contenteditable', true );
_div.className = 'km_receiver'; _div.className = 'km_receiver';
this.container = document.body.insertBefore( _div, document.body.firstChild ); this.container = document.body.insertBefore( _div, document.body.firstChild );
if(browser.ie && browser.version == 11){ if ( browser.ie && browser.version == 11 ) {
utils.listen(this.container,'keydown keypress keyup',function(e){ utils.listen( this.container, 'keydown keypress keyup', function ( e ) {
me.keyboardEvents.call(me,new MinderEvent(e.type == 'keyup' ? "beforekeyup": e.type,e)) me.keyboardEvents.call( me, new MinderEvent( e.type == 'keyup' ? "beforekeyup" : e.type, e ) )
}) } )
} }
utils.addCssRule( 'km_receiver_css', ' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}' ); // utils.addCssRule( 'km_receiver_css', ' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}' ); //
this.km.on( 'textedit.beforekeyup textedit.keydown textedit.keypress textedit.paste', utils.proxy( this.keyboardEvents, this ) ); this.km.on( 'textedit.beforekeyup textedit.keydown textedit.keypress textedit.paste', utils.proxy( this.keyboardEvents, this ) );
...@@ -52,7 +52,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -52,7 +52,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
textShape = new kity.Text(); textShape = new kity.Text();
} }
this.textShape = textShape; this.textShape = textShape;
this.container.innerHTML = utils.unhtml(textShape.getContent()); this.container.innerHTML = utils.unhtml( textShape.getContent() );
return this; return this;
}, },
setTextShapeSize: function ( size ) { setTextShapeSize: function ( size ) {
...@@ -147,7 +147,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -147,7 +147,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
setTimeout( function () { setTimeout( function () {
me.range.updateNativeRange().insertNode( $( '<span>$$_kityminder_bookmark_$$</span>' )[ 0 ] ); me.range.updateNativeRange().insertNode( $( '<span>$$_kityminder_bookmark_$$</span>' )[ 0 ] );
me.container.innerHTML = utils.unhtml(me.container.textContent.replace( /[\u200b\t\r\n]/g, '' )); me.container.innerHTML = utils.unhtml( me.container.textContent.replace( /[\u200b\t\r\n]/g, '' ) );
var index = me.container.textContent.indexOf( '$$_kityminder_bookmark_$$' ); var index = me.container.textContent.indexOf( '$$_kityminder_bookmark_$$' );
me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' ); me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' );
me.range.setStart( me.container.firstChild, index ).collapse( true ).select(); me.range.setStart( me.container.firstChild, index ).collapse( true ).select();
...@@ -236,10 +236,10 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -236,10 +236,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}, },
getBaseOffset: function ( refer ) { getBaseOffset: function ( refer ) {
var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() ); var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() );
// if(!this.pr) { // if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green')); // this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// } // }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y); // this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
return rb; return rb;
}, },
setBaseOffset: function () { setBaseOffset: function () {
...@@ -247,18 +247,18 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -247,18 +247,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this; return this;
}, },
setContainerStyle: function () { setContainerStyle: function () {
var textShapeBox = this.getBaseOffset('screen'); var textShapeBox = this.getBaseOffset( 'screen' );
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 35 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;'; this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 35 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
if(!this.selection.isShow()){ if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper(); var paperContainer = this.km.getPaper();
var width = paperContainer.node.parentNode.clientWidth; var width = paperContainer.node.parentNode.clientWidth;
var height = paperContainer.node.parentNode.clientHeight; var height = paperContainer.node.parentNode.clientHeight;
if(width < this.container.offsetWidth + this.container.offsetLeft){ if ( width < this.container.offsetWidth + this.container.offsetLeft ) {
this.km.getRenderContainer().translate(width/-3, 0); this.km.getRenderContainer().translate( width / -3, 0 );
this.setContainerStyle(); this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){ } else if ( height < this.container.offsetTop + this.container.offsetHeight ) {
this.km.getRenderContainer().translate(0, height/-3); this.km.getRenderContainer().translate( 0, height / -3 );
this.setContainerStyle() this.setContainerStyle()
} }
} }
...@@ -274,7 +274,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -274,7 +274,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
try { try {
var box = this.textShape.getExtentOfChar( i ); var box = this.textShape.getExtentOfChar( i );
} catch ( e ) { } catch ( e ) {
console.log(e) console.log( e )
} }
this.textData.push( { this.textData.push( {
...@@ -370,15 +370,15 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -370,15 +370,15 @@ Minder.Receiver = kity.createClass( 'Receiver', {
endOffset = this.textData[ this.selection.endOffset ], endOffset = this.textData[ this.selection.endOffset ],
width = 0; width = 0;
if ( this.selection.collapsed ) { if ( this.selection.collapsed ) {
this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ],1 ); this.selection.updateShow( startOffset || this.textData[ this.textData.length - 1 ], 1 );
return this; return this;
} }
if ( !endOffset ) { if ( !endOffset ) {
try{ try {
var lastOffset = this.textData[ this.textData.length - 1 ]; var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width; width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){ } catch ( e ) {
console.log('e') console.log( 'e' )
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment