<commit_before>/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.
 * Use of this source code is governed by a AGPL3 license that 
 * can be found in the LICENSE file. */

define(function(require, exports, module) {
"use strict";

	console.log("Loading viewerText");

    var extensionTitle = "IFrame Viewer";
    var extensionID = "viewerBrowser";  // ID should be equal to the directory name where the ext. is located   
    var extensionType =  "viewer";
    var extensionIcon = "icon-list";
    var extensionVersion = "1.0";
    var extensionManifestVersion = 1;
    var extensionLicense = "AGPL";
    var extensionSupportedFileTypes = [ "*" ];
	
	var TSCORE = require("tscore");	
	
	var containerElID = undefined;
	
	var extensionDirectory = TSCORE.Config.getExtensionPath()+"/"+extensionID;
	
	exports.init = function(filePath, containerElementID) {
	    console.log("Initalization Text Viewer...");
	    containerElID = containerElementID;

        var filePathURI = undefined;
        if(isCordova) {
            filePathURI = filePath;            
        } else {
            filePathURI = "file:///"+filePath;  
        }
        
        var fileExt = TSCORE.TagUtils.extractFileExtension(filePath);

        $('#'+containerElID).empty();        
        
        if((fileExt.indexOf("htm") == 0 || fileExt.indexOf("xhtm") == 0 || fileExt.indexOf("txt") == 0) && !isFirefox) {
	        $("#"+containerElID).append($('<iframe>', {
			    	id: "iframeViewer",
					"nwdisable": "",
					"nwfaketop": "",
	        	})
	        );
	     	TSCORE.IO.loadTextFile(filePath);	    	 
        } else {
        	$("#"+containerElID).append($('<iframe>', {
			    	id: "iframeViewer",
					src: filePathURI,
					"nwdisable": "",
					"nwfaketop": "",
	        	})
	        );
	    }
	};<commit_msg>setting the background color of the viewer to white<commit_after>/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.
 * Use of this source code is governed by a AGPL3 license that 
 * can be found in the LICENSE file. */

define(function(require, exports, module) {
"use strict";

	console.log("Loading viewerText");

    var extensionTitle = "IFrame Viewer";
    var extensionID = "viewerBrowser";  // ID should be equal to the directory name where the ext. is located   
    var extensionType =  "viewer";
    var extensionIcon = "icon-list";
    var extensionVersion = "1.0";
    var extensionManifestVersion = 1;
    var extensionLicense = "AGPL";
    var extensionSupportedFileTypes = [ "*" ];
	
	var TSCORE = require("tscore");	
	
	var containerElID = undefined;
	var $containerElement = undefined;	
	
	var extensionDirectory = TSCORE.Config.getExtensionPath()+"/"+extensionID;
	
	exports.init = function(filePath, containerElementID) {
	    console.log("Initalization Text Viewer...");
	    containerElID = containerElementID;
	    $containerElement = $('#'+containerElID);    

        var filePathURI = undefined;
        if(isCordova) {
            filePathURI = filePath;            
        } else {
            filePathURI = "file:///"+filePath;  
        }
        
        var fileExt = TSCORE.TagUtils.extractFileExtension(filePath);

        $containerElement.empty();        
        $containerElement.css("background-color","white");
        
        if((fileExt.indexOf("htm") == 0 || fileExt.indexOf("xhtm") == 0 || fileExt.indexOf("txt") == 0) && !isFirefox) {
        	$containerElement.append($('<iframe>', {
			    	id: "iframeViewer",
					"nwdisable": "",
					"nwfaketop": "",
	        	})
	        );
	     	TSCORE.IO.loadTextFile(filePath);	    	 
        } else {
        	$containerElement.append($('<iframe>', {
			    	id: "iframeViewer",
					src: filePathURI,
					"nwdisable": "",
					"nwfaketop": "",
	        	})
	        );
	    }
	};
{'fraction_non_alphanumeric': 0.13746065057712487, 'fraction_numerical': 0.007869884575026232, 'mean_word_length': 2.5305555555555554, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1990696', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1115, 'n_words': 262}