Skip to content

Commit

Permalink
Merge pull request #3016 from ONLYOFFICE/fix/color-schema
Browse files Browse the repository at this point in the history
Fix/color schema
  • Loading branch information
JuliaRadzhabova authored May 30, 2024
2 parents 167d307 + 16e95db commit ec5c5e0
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 268 deletions.
31 changes: 30 additions & 1 deletion apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ define([
'Heading 6', 'Heading 7', 'Heading 8', 'Heading 9', 'Title', 'Subtitle', 'Quote', 'Intense Quote', 'List Paragraph', 'footnote text',
'Caption', 'endnote text', 'Default Paragraph Font', 'No List', 'Intense Emphasis', 'Intense Reference', 'Subtle Emphasis', 'Emphasis',
'Strong', 'Subtle Reference', 'Book Title', 'footnote reference', 'endnote reference'],
schemeNames = ['Aspect', 'Blue Green', 'Blue II', 'Blue Warm', 'Blue', 'Grayscale', 'Green Yellow', 'Green', 'Marquee', 'Median', 'Office 2007 - 2010', 'Office 2013 - 2022', 'Office',
'Orange Red', 'Orange', 'Paper', 'Red Orange', 'Red Violet', 'Red', 'Slipstream', 'Violet II', 'Violet', 'Yellow Orange', 'Yellow'],
translate = {
'Series': this.txtSeries,
'Diagram Title': this.txtDiagramTitle,
Expand Down Expand Up @@ -156,6 +158,9 @@ define([
styleNames.forEach(function(item){
translate[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item;
});
schemeNames.forEach(function(item){
translate[item] = me['txtScheme_' + item.replace(/[ -]/g, '_')] || item;
});
me.translationTable = translate;
},

Expand Down Expand Up @@ -3612,7 +3617,31 @@ define([
txtStyle_Subtle_Reference: 'Subtle reference',
txtStyle_Book_Title: 'Book Title',
txtStyle_footnote_reference: 'Footnote reference',
txtStyle_endnote_reference: 'Endnote reference'
txtStyle_endnote_reference: 'Endnote reference',
txtScheme_Aspect: 'Aspect',
txtScheme_Blue_Green: 'Blue Green',
txtScheme_Blue_II: 'Blue II',
txtScheme_Blue_Warm: 'Blue Warm',
txtScheme_Blue: 'Blue',
txtScheme_Grayscale: 'Grayscale',
txtScheme_Green_Yellow: 'Green Yellow',
txtScheme_Green: 'Green',
txtScheme_Marquee: 'Marquee',
txtScheme_Median: 'Median',
txtScheme_Office_2007___2010: 'Office 2007 - 2010',
txtScheme_Office_2013___2022: 'Office 2013 - 2022',
txtScheme_Office: 'Office',
txtScheme_Orange_Red: 'Orange Red',
txtScheme_Orange: 'Orange',
txtScheme_Paper: 'Paper',
txtScheme_Red_Orange: 'Red Orange',
txtScheme_Red_Violet: 'Red Violet',
txtScheme_Red: 'Red',
txtScheme_Slipstream: 'Slipstream',
txtScheme_Violet_II: 'Violet II',
txtScheme_Violet: 'Violet',
txtScheme_Yellow_Orange: 'Yellow Orange',
txtScheme_Yellow: 'Yellow'
}
})(), DE.Controllers.Main || {}))
});
35 changes: 2 additions & 33 deletions apps/documenteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ define([
* UI Components
*/

this.SchemeNames = [ this.txtScheme22,
this.txtScheme1, this.txtScheme2, this.txtScheme3, this.txtScheme4, this.txtScheme5,
this.txtScheme6, this.txtScheme7, this.txtScheme8, this.txtScheme9, this.txtScheme10,
this.txtScheme11, this.txtScheme12, this.txtScheme13, this.txtScheme14, this.txtScheme15,
this.txtScheme16, this.txtScheme17, this.txtScheme18, this.txtScheme19, this.txtScheme20,
this.txtScheme21
];

this.paragraphControls = [];
this.toolbarControls = [];
this.textOnlyControls = [];
Expand Down Expand Up @@ -3178,17 +3170,16 @@ define([
schemecolors.push(clr);
}

if (index == 22) {
if (index == 24) {
this.mnuColorSchema.addItem({
caption: '--'
});
}
var name = schema.get_name();
this.mnuColorSchema.addItem({
template: itemTemplate,
cls: 'color-schemas-menu',
colors: schemecolors,
caption: (index < 22) ? (me.SchemeNames[index] || name) : name,
caption: schema.get_name(),
value: index,
checkable: true,
toggleGroup: 'menuSchema'
Expand Down Expand Up @@ -3483,27 +3474,6 @@ define([
textInText: 'In Text',
textInMargin: 'In Margin',
tipDropCap: 'Insert drop cap',
txtScheme1: 'Office',
txtScheme2: 'Grayscale',
txtScheme3: 'Apex',
txtScheme4: 'Aspect',
txtScheme5: 'Civic',
txtScheme6: 'Concourse',
txtScheme7: 'Equity',
txtScheme8: 'Flow',
txtScheme9: 'Foundry',
txtScheme10: 'Median',
txtScheme11: 'Metro',
txtScheme12: 'Module',
txtScheme13: 'Opulent',
txtScheme14: 'Oriel',
txtScheme15: 'Origin',
txtScheme16: 'Paper',
txtScheme17: 'Solstice',
txtScheme18: 'Technic',
txtScheme19: 'Trek',
txtScheme20: 'Urban',
txtScheme21: 'Verve',
textInsPageBreak: 'Insert Page Break',
textInsColumnBreak: 'Insert Column Break',
textInsSectionBreak: 'Insert Section Break',
Expand Down Expand Up @@ -3624,7 +3594,6 @@ define([
mniToggleCase: 'tOGGLE cASE',
textChangeLevel: 'Change List Level',
mniTextToTable: 'Convert Text to Table',
txtScheme22: 'New Office',
mniFromFile: 'From File',
mniFromUrl: 'From URL',
mniFromStorage: 'From Storage',
Expand Down
69 changes: 47 additions & 22 deletions apps/documenteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,30 @@
"DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Main.txtScheme_Aspect": "Aspect",
"DE.Controllers.Main.txtScheme_Blue_Green": "Blue Green",
"DE.Controllers.Main.txtScheme_Blue_II": "Blue II",
"DE.Controllers.Main.txtScheme_Blue_Warm": "Blue Warm",
"DE.Controllers.Main.txtScheme_Blue": "Blue",
"DE.Controllers.Main.txtScheme_Grayscale": "Grayscale",
"DE.Controllers.Main.txtScheme_Green_Yellow": "Green Yellow",
"DE.Controllers.Main.txtScheme_Green": "Green",
"DE.Controllers.Main.txtScheme_Marquee": "Marquee",
"DE.Controllers.Main.txtScheme_Median": "Median",
"DE.Controllers.Main.txtScheme_Office_2007___2010": "Office 2007 - 2010",
"DE.Controllers.Main.txtScheme_Office_2013___2022": "Office 2013 - 2022",
"DE.Controllers.Main.txtScheme_Office": "Office",
"DE.Controllers.Main.txtScheme_Orange_Red": "Orange Red",
"DE.Controllers.Main.txtScheme_Orange": "Orange",
"DE.Controllers.Main.txtScheme_Paper": "Paper",
"DE.Controllers.Main.txtScheme_Red_Orange": "Red Orange",
"DE.Controllers.Main.txtScheme_Red_Violet": "Red Violet",
"DE.Controllers.Main.txtScheme_Red": "Red",
"DE.Controllers.Main.txtScheme_Slipstream": "Slipstream",
"DE.Controllers.Main.txtScheme_Violet_II": "Violet II",
"DE.Controllers.Main.txtScheme_Violet": "Violet",
"DE.Controllers.Main.txtScheme_Yellow_Orange": "Yellow Orange",
"DE.Controllers.Main.txtScheme_Yellow": "Yellow",
"DE.Controllers.Navigation.txtBeginning": "Beginning of document",
"DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
"DE.Controllers.Print.textMarginsLast": "Last Custom",
Expand Down Expand Up @@ -3510,28 +3534,29 @@
"DE.Views.Toolbar.txtMarginAlign": "Align to margin",
"DE.Views.Toolbar.txtObjectsAlign": "Align selected objects",
"DE.Views.Toolbar.txtPageAlign": "Align to page",
"DE.Views.Toolbar.txtScheme1": "Office",
"DE.Views.Toolbar.txtScheme10": "Median",
"DE.Views.Toolbar.txtScheme11": "Metro",
"DE.Views.Toolbar.txtScheme12": "Module",
"DE.Views.Toolbar.txtScheme13": "Opulent",
"DE.Views.Toolbar.txtScheme14": "Oriel",
"DE.Views.Toolbar.txtScheme15": "Origin",
"DE.Views.Toolbar.txtScheme16": "Paper",
"DE.Views.Toolbar.txtScheme17": "Solstice",
"DE.Views.Toolbar.txtScheme18": "Technic",
"DE.Views.Toolbar.txtScheme19": "Trek",
"DE.Views.Toolbar.txtScheme2": "Grayscale",
"DE.Views.Toolbar.txtScheme20": "Urban",
"DE.Views.Toolbar.txtScheme21": "Verve",
"DE.Views.Toolbar.txtScheme22": "New Office",
"DE.Views.Toolbar.txtScheme3": "Apex",
"DE.Views.Toolbar.txtScheme4": "Aspect",
"DE.Views.Toolbar.txtScheme5": "Civic",
"DE.Views.Toolbar.txtScheme6": "Concourse",
"DE.Views.Toolbar.txtScheme7": "Equity",
"DE.Views.Toolbar.txtScheme8": "Flow",
"DE.Views.Toolbar.txtScheme9": "Foundry",
"del_DE.Views.Toolbar.txtScheme1": "Office",
"del_DE.Views.Toolbar.txtScheme10": "Median",
"del_DE.Views.Toolbar.txtScheme11": "Metro",
"del_DE.Views.Toolbar.txtScheme12": "Module",
"del_DE.Views.Toolbar.txtScheme13": "Opulent",
"del_DE.Views.Toolbar.txtScheme14": "Oriel",
"del_DE.Views.Toolbar.txtScheme15": "Origin",
"del_DE.Views.Toolbar.txtScheme16": "Paper",
"del_DE.Views.Toolbar.txtScheme17": "Solstice",
"del_DE.Views.Toolbar.txtScheme18": "Technic",
"del_DE.Views.Toolbar.txtScheme19": "Trek",
"del_DE.Views.Toolbar.txtScheme2": "Grayscale",
"del_DE.Views.Toolbar.txtScheme20": "Urban",
"del_DE.Views.Toolbar.txtScheme21": "Verve",
"del_DE.Views.Toolbar.txtScheme22": "New Office",
"del_DE.Views.Toolbar.txtScheme3": "Apex",
"del_DE.Views.Toolbar.txtScheme4": "Aspect",
"del_DE.Views.Toolbar.txtScheme5": "Civic",
"del_DE.Views.Toolbar.txtScheme6": "Concourse",
"del_DE.Views.Toolbar.txtScheme7": "Equity",
"del_DE.Views.Toolbar.txtScheme8": "Flow",
"del_DE.Views.Toolbar.txtScheme9": "Foundry",
"DE.Views.Toolbar.capColorScheme": "Color Scheme",
"DE.Views.ViewTab.textAlwaysShowToolbar": "Always Show Toolbar",
"DE.Views.ViewTab.textDarkDocument": "Dark Document",
"DE.Views.ViewTab.textFitToPage": "Fit To Page",
Expand Down
70 changes: 47 additions & 23 deletions apps/documenteditor/mobile/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,31 @@
"Subtle Reference": "Subtle Reference",
"Book Title":"Book Title",
"footnote reference": "Footnote reference",
"endnote reference": "Endnote reference"
"endnote reference": "Endnote reference",
"Aspect": "Aspect",
"Blue Green": "Blue Green",
"Blue II": "Blue II",
"Blue Warm": "Blue Warm",
"Blue": "Blue",
"Grayscale": "Grayscale",
"Green Yellow": "Green Yellow",
"Green": "Green",
"Marquee": "Marquee",
"Median": "Median",
"Office 2007 - 2010": "Office 2007 - 2010",
"Office 2013 - 2022": "Office 2013 - 2022",
"Office": "Office",
"Orange Red": "Orange Red",
"Orange": "Orange",
"Paper": "Paper",
"Red Orange": "Red Orange",
"Red Violet": "Red Violet",
"Red": "Red",
"Slipstream": "Slipstream",
"Violet II": "Violet II",
"Violet": "Violet",
"Yellow Orange": "Yellow Orange",
"Yellow": "Yellow"
},
"textAnonymous": "Anonymous",
"textBuyNow": "Visit website",
Expand Down Expand Up @@ -775,28 +799,28 @@
"txtIncorrectPwd": "Password is incorrect",
"txtOk": "Ok",
"txtProtected": "Once you enter the password and open the file, the current password will be reset",
"txtScheme1": "Office",
"txtScheme10": "Median",
"txtScheme11": "Metro",
"txtScheme12": "Module",
"txtScheme13": "Opulent",
"txtScheme14": "Oriel",
"txtScheme15": "Origin",
"txtScheme16": "Paper",
"txtScheme17": "Solstice",
"txtScheme18": "Technic",
"txtScheme19": "Trek",
"txtScheme2": "Grayscale",
"txtScheme20": "Urban",
"txtScheme21": "Verve",
"txtScheme22": "New Office",
"txtScheme3": "Apex",
"txtScheme4": "Aspect",
"txtScheme5": "Civic",
"txtScheme6": "Concourse",
"txtScheme7": "Equity",
"txtScheme8": "Flow",
"txtScheme9": "Foundry"
"del_txtScheme1": "Office",
"del_txtScheme10": "Median",
"del_txtScheme11": "Metro",
"del_txtScheme12": "Module",
"del_txtScheme13": "Opulent",
"del_txtScheme14": "Oriel",
"del_txtScheme15": "Origin",
"del_txtScheme16": "Paper",
"del_txtScheme17": "Solstice",
"del_txtScheme18": "Technic",
"del_txtScheme19": "Trek",
"del_txtScheme2": "Grayscale",
"del_txtScheme20": "Urban",
"del_txtScheme21": "Verve",
"del_txtScheme22": "New Office",
"del_txtScheme3": "Apex",
"del_txtScheme4": "Aspect",
"del_txtScheme5": "Civic",
"del_txtScheme6": "Concourse",
"del_txtScheme7": "Equity",
"del_txtScheme8": "Flow",
"del_txtScheme9": "Foundry"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
Expand Down
7 changes: 6 additions & 1 deletion apps/documenteditor/mobile/src/controller/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ class MainController extends Component {
"Book Title":"Book Title",
"footnote reference": "Footnote reference",
"endnote reference": "Endnote reference"
}
};
let me = this;
['Aspect', 'Blue Green', 'Blue II', 'Blue Warm', 'Blue', 'Grayscale', 'Green Yellow', 'Green', 'Marquee', 'Median', 'Office 2007 - 2010', 'Office 2013 - 2022', 'Office',
'Orange Red', 'Orange', 'Paper', 'Red Orange', 'Red Violet', 'Red', 'Slipstream', 'Violet II', 'Violet', 'Yellow Orange', 'Yellow'].forEach(function(item){
me.fallbackSdkTranslations[item] = item;
});

this._state = {
licenseType: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,15 @@ const PageDocumentColorSchemes = props => {
const [stateScheme, setScheme] = useState(curScheme);
const storeSettings = props.storeDocumentSettings;
const allSchemes = storeSettings.allSchemes;
const SchemeNames = [ t('Settings.txtScheme22'),
t('Settings.txtScheme1'), t('Settings.txtScheme2'), t('Settings.txtScheme3'), t('Settings.txtScheme4'),
t('Settings.txtScheme5'), t('Settings.txtScheme6'), t('Settings.txtScheme7'), t('Settings.txtScheme8'),
t('Settings.txtScheme9'), t('Settings.txtScheme10'), t('Settings.txtScheme11'), t('Settings.txtScheme12'),
t('Settings.txtScheme13'), t('Settings.txtScheme14'), t('Settings.txtScheme15'), t('Settings.txtScheme16'),
t('Settings.txtScheme17'), t('Settings.txtScheme18'), t('Settings.txtScheme19'), t('Settings.txtScheme20'),
t('Settings.txtScheme21')
];

return (
<Page>
<Navbar title={t('Settings.textColorSchemes')} backLink={t('Settings.textBack')} />
<List>
{
allSchemes ? allSchemes.map((scheme, index) => {
const name = scheme.get_name();
return (
<ListItem radio={true} className="color-schemes-menu no-fastclick" key={index} title={(index < 22) ? (SchemeNames[index] || name) : name} checked={stateScheme === index}
<ListItem radio={true} className="color-schemes-menu no-fastclick" key={index} title={scheme.get_name()} checked={stateScheme === index}
onChange={() => {
setScheme(index);
setTimeout(() => props.onColorSchemeChange(index), 10);
Expand Down
31 changes: 30 additions & 1 deletion apps/presentationeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ define([

var me = this,
themeNames = ['blank', 'pixel', 'classic', 'official', 'green', 'lines', 'office', 'safari', 'dotted', 'corner', 'turtle', 'basic', 'office theme', 'green leaf'],
schemeNames = ['Aspect', 'Blue Green', 'Blue II', 'Blue Warm', 'Blue', 'Grayscale', 'Green Yellow', 'Green', 'Marquee', 'Median', 'Office 2007 - 2010', 'Office 2013 - 2022', 'Office',
'Orange Red', 'Orange', 'Paper', 'Red Orange', 'Red Violet', 'Red', 'Slipstream', 'Violet II', 'Violet', 'Yellow Orange', 'Yellow'],
translate = {
'Series': this.txtSeries,
'Diagram Title': this.txtDiagramTitle,
Expand Down Expand Up @@ -135,6 +137,9 @@ define([
themeNames.forEach(function(item){
translate[item] = me['txtTheme_' + item.replace(/ /g, '_')] || item;
});
schemeNames.forEach(function(item){
translate[item] = me['txtScheme_' + item.replace(/[ -]/g, '_')] || item;
});
me.translationTable = translate;
},

Expand Down Expand Up @@ -3253,7 +3258,31 @@ define([
warnLicenseBefore: 'License not active.<br>Please contact your administrator.',
titleLicenseNotActive: 'License not active',
warnLicenseAnonymous: 'Access denied for anonymous users. This document will be opened for viewing only.',
textObject: 'Object'
textObject: 'Object',
txtScheme_Aspect: 'Aspect',
txtScheme_Blue_Green: 'Blue Green',
txtScheme_Blue_II: 'Blue II',
txtScheme_Blue_Warm: 'Blue Warm',
txtScheme_Blue: 'Blue',
txtScheme_Grayscale: 'Grayscale',
txtScheme_Green_Yellow: 'Green Yellow',
txtScheme_Green: 'Green',
txtScheme_Marquee: 'Marquee',
txtScheme_Median: 'Median',
txtScheme_Office_2007___2010: 'Office 2007 - 2010',
txtScheme_Office_2013___2022: 'Office 2013 - 2022',
txtScheme_Office: 'Office',
txtScheme_Orange_Red: 'Orange Red',
txtScheme_Orange: 'Orange',
txtScheme_Paper: 'Paper',
txtScheme_Red_Orange: 'Red Orange',
txtScheme_Red_Violet: 'Red Violet',
txtScheme_Red: 'Red',
txtScheme_Slipstream: 'Slipstream',
txtScheme_Violet_II: 'Violet II',
txtScheme_Violet: 'Violet',
txtScheme_Yellow_Orange: 'Yellow Orange',
txtScheme_Yellow: 'Yellow'
}
})(), PE.Controllers.Main || {}))
});
Loading

0 comments on commit ec5c5e0

Please sign in to comment.