Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaporopudas committed Jul 10, 2015
1 parent d435419 commit 94d637c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -21,7 +21,7 @@ Full documentation can be found [here](http://madebymany.github.io/sir-trevor-js
1. [Sir Trevor Rails](http://github.com/madebymany/sir-trevor-rails)
2. [Umbraco 7](https://github.com/mindrevolution/SirTrevor-for-Umbraco), [Umbraco 6](http://our.umbraco.org/projects/backoffice-extensions/skybrud-sir-trevor-editor)
3. [CakePHP](http://github.com/martinbean/cakephp-sir-trevor-plugin)
4. [Wordpress](https://github.com/raffij/sir-trevor-wordpress)
4. [Wordpress](https://github.com/neyre/sir-trevor-wp) && [Wordpress](https://github.com/raffij/sir-trevor-wordpress)
5. [Laravel](https://github.com/caouecs/Laravel4-SirTrevorJS)
6. [Django](https://github.com/philippbosch/django-sirtrevor)
7. [Yii Framework](https://github.com/DrMabuse23/yii2-sir-trevor-js)
Expand Down
1 change: 1 addition & 0 deletions contributing.md
Expand Up @@ -7,6 +7,7 @@ Here are a few ways you can help make SirTrevor better!
[Chris Bell](https://github.com/cjbell88),
[Andy Walker](https://github.com/ninjabiscuit),
[Andrew Sprinz](https://github.com/andrewsprinz),
[Łukasz Sągol](https://github.com/lukaszsagol),
[Ilya Poropudas](https://github.com/ilyaporopudas)


Expand Down
66 changes: 66 additions & 0 deletions spec/javascripts/units/block/video.spec.js
@@ -0,0 +1,66 @@
"use strict";

var utils = require('../../../../src/utils');

describe('Blocks: Video block', function() {

var createBlock = function(type, data) {
var element = $("<textarea>");
var editor = new SirTrevor.Editor({ el: element });
var options = editor.block_manager.blockOptions;
var Klass = SirTrevor.Blocks[utils.classify(type)];
var block = new Klass(data, editor.id, editor.mediator, options);
editor.renderBlock(block);

return block;
};

describe('initialize', function() {
it('creates a video block', function() {
var block = createBlock('video');
expect(block).not.toBe(undefined);
});

it('test URL formats', function() {

var urls = {
youtube: [
'http://www.youtube.com/watch?v=-wtIMTCHWuI',
'http://www.youtube.com/v/-wtIMTCHWuI?version=3&autohide=1',
'http://youtu.be/-wtIMTCHWuI',
'https://www.youtube.com/watch?v=-wtIMTCHWuI&feature=youtu.be',
'https://youtu.be/-wtIMTCHWuI?t=35',
'http://www.youtube.com/v/PjDw3azfZWI&hl=en_US&start=1868'
],
vimeo: [
'https://vimeo.com/11111111',
'http://vimeo.com/11111111',
'https://www.vimeo.com/11111111',
'http://www.vimeo.com/11111111',
'https://vimeo.com/channels/11111111',
'http://vimeo.com/channels/11111111',
'https://vimeo.com/groups/name/videos/11111111',
'http://vimeo.com/groups/name/videos/11111111',
'https://vimeo.com/album/2222222/video/11111111',
'http://vimeo.com/album/2222222/video/11111111',
'https://vimeo.com/11111111?param=test',
'http://vimeo.com/11111111?param=test'
]
};

var block = createBlock('video', urls[0]);

for (var provider in block.providers) {
if (typeof urls[provider] !== 'undefined') {
var regex = block.providers[provider].regex;
for (var i = 0; i < urls[provider].length; i++) {
expect(urls[provider][i]).toMatch(regex);
}
}
}

});

});

});
2 changes: 2 additions & 0 deletions website/source/partials/docs/_4.html.markdown
Expand Up @@ -5,6 +5,8 @@ A founding principle of Sir Trevor is to have an extensible editor that you can

A good place to start is to read through one of the [blocks that comes bundled with Sir Trevor](https://github.com/madebymany/sir-trevor-js/tree/master/src/blocks).

There’s also a [Sir Trevor Blocks repository](https://github.com/madebymany/sir-trevor-blocks).

<a name="4-1"></a>
## Concepts

Expand Down

0 comments on commit 94d637c

Please sign in to comment.