Merge arbelos fixes for opera widget for svgicons and locale to trunk

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1195 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2010-01-12 08:07:50 +00:00
parent 5a063726d0
commit f00068c02c
3 changed files with 33 additions and 7 deletions

View File

@ -34,7 +34,8 @@ var put_locale = function(svgCanvas, given_param){
}
var url = "locale/lang." + lang_param + ".js";
$.get(url, function(data){
var processFile = function(data){
var LangData = eval(data), js_strings;
$.each(LangData, function(i, data) {
if(data.id) {
@ -56,5 +57,16 @@ var put_locale = function(svgCanvas, given_param){
}
});
svgCanvas.setLang(lang_param, js_strings);
},"json");
}
$.ajax({
'url': url,
'dataType': "text",
success: processFile,
error: function(xhr) {
if(xhr.responseText) {
processFile(xhr.responseText);
}
}
});
};

View File

@ -160,10 +160,20 @@ $(function() {
getIcons('ajax');
});
},
error: function() {
$(function() {
useFallback();
});
error: function(err) {
// TODO: Fix Opera widget icon bug
if(window.opera) {
$(function() {
useFallback();
});
} else {
if(err.responseXML) {
svgdoc = err.responseXML;
$(function() {
getIcons('ajax');
});
}
}
}
});
}
@ -423,6 +433,10 @@ $(function() {
$(sel).each(function() {
this.setAttribute('width', w);
this.setAttribute('height', h);
if(window.opera && window.widget) {
this.parentNode.style.width = w + 'px';
this.parentNode.style.height = h + 'px';
}
});
});
}

View File

@ -33,7 +33,7 @@ $(function() {
}
},
'save':function(svg) {
'save':function(window, svg) {
try {
window.opera.io.filesystem.browseForSave(
new Date().getTime(), /* mountpoint name */