Skip to content

Commit c63cc1e

Browse files
committed
feat(core): Changed templating structure and export class
Now by default only EmbedJS class is exported and all the earlier 'ejs' methods are now static methods of that class. This is done to make it easier to create umd build and also there is a new Template constructor. So that users can use use different instances of templates on the same page. BREAKING
1 parent 8b37ae2 commit c63cc1e

34 files changed

Lines changed: 1167 additions & 1060 deletions

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ module.exports = function (grunt) {
154154
externals : ['regeneratorRuntime'],
155155
sourceMap : true,
156156
useStrict : true,
157+
moduleName : 'EmbedJS',
157158
sourceMapFile: 'src/embed.js',
158159
plugins : [
159160
npm({

demo/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h1>Loading embed.js in a block</h1>
7272
<script src="http://vjs.zencdn.net/5.0.0/video.js"></script>
7373
<script src="../src/embed.js"></script>
7474
<script>
75-
ejs.setOptions({
75+
EmbedJS.setOptions({
7676
// element: document.getElementById('block'),
7777
videoJS:true,
7878
videoWidth:720,
@@ -95,17 +95,17 @@ <h1>Loading embed.js in a block</h1>
9595
});
9696
x.render();
9797

98-
x.text(function(data){
99-
console.log(data);
100-
});
98+
// x.text(function(data){
99+
// console.log(data);
100+
// });
101101

102102

103-
ejs.template.basicAudio = function(match){
104-
return 'kjkh'+ match
105-
};
103+
// ejs.template.basicAudio = function(match){
104+
// return 'kjkh'+ match
105+
// };
106106

107107

108-
ejs.applyEmbedJS(".block");
108+
// ejs.applyEmbedJS(".block");
109109

110110
</script>
111111

dist/embed.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"grunt-postcss": "^0.7.1",
6464
"grunt-retinafy": "^0.1.5",
6565
"grunt-rollup": "^0.6.1",
66-
"grunt-spritesmith": "^6.1.0",
66+
"grunt-spritesmith": "^6.1.1",
6767
"grunt-string-replace": "^1.2.1",
6868
"load-grunt-tasks": "^3.4.0",
6969
"mocha": "^2.3.4",

src/embed.js

Lines changed: 685 additions & 566 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)