GithubHelp home page GithubHelp logo

isabella232 / atd-jquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/atd-jquery

0.0 0.0 0.0 96 KB

After the Deadline API for jQuery

License: Other

CSS 1.72% Shell 0.69% JavaScript 94.28% PHP 3.31%

atd-jquery's Introduction

atd-jquery

After the Deadline API for jQuery (1.3, 1.4.1) - README

After the Deadline is an open source software service that checks spelling, style, and grammar. This package contains an AtD API and examples for using After the Deadline in your web application.

Automattic no longer supports this library. We're putting it on Github so that you can feel free to fork it, hack it, and release your own version.

AtD API

Quick Start

The API above gives you full control over what AtD does. If you'd like to get going quicker and you have a basic form, then the jQuery style API is what you want. To attach AtD to a textarea:

$(textarea).addProofreader({ edit_text_content: 'Edit Text', proofread_content: 'Proofread' );

This call will also hook the parent form's submit event to restore the textarea for you.

You can customize the HTML used for the proofread and edit text links. If you want to communicate using a proxy, set AtD.rpc and AtD.api_key to the appropriate values and the proofreader will use that communication method instead.

Customizing

You may customize the suggestions menu and the error styles in css/atd.css.

Examples

The best way to learn to use the AtD API is to look at the examples and adapt them to your needs. The two examples included are:

Localization

To localize the strings in this extension, create an object with the localized strings. Here is an example:

var my_plugin_strings = {
   menu_title_spelling: "Spelling",
   menu_title_repeated_word: "Repeated  Word",
   menu_title_no_suggestions: "No suggestions",
   menu_option_explain: "Explain...",
   menu_option_ignore_once: "Ignore suggestion",
   menu_option_ignore_all: "Ignore all",
   menu_option_ignore_always: "Ignore always",
   menu_option_edit_selection: "Edit Selection...",
   message_no_errors_found: "No writing errors were found.",
   message_server_error_short: "There was a problem communicating with the After the Deadline service.",
   dialog_replace_selection: "Replace selection with:"
};

Then make AtD use these strings:

AtD.addI18n(my_plugin_strings);

These string labels are compatible with the AtD/TinyMCE extension.

Commercial use and running your own server

This library requires a running instance of an AtD server. Automattic operates an instance that you can use for personal projects as long as you don't send too much traffic. This library are configured to use this server by default.

For high volume and commercial uses of AtD, you must run your own server. The code is available on Github: After the Deadline Server. See the After the Deadline Developer's page for more information, and check out the AtD Developers Google Group for discussion and community support.

When you run your own server, replace service.afterthedeadline.com with your server's hostname.

AtD and Encoding

As a final note, make sure your webpage is encoded in UTF-8 format. AJAX requests use the encoding of the parent website and AtD expects UTF-8. This is important as AtD has better support for accented characters and languages beyond English.

License

Unless otherwise noted, the resources here are dual licensed under LGPL and MIT license.

The files scripts/csshttprequest.js and server/cssencode.php are © 2008-2009 nb.io and are licensed under the BSD license.

Contact

We (Automattic) are no longer supporting this library. This code has always been open source. We're putting it on Github so that you can feel free to fork it, hack it, and release your own version.

Join the atd-developers list for community support.

atd-jquery's People

Contributors

martinremy 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.