Changeset 402:9e1af86fe7e4 for admin
- Timestamp:
- 06/22/11 10:32:52 (14 years ago)
- Branch:
- wysiwyg
- Location:
- admin/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/jquery/jquery.oembed.js
r399 r402 191 191 if (data.title) alt.push(data.title); 192 192 193 return $('< a>').attr({193 return $('<div>').append($('<a>').attr({ 194 194 'href': data.url, 195 195 'title': title … … 198 198 'title': title, 199 199 'alt': alt.join(' - ') 200 })) ;200 }))).html(); 201 201 }, 202 202 … … 219 219 if (data.title) alt.push(data.title); 220 220 221 return $('< a>').attr({221 return $('<div>').append($('<a>').attr({ 222 222 'href': data.url, 223 223 'title': title 224 }).append(title) ;224 }).append(title)).html(); 225 225 }, 226 226 … … 243 243 } 244 244 } 245 xhtml += object.get(0).outerHTML;245 xhtml += $('<div>').append(object).html(); 246 246 } 247 247 else if (this.tagName == 'OBJECT') { … … 256 256 $(this).find('embed').remove(); 257 257 } 258 xhtml += this.outerHTML;258 xhtml += $('<div>').append($(this)).html(); 259 259 } else { 260 xhtml += internalMethods._getValidHXHTMLCode($( html).find('iframe,object').get(0).outerHTML);260 xhtml += internalMethods._getValidHXHTMLCode($('<div>').append($(html).find('iframe,object')).html()); 261 261 } 262 262 }); -
admin/js/tiny_mce/plugins/dcControls/js/popup_media.js
r400 r402 81 81 } 82 82 83 res = ed.dom.createHTML('div',opt_div, oplayer.get(0).outerHTML);83 res = ed.dom.createHTML('div',opt_div,ed.dom.getOuterHTML(oplayer.get(0))); 84 84 85 85 ed.execCommand('mceInsertContent',false,res,{skip_undo : 1}); -
admin/js/tiny_mce/plugins/dcControls/js/popup_web_media.js
r399 r402 3 3 var popup_web_media = { 4 4 oembed_opts: { 5 maxWidth: 4 80,5 maxWidth: 450, 6 6 maxHeight: 400, 7 7 onProviderNotFound: function(url) { … … 46 46 47 47 init: function() { 48 $('#src').focusin(function( ) {48 $('#src').focusin(function(e) { 49 49 $(this).removeClass(); 50 }).keypress(function(e) { 51 if (e.keyCode == 13) { 52 $(this).focusout(); 53 $('#webmedia-insert-search').click(); 54 } 50 55 }); 51 56 … … 78 83 var title = $('input[name="title"]').val(); 79 84 var alt = $('input[name="alt"]').val(); 80 var code = ''; 85 var width = $('input[name="width"]').val(); 86 var height = $('input[name="height"]').val(); 81 87 82 88 if (data != null) { 83 var a = $('<a>').attr({ 84 'href': src, 85 'title': title 86 }); 87 var img = $('<img>').attr({ 88 'src': data.thumbnail_url, 89 'alt': alt, 90 'title': title 91 }); 89 var res = null; 90 var opts_div = {}; 91 var opts_img = { 92 src: data.thumbnail_url, 93 alt: alt, 94 title: title 95 }; 96 var opts_a = { 97 href: src, 98 title: title 99 }; 100 92 101 switch($('input[name="insertion"]:checked').val()) { 93 102 case 'media': 94 code = $(data.code); 103 code = $(data.code).attr({ 104 'width': width, 105 'height': height 106 }); 107 res = ed.dom.create('div',opts_div,ed.dom.getOuterHTML(code.get(0))) 95 108 break; 96 109 case 'thumbnail': 97 code = a.append(img); 110 var img = ed.dom.create('img',opts_img); 111 res = ed.dom.create('a',opts_a,ed.dom.getOuterHTML(img)); 98 112 break; 99 113 case 'link': 100 code = a.append(alt);114 res = ed.dom.create('a',opts_a,alt); 101 115 break; 102 116 } 103 117 104 118 if (alignment != 'none') { 105 code.attr('style',media_align_grid[alignment]);119 ed.dom.setAttribs(res,{style: media_align_grid[alignment]}); 106 120 } 107 121 108 ed.execCommand('mceInsertContent',false, code.get(0).outerHTML);122 ed.execCommand('mceInsertContent',false,ed.dom.getOuterHTML(res)); 109 123 tinyMCEPopup.close(); 110 124 } else { … … 127 141 } 128 142 return info; 129 },130 131 getValidXHTMLCode: function(html) {132 var xhtml = $(html);133 var type = xhtml.get(0).tagName;134 135 if (type == 'IFRAME') {136 var attr = {137 'src': 'data',138 'width': 'width',139 'height': 'height'140 };141 var attributes = xhtml.get(0).attributes;142 xhtml = $('<object>');143 xhtml.attr('type','text/html');144 for (i in attributes) {145 if (attr.hasOwnProperty(attributes[i].name)) {146 xhtml.attr(attr[attributes[i].name],attributes[i].value);147 }148 }149 }150 else if (type == 'OBJECT') {151 if (xhtml.find('embed').size() > 0) {152 var embed = xhtml.find('embed').get(0);153 if ($.inArray('src',embed.attributes)) {154 xhtml.attr('data',embed.attributes.src.nodeValue);155 }156 if ($.inArray('type',embed.attributes)) {157 xhtml.attr('type',embed.attributes.type.nodeValue);158 }159 xhtml.find('embed').remove();160 }161 }162 else {163 xhtml = this.getValidXHTMLCode(xhtml.find('iframe,object').get(0).outerHTML);164 }165 166 return xhtml;167 143 } 168 144 };
Note: See TracChangeset
for help on using the changeset viewer.