GithubHelp home page GithubHelp logo

vie-annotate's Introduction

VIE annotate widget

VIE and VIE² based annotation widget collection.

Usage

When the necessary widgets implemented this is the code needed for activating the annotation widget. Later this could be compiled into one widget.

$(document).ready(function() {
    // Make an element editable using the VIE.editable widget. 
    // Whenever a smartContentChange happens..
    $('#content').editable().bind('editablechanged', function(editedInfo){
        // .. analyze the content using VIE2.
        $(editedInfo.element).vie2('analyze')
        // for each enhancement found by VIE2, 
        .bind('enhancementFound', function(enhancementDetails){
            // get create a dom element containing only the occurrance of the found entity
            // (getOrCreateDomElement is to be implemented)
            var foundEntityDomEl = $(this).getOrCreateDomElement( 
                enhancementDetails.occurranceText, {
                    // create only if it doesn't have it's element already
                    createMode: 'existing', 
                    createElement: 'span', 
                    // only the first occurrence
                    mode: 'first', 
                    styleClass: 'enhancementFound'
                }
            );
            // Apply annotation widget
            // This maakes the occurrance clickable
            // On clicking on the word a pop-over shows the found enhancements
            // and the buttons Accept, Decline, [More]
            // on Accept the element gets RDFa annotated plus specific event
            // on Decline the marker gets removed plus specific event
            $(foundEntityDomEl).annotate({
                enhancement: enhancementDetails,
            });
        });
    });
    
});

vie-annotate's People

Stargazers

Olivier Grisel avatar

Watchers

Olivier Grisel avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.