Difference between revisions of "MediaWiki:Common.js"
Kbjarkefur (talk | contribs) |
Kbjarkefur (talk | contribs) |
||
Line 1: | Line 1: | ||
/* Java script needed for the main page */ | /* Java script needed for the main page */ | ||
$(function () { | $(function () { | ||
Line 26: | Line 25: | ||
standAloneTopics.sort(function(a, b){return 0.5 - Math.random()}); | standAloneTopics.sort(function(a, b){return 0.5 - Math.random()}); | ||
/* | /* | ||
var lcElement = document.getElementById('dimewiki-mainpage-lc-js'); | var lcElement = document.getElementById('dimewiki-mainpage-lc-js'); | ||
Line 45: | Line 44: | ||
var topicTable = '<div class="table-div"><table style="width:100%">'; | var topicTable = '<div class="table-div"><table style="width:100%">'; | ||
topicTable += '<col width=20%><col width=80%><tr>'; | topicTable += '<col width=20%><col width=80%><tr>'; | ||
for ( topic = 0 ; topic < topicArray.length ; ++topic ) { | |||
topicTable += '<td rowspan="2">'+ topicArray[topic][0] +'</td>'; | |||
topicTable += '<td class="td_lc_titl">'+ topicArray[topic][1] +'</td>'; | |||
topicTable += '</tr><tr>'; | |||
topicTable += '<td class="td_lc_desc">'+ topicArray[topic][2] +'</td>'; | |||
} | |||
topicTable += '</tr></table></div>'; | topicTable += '</tr></table></div>'; | ||
Line 55: | Line 59: | ||
} | } | ||
function dispTopics_sa( | function dispTopics_sa(topicArray) | ||
{ | { | ||
for ( topic = 0 ; topic < topicArray.length ; ++topic ) { | |||
var topicTable = '<div class="table-div"><table style="width:100%">'; | |||
topicTable += '<tr><td class="td_sa">'+ topicArray[topic] +'</td></tr>'; | |||
topicTable += '</table></div>'; | |||
} | |||
return topicTable; | return topicTable; | ||
} | } | ||
Revision as of 14:43, 9 February 2017
/* Java script needed for the main page */
$(function () {
lifeCycleTopics = [
['Image file', 'Impact Evaluation Design', 'A brief introduction to the regression models commonly used in Impact Evaluation. Links to in details resources.'],
['Image file','Sampling & Power Calculations','A brief introduction to the regression models commonly used in Impact Evaluation. Links to in details resources.'],
['Image file','Human Subjects Approval','This topic discuss all ethical concerns important for the '],
['Image file','Preparing for Data Collection','This topic discuss all ethical concerns important for the '],
['Image file','Survey Firm Procurement','This topic discuss all ethical concerns important for the '],
['Image file','Questionnaire Design','This topic discuss all ethical concerns important for the '],
['Image file','Questionnaire Translation','This topic discuss all ethical concerns important for the '],
['Image file','Questionnaire Programming','This topic discuss all ethical concerns important for the '],
['Image file','[[Survey Pilot]','This topic discuss all ethical concerns important for the '],
['Image file','Enumerator Training','This topic discuss all ethical concerns important for the '],
['Image file','Monitoring Data Quality','This topic discuss all ethical concerns important for the '],
['Image file','Data Management','This topic discuss all ethical concerns important for the '],
['Image file','Data Cleaning','This topic discuss all ethical concerns important for the '],
['Image file','Data Analysis','This topic discuss all ethical concerns important for the '],
['Image file','Reproducible Research','This topic discuss all ethical concerns important for the ']
]
standAloneTopics = [
'Stata Coding Practices','Stata Coding Practices','SurveyCTO Coding Practices','Geo Spatial Data','Check Lists for Field Coordinators','i2i Trust Fund for Impact Evaluation','Impact Evaluation Team','Cost-effectiveness Analysis'
]
standAloneTopics.sort(function(a, b){return 0.5 - Math.random()});
/*
var lcElement = document.getElementById('dimewiki-mainpage-lc-js');
lcElement.innerHTML = dispTopics_lc(lifeCycleTopics );
var saElement = document.getElementById('dimewiki-mainpage-sa-js');
saElement.innerHTML = dispTopics_sa(standAloneTopics);
*/
var myElement = document.getElementById('mw-mywiki-example');
myElement.innerHTML = dispTopics_sa(standAloneTopics);
}());
function dispTopics_lc(topicArray)
{
var topicTable = '<div class="table-div"><table style="width:100%">';
topicTable += '<col width=20%><col width=80%><tr>';
for ( topic = 0 ; topic < topicArray.length ; ++topic ) {
topicTable += '<td rowspan="2">'+ topicArray[topic][0] +'</td>';
topicTable += '<td class="td_lc_titl">'+ topicArray[topic][1] +'</td>';
topicTable += '</tr><tr>';
topicTable += '<td class="td_lc_desc">'+ topicArray[topic][2] +'</td>';
}
topicTable += '</tr></table></div>';
return topicTable;
}
function dispTopics_sa(topicArray)
{
for ( topic = 0 ; topic < topicArray.length ; ++topic ) {
var topicTable = '<div class="table-div"><table style="width:100%">';
topicTable += '<tr><td class="td_sa">'+ topicArray[topic] +'</td></tr>';
topicTable += '</table></div>';
}
return topicTable;
}