Include minified versions of scripts for the server

This commit is contained in:
Robbie Antenesse 2016-03-02 11:13:19 -07:00
parent 0df7281c94
commit 24917e7ff2
6 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

1
js/min/marked.js Normal file

File diff suppressed because one or more lines are too long

1
js/min/publicView.js Normal file
View File

@ -0,0 +1 @@
function IsValidPublicDicitonary(){return"string"!=typeof publicDictionary}function ShowPublicDictionary(){if(IsValidPublicDicitonary()){var e=document.getElementById("wordFilter").value,i=[],t=htmlEntitiesParseForSearchEntry(document.getElementById("searchBox").value),n=document.getElementById("searchOptionWord").checked,r=document.getElementById("searchOptionSimple").checked,c=document.getElementById("searchOptionLong").checked,o=!document.getElementById("searchCaseSensitive").checked,a=document.getElementById("searchIgnoreDiacritics").checked;if(""!=t&&(n||r||c)){var d=[],s=htmlEntitiesParseForSearch(JSON.stringify(publicDictionary));o&&(t=t.toLowerCase()),a&&(t=removeDiacritics(t),s=removeDiacritics(s)),n&&d.push("contains("+(o?"name":'translate(name, "", "")')+', "'+t+'")'),r&&d.push("contains("+(o?"simpleDefinition":'translate(simpleDefinition, "", "")')+', "'+t+'")'),c&&d.push("contains("+(o?"longDefinition":'translate(longDefinition, "", "")')+', "'+t+'")');var l=JSON.parse(s);i=JSON.search(l,"//words["+d.join(" or ")+"]/wordId")}var m=document.getElementById("dictionaryName");m.innerHTML=htmlEntitiesParse(publicDictionary.name)+" Dictionary";var p=document.getElementById("dictionaryBy");p.innerHTML="created by "+htmlEntitiesParse(publicDictionary.createdBy);var u=document.getElementById("incompleteNotice");publicDictionary.settings.isComplete||(u.innerHTML="<em>Note: This dictionary is not yet complete and is likely to change.</em>");var y=document.getElementById("dictionaryDescription");y.innerHTML=marked(htmlEntitiesParse(publicDictionary.description));var h=document.getElementById("theDictionary"),D="",g=0;if(publicDictionary.words.length>0)for(var w=0;w<publicDictionary.words.length;w++)(""==e||""!=e&&publicDictionary.words[w].partOfSpeech==e)&&(""==t||""!=t&&(n||r||c)&&i.indexOf(publicDictionary.words[w].wordId)>=0)&&(publicDictionary.words[w].hasOwnProperty("pronunciation")||(publicDictionary.words[w].pronunciation=""),publicDictionary.words[w].hasOwnProperty("wordId")||(publicDictionary.words[w].wordId=w+1),D+=PublicDictionaryEntry(w),g++);else D="There are no entries in the dictionary.";h.innerHTML=D,ShowFilterWordCount(g)}else document.getElementById("dictionaryContainer").innerHTML=publicDictionary}function PublicDictionaryEntry(e){var i="<entry><a name='"+publicDictionary.words[e].wordId+"'></a><a href='#"+publicDictionary.words[e].wordId+"' class='wordLink clickable'>&#x1f517;</a>",t=regexParseForSearch(document.getElementById("searchBox").value),n=document.getElementById("searchOptionWord").checked,r=document.getElementById("searchOptionSimple").checked,c=document.getElementById("searchOptionLong").checked,o=!document.getElementById("searchCaseSensitive").checked,a=document.getElementById("searchIgnoreDiacritics").checked,d=new RegExp("("+(a?removeDiacritics(t)+"|"+t:t)+")","g"+(o?"i":""));return i+="<word>",i+=""!=t&&n?htmlEntitiesParse(publicDictionary.words[e].name).replace(d,"<searchTerm>$1</searchterm>"):publicDictionary.words[e].name,i+="</word>",""!=publicDictionary.words[e].pronunciation&&(i+="<pronunciation>",i+=marked(htmlEntitiesParse(publicDictionary.words[e].pronunciation)).replace("<p>","").replace("</p>",""),i+="</pronunciation>"),""!=publicDictionary.words[e].partOfSpeech&&(i+="<partofspeech>",i+=publicDictionary.words[e].partOfSpeech,i+="</partofspeech>"),i+="<br>",""!=publicDictionary.words[e].simpleDefinition&&(i+="<simpledefinition>",i+=""!=t&&r?htmlEntitiesParse(publicDictionary.words[e].simpleDefinition).replace(d,"<searchTerm>$1</searchterm>"):publicDictionary.words[e].simpleDefinition,i+="</simpledefinition>"),""!=publicDictionary.words[e].longDefinition&&(i+="<longdefinition>",i+=""!=t&&c?marked(htmlEntitiesParse(publicDictionary.words[e].longDefinition).replace(d,"<searchTerm>$1</searchterm>")):marked(htmlEntitiesParse(publicDictionary.words[e].longDefinition)),i+="</longdefinition>"),i+="</entry>"}function SetPublicPartsOfSpeech(){for(var e=document.getElementById("wordFilter"),i=htmlEntitiesParse(publicDictionary.settings.partsOfSpeech).trim().split(","),t=0;t<i.length;t++){var n=document.createElement("option");n.appendChild(document.createTextNode(i[t].trim())),n.value=i[t].trim(),e.appendChild(n)}}

View File

@ -0,0 +1 @@
function removeDiacritics(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return diacriticsMap[e]||e})}for(var defaultDiacriticsRemovalap=[{base:"A",letters:"AⒶÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷḂḄḆɃƂƁ"},{base:"C",letters:"CⒸĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻḞƑꝻ"},{base:"G",letters:"GⒼǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿĴɈ"},{base:"K",letters:"KⓀḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂḾṀṂⱮƜ"},{base:"N",letters:"NⓃǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆꝖꝘɊ"},{base:"R",letters:"RⓇŔṘŘȐȒṚṜŖṞɌⱤꞦꞂ"},{base:"S",letters:"SⓈẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍẊẌ"},{base:"Y",letters:"YⓎỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑḃḅḇƀƃɓ"},{base:"c",letters:"cⓒćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕḟƒꝼ"},{base:"g",letters:"gⓖǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙĵǰɉ"},{base:"k",letters:"kⓚḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜḿṁṃɱɯ"},{base:"n",letters:"nⓝǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠɋꝗꝙ"},{base:"r",letters:"rⓡŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧẋẍ"},{base:"y",letters:"yⓨỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩźẑżžẓẕƶȥɀⱬꝣ"}],diacriticsMap={},i=0;i<defaultDiacriticsRemovalap.length;i++)for(var letters=defaultDiacriticsRemovalap[i].letters,j=0;j<letters.length;j++)diacriticsMap[letters[j]]=defaultDiacriticsRemovalap[i].base;

1
js/min/ui.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -204,10 +204,6 @@ function wordFormIsLocked() {
}
function ToggleWordFormLock() {
var lockButton = document.getElementById("formLockButton");
var leftColumn = document.getElementById("leftColumn");
var wordForm = document.getElementById("wordEntryForm");
if (wordFormIsLocked()) { //If it is already locked, change it to Unlocked and get everything working as it needs to.
UnlockWordForm();
} else {