You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/api.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
4
4
<head>
5
5
<metacharset="utf-8">
6
-
<title>embedjs</title>
7
-
<metaname="description" content="">
6
+
<title>embed.js</title>
7
+
<metaname="description" content="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services.">
Copy file name to clipboardExpand all lines: app/doc.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
4
4
<head>
5
5
<metacharset="utf-8">
6
-
<title>embedjs</title>
7
-
<metaname="description" content="">
6
+
<title>embed.js</title>
7
+
<metaname="description" content="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services.">
Copy file name to clipboardExpand all lines: app/examples.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
4
4
<head>
5
5
<metacharset="utf-8">
6
-
<title>embedjs</title>
7
-
<metaname="description" content="">
6
+
<title>embed.js</title>
7
+
<metaname="description" content="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services.">
Copy file name to clipboardExpand all lines: app/getting_started.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
4
4
<head>
5
5
<metacharset="utf-8">
6
-
<title>embedjs</title>
7
-
<metaname="description" content="">
6
+
<title>embed.js</title>
7
+
<metaname="description" content="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services.">
Copy file name to clipboardExpand all lines: app/index.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
<head>
5
5
<metacharset="utf-8">
6
6
<title>embed.js</title>
7
-
<metaname="description" content="">
7
+
<metaname="description" content="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services.">
<!DOCTYPE html><htmllang=en><head><metacharset=utf-8><title>embed.js</title><metaname=descriptioncontent="A JavaScript plugin that analyses the string and automatically embeds emojis, media, maps, tweets, code and services."><metaname=viewportcontent="width=device-width,initial-scale=1"><linkrel="shortcut icon" href=/favicon.e1d38bd4.ico><linkrel=apple-touch-iconhref=/apple-touch-icon.9727d3c2.png><linkhref="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300" rel=stylesheettype=text/css><!-- Place favicon.ico and apple-touch-icon.png in the root directory --><linkrel=stylesheethref=styles/vendor.e0d30183.css><linkrel=stylesheethref=styles/api.22ede157.css><linkrel=stylesheethref=https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css><body><header><ahref="/"><imgsrc=images/logo.b48fbe99.pngalt=""></a><nav><ul><ahref="/"><li>Home</li></a><ahref=getting_started.html><li>Getting Started</li></a><ahref=doc.html><li>Options</li></a><ahref=api.html><li>API</li></a><ahref=examples.html><li>Examples</li></a></ul></nav></header><divclass=left-nav><ul><li><b>Default Methods</b></li><ahref=#render><li>render()</li></a><ahref=#text><li>text()</li></a><ahref=#destroy><li>destroy()</li></a><li><b>ejs Methods</b></li><ahref=#setOptions><li>.setOptions()</li></a><ahref=#applyEmbedJS><li>.applyEmbedJS()</li></a><ahref=#destroyEmbedJS><li>.destroyEmbedJS()</li></a><ahref=#template><li>.template.serviceName()</li></a></ul></div><divclass=container><h4>Default Methods</h4><p>This method of usage should be preferred if you wan't to apply embed.js to a single block or want the result as string.</p><h5id=render><b>.render()</b></h5> Renders the result in the element from which the original raw string was taken. <pre><codeclass=xml>
2
+
<div id="element">
3
+
Lotus :smile: eleates vix attrahendams luna est.Advenas mori!Fermiums prarere in cubiculum!Cum cacula cantare,
4
+
omnes stellaes manifestum azureus, nobilis https://angularjs.org/ acipenseres.Cum orgia mori, omnes rationees
5
+
:) experientia alter, regius :heart: mortemes.Devatios persuadere, tanquam secundus spatii.Heu,
6
+
barcas!Cedriums observare!A falsis, lacta talis imber. :P Cur eleates peregrinatione?
7
+
</div>
8
+
9
+
<script>
10
+
var x = new EmbedJS({
11
+
element: document.getElementById('element'),
12
+
googleAuthKey : 'xxxx'
13
+
})
14
+
15
+
x.render()
16
+
</script>
17
+
</code></pre><p>Here the <code>render()</code> method will replace the html content of <code>#element</code> with the processed string.</p><br><h5id=text><b>.text(function(result, input){ })</b></h5><b>Syntax</b> : <code>.text(function(result, input){})</code><p>This method comes handy if you want to only get the resulting string and use it according to your wish.</p><pre><code>
18
+
var x = new EmbedJS({
19
+
element: document.getElementById('element'),
20
+
googleAuthKey : 'xxxx'
21
+
})
22
+
23
+
x.text(function(result, input){
24
+
console.log(result) //result string
25
+
console.log(input) //input string
26
+
})
27
+
</code></pre><h5id=destroy><b>.destroy()</b></h5> The <code>destroy()</code> method turns off all the event listeners and replaces the string with the original string. <pre><code>
28
+
var x = new EmbedJS({
29
+
element: document.getElementById('element'),
30
+
googleAuthKey : 'xxxx'
31
+
})
32
+
33
+
x.render() //renders the result
34
+
x.destroy() //destroys the instance
35
+
</code></pre><h4>ejs Methods</h4><p>The following methods should be used when you want to use the plugin on multiple blocks.</p><h5id=setOptions><b>.setOptions(options)</b></h5> Can be used to set the options globally. The options can be overridden by passing the option for a single block. <pre><code>
36
+
ejs.setOptions({
37
+
videoDetails:false,
38
+
videoJS:true,
39
+
videoWidth:720,
40
+
videoDetails:true,
41
+
googleAuthKey:'xxx',
42
+
inlineEmbed:[],
43
+
marked:true,
44
+
link:true
45
+
});
46
+
47
+
var x = new EmbedJS({
48
+
element: document.getElementById('block')
49
+
});
50
+
</code></pre><h5id=applyEmbedJS><b>.applyEmbedJS(className)</b></h5> Can be used to apply this plugins to multiple classes by passing the class name as string. It will use the globally set options. <pre><code>
51
+
ejs.setOptions({
52
+
videoDetails:false,
53
+
videoJS:true,
54
+
videoWidth:720,
55
+
videoDetails:true,
56
+
googleAuthKey:'xxx'
57
+
});
58
+
59
+
ejs.applyEmbedJS('.element')
60
+
</code></pre><h5id=destroyEmbedJS><b>.destroyEmbedJS()</b></h5> destroys all the instances of the plugin <pre><code>ejs.destroyEmbedJS()</code></pre><h5id=template><b>.template.serviceName()</b></h5> You can change the templates of all the services. <pre><codeclass=javascript>
0 commit comments