diff --git a/Plugin.php b/Plugin.php new file mode 100644 index 0000000..c4e0a79 --- /dev/null +++ b/Plugin.php @@ -0,0 +1,43 @@ + 'romanov.flashmessage::lang.plugin.name', + 'description' => 'romanov.flashmessage::lang.plugin.description', + 'author' => 'Alexander Romanov', + 'icon' => 'icon-bullhorn' + ]; + } + + public function registerSettings() + { + return [ + 'settings' => [ + 'label' => 'romanov.flashmessage::lang.plugin.name', + 'description' => 'romanov.flashmessage::lang.plugin.description', + 'icon' => 'icon-bullhorn', + 'url' => Backend::url('romanov/flashmessage/settings'), + 'order' => 501, + 'category' => 'system::lang.system.categories.cms', + 'keywords' => 'flash message', + 'homepage' => 'https://github.com/romanov-acc/octobercms_flashmessage' + ], + ]; + } + + public function registerComponents() + { + return [ + 'Romanov\Flashmessage\Components\FlashMessage' => 'flashmessage', + 'Romanov\Flashmessage\Components\FormError' => 'formerrormessages', + ]; + } + +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ac1078 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Flash Message component +Display flash messages on front-end +## Install +Romanov.FlashMessage diff --git a/assets/js/bootstrap-notify.min.js b/assets/js/bootstrap-notify.min.js new file mode 100644 index 0000000..714bb41 --- /dev/null +++ b/assets/js/bootstrap-notify.min.js @@ -0,0 +1,2 @@ +/* Project: Bootstrap Growl = v3.0.0 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ +!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(e,i,n){var i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}};n=t.extend(!0,{},i,n),this.settings=t.extend(!0,{},s,n),this._defaults=s,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var s={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:''};String.format=function(){for(var t=arguments[0],e=1;e .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=s,this.$ele.addClass("alert-"+s).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+s);break;case"icon":var i=this.$ele.find('[data-notify="icon"]');"class"==t.settings.icon_type.toLowerCase()?i.removeClass(t.settings.content.icon).addClass(s):(i.is("img")||i.find("img"),i.attr("src",s));break;case"url":this.$ele.find('[data-notify="url"]').attr("href",s);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",s);break;default:this.$ele.find('[data-notify="'+e+'"]').html(s)}var n=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(n)},close:function(){t.close()}}},buildNotify:function(){var e=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,e.title,e.message,e.url,e.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),this.settings.delay<=0&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('Notify Icon')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var e=this,s=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return s=Math.max(s,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),1==this.settings.newest_on_top&&(s=this.settings.offset.y),i[this.settings.placement.from]=s+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(s=parseInt(s)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(s)),t.isFunction(e.settings.onShow)&&e.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)},600)},bind:function(){var e=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){e.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){e.$ele.data("notify-delay",e.settings.delay);var s=setInterval(function(){var t=parseInt(e.$ele.data("notify-delay"))-e.settings.timer;if("false"===e.$ele.data("data-hover")&&"pause"==e.settings.mouse_over||"pause"!=e.settings.mouse_over){var i=(e.settings.delay-t)/e.settings.delay*100;e.$ele.data("notify-delay",t),e.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-e.settings.timer&&(clearInterval(s),e.close())},e.settings.timer)}},close:function(){var e=this,s=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(s),t.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(e){var s=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(s.settings.placement.from,e),e=parseInt(e)+parseInt(s.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(e){return s=t.extend(!0,{},s,e)},t.notifyClose=function(e){"undefined"==typeof e||"all"==e?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+e+'"]').find('[data-notify="dismiss"]').trigger("click")}}); \ No newline at end of file diff --git a/assets/js/formmode.js b/assets/js/formmode.js new file mode 100644 index 0000000..8750b76 --- /dev/null +++ b/assets/js/formmode.js @@ -0,0 +1,27 @@ +$(window).on('ajaxErrorMessage', function(event, message){ + event.preventDefault(); +}); +$('button[type="submit"]').click( function(event) +{ + var form = $(this).closest('form')[0]; + $(form).on('ajaxError', function(event, obj, context, status){ + var message; + if(typeof status.responseJSON === 'undefined') { + message = status.responseText.match(/^\"(.*)\"\s/)[1]; + } else { + message = status.responseJSON.X_OCTOBER_ERROR_FIELDS; + } + $('.form-group').removeClass('has-error'); + $('.form-group .romanov_err_label').remove(); + if( typeof message === 'object' ) { + for(var key in message) { + $(this).find('input[name="'+ key +'"]').parent().addClass('has-error'); + $(this).find('input[name="'+ key +'"]').before('' + + '
'); + } + } else { + alert(message); + } + }); +}); \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..1cb16ff --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,52 @@ +$(window).on('ajaxErrorMessage', function(event, message){ + event.preventDefault(); +}); + +$(window).on('ajaxError', function(event, obj, context, status) { + var message; + var showfm = function(message){ + if(document.flashflag){ + document.romanov_flashoptions.message = message[key][0]; + document.romanov_flashsettings.type = 'danger'; + $.notify(document.romanov_flashoptions, document.romanov_flashsettings); + }else{ + $.notify({ + message: message[key][0] + },{ + type: 'danger', + placement: { + from: "top", + align: "center" + }, + delay: 10000 + }); + } + } + if (typeof status.responseJSON === 'undefined') { + message = status.responseText.match(/^\"(.*)\"\s/)[1]; + } else { + message = status.responseJSON.X_OCTOBER_ERROR_FIELDS; + } + if( typeof message === 'object' ) { + for (var key in message) { + showfm(message); + } + }else{ + showfm(message); + } +}); + +$(document).ready(function(){ + $.request('onShowFlashMsg', { + success: function(data){ + if(data != ''){ + $.each(data.msgs, function(type, msg) { + var t = type == 'error' ? 'danger' : type; + data.options.message = msg; + data.settings.type = t; + $.notify(data.options, data.settings); + }); + } + } + }); +}); \ No newline at end of file diff --git a/components/FlashMessage.php b/components/FlashMessage.php new file mode 100644 index 0000000..d56bf00 --- /dev/null +++ b/components/FlashMessage.php @@ -0,0 +1,97 @@ + 'romanov.flashmessage::lang.plugin.name', + 'description' => 'romanov.flashmessage::lang.plugin.description' + ]; + } + + public function defineProperties() + { + return [ + 'configuration' => [ + 'title' => 'romanov.flashmessage::lang.settings.conftitle', + 'type' => 'dropdown', + 'default' => '', + 'showExternalParam' => false, + ], + ]; + } + + public function onRun() { + $this->addJs('/plugins/romanov/flashmessage/assets/js/bootstrap-notify.min.js'); + $this->addJs('/plugins/romanov/flashmessage/assets/js/main.js'); + if($this->property('configuration')){ + $this->flag = true; + $this->getParam(); + } + } + + public function onShowFlashMsg(){ + $msg = \Flash::all(); + if($msg) { + $res['msgs'] = $msg; + if($this->property('configuration')) { + $data = FlashConfigur::find($this->property('configuration'))->toArray(); + $conf = $this->combineSettings($data); + $res['options'] = $conf['options']; + $res['settings'] = $conf['settings']; + }else{ + $res['options'] = []; + $res['settings'] = []; + } + return $res; + } + } + + public function getConfigurationOptions() + { + $arr = FlashConfigur::lists('title', 'id'); + $arr[''] = '...'; + return $arr; + } + + private function getParam(){ + $data = FlashConfigur::find($this->property('configuration'))->toArray(); + $conf = $this->combineSettings($data); + $this->options = $conf['options']; + $this->settings = $conf['settings']; + } + + private function checkArray($array){ + $arr = array_where($array, function($key, $value) + { + if(is_array($value)){ + return $this->checkArray($value); + } + return !empty($value); + }); + return $arr; + } + + private function combineSettings($data){ + $res['options'] = $this->checkArray(json_decode($data['options'],true)); + $s = json_decode($data['settings'],true); + $sp = json_decode($data['settingsplacement'],true); + $so = json_decode($data['settingsoffset'],true); + $sa = json_decode($data['settingsanimate'],true); + $s['placement'] = $sp; + $s['animate'] = $sa; + if(!$s['offset']) $s['offset'] = $so; + $res['settings'] = $this->checkArray($s); + return $res; + } + +} \ No newline at end of file diff --git a/components/FormError.php b/components/FormError.php new file mode 100644 index 0000000..c3ece02 --- /dev/null +++ b/components/FormError.php @@ -0,0 +1,24 @@ + 'romanov.flashmessage::lang.formerror.title', + 'description' => 'romanov.flashmessage::lang.formerror.description' + ]; + } + + public function defineProperties() + { + return []; + } + + public function onRun() { + $this->addJs('/plugins/romanov/flashmessage/assets/js/formmode.js'); + } +} \ No newline at end of file diff --git a/components/flashmessage/default.htm b/components/flashmessage/default.htm new file mode 100644 index 0000000..72cae06 --- /dev/null +++ b/components/flashmessage/default.htm @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/components/formerror/default.htm b/components/formerror/default.htm new file mode 100644 index 0000000..e69de29 diff --git a/controllers/Settings.php b/controllers/Settings.php new file mode 100644 index 0000000..a4aacdb --- /dev/null +++ b/controllers/Settings.php @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/controllers/settings/config_form.yaml b/controllers/settings/config_form.yaml new file mode 100644 index 0000000..faf802f --- /dev/null +++ b/controllers/settings/config_form.yaml @@ -0,0 +1,31 @@ +# =================================== +# Form Behavior Config +# =================================== + +# Record name +name: Setting + +# Model Form Field configuration +form: $/romanov/flashmessage/models/setting/fields.yaml + +# Model Class name +modelClass: Romanov\Flashmessage\Models\Setting + +# Default redirect location +defaultRedirect: romanov/flashmessage/settings + +# Create page +create: + title: romanov.flashmessage::lang.settings.new + redirect: romanov/flashmessage/settings/update/:id + redirectClose: romanov/flashmessage/settings + +# Update page +update: + title: romanov.flashmessage::lang.settings.edit + redirect: romanov/flashmessage/settings + redirectClose: romanov/flashmessage/settings + +# Preview page +preview: + title: romanov.flashmessage::lang.settings.preview \ No newline at end of file diff --git a/controllers/settings/config_list.yaml b/controllers/settings/config_list.yaml new file mode 100644 index 0000000..52bda91 --- /dev/null +++ b/controllers/settings/config_list.yaml @@ -0,0 +1,44 @@ +# =================================== +# List Behavior Config +# =================================== + +# Model List Column configuration +list: $/romanov/flashmessage/models/setting/columns.yaml + +# Model Class name +modelClass: Romanov\Flashmessage\Models\Setting + +# List Title +title: romanov.flashmessage::lang.settings.title + +# Link URL for each record +recordUrl: romanov/flashmessage/settings/update/:id + +# Message to display if the list is empty +noRecordsMessage: backend::lang.list.no_records + +# Records to display per page +recordsPerPage: 20 + +# Displays the list column set up button +showSetup: true + +# Displays the sorting link on each column +showSorting: true + +# Default sorting column +# defaultSort: +# column: created_at +# direction: desc + +# Display checkboxes next to each record +# showCheckboxes: true + +# Toolbar widget configuration +toolbar: + # Partial for toolbar buttons + buttons: list_toolbar + + # Search widget configuration + search: + prompt: backend::lang.list.search_prompt diff --git a/controllers/settings/create.htm b/controllers/settings/create.htm new file mode 100644 index 0000000..ae448c4 --- /dev/null +++ b/controllers/settings/create.htm @@ -0,0 +1,48 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + or Cancel + +
+
+ + + + + +

fatalError) ?>

+

Return to settings list

+ + \ No newline at end of file diff --git a/controllers/settings/index.htm b/controllers/settings/index.htm new file mode 100644 index 0000000..766877d --- /dev/null +++ b/controllers/settings/index.htm @@ -0,0 +1,2 @@ + +listRender() ?> diff --git a/controllers/settings/preview.htm b/controllers/settings/preview.htm new file mode 100644 index 0000000..ccc18dd --- /dev/null +++ b/controllers/settings/preview.htm @@ -0,0 +1,19 @@ + + + + +fatalError): ?> + +
+ formRenderPreview() ?> +
+ + + +

fatalError) ?>

+

Return to settings list

+ + \ No newline at end of file diff --git a/controllers/settings/update.htm b/controllers/settings/update.htm new file mode 100644 index 0000000..30f74db --- /dev/null +++ b/controllers/settings/update.htm @@ -0,0 +1,56 @@ + + + + +fatalError): ?> + + 'layout']) ?> + +
+ formRender() ?> +
+ +
+
+ + + + + or Cancel + +
+
+ + + + + +

fatalError) ?>

+

Return to settings list

+ + \ No newline at end of file diff --git a/lang/en/lang.php b/lang/en/lang.php new file mode 100644 index 0000000..50f86c1 --- /dev/null +++ b/lang/en/lang.php @@ -0,0 +1,20 @@ + [ + 'name' => 'Flash message', + 'description' => 'Component for show flash messages', + ], + 'formerror' => [ + 'title' => 'Form error messages', + 'description' => 'Show form error messages', + ], + 'settings' => [ + 'conftitle' => 'Configuration', + 'title' => 'Flash messages settings', + 'new' => 'Add configuration', + 'preview' => 'Preview', + 'edit' => 'Edin', + 'name' => 'Configuration name', + ], + +]; \ No newline at end of file diff --git a/lang/ru/lang.php b/lang/ru/lang.php new file mode 100644 index 0000000..9a32871 --- /dev/null +++ b/lang/ru/lang.php @@ -0,0 +1,20 @@ + [ + 'name' => 'Flash message', + 'description' => 'Компонент для вывода flash сообщений', + ], + 'formerror' => [ + 'title' => 'Form error messages', + 'description' => 'Показывает ошибки при отправке формы', + ], + 'settings' => [ + 'conftitle' => 'Конфигурация', + 'title' => 'Настройки flash сообщений', + 'new' => 'Добавить конфигурацию', + 'preview' => 'Предварительный просмотр', + 'edit' => 'Редактировать', + 'name' => 'Название конфигурации', + ], + +]; \ No newline at end of file diff --git a/models/Setting.php b/models/Setting.php new file mode 100644 index 0000000..c96eccf --- /dev/null +++ b/models/Setting.php @@ -0,0 +1,36 @@ + 'required', + ]; + public $attributeNames; + protected $guarded = ['*']; + + protected $fillable = []; + protected $jsonable = ['options','settings','settingsplacement','settingsoffset','settingsanimate']; + + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = []; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = []; + public $attachMany = []; + + public function __construct() + { + $this->attributeNames = [ + 'title' => '"'.Lang::get('romanov.flashmessage::lang.settings.name').'"', + ]; + parent::__construct(); + } + +} \ No newline at end of file diff --git a/models/setting/columns.yaml b/models/setting/columns.yaml new file mode 100644 index 0000000..6a6f182 --- /dev/null +++ b/models/setting/columns.yaml @@ -0,0 +1,7 @@ +columns: + id: + label: ID + searchable: true + title: + label: romanov.flashmessage::lang.settings.name + searchable: true \ No newline at end of file diff --git a/models/setting/fields.yaml b/models/setting/fields.yaml new file mode 100644 index 0000000..7a0a549 --- /dev/null +++ b/models/setting/fields.yaml @@ -0,0 +1,101 @@ +fields: + title: + label: romanov.flashmessage::lang.settings.name + required: required + options_section: + label: Options + type: section + comment: Documentation - http://bootstrap-notify.remabledesigns.com/#documentation-options + options[icon]: + label: icon + comment: class or src. This is the icon that will be displayed within the notify notification. This icon can either be a class (Font Icon) or an image url. Please keep in mind if you wish to use an image url that you must set icon_type to img in the options. + options[title]: + label: title + comment: This is the title that will be displayed within the notify notification. Please keep in mind unless you style the [data-notify="title"] in css this will look identical to the message. + options[message]: + label: message + comment: This is the message that will be displayed within the notify notification. + options[url]: + label: url + comment: If this value is set it will make the entire notify (except the close button) a clickable area. If the user clicks on this area it will take them to the url specified here. + options[target]: + label: target + comment: The target attribute specifies where to open the linked notification (_blank, _self, _parent, _top). + settings_section: + label: Settings + type: section + comment: Documentation - http://bootstrap-notify.remabledesigns.com/#documentation-settings + settings[element]: + label: element + comment: Appends the notification to a specific element. If the element is set to anything other than the body of a document it switches from a position: fixed to position: absolute. + settings[position]: + label: position + comment: Allows users to specify a custom position to the notification container element(static | fixed | relative | absolute). + settings[type]: + label: type + comment: Defines the style of the notification using bootstraps native alert styles. Please keep in mind that when the notification is generated the type gets prefixed with alert-. When using native alert styles this will not be an issue, but if you create a new style such as pink when setting up the css you have to use the class alert-pink. + settings[allow_dismiss]: + label: allow_dismiss + comment: If this value is set to false it will hide the data-grow="dismiss" element. Please keep in mind if you modify the template setting and do not include a data-notify="dismiss" element even with this set to true there will be no element for a user to click to close the notification. + type: switch + default: true + settingsplacement[from]: + label: placement.from + comment: This controls where if the notification will be placed at the top or bottom of your element. + settingsplacement[align]: + label: placement.align + comment: This controls if the notification will be placed in the left, center or right side of the element. + settings[offset]: + label: offset + comment: This adds padding in pixels between the element and the notification creating a space between their edges. + settingsoffset[x]: + label: offset.x + comment: This adds adding on the x axis in pixels between the element and the notification creating a space between their edges. + settingsoffset[y]: + label: offset.y + comment: This adds padding on the y axis in pixels between the element and the notification creating a space between their edges. + settings[spacing]: + label: spacing + comment: This adds a padding in pixels between notifications with the same placement creating a space between their edges. + settings[z_index]: + label: z_index + comment: Pretty simple, this sets the css property z-index for the notification. You may have to raise this number if you have other elements overlapping the notification. + settings[delay]: + label: delay + comment: If delay is set higher than 0 then the notification will auto-close after the delay period is up. Please keep in mind that delay uses milliseconds so 5000 is 5 seconds. + settings[timer]: + label: timer + comment: This is the amount of milliseconds removed from the notify at every timer milliseconds. So to make that a little less confusing every 1000 milliseconds there will be 1000 milliseconds removed from the remaining time of the notify delay. If this is set higher then delay the notify will not be removed until timer has run out. + settings[url_target]: + label: url_target + comment: This sets the target of the url for a notification. please check HTML target Attribute to learn more about these options(_blank | _self | _parent | _top). + settings[mouse_over]: + label: mouse_over + comment: By default this does nothing. If you set this option to pause it will pause the timer on the notification delay. Since version 2.0.0 the timer will not reset it will continue from it's last tick. + settingsanimate[enter]: + label: animate.enter + comment: This will control the animation used to bring the generate the notification on screen. Since version 2.0.0 all animations are controlled using css. This plugin is not com packaged with any animations. Please use Animate.css by Daniel Eden or you can always write your own css animations. + settingsanimate[exit]: + label: animate.exit + comment: This will control the animation used to bring the generate the notification on screen. Since version 2.0.0 all animations are controlled using css. This plugin is not com packaged with any animations. Please use Animate.css by Daniel Eden or you can always write your own css animations. + settings[onShow]: + label: onShow + comment: This event fires immediately when the show instance method is called. + settings[onShown]: + label: onShown + comment: This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete). + settings[onClose]: + label: onClose + comment: This event is fired immediately when the notification is closing. + settings[onClosed]: + label: onClosed + comment: This event is fired when the modal has finished closing and is removed from the document (will wait for CSS transitions to complete). + settings[icon_type]: + label: icon_type + comment: This is used to let the plugin know if you are using an icon font for images or if you are using image. If this setting is not set to class it will assume you are using an img. Please keep in mind if you are using an image you to set icon to the src of the image. + settings[template]: + label: template + comment: Since version 3.0.0 the template option has been revamped in hopes of giving users more control over the layout. Please find the code for the default template below. + type: codeeditor + size: huge + language: html \ No newline at end of file diff --git a/updates/create_settings_table.php b/updates/create_settings_table.php new file mode 100644 index 0000000..cc339d3 --- /dev/null +++ b/updates/create_settings_table.php @@ -0,0 +1,30 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->string('title', 100)->unique(); + $table->text('options'); + $table->text('settings'); + $table->text('settingsplacement'); + $table->text('settingsoffset'); + $table->text('settingsanimate'); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('romanov_flashmessage_settings'); + } + +} diff --git a/updates/version.yaml b/updates/version.yaml new file mode 100644 index 0000000..4556717 --- /dev/null +++ b/updates/version.yaml @@ -0,0 +1,4 @@ +1.0.1: + - First version of flashmessage + - Run table migrations + - create_settings_table.php \ No newline at end of file