|
| 1 | +var defaults = {} |
| 2 | +var factoryDefaults = {} |
| 3 | + factoryDefaults.font = 'Noto Sans Malayalam WF' // text area font name (a single font, no quotes) |
| 4 | + factoryDefaults.size = "28"; // text area font size, number of pixels (just the number) |
| 5 | + factoryDefaults.rows = "150"; // number representing number of times 100px for height of text area |
| 6 | + factoryDefaults.lineheight = "1.5"; // number representing line height of text area in pixels/100 |
| 7 | + factoryDefaults.language = 'ml' // language to use for examples |
| 8 | + factoryDefaults.uifont = 'Noto Sans Malayalam WF'; // font name for selection area (a single font, no quotes) |
| 9 | + factoryDefaults.uisize = "24"; // selection area font size, number of pixels (just the number) |
| 10 | + factoryDefaults.ccbase = "\u25CC"; // default base for combining characters |
| 11 | + factoryDefaults.uidir = "ltr" // indicates the base direction for the selection area |
| 12 | + factoryDefaults.contrast = "low" // contrast for UI text colours |
| 13 | + factoryDefaults.hints = "none" // type of hint to show alongside characters in the grids |
| 14 | + |
| 15 | + |
| 16 | +var thisPicker = 'malayalamPicker' |
| 17 | + |
| 18 | +if (localStorage.pickersStore && localStorage[thisPicker]) defaults = JSON.parse(localStorage[thisPicker]) |
| 19 | +else defaults = factoryDefaults |
| 20 | + |
| 21 | +var webFonts = [ "Noto Sans Malayalam WF" ] |
| 22 | + |
| 23 | + |
| 24 | +var template = {} |
| 25 | + template.title = 'Malayalam character app' |
| 26 | + template.sample = "2. തന്റെ സ്വന്തം രാജ്യവും മറ്റേതൊരു രാജ്യവും വിടുന്നതിന്നും തന്റെ രാജ്യത്തേയ്ക്കു മടങ്ങിവരുന്നതിനുമുള്ള അധികാരം ഏതൊരാള്ക്കുമുള്ളതാണ്." |
| 27 | + template.blocklocation= '/scripts/malayalam/block' // blocklocation to use for examples |
| 28 | + template.direction = "ltr" // indicates whether this is a picker for a RTL script |
| 29 | + template.github = 'malayalam' |
| 30 | + template.scriptcode = 'Mlym' |
| 31 | + template.fontLocale = 'mlym' |
| 32 | + template.hints = true |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +var controls = [ |
| 38 | +{"title":"Trans-<br/>literate", "alt":"Convert Malayalam text to a Latin transliteration.", "code":"doTranscription('transliterate')"}, |
| 39 | + |
| 40 | +{"title":"Make<br/>vocab", "alt":"Expand text to create a line for a vocab file.", "code":`_output=document.getElementById('output'); |
| 41 | +input=getHighlightedText(_output).split('|'); |
| 42 | +if (! hasHighlight(_output)) _output.value=''; |
| 43 | +
|
| 44 | +ipa = maptoipa(input[0]); |
| 45 | +notes = input[2]? input[2] : ''; |
| 46 | +
|
| 47 | +add(getVocab(input[0], input[1], notes, ipa)); |
| 48 | +vocab2Example(getHighlightedText(document.getElementById('output'))); |
| 49 | +_output.focus();`}, |
| 50 | +] |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +var pulldown = [ |
| 55 | +{"title":"Reverse<br/>transliterate", "alt":"Convert a Latin transliteration to Javanese text.", "code":"doTranscription('revTransliterate')"}, |
| 56 | + |
| 57 | +{"title":"Malayalam<br/>to ISO", "alt":"Convert Malayalam text to an ISO Latin transcription.", "code":"doTranscription('toISO')"}, |
| 58 | + |
| 59 | +{"title":"ISO to<br/>Malayalam", "alt":"Convert ISO latin text to Malayalam transcription.", "code":"doTranscription('toMalayalam')"}, |
| 60 | + |
| 61 | +{"title":"Malayalam<br/>to IPA", "alt":"Convert Malayalam text to an *approximation* to the IPA transcription.", "code":"doTranscription('toIPA')"}, |
| 62 | + |
| 63 | +{"title":"Vocab to<br>Example", "alt":"Convert a vocab sequence to example markup.", "code":"vocab2Example(getHighlightedText(document.getElementById('output')))"}, |
| 64 | +] |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +var inputAids = [ |
| 69 | +{"title":"Shape-based lookup", "dataVar":"showShapeLookup", "dataLocn":"shapelist", "dataShortTitle":"S", "type":"shape", "desc":"Click on a panel of shapes to find similar characters."}, |
| 70 | + |
| 71 | +{"title":"Hint at similar shapes", "dataVar":"showShapeHints", "dataLocn":"", "dataShortTitle":"H", "type":"hint", "desc":"Show similar shapes as you mouse over a character."}, |
| 72 | + |
| 73 | +{"title":"Type assist", "dataVar":"typeAssist", "dataLocn":"transcriptionPalette", "dataShortTitle":"T", "type":"palette", "initialCode":"setUpTypeAssist(false, '', typeAssistMap)", "desc":"Use ASCII characters to type Malayalam from the keyboard."}, |
| 74 | + |
| 75 | +{"title":"Latin type-assist", "dataVar":"showLatinTrans", "dataLocn":"transcriptionPalette", "dataShortTitle":"L", "type":"palette", "initialCode":"setUpTypeAssist(true, latinTypeAssistMap, latinTypeAssistMap)", "desc":"Show characters needed for IPA or other transcriptions and transliterations."}, |
| 76 | + |
| 77 | +{"title":"ISO to Malayalam", "dataVar":"showISOCharMap", "dataLocn":"transcriptionPalette", "dataShortTitle":"I", "type":"palette", "initialCode":"setUpTypeAssist(false, isoCharacterMap, isoCharacterMap)", "desc":"Create Malayalam text from characters in the ISO transcription."}, |
| 78 | + |
| 79 | +{"title":"Reverse transliteration", "dataVar":"showTranslit", "dataLocn":"transcriptionPalette", "dataShortTitle":"R", "type":"palette", "initialCode":"setUpTypeAssist(false, typeAssistMap, typeAssistMap)", "desc":"Use ASCII characters to type Malayalam from the keyboard via reverse transliteration."}, |
| 80 | + |
| 81 | +] |
| 82 | + |
0 commit comments