diff --git a/.env b/.env new file mode 100644 index 0000000..97c5fee --- /dev/null +++ b/.env @@ -0,0 +1,119 @@ +# Symfony +APP_ENV=prod +APP_SECRET=changeme + +# Messenger +MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 + +# Database +DATABASE_URL="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8" + +# Mailer +MAILER_METHOD=smtp +MAILER_DSN=smtp://127.0.0.1:1025 +MAILER_NOREPLY=noreply@noreply.fr + +# Basic +APP_WEBURL= +APP_MASTERIDENTITY=SQL # SQL | SSO à faire | LDAP +APP_AUTH=SQL # SQL | CAS à faire | LDAP | OPENID | SAML +APP_ALIAS=/ +APP_NAME=Nineskeletor +APP_MASTERURL= +APP_MASTERKEY= +APP_MODEREGISTRATION= # null | BYADMIN | BYUSER +APP_ADMINS='["admin"]' +APP_NIVEAU01LABEL="Niveau 01" +APP_NIVEAU02LABEL="Niveau 02" + +# Synchronisation +APP_SYNCHRO= # Synchronisation null | LDAP2NINE | NINE2LDAP | NINE2NINE +APP_SYNDCHROPURGENIVEAU01=1 # Purger les niveau01s obsolète en cas de synchronisation +APP_SYNDCHROPURGENIVEAU02=1 # Purger les niveau02s obsolète en cas de synchronisation +APP_SYNDCHROPURGEGROUP=1 # Purger les groups obsolète en cas de synchronisation +APP_SYNDCHROPURGEUSER=1 # Purger les groups obsolète en cas de synchronisation + +# LDAP +LDAP_HOST= # host du serveur ldap +LDAP_PORT= # port du serveur ldap +LDAP_USETLS=0 # connection TLS 0/1 +LDAP_USERWRITER=0 # LDAP_USER compte writer ? 0/1 +LDAP_USER= # DN compte access ldap +LDAP_PASSWORD= # Password comte access ldap +LDAP_BASEDN= # Base DN ex:o=gouv,c=fr +LDAP_BASEORGANISATION= # Base Organisation ex:ou=nine,o=gouv,c=fr +LDAP_BASENIVEAU01= # Base Niveau01 ex:ou=niveau01,ou=nine,o=gouv,c=fr +LDAP_BASENIVEAU02= # Base Niveau02 ex:ou=niveau02,ou=nine,o=gouv,c=fr +LDAP_BASEGROUP= # Base Group ex:ou=groups,ou=nine,o=gouv,c=fr +LDAP_BASEUSER= # Base User ex:ou=users,ou=nine,o=gouv,c=fr +LDAP_USERNAME=uid # Attribut id d'un user +LDAP_FIRSTNAME=givenname # Attribut firstname d'un user +LDAP_LASTNAME=sn # Attribut lastname d'un user +LDAP_EMAIL=mail # Attribut email d'un user +LDAP_AVATAR= # Attribut avatar d'un user +LDAP_MEMBEROF=memberof # Attribut memberof d'un user +LDAP_GROUPGID=gidnumber # Attribut gid d'un groupe +LDAP_GROUPNAME=cn # Attribut name d'un groupe +LDAP_GROUPMEMBER=memberuid # Attribut stockant les membres d'un groupe +LDAP_GROUPMEMBERISDN=0 # LDAP_GROUPMEMBER stocke un uid ou un dn ? 0/1 +LDAP_FILTERGROUP=(cn=*) # requete ldap pour rechercher les groupes +LDAP_FILTERUSER=(uid=*) # requete ldap pour rechercher les users + +# If APP_AUTH = CAS +CAS_HOST= +CAS_PORT= +CAS_PATH= +CAS_USERNAME=username +CAS_EMAIL=email +CAS_LASTNAME=lastname +CAS_FIRSTNAME=firstname +CAS_AVATAR= +CAS_NIVEAU01= +CAS_GROUP= + +# If APP_AUTH = OPENID +OAUTH_CLIENTID= +OAUTH_CLIENTSECRET= +OAUTH_LOGINURL= +OAUTH_LOGOUTURL= +OAUTH_TOKENURL= +OAUTH_USERINFO= +OAUTH_USERNAME=username +OAUTH_EMAIL=email +OAUTH_LASTNAME=lastname +OAUTH_FIRSTNAME=firstname +OAUTH_AVATAR= +OAUTH_NIVEAU01= +OAUTH_GROUP= + +# IF APP_SYNCHRO=NINE2NINE +NINE_URL= +NINE_SECRET= + +# If APP_MODEREGISTRATION != NULL +APP_MODEREGISTRATIONTERM=6 # Temps en heure de la durée de validité de l'inscription + +# Proxy +PROXY_USE=0 +PROXY_HOST= +PROXY_PORT= + +# Sonde statistic +SONDE_USE=0 +SONDE_URL= + +# Mercure +MERCURE_URL=https://example.com/.well-known/mercure +MERCURE_PUBLIC_URL=https://example.com/.well-known/mercure +MERCURE_JWT_SECRET="!ChangeMe!" + +# Messenger +# MESSENGER_TRANSPORT_DSN=doctrine://default +# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages +# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages + +# Lock +LOCK_DSN="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8" + +# Sentry +SENTRY_DSN= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b072513 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ + +###> symfony/framework-bundle ### +/.env.local +/.env.local.php +/.env.*.local +/config/secrets/prod/prod.decrypt.private.php +/public/bundles/ +/var/ +/vendor/ +###< symfony/framework-bundle ### + +###> symfony/webpack-encore-bundle ### +/node_modules/ +/public/build/ +npm-debug.log +yarn-error.log +###< symfony/webpack-encore-bundle ### + +###> phpunit/phpunit ### +/phpunit.xml +.phpunit.result.cache +###< phpunit/phpunit ### + +###> symfony/phpunit-bridge ### +.phpunit.result.cache +/phpunit.xml +###< symfony/phpunit-bridge ### diff --git a/assets/app.js b/assets/app.js new file mode 100644 index 0000000..32bdd24 --- /dev/null +++ b/assets/app.js @@ -0,0 +1,51 @@ +// JQuery +window.$ = window.jQuery = require('jquery'); + +// JQueryui +require('jquery-ui'); + +// Bootstrap +require('bootstrap'); +require('bootstrap/dist/css/bootstrap.css'); + +// Fontawesome +require('@fortawesome/fontawesome-free/css/all.css'); + +// Datatables +require('datatables.net-bs4'); +require('datatables.net-bs4/css/dataTables.bootstrap4.min.css'); +require('./js/datatables.init.js'); + +// Select2 +require('select2'); +require('select2/dist/js/i18n/fr.js'); +require('select2/dist/css/select2.css'); +require('@ttskch/select2-bootstrap4-theme/dist/select2-bootstrap4.css'); +$(() => { + $('.select2entity').select2( + { + theme: 'bootstrap4', + language: "fr" + } + ); +}); + +// Spectrum-colorpicker2 +require('spectrum-colorpicker2/dist/spectrum.min.js'); +require('spectrum-colorpicker2/dist/spectrum.min.css'); + +// CropSelectJs +require('crop-select-js/crop-select-js.min.css'); +window.CropSelectJs = require('crop-select-js/crop-select-js.min.js'); + +// Start the Stimulus application +import './bootstrap'; + +// App sytle +import './styles/font.css'; +import './styles/app.css'; + +// App js +require('./js/app.js'); + + diff --git a/assets/bootstrap.js b/assets/bootstrap.js new file mode 100644 index 0000000..4ab2df6 --- /dev/null +++ b/assets/bootstrap.js @@ -0,0 +1,11 @@ +import { startStimulusApp } from '@symfony/stimulus-bridge'; + +// Registers Stimulus controllers from controllers.json and in the controllers/ directory +export const app = startStimulusApp(require.context( + '@symfony/stimulus-bridge/lazy-controller-loader!./controllers', + true, + /\.[jt]sx?$/ +)); + +// register any custom, 3rd party controllers here +// app.register('some_controller_name', SomeImportedController); diff --git a/assets/ckplugins/html5video/dialogs/html5video.js b/assets/ckplugins/html5video/dialogs/html5video.js new file mode 100644 index 0000000..c11e055 --- /dev/null +++ b/assets/ckplugins/html5video/dialogs/html5video.js @@ -0,0 +1,259 @@ +CKEDITOR.dialog.add( 'html5video', function( editor ) { + return { + title: editor.lang.html5video.title, + minWidth: 500, + minHeight: 100, + contents: [ { + id: 'info', + label: editor.lang.html5video.infoLabel, + elements: [ + { + type: 'vbox', + padding: 0, + children: [ + { + type: 'hbox', + widths: [ '365px', '110px' ], + align: 'right', + children: [ { + type: 'text', + id: 'url', + label: editor.lang.html5video.allowed, + required: true, + validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.html5video.urlMissing ), + setup: function( widget ) { + this.setValue( widget.data.src ); + }, + commit: function( widget ) { + widget.setData( 'src', this.getValue() ); + } + }, + { + type: 'button', + id: 'browse', + // v-align with the 'txtUrl' field. + // TODO: We need something better than a fixed size here. + style: 'display:inline-block;margin-top:14px;', + align: 'center', + label: editor.lang.common.browseServer, + hidden: true, + filebrowser: 'info:url' + } ] + } ] + }, + { + type: 'checkbox', + id: 'responsive', + label: editor.lang.html5video.responsive, + setup: function( widget ) { + this.setValue( widget.data.responsive ); + }, + commit: function( widget ) { + widget.setData( 'responsive', this.getValue()?'true':'' ); + } + }, + { + type: 'vbox', + padding: 0, + + children: [{ + type: 'hbox', + widths: [ '365px', '110px' ], + align: 'right', + children: [ { + type: 'text', + id: 'poster', + label: editor.lang.html5video.poster, + setup: function( widget ) { + this.setValue( widget.data.poster ); + }, + commit: function( widget ) { + widget.setData( 'poster', this.getValue() ); + } + }, + { + type: 'button', + id: 'browseposter', + // v-align with the 'txtUrl' field. + // TODO: We need something better than a fixed size here. + style: 'display:inline-block;margin-top:14px;', + align: 'center', + label: editor.lang.common.browseServer, + hidden: true, + filebrowser:{action:"Browse",target:"info:poster",url:editor.config.filebrowserImageBrowseUrl} + } ] + }] + }, + { + type: 'checkbox', + id: 'controls', + label: editor.lang.html5video.controls, + setup: function (widget) { + this.setValue(widget.data.controls); + }, + commit: function (widget) { + widget.setData('controls', this.getValue() ? 'true' : ''); + } + }, + { + type: 'hbox', + id: 'size', + children: [ { + type: 'text', + id: 'width', + label: editor.lang.common.width, + setup: function( widget ) { + if ( widget.data.width ) { + this.setValue( widget.data.width ); + } + }, + commit: function( widget ) { + widget.setData( 'width', this.getValue() ); + } + }, + { + type: 'text', + id: 'height', + label: editor.lang.common.height, + setup: function( widget ) { + if ( widget.data.height ) { + this.setValue( widget.data.height ); + } + }, + commit: function( widget ) { + widget.setData( 'height', this.getValue() ); + } + }, + ] + }, + + { + type: 'hbox', + id: 'alignment', + children: [ { + type: 'radio', + id: 'align', + label: editor.lang.common.align, + items: [ + [editor.lang.common.alignCenter, 'center'], + [editor.lang.common.alignLeft, 'left'], + [editor.lang.common.alignRight, 'right'], + [editor.lang.common.alignNone, 'none'] + ], + 'default': 'center', + setup: function( widget ) { + if ( widget.data.align ) { + this.setValue( widget.data.align ); + } + }, + commit: function( widget ) { + widget.setData( 'align', this.getValue() ); + } + } ] + } ] + }, + { + id: 'Upload', + hidden: true, + filebrowser: 'uploadButton', + label: editor.lang.html5video.upload, + elements: [ { + type: 'file', + id: 'upload', + label: editor.lang.html5video.btnUpload, + style: 'height:40px', + size: 38 + }, + { + type: 'fileButton', + id: 'uploadButton', + filebrowser: 'info:url', + label: editor.lang.html5video.btnUpload, + 'for': [ 'Upload', 'upload' ] + } ] + }, + { + id: 'advanced', + label: editor.lang.html5video.advanced, + elements: [ { + type: 'vbox', + padding: 10, + children: [ { + type: 'hbox', + widths: ["33%", "33%", "33%"], + children: [ { + type: 'radio', + id: 'autoplay', + label: editor.lang.html5video.autoplay, + items: [ + [editor.lang.html5video.yes, 'yes'], + [editor.lang.html5video.no, 'no'] + ], + 'default': 'no', + setup: function( widget ) { + if ( widget.data.autoplay ) { + this.setValue( widget.data.autoplay ); + } + }, + commit: function( widget ) { + widget.setData( 'autoplay', this.getValue() ); + } + }, + { + type: 'radio', + id: 'loop', + label: editor.lang.html5video.loop, + items: [ + [editor.lang.html5video.yes, 'yes'], + [editor.lang.html5video.no, 'no'] + ], + 'default': 'no', + setup: function( widget ) { + if ( widget.data.loop ) { + this.setValue( widget.data.loop ); + } + }, + commit: function( widget ) { + widget.setData( 'loop', this.getValue() ); + } + }, + { + type: 'radio', + id: 'allowdownload', + label: editor.lang.html5video.allowdownload, + items: [ + [editor.lang.html5video.yes, 'yes'], + [editor.lang.html5video.no, 'no'] + ], + 'default': 'no', + setup: function( widget ) { + if ( widget.data.allowdownload ) { + this.setValue(widget.data.allowdownload); + } + }, + commit: function( widget ) { + widget.setData( 'allowdownload', this.getValue() ); + } + } ] + }, + { + type: 'hbox', + children: [ { + type: "text", + id: 'advisorytitle', + label: editor.lang.html5video.advisorytitle, + 'default': '', + setup: function( widget ) { + if ( widget.data.advisorytitle ) { + this.setValue(widget.data.advisorytitle); + } + }, + commit: function( widget ) { + widget.setData( 'advisorytitle', this.getValue() ); + } + } ] + } ] + } ] + } ] + }; +} ); diff --git a/assets/ckplugins/html5video/icons/html5video.png b/assets/ckplugins/html5video/icons/html5video.png new file mode 100644 index 0000000..a246517 Binary files /dev/null and b/assets/ckplugins/html5video/icons/html5video.png differ diff --git a/assets/ckplugins/html5video/lang/bg.js b/assets/ckplugins/html5video/lang/bg.js new file mode 100644 index 0000000..0def1ce --- /dev/null +++ b/assets/ckplugins/html5video/lang/bg.js @@ -0,0 +1,20 @@ +CKEDITOR.plugins.setLang( 'html5video', 'bg', { + button: 'Вмъква HTML5 видео', + title: 'HTML5 видео', + infoLabel: 'Видео', + allowed: 'Допустими файлови разширения: MP4, WebM, Ogv', + urlMissing: 'URL адресът на източника на видео липсва.', + videoProperties: 'Свойства на видео', + upload: 'Качване', + btnUpload: 'Изпрати на сървъра', + advanced: 'Разширено', + autoplay: 'Автоматично изпълнение', + allowdownload: 'Позволено изтегляне?', + advisorytitle: 'Заглавие', + yes: 'Да', + no: 'Не', + loop: 'Циклично изпълнение', + responsive: 'Адаптивна ширина', + controls: 'Показване на контролите', + poster: 'URL миниатюра' +} ); diff --git a/assets/ckplugins/html5video/lang/ca.js b/assets/ckplugins/html5video/lang/ca.js new file mode 100644 index 0000000..0369d48 --- /dev/null +++ b/assets/ckplugins/html5video/lang/ca.js @@ -0,0 +1,20 @@ +CKEDITOR.plugins.setLang( 'html5video', 'ca', { + button: "Insereix un vídeo HTML5", + title: "Vídeo HTML5", + infoLabel: "Informació del vídeo", + allowed: "Extensions d'arxius permeses: MP4, WebM, Ogv", + urlMissing: "Falta l'URL de la font de vídeo.", + videoProperties: "Propietats de vídeo", + upload: "Pujar", + btnUpload: "Envia-lo al servidor", + advanced: "Avançat", + autoplay: "Reproducció automàtica?", + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: "Sí", + no: "No", + loop: "Bucle?", + responsive: "Ample adaptatiu", + controls: "Mostra els controls", + poster: "Miniatura" +} ); diff --git a/assets/ckplugins/html5video/lang/de.js b/assets/ckplugins/html5video/lang/de.js new file mode 100644 index 0000000..ff4f781 --- /dev/null +++ b/assets/ckplugins/html5video/lang/de.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang( 'html5video', 'de', { + button: 'HTML5 Video einfügen', + title: 'HTML5 Video', + infoLabel: 'Video Infos', + allowed: 'Erlaubte Dateierweiterungen: MP4, WebM, Ogv', + urlMissing: 'Sie haben keine URL zur Video-Datei angegeben.', + videoProperties: 'Video-Einstellungen', + upload: 'Hochladen', + btnUpload: 'Zum Server senden', + advanced: 'Erweitert', + autoplay: 'Autoplay?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Ja', + no: 'Nein', + controls: 'Steuerelemente anzeigen' +} ); diff --git a/assets/ckplugins/html5video/lang/en.js b/assets/ckplugins/html5video/lang/en.js new file mode 100644 index 0000000..d196bc5 --- /dev/null +++ b/assets/ckplugins/html5video/lang/en.js @@ -0,0 +1,20 @@ +CKEDITOR.plugins.setLang( 'html5video', 'en', { + button: 'Insert HTML5 video', + title: 'HTML5 video', + infoLabel: 'Video info', + allowed: 'Allowed file extensions: MP4, WebM, Ogv', + urlMissing: 'Video source URL is missing.', + videoProperties: 'Video properties', + upload: 'Upload', + btnUpload: 'Send it to the server', + advanced: 'Advanced', + autoplay: 'Autoplay?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Yes', + no: 'No', + loop: 'Loop?', + responsive: 'Responsive width', + controls: 'Show controls', + poster: 'Thumbnail' +} ); diff --git a/assets/ckplugins/html5video/lang/es.js b/assets/ckplugins/html5video/lang/es.js new file mode 100644 index 0000000..54dd5d5 --- /dev/null +++ b/assets/ckplugins/html5video/lang/es.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'es', { + button: 'Insertar video HTML5', + title: 'Video HTML5', + infoLabel: 'Información del video', + allowed: 'Extensiones de archivo permitidas: MP4, WebM, Ogv', + urlMissing: 'La URL del video no puede estar vacía.', + videoProperties: 'Propiedades del video', + upload: 'Cargar', + btnUpload: 'Enviar al servidor', + advanced: 'Avanzado', + autoplay: '¿Reproducir automáticamente?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Sí', + no: 'No', + responsive: '¿Responsive?', + controls: 'Mostrar controles' +} ); diff --git a/assets/ckplugins/html5video/lang/eu.js b/assets/ckplugins/html5video/lang/eu.js new file mode 100644 index 0000000..5b90be7 --- /dev/null +++ b/assets/ckplugins/html5video/lang/eu.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang( 'html5video', 'eu', { + button: 'Txertatu HTML5 bideoa', + title: 'HTML5 bideoa', + infoLabel: 'Bideoaren informazioa', + allowed: 'Baimendutako fitxategi luzapenak: MP4, WebM, Ogv', + urlMissing: 'Bideoaren URLak ezin du hutsik egon.', + videoProperties: 'Bideoaren propietateak', + upload: 'Kargatu', + btnUpload: 'Bidali zerbitzarira', + advanced: 'Aurreratua', + autoplay: 'Automatikoki erreproduzitu?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Bai', + no: 'Ez', + controls: 'Erakutsi kontrolak?' +} ); diff --git a/assets/ckplugins/html5video/lang/fa.js b/assets/ckplugins/html5video/lang/fa.js new file mode 100644 index 0000000..df5dfb6 --- /dev/null +++ b/assets/ckplugins/html5video/lang/fa.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'fa', { + button: 'وارد کردن ویدیوی HTML5', + title: 'ویدیوی HTML5', + infoLabel: 'اطلاعات ویدیو', + allowed: 'پسوندهای مجاز فایل: MP4, WebM, Ogv', + urlMissing: 'URL منبع ویدیو پیدا نشد.', + videoProperties: 'خواهص ویدیو', + upload: 'بارگذاری', + btnUpload: 'ارسال به سرور', + advanced: 'پیشرفته', + autoplay: 'پخش خودکار؟', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'بله', + no: 'خیر', + responsive: 'عرض واکنشگرا', + controls: 'نمایش کنترل؟' +} ); diff --git a/assets/ckplugins/html5video/lang/fr.js b/assets/ckplugins/html5video/lang/fr.js new file mode 100644 index 0000000..7014239 --- /dev/null +++ b/assets/ckplugins/html5video/lang/fr.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang( 'html5video', 'fr', { + button: 'Insérer un lecteur video HTML5', + title: 'HTML5 video', + infoLabel: 'Informations video', + allowed: 'Extensions de fichiers autorisées: MP4, WebM, Ogv', + urlMissing: 'URL de la source video manquante. Veuillez la renseigner.', + videoProperties: 'Propriétés Video', + upload: 'Télécharger', + btnUpload: 'Envoyer vers le serveur', + advanced: 'Avancé', + autoplay: 'Jouer automatiquement ?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Oui', + no: 'Non', + controls: 'Afficher les contrôles ?' +} ); diff --git a/assets/ckplugins/html5video/lang/he.js b/assets/ckplugins/html5video/lang/he.js new file mode 100644 index 0000000..9bea57b --- /dev/null +++ b/assets/ckplugins/html5video/lang/he.js @@ -0,0 +1,18 @@ + +CKEDITOR.plugins.setLang('html5video', 'he', { + button: 'הוסף וידאו HTML5', + title: 'וידאו HTML5', + infoLabel: 'מידע וידאו', + allowed: 'סוגי קבצים מורשים: MP4, WebM, Ogv', + urlMissing: 'כתובת הוידאו חסרה', + videoProperties: 'מאפייני וידאו', + upload: 'העלה', + btnUpload: 'שלח לשרת', + advanced: 'מתקדם', + autoplay: 'ניגון אוטומטי?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'כן', + no: 'לא', + responsive: 'רוחב רספונסיבי' +}); diff --git a/assets/ckplugins/html5video/lang/ko.js b/assets/ckplugins/html5video/lang/ko.js new file mode 100644 index 0000000..0e68c24 --- /dev/null +++ b/assets/ckplugins/html5video/lang/ko.js @@ -0,0 +1,20 @@ +CKEDITOR.plugins.setLang( 'html5video', 'ko', { + button: 'HTML5 비디오 추가하기', + title: 'HTML5 비디오', + infoLabel: '비디오 정보', + allowed: '허용된 파일 확장자들: MP4, WebM, Ogv', + urlMissing: '비디오 Url이 없습니다.', + videoProperties: '비디오 속성', + upload: '업로드', + btnUpload: '서버로 전송', + advanced: '고급', + autoplay: '자동재생?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: '네', + no: '아니오', + loop: '무한반복?', + responsive: '반응형 너비', + controls: '컨트롤 보여주기', + poster: '썸네일' +} ); diff --git a/assets/ckplugins/html5video/lang/pl.js b/assets/ckplugins/html5video/lang/pl.js new file mode 100644 index 0000000..3528fba --- /dev/null +++ b/assets/ckplugins/html5video/lang/pl.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'pl', { + button: 'Wstaw HTML5 video', + title: 'HTML5 video', + infoLabel: 'Informacje', + allowed: 'Dozwolone typy plików: MP4, WebM, Ogv', + urlMissing: 'Nie znaleziono URL do pliku video.', + videoProperties: 'Właściwości', + upload: 'Wrzuć plik', + btnUpload: 'Wyślij na serwer', + advanced: 'Zaawansowane', + autoplay: 'Autoodtwarzanie?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Tak', + no: 'Nie', + responsive: 'Szerokość responsywna', + controls: 'Pokaż kontrolki' +} ); diff --git a/assets/ckplugins/html5video/lang/pt-br.js b/assets/ckplugins/html5video/lang/pt-br.js new file mode 100644 index 0000000..1874303 --- /dev/null +++ b/assets/ckplugins/html5video/lang/pt-br.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'pt-br', { + button: 'Inserir vídeo HTML5', + title: 'HTML5 video', + infoLabel: 'Informações do Vídeo', + allowed: 'Extensões permitidas: MP4, WebM, Ogv', + urlMissing: 'O URL do vídeo está faltando.', + videoProperties: 'Propriedades do vídeo', + upload: 'Upload', + btnUpload: 'Enviar para o servidor', + advanced: 'Avançado', + autoplay: 'Autoplay?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Sim', + no: 'Não', + responsive: 'Largura responsiva', + controls: 'Exibir controles' +} ); diff --git a/assets/ckplugins/html5video/lang/pt.js b/assets/ckplugins/html5video/lang/pt.js new file mode 100644 index 0000000..5c4213e --- /dev/null +++ b/assets/ckplugins/html5video/lang/pt.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'pt', { + button: 'Inserir vídeo HTML5', + title: 'HTML5 video', + infoLabel: 'Informações do Vídeo', + allowed: 'Extensões permitidas: MP4, WebM, Ogv', + urlMissing: 'O URL do vídeo está faltando.', + videoProperties: 'Propriedades do vídeo', + upload: 'Upload', + btnUpload: 'Enviar para o servidor', + advanced: 'Avançado', + autoplay: 'Autoplay?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Sim', + no: 'Não', + responsive: 'Largura responsiva', + controls: 'Exibir controles' +} ); diff --git a/assets/ckplugins/html5video/lang/ru.js b/assets/ckplugins/html5video/lang/ru.js new file mode 100644 index 0000000..bea81ed --- /dev/null +++ b/assets/ckplugins/html5video/lang/ru.js @@ -0,0 +1,21 @@ +CKEDITOR.plugins.setLang( 'html5video', 'ru', { + button: 'Вставить HTML5 видео', + title: 'HTML5 видео', + infoLabel: 'Видео', + allowed: 'Допустимые расширения файлов: MP4, WebM, Ogv', + urlMissing: 'Не выбран источник видео', + videoProperties: 'Свойства видео', + upload: 'Загрузить', + btnUpload: 'Загрузить на сервер', + advanced: 'Дополнительно', + autoplay: 'Автовоспроизведение', + allowdownload: 'Разрешить загрузку', + advisorytitle: 'Заголовок', + yes: 'Да', + no: 'Нет', + responsive: 'Адаптивная ширина', + controls: 'Показать элементы управления', + loop: 'Зациклить', + poster: 'Постер', + advisorytitle: 'Пояснительный текст' +} ); diff --git a/assets/ckplugins/html5video/lang/uk.js b/assets/ckplugins/html5video/lang/uk.js new file mode 100644 index 0000000..a115440 --- /dev/null +++ b/assets/ckplugins/html5video/lang/uk.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang( 'html5video', 'uk', { + button: 'Вставити HTML5 відео', + title: 'HTML5 відео', + infoLabel: 'Інформація', + allowed: 'Допустимі розширення файлів: MP4, WebM, Ogv', + urlMissing: 'Не обрано джерела відео', + videoProperties: 'Властивості відео', + upload: 'Відвантажити', + btnUpload: 'Відвантажити на сервер', + advanced: 'Додатково', + autoplay: 'Автовідтворення?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Так', + no: 'Ні', + controls: 'Показати елементи керування?' +} ); diff --git a/assets/ckplugins/html5video/lang/uz.js b/assets/ckplugins/html5video/lang/uz.js new file mode 100644 index 0000000..10d1f66 --- /dev/null +++ b/assets/ckplugins/html5video/lang/uz.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang( 'html5video', 'uz', { + button: 'HTML5 video qo‘shing', + title: 'HTML5 video', + infoLabel: 'Video ma\'lumot', + allowed: 'Ruxsat etilgan kengaytmalar: MP4, WebM, Ogv', + urlMissing: 'Video\'ning URL manbasi topilmadi.', + videoProperties: 'Video xususiyatlari', + upload: 'Yuklash', + btnUpload: 'Serverga jo‘natish', + advanced: 'Kengaytrilgan', + autoplay: 'Avtoijro?', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: 'Ha', + no: 'Yo‘q', + controls: 'Tekshiruvlarni ko‘rsatish' +} ); diff --git a/assets/ckplugins/html5video/lang/zh-cn.js b/assets/ckplugins/html5video/lang/zh-cn.js new file mode 100644 index 0000000..3ea9ad4 --- /dev/null +++ b/assets/ckplugins/html5video/lang/zh-cn.js @@ -0,0 +1,18 @@ +CKEDITOR.plugins.setLang( 'html5video', 'zh-cn', { + button: '发布HTML5视频', + title: 'HTML5视频', + infoLabel: '视频信息', + allowed: '支持格式: MP4, WebM, Ogv', + urlMissing: '视频url', + videoProperties: '视频属性', + upload: '上传视频', + btnUpload: '上传', + advanced: '高级', + autoplay: '自动播放', + allowdownload: 'Allow download?', + advisorytitle: 'Advisory title', + yes: '是', + no: '否', + responsive: '自动宽度', + controls: '显示控件?' +} ); diff --git a/assets/ckplugins/html5video/plugin.js b/assets/ckplugins/html5video/plugin.js new file mode 100644 index 0000000..9a71e49 --- /dev/null +++ b/assets/ckplugins/html5video/plugin.js @@ -0,0 +1,196 @@ +CKEDITOR.plugins.add( 'html5video', { + requires: 'widget', + lang: 'bg,ca,de,en,eu,es,ru,uk,fr,ko,pt,pt-br,pl', + icons: 'html5video', + init: function( editor ) { + editor.widgets.add( 'html5video', { + button: editor.lang.html5video.button, + template: '
', + /* + * Allowed content rules (http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules): + * - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-video class. + * - video tags with src, controls, width and height attributes. + */ + allowedContent: 'div[data-responsive](!ckeditor-html5-video){text-align,float,margin-left,margin-right}; video[src,poster,controls,autoplay,width, height,loop]{max-width,height};', + requiredContent: 'div(ckeditor-html5-video); video[src];', + upcast: function( element ) { + return element.name === 'div' && element.hasClass( 'ckeditor-html5-video' ); + }, + dialog: 'html5video', + init: function() { + var src = ''; + var autoplay = ''; + var loop = ''; + var controls = ''; + var align = this.element.getStyle( 'text-align' ); + + var width = ''; + var height = ''; + var poster = ''; + + // If there's a child (the video element) + if ( this.element.getChild( 0 ) ) { + // get it's attributes. + src = this.element.getChild( 0 ).getAttribute( 'src' ); + width = this.element.getChild( 0 ).getAttribute( 'width' ); + height = this.element.getChild( 0 ).getAttribute( 'height' ); + autoplay = this.element.getChild(0).getAttribute('autoplay'); + allowdownload = !this.element.getChild( 0 ).getAttribute( 'controlslist' ); + loop = this.element.getChild( 0 ).getAttribute( 'loop' ); + advisorytitle = this.element.getChild( 0 ).getAttribute( 'title' ); + controls = this.element.getChild(0).getAttribute('controls'); + responsive = this.element.getAttribute( 'data-responsive' ); + poster = this.element.getChild( 0 ).getAttribute( 'poster' ); + } + + if ( src ) { + this.setData( 'src', src ); + + if ( align ) { + this.setData( 'align', align ); + } else { + this.setData( 'align', 'none' ); + } + + if ( width ) { + this.setData( 'width', width ); + } + + if ( height ) { + this.setData( 'height', height ); + } + + if ( autoplay ) { + this.setData( 'autoplay', 'yes' ); + } + + if ( allowdownload ) { + this.setData( 'allowdownload', 'yes' ); + } + + if ( loop ) { + this.setData( 'loop', 'yes' ); + } + + if ( advisorytitle ) { + this.setData( 'advisorytitle', advisorytitle ); + } + + if ( responsive ) { + this.setData( 'responsive', responsive ); + } + + if (controls) { + this.setData('controls', controls); + } + + if ( poster ) { + this.setData('poster', poster); + } + } + }, + data: function() { + // If there is an video source + if ( this.data.src ) { + // and there isn't a child (the video element) + if ( !this.element.getChild( 0 ) ) { + // Create a new