Commit d2d0c27e authored by Akikonata's avatar Akikonata

format

parent f0cb4ee8
......@@ -7,26 +7,26 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<script src="lib/jquery-2.1.0.min.js?_=1399627592968" charset="utf-8"></script>
<script src="lib/ZeroClipboard.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?_=1399630445671" charset="utf-8"></script>
<script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script>
<script src="lib/kitygraph.all.min.js?_=1399627592968" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399627592968" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399627592968" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1399627592968" charset="utf-8"></script>
<script src="lib/kitygraph.all.min.js?_=1399630445671" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399630445671" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399630445671" 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>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js?_=1399627592968" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399627592968" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399627592968" charset="utf-8"></script>
<script src="social/social.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?_=1399630445671" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399630445671" charset="utf-8"></script>
<script src="social/social.js?_=1399630445671" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
......
......@@ -5406,10 +5406,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
_div.setAttribute( 'contenteditable', true );
_div.className = 'km_receiver';
this.container = document.body.insertBefore( _div, document.body.firstChild );
if(browser.ie && browser.version == 11){
utils.listen(this.container,'keydown keypress keyup',function(e){
me.keyboardEvents.call(me,new MinderEvent(e.type == 'keyup' ? "beforekeyup": e.type,e))
})
if ( browser.ie && browser.version == 11 ) {
utils.listen( this.container, 'keydown keypress keyup', function ( 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);}' ); //
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', {
textShape = new kity.Text();
}
this.textShape = textShape;
this.container.innerHTML = utils.unhtml(textShape.getContent());
this.container.innerHTML = utils.unhtml( textShape.getContent() );
return this;
},
setTextShapeSize: function ( size ) {
......@@ -5530,7 +5530,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
setTimeout( function () {
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_$$' );
me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' );
me.range.setStart( me.container.firstChild, index ).collapse( true ).select();
......@@ -5619,10 +5619,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
getBaseOffset: function ( refer ) {
var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() );
// if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
// if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
return rb;
},
setBaseOffset: function () {
......@@ -5630,18 +5630,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this;
},
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;';
if(!this.selection.isShow()){
if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper();
var width = paperContainer.node.parentNode.clientWidth;
var height = paperContainer.node.parentNode.clientHeight;
if(width < this.container.offsetWidth + this.container.offsetLeft){
this.km.getRenderContainer().translate(width/-3, 0);
if ( width < this.container.offsetWidth + this.container.offsetLeft ) {
this.km.getRenderContainer().translate( width / -3, 0 );
this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){
this.km.getRenderContainer().translate(0, height/-3);
} else if ( height < this.container.offsetTop + this.container.offsetHeight ) {
this.km.getRenderContainer().translate( 0, height / -3 );
this.setContainerStyle()
}
}
......@@ -5657,7 +5657,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
try {
var box = this.textShape.getExtentOfChar( i );
} catch ( e ) {
console.log(e)
console.log( e )
}
this.textData.push( {
......@@ -5753,15 +5753,15 @@ Minder.Receiver = kity.createClass( 'Receiver', {
endOffset = this.textData[ this.selection.endOffset ],
width = 0;
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;
}
if ( !endOffset ) {
try{
try {
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){
console.log('e')
} catch ( e ) {
console.log( 'e' )
}
} else {
......
......@@ -23,10 +23,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
_div.setAttribute( 'contenteditable', true );
_div.className = 'km_receiver';
this.container = document.body.insertBefore( _div, document.body.firstChild );
if(browser.ie && browser.version == 11){
utils.listen(this.container,'keydown keypress keyup',function(e){
me.keyboardEvents.call(me,new MinderEvent(e.type == 'keyup' ? "beforekeyup": e.type,e))
})
if ( browser.ie && browser.version == 11 ) {
utils.listen( this.container, 'keydown keypress keyup', function ( 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);}' ); //
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', {
textShape = new kity.Text();
}
this.textShape = textShape;
this.container.innerHTML = utils.unhtml(textShape.getContent());
this.container.innerHTML = utils.unhtml( textShape.getContent() );
return this;
},
setTextShapeSize: function ( size ) {
......@@ -147,7 +147,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
setTimeout( function () {
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_$$' );
me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' );
me.range.setStart( me.container.firstChild, index ).collapse( true ).select();
......@@ -236,10 +236,10 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
getBaseOffset: function ( refer ) {
var rb = this.textShape.getRenderBox( refer || this.km.getRenderContainer() );
// if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
// if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
return rb;
},
setBaseOffset: function () {
......@@ -247,18 +247,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this;
},
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;';
if(!this.selection.isShow()){
if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper();
var width = paperContainer.node.parentNode.clientWidth;
var height = paperContainer.node.parentNode.clientHeight;
if(width < this.container.offsetWidth + this.container.offsetLeft){
this.km.getRenderContainer().translate(width/-3, 0);
if ( width < this.container.offsetWidth + this.container.offsetLeft ) {
this.km.getRenderContainer().translate( width / -3, 0 );
this.setContainerStyle();
}else if (height < this.container.offsetTop + this.container.offsetHeight){
this.km.getRenderContainer().translate(0, height/-3);
} else if ( height < this.container.offsetTop + this.container.offsetHeight ) {
this.km.getRenderContainer().translate( 0, height / -3 );
this.setContainerStyle()
}
}
......@@ -274,7 +274,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
try {
var box = this.textShape.getExtentOfChar( i );
} catch ( e ) {
console.log(e)
console.log( e )
}
this.textData.push( {
......@@ -370,15 +370,15 @@ Minder.Receiver = kity.createClass( 'Receiver', {
endOffset = this.textData[ this.selection.endOffset ],
width = 0;
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;
}
if ( !endOffset ) {
try{
try {
var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width;
}catch(e){
console.log('e')
} catch ( e ) {
console.log( 'e' )
}
} 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