mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-06-15 21:30:56 +00:00
first commit
This commit is contained in:
BIN
Binary file not shown.
|
After Width: | Height: | Size: 619 B |
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'en', {
|
||||
button : 'Embed Youtube Video',
|
||||
title : 'Embed Youtube Video',
|
||||
txtEmbed : 'Paste Embed Code Here',
|
||||
txtUrl : 'Paste Youtube Video URL',
|
||||
txtWidth : 'Width',
|
||||
txtHeight : 'Height',
|
||||
chkRelated : 'Show suggested videos at the video\'s end',
|
||||
txtStartAt : 'Start at (ss or mm:ss or hh:mm:ss)',
|
||||
chkPrivacy : 'Enable privacy-enhanced mode',
|
||||
chkOlderCode : 'Use old embed code',
|
||||
noCode : 'You must input an embed code or URL',
|
||||
invalidEmbed : 'The embed code you\'ve entered doesn\'t appear to be valid',
|
||||
invalidUrl : 'The URL you\'ve entered doesn\'t appear to be valid',
|
||||
or : 'or',
|
||||
noWidth : 'You must inform the width',
|
||||
invalidWidth : 'Inform a valid width',
|
||||
noHeight : 'You must inform the height',
|
||||
invalidHeight : 'Inform a valid height',
|
||||
invalidTime : 'Inform a valid start time'
|
||||
});
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'fr', {
|
||||
button : 'Ins�rer une vid�o Youtube',
|
||||
title : 'Ins�rer une vid�o youtube',
|
||||
txtEmbed : 'Coller le code embed ici',
|
||||
txtUrl : 'Coller l\'url de la vid�o ici',
|
||||
txtWidth : 'Largeur',
|
||||
txtHeight : 'Hauteur',
|
||||
chkRelated : 'Montrer les suggestions de vid�o � la fin',
|
||||
txtStartAt : 'Commencer � (ss ou mm:ss ou hh:mm:ss)',
|
||||
chkPrivacy : 'Activer la protection de la vie priv�e',
|
||||
chkOlderCode : 'Utiliser l\'ancien code embed',
|
||||
noCode : 'Vous devez entrer un code embed ou une url',
|
||||
invalidEmbed : 'Le code embed est invalide',
|
||||
invalidUrl : 'L\'url est invalide',
|
||||
or : 'ou',
|
||||
noWidth : 'Vous devez saisir une largeur',
|
||||
invalidWidth : 'La largeur saisie est invalide',
|
||||
noHeight : 'Vous devez saisir une hauteur',
|
||||
invalidHeight : 'La hauteur saisie est invalide',
|
||||
invalidTime : 'Le temps de d�part de la vid�o est invalide'
|
||||
});
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'hu', {
|
||||
button : 'Youtube videó beillesztése',
|
||||
title : 'Youtube videó beillesztése',
|
||||
txtEmbed : 'Illessze be a beágyazott kódot',
|
||||
txtUrl : 'Illessze be a Youtube videó URL-jét',
|
||||
txtWidth : 'Szélesség',
|
||||
txtHeight : 'Magasság',
|
||||
txtStartAt : 'Kezdő időpont (ss vagy mm:ss vagy hh:mm:ss)',
|
||||
chkRelated : 'Ajánlott videók megjelenítése, amikor a videó befejeződik',
|
||||
chkPrivacy : 'Fokozott adatvédelmi mód engedélyezése',
|
||||
chkOlderCode : 'Régi beágyazott kód használata',
|
||||
noCode : 'A beágyazott kód, vagy az URL megadása kötelező',
|
||||
invalidEmbed : 'A beágyazott kód érvénytelen',
|
||||
invalidUrl : 'A megadott URL érvénytelen',
|
||||
or : 'vagy',
|
||||
noWidth : 'A szélesség megadása kötelező',
|
||||
invalidWidth : 'Érvényes szélességet adjon meg',
|
||||
noHeight : 'A magasság megadása kötelező',
|
||||
invalidHeight : 'Érvényes magasságot adjon meg',
|
||||
invalidTime : 'Érvényes kezdő időpontot adjon meg'
|
||||
});
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'it', {
|
||||
button : 'Incorpora video Youtube',
|
||||
title : 'Incorpora video Youtube',
|
||||
txtEmbed : 'Incolla qui il codice di incorporamento',
|
||||
txtUrl : 'Incolla l\'URL del video Youtube',
|
||||
txtWidth : 'Larghezza',
|
||||
txtHeight : 'Altezza',
|
||||
chkRelated : 'Mostra i video suggeriti dopo il video',
|
||||
txtStartAt : 'Inizia a (ss o mm:ss o hh:mm:ss)',
|
||||
chkPrivacy : 'Abilita la protezione della privacy',
|
||||
chkOlderCode : 'Usa il vecchio codice di incorporamento',
|
||||
noCode : 'Devi inserire un codice di incorporamento o un URL',
|
||||
invalidEmbed : 'Il codice di incorporamento inserito non sembra valido',
|
||||
invalidUrl : 'L\'URL inserito non sembra valido',
|
||||
or : 'o',
|
||||
noWidth : 'Devi indicare la larghezza',
|
||||
invalidWidth : 'Indica una larghezza valida',
|
||||
noHeight : 'Devi indicare l\'altezza',
|
||||
invalidHeight : 'Indica un\'altezza valida',
|
||||
invalidTime : 'Indica un tempo di inizio valido'
|
||||
});
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'ja', {
|
||||
button : 'Youtube動画埋め込み',
|
||||
title : 'Youtube動画埋め込み',
|
||||
txtEmbed : '埋め込みコードを貼り付けてください',
|
||||
txtUrl : 'URLを貼り付けてください',
|
||||
txtWidth : '幅',
|
||||
txtHeight : '高さ',
|
||||
chkRelated : '動画が終わったら関連動画を表示する',
|
||||
txtStartAt : 'Start at',
|
||||
chkPrivacy : 'プライバシー強化モードを有効にする',
|
||||
chkOlderCode : '以前の埋め込みコードを使用する',
|
||||
noCode : '埋め込みコードまたはURLを入力してください',
|
||||
invalidEmbed : '不適切な埋め込みコードが入力されました',
|
||||
invalidUrl : '不適切なURLが入力されました',
|
||||
or : 'または',
|
||||
noWidth : '幅を指定してください',
|
||||
invalidWidth : '幅指定に誤りがあります',
|
||||
noHeight : '高さを指定してください',
|
||||
invalidHeight : '高さ指定に誤りがあります',
|
||||
invalidTime : 'Inform a valid start time'
|
||||
});
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
CKEDITOR.plugins.setLang('youtube', 'pt', {
|
||||
button : 'Inserir Vídeo do Youtube',
|
||||
title : 'Inserir Vídeo do Youtube',
|
||||
txtEmbed : 'Cole aqui o código embed de um vídeo do Youtube',
|
||||
txtUrl : 'Cole aqui uma URL de um vídeo do Youtube',
|
||||
txtWidth : 'Largura',
|
||||
txtHeight : 'Altura',
|
||||
chkRelated : 'Mostrar vídeos sugeridos ao final do vídeo',
|
||||
txtStartAt : 'Iniciar em (ss ou mm:ss ou hh:mm:ss)',
|
||||
chkPrivacy : 'Ativar o modo de privacidade aprimorada',
|
||||
chkOlderCode : 'Usar código de incorporação antigo',
|
||||
noCode : 'Você precisa informar um código embed ou uma URL',
|
||||
invalidEmbed : 'O código informado não parece ser válido',
|
||||
invalidUrl : 'A URL informada não parece ser válida',
|
||||
or : 'ou',
|
||||
noWidth : 'Você deve informar a largura do vídeo',
|
||||
invalidWidth : 'Informe uma largura válida',
|
||||
noHeight : 'Você deve informar a altura do vídeo',
|
||||
invalidHeight : 'Informe uma altura válida',
|
||||
invalidTime : 'O tempo informado é inválido'
|
||||
});
|
||||
Executable
+321
@@ -0,0 +1,321 @@
|
||||
/*
|
||||
* Youtube Embed Plugin
|
||||
*
|
||||
* @author Jonnas Fonini <contato@fonini.net>
|
||||
* @version 1.0.4
|
||||
*/
|
||||
( function() {
|
||||
CKEDITOR.plugins.add( 'youtube',
|
||||
{
|
||||
lang: [ 'en', 'pt', 'ja', 'hu', 'it', 'fr' ],
|
||||
init: function( editor )
|
||||
{
|
||||
editor.addCommand( 'youtube', new CKEDITOR.dialogCommand( 'youtube', {
|
||||
allowedContent: 'iframe[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]'
|
||||
}));
|
||||
|
||||
editor.ui.addButton( 'Youtube',
|
||||
{
|
||||
label : editor.lang.youtube.button,
|
||||
toolbar : 'insert',
|
||||
command : 'youtube',
|
||||
icon : this.path + 'images/icon.png'
|
||||
});
|
||||
|
||||
CKEDITOR.dialog.add( 'youtube', function ( instance )
|
||||
{
|
||||
var video;
|
||||
|
||||
return {
|
||||
title : editor.lang.youtube.title,
|
||||
minWidth : 500,
|
||||
minHeight : 200,
|
||||
contents :
|
||||
[{
|
||||
id : 'youtubePlugin',
|
||||
expand : true,
|
||||
elements :
|
||||
[{
|
||||
id : 'txtEmbed',
|
||||
type : 'textarea',
|
||||
label : editor.lang.youtube.txtEmbed,
|
||||
autofocus : 'autofocus',
|
||||
onChange : function ( api )
|
||||
{
|
||||
if ( this.getValue().length > 0 )
|
||||
{
|
||||
this.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).disable();
|
||||
}
|
||||
else {
|
||||
this.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).enable();
|
||||
}
|
||||
},
|
||||
validate : function ()
|
||||
{
|
||||
if ( this.isEnabled() )
|
||||
{
|
||||
if ( !this.getValue() )
|
||||
{
|
||||
alert( editor.lang.youtube.noCode );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if ( this.getValue().length === 0 || this.getValue().indexOf( '//' ) === -1 )
|
||||
{
|
||||
alert( editor.lang.youtube.invalidEmbed );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'html',
|
||||
html : editor.lang.youtube.or + '<hr>'
|
||||
},
|
||||
{
|
||||
type : 'hbox',
|
||||
widths : [ '70%', '15%', '15%' ],
|
||||
children :
|
||||
[
|
||||
{
|
||||
id : 'txtUrl',
|
||||
type : 'text',
|
||||
label : editor.lang.youtube.txtUrl,
|
||||
onChange : function ( api )
|
||||
{
|
||||
if ( this.getValue().length > 0 )
|
||||
{
|
||||
this.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).disable();
|
||||
}
|
||||
else {
|
||||
this.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).enable();
|
||||
}
|
||||
},
|
||||
validate : function ()
|
||||
{
|
||||
if ( this.isEnabled() )
|
||||
{
|
||||
if ( !this.getValue() )
|
||||
{
|
||||
alert( editor.lang.youtube.noCode );
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
video = ytVidId(this.getValue());
|
||||
|
||||
if ( this.getValue().length === 0 || video === false)
|
||||
{
|
||||
alert( editor.lang.youtube.invalidUrl );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'text',
|
||||
id : 'txtWidth',
|
||||
width : '60px',
|
||||
label : editor.lang.youtube.txtWidth,
|
||||
'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
|
||||
validate : function ()
|
||||
{
|
||||
if ( this.getValue() )
|
||||
{
|
||||
var width = parseInt ( this.getValue() ) || 0;
|
||||
|
||||
if ( width === 0 )
|
||||
{
|
||||
alert( editor.lang.youtube.invalidWidth );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert( editor.lang.youtube.noWidth );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'text',
|
||||
id : 'txtHeight',
|
||||
width : '60px',
|
||||
label : editor.lang.youtube.txtHeight,
|
||||
'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
|
||||
validate : function ()
|
||||
{
|
||||
if ( this.getValue() )
|
||||
{
|
||||
var height = parseInt ( this.getValue() ) || 0;
|
||||
|
||||
if ( height === 0 )
|
||||
{
|
||||
alert( editor.lang.youtube.invalidHeight );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert( editor.lang.youtube.noHeight );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type : 'hbox',
|
||||
widths : [ '55%', '45%' ],
|
||||
children :
|
||||
[
|
||||
{
|
||||
id : 'chkRelated',
|
||||
type : 'checkbox',
|
||||
'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
|
||||
label : editor.lang.youtube.chkRelated
|
||||
},
|
||||
{
|
||||
id : 'chkOlderCode',
|
||||
type : 'checkbox',
|
||||
'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
|
||||
label : editor.lang.youtube.chkOlderCode
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type : 'hbox',
|
||||
widths : [ '55%', '45%' ],
|
||||
children :
|
||||
[
|
||||
{
|
||||
id : 'chkPrivacy',
|
||||
type : 'checkbox',
|
||||
label : editor.lang.youtube.chkPrivacy,
|
||||
'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false,
|
||||
},
|
||||
{
|
||||
id : 'txtStartAt',
|
||||
type : 'text',
|
||||
label : editor.lang.youtube.txtStartAt,
|
||||
validate : function ()
|
||||
{
|
||||
if ( this.getValue() )
|
||||
{
|
||||
var str = this.getValue();
|
||||
|
||||
if ( !/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test( str ) )
|
||||
{
|
||||
alert( editor.lang.youtube.invalidTime );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
onOk: function()
|
||||
{
|
||||
var content = '';
|
||||
|
||||
if ( this.getContentElement( 'youtubePlugin', 'txtEmbed' ).isEnabled() )
|
||||
{
|
||||
content = this.getValueOf( 'youtubePlugin', 'txtEmbed' );
|
||||
}
|
||||
else {
|
||||
var url = '//', params = [], startSecs;
|
||||
var width = this.getValueOf( 'youtubePlugin', 'txtWidth' );
|
||||
var height = this.getValueOf( 'youtubePlugin', 'txtHeight' );
|
||||
|
||||
if ( this.getContentElement( 'youtubePlugin', 'chkPrivacy' ).getValue() === true )
|
||||
{
|
||||
url += 'www.youtube-nocookie.com/';
|
||||
}
|
||||
else {
|
||||
url += 'www.youtube.com/';
|
||||
}
|
||||
|
||||
url += 'embed/' + video;
|
||||
|
||||
if ( this.getContentElement( 'youtubePlugin', 'chkRelated' ).getValue() === false )
|
||||
{
|
||||
params.push('rel=0');
|
||||
}
|
||||
|
||||
startSecs = this.getValueOf( 'youtubePlugin', 'txtStartAt' );
|
||||
if ( startSecs ){
|
||||
var seconds = hmsToSeconds( startSecs );
|
||||
|
||||
params.push('start=' + seconds);
|
||||
}
|
||||
|
||||
if ( this.getContentElement( 'youtubePlugin', 'chkOlderCode' ).getValue() === true )
|
||||
{
|
||||
url = url.replace('embed/', 'v/');
|
||||
url = url.replace(/&/g, '&');
|
||||
|
||||
if ( params.length == 0 )
|
||||
{
|
||||
url += '?';
|
||||
}
|
||||
|
||||
url += 'hl=pt_BR&version=3';
|
||||
|
||||
content = '<object width="' + width + '" height="' + height + '">';
|
||||
content += '<param name="movie" value="' + url + '"></param>';
|
||||
content += '<param name="allowFullScreen" value="true"></param>';
|
||||
content += '<param name="allowscriptaccess" value="always"></param>';
|
||||
content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
|
||||
content += 'width="' + width + '" height="' + height + '" allowscriptaccess="always" ';
|
||||
content += 'allowfullscreen="true"></embed>';
|
||||
content += '</object>';
|
||||
}
|
||||
else {
|
||||
if ( params.length > 0 )
|
||||
{
|
||||
url = url + '?' + params.join( '&' );
|
||||
}
|
||||
|
||||
content = '<iframe width="' + width + '" height="' + height + '" src="' + url + '" ';
|
||||
content += 'frameborder="0" allowfullscreen></iframe>';
|
||||
}
|
||||
}
|
||||
|
||||
var instance = this.getParentEditor();
|
||||
instance.insertHtml( content );
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
/**
|
||||
* JavaScript function to match (and return) the video Id
|
||||
* of any valid Youtube Url, given as input string.
|
||||
* @author: Stephan Schmitz <eyecatchup@gmail.com>
|
||||
* @url: http://stackoverflow.com/a/10315969/624466
|
||||
*/
|
||||
function ytVidId( url )
|
||||
{
|
||||
var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
|
||||
return ( url.match( p ) ) ? RegExp.$1 : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts time in hms format to seconds only
|
||||
*/
|
||||
function hmsToSeconds( time )
|
||||
{
|
||||
var arr = time.split(':'), s = 0, m = 1;
|
||||
|
||||
while (arr.length > 0)
|
||||
{
|
||||
s += m * parseInt(arr.pop(), 10);
|
||||
m *= 60;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user