diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 606e98736..e90270a40 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -348,20 +348,11 @@ define([ maxwidth = (this.initConfig.maxwidth) ? this.initConfig.maxwidth : main_width, maxheight = (this.initConfig.maxheight) ? this.initConfig.maxheight : main_height; - if (this.resizing.type[0]>0) { - this.resizing.maxx = Math.min(main_width, left+maxwidth); - this.resizing.minx = left+this.initConfig.minwidth; - } else if (this.resizing.type[0]<0) { - this.resizing.maxx = left+this.resizing.initw-this.initConfig.minwidth; - this.resizing.minx = Math.max(0, left+this.resizing.initw-maxwidth); - } - if (this.resizing.type[1]>0) { - this.resizing.maxy = Math.min(main_height, top+maxheight); - this.resizing.miny = top+this.initConfig.minheight; - } else if (this.resizing.type[1]<0) { - this.resizing.maxy = top+this.resizing.inith-this.initConfig.minheight; - this.resizing.miny = Math.max(0, top+this.resizing.inith-maxheight); - } + this.resizing.minw = this.initConfig.minwidth; + this.resizing.maxw = (this.resizing.type[0]>0) ? Math.min(main_width-left, maxwidth) : Math.min(left+this.resizing.initw, maxwidth); + + this.resizing.minh = this.initConfig.minheight; + this.resizing.maxh = (this.resizing.type[1]>0) ? Math.min(main_height-top, maxheight) : Math.min(top+this.resizing.inith, maxheight); $(document.body).css('cursor', el.css('cursor')); this.$window.find('.resize-border').addClass('resizing'); @@ -378,16 +369,34 @@ define([ zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1, pageX = event.pageX*zoom, pageY = event.pageY*zoom; - if (this.resizing.type[0] && pageXthis.resizing.minx) { + if (this.resizing.type[0]) { + var new_width = this.resizing.initw + (pageX - this.resizing.initpage_x) * this.resizing.type[0]; + if (new_width>this.resizing.maxw) { + pageX = pageX - (new_width-this.resizing.maxw) * this.resizing.type[0]; + new_width = this.resizing.maxw; + } else if (new_widththis.resizing.miny) { + if (this.resizing.type[1]) { + var new_height = this.resizing.inith + (pageY - this.resizing.initpage_y) * this.resizing.type[1]; + if (new_height>this.resizing.maxh) { + pageY = pageY - (new_height-this.resizing.maxh) * this.resizing.type[1]; + new_height = this.resizing.maxh; + } else if (new_height= _end) + return null; + + while (_start < _end) + { + var _center = (_start + _end) >> 1; + var _range = _array[_center]; + + if (_range.Start > _char) + _end = _center - 1; + else if (_range.End < _char) + _start = _center + 1; + else + return _array[_center]; + } + + if (_start > _end) + return null; + + _range = _array[_start]; + if (_range.Start > _char || _range.End < _char) + return null; + + return _array[_start]; + } + + window.getSupportedFonts = function(_char) + { + var _range = getRangeBySymbol(_char, c_oUnicodeRanges); + return window.getSupportedFontsByRange(_range); + }; + + window.getSupportedFontsByRange = function(_range) + { + if (null == _range) + return []; + + var _system_fonts = AscFonts.g_fontApplication.g_fontSelections.List; + var _count = _system_fonts.length; + + var _retArray = []; + + for (var j = 0; j < _count; j++) + { + var _select = _system_fonts[j]; + + var _param = _range.Param; + + if (_param[0] != (_select.m_ulUnicodeRange1 & _param[0])) + continue; + + if (_param[1] != (_select.m_ulUnicodeRange2 & _param[1])) + continue; + + if (_param[2] != (_select.m_ulUnicodeRange3 & _param[2])) + continue; + + if (_param[3] != (_select.m_ulUnicodeRange4 & _param[3])) + continue; + + if (_range.Name == c_oUnicodeRangesLID.CJK_Unified_Ideographs) + { + if (0 == (_select.m_ulCodePageRange1 & _param[4])) + continue; + } + else + { + if (_param[4] != (_select.m_ulCodePageRange1 & _param[4])) + continue; + } + + if (_param[5] != (_select.m_ulCodePageRange2 & _param[5])) + continue; + + _retArray.push(_select.m_wsFontName); + } + + return _retArray; + }; + + window.getSupportedRangesByFont = function(_select) + { + var _ret = []; + for(var i = 0; i < c_oUnicodeRanges.length; ++i) + { + var _range = c_oUnicodeRanges[i]; + var _param = _range.Param; + if (_param[0] != (_select.m_ulUnicodeRange1 & _param[0])) + continue; + + if (_param[1] != (_select.m_ulUnicodeRange2 & _param[1])) + continue; + + if (_param[2] != (_select.m_ulUnicodeRange3 & _param[2])) + continue; + + if (_param[3] != (_select.m_ulUnicodeRange4 & _param[3])) + continue; + + /*if (_range.Name == c_oUnicodeRangesLID.CJK_Unified_Ideographs) + { + if (0 == (_select.m_ulCodePageRange1 & _param[4])) + continue; + } + else + { + if (_param[4] != (_select.m_ulCodePageRange1 & _param[4])) + continue; + }*/ + + + if (_param[4] != (_select.m_ulCodePageRange1 & _param[4])) + continue; + + if (_param[5] != (_select.m_ulCodePageRange2 & _param[5])) + continue; + _ret.push(_range); + } + + if(_ret.length === 0) + { + _ret.push(new CRange(0x0020, 0x007E, c_oUnicodeRangesLID.Basic_Latin, lcid_enUS, [(1 << c_oUnicodeRangeOS2_1.Basic_Latin), 0, 0, 0, (1 << c_oCodePagesOS2_1.Latin_1), 0])); + _ret.push(new CRange(0x00A0, 0x00FF, c_oUnicodeRangesLID.Latin_1_Supplement, lcid_unknown, [(1 << c_oUnicodeRangeOS2_1.Basic_Latin) | (1 << c_oUnicodeRangeOS2_1.Latin_1_Supplement), 0, 0, 0, (1 << c_oCodePagesOS2_1.Latin_1), 0])); + } + return _ret; + }; +})(window); \ No newline at end of file diff --git a/apps/common/main/lib/view/SymbolTableDialog.js b/apps/common/main/lib/view/SymbolTableDialog.js new file mode 100644 index 000000000..e8eea6645 --- /dev/null +++ b/apps/common/main/lib/view/SymbolTableDialog.js @@ -0,0 +1,1333 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2019 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * SymbolTableDialog.js + * + * Created by Julia Radzhabova on 07.11.2019 + * Copyright (c) 2019 Ascensio System SIA. All rights reserved. + * + */ +if (Common === undefined) + var Common = {}; +define([ + 'common/main/lib/util/utils', + 'common/main/lib/util/character', + 'common/main/lib/component/InputField', + 'common/main/lib/component/Window' +], function () { 'use strict'; + + var oRangeNames = {}; + oRangeNames[1] = 'Basic Latin'; + oRangeNames[2] = 'Latin 1 Supplement'; + oRangeNames[3] = 'Latin Extended A'; + oRangeNames[4] = 'Latin Extended B'; + oRangeNames[5] = 'IPA Extensions'; + oRangeNames[6] = 'Spacing Modifier Letters'; + oRangeNames[7] = 'Combining Diacritical Marks'; + oRangeNames[8] = 'Greek and Coptic'; + oRangeNames[9] = 'Cyrillic'; + oRangeNames[10] = 'Cyrillic Supplement'; + oRangeNames[11] = 'Armenian'; + oRangeNames[12] = 'Hebrew'; + oRangeNames[13] = 'Arabic'; + oRangeNames[14] = 'Syriac'; + oRangeNames[15] = 'Arabic Supplement'; + oRangeNames[16] = 'Thaana'; + oRangeNames[17] = 'NKo'; + oRangeNames[18] = 'Samaritan'; + oRangeNames[19] = 'Mandaic'; + oRangeNames[20] = 'Arabic Extended A'; + oRangeNames[21] = 'Devanagari'; + oRangeNames[22] = 'Bengali'; + oRangeNames[23] = 'Gurmukhi'; + oRangeNames[24] = 'Gujarati'; + oRangeNames[25] = 'Oriya'; + oRangeNames[26] = 'Tamil'; + oRangeNames[27] = 'Telugu'; + oRangeNames[28] = 'Kannada'; + oRangeNames[29] = 'Malayalam'; + oRangeNames[30] = 'Sinhala'; + oRangeNames[31] = 'Thai'; + oRangeNames[32] = 'Lao'; + oRangeNames[33] = 'Tibetan'; + oRangeNames[34] = 'Myanmar'; + oRangeNames[35] = 'Georgian'; + oRangeNames[36] = 'Hangul Jamo'; + oRangeNames[37] = 'Ethiopic'; + oRangeNames[38] = 'Ethiopic Supplement'; + oRangeNames[39] = 'Cherokee'; + oRangeNames[40] = 'Unified Canadian Aboriginal Syllabics'; + oRangeNames[41] = 'Ogham'; + oRangeNames[42] = 'Runic'; + oRangeNames[43] = 'Tagalog'; + oRangeNames[44] = 'Hanunoo'; + oRangeNames[45] = 'Buhid'; + oRangeNames[46] = 'Tagbanwa'; + oRangeNames[47] = 'Khmer'; + oRangeNames[48] = 'Mongolian'; + oRangeNames[49] = 'Unified Canadian Aboriginal Syllabics Extended'; + oRangeNames[50] = 'Limbu'; + oRangeNames[51] = 'Tai Le'; + oRangeNames[52] = 'New Tai Lue'; + oRangeNames[53] = 'Khmer Symbols'; + oRangeNames[54] = 'Buginese'; + oRangeNames[55] = 'Tai Tham'; + oRangeNames[56] = 'Combining Diacritical Marks Extended'; + oRangeNames[57] = 'Balinese'; + oRangeNames[58] = 'Sundanese'; + oRangeNames[59] = 'Batak'; + oRangeNames[60] = 'Lepcha'; + oRangeNames[61] = 'Ol Chiki'; + oRangeNames[62] = 'Cyrillic Extended C'; + oRangeNames[63] = 'Sundanese Supplement'; + oRangeNames[64] = 'Vedic Extensions'; + oRangeNames[65] = 'Phonetic Extensions'; + oRangeNames[66] = 'Phonetic Extensions Supplement'; + oRangeNames[67] = 'Combining Diacritical Marks Supplement'; + oRangeNames[68] = 'Latin Extended Additional'; + oRangeNames[69] = 'Greek Extended'; + oRangeNames[70] = 'General Punctuation'; + oRangeNames[71] = 'Superscripts and Subscripts'; + oRangeNames[72] = 'Currency Symbols'; + oRangeNames[73] = 'Combining Diacritical Marks for Symbols'; + oRangeNames[74] = 'Letterlike Symbols'; + oRangeNames[75] = 'Number Forms'; + oRangeNames[76] = 'Arrows'; + oRangeNames[77] = 'Mathematical Operators'; + oRangeNames[78] = 'Miscellaneous Technical'; + oRangeNames[79] = 'Control Pictures'; + oRangeNames[80] = 'Optical Character Recognition'; + oRangeNames[81] = 'Enclosed Alphanumerics'; + oRangeNames[82] = 'Box Drawing'; + oRangeNames[83] = 'Block Elements'; + oRangeNames[84] = 'Geometric Shapes'; + oRangeNames[85] = 'Miscellaneous Symbols'; + oRangeNames[86] = 'Dingbats'; + oRangeNames[87] = 'Miscellaneous Mathematical Symbols A'; + oRangeNames[88] = 'Supplemental Arrows A'; + oRangeNames[89] = 'Braille Patterns'; + oRangeNames[90] = 'Supplemental Arrows B'; + oRangeNames[91] = 'Miscellaneous Mathematical Symbols B'; + oRangeNames[92] = 'Supplemental Mathematical Operators'; + oRangeNames[93] = 'Miscellaneous Symbols and Arrows'; + oRangeNames[94] = 'Glagolitic'; + oRangeNames[95] = 'Latin Extended C'; + oRangeNames[96] = 'Coptic'; + oRangeNames[97] = 'Georgian Supplement'; + oRangeNames[98] = 'Tifinagh'; + oRangeNames[99] = 'Ethiopic Extended'; + oRangeNames[100] = 'Cyrillic Extended A'; + oRangeNames[101] = 'Supplemental Punctuation'; + oRangeNames[102] = 'CJK Radicals Supplement'; + oRangeNames[103] = 'Kangxi Radicals'; + oRangeNames[104] = 'Ideographic Description Characters'; + oRangeNames[105] = 'CJK Symbols and Punctuation'; + oRangeNames[106] = 'Hiragana'; + oRangeNames[107] = 'Katakana'; + oRangeNames[108] = 'Bopomofo'; + oRangeNames[109] = 'Hangul Compatibility Jamo'; + oRangeNames[110] = 'Kanbun'; + oRangeNames[111] = 'Bopomofo Extended'; + oRangeNames[112] = 'CJK Strokes'; + oRangeNames[113] = 'Katakana Phonetic Extensions'; + oRangeNames[114] = 'Enclosed CJK Letters and Months'; + oRangeNames[115] = 'CJK Compatibility'; + oRangeNames[116] = 'CJK Unified Ideographs Extension'; + oRangeNames[117] = 'Yijing Hexagram Symbols'; + oRangeNames[118] = 'CJK Unified Ideographs'; + oRangeNames[119] = 'Yi Syllables'; + oRangeNames[120] = 'Yi Radicals'; + oRangeNames[121] = 'Lisu'; + oRangeNames[122] = 'Vai'; + oRangeNames[123] = 'Cyrillic Extended B'; + oRangeNames[124] = 'Bamum'; + oRangeNames[125] = 'Modifier Tone Letters'; + oRangeNames[126] = 'Latin Extended D'; + oRangeNames[127] = 'Syloti Nagri'; + oRangeNames[128] = 'Common Indic Number Forms'; + oRangeNames[129] = 'Phags pa'; + oRangeNames[130] = 'Saurashtra'; + oRangeNames[131] = 'Devanagari Extended'; + oRangeNames[132] = 'Kayah Li'; + oRangeNames[133] = 'Rejang'; + oRangeNames[134] = 'Hangul Jamo Extended A'; + oRangeNames[135] = 'Javanese'; + oRangeNames[136] = 'Myanmar Extended B'; + oRangeNames[137] = 'Cham'; + oRangeNames[138] = 'Myanmar Extended A'; + oRangeNames[139] = 'Tai Viet'; + oRangeNames[140] = 'Meetei Mayek Extensions'; + oRangeNames[141] = 'Ethiopic Extended A'; + oRangeNames[142] = 'Latin Extended E'; + oRangeNames[143] = 'Cherokee Supplement'; + oRangeNames[144] = 'Meetei Mayek'; + oRangeNames[145] = 'Hangul Syllables'; + oRangeNames[146] = 'Hangul Jamo Extended B'; + oRangeNames[147] = 'High Surrogates'; + oRangeNames[148] = 'High Private Use Surrogates'; + oRangeNames[149] = 'Low Surrogates'; + oRangeNames[150] = 'Private Use Area'; + oRangeNames[151] = 'CJK Compatibility Ideographs'; + oRangeNames[152] = 'Alphabetic Presentation Forms'; + oRangeNames[153] = 'Arabic Presentation Forms A'; + oRangeNames[154] = 'Variation Selectors'; + oRangeNames[155] = 'Vertical Forms'; + oRangeNames[156] = 'Combining Half Marks'; + oRangeNames[157] = 'CJK Compatibility Forms'; + oRangeNames[158] = 'Small Form Variants'; + oRangeNames[159] = 'Arabic Presentation Forms B'; + oRangeNames[160] = 'Halfwidth and Fullwidth Forms'; + oRangeNames[161] = 'Specials'; + oRangeNames[162] = 'Linear B Syllabary'; + oRangeNames[163] = 'Linear B Ideograms'; + oRangeNames[164] = 'Aegean Numbers'; + oRangeNames[165] = 'Ancient Greek Numbers'; + oRangeNames[166] = 'Ancient Symbols'; + oRangeNames[167] = 'Phaistos Disc'; + oRangeNames[168] = 'Lycian'; + oRangeNames[169] = 'Carian'; + oRangeNames[170] = 'Coptic Epact Numbers'; + oRangeNames[171] = 'Old Italic'; + oRangeNames[172] = 'Gothic'; + oRangeNames[173] = 'Old Permic'; + oRangeNames[174] = 'Ugaritic'; + oRangeNames[175] = 'Old Persian'; + oRangeNames[176] = 'Deseret'; + oRangeNames[177] = 'Shavian'; + oRangeNames[178] = 'Osmanya'; + oRangeNames[179] = 'Osage'; + oRangeNames[180] = 'Elbasan'; + oRangeNames[181] = 'Caucasian Albanian'; + oRangeNames[182] = 'Linear A'; + oRangeNames[183] = 'Cypriot Syllabary'; + oRangeNames[184] = 'Imperial Aramaic'; + oRangeNames[185] = 'Palmyrene'; + oRangeNames[186] = 'Nabataean'; + oRangeNames[187] = 'Hatran'; + oRangeNames[188] = 'Phoenician'; + oRangeNames[189] = 'Lydian'; + oRangeNames[190] = 'Meroitic Hieroglyphs'; + oRangeNames[191] = 'Meroitic Cursive'; + oRangeNames[192] = 'Kharoshthi'; + oRangeNames[193] = 'Old South Arabian'; + oRangeNames[194] = 'Old North Arabian'; + oRangeNames[195] = 'Manichaean'; + oRangeNames[196] = 'Avestan'; + oRangeNames[197] = 'Inscriptional Parthian'; + oRangeNames[198] = 'Inscriptional Pahlavi'; + oRangeNames[199] = 'Psalter Pahlavi'; + oRangeNames[200] = 'Old Turkic'; + oRangeNames[201] = 'Old Hungarian'; + oRangeNames[202] = 'Rumi Numeral Symbols'; + oRangeNames[203] = 'Brahmi'; + oRangeNames[204] = 'Kaithi'; + oRangeNames[205] = 'Sora Sompeng'; + oRangeNames[206] = 'Chakma'; + oRangeNames[207] = 'Mahajani'; + oRangeNames[208] = 'Sharada'; + oRangeNames[209] = 'Sinhala Archaic Numbers'; + oRangeNames[210] = 'Khojki'; + oRangeNames[211] = 'Multani'; + oRangeNames[212] = 'Khudawadi'; + oRangeNames[213] = 'Grantha'; + oRangeNames[214] = 'Newa'; + oRangeNames[215] = 'Tirhuta'; + oRangeNames[216] = 'Siddham'; + oRangeNames[217] = 'Modi'; + oRangeNames[218] = 'Mongolian Supplement'; + oRangeNames[219] = 'Takri'; + oRangeNames[220] = 'Ahom'; + oRangeNames[221] = 'Warang Citi'; + oRangeNames[222] = 'Pau Cin Hau'; + oRangeNames[223] = 'Bhaiksuki'; + oRangeNames[224] = 'Marchen'; + oRangeNames[225] = 'Cuneiform'; + oRangeNames[226] = 'Cuneiform Numbers and Punctuation'; + oRangeNames[227] = 'Early Dynastic Cuneiform'; + oRangeNames[228] = 'Egyptian Hieroglyphs'; + oRangeNames[229] = 'Anatolian Hieroglyphs'; + oRangeNames[230] = 'Bamum Supplement'; + oRangeNames[231] = 'Mro'; + oRangeNames[232] = 'Bassa Vah'; + oRangeNames[233] = 'Pahawh Hmong'; + oRangeNames[234] = 'Miao'; + oRangeNames[235] = 'Ideographic Symbols and Punctuation'; + oRangeNames[236] = 'Tangut'; + oRangeNames[237] = 'Tangut Components'; + oRangeNames[238] = 'Kana Supplement'; + oRangeNames[239] = 'Duployan'; + oRangeNames[240] = 'Shorthand Format Controls'; + oRangeNames[241] = 'Byzantine Musical Symbols'; + oRangeNames[242] = 'Musical Symbols'; + oRangeNames[243] = 'Ancient Greek Musical Notation'; + oRangeNames[244] = 'Tai Xuan Jing Symbols'; + oRangeNames[245] = 'Counting Rod Numerals'; + oRangeNames[246] = 'Mathematical Alphanumeric Symbols'; + oRangeNames[247] = 'Sutton SignWriting'; + oRangeNames[248] = 'Glagolitic Supplement'; + oRangeNames[249] = 'Mende Kikakui'; + oRangeNames[250] = 'Adlam'; + oRangeNames[251] = 'Arabic Mathematical Alphabetic Symbols'; + oRangeNames[252] = 'Mahjong Tiles'; + oRangeNames[253] = 'Domino Tiles'; + oRangeNames[254] = 'Playing Cards'; + oRangeNames[255] = 'Enclosed Alphanumeric Supplement'; + oRangeNames[256] = 'Enclosed Ideographic Supplement'; + oRangeNames[257] = 'Miscellaneous Symbols and Pictographs'; + oRangeNames[258] = 'Emoticons'; + oRangeNames[259] = 'Ornamental Dingbats'; + oRangeNames[260] = 'Transport and Map Symbols'; + oRangeNames[261] = 'Alchemical Symbols'; + oRangeNames[262] = 'Geometric Shapes Extended'; + oRangeNames[263] = 'Supplemental Arrows C'; + oRangeNames[264] = 'Supplemental Symbols and Pictographs'; + oRangeNames[265] = 'CJK Unified Ideographs Extension B'; + oRangeNames[266] = 'CJK Unified Ideographs Extension C'; + oRangeNames[267] = 'CJK Unified Ideographs Extension D'; + oRangeNames[268] = 'CJK Unified Ideographs Extension E'; + oRangeNames[269] = 'CJK Compatibility Ideographs Supplement'; + oRangeNames[270] = 'Tags'; + oRangeNames[271] = 'Variation Selectors Supplement'; + oRangeNames[272] = 'Supplementary Private Use Area A'; + oRangeNames[273] = 'Supplementary Private Use Area B'; + + var CELL_WIDTH = 31; + var CELL_HEIGHT = 33; + + var aFontSelects = []; + var aRanges = []; + var aRecents = []; + var nCurrentFont = -1;// индекс в aFontSelects + var nCurrentSymbol = -1;// code + var bMainFocus = true;//фокус в основной таблице + var nFontNameRecent = -1; + + var nMaxRecent = 36; + var bScrollMouseUp = false; + + var sInitFont = ""; + var sInitSymbol = ""; + + var nLastScroll = -1000; + + var sLastId = ""; + var nLastTime = -1000; + + var lastTime = -1; + var lastKeyCode = -1; + + var minScrollbarLength = 20; + var wheelSpeed = 20; + + + var loadTranslation = function(lang, callback) { + lang = lang.split(/[\-_]/)[0].toLocaleLowerCase(); + Common.Utils.loadConfig('resources/symboltable/' + lang + '.json', function (langJson) { + for (var i=1; i<274; i++) { + var val = oRangeNames[i]; + oRangeNames[i] = langJson[val] || val; + } + callback && callback(); + }); + }; + + Common.Views.SymbolTableDialog = Common.UI.Window.extend(_.extend({ + options: { + resizable : true, + minwidth : 448, + minheight : 396, + width: 448, + height: 396, + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] + }, + + initialize : function(options) { + var filter = Common.localStorage.getKeysFilter(); + this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + + var path = this.appPrefix + 'settings-size-symbol-table', + size = Common.Utils.InternalSettings.get(path); + if (size==null || size==undefined) { + size = Common.localStorage.getItem(path) || ''; + Common.Utils.InternalSettings.set(path, size); + } + size = size ? JSON.parse(size) : []; + + _.extend(this.options, { + title: this.textTitle, + width : size[0] || 448, + height : size[1] || 396 + }, options || {}); + + this.template = [ + '
', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '', + '', + '', + '', + '', + '', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '', + '
', + '
', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '
', + '', + '', + '
', + '
', + '
', + '
', + '
', + '
' + ].join(''); + + this.options.tpl = _.template(this.template)(this.options); + this.api = this.options.api; + this.type = this.options.type || 0; // 0 - close on OK, single adding symbol + + var init = (aFontSelects.length<1); + init && this.initFonts(); + + if (nCurrentFont < 0) + nCurrentFont = 0; + + aRanges = this.getArrRangesByFont(nCurrentFont); + if(sInitSymbol && sInitSymbol.length > 0){ + nCurrentSymbol = this.fixedCharCodeAt(sInitSymbol, 0); + if(false === nCurrentSymbol){ + nCurrentSymbol = -1; + } + else{ + for(var i = 0; i < aRanges.length; ++i){ + if(nCurrentSymbol >= aRanges[i].Start && nCurrentSymbol <= aRanges[i].End){ + break; + } + } + if(i === aRanges.length){ + nCurrentSymbol = -1; + } + } + } + if(nCurrentSymbol === -1){ + nCurrentSymbol = aRanges[0].Start; + } + + if (init && this.options.lang && this.options.lang != 'en') { + var me = this; + loadTranslation(this.options.lang, function(){ + me.updateRangeSelector(); + }); + } + + Common.UI.Window.prototype.initialize.call(this, this.options); + + this.on('resizing', _.bind(this.onWindowResizing, this)); + this.on('resize', _.bind(this.onWindowResize, this)); + }, + + initFonts: function() { + var fontList = this.api.pluginMethod_GetFontList(); + fontList.sort(function(a, b){ + if(a.m_wsFontName < b.m_wsFontName) return -1; + if(a.m_wsFontName > b.m_wsFontName) return 1; + return 0; + }); + + var oCurFont, oLastFont; + var data = []; + var oFontsByName = {}; + var sCurFontNameInMap; + for(var i = 0; i < fontList.length; ++i){ + oCurFont = fontList[i]; + sCurFontNameInMap = oCurFont.m_wsFontName; + oLastFont = oFontsByName[sCurFontNameInMap]; + if(!oLastFont){ + oFontsByName[sCurFontNameInMap] = oCurFont; + } + else{ + if(oLastFont.m_bBold && oLastFont.m_bItalic){ + oFontsByName[sCurFontNameInMap] = oCurFont; + } + else if(oLastFont.m_bBold && !oCurFont.m_bBold){ + oFontsByName[sCurFontNameInMap] = oCurFont; + } + else if(oLastFont.m_bItalic && !oCurFont.m_bBold && !oCurFont.m_bItalic){ + oFontsByName[sCurFontNameInMap] = oCurFont; + } + } + } + delete oFontsByName['ASCW3']; + var i = 0; + for(var key in oFontsByName){ + if(oFontsByName.hasOwnProperty(key)){ + data.push(oFontsByName[key]); + data[data.length-1].value = i++; + data[data.length-1].displayValue = oFontsByName[key].m_wsFontName; + } + } + + //initialize params + aFontSelects = data; + aFontSelects.sort(function(a, b){return (a.displayValue.toLowerCase() > b.displayValue.toLowerCase()) ? 1 : -1;}); + if(!oFontsByName[sInitFont]){ + if(oFontsByName['Cambria Math']){ + sInitFont = 'Cambria Math'; + } + else if(oFontsByName['Asana-Math']){ + sInitFont = 'Asana-Math'; + } + } + if(oFontsByName[sInitFont]){ + for(i = 0; i < aFontSelects.length; ++i){ + if(aFontSelects[i].displayValue === sInitFont){ + nCurrentFont = i; + break; + } + } + } + }, + + render: function() { + Common.UI.Window.prototype.render.call(this); + + var me = this, + $window = this.getChild(); + + var $border = $window.find('.resize-border'); + $border.css({'background': 'none', 'border': 'none'}); + + this.cmbFonts = new Common.UI.ComboBox({ + el : $window.find('#symbol-table-cmb-fonts'), + cls : 'input-group-nr', + data : aFontSelects, + editable : false, + search : true, + menuStyle : 'min-width: 100%; max-height: 209px;' + }).on('selected', function(combo, record) { + var oCurrentRange = me.getRangeBySymbol(aRanges, nCurrentSymbol); + nCurrentFont = record.value; + aRanges = me.getArrRangesByFont(nCurrentFont); + if(oCurrentRange){ + for(var i = 0; i < aRanges.length; ++i){ + if(oCurrentRange.Name === aRanges[i].Name){ + break; + } + } + if(i === aRanges.length){ + nCurrentSymbol = aRanges[0].Start; + } + } + else{ + nCurrentSymbol = aRanges[0].Start; + } + bMainFocus = true; + me.updateView(); + setTimeout(function(){ + me.previewPanel.focus(); + }, 1); + }); + this.cmbFonts.setValue(nCurrentFont); + + this.cmbRange = new Common.UI.ComboBox({ + el : $window.find('#symbol-table-cmb-range'), + cls : 'input-group-nr', + editable : false, + menuStyle : 'min-width: 100%; max-height: 209px;' + }).on('selected', function(combo, record) { + var oCurrentRange = me.getRangeByName(aRanges, parseInt(record.value)); + nCurrentSymbol = oCurrentRange.Start; + bMainFocus = true; + me.updateView(undefined, undefined, undefined, undefined, false); + setTimeout(function(){ + me.previewPanel.focus(); + }, 1); + }); + this.updateRangeSelector(); + + me.inputCode = new Common.UI.InputField({ + el : $window.find('#symbol-table-text-code'), + allowBlank : false, + blankError : me.txtEmpty, + style : 'width: 100%;', + validateOnBlur: false, + validateOnChange: true + }).on('changing', function(cmp, newValue, oldValue) { + var value = parseInt(newValue, 16); + if(!isNaN(value) && value > 0x1F){ + var oRange = me.getRangeBySymbol(aRanges, value); + if(oRange){ + var bUpdateTable = ($window.find("#c" + value).length === 0); + nCurrentSymbol = value; + bMainFocus = true; + me.updateView(bUpdateTable, undefined, false); + } + } + }).on('change:after', function(cmp, newValue, oldValue) { + me.updateInput(); + }); + + //fill recents + this.fillRecentSymbols(); + + this.symbolTablePanel = $window.find('#symbol-table-scrollable-div'); + this.previewPanel = $window.find('#id-preview-data'); + this.previewParent = this.previewPanel.parent(); + this.previewScrolled = $window.find('#id-preview'); + this.previewInner = this.previewScrolled.find('div:first-child'); + this.recentPanel = $window.find('#symbol-table-recent'); + this.fontLabel = $window.find("#symbol-table-label-font"); + this.boxPanel = $window.find('.box'); + this.updateView(undefined, undefined, undefined, true); + + $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + }, + + show: function() { + Common.UI.Window.prototype.show.apply(this, arguments); + + if (!this.binding) + this.binding = {}; + this.binding.keydownSymbols = _.bind(this.onKeyDown,this); + this.binding.keypressSymbols = _.bind(this.onKeyPress,this); + $(document).on('keydown.' + this.cid, '#symbol-table-scrollable-div #id-preview-data, #symbol-table-recent', this.binding.keydownSymbols); + $(document).on('keypress.' + this.cid, '#symbol-table-scrollable-div #id-preview-data, #symbol-table-recent', this.binding.keypressSymbols); + + var me = this; + _.delay(function(){ + me.previewPanel.focus(); + },50); + }, + + close: function(suppressevent) { + $(document).off('keydown.' + this.cid, this.binding.keydownSymbols); + $(document).off('keypress.' + this.cid, this.binding.keypressSymbols); + + Common.UI.Window.prototype.close.apply(this, arguments); + }, + + getPasteSymbol: function(cellId) { + var bUpdateRecents = cellId[0] === 'c'; + var sFont; + if(bUpdateRecents){ + sFont = aFontSelects[nCurrentFont].displayValue; + } else { + var nFontId = parseInt(cellId.split('_')[2]); + sFont = aFontSelects[nFontId].displayValue; + } + return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), updateRecents: bUpdateRecents}; + }, + + onBtnClick: function(event) { + this._handleInput(event.currentTarget.attributes['result'].value); + }, + + onPrimary: function(event) { + this._handleInput('ok'); + return false; + }, + + _handleInput: function(state) { + var settings = this.getPasteSymbol(this.$window.find('.cell-selected').attr('id')); + if (this.options.handler) { + this.options.handler.call(this, this, state, settings); + } + if (state=='ok') { + settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font); + settings.updateRecents && this.updateRecents(); + if (this.type) + return; + } + this.close(); + }, + + encodeSurrogateChar: function(nUnicode) { + if (nUnicode < 0x10000) + { + return String.fromCharCode(nUnicode); + } + else + { + nUnicode = nUnicode - 0x10000; + var nLeadingChar = 0xD800 | (nUnicode >> 10); + var nTrailingChar = 0xDC00 | (nUnicode & 0x3FF); + return String.fromCharCode(nLeadingChar) + String.fromCharCode(nTrailingChar); + } + }, + + fixedCharCodeAt: function(str, idx) { + idx = idx || 0; + var code = str.charCodeAt(idx); + var hi, low; + if (0xD800 <= code && code <= 0xDBFF) { + hi = code; + low = str.charCodeAt(idx + 1); + if (isNaN(low)) { + throw 'Старшая часть суррогатной пары без следующей младшей в fixedCharCodeAt()'; + } + return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; + } + if (0xDC00 <= code && code <= 0xDFFF) { + return false; + } + return code; + }, + + getArrRangesByFont: function(nFontName){ + var _ret = getSupportedRangesByFont(aFontSelects[nFontName]); + if(_ret.length === 0){ + _ret.push({Start:0x20, End: 0xFF}); + } + if(_ret[0].Start < 0x20){ + _ret[0].Start = 0x20; + } + return _ret; + }, + + getRangeBySymbol: function(arrRanges, nCode){ + for(var i = 0; i < arrRanges.length; ++i){ + if(arrRanges[i].Start <= nCode && arrRanges[i].End >= nCode){ + return arrRanges[i]; + } + } + return null; + }, + + getRangeByName: function(arrRanges, nName){ + for(var i = 0; i < arrRanges.length; ++i){ + if(arrRanges[i].Name === nName){ + return arrRanges[i]; + } + } + return null; + }, + + getLinearIndexByCode: function(arrRanges, nCode){ + var nLinearIndex = -1; + var nCounter = 0; + var oCurRange; + for(var i = 0; i < arrRanges.length; ++i){ + oCurRange = arrRanges[i]; + if(oCurRange.Start > nCode){ + return -1; + } + if(oCurRange.Start <= nCode && oCurRange.End >= nCode){ + return nCounter + (nCode - oCurRange.Start); + } + nCounter += (oCurRange.End - oCurRange.Start + 1); + } + return nLinearIndex; + }, + + getCodeByLinearIndex: function(arrRanges, nIndex){ + if(nIndex < 0){ + return -1; + } + var nCount = 0; + var oCurRange = arrRanges[0]; + var nDiff; + for(var i = 0; i < arrRanges.length; ++i){ + oCurRange = arrRanges[i]; + nDiff = oCurRange.End - oCurRange.Start + 1; + if(nCount + nDiff > nIndex){ + return oCurRange.Start + nIndex - nCount; + } + nCount += nDiff; + } + return -1; + }, + + createTable: function(arrSym, nRowsCount, nColsCount){ + var nDivCount = nRowsCount*nColsCount; + var nCellsCounter = 0; + var sInnerHtml = ''; + var sId; + var sStyle = 'style=\'border-bottom: none\''; + var sCellStyle; + for(var i = 0; i < nDivCount; ++i){ + + + if(((i / nColsCount) >> 0) === (nRowsCount - 1)){ + sCellStyle = sStyle; + } + else{ + sCellStyle = ''; + } + if(i < arrSym.length){ + sId = 'c' + arrSym[i]; + sInnerHtml += '
' + '&#' + arrSym[i].toString(10) + '
'; + } + else{ + sInnerHtml += '
'; + } + ++nCellsCounter; + if(nCellsCounter >= nColsCount){ + sInnerHtml += '
'; + nCellsCounter = 0; + } + } + this.previewPanel.html(sInnerHtml); + }, + + fillRecentSymbols: function(){ + var sRecents = Common.localStorage.getItem(this.appPrefix + 'recentSymbols'); + var aRecentCookies; + if(sRecents != ''){ + aRecentCookies = JSON.parse(sRecents); + } + if(_.isArray(aRecentCookies)){ + aRecents = aRecentCookies; + } + }, + + saveRecent: function(){ + var sJSON = JSON.stringify(aRecents); + Common.localStorage.setItem(this.appPrefix + 'recentSymbols', sJSON); + }, + + checkRecent: function(sSymbol, sFont){ + if(aRecents.length === 0){ + aRecents.push({symbol: sSymbol, font: sFont}); + return; + } + for(var i = 0; i < aRecents.length; ++i){ + if(aRecents[i].symbol === sSymbol && aRecents[i].font === sFont){ + aRecents.splice(i, 1); + break; + } + } + aRecents.splice(0, 0, {symbol: sSymbol, font: sFont}); + if(aRecents.length > nMaxRecent){ + aRecents.splice(nMaxRecent, aRecents.length - nMaxRecent); + } + this.saveRecent(); + }, + + createCell: function(nSymbolCode, sFontName){ + var sId = '', + symbol = ''; + if(sFontName){ + var nFontIndex = 0; + for(var i = 0; i < aFontSelects.length; ++i){ + if(aFontSelects[i].displayValue === sFontName){ + nFontIndex = i; + break; + } + } + sId = 'r_' + nSymbolCode + '_' + nFontIndex; + symbol = '&#' + nSymbolCode.toString(); + } else if (nSymbolCode!==undefined) { + sId = 'r' + nSymbolCode; + symbol = '&#' + nSymbolCode.toString(); + } + var _ret = $('
' + symbol + '
'); + _ret.addClass('cell'); + _ret.addClass('noselect'); + _ret.mousedown(_.bind(this.cellClickHandler, this)); + if(sFontName){ + _ret.css('font-family', '\'' + sFontName + '\''); + } + return _ret; + }, + + cellClickHandler: function (e) { + var id = $(e.target).attr('id'); + if(!id){ + return; + } + var nTime = (new Date()).getTime(); + if(id === sLastId && (nTime - nLastTime) < 300 ){ + this.cellDblClickHandler(e) + } + else{ + if(id[0] === 'c'){ + nCurrentSymbol = parseInt(id.slice(1, id.length)); + bMainFocus = true; + } + else{ + var aStrings = id.split('_'); + nCurrentSymbol = parseInt(aStrings[1]); + nFontNameRecent = parseInt(aStrings[2]); + bMainFocus = false; + } + this.updateView(false); + } + sLastId = e.target.id; + nLastTime = nTime; + }, + + cellDblClickHandler: function (e){ + if (!this.type) + this._handleInput('ok'); + else { + var settings = this.getPasteSymbol($(e.target).attr('id')); + settings.updateRecents && this.checkRecent(nCurrentSymbol, settings.font); + settings.updateRecents && this.updateView(false, undefined, undefined, true); + this.fireEvent('symbol:dblclick', this, settings); + } + }, + + updateRecents: function(){ + var oRecentsDiv = this.recentPanel; + oRecentsDiv.empty(); + var nCols = this.getColsCount(), + nRecents = aRecents.length; + oRecentsDiv.width(nCols * CELL_WIDTH); + for(var i = 0; i < nCols; ++i){ + var oCell = (i> 0); + }, + + getMaxHeight: function(){ + return this.symbolTablePanel.innerHeight(); + }, + + getRowsCount: function() { + return Math.max(1, ((this.getMaxHeight()/CELL_HEIGHT) >> 0)); + }, + + getAllSymbolsCount: function(arrRanges){ + var _count = 0; + var oRange; + for(var i = 0; i < arrRanges.length; ++i){ + oRange = arrRanges[i]; + _count += (oRange.End - oRange.Start + 1); + } + return _count; + }, + + setTable: function(nStartCode){ + var nColsCount = this.getColsCount(); + var nRowsCount = this.getRowsCount(); + var nIndexSymbol = this.getLinearIndexByCode(aRanges, nStartCode); + var nAllSymbolsCount = this.getAllSymbolsCount(aRanges); + var nAllRowsCount = Math.ceil(nAllSymbolsCount/nColsCount); + var nRowsSkip = Math.max(0, Math.min(nAllRowsCount - nRowsCount, ((nIndexSymbol / nColsCount) >> 0))); + var nFirst = nRowsSkip*nColsCount; + var nSymbolsCount = nRowsCount*nColsCount; + var aSymbols = []; + var nCode; + for(var i = 0; i < nSymbolsCount; ++i){ + nCode = this.getCodeByLinearIndex(aRanges, nFirst + i); + if(nCode === -1){ + break; + } + aSymbols.push(nCode); + } + this.previewPanel.css('font-family', '\'' + aFontSelects[nCurrentFont].displayValue + '\''); + this.createTable(aSymbols, nRowsCount, nColsCount); + return nRowsSkip; + }, + + updateView: function(bUpdateTable, nTopSymbol, bUpdateInput, bUpdateRecents, bUpdateRanges) { + //fill ranges combo box + if(bMainFocus){ + if(bUpdateRanges !== false){ + this.updateRangeSelector(); + } + } + + if(bMainFocus){ + this.fontLabel.text(aFontSelects[nCurrentFont] ? aFontSelects[nCurrentFont].displayValue : ''); + } else { + this.fontLabel.text(aFontSelects[nFontNameRecent] ? aFontSelects[nFontNameRecent].displayValue : ''); + } + + if(bUpdateTable !== false){ + //fill fonts combo box + this.cmbFonts.setValue(nCurrentFont); + } + + //main table + var nRowsCount = this.getRowsCount(); + var nHeight = nRowsCount*CELL_HEIGHT; + bScrollMouseUp = false; + if(bUpdateTable !== false){ + //fill table + var nSymbol = (nTopSymbol !== null && nTopSymbol !== undefined)? nTopSymbol : nCurrentSymbol; + var nRowSkip = this.setTable(nSymbol); + //update scroll + var nSymbolsCount = this.getAllSymbolsCount(aRanges); + var nAllRowsCount = Math.ceil(nSymbolsCount/this.getColsCount()); + var nFullHeight = nAllRowsCount*CELL_HEIGHT; + + this.previewInner.height(nFullHeight); + this.previewPanel.height(nHeight); + this.previewScrolled.height(nHeight); + + if (!this.scrollerY) { + minScrollbarLength = Math.max((CELL_HEIGHT*2.0/3.0 + 0.5) >> 0, ((nHeight/8.0 + 0.5) >> 0)); + wheelSpeed = Math.min((Math.floor(this.previewPanel.height()/CELL_HEIGHT) * CELL_HEIGHT)/10, 20); + this.scrollerY = new Common.UI.Scroller({ + el: this.previewScrolled, + minScrollbarLength: minScrollbarLength, + alwaysVisibleY: true, + wheelSpeed: wheelSpeed, + useKeyboard: false, + onChange: _.bind(function(){ + if (this.scrollerY) { + this._preventUpdateScroll = true; + this.onScrollEnd(); + this._preventUpdateScroll = false; + this.previewParent.height(nHeight); + this.previewParent.css({top: this.scrollerY.getScrollTop()}); + } + }, this) + }); + } + if (!this._preventUpdateScroll) { + this.scrollerY.update({ + minScrollbarLength: minScrollbarLength, + wheelSpeed: wheelSpeed + }); + this.scrollerY.scrollTop(nRowSkip*CELL_HEIGHT); + } + + var aCells = this.previewPanel.find('.cell'); + aCells.off('mousedown'); + aCells.mousedown(_.bind(this.cellClickHandler, this)); + } + + //fill recent + if(bUpdateRecents){ + this.updateRecents(); + } + + //reset selection + this.$window.find('.cell').removeClass('cell-selected'); + + //select current cell + if(bMainFocus){ + this.$window.find('#c' + nCurrentSymbol).addClass('cell-selected'); + } else { + this.$window.find('#r_' + nCurrentSymbol + '_' + nFontNameRecent).addClass('cell-selected'); + } + + //update input + if(bUpdateInput !== false){ + this.updateInput(); + } + }, + + onScrollEnd: function(){ + if(this.scrollerY.getScrollTop() === nLastScroll){ + return; + } + + var nSymbolsCount = this.getAllSymbolsCount(aRanges); + var nColsCount = this.getColsCount(); + var nRows = this.getRowsCount(); + var nAllRowsCount = Math.ceil(nSymbolsCount/nColsCount); + var nFullHeight = nAllRowsCount*CELL_HEIGHT; + var nRowSkip = Math.max(0, Math.min(nAllRowsCount - nRows, (nAllRowsCount*this.scrollerY.getScrollTop()/nFullHeight + 0.5) >> 0)); + nLastScroll = this.scrollerY.getScrollTop(); + if(!bMainFocus){ + nCurrentSymbol = this.getCodeByLinearIndex(aRanges, nRowSkip*nColsCount); + bMainFocus = true; + } + else{ + var oFirstCell = this.previewPanel.children()[0]; + if(oFirstCell){ + var id = oFirstCell.id; + if(id){ + var nOldFirstCode = parseInt(id.slice(1, id.length)); + var nOldFirstLinearIndex = this.getLinearIndexByCode(aRanges, nOldFirstCode); + var nOldCurrentLinearIndex = this.getLinearIndexByCode(aRanges, nCurrentSymbol); + var nDiff = nOldCurrentLinearIndex - nOldFirstLinearIndex; + var nNewCurLinearIndex = nRowSkip*nColsCount + nDiff; + nCurrentSymbol = this.getCodeByLinearIndex(aRanges, nNewCurLinearIndex); + var nFirstIndex = nRowSkip*nColsCount; + nNewCurLinearIndex -= nColsCount; + while(nCurrentSymbol === -1 && nNewCurLinearIndex >= nFirstIndex){ + nCurrentSymbol = this.getCodeByLinearIndex(aRanges, nNewCurLinearIndex); + nNewCurLinearIndex -= nColsCount; + } + if(nCurrentSymbol === -1){ + nCurrentSymbol = this.getCodeByLinearIndex(aRanges, nFirstIndex); + } + } + else{ + nCurrentSymbol = this.getCodeByLinearIndex(aRanges, nRowSkip*nColsCount); + } + } + } + this.updateView(true, this.getCodeByLinearIndex(aRanges, nRowSkip*nColsCount)); + }, + + updateInput: function(){ + var sVal = nCurrentSymbol.toString(16).toUpperCase(); + var sValLen = sVal.length; + for(var i = sValLen; i < 5; ++i){ + sVal = '0' + sVal; + } + this.inputCode.setValue(sVal); + }, + + updateRangeSelector: function() { + var oCurrentRange = this.getRangeBySymbol(aRanges, nCurrentSymbol); + if(!oCurrentRange || !oCurrentRange.Name){ + this.cmbRange.setDisabled(true); + this.cmbRange.setValue(''); + } + else{ + this.cmbRange.setDisabled(false); + var oOption, i, data = []; + for(i = 0; i < aRanges.length; ++i){ + data.push({ + value: aRanges[i].Name, + displayValue: oRangeNames[aRanges[i].Name] + }); + } + this.cmbRange.setData(data); + this.cmbRange.setValue(oCurrentRange.Name); + } + }, + + onKeyDown: function(e){ + if(document.activeElement){ + if(document.activeElement.nodeName && document.activeElement.nodeName.toLowerCase() === 'span'){ + return; + } + } + var value = e.which || e.charCode || e.keyCode || 0; + var bFill = true; + if(bMainFocus){ + var nCode = -1; + if ( value === Common.UI.Keys.LEFT ){//left + nCode = this.getCodeByLinearIndex(aRanges, this.getLinearIndexByCode(aRanges, nCurrentSymbol) - 1); + } + else if ( value === Common.UI.Keys.UP ){//top + nCode = this.getCodeByLinearIndex(aRanges, this.getLinearIndexByCode(aRanges, nCurrentSymbol) - this.getColsCount()); + } + else if ( value === Common.UI.Keys.RIGHT ){//right + nCode = this.getCodeByLinearIndex(aRanges, this.getLinearIndexByCode(aRanges, nCurrentSymbol) + 1); + } + else if ( value === Common.UI.Keys.DOWN ){//bottom + nCode = this.getCodeByLinearIndex(aRanges, this.getLinearIndexByCode(aRanges, nCurrentSymbol) + this.getColsCount()); + } + else if(value === Common.UI.Keys.HOME){//home + if(aRanges.length > 0){ + nCode = aRanges[0].Start; + } + } + else if(value === Common.UI.Keys.END){//end + if(aRanges.length > 0){ + nCode = aRanges[aRanges.length - 1].End; + } + } + else{ + bFill = false; + } + if(nCode > -1){ + nCurrentSymbol = nCode; + var bUpdateTable = this.$window.find('#c' + nCurrentSymbol).length === 0; + this.updateView(bUpdateTable); + } + } + else{ + var oSelectedCell, aStrings; + if ( value === Common.UI.Keys.LEFT ){//left + oSelectedCell = this.$window.find('.cell-selected')[0]; + if(oSelectedCell && oSelectedCell.id[0] === 'r'){ + var oPresCell = this.$window.find(oSelectedCell).prev(); + if(oPresCell.length > 0){ + aStrings = this.$window.find(oPresCell).attr('id').split('_'); + nCurrentSymbol = parseInt(aStrings[1]); + nFontNameRecent = parseInt(aStrings[2]); + this.updateView(false); + } + } + } + else if ( value === Common.UI.Keys.RIGHT ){//right + oSelectedCell = this.$window.find('.cell-selected')[0]; + if(oSelectedCell && oSelectedCell.id[0] === 'r'){ + var oNextCell = this.$window.find(oSelectedCell).next(); + if(oNextCell.length > 0){ + aStrings = this.$window.find(oNextCell).attr('id').split('_'); + nCurrentSymbol = parseInt(aStrings[1]); + nFontNameRecent = parseInt(aStrings[2]); + this.updateView(false); + } + } + } + else if(value === Common.UI.Keys.HOME){//home + var oFirstCell = this.$window.find('#recent-table').children()[0]; + if(oFirstCell){ + aStrings = oFirstCell.id.split('_'); + nCurrentSymbol = parseInt(aStrings[1]); + nFontNameRecent = parseInt(aStrings[2]); + this.updateView(false); + } + } + else if(value === Common.UI.Keys.END){//end + var aChildren = this.recentPanel.children(); + var oLastCell = aChildren[aChildren.length - 1]; + if(oLastCell){ + aStrings = oLastCell.id.split('_'); + nCurrentSymbol = parseInt(aStrings[1]); + nFontNameRecent = parseInt(aStrings[2]); + this.updateView(false); + } + } + else{ + bFill = false; + } + } + + if(bFill){ + lastKeyCode = value; + lastTime = (new Date()).getTime(); + } + }, + + onKeyPress: function(e){ + if(document.activeElement){ + if(document.activeElement.nodeName && document.activeElement.nodeName.toLowerCase() === 'span'){ + return; + } + } + var value = e.which || e.charCode || e.keyCode || 0; + if(lastKeyCode === value){ + if(Math.abs(lastTime - (new Date()).getTime()) < 1000){ + return; + } + } + if(!isNaN(value) && value > 0x1F){ + var oRange = this.getRangeBySymbol(aRanges, value); + if(oRange){ + var bUpdateTable = (this.$window.find("#c" + value).length === 0); + nCurrentSymbol = value; + bMainFocus = true; + this.updateView(bUpdateTable, undefined, true); + } + } + e.preventDefault && e.preventDefault(); + }, + + onWindowResize: function (args) { + var size = this.getSize(); + if (args && args[1]=='start') { + this._preventUpdateScroll = true; + this.curSize = {resize: false, width: size[0], height: size[1]}; + } else if (this.curSize.resize) { + this._preventUpdateScroll = false; + this.curSize.height = size[1] - 264; + var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)), + height = rows*CELL_HEIGHT; + + this.symbolTablePanel.css({'height': this.curSize.height + 'px'}); + this.previewPanel.css({'height': height + 'px'}); + this.previewScrolled.css({'height': height + 'px'}); + this.scrollerY = null; + + this.updateView(undefined, undefined, undefined, true); + + var valJson = JSON.stringify(size); + Common.localStorage.setItem(this.appPrefix + 'settings-size-symbol-table', valJson); + Common.Utils.InternalSettings.set(this.appPrefix + 'settings-size-symbol-table', valJson); + } + }, + + onWindowResizing: function () { + if (!this.curSize) return; + + var size = this.getSize(); + if (size[0] !== this.curSize.width || size[1] !== this.curSize.height) { + if (!this.curSize.resize) + this.curSize.resize = true; + + this.curSize.width = size[0]; + this.curSize.height = size[1] - 264; + + var rows = Math.max(1, ((this.curSize.height/CELL_HEIGHT) >> 0)), + height = rows*CELL_HEIGHT; + + this.symbolTablePanel.css({'height': this.curSize.height + 'px'}); + this.previewPanel.css({'height': height + 'px'}); + this.previewScrolled.css({'height': height + 'px'}); + + this.updateView(undefined, undefined, undefined, true); + } + }, + + textTitle: 'Symbol Table', + textFont: 'Font', + textRange: 'Range', + textRecent: 'Recently used symbols', + textCode: 'Unicode HEX value' + }, Common.Views.SymbolTableDialog || {})) +}); \ No newline at end of file diff --git a/apps/common/main/resources/img/controls/toolbarbig.png b/apps/common/main/resources/img/controls/toolbarbig.png index 29c5eb05a..735a2dbae 100644 Binary files a/apps/common/main/resources/img/controls/toolbarbig.png and b/apps/common/main/resources/img/controls/toolbarbig.png differ diff --git a/apps/common/main/resources/img/controls/toolbarbig@2x.png b/apps/common/main/resources/img/controls/toolbarbig@2x.png index f5127cb0f..a1b2b36ef 100644 Binary files a/apps/common/main/resources/img/controls/toolbarbig@2x.png and b/apps/common/main/resources/img/controls/toolbarbig@2x.png differ diff --git a/apps/common/main/resources/less/symboltable.less b/apps/common/main/resources/less/symboltable.less new file mode 100644 index 000000000..6b064a595 --- /dev/null +++ b/apps/common/main/resources/less/symboltable.less @@ -0,0 +1,54 @@ +#symbol-table-scrollable-div, #symbol-table-recent { + div{ + display: inline-block; + vertical-align: top; + } + + .cell{ + width: 31px; + height: 33px; + border-right: 1px solid @gray-soft; + border-bottom: 1px solid @gray-soft; + background: #ffffff; + align-content: center; + vertical-align: middle; + text-align: center; + font-size: 22px; + -khtml-user-select: none; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + cursor: default; + overflow:hidden; + display: inline-block; + } + + .cell-selected{ + background-color: @gray-darker; + color: white; + } +} + +#symbol-table-recent { + width: 100%; + height: 32px; + overflow: hidden; + border: @gray-soft solid 1px; +} + +#symbol-table-scrollable-div { + #id-preview { + width: 100%; + height: 132px; + position:relative; + overflow:hidden; + border: @gray-soft solid 1px; + } + + #id-preview-data { + width: 100%; + height: 132px; + position:relative; + overflow:hidden; + } +} diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index cbab0599b..074fc78fc 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -533,6 +533,7 @@ .button-normal-icon(btn-caption, 76, @toolbar-big-icon-size); .button-normal-icon(btn-calculation, 80, @toolbar-big-icon-size); .button-normal-icon(btn-scale, 81, @toolbar-big-icon-size); +.button-normal-icon(btn-symbol, 84, @toolbar-big-icon-size); [applang=ru] { .btn-toolbar { diff --git a/apps/common/main/resources/symboltable/ru.json b/apps/common/main/resources/symboltable/ru.json new file mode 100644 index 000000000..c9cded905 --- /dev/null +++ b/apps/common/main/resources/symboltable/ru.json @@ -0,0 +1,275 @@ +{ + "Basic Latin": "Основная латиница", + "Latin 1 Supplement": "Дополнительная латиница-1", + "Latin Extended A": "Расширенная латиница-A", + "Latin Extended B": "Расширенная латиница-B", + "IPA Extensions": "Международный фонетический алфавит", + "Spacing Modifier Letters": "Некомбинируемые протяжённые символы-модификаторы", + "Combining Diacritical Marks": "Комбинируемые диакритические знаки", + "Greek and Coptic": "Греческий и коптский алфавиты", + "Cyrillic": "Кириллица", + "Cyrillic Supplement": "Кириллица. Дополнительные символы", + "Armenian": "Армянский алфавит", + "Hebrew": "Иврит", + "Arabic": "Арабский", + "Syriac": "Сирийский", + "Arabic Supplement": "Дополнительные символы арабского письма", + "Thaana": "Тана", + "NKo": "Нко", + "Samaritan": "Самаритянское письмо", + "Mandaic": "Мандейский алфавит", + "Arabic Extended A": "Расширенный набор символов арабского письма-A", + "Devanagari": "Деванагари", + "Bengali": "Бенгальский", + "Gurmukhi": "Гурмукхи", + "Gujarati": "Гуджарати", + "Oriya": "Ория", + "Tamil": "Тамильская письменность", + "Telugu": "Телугу", + "Kannada": "Каннада", + "Malayalam": "Малаялам", + "Sinhala": "Сингальская письменность", + "Thai": "Тайская письменность", + "Lao": "Лаосская письменность", + "Tibetan": "Тибетская письменность", + "Myanmar": "Бирманский", + "Georgian": "Грузинский", + "Hangul Jamo": "Хангыль чамо", + "Ethiopic": "Эфиопская слоговая письменность", + "Ethiopic Supplement": "Дополнительные символы эфиопской письменности", + "Cherokee": "Письменность чероки", + "Unified Canadian Aboriginal Syllabics": "Канадское слоговое письмо", + "Ogham": "Огамическое письмо", + "Runic": "Руническая письменность", + "Tagalog": "Тагальская письменность. Байбайин", + "Hanunoo": "Хануноо", + "Buhid": "Бухид", + "Tagbanwa": "Тагбанва", + "Khmer": "Кхмерская письменность", + "Mongolian": "Старомонгольская письменность", + "Unified Canadian Aboriginal Syllabics Extended": "Расширенный набор символов канадского слогового письма", + "Limbu": "Письменность лимбу", + "Tai Le": "Письменность тай лы", + "New Tai Lue": "Новый алфавит тай лы", + "Khmer Symbols": "Кхмерские символы", + "Buginese": "Бугийская письменность. Лонтара", + "Tai Tham": "Тай Тхам", + "Combining Diacritical Marks Extended": "Комбинируемые диакритические знаки (расширение)", + "Balinese": "Балийское письмо", + "Sundanese": "Сунданское письмо", + "Batak": "Батакское письмо", + "Lepcha": "Письмо лепча", + "Ol Chiki": "Письменность Ол-чики", + "Cyrillic Extended C": "Расширенная кириллица C", + "Sundanese Supplement": "Сунданское расширенное письмо", + "Vedic Extensions": "Ведические символы", + "Phonetic Extensions": "Фонетические расширения", + "Phonetic Extensions Supplement": "Дополнительные фонетические расширения", + "Combining Diacritical Marks Supplement": "Дополнительные комбинируемые диакритические знаки", + "Latin Extended Additional": "Дополнительная расширенная латиница", + "Greek Extended": "Расширенный набор символов греческого алфавита", + "General Punctuation": "Знаки пунктуации", + "Superscripts and Subscripts": "Надстрочные и подстрочные знаки", + "Currency Symbols": "Символы валют", + "Combining Diacritical Marks for Symbols": "Комбинируемые диакритические знаки для символов", + "Letterlike Symbols": "Буквоподобные символы", + "Number Forms": "Числовые формы", + "Arrows": "Стрелки", + "Mathematical Operators": "Математические операторы", + "Miscellaneous Technical": "Разнообразные технические символы", + "Control Pictures": "Значки управляющих кодов", + "Optical Character Recognition": "Символы оптического распознавания", + "Enclosed Alphanumerics": "Вложенные буквы и цифры", + "Box Drawing": "Символы для рисования рамок", + "Block Elements": "Символы заполнения", + "Geometric Shapes": "Геометрические фигуры", + "Miscellaneous Symbols": "Разнообразные символы", + "Dingbats": "Дингбаты", + "Miscellaneous Mathematical Symbols A": "Разнообразные математические символы-A", + "Supplemental Arrows A": "Дополнительные стрелки-A", + "Braille Patterns": "Азбука Брайля", + "Supplemental Arrows B": "Дополнительные стрелки-B", + "Miscellaneous Mathematical Symbols B": "Разнообразные математические символы-B", + "Supplemental Mathematical Operators": "Дополнительные математические операторы", + "Miscellaneous Symbols and Arrows": "Разнообразные символы и стрелки", + "Glagolitic": "Глаголица", + "Latin Extended C": "Расширенная латиница C", + "Coptic": "Коптский алфавит", + "Georgian Supplement": "Дополнительные символы грузинского алфавита", + "Tifinagh": "Тифинаг (Древнеливийское письмо)", + "Ethiopic Extended": "Расширенный набор символов эфиопского письма", + "Cyrillic Extended A": "Расширенная кириллица A", + "Supplemental Punctuation": "Дополнительные знаки пунктуации", + "CJK Radicals Supplement": "Дополнительные иероглифические ключи ККЯ", + "Kangxi Radicals": "Иероглифические ключи словаря Канси", + "Ideographic Description Characters": "Символы описания иероглифов", + "CJK Symbols and Punctuation": "Символы и пунктуация ККЯ", + "Hiragana": "Хирагана", + "Katakana": "Катакана", + "Bopomofo": "Чжуинь. Бопомофо", + "Hangul Compatibility Jamo": "Комбинируемые чамо Хангыля", + "Kanbun": "Канбун(китайский)", + "Bopomofo Extended": "Расширенный набор символов бопомофо, чжуинь", + "CJK Strokes": "Черты ККЯ", + "Katakana Phonetic Extensions": "Фонетические расширения катаканы", + "Enclosed CJK Letters and Months": "Вложенные буквы и месяцы ККЯ", + "CJK Compatibility": "Знаки совместимости ККЯ", + "CJK Unified Ideographs Extension": "Унифицированные иероглифы ККЯ. Расширение А", + "Yijing Hexagram Symbols": "Гексаграммы И-Цзин", + "CJK Unified Ideographs": "Унифицированные иероглифы ККЯ", + "Yi Syllables": "Слоги. Письмо И", + "Yi Radicals": "Радикалы. Письмо И", + "Lisu": "Лису", + "Vai": "Слоговая письменность ваи", + "Cyrillic Extended B": "Расширенная кириллица-B", + "Bamum": "Письмо бамум", + "Modifier Tone Letters": "Символы изменения тона", + "Latin Extended D": "Расширенная латиница-D", + "Syloti Nagri": "Силоти нагри", + "Common Indic Number Forms": "Индийские числовые символы", + "Phags pa": "Квадратное письмо Пагба-ламы", + "Saurashtra": "Саураштра", + "Devanagari Extended": "Расширенный набор символов деванагари", + "Kayah Li": "Кайях Ли", + "Rejang": "Реджанг", + "Hangul Jamo Extended A": "Хангыль", + "Javanese": "Яванская письменность", + "Myanmar Extended B": "Расширенный бирманский-B", + "Cham": "Чамское письмо", + "Myanmar Extended A": "Мьянманская письменность. Расширение A", + "Tai Viet": "Письменность Тай Вьет", + "Meetei Mayek Extensions": "Мейтей расширенная", + "Ethiopic Extended A": "Набор расширенных символов эфиопского письма-А", + "Latin Extended E": "Расширенная латиница-E", + "Cherokee Supplement": "Письменность чероки (дополнение)", + "Meetei Mayek": "Мейтей (Манипури)", + "Hangul Syllables": "Слоги Хангыля", + "Hangul Jamo Extended B": "Расширенные хангыль чамо B", + "High Surrogates": "Верхняя часть суррогатных пар", + "High Private Use Surrogates": "Верхняя часть суррогатных пар для частного использования", + "Low Surrogates": "Нижняя часть суррогатных пар", + "Private Use Area": "Область для частного использования", + "CJK Compatibility Ideographs": "Совместимые иероглифы ККЯ", + "Alphabetic Presentation Forms": "Алфавитные формы представления", + "Arabic Presentation Forms A": "Формы представления арабских букв-A", + "Variation Selectors": "Селекторы вариантов начертания", + "Vertical Forms": "Вертикальные формы", + "Combining Half Marks": "Комбинируемые половинки символов", + "CJK Compatibility Forms": "Формы совместимости ККЯ", + "Small Form Variants": "Варианты малого размера", + "Arabic Presentation Forms B": "Формы представления арабских букв-B", + "Halfwidth and Fullwidth Forms": "Полуширинные и полноширинные формы", + "Specials": "Специальные символы", + "Linear B Syllabary": "Слоги линейного письма Б", + "Linear B Ideograms": "Идеограммы линейного письма Б", + "Aegean Numbers": "Эгейские цифры", + "Ancient Greek Numbers": "Древнегреческие единицы измерения", + "Ancient Symbols": "Древние символы", + "Phaistos Disc": "Символы фестского диска", + "Lycian": "Ликийский алфавит", + "Carian": "Алфавит карийского языка", + "Coptic Epact Numbers": "Коптские числа епакты", + "Old Italic": "Этрусский (староитальянский) алфавит", + "Gothic": "Готский алфавит", + "Old Permic": "Древнепермское письмо", + "Ugaritic": "Угаритский алфавит", + "Old Persian": "Древнеперсидский клинописный алфавит", + "Deseret": "Дезеретский алфавит", + "Shavian": "Алфавит Бернарда Шоу", + "Osmanya": "Османья (сомалийский алфавит)", + "Osage": "Оседж", + "Elbasan": "Эльбасанское письмо", + "Caucasian Albanian": "Агванское письмо (Кавказская Албания)", + "Linear A": "Линейное письмо А", + "Cypriot Syllabary": "Слоговая письменность острова Кипр", + "Imperial Aramaic": "Имперское арамейское письмо", + "Palmyrene": "Пальмирский алфавит", + "Nabataean": "Набатейское письмо", + "Hatran": "Хатран", + "Phoenician": "Финикийское письмо", + "Lydian": "Лидийский алфавит", + "Meroitic Hieroglyphs": "Лидийский алфавит", + "Meroitic Cursive": "Курсивное мероитское письмо", + "Kharoshthi": "Кхароштхи", + "Old South Arabian": "Старый южноаравийский алфавит", + "Old North Arabian": "Старый североаравийский алфавит", + "Manichaean": "Манихейское письмо", + "Avestan": "Авестийский алфавит", + "Inscriptional Parthian": "Пехлевийское письмо для парфянского языка", + "Inscriptional Pahlavi": "Эпиграфическое пехлевийское письмо", + "Psalter Pahlavi": "Псалтырь пехлеви", + "Old Turkic": "Древнетюркское руническое письмо", + "Old Hungarian": "Венгерские руны", + "Rumi Numeral Symbols": "Цифры системы руми", + "Brahmi": "Брахмическая письменность", + "Kaithi": "Кайтхи", + "Sora Sompeng": "Соранг сомпенг", + "Chakma": "Чакма", + "Mahajani": "Махаяни", + "Sharada": "Шарада", + "Sinhala Archaic Numbers": "Сингальские архаические цифры", + "Khojki": "Кходжики", + "Multani": "Мултани", + "Khudawadi": "Кхудабади", + "Grantha": "Грантха", + "Newa": "Нева", + "Tirhuta": "Тирхута", + "Siddham": "Сиддхаматрика", + "Modi": "Моди", + "Mongolian Supplement": "Монгольский (дополнение)", + "Takri": "Такри", + "Ahom": "Письмо ахом", + "Warang Citi": "Варанг-кшити", + "Pau Cin Hau": "Пау Цин Хау", + "Bhaiksuki": "Байсаки", + "Marchen": "Марчен", + "Cuneiform": "Клинопись", + "Cuneiform Numbers and Punctuation": "Клинописные цифры и знаки препинания", + "Early Dynastic Cuneiform": "Ранняя династическая клинопись", + "Egyptian Hieroglyphs": "Египетские иероглифы", + "Anatolian Hieroglyphs": "Анатолийские иероглифы", + "Bamum Supplement": "Письмо бамум (дополнение)", + "Mro": "Мру", + "Bassa Vah": "Письмо басса", + "Pahawh Hmong": "Пахау хмонг", + "Miao": "Письмо Полларда (миао)", + "Ideographic Symbols and Punctuation": "Идеографические символы и знаки препинания", + "Tangut": "Тангутское письмо", + "Tangut Components": "Компоненты тангутского письма", + "Kana Supplement": "Кана (дополнение)", + "Duployan": "Дюплойе", + "Shorthand Format Controls": "Форматирующие символы стенографии", + "Byzantine Musical Symbols": "Византийские музыкальные символы", + "Musical Symbols": "Музыкальные символы", + "Ancient Greek Musical Notation": "Древнегреческие музыкальные символы", + "Tai Xuan Jing Symbols": "Символы Тай Сюань Цзин", + "Counting Rod Numerals": "Счётные палочки", + "Mathematical Alphanumeric Symbols": "Математические буквенно-цифровые символы", + "Sutton SignWriting": "Жестовая письменность Саттон", + "Glagolitic Supplement": "Глаголица (расширение)", + "Mende Kikakui": "Письмо кикакуи для языка менде", + "Adlam": "Адлам", + "Arabic Mathematical Alphabetic Symbols": "Арабские математические буквенно-цифровые символы", + "Mahjong Tiles": "Кости для маджонга", + "Domino Tiles": "Кости для домино", + "Playing Cards": "Игральные карты", + "Enclosed Alphanumeric Supplement": "Вложенные буквенно-цифровые символы (дополнение)", + "Enclosed Ideographic Supplement": "Вложенные идеографические символы (дополнение)", + "Miscellaneous Symbols and Pictographs": "Различные символы и пиктограммы", + "Emoticons": "Эмотикон (эмоджи)", + "Ornamental Dingbats": "Элементы орнамента", + "Transport and Map Symbols": "Транспортные и картографические символы", + "Alchemical Symbols": "Алхимические символы", + "Geometric Shapes Extended": "Геометрические фигуры (расширение)", + "Supplemental Arrows C": "Дополнительные стрелки-С", + "Supplemental Symbols and Pictographs": "Символы и пиктограммы (дополнение)", + "CJK Unified Ideographs Extension B": "Унифицированные иероглифы ККЯ. Расширение B", + "CJK Unified Ideographs Extension C": "Унифицированные иероглифы ККЯ. Расширение C", + "CJK Unified Ideographs Extension D": "Унифицированные иероглифы ККЯ. Расширение D", + "CJK Unified Ideographs Extension E": "Унифицированные иероглифы ККЯ. Расширение E", + "CJK Compatibility Ideographs Supplement": "Унифицированные иероглифы ККЯ (дополнение)", + "Tags": "Теги", + "Variation Selectors Supplement": "Селекторы вариантов начертания (дополнение)", + "Supplementary Private Use Area A": "Дополнительная область для частного использования — A", + "Supplementary Private Use Area B": "Дополнительная область для частного использования — B" +} \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 71c5041ce..ed898d49c 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -47,6 +47,7 @@ define([ 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/InsertTableDialog', 'common/main/lib/view/SelectFileDlg', + 'common/main/lib/view/SymbolTableDialog', 'common/main/lib/util/define', 'documenteditor/main/app/view/Toolbar', 'documenteditor/main/app/view/DropcapSettingsAdvanced', @@ -324,6 +325,7 @@ define([ toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this)); toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); + toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); toolbar.mnuNoControlsColor.on('click', _.bind(this.onNoControlsColor, this)); toolbar.mnuControlsColorPicker.on('select', _.bind(this.onSelectControlsColor, this)); Common.Gateway.on('insertimage', _.bind(this.insertImage, this)); @@ -820,6 +822,8 @@ define([ need_disable = paragraph_locked || header_locked || in_chart || !can_add_image&&!in_equation || control_plain; toolbar.btnInsertEquation.setDisabled(need_disable); + toolbar.btnInsertSymbol.setDisabled(!in_para || paragraph_locked || header_locked); + need_disable = paragraph_locked || header_locked || in_equation; toolbar.btnSuperscript.setDisabled(need_disable); toolbar.btnSubscript.setDisabled(need_disable); @@ -2470,6 +2474,29 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onInsertSymbolClick: function() { + if (this.api) { + var me = this, + win = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.mode.lang, + modal: false, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + win.show(); + win.on('symbol:dblclick', function(cmp, settings) { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + }); + } + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; @@ -3268,7 +3295,8 @@ define([ confirmAddFontName: 'The font you are going to save is not available on the current device.
The text style will be displayed using one of the device fonts, the saved font will be used when it is available.
Do you want to continue?', notcriticalErrorTitle: 'Warning', txtMarginsW: 'Left and right margins are too high for a given page wight', - txtMarginsH: 'Top and bottom margins are too high for a given page height' + txtMarginsH: 'Top and bottom margins are too high for a given page height', + textInsert: 'Insert' }, DE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index c50e0c0e7..aba5de34a 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -108,6 +108,7 @@
+
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index acdb1b86a..70ab3fc48 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -583,6 +583,14 @@ define([ }); this.paragraphControls.push(this.btnInsertEquation); + this.btnInsertSymbol = new Common.UI.Button({ + id: 'tlbtn-insertsymbol', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-symbol', + caption: me.capBtnInsSymbol + }); + this.paragraphControls.push(this.btnInsertSymbol); + this.btnDropCap = new Common.UI.Button({ id: 'tlbtn-dropcap', cls: 'btn-toolbar x-huge icon-top', @@ -1309,6 +1317,7 @@ define([ _injectComponent('#slot-btn-blankpage', this.btnBlankPage); _injectComponent('#slot-btn-insshape', this.btnInsertShape); _injectComponent('#slot-btn-insequation', this.btnInsertEquation); + _injectComponent('#slot-btn-inssymbol', this.btnInsertSymbol); _injectComponent('#slot-btn-pageorient', this.btnPageOrient); _injectComponent('#slot-btn-pagemargins', this.btnPageMargins); _injectComponent('#slot-btn-pagesize', this.btnPageSize); @@ -1579,6 +1588,7 @@ define([ this.btnBlankPage.updateHint(this.tipBlankPage); this.btnInsertShape.updateHint(this.tipInsertShape); this.btnInsertEquation.updateHint(this.tipInsertEquation); + this.btnInsertSymbol.updateHint(this.tipInsertSymbol); this.btnDropCap.updateHint(this.tipDropCap); this.btnContentControls.updateHint(this.tipControls); this.btnColumns.updateHint(this.tipColumns); @@ -2324,7 +2334,9 @@ define([ capBtnWatermark: 'Watermark', textEditWatermark: 'Custom Watermark', textRemWatermark: 'Remove Watermark', - tipWatermark: 'Edit watermark' + tipWatermark: 'Edit watermark', + capBtnInsSymbol: 'Symbol', + tipInsertSymbol: 'Insert symbol' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index c752dd1d0..31a578370 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -299,6 +299,11 @@ "Common.Views.SignSettingsDialog.textShowDate": "Show sign date in signature line", "Common.Views.SignSettingsDialog.textTitle": "Signature Setup", "Common.Views.SignSettingsDialog.txtEmpty": "This field is required", + "Common.Views.SymbolTableDialog.textTitle": "Symbol Table", + "Common.Views.SymbolTableDialog.textFont": "Font", + "Common.Views.SymbolTableDialog.textRange": "Range", + "Common.Views.SymbolTableDialog.textRecent": "Recently used symbols", + "Common.Views.SymbolTableDialog.textCode": "Unicode HEX value", "DE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.
Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", "DE.Controllers.LeftMenu.newDocumentTitle": "Unnamed document", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", @@ -992,6 +997,7 @@ "DE.Controllers.Toolbar.txtSymbol_vdots": "Vertical ellipsis", "DE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "DE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", + "DE.Controllers.Toolbar.textInsert": "Insert", "DE.Controllers.Viewport.textFitPage": "Fit to Page", "DE.Controllers.Viewport.textFitWidth": "Fit to Width", "DE.Views.AddNewCaptionLabelDialog.textLabel": "Label:", @@ -2239,6 +2245,8 @@ "DE.Views.Toolbar.txtScheme7": "Equity", "DE.Views.Toolbar.txtScheme8": "Flow", "DE.Views.Toolbar.txtScheme9": "Foundry", + "DE.Views.Toolbar.capBtnInsSymbol": "Symbol", + "DE.Views.Toolbar.tipInsertSymbol": "Insert symbol", "DE.Views.WatermarkSettingsDialog.textAuto": "Auto", "DE.Views.WatermarkSettingsDialog.textBold": "Bold", "DE.Views.WatermarkSettingsDialog.textColor": "Text color", diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json index 800c93bea..44695cd59 100644 --- a/apps/documenteditor/main/locale/ru.json +++ b/apps/documenteditor/main/locale/ru.json @@ -299,6 +299,11 @@ "Common.Views.SignSettingsDialog.textShowDate": "Показывать дату подписи в строке подписи", "Common.Views.SignSettingsDialog.textTitle": "Настройка подписи", "Common.Views.SignSettingsDialog.txtEmpty": "Это поле необходимо заполнить", + "Common.Views.SymbolTableDialog.textTitle": "Symbol Table", + "Common.Views.SymbolTableDialog.textFont": "Шрифт", + "Common.Views.SymbolTableDialog.textRange": "Набор", + "Common.Views.SymbolTableDialog.textRecent": "Ранее использовавшиеся символы", + "Common.Views.SymbolTableDialog.textCode": "Код знака из Юникод (шестн.)", "DE.Controllers.LeftMenu.leavePageText": "Все несохраненные изменения в этом документе будут потеряны.
Нажмите кнопку \"Отмена\", а затем нажмите кнопку \"Сохранить\", чтобы сохранить их. Нажмите кнопку \"OK\", чтобы сбросить все несохраненные изменения.", "DE.Controllers.LeftMenu.newDocumentTitle": "Документ без имени", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Внимание", diff --git a/apps/documenteditor/main/resources/less/app.less b/apps/documenteditor/main/resources/less/app.less index cfeb6e07d..d07e1e5e4 100644 --- a/apps/documenteditor/main/resources/less/app.less +++ b/apps/documenteditor/main/resources/less/app.less @@ -118,6 +118,7 @@ @import "../../../../common/main/resources/less/toolbar.less"; @import "../../../../common/main/resources/less/language-dialog.less"; @import "../../../../common/main/resources/less/winxp_fix.less"; +@import "../../../../common/main/resources/less/symboltable.less"; // App // -------------------------------------------------- diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 54e414d37..64d75d653 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -49,6 +49,7 @@ define([ 'common/main/lib/view/InsertTableDialog', 'common/main/lib/view/SelectFileDlg', 'common/main/lib/view/ListSettingsDialog', + 'common/main/lib/view/SymbolTableDialog', 'common/main/lib/util/define', 'presentationeditor/main/app/collection/SlideThemes', 'presentationeditor/main/app/view/Toolbar', @@ -310,6 +311,7 @@ define([ toolbar.btnSlideSize.menu.on('item:click', _.bind(this.onSlideSize, this)); toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); + toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); toolbar.btnEditHeader.on('click', _.bind(this.onEditHeaderClick, this, 'header')); toolbar.btnInsDateTime.on('click', _.bind(this.onEditHeaderClick, this, 'datetime')); toolbar.btnInsSlideNum.on('click', _.bind(this.onEditHeaderClick, this, 'slidenum')); @@ -1825,6 +1827,28 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onInsertSymbolClick: function() { + if (this.api) { + var me = this, + win = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.toolbar.mode.lang, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + win.show(); + win.on('symbol:dblclick', function(cmp, settings) { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + }); + } + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; @@ -2528,7 +2552,8 @@ define([ txtMatrix_2_2_LineBracket : 'Empty Matrix with Brackets', txtMatrix_2_2_DLineBracket : 'Empty Matrix with Brackets', txtMatrix_Flat_Round : 'Sparse Matrix', - txtMatrix_Flat_Square : 'Sparse Matrix' + txtMatrix_Flat_Square : 'Sparse Matrix', + textInsert: 'Insert' }, PE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 0b8287bc6..4d5e1c3d2 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -129,6 +129,7 @@
+
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 13f52082c..a5cb95d6b 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -543,6 +543,15 @@ define([ }); me.slideOnlyControls.push(this.btnInsertEquation); + me.btnInsertSymbol = new Common.UI.Button({ + id: 'tlbtn-insertsymbol', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-symbol', + caption: me.capBtnInsSymbol, + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected] + }); + me.paragraphControls.push(me.btnInsertSymbol); + me.btnInsertHyperlink = new Common.UI.Button({ id: 'tlbtn-insertlink', cls: 'btn-toolbar x-huge icon-top', @@ -815,7 +824,7 @@ define([ this.btnSubscript, this.btnFontColor, this.btnClearStyle, this.btnCopyStyle, this.btnMarkers, this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign, this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertChart, - this.btnInsertEquation, this.btnInsertHyperlink, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings + this.btnInsertEquation, this.btnInsertSymbol, this.btnInsertHyperlink, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings ]; // Disable all components before load document @@ -933,6 +942,7 @@ define([ _injectComponent('#slot-btn-arrange-shape', this.btnShapeArrange); _injectComponent('#slot-btn-align-shape', this.btnShapeAlign); _injectComponent('#slot-btn-insertequation', this.btnInsertEquation); + _injectComponent('#slot-btn-inssymbol', this.btnInsertSymbol); _injectComponent('#slot-btn-insertlink', this.btnInsertHyperlink); _injectComponent('#slot-btn-inserttable', this.btnInsertTable); _injectComponent('#slot-btn-insertchart', this.btnInsertChart); @@ -1044,6 +1054,7 @@ define([ this.btnInsertTable.updateHint(this.tipInsertTable); this.btnInsertChart.updateHint(this.tipInsertChart); this.btnInsertEquation.updateHint(this.tipInsertEquation); + this.btnInsertSymbol.updateHint(this.tipInsertSymbol); this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')); this.btnInsertTextArt.updateHint(this.tipInsertTextArt); this.btnColorSchemas.updateHint(this.tipColorSchemas); @@ -1676,7 +1687,9 @@ define([ capBtnInsHeader: 'Header/Footer', capBtnSlideNum: 'Slide Number', capBtnDateTime: 'Date & Time', - textListSettings: 'List Settings' + textListSettings: 'List Settings', + capBtnInsSymbol: 'Symbol', + tipInsertSymbol: 'Insert symbol' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index e1c99e63b..77c8ffa81 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -220,6 +220,11 @@ "Common.Views.SignSettingsDialog.textShowDate": "Show sign date in signature line", "Common.Views.SignSettingsDialog.textTitle": "Signature Setup", "Common.Views.SignSettingsDialog.txtEmpty": "This field is required", + "Common.Views.SymbolTableDialog.textTitle": "Symbol Table", + "Common.Views.SymbolTableDialog.textFont": "Font", + "Common.Views.SymbolTableDialog.textRange": "Range", + "Common.Views.SymbolTableDialog.textRecent": "Recently used symbols", + "Common.Views.SymbolTableDialog.textCode": "Unicode HEX value", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", "PE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...", @@ -908,6 +913,7 @@ "PE.Controllers.Toolbar.txtSymbol_vdots": "Vertical ellipsis", "PE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "PE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", + "PE.Controllers.Toolbar.textInsert": "Insert", "PE.Controllers.Viewport.textFitPage": "Fit to Slide", "PE.Controllers.Viewport.textFitWidth": "Fit to Width", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", @@ -1798,5 +1804,7 @@ "PE.Views.Toolbar.txtScheme8": "Flow", "PE.Views.Toolbar.txtScheme9": "Foundry", "PE.Views.Toolbar.txtSlideAlign": "Align to Slide", - "PE.Views.Toolbar.txtUngroup": "Ungroup" + "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.capBtnInsSymbol": "Symbol", + "PE.Views.Toolbar.tipInsertSymbol": "Insert symbol" } \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index 0e0890b76..9f99ba211 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -114,6 +114,7 @@ @import "../../../../common/main/resources/less/toolbar.less"; @import "../../../../common/main/resources/less/language-dialog.less"; @import "../../../../common/main/resources/less/winxp_fix.less"; +@import "../../../../common/main/resources/less/symboltable.less"; // App // -------------------------------------------------- diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index f37309543..1c6b65022 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -44,6 +44,7 @@ define([ 'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/SelectFileDlg', + 'common/main/lib/view/SymbolTableDialog', 'common/main/lib/util/define', 'spreadsheeteditor/main/app/view/Toolbar', 'spreadsheeteditor/main/app/collection/TableTemplates', @@ -323,6 +324,7 @@ define([ toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this)); toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); + toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); toolbar.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this)); toolbar.btnPercentStyle.on('click', _.bind(this.onNumberFormat, this)); toolbar.btnCurrencyStyle.on('click', _.bind(this.onNumberFormat, this)); @@ -2763,6 +2765,28 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onInsertSymbolClick: function() { + if (this.api) { + var me = this, + win = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.toolbar.mode.lang, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + win.show(); + win.on('symbol:dblclick', function(cmp, settings) { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + }); + } + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; @@ -3811,7 +3835,8 @@ define([ textPivot: 'Pivot Table', txtTable_TableStyleMedium: 'Table Style Medium', txtTable_TableStyleDark: 'Table Style Dark', - txtTable_TableStyleLight: 'Table Style Light' + txtTable_TableStyleLight: 'Table Style Light', + textInsert: 'Insert' }, SSE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 9d812e6b3..b1f14757a 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -142,6 +142,7 @@
+
diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 08ac23eba..80741de00 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -714,6 +714,14 @@ define([ menu : new Common.UI.Menu({cls: 'menu-shapes'}) }); + me.btnInsertSymbol = new Common.UI.Button({ + id: 'tlbtn-insertsymbol', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-symbol', + caption: me.capBtnInsSymbol, + lock: [_set.selImage, _set.selChart, _set.selShape, _set.editFormula, _set.selRangeEdit, _set.coAuth, _set.coAuthText, _set.lostConnect] + }); + me.btnTableTemplate = new Common.UI.Button({ id : 'id-toolbar-btn-ttempl', cls : 'btn-toolbar', @@ -1459,7 +1467,7 @@ define([ me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft, me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop, me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor, me.btnInsertTable, - me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation, + me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation, me.btnInsertSymbol, me.btnInsertText, me.btnInsertTextArt, me.btnSortUp, me.btnSortDown, me.btnSetAutofilter, me.btnClearAutofilter, me.btnTableTemplate, me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell, me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink, @@ -1635,6 +1643,7 @@ define([ _injectComponent('#slot-btn-instext', this.btnInsertText); _injectComponent('#slot-btn-instextart', this.btnInsertTextArt); _injectComponent('#slot-btn-insequation', this.btnInsertEquation); + _injectComponent('#slot-btn-inssymbol', this.btnInsertSymbol); _injectComponent('#slot-btn-sortdesc', this.btnSortDown); _injectComponent('#slot-btn-sortasc', this.btnSortUp); _injectComponent('#slot-btn-setfilter', this.btnSetAutofilter); @@ -1717,6 +1726,7 @@ define([ _updateHint(this.btnInsertHyperlink, this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')); _updateHint(this.btnInsertShape, this.tipInsertShape); _updateHint(this.btnInsertEquation, this.tipInsertEquation); + _updateHint(this.btnInsertSymbol, this.tipInsertSymbol); _updateHint(this.btnSortDown, this.txtSortAZ); _updateHint(this.btnSortUp, this.txtSortZA); _updateHint(this.btnSetAutofilter, this.txtFilter + ' (Ctrl+Shift+L)'); @@ -2520,6 +2530,8 @@ define([ textManyPages: 'pages', textHeight: 'Height', textWidth: 'Width', - textMorePages: 'More pages' + textMorePages: 'More pages', + capBtnInsSymbol: 'Symbol', + tipInsertSymbol: 'Insert symbol' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 6463233b9..c363e0e39 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -214,6 +214,11 @@ "Common.Views.SignSettingsDialog.textShowDate": "Show sign date in signature line", "Common.Views.SignSettingsDialog.textTitle": "Signature Setup", "Common.Views.SignSettingsDialog.txtEmpty": "This field is required", + "Common.Views.SymbolTableDialog.textTitle": "Symbol Table", + "Common.Views.SymbolTableDialog.textFont": "Font", + "Common.Views.SymbolTableDialog.textRange": "Range", + "Common.Views.SymbolTableDialog.textRecent": "Recently used symbols", + "Common.Views.SymbolTableDialog.textCode": "Unicode HEX value", "SSE.Controllers.DataTab.textWizard": "Text to Columns", "SSE.Controllers.DocumentHolder.alignmentText": "Alignment", "SSE.Controllers.DocumentHolder.centerText": "Center", @@ -1098,6 +1103,7 @@ "SSE.Controllers.Toolbar.txtTable_TableStyleMedium": "Table Style Medium", "SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell.
Are you sure you want to continue?", + "SSE.Controllers.Toolbar.textInsert": "Insert", "SSE.Controllers.Viewport.textFreezePanes": "Freeze Panes", "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", @@ -2437,6 +2443,8 @@ "SSE.Views.Toolbar.txtTime": "Time", "SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells", "SSE.Views.Toolbar.txtYen": "¥ Yen", + "SSE.Views.Toolbar.capBtnInsSymbol": "Symbol", + "SSE.Views.Toolbar.tipInsertSymbol": "Insert symbol", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtItems": "Item", diff --git a/apps/spreadsheeteditor/main/resources/less/app.less b/apps/spreadsheeteditor/main/resources/less/app.less index 665d6f51e..5bd93bc68 100644 --- a/apps/spreadsheeteditor/main/resources/less/app.less +++ b/apps/spreadsheeteditor/main/resources/less/app.less @@ -115,6 +115,7 @@ @import "../../../../common/main/resources/less/toolbar.less"; @import "../../../../common/main/resources/less/language-dialog.less"; @import "../../../../common/main/resources/less/winxp_fix.less"; +@import "../../../../common/main/resources/less/symboltable.less"; // App // -------------------------------------------------- diff --git a/build/documenteditor.json b/build/documenteditor.json index 98abaf31c..954eb878c 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -151,6 +151,12 @@ "cwd": "../apps/documenteditor/main/resources/watermark", "src": "*", "dest": "../deploy/web-apps/apps/documenteditor/main/resources/watermark" + }, + { + "expand": true, + "cwd": "../apps/common/main/resources/symboltable", + "src": "*", + "dest": "../deploy/web-apps/apps/documenteditor/main/resources/symboltable" } ], "help": [ diff --git a/build/presentationeditor.json b/build/presentationeditor.json index 78f988361..8471938ef 100644 --- a/build/presentationeditor.json +++ b/build/presentationeditor.json @@ -145,6 +145,12 @@ "cwd": "../apps/presentationeditor/main/locale/", "src": "*", "dest": "../deploy/web-apps/apps/presentationeditor/main/locale/" + }, + { + "expand": true, + "cwd": "../apps/common/main/resources/symboltable", + "src": "*", + "dest": "../deploy/web-apps/apps/presentationeditor/main/resources/symboltable" } ], "help": [ diff --git a/build/spreadsheeteditor.json b/build/spreadsheeteditor.json index ecb9798a9..9e05fc9b8 100644 --- a/build/spreadsheeteditor.json +++ b/build/spreadsheeteditor.json @@ -159,6 +159,12 @@ "cwd": "../apps/spreadsheeteditor/main/resources/formula-lang", "src": "*", "dest": "../deploy/web-apps/apps/spreadsheeteditor/main/resources/formula-lang" + }, + { + "expand": true, + "cwd": "../apps/common/main/resources/symboltable", + "src": "*", + "dest": "../deploy/web-apps/apps/spreadsheeteditor/main/resources/symboltable" } ], "help": [