User:CenPop/CenPopLayout.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:CenPop/CenPopLayout. |
/**<nowiki>
* Layout Code for CenPop Script
*
* @license
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* @version 1.0
* @author Jacob Alperin-Sheriff, Joeytje50
*/
var temp_state_list=["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
var temp_fips_list=["01","02","04","05","06","08","09","10","11","12","13","15","16","17","18","19","20","21","22",
"23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39",
"40","41","42","44","45","46","47","48","49","50","51","53","54","55","56"];
var stateAddingStr='';
for(let i=0; i < temp_state_list.length;i++) stateAddingStr = stateAddingStr + '<option value="'+temp_fips_list[i]+'">'+temp_state_list[i]+'</option>';
CenPop.layoutHTML={body:
'<article id="resultWindow"></article>'+
'<main id="inputsWindow">'+
'<div id="inputsBox">'+
'<section id="articleTabs">'+
'<nav class="tabholder">'+
'<span class="articleTab failed activeArticle" data-tab="1">'+'Failed to add'+'</span> '+
'<span class="articleTab nowebsite" data-tab="2">'+CenPop.msg('tab-nowebsite')+'</span> '+
'</nav>'+
'<section class="articleTabc failed activeArticle" data-tab="1">'+
'<aside id="articleBox">'+
'<textarea id="articleList"></textarea>'+
'</aside>'+
'</section>'+
'<section class="articleTabc nowebsite" data-tab="2">'+
'<aside id="noWebsiteBox">'+
'<textarea id="noWebsiteList"></textarea>'+
'</aside>'+
'</section>'+
'</section>'+
'<section id="tabs">'+
'<nav class="tabholder">'+
'<span class="CenPoptab active" data-tab="1">'+CenPop.msg('tab-editing')+'</span> '+
'<span class="CenPoptab cenfields" data-tab="2">'+CenPop.msg('tab-cen-fields')+'</span> '+
'<span class="CenPoptab debug" data-tab="3">'+CenPop.msg('tab-debug')+'</span> '+
'<span class="CenPoptab upload" data-tab="4">'+CenPop.msg('tab-upload')+'</span> '+
' <span class="CenPoptab log" data-tab="5">'+'Log'+'</span> '+
'</nav>'+
'<section class="CenPoptabc active" data-tab="1"></section>'+
'<section class="CenPoptabc cenfields" data-tab="2"></section>'+
'<section class="CenPoptabc debug" data-tab="3"></section>'+
'<section class="CenPoptabc upload" data-tab="4"></section>'+
'<section class="CenPoptabc log" data-tab="5"></section>'+
'<footer id="status">done</footer>'+
'</section>'+
'<aside id="editBox">'+
'<b>'+CenPop.msg('editbox-caption')+'</b> (<span id="diffLen">0</span>) '+
'<textarea id="editBoxArea"></textarea>'+
'</aside>'+
'</div>'+
'</main>'+
'<footer id="stats">'+
CenPop.msg('stat-new')+ '<span id="newPages">0</span>; '+
CenPop.msg('stat-modhist')+' <span id="modPages">0</span>; '+
CenPop.msg('stat-geoinfo')+' <span id="geoInfoPages">0</span>; '+
CenPop.msg('stat-modinfobox')+' <span id="modInfoPages">0</span>; '+
CenPop.msg('stat-save')+' <span id="pagesSaved">0</span>; '+
CenPop.msg('stat-null')+' <span id="nullEdits">0</span>; '+
'Fail:'+' <span id="noMatch">0</span>; '+
'</footer>'+
'<div id="overlay" style="display:none;"></div>',
censusinputfields:'<div id="histPopDiv">Historical Census Info</div>'+
'<div class="replaces" id="censusInputFields">'+
'<div id="est_or_census_div">'+
'<span class="to_add_span">'+
'<label class="load_label">Type: </label>'+
'<label class="radio_label"><input type="radio" class="my_radio estorcensus" name="estorcensus" value="Estimate" checked>Estimate</label>'+
'<label class="radio_label"><input type="radio" class="my_radio estorcensus" name="estorcensus" value="Decennial">Decennial</label>'+
'</span>'+
'</div>'+
'<label title="'+CenPop.msg('begin-year-tip')+'" style="display:block;">'+'begin_year='+' <input type="text" class="beginYearText"/></label>'+
'<label title="'+CenPop.msg('est-year-tip')+'" style="display:block;">'+'estyear='+' <input type="text" class="estYearText"/></label>' +
'<label style="display:block;">'+'estref='+' <input type="text" class="estRefText"/></label>'+
'<label style="display:block;">'+'footnote='+' <input type="text" class="footnoteText"/></label>'+
'</div>',
census_load_str:'<div id="select_div">'+'<div class="to_add_div" id="state_div">'+'<span class="to_add_span">State</span>'+
'<select id="stateAdding" title="State to add updates from">'+stateAddingStr+'</select></div>'+
'<div class="to_add_div" id="geo_div">'+'<span class="to_add_span">Geo Level</span>'+
'<select id="geoAdding" title="Geography level to add updates from">'+
'<option value="county">'+'County'+'</option>'+'<option value="place">'+'Place'+'</option>'+
'<option value="incplace" selected>'+'Inc. Place'+'</option>'+
'<option value="cousub">'+'County Sub.'+'</option>'+
'</select></div>'+
'<div class="to_add_div" id="county_div">'+
'<span class="to_add_span">County</span>'+
'<input type="text" id="county_fips" title="County FIPS code" maxlength="3">'+
'</div>'+
'<div class="to_add_div" id="fips_div">'+
'<span class="to_add_span">Start FIPS</span>'+
'<input type="text" id="min_fips" title="Minimum FIPS code for locality to start adding from" maxlength="5">'+
'</div>'+
'</div>'
,
findreplace:'<div class="replaces">'+
'<label style="display:block;" id="summaryLabel">Summary:<input class="fullwidth" type="text" id="summary" maxlength="170"></label>'+
'</div>'
};
CenPop.layoutHTML.datatab1='<div id="load_from_div">'+
'<span class="to_add_span">'+
'<label id="load_label">Load From: </label>'+
'<label class="radio_label"><input type="radio" class="my_radio" name="load_from" value="census" checked>Census Bureau</label>'+
'<label class="radio_label"><input type="radio" class="my_radio" name="load_from" value="file">Internal File</label>'+
'</span>'+
'</div>'+
'<div id="load_details">'+CenPop.layoutHTML.census_load_str+'</div>'+
'<div class="check_div">'+
'<span class="to_add_span">'+
'<label><input type="checkbox" id="autosave"> '+CenPop.msg('auto-save')+'</label>'+
'<label title="'+CenPop.msg('tip-save-interval')+'" class="divisor">'+
CenPop.msg('save-interval', '<input type="number" min="0" value="0" style="width:50px" id="throttle" disabled>')+
'</label>'+
'</span>'+
'<span class="to_add_span">'+
'<label><input type="checkbox" id="overwrite"> '+'Overwrite'+'</label>'+
'</span>'+
'<span class="to_add_span">'+
'<label title="'+CenPop.msg('tip-only-fips')+'"><input type="checkbox" id="tryfipsonly" /> Try FIPS only</label>'+
'</span>'+
'<span class="to_add_span">'+
'<label title="'+CenPop.msg('tip-add-images')+'"><input type="checkbox" id="addimages" />Add images</label>'+
'</span>'+
'<div id="button_div">'+
'<button class="editbutton" id="nextButton" disabled accesskey="n" title="['+CenPop.tooltip+'n]">'+'Next'+'</button>'+
'<button class="editbutton" id="submitButton" disabled accesskey="s" title="['+CenPop.tooltip+'s]">'+CenPop.msg('editbutton-save')+'</button>'+
'<button class="editbutton" id="previewButton" disabled accesskey="p" title="['+CenPop.tooltip+'p]">'+CenPop.msg('editbutton-preview')+'</button>'+
'<button class="editbutton" id="diffButton" disabled accesskey="d" title="['+CenPop.tooltip+'d]">'+CenPop.msg('editbutton-diff')+'</button>'+
'</div>'+
'</div>'+
'<span id="startstop">'+
'<button id="startbutton" accesskey="a" title="Start and load data">'+CenPop.msg('editbutton-start')+'</button>'+
'<br>'+
'<button id="stopbutton" disabled accesskey="q" title="['+CenPop.tooltip+'q]">'+CenPop.msg('editbutton-stop')+'</button> '+
'<br>'+
'<button id="runButton" disabled>'+CenPop.msg('editbutton-run')+'</button>'+
'</span>'+
CenPop.layoutHTML.findreplace;