Enable loading a page and overwriting its contents with a file
This commit is contained in:
@@ -47,13 +47,9 @@ function MsgAreas() {
|
||||
writeln('Areas that we ARE managing mail:'+this.areas.length);
|
||||
|
||||
for(var x in this.areas_excluded) {
|
||||
/*
|
||||
writeln(this.areas_excluded[x].area_name = undefined
|
||||
? JSON.stringify(this.areas_excluded[x])
|
||||
: this.areas_excluded[x].area_name);
|
||||
*/
|
||||
writeln(JSON.stringify(this.areas_excluded[x]));
|
||||
exit();
|
||||
writeln(x+':'+((this.areas_excluded[x].area_name === undefined)
|
||||
? this.areas_excluded[x]
|
||||
: JSON.stringify(this.areas_excluded[x])));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -443,8 +443,7 @@ function Page(debug) {
|
||||
/**
|
||||
* Build in any input_fields with values
|
||||
*/
|
||||
this.build_input_fields = function()
|
||||
{
|
||||
this.build_input_fields = function() {
|
||||
var that = this;
|
||||
|
||||
var f = this.input_fields.filter(function(item) { return item.value.length; });
|
||||
@@ -836,7 +835,7 @@ function Page(debug) {
|
||||
throw new Error('page must be a PageObject');
|
||||
|
||||
// Load a page from disk first if it exists
|
||||
if (FRAMES_MSG_FILES && this.import(FRAMES_HOME+SESSION_EXT+'/'+page.toString()))
|
||||
if (FRAMES_MSG_FILES && this.import(FRAMES_HOME+SESSION_EXT+'/'+page.toString(),SESSION_EXT))
|
||||
return true;
|
||||
|
||||
// Fall back to loading from msgbase
|
||||
@@ -868,7 +867,7 @@ function Page(debug) {
|
||||
* @returns {boolean}
|
||||
* @todo Dont allow load() to load a Viewdata frame for an ANSItex session and visa-versa.
|
||||
*/
|
||||
this.import = function(filename,width,height) {
|
||||
this.import = function(filename,ext,width,height) {
|
||||
log(LOG_DEBUG,'|- Importing frame: ['+filename+']');
|
||||
|
||||
var f = new File(filename);
|
||||
@@ -881,7 +880,6 @@ function Page(debug) {
|
||||
f.close();
|
||||
|
||||
var valid_sauce = false;
|
||||
var ext = SESSION_EXT;
|
||||
|
||||
if (contents.substr(-128, 7) === 'SAUCE00') {
|
||||
ext = file_getext(filename).substr(1).toLowerCase();
|
||||
|
@@ -43,10 +43,12 @@ function rawtoattrs(contents,width,yoffset,xoffset,debug) {
|
||||
|
||||
// @todo temp hack, rework ansi variable - perhaps have a function that converts an attribute back into an ANSI sequence
|
||||
var ansi = { i: 0, f: 37, b: 40 };
|
||||
var line;
|
||||
var x;
|
||||
|
||||
while (lines.length > 0) {
|
||||
var x = 0;
|
||||
var line = lines.shift();
|
||||
x = 0;
|
||||
line = lines.shift();
|
||||
|
||||
if ((debug !== undefined) && (y > debug)) {
|
||||
exit(1);
|
||||
|
Reference in New Issue
Block a user