05-26-2010 11:21 AM
I think the insert code option on the forum could use some work. It does box off the code from the rest of the text in a post, but it renders it unreadable while viewing on the forum.
Are there any improvements that can be made to this functionality?
05-26-2010 07:46 PM
let's take an example. I have the elevators things on the scroll bars but apart from that, it does the job. Can you detail how it could be better?
var xdxTitle;
var A = document.getElementsByName('title');
xdxTitle = A.item(0).firstChild.nodeValue;
var xdxKbId;
var xx = document.evaluate( '//td', document, null, XPathResult.ANY_TYPE, null );
var thisHeading = xx.iterateNext();
while (thisHeading) {
var e = thisHeading.textContent;
if (e.match(/^KB/)) xdxKbId = e;
thisHeading = xx.iterateNext();
}
var aList = document.getElementsByTagName('a');
for (var i=0;i<=aList.length-1;i++) {
if ('javascript:window.print()'== aList[i].getAttribute('href') ) {
var xD = aList[i].parentNode;
xD.appendChild(document.createElement('br'));
xD.appendChild(document.createElement('br'));
var xF = document.createElement('form');
var xI = document.createElement('input');
xI.setAttribute('type','text');
xI.setAttribute('readonly','readonly');
xI.setAttribute('onclick','javascript:this.s elect();');
xI.setAttribute('value','<a href="http://www.blackberry.com/btsc/'+xdxKbId+'">'+xdxKbId+'</a> '+xdxTitle);
xF.appendChild(xI);
xD.appendChild(xF);
}
}
(t's my grease monkey script to add a pastable entry for a KB on BTSC)
05-27-2010 07:55 AM
That looks great Xandrex, but when I copy and paste from one of my IDEs I get results as seen in this thread
http://supportforums.blackberry.com/t5/Web-Develop
05-28-2010 09:43 AM - edited 05-28-2010 09:47 AM
jmace wrote:
That looks great Xandrex, but when I copy and paste from one of my IDEs I get results as seen in this thread
http://supportforums.blackberry.com/t5/Web-Develop
ment/Sqlite-Drop-Table-problem/td-p/509632/page/2
the lines are too long. Replace the tabs by spaces. I did it over there. It's not perfect but better.
05-28-2010 10:35 AM
Thanks Xandrex, I appreciate the look.
I'll just adjust my code spacing next time.