Commit 9a1f16cb authored by techird's avatar techird

Merge branch 'dev' into gh-pages

parents 57e57bb5 ac7424be
...@@ -91,7 +91,7 @@ $( function () { ...@@ -91,7 +91,7 @@ $( function () {
var options = { var options = {
response_type: 'token', response_type: 'token',
media_type: 'baidu', media_type: 'baidu',
redirect_uri: baseUrl + 'index.html', redirect_uri: window.location.href,
client_type: 'web' client_type: 'web'
}; };
baidu.frontia.social.login( options ); baidu.frontia.social.login( options );
...@@ -129,7 +129,7 @@ $( function () { ...@@ -129,7 +129,7 @@ $( function () {
by: 'time', by: 'time',
success: function ( result ) { success: function ( result ) {
if ( result.list.length ) { if ( result.list.length ) {
if ( !isShareLink ) { if ( !isShareLink && !thisMapFilename ) {
loadPersonal( result.list[ 0 ].path ); loadPersonal( result.list[ 0 ].path );
} else { } else {
$user_btn.loading( false ); $user_btn.loading( false );
...@@ -141,7 +141,7 @@ $( function () { ...@@ -141,7 +141,7 @@ $( function () {
} }
function addToRecentMenu( list ) { function addToRecentMenu( list ) {
list.splice(8); list.splice( 8 );
list.forEach( function ( file ) { list.forEach( function ( file ) {
$user_menu.appendItem( { $user_menu.appendItem( {
item: { item: {
...@@ -290,7 +290,7 @@ $( function () { ...@@ -290,7 +290,7 @@ $( function () {
function loadShare() { function loadShare() {
var pattern = /share_id=(\w+)([&#]|$)/; var pattern = /share_id=(\w+)([&#]|$)/;
var match = pattern.exec( window.location.href ); var match = pattern.exec( window.top.location.href );
if ( !match ) return; if ( !match ) return;
var shareId = match[ 1 ]; var shareId = match[ 1 ];
var query = new baidu.frontia.storage.Query(); var query = new baidu.frontia.storage.Query();
...@@ -308,11 +308,23 @@ $( function () { ...@@ -308,11 +308,23 @@ $( function () {
} ); } );
isShareLink = true; isShareLink = true;
} }
function loadPath() {
var pattern = /path=(.+?)([&#]|$)/;
var match = pattern.exec( window.top.location.href );
if ( !match ) return;
thisMapFilename = decodeURI( match[ 1 ] );
}
loadShare(); loadShare();
currentUser = baidu.frontia.getCurrentAccount(); currentUser = baidu.frontia.getCurrentAccount();
if ( currentUser ) { if ( currentUser ) {
setCurrentUser( currentUser ); setCurrentUser( currentUser );
loadPath();
if(thisMapFilename) {
loadPersonal( thisMapFilename );
}
} else { } else {
$login_btn.appendTo( $panel ); $login_btn.appendTo( $panel );
} }
......
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