Giter Site home page Giter Site logo

miu-imageupload's Introduction

Image/File Upload for MarkItUp!

markItUp! is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor.

This is a plugin for markItUp! to add the ability to browse for images and files to upload via ajax. A link to the file, or image tag is then returned to the editor.

This plugin supports Textile, Markdown and HTML.

Origin

This plugin was written for Perch – a light weight PHP content management system. This is a simplified, standalone version of the plugin shipped by default with Perch.

Installation

Copy the image_upload folder into your markitup folder.

Use the following to add the button to your toolbar. You may wish to replace the default ‘Pictures’ button.

{name:'Picture', className:'image-upload', closeWith:function(markItUp){miu.ImageUpload.upload(markItUp,'textile');}}, 
{name:'File', className:'file-upload', closeWith:function(markItUp){miu.ImageUpload.upload(markItUp,'textile',true);}},

Replace textile with markdown or html for your language of choice.

Upload Script

The supplied image_upload.php file performs an extremely basic file upload in PHP. Customise the paths at the start of the file to your system.

HTML Configuration

The plugin looks for three HTML5 data- attributes on your textarea tag, and if present, passes them along to the upload script:

  • data-width
  • data-height
  • data-crop

This can be used by the upload script for processing the image to match the context. This processing uses a Perch API, and so is not included with this version of the upload script. It could be easily implemented.

miu-imageupload's People

Stargazers

Shawn Crigger avatar

Watchers

James Cloos avatar Shawn Crigger 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.