Skip to content

Commit 4a11cfc

Browse files
committed
Changes in the demo
Changed all labels to camelCase, to match with the real properties name
1 parent a3694a4 commit 4a11cfc

File tree

1 file changed

+49
-39
lines changed

1 file changed

+49
-39
lines changed

demo/index.php

+49-39
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
color: black;
7575
text-decoration: none;
7676
}
77+
table a {
78+
color: inherit;
79+
text-decoration: none;
80+
font-size: inherit;
81+
}
7782
button[type="submit"] {
7883
font-size: 1.6rem;
7984
font-weight: bold;
@@ -132,23 +137,23 @@ function getResolverOption($name, $default = null)
132137
<fieldset class="options">
133138
<h2>Info options</h2>
134139

135-
<label><span>Min image width:</span> <input type="number" name="options[minImageWidth]" value="<?php echo getOption('minImageWidth', 0); ?>"></label>
136-
<label><span>Min image height:</span> <input type="number" name="options[minImageHeight]" value="<?php echo getOption('minImageHeight', 0); ?>"></label>
137-
<label><span>Get bigger image</span> <input type="checkbox" name="options[getBiggerImage]" value="1" <?php echo getOption('getBiggerImage') ? 'checked' : ''; ?>></label>
138-
<label><span>Get bigger icon</span> <input type="checkbox" name="options[getBiggerIcon]" value="1" <?php echo getOption('getBiggerIcon') ? 'checked' : ''; ?>></label>
139-
<label><span>Facebook access token:</span> <input type="text" name="options[facebookAccessToken]" value="<?php echo getOption('facebookAccessToken'); ?>"></label>
140-
<label><span>Embedly key:</span> <input type="text" name="options[embedlyKey]" value="<?php echo getOption('embedlyKey'); ?>"></label>
141-
<label><span>Soundcloud client id:</span> <input type="text" name="options[soundcloudClientId]" value="<?php echo getOption('soundcloudClientId', 'YOUR_CLIENT_ID'); ?>"></label>
142-
<label><span>Use facebook provider</span> <input type="checkbox" name="options[facebookProvider]" value="1" <?php echo getOption('facebookProvider') ? 'checked' : ''; ?>></label>
143-
<label><span>oEmbed extra Parameters (in json format):</span> <input type="text" name="options[oembedParameters]" value="<?php echo getOption('oembedParameters'); ?>"></label>
140+
<label><span>minImageWidth:</span> <input type="number" name="options[minImageWidth]" value="<?php echo getOption('minImageWidth', 0); ?>"></label>
141+
<label><span>minImageHeight:</span> <input type="number" name="options[minImageHeight]" value="<?php echo getOption('minImageHeight', 0); ?>"></label>
142+
<label><span>getBiggerImage</span> <input type="checkbox" name="options[getBiggerImage]" value="1" <?php echo getOption('getBiggerImage') ? 'checked' : ''; ?>></label>
143+
<label><span>getBiggerIcon</span> <input type="checkbox" name="options[getBiggerIcon]" value="1" <?php echo getOption('getBiggerIcon') ? 'checked' : ''; ?>></label>
144+
<label><span>facebookAccessToken:</span> <input type="text" name="options[facebookAccessToken]" value="<?php echo getOption('facebookAccessToken'); ?>"></label>
145+
<label><span>embedlyKey:</span> <input type="text" name="options[embedlyKey]" value="<?php echo getOption('embedlyKey'); ?>"></label>
146+
<label><span>soundcloudClientId:</span> <input type="text" name="options[soundcloudClientId]" value="<?php echo getOption('soundcloudClientId', 'YOUR_CLIENT_ID'); ?>"></label>
147+
<label><span>facebookProvider</span> <input type="checkbox" name="options[facebookProvider]" value="1" <?php echo getOption('facebookProvider') ? 'checked' : ''; ?>></label>
148+
<label><span>oembedParameters (in json format):</span> <input type="text" name="options[oembedParameters]" value="<?php echo getOption('oembedParameters'); ?>"></label>
144149
</fieldset>
145150
<fieldset class="options">
146151
<h2>Request resolver options:</h2>
147152

148-
<label><span>User agent:</span> <input type="text" name="resolver[user_agent]" value="<?php echo getResolverOption('user_agent', 'Embed PHP Library'); ?>"></label>
149-
<label><span>Max redirections:</span> <input type="number" name="resolver[max_redirections]" value="<?php echo getResolverOption('max_redirections', 20); ?>"></label>
150-
<label><span>Connection timeout:</span> <input type="number" name="resolver[connection_timeout]" value="<?php echo getResolverOption('connection_timeout', 10); ?>"></label>
151-
<label><span>Timeout:</span> <input type="number" name="resolver[timeout]" value="<?php echo getResolverOption('timeout', 10); ?>"></label>
153+
<label><span>userAgent:</span> <input type="text" name="resolver[userAgent]" value="<?php echo getResolverOption('userAgent', 'Embed PHP Library'); ?>"></label>
154+
<label><span>maxRedirections:</span> <input type="number" name="resolver[maxRedirections]" value="<?php echo getResolverOption('maxRedirections', 20); ?>"></label>
155+
<label><span>connectionTimeout:</span> <input type="number" name="resolver[connectionTimeout]" value="<?php echo getResolverOption('connectionTimeout', 10); ?>"></label>
156+
<label><span>timeout:</span> <input type="number" name="resolver[timeout]" value="<?php echo getResolverOption('timeout', 10); ?>"></label>
152157
</fieldset>
153158
<fieldset class="action">
154159
<button type="submit">Test</button>
@@ -202,92 +207,97 @@ function getResolverOption($name, $default = null)
202207

203208
<table class="embed">
204209
<tr>
205-
<th>Title</th>
210+
<th>title</th>
206211
<td><?php echo $info->title; ?></td>
207212
</tr>
208213
<tr>
209-
<th>Description</th>
214+
<th>description</th>
210215
<td><?php echo $info->description; ?></td>
211216
</tr>
212217
<tr>
213-
<th>Image</th>
218+
<th>image</th>
214219
<td>
215220
<?php if ($info->image): ?>
216-
<img src="<?php echo $info->image; ?>"> <?php echo $info->image; ?>
221+
<img src="<?php echo $info->image; ?>"><br>
222+
<a href="<?php echo $info->image; ?>" target="_blank"><?php echo $info->image; ?></a>
217223
<?php endif; ?>
218224
</td>
219225
</tr>
220226
<tr>
221-
<th>Image size</th>
222-
<td><?php echo $info->imageWidth.' x '.$info->imageHeight; ?></td>
227+
<th>imageWidth</th>
228+
<td><?php echo $info->imageWidth; ?></td>
223229
</tr>
224230
<tr>
225-
<th>All images</th>
231+
<th>imageHeight</th>
232+
<td><?php echo $info->imageHeight; ?></td>
233+
</tr>
234+
<tr>
235+
<th>images</th>
226236
<td><pre><?php print_r($info->images); ?></pre></td>
227237
</tr>
228238
<tr>
229-
<th>Embed code</th>
239+
<th>code</th>
230240
<td>
231241
<?php echo $info->code; ?>
232242
<pre><?php echo htmlspecialchars($info->code, ENT_IGNORE); ?></pre>
233243
</td>
234244
</tr>
235245
<tr>
236-
<th>Url</th>
237-
<td><?php echo $info->url; ?></td>
246+
<th>url</th>
247+
<td><a href="<?php echo $info->url; ?>" target="_blank"><?php echo $info->url; ?></a></td>
238248
</tr>
239249
<tr>
240-
<th>Type</th>
250+
<th>type</th>
241251
<td><?php echo $info->type; ?></td>
242252
</tr>
243253
<tr>
244-
<th>Source</th>
254+
<th>source</th>
245255
<td><?php
246256
if ($info->source) {
247-
echo $info->source;
248-
echo ' / <a href="test-sources.php?url='.urlencode($info->source).'" target="_blank">Test</a>';
257+
echo '<a href="'.$info->source.'" target="_blank">'.$info->source.'</a>';
258+
echo ' / <a href="sources.php?url='.urlencode($info->source).'" target="_blank">Test</a>';
249259
}
250260
?>
251261
</td>
252262
</tr>
253263
<tr>
254-
<th>Author name</th>
264+
<th>authorName</th>
255265
<td><?php echo $info->authorName; ?></td>
256266
</tr>
257267
<tr>
258-
<th>Author url</th>
259-
<td><?php echo $info->authorUrl; ?></td>
268+
<th>authorUrl</th>
269+
<td><a href="<?php echo $info->authorUrl; ?>" target="_blank"><?php echo $info->authorUrl; ?></a>
260270
</tr>
261271
<tr>
262-
<th>Provider icon</th>
272+
<th>providerIcon</th>
263273
<td><img src="<?php echo $info->providerIcon; ?>"> <?php echo $info->providerIcon; ?></td>
264274
</tr>
265275
<tr>
266-
<th>All icons</th>
276+
<th>providerIcons</th>
267277
<td><pre><?php print_r($info->providerIcons); ?></pre></td>
268278
</tr>
269279
<tr>
270-
<th>Provider name</th>
280+
<th>providerName</th>
271281
<td><?php echo $info->providerName; ?></td>
272282
</tr>
273283
<tr>
274-
<th>Provider url</th>
275-
<td><?php echo $info->providerUrl; ?></td>
284+
<th>providerUrl</th>
285+
<td><a href="<?php echo $info->providerUrl; ?>" target="_blank"><?php echo $info->providerUrl; ?></a>
276286
</tr>
277287
<tr>
278-
<th>Width</th>
288+
<th>width</th>
279289
<td><?php echo $info->width; ?></td>
280290
</tr>
281291
<tr>
282-
<th>Height</th>
292+
<th>height</th>
283293
<td><?php echo $info->height; ?></td>
284294
</tr>
285295
<tr>
286-
<th>Aspect ratio</th>
296+
<th>aspectRatio</th>
287297
<td><?php echo $info->aspectRatio; ?></td>
288298
</tr>
289299
<tr>
290-
<th>Http request result</th>
300+
<th>Http request info</th>
291301
<td>
292302
<ul>
293303
<?php

0 commit comments

Comments
 (0)