Merge pull request #667 from fourplusone/feature/cleaner_code

Removing unused code - All looks good, some minor tweeks are probably worthwhile  in the future.
This commit is contained in:
John McLear 2012-05-13 06:51:58 -07:00
commit c70d88eedc
15 changed files with 30 additions and 1083 deletions

View file

@ -58,7 +58,6 @@ var padeditor = (function()
self.setViewOptions(initialViewOptions);
// view bar
self.initViewZoom();
$("#viewbarcontents").show();
},
initViewOptions: function()
@ -106,36 +105,6 @@ var padeditor = (function()
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
$("#viewfontmenu").val(v ? "monospace" : "normal");
},
initViewZoom: function()
{
var viewZoom = Number(padcookie.getPref('viewZoom'));
if ((!viewZoom) || isNaN(viewZoom))
{
viewZoom = 100;
}
self.setViewZoom(viewZoom);
$("#viewzoommenu").change(function(evt)
{
// strip initial 'z' from val
self.setViewZoom(Number($("#viewzoommenu").val().substring(1)));
});
},
setViewZoom: function(percent)
{
if (!(percent >= 50 && percent <= 1000))
{
// percent is out of sane range or NaN (which fails comparisons)
return;
}
self.viewZoom = percent;
$("#viewzoommenu").val('z' + percent);
var baseSize = 13;
self.ace.setProperty('textsize', Math.round(baseSize * self.viewZoom / 100));
padcookie.setPref('viewZoom', percent);
},
dispose: function()
{
if (self.ace)