Commits

Nicolas Froidure <>  committed 778a702

Testing script replacement

  • Participants
  • Parent commits 7cc464d

Comments (0)

Files changed (4)

File chrome/bbcomposer/content/bbcomposer.js

 		{
 		var contents=this.editor.contentDocument.createElement('div');
 		contents.innerHTML=content;
+		/* Trying to take in count scripts
+		var scripts=contents.getElementsByTagName('script');
+		for(let i=scripts.length-1; i>=0; i--)
+			{
+			var replacement=this.editor.contentDocument.createElement('p');
+			replacement.setAttribute('class','bbcspecial-script');
+			replacement.innerHTML='\u00A0';
+			if(scripts[i].hasAttribute('src'))
+				{
+				//replacement.innerHTML='script src:'+scripts[i].getAttribute('src');
+				//replacement.setAttribute('bbcomp','src:'+scripts[i].getAttribute('src'));
+				}
+			scripts[i].parentNode.insertBefore(replacement,scripts[i]);
+			scripts[i].parentNode.removeChild(scripts[i]);
+			}*/
 		while(this.rootElement.firstChild)
 			this.doAction({actionFunction: this.removeElement, theElement:this.rootElement.firstChild, traceMessage:'setEditorContent 1'});
 		this.doAction({actionFunction: this.exchangeElementChildNodes, sourceElement:contents, targetElement:this.rootElement, focusNode:this.getFirstChildTextnode(this.rootElement), traceMessage:'setEditorContent 2'});

File chrome/bbcomposer/skin/classic/editor.css

 td { font-family:sans-serif; font-size:0.9em; border:1px solid #000000; padding:5px; text-align:left; }
 caption { font-size:1.2em; margin:10px; text-align:center; }
 /* External objects styles */
-span.bccspecial-script { background-image: url(chrome://bbcomposer/skin/images/noscript.png); padding:0 0 0 16px; }
-span.bccspecial-style { background-image: url(chrome://bbcomposer/skin/images/style.png); padding:0 0 0 16px; }
+p.bbcspecial-script { background:url(chrome://bbcomposer/skin/images/script.png) no-repeat center center; width:16px; height:16px; border:0; }
+p.bbcspecial-style { background-image:url(chrome://bbcomposer/skin/images/style.png); padding:0 0 0 16px; }
 noscript { display:block; background-image: url(chrome://bbcomposer/skin/images/noscript.png); border-right: 2px dotted #808080; text-align:left; }
 script { display:block; min-height:15px; width:100%; background-image: url(chrome://bbcomposer/skin/images/noscript.png); border-right: 2px dotted #808080; text-align:left; }
 object { display:block; min-height:15px; width:100%; background-image: url(chrome://bbcomposer/skin/images/object.png); border-right: 2px dotted #808080; text-align:left; }
-param { display:block; min-height:10px; width:100%; background-image: url(chrome://bbcomposer/skin/images/param.png); border-right: 2px dotted #808080; text-align:left; }
+param { display:block; min-height:10px; width:100%; background-image: url(chrome://bbcomposer/skin/images/param.png); border-right: 2px dotted #808080; text-align:left; }

File chrome/bbcomposer/skin/classic/images/script.png

Added
New image

File chrome/bbcomposer/skin/classic/images/style.png

Added
New image