Skip to content

Commit 6236d00

Browse files
authored
fix: made protocol dynamic in the publishURL displayed on 'Publish As Website' dialogbox (#1170)
* change https to http on UIWindowPublishWebsite * fix: made protocol string dynamic in the publish as website dialogbox
1 parent 3e74f42 commit 6236d00

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/gui/src/UI/UIWindowPublishWebsite.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di
3636
h += `<div class="publish-website-error-msg"></div>`;
3737
// subdomain
3838
h += `<div style="overflow: hidden;">`;
39-
h += `<label style="margin-bottom: 10px;">${i18n('pick_name_for_website')}</label>`;
40-
h += `<div style="font-family: monospace;">https://<input class="publish-website-subdomain" style="width:235px;" type="text" autocomplete="subdomain" spellcheck="false" autocorrect="off" autocapitalize="off" data-gramm_editor="false"/>.${html_encode(window.hosting_domain)}</div>`;
39+
h += `<label style="margin-bottom: 10px;">${i18n('pick_name_for_website')}</label>`;
40+
41+
h += `<div style="font-family: monospace;">${html_encode(window.extractProtocol(window.url))}://<input class="publish-website-subdomain" style="width:235px;" type="text" autocomplete="subdomain" spellcheck="false" autocorrect="off" autocapitalize="off" data-gramm_editor="false"/>.${html_encode(window.hosting_domain)}</div>`;
4142
h += `</div>`;
4243
// uid
4344
h += `<input class="publishWebsiteTargetDirUID" type="hidden" value="${html_encode(target_dir_uid)}"/>`;

src/gui/src/helpers.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,6 +2224,10 @@ window.extractSubdomain = function(url) {
22242224
return subdomain;
22252225
}
22262226

2227+
window.extractProtocol = function (url) {
2228+
var protocol = url.split('://')[0];
2229+
return protocol;
2230+
}
22272231
window.sleep = function(ms){
22282232
return new Promise(resolve => setTimeout(resolve, ms));
22292233
}

0 commit comments

Comments
 (0)