-
Notifications
You must be signed in to change notification settings - Fork 80
Firefox support, tiling terminal, preview fix #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -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; | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -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; | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
|
@@ -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(); | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
|
@@ -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
|
||||||||||||||||||||||||||||||||
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
refresh(),frmis checked for null butfrm.$browseris not; ifrefresh()runs before the<a:browser>element finishes drawing, this will throw. Mirror the defensive checks used inonFileSave()/preview()by verifyingfrm.$browserexists before assigningsrc.