Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#21411 from RudyLu/keyboard/Bug1027979_…
Browse files Browse the repository at this point in the history
…remove_PendingSymbols

Bug 1027979 - Remove more dead code from keyboard app.
r=timdream.
  • Loading branch information
RudyLu committed Jul 8, 2014
2 parents 97107ca + 6ed1412 commit d101974
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 81 deletions.
47 changes: 0 additions & 47 deletions apps/keyboard/js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -1114,7 +1068,6 @@ const IMERender = (function() {
'setUpperCaseLock': setUpperCaseLock,
'resizeUI': resizeUI,
'showCandidates': showCandidates,
'showPendingSymbols': showPendingSymbols,
'getWidth': getWidth,
'getHeight': getHeight,
'getKeyArray': getKeyArray,
Expand Down
34 changes: 0 additions & 34 deletions apps/keyboard/style/keyboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d101974

Please sign in to comment.