Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
--Signed-off-by: Ken Kumagai <theken@jp.ibm.com>
A fix for "Bug 414607 - [themes] export themes"
  • Loading branch information
theken55 committed Nov 17, 2013
1 parent 6cb5ca5 commit 3e833ec
Showing 1 changed file with 11 additions and 18 deletions.
Expand Up @@ -982,44 +982,37 @@ define(['i18n!orion/settings/nls/messages', 'orion/commands', 'orion/commandRegi
ThemeBuilder.prototype.exportTheme = exportTheme;

function exportTheme(data){
var background = "";
var keyword = "";
var foreground = "";
var string = "";
var singleLineComment = "";
var lineNumber = "";
var selectionBackground = "";
var dat = {};
for( var z in zones ){
if( !zones[z].paintchip ){
console.log(zones[z]);
var zone = zones[z];
if(zone.family == 'lineNumber' && !dat.hasOwnProperty('lineNumber')){// Line Numbers
if(zone.family === 'lineNumber' && !dat.hasOwnProperty('lineNumber')){
dat['lineNumber'] = zone.fill;
}else if(zone.family == 'background' && !dat.hasOwnProperty('background')){
}else if(zone.family === 'background' && !dat.hasOwnProperty('background')){
dat['background'] = zone.fill;
}else if(zone.family == 'string' && !dat.hasOwnProperty('string')){ // Strings, CSS Value
}else if(zone.family === 'string' && !dat.hasOwnProperty('string')){
dat['string'] = zone.fill;
}else if(zone.family == 'text' && !dat.hasOwnProperty('text')){ // Foreground, CSS Class Name, CSS Attribute,CSS Text, CSS Class Name
}else if(zone.family === 'text' && !dat.hasOwnProperty('text')){
dat['foreground'] = zone.fill;
}else if(zone.family == 'currentLine' && !dat.hasOwnProperty('currentLine')){ //
}else if(zone.family === 'currentLine' && !dat.hasOwnProperty('currentLine')){
dat['selectionBackground'] = zone.fill;
}else if(zone.family == 'comment' && !dat.hasOwnProperty('comment')){
}else if(zone.family === 'comment' && !dat.hasOwnProperty('comment')){
dat['singleLineComment'] = zone.fill;
}else if(zone.family == 'keyword' && !dat.hasOwnProperty('keyword')){ // HTML Tag, Keywords, CSS Class Name
}else if(zone.family === 'keyword' && !dat.hasOwnProperty('keyword')){
dat['keyword'] = zone.fill;
}else if(zone.family == 'overviewRuler' && !dat.hasOwnProperty('overviewRuler')){
}else if(zone.family === 'overviewRuler' && !dat.hasOwnProperty('overviewRuler')){
dat['overviewRuler'] = zone.fill;
}else if(zone.family == 'annotationRuler' && !dat.hasOwnProperty('annotationRuler')){ // Annotation Ruler
}else if(zone.family === 'annotationRuler' && !dat.hasOwnProperty('annotationRuler')){
dat['annotationRuler'] = zone.fill;
}else if(zone.family == 'attribute' && !dat.hasOwnProperty('attribute')){
}else if(zone.family === 'attribute' && !dat.hasOwnProperty('attribute')){
dat['attribute'] = zone.fill;
}
}
}
// During import, a color of background is used for both overviewRuler, anntationRuler. Export them for future enhancement.
// During import, attribute is not handled. Export it for future enhancement.
var currentStyle = '<colorTheme id="0" name="yourTheme"><background color="#background"/><singleLineComment color="#singleLineComment"/>' +
var currentStyle = '<colorTheme id="0" name="yourTheme"><background color="#background"/><singleLineComment color="#singleLineComment"/>' +
'<keyword color="#keyword"/><foreground color="#foreground"/><string color="#string"/><lineNumber color="#lineNumber"/><selectionBackground color="#selectionBackground"/>' +
'<overviewRuler color="#overviewRuler"/><annotationRuler color="#annotationRuler"/><attribute color="#attribute"/>' +
'</colorTheme>';
Expand Down

0 comments on commit 3e833ec

Please sign in to comment.