From 86ff2136f7dede29af0da0011acf793efba6ebeb Mon Sep 17 00:00:00 2001 From: --headM Date: Wed, 4 Mar 2020 19:46:51 -0500 Subject: [PATCH 1/6] Added Abbreviations and Ellispis-Based Truncation Added shortening of titles based on OED abbreviations Added ellispsis-based truncation Truncation currently removes ability to break text at word boundaries (haven't found a way to resolve this). --- package-lock.json | 5 + package.json | 1 + src/components/Class.vue | 36 +++- src/utils/abbreviations.js | 330 +++++++++++++++++++++++++++++++++++++ 4 files changed, 366 insertions(+), 6 deletions(-) create mode 100644 src/utils/abbreviations.js diff --git a/package-lock.json b/package-lock.json index f363baa8..d0faff4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16102,6 +16102,11 @@ "vue-template-es2015-compiler": "^1.6.0" } }, + "vue-line-clamp": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/vue-line-clamp/-/vue-line-clamp-1.3.2.tgz", + "integrity": "sha512-SuZlRDBKsTlMOSLsJsceJPM7Sd2wcaKayyMEsf65b33chuK1zgTIU1RqlbAXSxO2R+FOQV5rYHLiAopdwVjroQ==" + }, "vue-loader": { "version": "15.7.0", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.7.0.tgz", diff --git a/package.json b/package.json index ce6b97f4..0eef9cfe 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "ua-parser-js": "^0.7.19", "vue-context": "^3.4.0", "vue-cookies": "^1.5.12", + "vue-line-clamp": "^1.3.2", "vue-router": "^3.0.4", "vue-scrolling-table": "^0.2.2", "vuetify": "^1.5.12", diff --git a/src/components/Class.vue b/src/components/Class.vue index cddd18de..91c83f93 100644 --- a/src/components/Class.vue +++ b/src/components/Class.vue @@ -33,16 +33,16 @@ cancel - - {{ classInfo.id }} {{ classInfo.title }} + + {{ classInfo.id }} {{ shortenedTitle }} - + @@ -74,6 +74,12 @@ diff --git a/src/utils/abbreviations.js b/src/utils/abbreviations.js new file mode 100644 index 00000000..4b052d40 --- /dev/null +++ b/src/utils/abbreviations.js @@ -0,0 +1,330 @@ +const abbreviations = { + 'and': '&', + 'i': '1', + 'ii': '2', + 'iii': '3', + 'iv': '4', + 'v': '5', + 'vi': '6', + 'undergraduate': 'undergrad', + 'materials': 'mat', + 'computer': 'comp', + + 'special': 'spec', + 'engineering': 'engin', + 'subject': 'subj', + 'science': 'sci', + 'introduction': 'intro', + 'advanced': 'adv', + 'research': 'res', + 'technology': 'tech', + 'management': 'managem', + 'studies': 'stud', + 'biology': 'bio', + 'analysis': 'anal', + 'development': 'dev', + 'history': 'hist', + 'economics': 'econ', + 'laboratory': 'lab', + 'principles': 'princ', + 'methods': 'meth', + 'sciences': 'sci', + 'architecture': 'archit', + 'writing': 'writ', + 'practice': 'pract', + 'chemistry': 'chem', + 'chemical': 'chem', + 'electrical': 'elec', + 'society': 'soc', + 'fundamentals': 'fund', + 'mechanics': 'mech', + 'biological': 'bio', + 'modern': 'mod', + 'literature': 'lit', + 'music': 'mus', + 'communication': 'communic', + 'political': 'poli', + 'politics': 'poli', + 'nuclear': 'nuc', + 'american': 'amer', + 'mechanical': 'mech', + 'public': 'pub', + 'applications': 'applic', + 'applied': 'appl', + 'system': 'syst', + 'oceanography': 'oceanogr', + 'international': 'internat', + 'philosophy': 'philos', + 'language': 'lang', + 'medical': 'med', + 'comparative': 'compar', + 'from': 'fr', + 'economic': 'econ', + 'mathematics': 'math', + 'building': 'build', + 'structural': 'struct', + 'medicine': 'med', + 'structure': 'struct', + 'geology': 'geol', + 'statistical': 'statist', + 'french': 'fr', + 'probability': 'prob', + 'spanish': 'span', + 'evolution': 'evol', + 'foundations': 'found', + 'experimental': 'exper', + 'selected': 'sel', + 'practical': 'pract', + 'manufacturing': 'manuf', + 'machine': 'mach', + 'america': 'amer', + 'architectural': 'archit', + 'contemporary': 'contemp', + 'ancient': 'anc', + 'introductory': 'introd', + 'anthropology': 'anthropol', + 'industrial': 'industr', + 'present': 'pres', + 'east': 'e', + 'mathematical': 'math', + 'latin': 'lat', + 'japanese': 'jap', + 'calculus': 'calc', + 'ecology': 'ecol', + 'regular': 'reg', + 'geometry': 'geom', + 'organic': 'org', + 'product': 'prod', + 'naval': 'nav', + 'german': 'ger', + 'composition': 'compos', + 'photography': 'photogr', + 'intelligence': 'intell', + 'microbiology': 'microbiol', + 'disease': 'dis', + 'theoretical': 'theoret', + 'future': 'fut', + 'education': 'educ', + 'work': 'wk', + 'africa': 'afr', + 'physiology': 'physiol', + 'portuguese': 'port', + 'linguistics': 'ling', + 'properties': 'prop', + 'clinical': 'clin', + 'popular': 'pop', + 'century': 'cent', + 'criticism': 'crit', + 'machines': 'mach', + 'russian': 'russ', + 'revolution': 'revol', + 'languages': 'langs', + 'good': 'gd', + 'conflict': 'confl', + 'classical': 'class', + 'natural': 'nat', + 'medieval': 'med', + 'aeronautics': 'aeronaut', + 'astronautics': 'astronaut', + 'algebra': 'alg', + 'narrative': 'narrat', + 'hydrology': 'hydrol', + 'general': 'gen', + 'artificial': 'artific', + 'measurement': 'measurem', + 'linguistic': 'ling', + 'critical': 'crit', + 'south': 's', + 'rhetoric': 'rhet', + 'magnetic': 'magn', + 'related': 'rel', + 'diseases': 'dis', + 'school': 'sch', + 'spectroscopy': 'spectrosc', + 'educational': 'educ', + 'investment': 'investm', + 'military': 'milit', + 'western': 'west', + 'advances': 'adv', + 'biochemical': 'biochem', + 'technical': 'techn', + 'immunology': 'immunol', + 'inquiry': 'inq', + 'electric': 'electr', + 'knowledge': 'knowl', + 'geometric': 'geom', + 'objects': 'obj', + 'phonology': 'phonol', + 'exploration': 'explor', + 'problem': 'probl', + 'elements': 'elem', + 'astronomy': 'astron', + 'psychology': 'psychol', + 'method': 'meth', + 'communications': 'communic', + 'shakespeare': 'shaks', + 'optics': 'opt', + 'ecological': 'ecol', + 'industry': 'ind', + 'construction': 'constr', + 'college': 'coll', + 'discovery': 'discov', + 'india': 'ind', + 'aerodynamics': 'aerodynam', + 'past': 'pa', + 'african': 'afr', + 'animals': 'anim', + 'literary': 'lit', + 'musical': 'mus', + 'memoir': 'mem', + 'metallurgy': 'metall', + 'inorganic': 'inorg', + 'biochemistry': 'biochem', + 'pathology': 'pathol', + 'philosophical': 'philos', + 'products': 'prod', + 'archaeological': 'archaeol', + 'geomorphology': 'geomorphol', + 'series': 'ser', + 'congress': 'congr', + 'number': 'no', + 'element': 'elem', + 'family': 'fam', + 'academic': 'acad', + 'english': 'eng', + 'conversation': 'conversat', + 'north': 'n', + 'anatomy': 'anat', + 'word': 'wd', + 'ceramics': 'ceram', + 'selection': 'select', + 'archaeology': 'archaeol', + 'oceanographic': 'oceanogr', + 'sociology': 'sociol', + 'geographic': 'geogr', + 'petrology': 'petrol', + 'record': 'rec', + 'seismology': 'seismol', + 'technological': 'technol', + 'essential': 'essent', + 'analytical': 'analyt', + 'navigation': 'navig', + 'historical': 'hist', + 'between': 'betw', + 'russia': 'russ', + 'year': 'yr', + 'analytic': 'analyt', + 'cryptography': 'cryptogr', + 'religion': 'relig', + 'translation': 'transl', + 'intellectual': 'intellect', + 'books': 'bks', + 'authors': 'auth', + 'museum': 'mus', + 'metaphysics': 'metaph', + 'evolutionary': 'evol', + 'affairs': 'aff', + 'reproductive': 'reprod', + 'concrete': 'concr', + 'limnology': 'limnol', + 'pharmaceutical': 'pharmaceut', + 'metropolis': 'metrop', + 'representing': 'repr', + 'against': 'agst', + 'property': 'prop', + 'scientific': 'sci', + 'great': 'gt', + 'terrestrial': 'terrestr', + 'lectures': 'lect', + 'magnetism': 'magn', + 'geological': 'geol', + 'influence': 'infl', + 'junior': 'jun', + 'constitutional': 'constit', + 'doctrine': 'doctr', + 'king': 'k', + 'traditional': 'trad', + 'works': 'wks', + 'indian': 'ind', + 'invention': 'invent', + 'pronunciation': 'pronunc', + 'italian': 'ital', + 'roman': 'rom', + 'british': 'brit', + 'interpretation': 'interpr', + 'chamber': 'chamb', + 'autobiography': 'autobiogr', + 'essay': 'ess', + 'biography': 'biogr', + 'book': 'bk', + 'apocalyptic': 'apoc', + 'dissertation': 'diss', + 'morphology': 'morphol', + 'furniture': 'furnit', + 'application': 'applic', + 'psychological': 'psychol', + 'imagination': 'imag', + 'archives': 'arch', + 'agriculture': 'agric', + 'pharmacology': 'pharmacol', + 'inventions': 'invent', + 'evaluation': 'eval', + 'assembly': 'assemb', + 'geography': 'geogr', + 'transactions': 'trans', + 'southern': 's', + 'geologic': 'geol', + 'origin': 'orig', + 'observations': 'observ', + 'hydraulic': 'hydraul', + 'tropical': 'trop', + 'meteorology': 'meteorol', + 'commerce': 'comm', + 'collective': 'collect', + 'prediction': 'predict', + 'central': 'cent', + 'fundamental': 'fund', + 'journal': 'jrnl', + 'article': 'art', + 'reflection': 'refl', + 'review': 'rev', + 'lecture': 'lect', + 'several': 'sev', + 'measure': 'meas', + 'arithmetic': 'arithm', + 'instruction': 'instr', + 'england': 'eng', + 'calligraphy': 'calligr', + 'expository': 'expos', + 'brazilian': 'braz', + 'lines': 'll', + 'west': 'w', + 'survey': 'surv', + 'tradition': 'trad', + 'saints': 'ss', + 'publication': 'publ', + 'republic': 'repub', + 'original': 'orig', + 'accounts': 'accts', + 'antiquity': 'antiq', + 'london': 'lond', + 'grammar': 'gram', + 'familiar': 'famil', + 'palaeontology': 'palaeontol', + 'meeting': 'mtg', + 'assemblies': 'assemb', + 'march': 'mar', + 'vegetable': 'veg', + 'intelligent': 'intell', + 'experiment': 'exper', + 'orders': 'ord', + 'animal': 'anim', + 'nervous': 'nerv', + 'electricity': 'electr', + 'certificate': 'certif', + 'exercise': 'exerc', + 'physiological': 'physiol', + 'company': 'comp' +}; + +export {abbreviations}; \ No newline at end of file From cd1371bfffe3c55270337b689f4099d0cc99c190 Mon Sep 17 00:00:00 2001 From: HeadMerchant Date: Thu, 9 Apr 2020 16:21:04 -0700 Subject: [PATCH 2/6] Removed Dependence on vue-line-clamp Can now specify abbreviations that won't be abbreviated by a '.' No longer using line-clamp Fixed ascender text peaking in classes w/ >4 lines --- src/components/Class.vue | 55 ++-- src/utils/abbreviations.js | 655 +++++++++++++++++++------------------ 2 files changed, 355 insertions(+), 355 deletions(-) diff --git a/src/components/Class.vue b/src/components/Class.vue index 91c83f93..528c35fc 100644 --- a/src/components/Class.vue +++ b/src/components/Class.vue @@ -74,12 +74,7 @@ @@ -155,14 +154,14 @@ export default { padding: 0; margin: .2em .4em 0em .2em; height: 100%; + overflow: hidden; } .classbox { display: flex; align-items: flex-start; height: 5.8em; /* Chosen for three lines in the card, working with the set padding and margins. */ - overflow: hidden; - padding: .2em .4em .4em .2em; + padding: .2em .4em .5em .2em; /* Multi-line truncation is not a supported feature of CSS right now. Optimally, we would have multi-line truncation within the cards, but currently extra words are clipped. diff --git a/src/utils/abbreviations.js b/src/utils/abbreviations.js index 4b052d40..27188573 100644 --- a/src/utils/abbreviations.js +++ b/src/utils/abbreviations.js @@ -1,330 +1,331 @@ +// Abbreviations starting with '|' don't receive a delimeter (eg. '.') after them +const nonAbbreviator = '|'; const abbreviations = { - 'and': '&', - 'i': '1', - 'ii': '2', - 'iii': '3', - 'iv': '4', - 'v': '5', - 'vi': '6', - 'undergraduate': 'undergrad', - 'materials': 'mat', - 'computer': 'comp', - - 'special': 'spec', - 'engineering': 'engin', - 'subject': 'subj', - 'science': 'sci', - 'introduction': 'intro', - 'advanced': 'adv', - 'research': 'res', - 'technology': 'tech', - 'management': 'managem', - 'studies': 'stud', - 'biology': 'bio', - 'analysis': 'anal', - 'development': 'dev', - 'history': 'hist', - 'economics': 'econ', - 'laboratory': 'lab', - 'principles': 'princ', - 'methods': 'meth', - 'sciences': 'sci', - 'architecture': 'archit', - 'writing': 'writ', - 'practice': 'pract', - 'chemistry': 'chem', - 'chemical': 'chem', - 'electrical': 'elec', - 'society': 'soc', - 'fundamentals': 'fund', - 'mechanics': 'mech', - 'biological': 'bio', - 'modern': 'mod', - 'literature': 'lit', - 'music': 'mus', - 'communication': 'communic', - 'political': 'poli', - 'politics': 'poli', - 'nuclear': 'nuc', - 'american': 'amer', - 'mechanical': 'mech', - 'public': 'pub', - 'applications': 'applic', - 'applied': 'appl', - 'system': 'syst', - 'oceanography': 'oceanogr', - 'international': 'internat', - 'philosophy': 'philos', - 'language': 'lang', - 'medical': 'med', - 'comparative': 'compar', - 'from': 'fr', - 'economic': 'econ', - 'mathematics': 'math', - 'building': 'build', - 'structural': 'struct', - 'medicine': 'med', - 'structure': 'struct', - 'geology': 'geol', - 'statistical': 'statist', - 'french': 'fr', - 'probability': 'prob', - 'spanish': 'span', - 'evolution': 'evol', - 'foundations': 'found', - 'experimental': 'exper', - 'selected': 'sel', - 'practical': 'pract', - 'manufacturing': 'manuf', - 'machine': 'mach', - 'america': 'amer', - 'architectural': 'archit', - 'contemporary': 'contemp', - 'ancient': 'anc', - 'introductory': 'introd', - 'anthropology': 'anthropol', - 'industrial': 'industr', - 'present': 'pres', - 'east': 'e', - 'mathematical': 'math', - 'latin': 'lat', - 'japanese': 'jap', - 'calculus': 'calc', - 'ecology': 'ecol', - 'regular': 'reg', - 'geometry': 'geom', - 'organic': 'org', - 'product': 'prod', - 'naval': 'nav', - 'german': 'ger', - 'composition': 'compos', - 'photography': 'photogr', - 'intelligence': 'intell', - 'microbiology': 'microbiol', - 'disease': 'dis', - 'theoretical': 'theoret', - 'future': 'fut', - 'education': 'educ', - 'work': 'wk', - 'africa': 'afr', - 'physiology': 'physiol', - 'portuguese': 'port', - 'linguistics': 'ling', - 'properties': 'prop', - 'clinical': 'clin', - 'popular': 'pop', - 'century': 'cent', - 'criticism': 'crit', - 'machines': 'mach', - 'russian': 'russ', - 'revolution': 'revol', - 'languages': 'langs', - 'good': 'gd', - 'conflict': 'confl', - 'classical': 'class', - 'natural': 'nat', - 'medieval': 'med', - 'aeronautics': 'aeronaut', - 'astronautics': 'astronaut', - 'algebra': 'alg', - 'narrative': 'narrat', - 'hydrology': 'hydrol', - 'general': 'gen', - 'artificial': 'artific', - 'measurement': 'measurem', - 'linguistic': 'ling', - 'critical': 'crit', - 'south': 's', - 'rhetoric': 'rhet', - 'magnetic': 'magn', - 'related': 'rel', - 'diseases': 'dis', - 'school': 'sch', - 'spectroscopy': 'spectrosc', - 'educational': 'educ', - 'investment': 'investm', - 'military': 'milit', - 'western': 'west', - 'advances': 'adv', - 'biochemical': 'biochem', - 'technical': 'techn', - 'immunology': 'immunol', - 'inquiry': 'inq', - 'electric': 'electr', - 'knowledge': 'knowl', - 'geometric': 'geom', - 'objects': 'obj', - 'phonology': 'phonol', - 'exploration': 'explor', - 'problem': 'probl', - 'elements': 'elem', - 'astronomy': 'astron', - 'psychology': 'psychol', - 'method': 'meth', - 'communications': 'communic', - 'shakespeare': 'shaks', - 'optics': 'opt', - 'ecological': 'ecol', - 'industry': 'ind', - 'construction': 'constr', - 'college': 'coll', - 'discovery': 'discov', - 'india': 'ind', - 'aerodynamics': 'aerodynam', - 'past': 'pa', - 'african': 'afr', - 'animals': 'anim', - 'literary': 'lit', - 'musical': 'mus', - 'memoir': 'mem', - 'metallurgy': 'metall', - 'inorganic': 'inorg', - 'biochemistry': 'biochem', - 'pathology': 'pathol', - 'philosophical': 'philos', - 'products': 'prod', - 'archaeological': 'archaeol', - 'geomorphology': 'geomorphol', - 'series': 'ser', - 'congress': 'congr', - 'number': 'no', - 'element': 'elem', - 'family': 'fam', - 'academic': 'acad', - 'english': 'eng', - 'conversation': 'conversat', - 'north': 'n', - 'anatomy': 'anat', - 'word': 'wd', - 'ceramics': 'ceram', - 'selection': 'select', - 'archaeology': 'archaeol', - 'oceanographic': 'oceanogr', - 'sociology': 'sociol', - 'geographic': 'geogr', - 'petrology': 'petrol', - 'record': 'rec', - 'seismology': 'seismol', - 'technological': 'technol', - 'essential': 'essent', - 'analytical': 'analyt', - 'navigation': 'navig', - 'historical': 'hist', - 'between': 'betw', - 'russia': 'russ', - 'year': 'yr', - 'analytic': 'analyt', - 'cryptography': 'cryptogr', - 'religion': 'relig', - 'translation': 'transl', - 'intellectual': 'intellect', - 'books': 'bks', - 'authors': 'auth', - 'museum': 'mus', - 'metaphysics': 'metaph', - 'evolutionary': 'evol', - 'affairs': 'aff', - 'reproductive': 'reprod', - 'concrete': 'concr', - 'limnology': 'limnol', - 'pharmaceutical': 'pharmaceut', - 'metropolis': 'metrop', - 'representing': 'repr', - 'against': 'agst', - 'property': 'prop', - 'scientific': 'sci', - 'great': 'gt', - 'terrestrial': 'terrestr', - 'lectures': 'lect', - 'magnetism': 'magn', - 'geological': 'geol', - 'influence': 'infl', - 'junior': 'jun', - 'constitutional': 'constit', - 'doctrine': 'doctr', - 'king': 'k', - 'traditional': 'trad', - 'works': 'wks', - 'indian': 'ind', - 'invention': 'invent', - 'pronunciation': 'pronunc', - 'italian': 'ital', - 'roman': 'rom', - 'british': 'brit', - 'interpretation': 'interpr', - 'chamber': 'chamb', - 'autobiography': 'autobiogr', - 'essay': 'ess', - 'biography': 'biogr', - 'book': 'bk', - 'apocalyptic': 'apoc', - 'dissertation': 'diss', - 'morphology': 'morphol', - 'furniture': 'furnit', - 'application': 'applic', - 'psychological': 'psychol', - 'imagination': 'imag', - 'archives': 'arch', - 'agriculture': 'agric', - 'pharmacology': 'pharmacol', - 'inventions': 'invent', - 'evaluation': 'eval', - 'assembly': 'assemb', - 'geography': 'geogr', - 'transactions': 'trans', - 'southern': 's', - 'geologic': 'geol', - 'origin': 'orig', - 'observations': 'observ', - 'hydraulic': 'hydraul', - 'tropical': 'trop', - 'meteorology': 'meteorol', - 'commerce': 'comm', - 'collective': 'collect', - 'prediction': 'predict', - 'central': 'cent', - 'fundamental': 'fund', - 'journal': 'jrnl', - 'article': 'art', - 'reflection': 'refl', - 'review': 'rev', - 'lecture': 'lect', - 'several': 'sev', - 'measure': 'meas', - 'arithmetic': 'arithm', - 'instruction': 'instr', - 'england': 'eng', - 'calligraphy': 'calligr', - 'expository': 'expos', - 'brazilian': 'braz', - 'lines': 'll', - 'west': 'w', - 'survey': 'surv', - 'tradition': 'trad', - 'saints': 'ss', - 'publication': 'publ', - 'republic': 'repub', - 'original': 'orig', - 'accounts': 'accts', - 'antiquity': 'antiq', - 'london': 'lond', - 'grammar': 'gram', - 'familiar': 'famil', - 'palaeontology': 'palaeontol', - 'meeting': 'mtg', - 'assemblies': 'assemb', - 'march': 'mar', - 'vegetable': 'veg', - 'intelligent': 'intell', - 'experiment': 'exper', - 'orders': 'ord', - 'animal': 'anim', - 'nervous': 'nerv', - 'electricity': 'electr', - 'certificate': 'certif', - 'exercise': 'exerc', - 'physiological': 'physiol', - 'company': 'comp' + 'and': nonAbbreviator + '&', + 'i': nonAbbreviator + '1', + 'ii': nonAbbreviator + '2', + 'iii': nonAbbreviator + '3', + 'iv': nonAbbreviator + '4', + 'v': nonAbbreviator + '5', + 'vi': nonAbbreviator + '6', + 'undergraduate': 'undergrad', + 'materials': 'mat', + 'computer': 'comp', + 'special': 'spec', + 'engineering': 'engin', + 'subject': 'subj', + 'science': 'sci', + 'introduction': 'intro', + 'advanced': 'adv', + 'research': 'res', + 'technology': 'tech', + 'management': 'managem', + 'studies': 'stud', + 'biology': 'bio', + 'analysis': 'anal', + 'development': 'dev', + 'history': 'hist', + 'economics': 'econ', + 'laboratory': 'lab', + 'principles': 'princ', + 'methods': 'meth', + 'sciences': 'sci', + 'architecture': 'archit', + 'writing': 'writ', + 'practice': 'pract', + 'chemistry': 'chem', + 'chemical': 'chem', + 'electrical': 'elec', + 'society': 'soc', + 'fundamentals': 'fund', + 'mechanics': 'mech', + 'biological': 'bio', + 'modern': 'mod', + 'literature': 'lit', + 'music': 'mus', + 'communication': 'communic', + 'political': 'poli', + 'politics': 'poli', + 'nuclear': 'nuc', + 'american': 'amer', + 'mechanical': 'mech', + 'public': 'pub', + 'applications': 'applic', + 'applied': 'appl', + 'system': 'syst', + 'oceanography': 'oceanogr', + 'international': 'internat', + 'philosophy': 'philos', + 'language': 'lang', + 'medical': 'med', + 'comparative': 'compar', + 'from': 'fr', + 'economic': 'econ', + 'mathematics': 'math', + 'building': 'build', + 'structural': 'struct', + 'medicine': 'med', + 'structure': 'struct', + 'geology': 'geol', + 'statistical': 'statist', + 'french': 'fr', + 'probability': 'prob', + 'spanish': 'span', + 'evolution': 'evol', + 'foundations': 'found', + 'experimental': 'exper', + 'selected': 'sel', + 'practical': 'pract', + 'manufacturing': 'manuf', + 'machine': 'mach', + 'america': 'amer', + 'architectural': 'archit', + 'contemporary': 'contemp', + 'ancient': 'anc', + 'introductory': 'introd', + 'anthropology': 'anthropol', + 'industrial': 'industr', + 'present': 'pres', + 'east': 'e', + 'mathematical': 'math', + 'latin': 'lat', + 'japanese': 'jap', + 'calculus': 'calc', + 'ecology': 'ecol', + 'regular': 'reg', + 'geometry': 'geom', + 'organic': 'org', + 'product': 'prod', + 'naval': 'nav', + 'german': 'ger', + 'composition': 'compos', + 'photography': 'photogr', + 'intelligence': 'intell', + 'microbiology': 'microbiol', + 'disease': 'dis', + 'theoretical': 'theoret', + 'future': 'fut', + 'education': 'educ', + 'work': 'wk', + 'africa': 'afr', + 'physiology': 'physiol', + 'portuguese': 'port', + 'linguistics': 'ling', + 'properties': 'prop', + 'clinical': 'clin', + 'popular': 'pop', + 'century': 'cent', + 'criticism': 'crit', + 'machines': 'mach', + 'russian': 'russ', + 'revolution': 'revol', + 'languages': 'langs', + 'good': 'gd', + 'conflict': 'confl', + 'classical': 'class', + 'natural': 'nat', + 'medieval': 'med', + 'aeronautics': 'aeronaut', + 'astronautics': 'astronaut', + 'algebra': 'alg', + 'narrative': 'narrat', + 'hydrology': 'hydrol', + 'general': 'gen', + 'artificial': 'artific', + 'measurement': 'measurem', + 'linguistic': 'ling', + 'critical': 'crit', + 'south': 's', + 'rhetoric': 'rhet', + 'magnetic': 'magn', + 'related': 'rel', + 'diseases': 'dis', + 'school': 'sch', + 'spectroscopy': 'spectrosc', + 'educational': 'educ', + 'investment': 'investm', + 'military': 'milit', + 'western': 'west', + 'advances': 'adv', + 'biochemical': 'biochem', + 'technical': 'techn', + 'immunology': 'immunol', + 'inquiry': 'inq', + 'electric': 'electr', + 'knowledge': 'knowl', + 'geometric': 'geom', + 'objects': 'obj', + 'phonology': 'phonol', + 'exploration': 'explor', + 'problem': 'probl', + 'elements': 'elem', + 'astronomy': 'astron', + 'psychology': 'psychol', + 'method': 'meth', + 'communications': 'communic', + 'shakespeare': 'shaks', + 'optics': 'opt', + 'ecological': 'ecol', + 'industry': 'ind', + 'construction': 'constr', + 'college': 'coll', + 'discovery': 'discov', + 'india': 'ind', + 'aerodynamics': 'aerodynam', + 'past': 'pa', + 'african': 'afr', + 'animals': 'anim', + 'literary': 'lit', + 'musical': 'mus', + 'memoir': 'mem', + 'metallurgy': 'metall', + 'inorganic': 'inorg', + 'biochemistry': 'biochem', + 'pathology': 'pathol', + 'philosophical': 'philos', + 'products': 'prod', + 'archaeological': 'archaeol', + 'geomorphology': 'geomorphol', + 'series': 'ser', + 'congress': 'congr', + 'number': 'no', + 'element': 'elem', + 'family': 'fam', + 'academic': 'acad', + 'english': 'eng', + 'conversation': 'conversat', + 'north': 'n', + 'anatomy': 'anat', + 'word': 'wd', + 'ceramics': 'ceram', + 'selection': 'select', + 'archaeology': 'archaeol', + 'oceanographic': 'oceanogr', + 'sociology': 'sociol', + 'geographic': 'geogr', + 'petrology': 'petrol', + 'record': 'rec', + 'seismology': 'seismol', + 'technological': 'technol', + 'essential': 'essent', + 'analytical': 'analyt', + 'navigation': 'navig', + 'historical': 'hist', + 'between': 'betw', + 'russia': 'russ', + 'year': 'yr', + 'analytic': 'analyt', + 'cryptography': 'cryptogr', + 'religion': 'relig', + 'translation': 'transl', + 'intellectual': 'intellect', + 'books': 'bks', + 'authors': 'auth', + 'museum': 'mus', + 'metaphysics': 'metaph', + 'evolutionary': 'evol', + 'affairs': 'aff', + 'reproductive': 'reprod', + 'concrete': 'concr', + 'limnology': 'limnol', + 'pharmaceutical': 'pharmaceut', + 'metropolis': 'metrop', + 'representing': 'repr', + 'against': 'agst', + 'property': 'prop', + 'scientific': 'sci', + 'great': 'gt', + 'terrestrial': 'terrestr', + 'lectures': 'lect', + 'magnetism': 'magn', + 'geological': 'geol', + 'influence': 'infl', + 'junior': 'jun', + 'constitutional': 'constit', + 'doctrine': 'doctr', + 'king': 'k', + 'traditional': 'trad', + 'works': 'wks', + 'indian': 'ind', + 'invention': 'invent', + 'pronunciation': 'pronunc', + 'italian': 'ital', + 'roman': 'rom', + 'british': 'brit', + 'interpretation': 'interpr', + 'chamber': 'chamb', + 'autobiography': 'autobiogr', + 'essay': 'ess', + 'biography': 'biogr', + 'book': 'bk', + 'apocalyptic': 'apoc', + 'dissertation': 'diss', + 'morphology': 'morphol', + 'furniture': 'furnit', + 'application': 'applic', + 'psychological': 'psychol', + 'imagination': 'imag', + 'archives': 'arch', + 'agriculture': 'agric', + 'pharmacology': 'pharmacol', + 'inventions': 'invent', + 'evaluation': 'eval', + 'assembly': 'assemb', + 'geography': 'geogr', + 'transactions': 'trans', + 'southern': 's', + 'geologic': 'geol', + 'origin': 'orig', + 'observations': 'observ', + 'hydraulic': 'hydraul', + 'tropical': 'trop', + 'meteorology': 'meteorol', + 'commerce': 'comm', + 'collective': 'collect', + 'prediction': 'predict', + 'central': 'cent', + 'fundamental': 'fund', + 'journal': 'jrnl', + 'article': 'art', + 'reflection': 'refl', + 'review': 'rev', + 'lecture': 'lect', + 'several': 'sev', + 'measure': 'meas', + 'arithmetic': 'arithm', + 'instruction': 'instr', + 'england': 'eng', + 'calligraphy': 'calligr', + 'expository': 'expos', + 'brazilian': 'braz', + 'lines': 'll', + 'west': 'w', + 'survey': 'surv', + 'tradition': 'trad', + 'saints': 'ss', + 'publication': 'publ', + 'republic': 'repub', + 'original': 'orig', + 'accounts': 'accts', + 'antiquity': 'antiq', + 'london': 'lond', + 'grammar': 'gram', + 'familiar': 'famil', + 'palaeontology': 'palaeontol', + 'meeting': 'mtg', + 'assemblies': 'assemb', + 'march': 'mar', + 'vegetable': 'veg', + 'intelligent': 'intell', + 'experiment': 'exper', + 'orders': 'ord', + 'animal': 'anim', + 'nervous': 'nerv', + 'electricity': 'electr', + 'certificate': 'certif', + 'exercise': 'exerc', + 'physiological': 'physiol', + 'company': 'comp' }; -export {abbreviations}; \ No newline at end of file +export { abbreviations, nonAbbreviator }; From 221828ce790fc1679c3de1c82a9f19315c460821 Mon Sep 17 00:00:00 2001 From: HeadMerchant Date: Thu, 9 Apr 2020 19:35:36 -0700 Subject: [PATCH 3/6] Smart Truncation Shortened titles now only appear when the longer title would be truncated Uses modified version of vue-line-clamp based on https://github.com/AndyDyer/vue-line-clamp/tree/add-options-change-fallback-logic --- src/components/Class.vue | 11 +++-- src/utils/vue-line-clamp.js | 89 +++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 src/utils/vue-line-clamp.js diff --git a/src/components/Class.vue b/src/components/Class.vue index 528c35fc..48e44e57 100644 --- a/src/components/Class.vue +++ b/src/components/Class.vue @@ -33,8 +33,8 @@ cancel - - {{ classInfo.id }} {{ shortenedTitle }} + + {{ classInfo.id }} {{ useShortenedTitle ? shortenedTitle : classInfo.title }} @@ -75,6 +75,10 @@