toastr

Jquery validate - show messages with Toastr

淺唱寂寞╮ 提交于 2021-01-28 10:51:46
问题 I'm using jquery validate.js for validating a form. I want to show the validation messages as Toastr popups, I've tried to add the Toastr function like this : .... messages: { "email": { required: function() { toastr.warning("Warning") }, email: "Email is invalid" } }, .... but it's keeps duplicate the popup for some reason - and instead of one popup - it creates 3.... I want to prevent messages duplication also - so if there is an error message than only one will displayed - no matter how

laravel和laravel-admin , EasyWeChat,WangEditor

自古美人都是妖i 提交于 2020-11-11 20:52:29
**本片博客主要介绍了 laravl和laravel-admin的使用,EasyWeChat结合laravel的使用,laravl-admin后台调取, WangEditor富文本编辑器。 关于laravel和laravel-admin的使用 首先去多看文档吧 大概流程就是先去composer laravel框架 然后配置数据库 然后安装laravl-admin官网文档 进行安装laravel-admin框架 关于laravel微信公众号开发 基于EasyWeChat 验证token use EasyWeChat\Factory; class TokenController extends Controller { public function wxtoken(Request $request) { /* $signature = $request->input('signature'); $timestamp = $request->input('timestamp'); $nonce = $request->input('nonce'); $echoStr = $request->input('echostr'); if ($this->checkSignature($signature, $timestamp, $nonce)) { ob_end_clean(); /

【转载】laravel中使用WangEditor及多图上传

梦想与她 提交于 2020-04-30 21:44:55
1. 创建项目及安装所需安装包 1.1 创建项目 composer create- project laravel/laravel= 5.3 blog_wangeditor --prefer-dist 1.2 创建数据库及配置文件 vim .env 1.3 安装中文包 composer require "caouecs/laravel-lang:~3.0" 安装之后将语言包移动到对应位置就好了,语言包默认位置是 resources/lang cp -a vendor/caouecs/laravel-lang/src/zh-CN resources/lang 修改 config/app.php 将local的值改为 zh-CN 1.4 安装 laravel-admin composer 安装 composer require encore/laravel-admin "1.3.*" 在 config/app.php 加入 ServiceProvider: Encore\Admin\Providers\AdminServiceProvider:: class 发布资源 php artisan vendor:publish --tag=laravel-admin 安装 php artisan admin: install 1.5 快速生成前端登录注册模块 php artisan make

How can I check if TempData is null through integration with jQuery?

試著忘記壹切 提交于 2020-01-23 01:42:06
问题 I would like to show a toastr (aka a popup) if TempData isn't null. However, I'm having trouble integrating the jQuery and Razor syntax together. This is my current javascript: $(document).ready(function() { if (@TempData["SuccessMessage"] != null) { toastr.options = { "closeButton": true, "positionClass": "toast-bottom-right" } toastr.success("This is a test!"); } }); However, the toastr isn't displaying. I'm already checking TempData further up to also display text to the user. @if

Cancel route using Sammy.js without affecting history

浪子不回头ぞ 提交于 2020-01-22 18:15:33
问题 I want to intercept all route changes with Sammy to first check if there is a pending action. I have done this using the sammy.before API and I return false to cancel the route. This keeps the user on the 'page' but it still changes the hash in the browsers address bar and adds the route to the browsers' history. If I cancel the route, I dont want it in the address bar nor history, but instead I expect the address to stay the same. Currently, to get around this I can either call window

Sticky toastr onclick event of close button

房东的猫 提交于 2020-01-16 01:36:08
问题 Is there a way I can perform an action after a user either clicks on the notification or clicks on the close button? At the moment I can do the first option using the options.onclick event. However I can not see how I can do this on the close button. Alternatively is there a way it could perform my action on the notification fading out? toastr.options = { "closeButton": true, "timeOut": "0", "extendedTimeOut": "0" }; toastr.options.onclick = function () { console.log("Notification clicked");

Display message in a toastr after controller method finish

穿精又带淫゛_ 提交于 2020-01-03 04:30:07
问题 i have controller method that upload image file, not using jQuery AJAX, from <input> type "file", the method returns: Return Redirect(Request.UrlReferrer.PathAndQuery) Because i want to stay in the same view after the submit click. I want to show after the success image upload, toastr.success . How i can do it? 回答1: In your http post action method, after successful upload, set an entry to TempData dictionary and read it in the next view which is loaded by the Redirect method and display the

how to show a confirmation dialog box in toastr

ⅰ亾dé卋堺 提交于 2020-01-01 05:50:27
问题 I have the below code for a delete button in the controller, $scope.removes = function (scope) { toastr.success("Delete all?","<br /><br /><button type='button' class='btn clear'>Yes</button>",{ closeButton: false, onClick: function(){ var nodeData = scope.$modelValue; if(nodeData.nodes.length > 0){ toastr.error('Cant delete Sub levels available :', 'Warning', { closeButton: true }); }else{ mainMenuService.deleteData(nodeData).success(function(data) { scope.remove(); toastr.success(data

Alert messages from controller: Add alert behavior in partial view?

孤街浪徒 提交于 2019-12-24 18:06:41
问题 In MVC 4, you could install this package Twitter.bootstrap.mvc and this would add lots of HTML helpers. Once istalled you could send alert to view right from controller. For example: public class AccountController : BaseController { public ActionResult AlertExample() { Success("This is a success alert"); Error("This is error alert"); Information("This is information alert"); ... etc. } } This would send the success alert right from controller to the view. Objective: Sending Growl Messages

Using toastr in the AngularJS way

倾然丶 夕夏残阳落幕 提交于 2019-12-21 03:11:06
问题 Currently, I just call toastr.success('my message') within a controller where required. This work fine, but it feels a bit dirty to me. Is there a 'best practice' or recommended 'angularjs' way of using the toastr.js library? 回答1: Yes. Pretty simply: app.factory('notificationFactory', function () { return { success: function (text) { toastr.success(text,"Success"); }, error: function (text) { toastr.error(text, "Error"); } }; }); Resolve factory in controller. Customize messages,