Friday 21 November 2014

ALPHABETICAL ORDER TOOL CODE

ALPHABETICAL ORDER TOOL CODE



------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN POST HTML CODE
-------------------------------------------------------------------------------------------------


<html>

<head>

<title>Put in Alphabetical Order - free online tool</title>

<style type="text/css">
h2 {
color:#E86032;
font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
font-size:18px;
margin:0;
padding:8px 0;
}

/* CONTENT */
.flat{margin:0;padding:0;}
.online-tools{margin:0 0 20px 0;padding:20px; border: 1px dashed #999999;background-color:#dfecfa;clear:both;-moz-border-radius: 12px;border-radius: 12px;}
.resourcelist{margin: 0 0 2% 0;padding:2%;border:1px solid #4592d4;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;}
.mright{margin-right:20px;}
.mbottom{margin-bottom:15px;}
.clb{clear:both;}
.tfquote{font-style:italic;color:#7e7f80;font-size:16px;padding-left:30px;padding-right:30px;}
.hpagebox{float:right;margin: 15px 0 20px 10px;padding:20px 20px;width:242px;border:1px solid #4592d4;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;}
.hpagebox h2{font-size: 21px;color: #3b6e9a;margin-bottom:0;padding-bottom:4px;}
.hpagebox p{font-size: 15px;margin-top:0;padding-top:0;}
.hpagelist li{line-height:23px;}
hr{margin:15px 0; padding:0;height: 1px;background-color: #ea6f15;border:none}
.fleft{float:left;padding: 5px 10px 5px 0px;}
.fright{float:right;padding: 5px 0px 5px 10px;}
.code{font-family:courier,sans-serif;color: #031f0c;padding:20px 10px;border-top: 2px dotted #cccccc;border-bottom: 2px dotted #cccccc;}
.cmt{font-family:courier,sans-serif;color: #006633;}

/* FORMS */
form{padding:0;margin:0;}
textarea{width:99%;margin:0;padding:0;}
form h2{margin:0;padding:0;}
.frmbtn{margin: 0 0 20px 0;padding:6px 9px;color:#006699;font-size:15px;cursor:pointer;}
button{cursor:pointer;}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

</head>

<body>

<div id="wrapper">

<form action="" class="online-tools" method="post">

<script type="text/javascript">
//<![CDATA[
//Alphabetical Order Tool
$(function() {
var seperatorI;
var newCode;
var newCodeArray = [];
var inputSep;
var outputSep;
$("input:radio[name=seperatorI]").click(function() {
$('#sepcsI').val('');
$('#sepcsO').val('');
seperatorI = $('input:radio[name=seperatorI]:checked').val();
if(seperatorI == "space"){
$('#sepspO').attr('checked', true);
}
if(seperatorI == "comma"){
$('#sepcoO').attr('checked', true);
}
if(seperatorI == "semi-colon"){
$('#sepscO').attr('checked', true);
}
if(seperatorI == "linebreak"){
$('#spelbO').attr('checked', true);
}
});
$("input:radio[name=seperatorO]").click(function() {
$('#sepcsO').val('');
});
//Custom separator
$('#sepcsI').keyup(function() {
if ($('#sepcsI').val() != ""){
$("input:radio[name=seperatorI]").attr('checked', false);
$("input:radio[name=seperatorO]").attr('checked', false);
}else{
$('#sepspI').attr('checked', true);
$('#sepspO').attr('checked', true);
}
$('#sepcsO').val($('#sepcsI').val());
});
$('#sepcsO').keyup(function() {
if ($('#sepcsO').val() == ""){
$('#sepspO').attr('checked', true);
}else{
$("input:radio[name=seperatorO]").attr('checked', false);
}
});
function naturalSort (a, b) {
var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
sre = /(^[ ]*|[ ]*$)/g,
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
hre = /^0x[0-9a-f]+$/i,
ore = /^0/,
i = function(s) { return naturalSort.insensitive && (''+s).toLowerCase() || ''+s },
x = i(a).replace(sre, '') || '',
y = i(b).replace(sre, '') || '',
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null,
oFxNcL, oFyNcL;
if (yD)
if ( xD < yD ) return -1;
else if ( xD > yD ) return 1;
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }
else if (typeof oFxNcL !== typeof oFyNcL) {
oFxNcL += '';
oFyNcL += '';
}
if (oFxNcL < oFyNcL) return -1;
if (oFxNcL > oFyNcL) return 1;
}
return 0;
}
$("#Alphabetize-Text").click(function() {
newCode = $('#oldText').val();
if($('#removeHtml:checked').val() == "html"){
$('#htmlStripper').html(newCode);
newCode = $('#htmlStripper').text();
$('#htmlStripper').text('');
}
if($('#removePunctuation:checked').val() == "punctuation"){
newCode = newCode.replace (/[.?!:(){}\[\]]/g, " ");
}
if($('#sepcsI').val() != ""){
inputSep = $('#sepcsI').val();
}else{
if($('input:radio[name=seperatorI]:checked').val() != "" ){
inputSep = $('input:radio[name=seperatorI]:checked').val();
}else{
inputSep = "space";
}
}
if (inputSep == 'space'){inputSep = ' ';}
if (inputSep == 'comma'){inputSep = ',';}
if (inputSep == 'semi-colon'){inputSep = ';';}
if (inputSep == 'linebreak'){inputSep = '\n';}
if($('#sepcsO').val() != ""){
outputSep = $('#sepcsO').val();
}else{
if($('input:radio[name=seperatorO]:checked').val() != "" ){
outputSep = $('input:radio[name=seperatorO]:checked').val();
}else{
outputSep = "space";
}
}
if (outputSep == 'space'){outputSep = ' ';}
if (outputSep == 'comma'){outputSep = ',';}
if (outputSep == 'semi-colon'){outputSep = ';';}
if (outputSep == 'linebreak'){outputSep = '\n';}
if (inputSep == '\n'){
newCode = newCode.replace(/(\r\n|\r)/gm,"\n");
newCodeArray = newCode.split(inputSep);
for(var i=0;i<newCodeArray.length;i++){ newCodeArray[i]=$.trim(newCodeArray[i]); } }else{ newCode=newCode.replace(/(\r\n|\n|\r)/gm," "); nodsp=/\s+/g; newCode=newCode.replace(nodsp," "); newCodeArray=newCode.split(inputSep); for(var i=0;i<newCodeArray.length;i++){ newCodeArray[i]=$.trim(newCodeArray[i]); } } newCodeArray.sort(); if($('input:radio[name=sortType]:checked').val()=='alphabetical'){ naturalSort.insensitive=true; newCodeArray.sort(naturalSort); } if($('input:checkbox[name=removeDuplicates]:checked').val()=='duplicates'){ var i=newCodeArray.length-1; while(i> -1){
var ii = newCodeArray.length-1;
while(ii > -1){
if(i != ii){
if (newCodeArray[i] == newCodeArray[ii]){
newCodeArray.splice (ii, 1);
}
}
ii--;
}
i--;
}
}
if($('input:checkbox[name=reverseSort]:checked').val() == 'reverse'){
newCodeArray.reverse();
}
newCode = newCodeArray.join(outputSep);
$('#newCode').val(newCode);
});
});

//]]>
</script>

<h2>Alphabetical Order Tool</h2>
<div style="border-bottom: 1px dashed #999; padding-bottom: 10px;">
Paste your text in the box below and then click the button. The newly alphabetized text will appear in the box at the bottom of the page.</div>
<strong>Type of Sorting Required</strong><br />
<div class="flat" style="border-bottom: 1px dashed #999; padding-bottom: 10px;">
<input checked="checked" id="sortAlpha" name="sortType" type="radio" value="alphabetical" /> Standard Alphabetical Order
<input id="sortAscii" name="sortType" type="radio" value="ascii" /> <span style="padding-right: 80px;">Ascii Sorting</span>
<input id="reverseSort" name="reverseSort" type="checkbox" value="reverse" /> Reverse Sorting Order (Z-A or 9-0)
</div>
<strong>Input Format Options</strong> (separator between the items to be sorted)<br />
<div class="flat" style="border-bottom: 1px dashed #999; padding-bottom: 10px;">
<span class="flat" style="padding-right: 15px;"><input checked="checked" id="sepspI" name="seperatorI" type="radio" value="space" /> Blank space</span>
<span class="flat" style="padding-right: 15px;"><input id="sepcoI" name="seperatorI" type="radio" value="comma" /> Comma</span>
<span class="flat" style="padding-right: 15px;"><input id="sepscI" name="seperatorI" type="radio" value="semi-colon" /> Semi-colon</span>
<span class="flat" style="padding-right: 15px;"><input id="spelbI" name="seperatorI" type="radio" value="linebreak" /> Line break </span>
<span class="flat"> OR a custom separator:&nbsp; <input class="frmtxt" id="sepcsI" name="customSeperatorI" size="2" type="text" value="" /></span>
</div>
<strong>Output Format Options</strong><br />

<div class="flat" style="border-bottom: 1px dashed #999; padding-bottom: 10px;">
<span class="flat" style="padding-right: 15px;"><input checked="checked" id="sepspO" name="seperatorO" type="radio" value="space" /> Blank space</span>
<span class="flat" style="padding-right: 15px;"><input id="sepcoO" name="seperatorO" type="radio" value="comma" /> Comma</span>
<span class="flat" style="padding-right: 15px;"><input id="sepscO" name="seperatorO" type="radio" value="semi-colon" /> Semi-colon</span>
<span class="flat" style="padding-right: 15px;"><input id="spelbO" name="seperatorO" type="radio" value="linebreak" /> Line break </span>
<span class="flat"> OR a custom separator:&nbsp; <input class="frmtxt" id="sepcsO" name="customSeperatorO" size="2" type="text" value="" /></span>
</div>
<strong>Removal Options</strong><br />
<input checked="checked" id="removeDuplicates" name="removeDuplicates" type="checkbox" value="duplicates" /> Remove Duplicates&nbsp;&nbsp;
<input id="removePunctuation" name="removePunctuation" type="checkbox" value="punctuation" /> Remove Punctuation, and Brackets&nbsp;&nbsp;
<input checked="checked" id="removeHtml" name="removeHtml" type="checkbox" value="html" /> Remove HTML <br />
<br />
<textarea cols="36" id="oldText" name="oldText" rows="9"></textarea><br />
<input class="frmbtn" id="Alphabetize-Text" name="Alphabetize-Text" type="button" value="Alphabetize your Text" /> &nbsp;&nbsp;(Alphabetized text appears in box below)<br />
<div id="htmlStripper" style="display: none;">
</div>
<h2>
New Text in Alphabetical Order</h2>
<div class="flat">
Copy your newly alphabetized ABC text from the box below. <!-- Or click the button below to save the alphabetical results as a text file on your computer. --></div>
<textarea cols="36" id="newCode" name="newCode" onclick="javascript:this.form.newCode.focus();this.form.newCode.select();" rows="12"></textarea>
<br />
<!--
<p style="float:right;">
<input type="button" name="Alphabetize-Text" value="Save Alphabetized Results as Text File" class="frmbtn" /></p>
<p>
&nbsp;</p>
-->
</form>
</div>

</body>

</html>








0 comments:

Post a Comment

FB Gadgets | Template Designed by Fatakat PhotosCoolBThemes.com
Code by : paid web directory

https://www.google.co.uk/search?q=site%3Ablogspot.com+fbgadgets