How to use cwrc-git-dialogs - 2 common examples

To help you get started, we’ve selected a few cwrc-git-dialogs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cwrc / CWRC-WriterBase / test / forDebug / debug.js View on Github external
let CWRCWriterStorageDialogs = require('cwrc-git-dialogs');

// only continue loading the cwrcWriter if the user has authenticated with github
if (CWRCWriterStorageDialogs.authenticate()) {

    let viaf = require('viaf-entity-lookup')
    let dbpedia = require('dbpedia-entity-lookup');
    let wikidata = require('wikidata-entity-lookup');
    let getty = require('getty-entity-lookup');
    let geonames = require('geonames-entity-lookup');
    let CWRCWriterDialogs = require('cwrc-public-entity-dialogs');

    CWRCWriterDialogs.registerEntitySources({
        people: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('getty', getty).set('dbpedia', dbpedia),
        places: (new Map()).set('geonames', geonames).set('viaf', viaf).set('dbpedia', dbpedia).set('wikidata', wikidata),
        organizations: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('dbpedia', dbpedia),
        titles: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('dbpedia', dbpedia)
    })
    //window.CWRCWriterStorageDialogs = require('./storage-dialogs.js');
    let config = require('./config.js');
github cwrc / CWRC-GitWriter / src / js / app.js View on Github external
let wikidata = require('wikidata-entity-lookup');
    let getty = require('getty-entity-lookup');
    let geonames = require('geonames-entity-lookup');
    let CWRCWriterDialogs = require('cwrc-public-entity-dialogs');

    CWRCWriterDialogs.showNoLinkButton(true);
    CWRCWriterDialogs.showCreateNewButton(false);
    CWRCWriterDialogs.showEditButton(false);
    CWRCWriterDialogs.registerEntitySources({
        person: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('getty', getty).set('dbpedia', dbpedia),
        place: (new Map()).set('geonames', geonames).set('viaf', viaf).set('dbpedia', dbpedia).set('wikidata', wikidata),
        organization: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('dbpedia', dbpedia),
        title: (new Map()).set('viaf', viaf).set('wikidata', wikidata).set('dbpedia', dbpedia)
    })
    // window.CWRCWriterStorageDialogs = require('./storage-dialogs.js');
    let CWRCWriterStorageDialogs = require('cwrc-git-dialogs')['default'];
    let config = require('./config.js');
    config.container = 'cwrcWriterContainer';
    config.modules = {
        west: [ 'structure', 'entities', 'nerve' ],
        south: [ 'selection', 'validation' ],
        east: [ 'imageViewer' ]
    };
    config.entityLookupDialogs = CWRCWriterDialogs;
    config.storageDialogs = CWRCWriterStorageDialogs;
    
    let CWRCWriter = require('cwrc-writer-base');
    var writer = new CWRCWriter(config);

    writer.event('writerInitialized').subscribe(function() {
        if (writer.storageDialogs.authenticate()) {
            writer.showLoadDialog();

cwrc-git-dialogs

Dialogs for listing, loading, and saving CWRC XML documents.

GPL-2.0
Latest version published 3 years ago

Package Health Score

40 / 100
Full package analysis

Popular cwrc-git-dialogs functions