-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from fedwiki/paul90/dialog
Replacing jQuery UI Dialog
- Loading branch information
Showing
19 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title></title> | ||
<link id="favicon" href="/favicon.png" rel="icon" type="image/png" /> | ||
<link href="/dialog/style.css" rel="stylesheet" /> | ||
<script> | ||
window.addEventListener( | ||
"message", | ||
(event) => { | ||
const data = event.data | ||
console.log('data', data) | ||
document.title = data.title | ||
document.querySelector('.page').innerHTML = data.body | ||
} | ||
) | ||
</script> | ||
</head> | ||
<body> | ||
<div class="page"> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
body { | ||
inset: 0; | ||
position: absolute; | ||
background: #eee url('/images/crosses.png'); | ||
padding: 0; | ||
margin: 0; | ||
line-height: 1.3; | ||
color: #333; | ||
} | ||
.page { | ||
margin: 8px; | ||
outline: none; | ||
box-shadow: 2px 1px 4px rgba(0,0,0,0.2); | ||
background: #eee; | ||
padding: 8px; | ||
position: absolute; | ||
inset: 0px; | ||
overflow: auto; | ||
scrollbar-gutter: stable; | ||
scrollbar-width: thin; | ||
scrollbar-color: #ccc #eee; | ||
} | ||
p { | ||
margin: 8px; | ||
} | ||
.remote { | ||
vertical-align: text-top; | ||
width: 16px; | ||
height: 16px | ||
} | ||
a { | ||
text-decoration: none; | ||
} | ||
|
||
:is(#authors,#provenance) a { | ||
margin-left: 16px; | ||
} | ||
|
||
.page:has(>img,svg) { | ||
overflow: hidden; | ||
scrollbar-gutter: auto; | ||
} | ||
|
||
.page > img,svg{ | ||
width: auto !important; | ||
max-width: 100%; | ||
max-height: 100%; | ||
} |
Binary file not shown.
Binary file removed
BIN
-208 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_flat_75_ffffff_40x100.png
Binary file not shown.
Binary file removed
BIN
-335 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_glass_55_fbf9ee_1x400.png
Binary file not shown.
Binary file removed
BIN
-207 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_glass_65_ffffff_1x400.png
Binary file not shown.
Binary file removed
BIN
-262 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_glass_75_dadada_1x400.png
Binary file not shown.
Binary file removed
BIN
-262 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_glass_75_e6e6e6_1x400.png
Binary file not shown.
Binary file removed
BIN
-332 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_glass_95_fef1ec_1x400.png
Binary file not shown.
Binary file removed
BIN
-280 Bytes
client/js/jquery-ui/1.11.4/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# Dialog manages a single <div> that is used to present a | ||
# jQuery UI dialog used for detail display, usually on | ||
# double click. | ||
# Dialog manages a single popup window that is used to present a | ||
# dialog used for detail display, usually on double click. | ||
|
||
resolve = require './resolve' | ||
|
||
$dialog = null | ||
open = (title, html) -> | ||
body = html | ||
if typeof html is 'object' | ||
body = html[0].outerHTML | ||
|
||
emit = -> | ||
$dialog = $('<div></div>') | ||
.html('This dialog will show every time!') | ||
.dialog { autoOpen: false, title: 'Basic Dialog', height: 600, width: 800 } | ||
dialogWindow = window.open('/dialog/#', 'dialog', 'popup,height=600,width=800') | ||
|
||
open = (title, html) -> | ||
$dialog.html html | ||
$dialog.dialog "option", "title", resolve.resolveLinks(title) | ||
$dialog.dialog 'open' | ||
if dialogWindow.location.pathname isnt '/dialog/' | ||
# this will only happen when popup is first opened. | ||
dialogWindow.addEventListener 'load', (event) -> | ||
dialogWindow.postMessage({ title, body }, window.origin) | ||
else | ||
dialogWindow.postMessage({ title, body }, window.origin) | ||
|
||
module.exports = {emit, open} | ||
module.exports = { open } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters