X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=addon%2Foembed%2Foembed.js;h=f8e957413cb1954f09cc095a9a44d5ff6c34d066;hb=4ba29089d27912fc0e742fb1e1d1c12b6719c5c5;hp=26541490b18fc01b7cb570f1996175bb17336062;hpb=62fda0a120fe4d068f1380924b5493adb70064ea;p=friendica.git
diff --git a/addon/oembed/oembed.js b/addon/oembed/oembed.js
index 26541490b1..f8e957413c 100644
--- a/addon/oembed/oembed.js
+++ b/addon/oembed/oembed.js
@@ -1,51 +1,6 @@
function oembed(){
- $("#oembed").toggleClass('hide');
-}
-
-function oembed_do(){
- embedurl = $('#oembed_url').attr('value');
- var url = 'http://oohembed.com/oohembed/?url='+escape( embedurl )+"&callback=?";
-
- $.getJSON(url, function(data) {
- var ret="";
- switch(data.type){
- case "video": {
- if (data.thumbnail_url){
- tw = 200; if (data.thumbnail_width) tw=data.thumbnail_width;
- th = 180; if (data.thumbnail_height) tw=data.thumbnail_height;
- ret = "";
- // tiny mce bbcode plugin not support image size......
- ret += "";
- } else {
- ret = data.html;
- }
- }; break;
- case "photo": {
- // tiny mce bbcode plugin not support image size......
- ret = "";
- }; break;
- case "link": {
- ret = ""+data.title+"";
- }; break;
- case "rich": {
- ret = data.html; // not so safe... http://www.oembed.com/ : "Consumers may wish to load the HTML in an off-domain iframe to avoid XSS"
- }; break;
- default: {
- alert("Error retriving data!");
- return;
- }
- }
- var embedlink = embedurl;
- if (data.title) embedlink = data.title
- ret+="
"+embedlink+"";
- if (data.author_name) {
- ret+=" by "+data.author_name;
- }
- if (data.provider_name) {
- ret+=" on "+data.provider_name;
- }
- tinyMCE.execCommand('mceInsertRawHTML',false,ret);
- oembed();
- });
-
+ var reply = prompt("$oembed_message:");
+ if(reply && reply.length) {
+ tinyMCE.execCommand('mceInsertRawHTML',false, "[embed]"+reply+"[/embed]" );
+ }
}