Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
campaign committed Apr 18, 2014
2 parents ef3b55d + e51f17a commit 2c353fa
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="keywords" content="思维导图,脑图,minder,mind,kity">
<meta name="description" content="在线思维导图工具"
<meta name="description" content="在线思维导图工具">
<script src="../lib/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="../lib/ZeroClipboard.min.js" charset="utf-8"></script>
<script type="text/javascript">
Expand Down
Binary file added social/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions social/social.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions social/social.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ $( function () {
function start() {
initUI();
initFrontia();
if ( checkLogin() ) {
return;
}
loadShare();
checkLogin();
bindShortCuts();
bindDraft();
watchChanges();
Expand Down Expand Up @@ -260,8 +262,10 @@ $( function () {
function checkLogin() {
var account = baidu.frontia.getCurrentAccount();
if ( account ) {
setAccount( account );
login();
return true;
}
return false;
}

// 用户点击登录按钮主动登录
Expand Down Expand Up @@ -299,14 +303,16 @@ $( function () {

// 加载用户头像
function loadAvator() {
var $img = $( '<img />' ).attr( {
'src': '../social/loading.gif',
'width': 16,
'height': 16
} ).prependTo( $user_btn );
currentAccount.getDetailInfo( {
success: function ( user ) {
var $img = $( '<img />' ).attr( {
'src': user.extra.tinyurl,
'width': 16,
'height': 16
$img.attr( {
'src': user.extra.tinyurl
} );
$img.prependTo( $user_btn );
}
} );
}
Expand Down
12 changes: 11 additions & 1 deletion social/social.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ button {
font-family: Arial, "Heiti SC", "Microsoft Yahei";
outline: none;
display: inline-block;
vertical-align: middle;
padding: 0 15px;
height: 35px;
font-size: 13px;
Expand All @@ -47,7 +48,7 @@ button {
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */

&:hover, &.hover {
background: #009fff;
}
Expand Down Expand Up @@ -99,6 +100,15 @@ button {
}
&.user-file {
position: relative;
img {
border: none;
outline: none;
}
span.text {
display: inline-block;
height: 24px;
line-height: 24px;
}
.dropdown;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/adapter/saveto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
value: [],
autowidthitem: [],
enabledRecord: false,
enabledSelected:false
enabledSelected: false
},
$combox = null,
comboboxWidget = null;
Expand Down Expand Up @@ -70,9 +70,12 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
if ( typeof ( data ) == 'string' ) {
var url = 'data:text/plain; utf-8,' + encodeURIComponent( data );
if ( ie_ver() > 0 ) {
alert( '11111111' );
console.log( p.fileExtension );
if ( p.fileExtension === '.km' ) {
console.log( "KM" );
doSave( 'application/x-javascript', data, me.getMinderTitle() );
} else( p.fileExtension === '.svg' ) {
doSave( 'image/svg+xml', data, filename );
} else {
doSave( 'text/html', data, filename );
}
Expand All @@ -81,7 +84,6 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
}
} else if ( data && data.then ) {
data.then( function ( url ) {
console.log( url );
if ( ie_ver() > 0 ) {
//doSave( 'application/base64', url.replace( 'image/octet-stream,', '' ), filename );
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/protocal/png.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ KityMinder.registerProtocal( "png", function () {
function loadImage( url, callback ) {
var image = new Image();
image.onload = callback;
console.log( url );
image.src = url;
}

Expand All @@ -27,7 +28,7 @@ KityMinder.registerProtocal( "png", function () {
ctx = canvas.getContext( '2d' ),
blob, DomURL, url, img, finishCallback;


bgUrl = bgUrl.replace( /"/g, '' );
renderContainer.translate( -renderBox.x, -renderBox.y );

svgXml = km.getPaper().container.innerHTML;
Expand Down Expand Up @@ -73,7 +74,6 @@ KityMinder.registerProtocal( "png", function () {
var url = canvas.toDataURL( 'png' );
return url.replace( 'image/png', 'image/octet-stream' );
}

loadImage( url, function () {
var svgImage = this;
loadImage( bgUrl, function () {
Expand Down

0 comments on commit 2c353fa

Please sign in to comment.