Code Monkey home page Code Monkey logo

cozy-editor's Introduction

Welcome to the fabulous CozyNote Editor

Simple, yet Towerfull : one day it will be !

Build

  • for production :
    • cd inTheFolder
    • brunch build --minify -c config-prod.coffee
    • js & css are in public/bin
  • for developement :
    • cd server-test
    • coffee server-test.coffee
    • cd ..
    • brunch w
    • code...
    • open localhost:3000 in your browser

## How to use

  • put in your project the js and css that are in public/bin
  • get the dependencies and add them to your project :
    • Jquery: V1.8.2 :
    • showdown : V0.3.1 : A javascript port of Markdown
    • rangy : V1.2.3 : a librairie that manages ranges and selection. Two modules are required : Rangy core and the Selection save and restore module.
  • to create a new editor in an iframe :
    • var myNewEditor = new CNeditor(iFrameRef,callBack)
    • where iframeRef is a ref to the iframe where you will embed your editor and callback is the ... callback to run after init of the editor.

About the Android/ folder

  • run sh amalgamer.sh [<targetNameHere>] to generate a JavaScript file that nestes an editor inside the element whose id is <targetNameHere\> or 'editorIframe' if no argument specified.

  • notice that target may not be an iFrame

The main object CNEditor

  • constructor(iframeTarget, callBack) : the editor is set within the specified iframe label.
  • note : an event called "onHistoryChanged" is triggered on the iframe nesting the editor whenever a content's modification occurs and is significant enough. The editor's content should be saved when it happens.
  • getEditorContent() : as expected, return the editor content
  • setEditorContent(mdContent) : same here... change the editor content
  • unDo() : ctrl-z
  • reDo() : ctrl-y
  • tab() : tab
  • and a lot more...

Install editor's environment

  1. Clone git repository and install dependancies
    • git clone https://github.com/Benibur/cozy-note-editor.git
    • cd cozy-note-editor
    • npm install
  2. These commands may be necessary... ?
    • git submodule init
    • git submodule update
  3. Install brunch and build inside of the project directory
    • sudo npm install brunch -g
    • brunch build

EBNF for CozyNote :

* Non-terminals : 
    * <CozyNote> : 
    * <note> : 
    * <ListParaTh> : Th = Title of type <h>
    * <ListParaTx> : Tx = Titlte of type Tu or To
    * <ParaTh> : 
    * <ParaTu> : Tu = Title of type <ul><li>
    * <ParaTo> : To = Title of type <ol><li>
    * <TitleTh> : 
    * <TitleTu> : 
    * <TitleTo> : 
    * <Txt> : 
    * <Tab> : 
* <CozyNote> ::= { (<TitleTh> <CozyNote>) (<TitleTh> <Note>) }* ;
* <Note> ::= <ListParaTh> | <ListParaTu> ;
* <ListParaTh> ::= <ParaTh>+ ;
* <ParaTh> ::= <TitleTh>  { (<LigneTh><ListParaTh>?) | (<LigneTh>|<ListParaTu>+) }* ;
* <TitleTh> ::= <Txt> ;
* <LigneTh> ::= <Txt> | <Tab> ;
* <ListParaTx> ::= <ParaTu>+ | <ParaTo>+ ;
* <ParaTu> ::= <TitleTu> {<LigneLu><ListParaTu>?}* ;
* <ParaTo> ::= <TitleTo> {<LigneLo><ListParaTo>?}* ;
* <TitleTu> ::= <Txt> ;
* <TitleTo> ::= <Txt> ;
* <LigneTu> ::= <Txt> | <Tab> ;
* <LigneTo> ::= <Txt> | <Tab> ;
* <Txt> ::= html text ;
* <Tab> ::= a table ;

Connection with html :

* <TitleTh>     : <div class="Th-xx" >  // 
* <TitleTu>     : <div class="Tu-xx" >  // paragraph title of unordered list
* <TitleTo>     : <div class="To-xx" >  // paragraph title of unordered list
* <LigneTh>     : <div class="Lh-xx" >  // paragraph line under a Tu
* <LigneTu>     : <div class="Lu-xx" >  // paragraph line under a Tu
* <LigneTo>     : <div class="Lo-xx" >  // paragraph line under a To
* <Txt>         : 
* <Num>         : 
* <Tab>         : 

What is Cozy?

Cozy Logo

Cozy is a platform that brings all your web services in the same private space. With it, your web apps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one profiles you. You install only the applications you want. You can build your own one too.

Community

You can reach the Cozy community via various support:

cozy-editor's People

Contributors

aenario avatar benibur avatar frankrousseau avatar jsilvestre avatar kelukelu avatar

Watchers

 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.