Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

Irish News Links

3,604 bytes added, 11:27, 6 March 2013
no edit summary
The first part is to put in a section header to hold the buttons. The following has three rows of buttons. The first are national news agencies. The second row is technical articles. The third row is to share prices.
<source lang="htmlhtml4strict">
<input type=button name=btnNewsTools1 id=btnNewsTools1 class='Master_Button' style='width:19%;' value='Irish Times' />
<input type=button name=btnNewsTools2 id=btnNewsTools2 class='Master_Button' style='width:19%;' value='Irish Independent' />
<input type=button name=btnFinancialTools1 id=btnFinancialTools1 class='Master_Button' style='width:49%;' value='Irish Share Exchange' />
<input type=button name=btnFinancialTools2 id=btnFinancialTools2 class='Master_Button' style='width:49%;' value='FTSE' />
</source>
 
So this adds the button, now we need to add some JavaScript to the onload of the page to add the functionality to the buttons.
The first line looks up the field with the company name to do the searching on.
 
<source lang="javascript">
var strNewsKeyword = document.getElementById('strCDA_41_field_0_4').value;
 
//onLoad function to set up links if existing record
function fn_InitialiseNewsLinks() {
 
//If the values have been initialised
if (strNewsKeyword != '') {
 
//Add the onclick event to allow window.open
addEvent( document.getElementById('btnNewsTools1'), 'click', strURL_IrishTimes );
addEvent( document.getElementById('btnNewsTools2'), 'click', strURL_IrishIndependent );
addEvent( document.getElementById('btnNewsTools3'), 'click', strURL_IrishExaminer );
addEvent( document.getElementById('btnNewsTools4'), 'click', strURL_SundayBusinessPost );
addEvent( document.getElementById('btnNewsTools5'), 'click', strURL_RTE );
addEvent( document.getElementById('btnTechTools1'), 'click', strURL_SiliconRepublic );
addEvent( document.getElementById('btnTechTools2'), 'click', strURL_TechCentral );
addEvent( document.getElementById('btnTechTools3'), 'click', strURL_CNET );
addEvent( document.getElementById('btnTechTools4'), 'click', strURL_ITLG );
addEvent( document.getElementById('btnTechTools5'), 'click', strURL_Blacknight );
addEvent( document.getElementById('btnFinancialTools1'), 'click', strURL_ISE );
addEvent( document.getElementById('btnFinancialTools2'), 'click', strURL_FTSE );
}
}
 
//Daniels add event function
function addEvent( obj, type, fn ) {
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
 
//The News Sites
function strURL_IrishExaminer(){
window.open("http://www.irishexaminer.com/search/?cx=004422957488353982429%3A4gb73lvknqy&cof=FORID%3A9&ie=UTF-8&q=" + strNewsKeyword + "&x=0&y=0");
}
function strURL_IrishTimes(){
window.open("http://www.irishtimes.com/search/index.html?rm=listresults&filter=datedesc&keywords=" + strNewsKeyword + "&x=0&y=0");
}
function strURL_SundayBusinessPost(){
window.open("http://www.businesspost.ie/#!search/" + strNewsKeyword + "");
}
function strURL_IrishIndependent(){
window.open("http://www.independent.ie/search/?fromSection=ece_frontpage&search=" + strNewsKeyword + "");
}
function strURL_RTE(){
window.open("http://www.rte.ie/search/?query=" + strNewsKeyword + "");
}
 
//The Tech Sites
function strURL_SiliconRepublic(){
window.open("http://search.siliconrepublic.com/search?IW_FIELD_WEB_STYLE=" + strNewsKeyword + "&IW_DATABASE=SRNewsChain&IW_SORT=-DC.date.issued&sa.x=0&sa.y=0");
}
function strURL_CNET(){
window.open("http://news.cnet.com/1770-5_3-0.html?query=" + strNewsKeyword + "&tag=srch&searchtype=news");
}
function strURL_Blacknight(){
window.open("http://technology.ie/?s=" + strNewsKeyword + "&submit.x=0&submit.y=0");
}
function strURL_TechCentral(){
window.open("http://www.techcentral.ie/search.aspx?search=" + strNewsKeyword + "&idcategory=0");
}
function strURL_ITLG(){
window.open("http://www.itlg.org/search.php?searchBox=" + strNewsKeyword + "&p=1");
}
 
//The Financial Sites
function strURL_ISE(){
window.open("http://www.ise.ie/Prices,-Indices-Stats/Equity-Market-Data/Shares-In-Issue/?list=full&type=SHARESISS");
}
function strURL_FTSE(){
window.open("http://www.londonstockexchange.com/prices-and-markets/markets/prices.htm");
}
 
//OnLoad fire it all off
fn_InitialiseNewsLinks();
 
</source>
7,528
edits