Skip to content

GlennS/zenpen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zenpen Toolbar

A deriviative of Zenpen (http://zenpen.io), adapted to be a JavaScript component that you can apply to many different elements on a page.

Modifications

Code Organisation

The code is now arranged as Node modules, so the editor factory can be loaded using the require statement.

I’ve moved everything to “use strict”;.

Added d3 as a dependency - I’m using it for event management and as a DOM helper library.

Multiple Dialogues

After creating a toolbar, call it as a function with a d3 selection to hook up events for that node.

UI Removal

I’ve removed the following features:

  • HTML local storage
  • Fullscreen
  • Word count and word count targets
  • Colour change

Links

Links now always refer to the browser window when we’re in an iframe (target=”_top”).

Run the Demo

First, clone the repository:

git clone git@github.com:GlennS/zenpen.git

Our Javascript files our arranged as node.js modules, and we use the ‘browserify’ tool to combine them into a single file.

Install Node JS. For example, on a Debian-based system using the package manager:

sudo aptitude update;
sudo aptitude install -y nodejs nodejs-legacy;

Next, install browserify using Node’s package manager npm:

sudo npm -g install browserify; # Install Browserify as a command you can run from your shell.

Run ‘make’, or run the appropriate commands manually if you do not have it:

# On Linux, Mac OS, BSD etc., or from mingw32/Git Bash

make; # Runs the build target, which will execute the commands below for you.

# On Windows (if you don't have mingw32).

npm install; # Install the various packages we depend on (listed in package.json).
browserify demo.js -o bin/main.js; # Package all the Javascript code together in a way that we can load into a browser.

Serve index.html using any web server. For example, using python3 on a Debian system:

sudo python3 -m http.server 80;

At this point you should be able to see the demo page on http://localhost.

Source Code

Get the source code.

Get the original source code from which this version is derived.

License

The Apache License

Copyright (C) 2014 ~ Tim Holman ~ timothy.w.holman@gmail.com

Modifications Copyright (C) 2015 Glenn Searby

About

ZenPen toolbar-only version as an npm module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 61.6%
  • CSS 29.3%
  • HTML 8.4%
  • Makefile 0.7%