Skip to content

Commit

Permalink
更新版本为 v1.3.0 for 3818
Browse files Browse the repository at this point in the history
  • Loading branch information
shileiye committed Apr 6, 2021
1 parent 01997db commit 8e82f4b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 314 deletions.
2 changes: 1 addition & 1 deletion DefaultSettings/Prototype_Files/plugins/debug/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
pageNotesUi += "<div id='traceDiv'></div></div>";
pageNotesUi += "</div></div>";

$('#debugHost').html(pageNotesUi);
$('#debugHost').append(pageNotesUi);
$('#traceEmptyState').show();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
pageNotesUi += "<span id='pageNotesContent'></span>";
pageNotesUi += "</div></div>";

$('#pageNotesHost').html(pageNotesUi);
$('#pageNotesHost').append(pageNotesUi);

if(!$axure.document.configuration.showAnnotations) {
$('#pageNotesHost .pageNameHeader').css('padding-right', '55px');
Expand Down
304 changes: 9 additions & 295 deletions DefaultSettings/Prototype_Files/resources/scripts/player/axplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,37 +1093,6 @@ var toolBarOnly = true;
}
}

var userAcct = {
userId: '',
userName: '',
userEmail: '',
userProfileImg: '',
isUsingAxureAcct: false,
}

var authCookieValue = null;
var userCookieValue = null;
var isSubInstance = false;
//var readOnlyMode = false;
//var readOnlyMessage = '';

// Watermark hints
// NOTE: The trailing characters serve to be a distinguishing element in case the user actually does use text similar to the hint.
var emailHint = "Email ";
var passHint = "Password ";

var feedbackServiceUrl = (window.AXSHARE_HOST_SECURE_URL || 'https://share.axure.com') + '/issue';
// Look at creating a new location to have GetShareStatus(FbEnabled replacement) and SafariAuth since they are more general calls that are not solely for feedback now
//var prototypeControlUrl = (window.AXSHARE_HOST_SECURE_URL || 'https://share.axure.com') + '/prototype';

// Checks if the browser is Safari 3.0+
// https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
function isSafari() {
// Safari 3.0+ "[object HTMLElementConstructor]"
var liveSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));
return liveSafari || SAFARI || (IOS && $axure.utils.isShareApp());
};

var iosInnerHeight = (function () {
if (!navigator.userAgent.match(/iphone|ipod|ipad/i)) {
/**
Expand Down Expand Up @@ -1180,265 +1149,6 @@ var toolBarOnly = true;
};
}());

function includeTokens(ajaxData, excludeUser) {
//If the authCookieValue is set (a password-protected local prototype), then send the
//token as well (because cookies don't always get sent to external domains)
if (authCookieValue) {
$.extend(ajaxData, { token: authCookieValue });
}
if (!excludeUser && userCookieValue) {
$.extend(ajaxData, { utoken: userCookieValue });
}
}

function setUserLoggedInStatus(response, safariAuthResponseProfile) {
if (!response.success) {
userAcct.isUsingAxureAcct = false;
} else {
if (safariAuthResponseProfile) response = safariAuthResponseProfile;
userAcct.userId = response.userId;
if (safariAuthResponseProfile)
userAcct.userName = response.username == null || response.username.trim() === '' ? response.userEmail : response.username.trim();
else
userAcct.userName = response.nickname == null || response.nickname.trim() === '' ? response.userEmail : response.nickname.trim();
userAcct.userEmail = response.userEmail;
userAcct.userProfileImg = response.profileImageUrl;
userAcct.isUsingAxureAcct = true;

if (response.authToken != null) {
$axshare.setAuthCookie(response.authToken);
userCookieValue = response.authToken;
}
}

// If feedback is loaded, update feedback with new account information
if (typeof feedback !== 'undefined') feedback.updateUserAccountInfo(userAcct, authCookieValue, userCookieValue);
}

// TODO: for on prem, we need to use an ajax call directly to share instead of accounts
// Verify authentication against axure accounts
$axure.player.axureAuth = function axureAuth(callback) {
if (window.$axshare != null) {
$axshare.auth(function (response) {
if (response.success) {
setUserLoggedInStatus(response);
} else {
if (isSafari()) {
var ajaxData = {
userId: userAcct.isUsingAxureAcct ? userAcct.userId : ""
};
includeTokens(ajaxData);

$.ajax({
type: 'GET',
url: feedbackServiceUrl + '/safariAuth',
data: ajaxData,
success: function (response) {
if (!response.success) {
setUserLoggedInStatus(response);
} else {
setUserLoggedInStatus(response, response.data.profile[userAcct.userId]);

if (callback != null) {
callback(response);
}
}
},
dataType: 'jsonp'
});
} else {
setUserLoggedInStatus(response);
}
}

if (callback != null) {
callback(response);
}

});
}
}

// TODO: for on prem, we need to use an ajax call directly to share instead of accounts
// Log into axure accounts
$axure.player.axureLogin = function axureLogin(email, password, success, failure, saml) {
if (window.$axshare != null) {
password = password === passHint ? "" : password;
$axshare.login(email, password, false, function (response) {
if (response.redirecturl !== "" && response.redirecturl != null) {
saml(response);
return;
}

if (response.success && (response.verified || isSubInstance)) {
if (isSafari()) setUserLoggedInStatus(response);
$axure.player.axureAuth(success);
} else {
failure(response);
}
}, window.ON_PREM_LDAP_ENABLED);
} else {
failure();
}
}

function playerLogout() {
userAcct.isUsingAxureAcct = false;
userAcct.userId = '';
userAcct.userProfileImg = '';

// If feedback is loaded, update feedback with new account information
if (typeof feedback !== 'undefined') feedback.updateUserAccountInfo(userAcct);
}

$axure.player.logout = function (feedbackLogout) {
var completeLogout = playerLogout;
if (feedbackLogout) {
completeLogout = function () {
feedbackLogout();
playerLogout();
}
}
if (window.$axshare != null) {
$axshare.logout(completeLogout);
} else {
completeLogout();
}
}

/*
* TODO: Start of Login/Account Mgmt UI, which will need to be updated (currenly uses feedback9.css often)
*/
function buildAccountLoginPopup() {
return [
'<div class="axClearMsgBubble_Player axureLoginBubble_Player">',
' <div class="axureLoginBubbleContainer_Player">',
' <span style="font-weight: bold; font-size: 10px;">登录您的Axure云帐户</span>',
' <input type="text" autocapitalize="none" name="email" class="axureEmail" style="margin-top: 7px;"/>',
' <input name="password" autocapitalize="none" class="axurePassword" />',
' <div class="feedbackGreenBtn_Player">登录</div>',
' <div class="errorMessage"></div>',
' <div id="playerSignUpLink" style="text-align: right; margin-top: 5px; font-size: 10px;">',
' <span>没有账号?<a class="axureSignUpLink" href="', window.AXSHARE_HOST_SECURE_URL, '" target="_blank">注册</a></span>',
' </div>',
' </div>',
'</div>'
].join("");
}

// Bind events to axure login speech bubble (watermark, login, errors, click outside)
function bindAxureLoginContainerEvent() {
var $container = $("#accountLoginContainer");
$container.find('input[name="email"]').addClass("watermark").val(emailHint).focus(function () {
if ($(this).val() === emailHint) {
$(this).removeClass("watermark").val("");
}
}).blur(function () {
if ($(this).val() === "") {
$(this).addClass("watermark").val(emailHint);
}

$container.find('.errorMessage').text('');
$container.find('.errorMessage').hide();
}).keyup(function (event) {
if (event.keyCode == 13) {
$container.find('.feedbackGreenBtn').click();
}
});
$container.find('input[name="password"]').addClass("watermark").val(passHint).focus(function () {
if ($(this).val() === passHint) {
$(this).removeClass("watermark").val("");
//$(this).removeClass("watermark").val("").attr("type", "password");

// Note: this might be an issue since jquery doesn't like it. Test in IE
$(this)[0].setAttribute('type', 'password');
}
}).blur(function () {
if ($(this).val() === "") {
$(this).val(passHint).addClass("watermark");
//$(this).val(passHint).addClass("watermark").removeAttr("type");

// Note: this might be an issue since jquery doesn't like it. Test in IE
$(this)[0].setAttribute('type', 'text');
}

$container.find('.errorMessage').text('');
$container.find('.errorMessage').hide();
}).keyup(function (event) {
if (event.keyCode == 13) {
$container.find('.feedbackGreenBtn_Player').click();
}
});

// Login Submit Event
$container.find('.feedbackGreenBtn_Player').click(function (e) {
var email = $container.find('.axureEmail').val();
var password = $container.find('.axurePassword').val();

$axure.player.axureLogin(email, password, function (response) {
// Success
// Clear out fields
$container.find('.axureEmail').val(emailHint).addClass("watermark");
$container.find('.axurePassword').val(passHint).addClass("watermark");
$container.find('.axurePassword')[0].setAttribute('type', 'text');

closePopup();
}, function (response) {
// Failure
$container.find('.errorMessage').text(response != null && response.message ? response.message : "There was an error connecting to the server, please try again later.");
$container.find('.errorMessage').show();
}, function (response) {
// SAML User
$container.find('.errorMessage').empty();
$container.find('.errorMessage').append("Please <a class='refreshLink' style='text-decoration: underline;'>refresh</a> this page after logging in via your identity provider.");
$container.find('.errorMessage').show();

window.open(response.redirecturl, '_blank');

$container.find('.errorMessage').find('.refreshLink').click(function () {
location.reload(true);
});
});
});
};

function initializeSignIn() {
if (typeof PREVIEW_INFO === 'undefined' && $axure.player.settings.isAxshare) {
(function finishInit() {
if (window.$axshare == null || $axshare.auth == null || $axshare.login == null) {
setTimeout(finishInit, 50);
} else {
// Call to set readOnlyMode, readOnlyMessage, and isSubinstance (readOnlyMode/Message currently only used for feedback9)
$.ajax({
type: 'GET',
url: feedbackServiceUrl + '/GetShareStatus',
data: {},
success: function (response) {
//readOnlyMode = response.readOnlyMode;
//readOnlyMessage = response.readOnlyMessage;
isSubInstance = response.isSubInstance;
if (isSubInstance) $('#accountLoginContainer').find("#playerSignUpLink").hide();

// For now, calling methods to set these values in feedback on start (could later make a general method to retrieve these values from player)
if (typeof feedback !== 'undefined') {
feedback.setReadOnlyModeAndMessage(response.readOnlyMode, response.readOnlyMessage);
feedback.setIsSubInstance(isSubInstance);
}
},
dataType: 'jsonp'
});

// Login container
$("#accountLoginContainer").append(buildAccountLoginPopup());
bindAxureLoginContainerEvent();

// Attempt to auth and acquire account information, then update top panel
$axure.player.axureAuth();
}
})();
}
}

function overflowIsHidden(node) {
var style = getComputedStyle(node);
return style.overflow === 'hidden' || style.overflowX === 'hidden' || style.overflowY === 'hidden';
Expand Down Expand Up @@ -1607,9 +1317,6 @@ var toolBarOnly = true;
initializePreview();

$axure.player.resizeContent(true);

// Has timeout to keep waiting to build sign in controls while axAccount is still loading
initializeSignIn();
})();
});

Expand Down Expand Up @@ -2368,8 +2075,15 @@ var toolBarOnly = true;
}
} else {
if (!$('#separatorContainer').hasClass('hasLeft')) $('#separatorContainer').addClass('hasLeft');
host = $('<div id="' + settings.id + '" class="' + panelClass + '"></div>')
.appendTo('#' + hostContainerId);
var closeButtonContainer = $('<div class="closeButtonContainer"></div>');
var closeButton = $('<button>&#10006;</button>');
closeButton.on('click', function () {
$axure.player.pluginClose(settings.id);
});
closeButton.appendTo(closeButtonContainer);
host = $('<div id="' + settings.id + '" class="' + panelClass + '"></div>');
closeButtonContainer.appendTo(host);
host.appendTo('#' + hostContainerId);
}

$(('#' + settings.id)).click(function (e) { e.stopPropagation(); });
Expand Down
7 changes: 2 additions & 5 deletions DefaultSettings/Prototype_Files/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<div class="separator"></div>
</div>

<!-- <div id="overflowMadeWith"><a href="https://www.shileiye.com" title="Axure RP 10 CHS.WEB V1.2 for 3816" id="axureLogo" target="_blank"></a></div> -->
<!-- <div id="overflowMadeWith"><a href="https://www.shileiye.com" title="Axure RP 10 CHS.WEB V1.3 for 3818" id="axureLogo" target="_blank"></a></div> -->

</div>

Expand All @@ -103,9 +103,6 @@
<div id='interfaceScaleListContainer'>
</div>

<div id='accountLoginContainer'>
</div>

<div id='overflowMenuContainer'>
</div>
</div>
Expand Down Expand Up @@ -139,7 +136,7 @@

<div id="mobileControlFrameContainer"></div>

<!-- 10.0.0.3816 -->
<!-- 10.0.0.3818 -->
<script src="resources/scripts/jquery-3.2.1.min.js"></script>
<script src="resources/scripts/axure/jquery.nicescroll.min.js"></script>
<script src="resources/scripts/axutils.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
本汉化在Windows10系统中通过测试,可放心使用,仅适用于Axure RP 10!

### 【文件版本】
汉化文件版本:Axure RP 10 CHS v1.2.0 for 3816
汉化文件版本:Axure RP 10 CHS v1.3.0 for 3818

### 【使用方法】
1、将汉化压缩包解压缩。
Expand All @@ -26,7 +26,7 @@
4、不定时跟进新版Axure RP 10的汉化,欢迎关注本仓库下载最新版汉化包。

### 【申明】
软件通用汉化语言文件基于Pluwen发布的Axure RP 9中文语言包整理补全,感谢小楼老师及曾经为该汉化贡献的朋友们!欢迎大家过来贡献翻译,保持该软件汉化的持续更新!
软件通用汉化语言文件基于Pluwen发布的Axure RP 10中文语言包整理补全,感谢小楼老师及曾经为该汉化贡献的朋友们!欢迎大家过来贡献翻译,保持该软件汉化的持续更新!

### 【截图演示】
[![软件界面汉化截图](https://github.com/shileiye/Axure-RP-10-CHS/blob/main/%E6%BC%94%E7%A4%BA%E5%9B%BE%E7%89%87/%E8%BD%AF%E4%BB%B6%E6%88%AA%E5%9B%BE.png "软件界面汉化截图")](https://github.com/shileiye/Axure-RP-10-CHS/blob/main/%E6%BC%94%E7%A4%BA%E5%9B%BE%E7%89%87/%E8%BD%AF%E4%BB%B6%E6%88%AA%E5%9B%BE.png "软件界面汉化截图")
Expand Down
Loading

0 comments on commit 8e82f4b

Please sign in to comment.