Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is additional features for the excellent Mediator plugin created by Seon-Wook Park alias Swook.
- Swook page : http://www.swook.net/
- Mediator plugin page : http://vanillaforums.org/addon/mediator-plugin
- Note : The code is more a hack then anything, I'm an amateur in JS. Just here for people who'd like the feature. :D
- ------------------- ▼ JS Edit (mediator.js) ▼ -----------------------------
- //Place inside function Check (i, elem) {...}
- if (urlo.host == 'vine.co' || urlo.host == 'www.vine.co')
- return ReplaceVine(urlo.file, elem, $elem);
- //Place inside function Check (i, elem) {...}
- if (urlo.host == 'twitter.com' || urlo.host == 'www.twitter.com'){
- var user = url.match(/^http[s]?:\/\/.*?\/([a-zA-Z-_\d+]+).*$/)[1];
- return ReplaceTwitter(user, urlo.file, elem, $elem);
- }
- function ReplaceVine (hash, elem, $elem) {
- var newel = $('<iframe>');
- newel.prop('src', '//vine.co/v/'+ hash+ '/embed/simple')
- CommonSetting(newel, $elem, 'Vine');
- $elem.replaceWith(newel);
- }
- function ReplaceTwitter(user, hash, elem, $elem) {
- var newel = $('<iframe>');
- newel.prop('src', 'http://twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2F' + user + '%2Fstatus%2F' + hash)
- TwitterSetting(newel, $elem, 'Twitter');
- $elem.replaceWith(newel);
- }
- function TwitterSetting (newel, $elem, type) {
- $elem.addClass('Mediator');
- type = type ? ' '+ type : '';
- $elem.wrap('<center class="Mediator'+ type +'"/>');
- return;
- }
- ------------------- ▼ CSS Edit (style.css) ▼ -----------------------------
- center.Vine iframe {
- width: 480px;
- height: 480px;
- }
- center.Twitter iframe {
- width: 480px;
- height: 300px;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement