Skip to content

Commit

Permalink
feat: load webcg scripts from libs subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
indr committed Aug 7, 2018
1 parent f2ebe6a commit f671a85
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion adobe-animate/Adobe-Animate-Publish-Template.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="authoring-tool" content="$VERSION">
<title>$TITLE</title>
<!-- write your code here -->
<script src="webcg-adobe-animate-adapter.umd.js"></script>
<script src="libs/webcg-adobe-animate-adapter.umd.js"></script>
$CENTER_STYLE
$CREATEJS_LIBRARY_SCRIPTS
$ANIMATE_CC_SCRIPTS
Expand Down
2 changes: 1 addition & 1 deletion dist/Adobe-Animate-Publish-Template.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="authoring-tool" content="$VERSION">
<title>$TITLE</title>
<!-- write your code here -->
<script src="webcg-adobe-animate-adapter.umd.js"></script>
<script src="libs/webcg-adobe-animate-adapter.umd.js"></script>
$CENTER_STYLE
$CREATEJS_LIBRARY_SCRIPTS
$ANIMATE_CC_SCRIPTS
Expand Down
Binary file modified dist/webcg-adobe-animate-adapter-1.1.0.zip
Binary file not shown.
12 changes: 10 additions & 2 deletions dist/webcg-adobe-animate-adapter.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(function (global, factory) {
factory();
}(commonjsGlobal, (function () {
var version = "1.1.0";
var version = "1.2.1";

var Parser = (function () {
function Parser () {}
Expand Down Expand Up @@ -133,13 +133,21 @@
window.webcg = new WebCG(window);
};

var getCurrentScriptPathWithTrailingSlash = function (document) {
if (!document || typeof document !== 'object') { return '' }
if (!document.currentScript) { return '' }
if (!document.currentScript.src || typeof document.currentScript.src !== 'string') { return '' }
var src = document.currentScript.src;
return src.substring(0, src.lastIndexOf('/') + 1)
};

var initDevTools = function (window) {
var debug = (window.location.search.match(/[?&]debug=([^&$]+)/) || [])[1] === 'true';
if (!debug) { return }

var document = window.document;
var script = document.createElement('script');
script.src = 'webcg-devtools.umd.js';
script.src = getCurrentScriptPathWithTrailingSlash(document) + 'webcg-devtools.umd.js';
console.log('[webcg-framework] injecting ' + script.src);
document.head.append(script);
};
Expand Down
Binary file modified docs/example-lower-third.fla
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/example-lower-third.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="authoring-tool" content="Adobe_Animate_CC">
<title>example-lower-third</title>
<!-- write your code here -->
<script src="webcg-adobe-animate-adapter.umd.js"></script>
<script src="libs/webcg-adobe-animate-adapter.umd.js"></script>
<script src="libs/createjs-2015.11.26.min.js"></script>
<script src="example-lower-third.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(function (global, factory) {
factory();
}(commonjsGlobal, (function () {
var version = "1.1.0";
var version = "1.2.1";

var Parser = (function () {
function Parser () {}
Expand Down Expand Up @@ -133,13 +133,21 @@
window.webcg = new WebCG(window);
};

var getCurrentScriptPathWithTrailingSlash = function (document) {
if (!document || typeof document !== 'object') { return '' }
if (!document.currentScript) { return '' }
if (!document.currentScript.src || typeof document.currentScript.src !== 'string') { return '' }
var src = document.currentScript.src;
return src.substring(0, src.lastIndexOf('/') + 1)
};

var initDevTools = function (window) {
var debug = (window.location.search.match(/[?&]debug=([^&$]+)/) || [])[1] === 'true';
if (!debug) { return }

var document = window.document;
var script = document.createElement('script');
script.src = 'webcg-devtools.umd.js';
script.src = getCurrentScriptPathWithTrailingSlash(document) + 'webcg-devtools.umd.js';
console.log('[webcg-framework] injecting ' + script.src);
document.head.append(script);
};
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/postbuild.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

cp dist/*.umd.js docs/
cp dist/*.umd.js docs/libs/
cd dist
zip webcg-adobe-animate-adapter-$npm_package_version.zip *
cd ..
1 change: 0 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const express = require('express')
const path = require('path')

const app = express()
app.use(express.static(path.join(__dirname, 'dist')))
app.use(express.static(path.join(__dirname, 'docs')))

const port = process.env.PORT || 8080
Expand Down

0 comments on commit f671a85

Please sign in to comment.