PDA

View Full Version : Forum: split GXT and EXTJS



Arno.Nyhm
29 Jul 2009, 3:30 AM
See the Posting #9 for the newest userscript!


is it possible to make more easy split between extjs and gxt?

if you interested only in gxt then its difficult to search and find some things if search results are messed up with extjs related threads.



i would like to see something like a switch with "(o) ExtJS ( ) GXT ( ) both" in this functions:

- List new Posts link
- Search function

micgala
29 Jul 2009, 4:41 AM
Although not directly, you can already do that.

When you use the advanced search, you can define under which forums to run your search on.

Regards,
Michel.

Arno.Nyhm
29 Jul 2009, 9:05 AM
1) new posts

but then i can not find new posts. i need to give a keyword in the search.


2) search
and it is very mixed with gxt and extjs. "gxt open discussion is under Ext General forums"

so you have to click many items.

maybe there can be some additional link with "mark extjs" categories and "mark gxt" categories.

micgala
30 Jul 2009, 12:49 AM
For new posts you have no manually enter in the forum session itself.

For searching you need to select what forums...

This works, but, of course a split would be way more convenient...

I also would like to have this split.

Arno.Nyhm
10 Aug 2009, 7:03 AM
i use this script with greasemonkey.

save this script as extjs_favourites.user.js (important the .user.js for greasemonkey)
(if you use the attachment remove the .txt )

drag it to firefox to "open" it. after this greasemonkey ask you to install this script.


it remove only on the search result pages all result rows of categories which are not "Gxt".




// ==UserScript==
// @name ExtJS Favourites
// @description Only display specified forums on the forum index and the 'Recent Topics' page. Useful if you want to hide forums out of interest. Hidden forums are still accessible via 'Categories' page. based on script http://userscripts.org/scripts/review/41013
// @author Arno.Nyhm
// @namespace http://www.extjs.com
// @include http://www.extjs.com/forum/search.php*
// @include http://extjs.com/forum/search.php*
// ==/UserScript==

// Specify your prefix of favourite forums here.
var startWith = 'Gxt';

// Specify your array of favourite forums here.
//var favouriteForums = new Array('Servlets', 'CaSeSeNsItIvE!!!');

// Hide non-specified forums in 'search' page.
if (window.location.href.indexOf('/search') > -1) {
var table = document.getElementById('threadslist');
var rows = table.getElementsByTagName('tr');
for (var i = rows.length-1; i > 0; i--) {
var row = rows[i];
var cells = row.getElementsByTagName('td');
if(cells.length == 7){
var forumLink = cells[6].getElementsByTagName('a')[0];
var forumName = forumLink.firstChild.nodeValue;
// in this forum there are not trimmed forum names....
// var forumNameTrimmed = trim(forumName);
var forumNameTrimmed = forumName;
if(forumNameTrimmed.indexOf(startWith) == -1){
// if (favouriteForums.indexOf(forumNameTrimmed) == -1) {
// row.style.display = 'none';
row.parentNode.removeChild(row);
}

}
}
}

// Link values sometimes trailed with spaces!!!
function trim(value) {
return value.replace(/^\s*|\s*$/g, '');
}

credits:
this script is based on this userscript: http://userscripts.org/scripts/review/41013


EDIT: 11.08.2009 add http://extjs.com/ without subdomain to include, updated script and attachment

Arno.Nyhm
11 Aug 2009, 2:48 AM
added http://extjs.com/ without subdomain to include, updated script and attachment

Arno.Nyhm
17 Aug 2009, 1:37 AM
new: in the advanced search are the gxt forums already selected. see attached image


// ==UserScript==
// @name ExtJS Favourites
// @description Only display specified forums on the forum index and the 'Recent Topics' page. Useful if you want to hide forums out of interest. Hidden forums are still accessible via 'Categories' page. based on script http://userscripts.org/scripts/review/41013
// @author Arno.Nyhm
// @namespace http://www.extjs.com
// @include http://www.extjs.com/forum/search.php*
// @include http://extjs.com/forum/search.php*
// ==/UserScript==

// Specify your prefix of favourite forums here.
var startWith = 'Gxt';

// Specify your array of favourite forums here.
//var favouriteForums = new Array('Servlets', 'CaSeSeNsItIvE!!!');

// Hide non-specified forums in 'search' page.
if (window.location.href.indexOf('/search') > -1) {
var table = document.getElementById('threadslist');
if( table != null){
var rows = table.getElementsByTagName('tr');
for (var i = rows.length-1; i > 0; i--) {
var row = rows[i];
var cells = row.getElementsByTagName('td');
if(cells.length == 7){
var forumLink = cells[6].getElementsByTagName('a')[0];
var forumName = forumLink.firstChild.nodeValue;
// in this forum there are not trimmed forum names....
// var forumNameTrimmed = trim(forumName);
var forumNameTrimmed = forumName;
if(forumNameTrimmed.indexOf(startWith) == -1){
// if (favouriteForums.indexOf(forumNameTrimmed) == -1) {
// row.style.display = 'none';
row.parentNode.removeChild(row);
}

}
}
}

var myselects = document.getElementsByName("forumchoice[]");
if(myselects != null){
var myselect = myselects[0];
for (var selectIndex=0; selectIndex<myselect.options.length; selectIndex++){
var name = trim(myselect.options[selectIndex].text);
var select = !(name.indexOf(startWith) == -1);
myselect.options[selectIndex].selected = select;
}
}
}

// Link values sometimes trailed with spaces!!!
function trim(value) {
return value.replace(/^\s*|\s*$/g, '');
}


or download attachement and remove the .txt extension anddrag the file to your FireFox with installed greasemonkey

mistigi
7 Oct 2009, 7:56 AM
Thanks a lot for the script Arno, its really useful!

Arno.Nyhm
18 Nov 2009, 7:17 AM
new in this Version:

- Hide ExtJs in the Category Overview


Function:
- hide ExtJs in New Posts list
- hide ExtJs in Search Results list
- select only GXT Categories in Advanced Search form
- hide ExtJs in the Category overview


Installation:
1) install GreaseMonkey
2) install the userscript with one of the following 2 options:
2a) save this script as extjs_favourites.user.js (important the .user.js for greasemonkey)
or
2b) save the attachment and remove the .txt from the filename
3) drag the file to an open firefox window to "open" it. after this greasemonkey ask you to install this script.




// ==UserScript==
// @name ExtJS Favourites
// @description Only display specified forums on the forum index and the 'Recent Topics' page. Useful if you want to hide forums out of interest. Hidden forums are still accessible via 'Categories' page. based on script http://userscripts.org/scripts/review/41013
// @author Arno.Nyhm
// @namespace http://www.extjs.com
// @include http://www.extjs.com/forum/search.php*
// @include http://extjs.com/forum/search.php*
// @include http://www.extjs.com/forum/index.php*
// @include http://extjs.com/forum/index.php*
// ==/UserScript==

// Specify your prefix of favourite forums here.
var startWith = 'Gxt';
var log_counter = 0;

// Specify your array of favourite forums here.
//var favouriteForums = new Array('Servlets', 'CaSeSeNsItIvE!!!');

// Hide non-specified forums in 'search' page.
if (window.location.href.indexOf('/search') > -1) {
var table = document.getElementById('threadslist');
if( table != null){
var rows = table.getElementsByTagName('tr');
for (var i = rows.length-1; i > 0; i--) {
var row = rows[i];
var cells = row.getElementsByTagName('td');
if(cells.length == 7){
var forumLink = cells[6].getElementsByTagName('a')[0];
var forumName = forumLink.firstChild.nodeValue;
// in this forum there are not trimmed forum names....
// var forumNameTrimmed = trim(forumName);
var forumNameTrimmed = forumName;
if(forumNameTrimmed.indexOf(startWith) == -1){
// if (favouriteForums.indexOf(forumNameTrimmed) == -1) {
// row.style.display = 'none';
row.parentNode.removeChild(row);
}

}
}
}

var myselects = document.getElementsByName("forumchoice[]");
if(myselects != null){
var myselect = myselects[0];
for (var selectIndex=0; selectIndex<myselect.options.length; selectIndex++){
var name = trim(myselect.options[selectIndex].text);
var select = !(name.indexOf(startWith) == -1);
myselect.options[selectIndex].selected = select;
}
}
}

if (window.location.href.indexOf('/forum/index') > -1) {
var div = document.getElementById('bd');
var tables = getElementsByClass('tborder',div,'table');
var sectionsTable = tables[2];
var sections = sectionsTable.getElementsByTagName('tbody');
var removeNextSection = false;
for (var sectionId = sections.length-1; sectionId >= 0; sectionId--) {
var section = sections[sectionId];
if(section.id.indexOf('collapseobj') > -1){
var lines = section.getElementsByTagName('tr');
for (var lineId = lines.length-1; lineId >= 0; lineId--) {
var line = lines[lineId];
var links = line.getElementsByTagName('a');
var forumName = links[0].firstChild.innerHTML;
if( forumName.indexOf(startWith) == -1){
line.parentNode.removeChild(line);
if(section.getElementsByTagName('tr').length == 0){
removeNextSection = true;
}
}
}
} else {
if(removeNextSection){
section.parentNode.removeChild(section);
}
removeNextSection = false;
}


}
}

// Link values sometimes trailed with spaces!!!
function trim(value) {
return value.replace(/^\s*|\s*$/g, '');
}

// http://www.dustindiaz.com/getelementsbyclass/
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}


function log(text){

// GM_log( ++log_counter + ": " + text);

}