<embed-jsfiddle>
Web Component wrapper for jsFiddle's widgets using Polymer.
Maintained by Varun Malhotra.
Demo
Installation
Install the component using bower:
$ bower install embed-jsfiddle
Usage
Import Web Components' polyfill:
If using bower, then
<script src="bower_components/platform/platform.js"></script>Otherwise
<script src="http://cdnjs.cloudflare.com/ajax/libs/polymer/0.1.4/platform.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/polymer/0.1.4/polymer.js"></script>Import Custom Element:
If using bower, then include the below code inside
<head>...</head><link rel="import" href="bower_components/embed-jsfiddle/src/embed-jsfiddle.html">Else if using the
download as zipcopy, then include the below code inside<head>...</head><link rel="import" href="src/embed-jsfiddle.html">Start using it!
<embed-jsfiddle user="softvar" fiddleid="xxxxx"></embed-jsfiddle>
Setup
In order to run it locally you'll need a basic server setup.
- Install NodeJS.
Install GruntJS:
$ [sudo] npm install -g grunt-cliInstall local dependencies:
$ npm installRun a local server and open
http://localhost:8000.$ grunt connect
Or, you can have a bare minimum local server using python.
Clone this repo.
$ git clone https://github.com/softvar/embed-jsChange the drectory-path in terminal.
$ cd /path/to/this/dirRun a local server
# to run local server on specified `PORTNUMBER` $ python -m SimpleHTTPServer `PORTNUMBER`# to run local server on port:8000 $ python -m SimpleHTTPServerOpen and point your browser to http://locahost:8000.
Options
<embed-jsfiddle>
| Attribute | Options | Default | Description |
|---|---|---|---|
user |
string | `` | User who created it |
fiddleid |
string | `` | The ID of the Fiddle |
skin |
light, presentation |
light |
The skin layout |
tabs |
result,js,html,css |
result,js,html |
The tabs that are going to be rendered |
width |
int | 800 |
The width of the element |
height |
int | 300 |
The height of the element |
See jsFiddle Embed Options official documentation.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
History
For detailed changelog, check Releases.
License
MIT License © Varun Malhotra
Log in or sign up for Devpost to join the conversation.