Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Community Feedback and Ideas


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T

inserting code on forum

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?

_________________________________________
www.jasonmace.com/blackberry
Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: inserting code on forum

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&colon;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&colon;this.select();');
		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)

 




The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Highlighted
Developer
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T

Re: inserting code on forum

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-Development/Sqlite-Drop-Table-problem/td-p/509632/page/2

_________________________________________
www.jasonmace.com/blackberry
Guru I
Posts: 19,020
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: inserting code on forum

[ Edited ]

 


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-Development/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.




The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Developer
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T

Re: inserting code on forum

Thanks Xandrex, I appreciate the look.

 

I'll just adjust my code spacing next time.

_________________________________________
www.jasonmace.com/blackberry