Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The Uploadcare Widget
JavaScript CoffeeScript HTML CSS Ruby

version

latest commit 48141bafb8
@homm homm authored

README.markdown

This is the Uploadcare widget source.

Build Status

Embedding

Add following code to your document's <head>.

<script>
  // Widget settings
  UPLOADCARE_PUBLIC_KEY = 'your_public_key';
</script>
<script src="https://ucarecdn.com/widget/x.y.z/uploadcare/uploadcare.full.min.js" charset="utf-8"></script>

Where x.y.z is widget version (2.0.6 for example). Here is also version without builtin jQuery:

<script>
  // Widget settings
  UPLOADCARE_PUBLIC_KEY = 'your_public_key';
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" charset="utf-8"></script>
<script src="https://ucarecdn.com/widget/x.y.z/uploadcare/uploadcare.min.js" charset="utf-8"></script>

The official Widget documentation has more information on using the widget itself.

Using with Bower

Install uploadcare using bower command:

$ bower install uploadcare

Add following code to your document's <head>.

<script>
  // Widget settings
  UPLOADCARE_PUBLIC_KEY = 'your_public_key';
</script>
<script src="/bower_components/jquery/jquery.js" charset="utf-8"></script>
<script src="/bower_components/uploadcare/uploadcare.js" charset="utf-8"></script>

Building Your Own

You need a working Ruby 1.9.3 environment with Bundler.

  • bundle install to get build dependencies.
  • bundle exec rake js:latest:build to build assets to the pkg/latest directory (with the “latest” suffix).
  • bundle exec rake js:release:build to build assets to the pkg/version folder (with the current version suffix). The version is specified in lib/uploadcare-widget/version.rb.

Development

Clone the repository, and go to test/dummy/. There is a simple Rails app. Run it:

bundle install
bundle update
bundle exec rails server

Open http://0.0.0.0:3000/ . Follow any link. There's going to be a widget or three. Edit code and reload page :-)

Testing

Jasminerice installed under the test/dummy/ Rails app.

To run tests in your browser go to http://0.0.0.0:3000/jasmine.

For more information see jasminerice docs.

guard-jasmine

To run tests in a terminal you must first install phantomjs.

Then you have two options:

  • run bundle exec guard start
  • run bundle exec guard-jasmine

The first one is for continuous tests execution, the second one runs tests just once. Both should be executed from the test/dummy/ directory.

See guard-jasmine docs for more information.

Something went wrong with that request. Please try again.