From 6ed141216487234b8bf5c25b853efe316c2d130a Mon Sep 17 00:00:00 2001 From: Rudy Lu Date: Sat, 5 Jul 2014 17:31:01 +0800 Subject: [PATCH] Bug 1027979 - Remove more dead code from keyboard app. - Remove the pendingSymbols relate code. --- apps/keyboard/js/render.js | 47 -------------------------------- apps/keyboard/style/keyboard.css | 34 ----------------------- 2 files changed, 81 deletions(-) diff --git a/apps/keyboard/js/render.js b/apps/keyboard/js/render.js index 4cd4886f5298..398bf24df685 100644 --- a/apps/keyboard/js/render.js +++ b/apps/keyboard/js/render.js @@ -286,8 +286,6 @@ const IMERender = (function() { container.insertBefore( candidatePanelToggleButtonCode(), container.firstChild); container.insertBefore(candidatePanelCode(), container.firstChild); - container.insertBefore(pendingSymbolPanelCode(), container.firstChild); - showPendingSymbols(''); showCandidates([], true); container.classList.add('candidate-panel'); @@ -313,44 +311,6 @@ const IMERender = (function() { key.classList.remove('lowercase'); }; - // Show pending symbols with highlight (selection) if provided - var showPendingSymbols = function km_showPendingSymbols(symbols, - highlightStart, - highlightEnd, - highlightState) { - if (!activeIme) - return; - - var HIGHLIGHT_COLOR_TABLE = { - 'red': 'keyboard-pending-symbols-highlight-red', - 'green': 'keyboard-pending-symbols-highlight-green', - 'blue': 'keyboard-pending-symbols-highlight-blue' - }; - - // TODO: Save the element - var pendingSymbolPanel = - activeIme.querySelector('.keyboard-pending-symbol-panel'); - - if (pendingSymbolPanel) { - - if (typeof highlightStart === 'undefined' || - typeof highlightEnd === 'undefined' || - typeof highlightState === 'undefined') { - pendingSymbolPanel.textContent = symbols; - return; - } - - var span = document.createElement('span'); - span.className = HIGHLIGHT_COLOR_TABLE[highlightState]; - span.textContent = symbols.slice(highlightStart, highlightEnd); - - pendingSymbolPanel.innerHTML = ''; - pendingSymbolPanel.appendChild(span); - pendingSymbolPanel.appendChild( - document.createTextNode(symbols.substr(highlightEnd))); - } - }; - var toggleCandidatePanel = function(expand, resetScroll) { var candidatePanel = activeIme.querySelector('.keyboard-candidate-panel'); if (resetScroll) { @@ -869,12 +829,6 @@ const IMERender = (function() { // to be applied as dataset //* - var pendingSymbolPanelCode = function() { - var pendingSymbolPanel = document.createElement('div'); - pendingSymbolPanel.classList.add('keyboard-pending-symbol-panel'); - return pendingSymbolPanel; - }; - // Explicit call to mozL10n to translate the generated DOM element // to be removed once bug 992473 lands. var translateElement = function(el) { @@ -1114,7 +1068,6 @@ const IMERender = (function() { 'setUpperCaseLock': setUpperCaseLock, 'resizeUI': resizeUI, 'showCandidates': showCandidates, - 'showPendingSymbols': showPendingSymbols, 'getWidth': getWidth, 'getHeight': getHeight, 'getKeyArray': getKeyArray, diff --git a/apps/keyboard/style/keyboard.css b/apps/keyboard/style/keyboard.css index f5a1b0b9dfb5..b0379423aac7 100644 --- a/apps/keyboard/style/keyboard.css +++ b/apps/keyboard/style/keyboard.css @@ -378,27 +378,6 @@ bubble above the key when you tap and hold. */ border: none; } -/* IMEs */ -.keyboard-pending-symbol-panel { - position: absolute; - top: -3.5rem; - left: 0; - height: 3.2rem; - line-height: 3.2rem; - font-size: 2.4rem; - width: auto; - padding: 0 0.8rem; - background: rgba(245, 245, 245, 0.7); - color: rgb(36, 36, 36); - border-top: 0.1rem solid #d5d5d5; - border-right: 0.1rem solid #d5d5d5; - white-space: nowrap; -} - -.keyboard-pending-symbol-panel:empty { - display: none; -} - #keyboard.full-candidate-panel { padding-top: 3.4rem; } @@ -546,19 +525,6 @@ bubble above the key when you tap and hold. */ background: -moz-linear-gradient(bottom, rgb(191,191,183) 10%, rgb(161,158,153) 90%); } -/* Pending panel highlight */ -.keyboard-pending-symbols-highlight-green { - background: #33aa33; -} - -.keyboard-pending-symbols-highlight-red { - background: #aa3333; -} - -.keyboard-pending-symbols-highlight-blue { - background: #3333aa; -} - /* A note to show on the key to indicate the alternative char */ .alt-note { position: absolute;