Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins-client/ext.dockpanel/dockpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,10 @@ module.exports = ext.register("ext/dockpanel/dockpanel", {
},

expandBar : function(bar){
this.layout.expandBar(bar.cache);
if (bar.cache)
this.layout.expandBar(bar.cache);
else if (bar.uniqueId != null)
this.layout.expandBar(bar.uniqueId);
},

//@todo removal of pages
Expand Down
18 changes: 15 additions & 3 deletions plugins-client/ext.dockpanel/libdock.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,18 @@ var DockableLayout = module.exports = function(parentHBox, cbFindPage, cbStorePa
if (!bar.vbox) {
var _self = this;

if (bar.$dockData.minWidth)
pNode.minwidth = bar.$dockData.minWidth;
var dockMinWidthVal = bar.$dockData.minWidth || bar.$dockData["min-width"];
if (dockMinWidthVal)
pNode.minwidth = dockMinWidthVal;

var dockWidth = bar.$dockData && bar.$dockData.width || 260;
var dockMinWidth = dockMinWidthVal || 0;
if (dockMinWidth && dockWidth < dockMinWidth)
dockWidth = dockMinWidth;

bar.vbox = pNode.insertBefore(new ppc.vbox({
padding : 0,
width : bar.$dockData && bar.$dockData.width || 260,
width : dockWidth,
splitters : true,
vdock : 1,
"class" : "dockcol unselectable expandedpanel",
Expand Down Expand Up @@ -772,6 +778,12 @@ var DockableLayout = module.exports = function(parentHBox, cbFindPage, cbStorePa
}

if (bar.vbox) {
// Enforce min-width on the vbox — always set if width is too small
var minW = bar.$dockData && (bar.$dockData.minWidth || bar.$dockData["min-width"]);
var curW = bar.vbox.getWidth ? bar.vbox.getWidth() : 0;
if (minW && (!curW || curW < minW))
bar.vbox.setWidth(minW);

bar.vbox.show();
bar.vbox.expanded = true;
bar.vbox.firstChild.$ext.onmousemove({});
Expand Down
40 changes: 19 additions & 21 deletions plugins-client/ext.main/style/skins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4093,7 +4093,7 @@
}

.datagrid .headings div{
display : -moz-inline-box;
display : inline-block;
overflow : visible;
position : relative;
}
Expand All @@ -4102,7 +4102,7 @@
}

.datagrid .records .row span{
display : -moz-inline-box;
display : inline-block;
overflow : visible;
position : relative;
}
Expand Down Expand Up @@ -4623,7 +4623,7 @@
}

.dgcheck .headings div{
display : -moz-inline-box;
display : inline-block;
overflow : visible;
position : relative;
}
Expand All @@ -4632,7 +4632,7 @@
}

.dgcheck .records .row span{
display : -moz-inline-box;
display : inline-block;
overflow : visible;
position : relative;
}
Expand Down Expand Up @@ -6682,7 +6682,7 @@
]]></a:style>
<a:style condition="ppc.isWebkit">
.sbios{
display : -webkit-box;
display : flex;
}

.sbios span{
Expand Down Expand Up @@ -8055,7 +8055,7 @@
]]></a:style>
<a:style condition="ppc.isWebkit">
.console_scrollbar{
display : -webkit-box;
display : flex;
}

.console_scrollbar span{
Expand Down Expand Up @@ -8779,8 +8779,7 @@
z-index : 90000;
background-color: #e8e8e8;

display : -webkit-box;
display : -ms-box;
display : flex;
}

.w-resize {
Expand Down Expand Up @@ -9314,15 +9313,15 @@
right : 0;

clip: rect(0px 4000px 30px 0px);
display : -webkit-box;
display : flex;
}

.tab_console .btncontainer > .btntab {
cursor: default;

min-width : 17px;
max-width : 70px;
-webkit-box-flex : 1;
flex : 1;
position : relative;
width : 0;

Expand Down Expand Up @@ -9543,7 +9542,7 @@
/*box-shadow: 0 -1px 0 0 black inset, 0 1px 0 0 rgba(255, 255, 255, .06) inset;*/
margin-bottom: 1px;

display : -webkit-box;
display : flex;
}

.editor_tab .btnsesssioncontainer.morepadding{
Expand All @@ -9561,7 +9560,7 @@

min-width : 17px;
max-width : 150px;
-webkit-box-flex : 1;
flex : 1;
position : relative;
width : 0;
line-height : 1.2em;
Expand Down Expand Up @@ -10811,6 +10810,8 @@
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
width: 100%;
min-width: 0;
}

.docktab .btncontainer{
Expand All @@ -10822,7 +10823,7 @@
width : auto;

clip: rect(0px 3000px 30px 0px);
display : -webkit-box;
display : flex;
}

.dockcol .docktab .btncontainer{
Expand All @@ -10845,7 +10846,7 @@

min-width : 17px;
max-width : 100px;
-webkit-box-flex : 1;
flex : 1;
width : 0;

padding : 3px 2px 4px;
Expand Down Expand Up @@ -12542,13 +12543,10 @@
.img div {
width : 100%;
height : 100%;
display: -webkit-box;
-webkit-box-orient: horizontal;
box-orient: horizontal;
-webkit-box-pack: center;
box-pack: center;
-webkit-box-align: center;
box-align: center;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}

.img IMG {
Expand Down
66 changes: 55 additions & 11 deletions plugins-client/ext.preview/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,17 @@ module.exports = ext.register($name, {
if (!button || !button.cache)
return;
var pNode = button.cache.$dockpage.$pHtmlNode;
if (pNode.children.length === 4) {
pNode.removeChild(pNode.children[2]);
pNode.children[2].style.top = 0;
// Find and hide the caption element by class instead of
// removing by index, which could destroy the iframe.
for (var i = 0; i < pNode.children.length; i++) {
var child = pNode.children[i];
if (child.className && child.className.indexOf('docktab_page_caption') !== -1) {
child.style.display = 'none';
// Expand the content area below to fill the space
var next = pNode.children[i + 1];
if (next) next.style.top = '0';
break;
}
}
},

Expand All @@ -182,10 +190,10 @@ module.exports = ext.register($name, {
})[0];
if (page)
this.live.value = page.$doc.getValue();
var iframe = this.getIframe().$ext;
if (!iframe || !iframe.contentWindow)
var frm = this.getIframe();
if (!frm || !frm.$browser || !frm.$browser.contentWindow)
return;
var html = iframe.contentWindow.document.getElementsByTagName("html")[0];
var html = frm.$browser.contentWindow.document.getElementsByTagName("html")[0];
html.innerHTML = this.live.value;
},

Expand All @@ -195,8 +203,8 @@ module.exports = ext.register($name, {
dock.expandBar(bar);
dock.showSection(this.$name, this.$button);
this.hidePageHeader();
var frmPreview = this.getIframe();
if (frmPreview.$ext.src !== url)
var frm = this.getIframe();
if (frm && frm.$browser && frm.$browser.src !== url)
this.refresh(url);
this.live = live;
},
Expand All @@ -207,9 +215,10 @@ module.exports = ext.register($name, {
},

refresh: function (url) {
var frmPreview = this.getIframe();
var frm = this.getIframe();
if (!frm) return;
url = url || txtPreview.getValue();
frmPreview.$ext.src = url;
frm.$browser.src = url;
txtPreview.setValue(url);
settings.save();
Comment on lines 217 to 223

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In refresh(), frm is checked for null but frm.$browser is not; if refresh() runs before the <a:browser> element finishes drawing, this will throw. Mirror the defensive checks used in onFileSave()/preview() by verifying frm.$browser exists before assigning src.

Copilot uses AI. Check for mistakes.
},
Expand All @@ -222,10 +231,45 @@ module.exports = ext.register($name, {

init: function() {
ppc.importCssString(this.css || "");

// Size the browser iframe to fill the page below the toolbar.
// PPC page elements don't support flexbox so we calculate
// the height dynamically based on the docktab container.
var fixSize = function() {
if (typeof frmPreview === 'undefined' || !frmPreview.$ext ||
typeof pgPreview === 'undefined' || !pgPreview.$ext) {
setTimeout(fixSize, 200);
return;
}

var iframe = frmPreview.$ext;
Comment on lines +239 to +245

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

init() sizes frmPreview.$ext, but for <a:browser> $ext can be a wrapper element (e.g., when ppc.cannotSizeIframe), while the actual iframe is frmPreview.$browser (which is also what the rest of this module uses). Use frmPreview.$browser (or handle both cases) to ensure border/width/height are applied to the real iframe consistently.

Suggested change
if (typeof frmPreview === 'undefined' || !frmPreview.$ext ||
typeof pgPreview === 'undefined' || !pgPreview.$ext) {
setTimeout(fixSize, 200);
return;
}
var iframe = frmPreview.$ext;
if (typeof frmPreview === 'undefined' ||
(!frmPreview.$browser && !frmPreview.$ext) ||
typeof pgPreview === 'undefined' || !pgPreview.$ext) {
setTimeout(fixSize, 200);
return;
}
var iframe = frmPreview.$browser || frmPreview.$ext;

Copilot uses AI. Check for mistakes.
iframe.style.border = 'none';
iframe.style.width = '100%';

var resize = function() {
// Find the docktab ancestor to get the available height
var el = pgPreview.$ext;
while (el && !(el.className || '').match(/docktab/)) {
el = el.parentElement;
}
if (!el) return;
var availH = el.getBoundingClientRect().height;
// 36px for the toolbar bar
iframe.style.height = Math.max(0, availH - 36 - 28) + 'px';
};

resize();
// Re-size when window resizes
window.addEventListener('resize', resize);
// Also periodically check in case dock panel is resized
setInterval(resize, 500);
};
fixSize();
},

getIframe: function() {
return pgPreview.selectSingleNode("iframe");
// frmPreview is the PPC browser element defined in preview.xml
return typeof frmPreview !== 'undefined' ? frmPreview : null;
},

enable : function() {
Expand Down
10 changes: 4 additions & 6 deletions plugins-client/ext.preview/preview.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a:application xmlns:a="https://github.com/pylonide/pylon">
<a:tab skin="docktab" visible="false">
<a:page id="pgPreview" caption="Preview">
<a:bar border="0 0 0 0">
<a:bar border="0 0 0 0" height="36">
<a:hbox class="previewbar" height="36" align="center" edge="4 5 4" padding="5">
<a:textbox id="txtPreview" style="width:100%" class="ace_searchbox tb_textbox searchbox searchTxt tb_console"
flex="1" value=""
Expand All @@ -13,10 +13,8 @@
<a:button onclick="require('ext/preview/preview').close()" skin="btn-preview-nav" skinset="previewskin" class="close"></a:button>
</a:hbox>
</a:bar>
<iframe
class="preview_iframe"
onload="require('ext/preview/preview').onLoad()"
src="" />
</a:page>
<a:browser id="frmPreview" src=""
onload="require('ext/preview/preview').onLoad()" />
</a:page>
</a:tab>
</a:application>
Loading
Loading