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