<commit_before>Paperpile.PdfExtractControl = Ext.extend(Ext.Panel, {
	
    matchPlugin:'PubMed',

    statusMsgTpl: [
        '<tpl if="number">',
        'There are <b>{number}</b> PDFs in the list not yet in your library. ',
        'The files can be matched against online resources and then imported. ',
        'Click <i>Import</i> in the toolbar to match and import files individually, ',
        'or import all files automatically by clicking the button below. ',
        '</tpl>',
        '<tpl if="!number">',
        'All files imported.',
        '</tpl>',

    ],

    markup: [
        '<div class="pp-box pp-box-style1"',
        '<h2>Import PDFs</h2>',
        '<p id="status-msg-{id}"></p>',
        '<div class="pp-control-container">',
        '<table><tr>',
        '</tr></table>',
        '</div>',
        '<div id="start-container-{id}" class="pp-control-container"></div>',
        '<p>&nbsp;</p>',
        '<div id="pbox-container-{id}" class="pp-control-container"></div>',
        '</div>',
	],

    initComponent: function() {
		Ext.apply(this, {
            cancelProcess:0,
			bodyStyle: {
				background: '#ffffff',
				padding: '7px'
			},
            autoScroll: true,
		});
		
        Paperpile.PDFmanager.superclass.initComponent.call(this);
	},

    getUnimportedList: function(){
        
        var list=[];

        this.grid.store.each(
            function(record){
                if (record.get('status') !='IMPORTED'){
                    list.push(record);
                }
            });

        return list;
    },

    updateView: function(){
        var list=this.getUnimportedList();

        if (list.length==0){
            this.startButton.disable();
        }
        
        var tpl= new Ext.XTemplate(this.statusMsgTpl);
        tpl.overwrite('status-msg-'+this.id, {number: list.length});
        
    },

    initControls: function(data){
        this.grid=this.ownerCt.ownerCt.items.get('west_panel').items.get('grid');

        var list=this.getUnimportedList();

        var tpl= new Ext.XTemplate(this.markup);

        tpl.overwrite(this.body, {number: list.length, id: this.id});

        this.updateView();
                
        this.startButton=new Ext.Button(
            { renderTo: "start-container-"+this.id,
              text: 'Match and import all PDFs',
              handler: function(){
                  this.importAll();
              },
              scope:this,
            });
        <commit_msg>Small fix.<commit_after>Paperpile.PdfExtractControl = Ext.extend(Ext.Panel, {
	
    matchPlugin:'PubMed',

    statusMsgTpl: [
        '<tpl if="number">',
        'There are <b>{number}</b> PDFs in the list not yet in your library. ',
        'The files can be matched against online resources and then imported. ',
        'Click <i>Import</i> in the toolbar to match and import files individually, ',
        'or import all files automatically by clicking the button below. ',
        '</tpl>',
        '<tpl if="!number">',
        'All files imported.',
        '</tpl>',

    ],

    markup: [
        '<div class="pp-box pp-box-style1"',
        '<h2>Import PDFs</h2>',
        '<p id="status-msg-{id}"></p>',
        '<div class="pp-control-container">',
        '<table><tr>',
        '</tr></table>',
        '</div>',
        '<div id="start-container-{id}" class="pp-control-container"></div>',
        '<p>&nbsp;</p>',
        '<div id="pbox-container-{id}" class="pp-control-container"></div>',
        '</div>',
	],

    initComponent: function() {
		Ext.apply(this, {
            cancelProcess:0,
			bodyStyle: {
				background: '#ffffff',
				padding: '7px'
			},
            autoScroll: true,
		});
		
        Paperpile.PDFmanager.superclass.initComponent.call(this);
	},

    getUnimportedList: function(){
        
        var list=[];

        this.grid.store.each(
            function(record){
                if (record.get('status') !='IMPORTED'){
                    list.push(record);
                }
            });

        return list;
    },

    updateView: function(){
        var list=this.getUnimportedList();

        var tpl= new Ext.XTemplate(this.statusMsgTpl);
        tpl.overwrite('status-msg-'+this.id, {number: list.length});

        if (list.length==0){
            this.startButton.disable();
        }
        
        
    },

    initControls: function(data){
        this.grid=this.ownerCt.ownerCt.items.get('west_panel').items.get('grid');

        var list=this.getUnimportedList();

        var tpl= new Ext.XTemplate(this.markup);

        tpl.overwrite(this.body, {number: list.length, id: this.id});

               
        this.startButton=new Ext.Button(
            { renderTo: "start-container-"+this.id,
              text: 'Match and import all PDFs',
              handler: function(){
                  this.importAll();
              },
              scope:this,
            });

        this.updateView();

        
{'fraction_non_alphanumeric': 0.1623415811707906, 'fraction_numerical': 0.0024140012070006035, 'mean_word_length': 1.8591144335825187, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 53, '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': '4724249', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1493, 'n_words': 291}