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
<p>This method comes handy if you want to only get the resulting string and use it according to your wish.</p>
96
-
<pre><code>var x = new EmbedJS({
97
-
element: document.getElementById('element'),
98
-
googleAuthKey : 'xxxx'
99
-
})
103
+
<pre><code>var x = new EmbedJS({
104
+
element: document.getElementById('element'),
105
+
googleAuthKey : 'xxxx'
106
+
})
100
107
101
-
x.text(function(result, input){
102
-
console.log(result) //result string
103
-
console.log(input) //input string
104
-
})
105
-
</code></pre>
106
-
<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.
107
-
<pre><code>var x = new EmbedJS({
108
-
element: document.getElementById('element'),
109
-
googleAuthKey : 'xxxx'
110
-
})
108
+
x.text(function(result, input){
109
+
console.log(result) //result string
110
+
console.log(input) //input string
111
+
})
112
+
</code></pre>
113
+
<h5id="destroy"><b>.destroy()</b></h5> The <code>destroy()</code> method turns off all the event listeners and
114
+
replaces the string with the original string.
115
+
<pre><code> var x = new EmbedJS({
116
+
element: document.getElementById('element'),
117
+
googleAuthKey : 'xxxx'
118
+
})
111
119
112
-
x.render() //renders the result
113
-
x.destroy() //destroys the instance
114
-
</code></pre>
120
+
x.render() //renders the result
121
+
x.destroy() //destroys the instance
122
+
</code></pre>
115
123
<h4>ejs Methods</h4>
124
+
116
125
<p>The following methods should be used when you want to use the plugin on multiple blocks.</p>
117
-
<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.
118
-
<pre><code>ejs.setOptions({
119
-
videoDetails:false,
120
-
videoJS:true,
121
-
videoWidth:720,
122
-
videoDetails:true,
123
-
googleAuthKey:'xxx',
124
-
inlineEmbed:[],
125
-
marked:true,
126
-
link:true
127
-
});
126
+
<h5id="setOptions"><b>.setOptions(options)</b></h5> Can be used to set the options globally. The options can be
127
+
overridden by passing the option for a single block.
128
+
<pre><code> ejs.setOptions({
129
+
videoDetails:false,
130
+
videoJS:true,
131
+
videoWidth:720,
132
+
videoDetails:true,
133
+
googleAuthKey:'xxx',
134
+
inlineEmbed:[],
135
+
marked:true,
136
+
link:true
137
+
});
128
138
129
-
var x = new EmbedJS({
130
-
element: document.getElementById('block')
131
-
});</code></pre>
132
-
<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.
133
-
<pre><code>ejs.setOptions({
134
-
videoDetails:false,
135
-
videoJS:true,
136
-
videoWidth:720,
137
-
videoDetails:true,
138
-
googleAuthKey:'xxx'
139
-
});
139
+
var x = new EmbedJS({
140
+
element: document.getElementById('block')
141
+
});</code></pre>
142
+
<h5id="applyEmbedJS"><b>.applyEmbedJS(className)</b></h5> Can be used to apply this plugins to multiple classes by
143
+
passing the class name as string. It will use the globally set options.
144
+
<pre><code> ejs.setOptions({
145
+
videoDetails:false,
146
+
videoJS:true,
147
+
videoWidth:720,
148
+
videoDetails:true,
149
+
googleAuthKey:'xxx'
150
+
});
140
151
141
-
ejs.applyEmbedJS('.element')</code></pre>
152
+
ejs.applyEmbedJS('.element')</code></pre>
142
153
<h5id="destroyEmbedJS"><b>.destroyEmbedJS()</b></h5> destroys all the instances of the plugin
143
154
<pre><code>ejs.destroyEmbedJS()</code></pre>
144
155
<h5id="template"><b>.template.serviceName()</b></h5> You can change the templates of all the services.
0 commit comments