Skip to content

Commit

Permalink
Export option → Dockable panel in AE ( Closes #72 )
Browse files Browse the repository at this point in the history
  • Loading branch information
joonaspaakko committed Mar 8, 2020
1 parent 7b689af commit cf47436
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 29 deletions.
8 changes: 4 additions & 4 deletions build/assets/js/dialog.builder.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/assets/js/dialog.builder.js.map

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<head>

<meta charset="UTF-8">
<link href="http://gmpg.org/xfn/11?ckcachebust=603568053" rel="profile">
<link href="http://gmpg.org/xfn/11?ckcachebust=605397228" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>ScriptUI Dialog Builder</title>

<meta name="description" content="A web app for designing ScriptUI dialogs with ease and export it as javascript.">

<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png?v=xQdrX8olYR&ckcachebust=4d0dcf4f5d032ac4b7304f271759f928">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png?v=xQdrX8olYR&ckcachebust=df3ec88c49ebfe875527fc16be5f973b">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png?v=xQdrX8olYR&ckcachebust=6cf1427ce6fa9157d3546a4018ff91e6">
<link rel="manifest" href="favicon/site.webmanifest?v=xQdrX8olYR&ckcachebust=567f82a94f3eaba0080ec3cc3255b032">
<link rel="mask-icon" href="favicon/safari-pinned-tab.svg?v=xQdrX8olYR&ckcachebust=6f0178ce853f815dc108501fcaa8488d" color="#5bbad5">
<link rel="shortcut icon" href="favicon/favicon.ico?v=xQdrX8olYR&ckcachebust=9d4f3c47279281ae0541dca88a18e5d9">
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png?v=xQdrX8olYR&ckcachebust=2c588422c05374051b118b793f6dc80e">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png?v=xQdrX8olYR&ckcachebust=a89d5b8316e136141ab98f8879131c24">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png?v=xQdrX8olYR&ckcachebust=59338a52297b15e46db2b13566b73b53">
<link rel="manifest" href="favicon/site.webmanifest?v=xQdrX8olYR&ckcachebust=dd4511c62370237ea099ab2502f16d6a">
<link rel="mask-icon" href="favicon/safari-pinned-tab.svg?v=xQdrX8olYR&ckcachebust=e214f88089f7b3bc455687fcb2e6d835" color="#5bbad5">
<link rel="shortcut icon" href="favicon/favicon.ico?v=xQdrX8olYR&ckcachebust=1a014b1d9d6b9f0c08a4ea28f49803e8">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-config" content="favicon/browserconfig.xml?v=xQdrX8olYR">
<meta name="theme-color" content="#ffffff">
Expand Down Expand Up @@ -264,8 +264,8 @@
</div>


<link href="assets/css/dialog.builder.css?ckcachebust=b155a394cbbdb2434e9bde1104b7cc72" rel="stylesheet">
<link href="assets/css/libraries.css?ckcachebust=9d92bb42d912bb2c5e2b4c561ab4c4ab" rel="stylesheet">
<link href="assets/css/dialog.builder.css?ckcachebust=900023d80170cf58fb66f8a596b19346" rel="stylesheet">
<link href="assets/css/libraries.css?ckcachebust=c570af134755a0a6f671348c9873ed35" rel="stylesheet">
<script>
// Emergency services.
// Ctrl + Alt + L (4x) — Clears local_storage from dialog data refreshes the page.
Expand All @@ -284,8 +284,8 @@

});
</script>
<script src="assets/js/libraries.js?ckcachebust=0cc5d896fbb387f71513914940de2549"></script>
<script src="assets/js/dialog.builder.js?ckcachebust=314e96940c29a415c147fe97ce72da1a"></script>
<script src="assets/js/libraries.js?ckcachebust=b7fa725c88ad2cb6cc8a2915c600c880"></script>
<script src="assets/js/dialog.builder.js?ckcachebust=6334dd877864cb8582edb731c28901ae"></script>

</body>
</html>
Expand Down
5 changes: 5 additions & 0 deletions source/assets/js/dialog.builder/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ var settings = {
label: 'Function wrapper',
settingFor: 'SUI'
},
afterEffectsDockable: {
divider: false,
status: false,
label: 'Dockable panel in After Effects <span title="If the script is put in the &quot;Scripts/ScriptUI Panels&quot; folder, the dialog will behave similar to native panels. Inside the regular scripts folder the window type &quot;palette&quot; is enforced as well.">?</span>'
},
itemReferenceList: {
divider: false,
status: 'None',
Expand Down
26 changes: 19 additions & 7 deletions source/assets/js/dialog.builder/modules/toolbar/export.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ function makeJSXitem( index, data, jsxParents, type, id, parentId, parentType, s
var commentOut = hideItem.onExport( data.items[ 'item-'+id ] );

var windowType = data.items['item-0'].style.windowType.toLowerCase();
if ( data.settings.afterEffectsDockable ) windowType = 'palette';

var multilineText = [false];
var block = '';
var lowerCaseType = type.toLowerCase();
Expand Down Expand Up @@ -87,7 +89,8 @@ function makeJSXitem( index, data, jsxParents, type, id, parentId, parentType, s
switch ( type ) {

case 'Dialog':
block += wrapperTabsies + commentOut + 'var '+ jsxVarName +' = new Window("'+ windowType +'"'+ creationProps( true ) +'); \n';
var aeDockable = data.settings.afterEffectsDockable ? '(panelGlobal instanceof Panel) ? panelGlobal : ' : '';
block += wrapperTabsies + commentOut + 'var '+ jsxVarName +' = '+ aeDockable +'new Window("'+ windowType +'"'+ creationProps( true ) +'); \n';
break;

case 'ListBox':
Expand Down Expand Up @@ -354,11 +357,9 @@ function makeJSXitem( index, data, jsxParents, type, id, parentId, parentType, s
block += wrapperTabsies + vtTabssies + vtpanelCommentOut + '} \n';
block += wrapperTabsies + vtpanelCommentOut + '} \n\n';

block += wrapperTabsies + vtpanelCommentOut + customVar.names[ 0 ] +'.onShow = function () { \n';
var selectedTabIndex = $('#dialog [data-item-id="'+ parentId +'"] > .tab-container .tab.visible').index();
block += wrapperTabsies + vtTabssies + vtpanelCommentOut + jsxParents[ parentId ] +'_nav.selection = '+ selectedTabIndex +'; \n';
block += wrapperTabsies + vtTabssies + vtpanelCommentOut + showFunction + '; \n';
block += wrapperTabsies + vtpanelCommentOut + '} \n\n';
var selectedTabIndex = $('#dialog [data-item-id="'+ parentId +'"] > .tab-container .tab.visible').index();
block += wrapperTabsies + vtpanelCommentOut + jsxParents[ parentId ] +'_nav.selection = '+ selectedTabIndex +'; \n';
block += wrapperTabsies + vtpanelCommentOut + showFunction + '() \n\n';

}
else {
Expand Down

0 comments on commit cf47436

Please sign in to comment.