diff --git a/assets/src/js/auth.js b/assets/src/js/auth.js index 3e3991ed..d1d2734f 100644 --- a/assets/src/js/auth.js +++ b/assets/src/js/auth.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-17 10:54:22 * @Last Modified by: printempw - * @Last Modified time: 2016-07-29 11:10:21 + * @Last Modified time: 2016-08-14 13:22:35 */ 'use strict'; @@ -63,12 +63,20 @@ $('#login-button').click(function() { docCookies.setItem('email', data.email, time, '/'); docCookies.setItem('token', json.token, time, '/'); - showMsg(json.msg, 'success'); + swal({ + type: 'success', + html: json.msg + }); window.setTimeout('window.location = "../user"', 1000); + } else { if (json.login_fails > 3) { + swal({ + type: 'error', + html: '你尝试的次数太多啦,请输入验证码' + }); + $('#captcha-form').show(); - toastr.warning('你尝试的次数太多啦,请输入验证码'); freshCaptcha(); } @@ -138,7 +146,10 @@ $('#register-button').click(function() { docCookies.setItem('email', email, null, '/'); docCookies.setItem('token', json.token, null, '/'); - showMsg(json.msg, 'success'); + swal({ + type: 'success', + html: json.msg + }); window.setTimeout('window.location = "../user"', 1000); } else { showMsg(json.msg, 'warning'); @@ -225,8 +236,12 @@ $('#reset-button').click(function() { }, success: function(json) { if (json.errno == 0) { - showMsg('重置成功,请登录~', 'success'); - window.setTimeout('window.location = "./login"', 1000); + swal({ + type: '重置成功,请重新登录~', + html: json.msg + }).then(function() { + window.location = "./login"; + }); } else { showMsg(json.msg, 'warning'); $('#reset-button').html('重置').prop('disabled', ''); @@ -239,5 +254,4 @@ $('#reset-button').click(function() { }); } return false; - }); diff --git a/assets/src/js/skinlib.js b/assets/src/js/skinlib.js index 0950c29f..5ffb70e8 100644 --- a/assets/src/js/skinlib.js +++ b/assets/src/js/skinlib.js @@ -2,11 +2,18 @@ * @Author: printempw * @Date: 2016-07-19 10:46:38 * @Last Modified by: printempw - * @Last Modified time: 2016-08-13 23:23:14 + * @Last Modified time: 2016-08-14 13:20:38 */ 'use strict'; +$(document).ready(function() { + swal.setDefaults({ + confirmButtonText: '确定', + cancelButtonText: '取消' + }); +}); + $('#page-select').on('change', function() { // if has query strings if (getQueryString('filter') != "" || getQueryString('sort') != "") { @@ -26,29 +33,33 @@ $('#private').on('ifToggled', function() { function addToCloset(tid) { $.getJSON('../skinlib/info/'+tid, function(json) { - var dom = '
'+ - ''+ - ''+ - '

'; - showModal(dom, '收藏新皮肤', 'default', 'ajaxAddToCloset('+tid+')'); - return; + swal({ + title: '给你的皮肤起个名字吧~', + inputValue: json.name, + input: 'text', + showCancelButton: true, + inputValidator: function(value) { + return new Promise(function(resolve, reject) { + if (value) { + resolve(); + } else { + reject('你还没有填写名称哦'); + } + }); + } + }).then(function(result) { + ajaxAddToCloset(tid, result); + }); }); } -function ajaxAddToCloset(tid) { +function ajaxAddToCloset(tid, name) { // remove interference of modal which is hide $('.modal').each(function() { if ($(this).css('display') == "none") $(this).remove(); }); - var name = $('#new-name').val(); - - if (name == "") { - toastr.info('你还没有填写名称哦'); - $('#name').focus(); return; - } - $.ajax({ type: "POST", url: "../user/closet/add", @@ -56,7 +67,11 @@ function ajaxAddToCloset(tid) { data: { 'tid': tid, 'name': name }, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); + swal({ + type: 'success', + html: json.msg + }); + $('.modal').modal('hide'); $('a[tid='+tid+']').attr('href', 'javascript:removeFromCloset('+tid+');').attr('title', '从衣柜中移除').addClass('liked'); $('#'+tid).attr('href', 'javascript:removeFromCloset('+tid+');').html('从衣柜中移除'); @@ -70,23 +85,36 @@ function ajaxAddToCloset(tid) { } function removeFromCloset(tid) { - $.ajax({ - type: "POST", - url: "../user/closet/remove", - dataType: "json", - data: { 'tid' : tid }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - $('a[tid='+tid+']').attr('href', 'javascript:addToCloset('+tid+');').attr('title', '添加至衣柜').removeClass('liked'); - $('#'+tid).attr('href', 'javascript:addToCloset('+tid+');').html('添加至衣柜'); - $('#likes').html(parseInt($('#likes').html()) - 1); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: '确定要从衣柜中移除此材质吗?', + type: 'warning', + showCancelButton: true, + cancelButtonColor: '#3085d6', + confirmButtonColor: '#d33' + }).then(function() { + $.ajax({ + type: "POST", + url: "../user/closet/remove", + dataType: "json", + data: { 'tid' : tid }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); + + $('a[tid='+tid+']').attr('href', 'javascript:addToCloset('+tid+');').attr('title', '添加至衣柜').removeClass('liked'); + $('#'+tid).attr('href', 'javascript:addToCloset('+tid+');').html('添加至衣柜'); + $('#likes').html(parseInt($('#likes').html()) - 1); + } else { + toastr.warning(json.msg); + } + }, + error: showAjaxError + }); }); + } function init3dCanvas() { @@ -183,17 +211,25 @@ function upload() { }, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); - toastr.info('正在跳转...'); - window.setTimeout('window.location = "./show?tid='+json.tid+'"', 2500); + swal({ + type: 'success', + html: json.msg + }).then(function() { + toastr.info('正在跳转...'); + window.setTimeout('window.location = "./show?tid='+json.tid+'"', 1000); + }); } else { - $('#upload-button').html('确认上传').prop('disabled', ''); - toastr.warning(json.msg); + swal({ + type: 'warning', + html: json.msg + }).then(function() { + $('#upload-button').html('确认上传').prop('disabled', ''); + }); } }, error: function(json) { $('#upload-button').html('确认上传').prop('disabled', ''); - showModal(json.responseText.replace(/\n/g, '
'), 'Fatal Error(请联系作者)', 'danger'); + showAjaxError(json); } }); } @@ -201,24 +237,35 @@ function upload() { } function changeTextureName(tid) { - var new_name = prompt("请输入新的材质名称:"); - - if (!new_name) return; - - $.ajax({ - type: "POST", - url: "./rename", - dataType: "json", - data: { 'tid': tid, 'new_name': new_name }, - success: function(json) { - if (json.errno == 0) { - $('#name').text(new_name); - toastr.success(json.msg); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: '请输入新的材质名称:', + input: 'text', + showCancelButton: true, + inputValidator: function(value) { + return new Promise(function(resolve, reject) { + if (value) { + resolve(); + } else { + reject('你还没有填写名称哦'); + } + }); + } + }).then(function(new_name) { + $.ajax({ + type: "POST", + url: "./rename", + dataType: "json", + data: { 'tid': tid, 'new_name': new_name }, + success: function(json) { + if (json.errno == 0) { + $('#name').text(new_name); + toastr.success(json.msg); + } else { + toastr.warning(json.msg); + } + }, + error: showAjaxError + }); }); } @@ -243,21 +290,33 @@ function changePrivacy(tid) { } function deleteTexture(tid) { - if (!window.confirm('真的要删除此材质吗?积分将会被返还')) return; - - $.ajax({ - type: "POST", - url: "./delete", - dataType: "json", - data: { 'tid': tid }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - window.setTimeout('window.location = "./"', 1000); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: '真的要删除此材质吗?积分将会被返还', + type: 'warning', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./delete", + dataType: "json", + data: { 'tid': tid }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }).then(function() { + toastr.info('正在跳转...'); + window.setTimeout('window.location = "./', 1000); + }); + } else { + swal({ + type: 'warning', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); } diff --git a/assets/src/js/user.js b/assets/src/js/user.js index 8751daae..ef8e9ab3 100644 --- a/assets/src/js/user.js +++ b/assets/src/js/user.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-16 10:02:24 * @Last Modified by: printempw - * @Last Modified time: 2016-07-24 12:28:52 + * @Last Modified time: 2016-08-14 13:03:37 */ 'use strict'; @@ -146,43 +146,58 @@ $('body').on('click', '.item', function() { }); function removeFromCloset(tid) { - if (!window.confirm('真的要从您的衣柜中移除此皮肤/披风吗?')) return; + swal({ + text: '确定要从衣柜中移除此材质吗?', + type: 'warning', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./closet/remove", + dataType: "json", + data: { 'tid' : tid }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); - $.ajax({ - type: "POST", - url: "./closet/remove", - dataType: "json", - data: { "tid": tid }, - success: function(json) { - if (json.errno == 0) - toastr.success(json.msg); - else - toastr.warning(json.msg); - }, - error: showAjaxError + $('div[tid='+tid+']').remove(); + } else { + toastr.warning(json.msg); + } + }, + error: showAjaxError + }); }); } function setAsAvatar(tid) { - if (!window.confirm('真的要将此材质设置为用户头像吗?(将会自动截取皮肤头部)')) return; - - $.ajax({ - type: "POST", - url: "./profile/avatar", - dataType: "json", - data: { "tid": tid }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - // refersh avatars - $('[alt="User Image"]').each(function() { - $(this).prop('src', $(this).attr('src') + '?' + new Date().getTime()); - }) - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + title: '确定要将此材质设置为用户头像吗?', + text: '将会自动截取皮肤头部', + type: 'question', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./profile/avatar", + dataType: "json", + data: { "tid": tid }, + success: function(json) { + if (json.errno == 0) { + toastr.success(json.msg); + // refersh avatars + $('[alt="User Image"]').each(function() { + $(this).prop('src', $(this).attr('src') + '?' + new Date().getTime()); + }) + } else { + toastr.warning(json.msg); + } + }, + error: showAjaxError + }); }); } @@ -190,6 +205,10 @@ $(document).ready(function() { $('input[type=radio]').iCheck({ radioClass: 'iradio_square-blue' }); + swal.setDefaults({ + confirmButtonText: '确定', + cancelButtonText: '取消' + }); }); function setTexture() { @@ -213,7 +232,10 @@ function setTexture() { data: { 'pid' : pid, 'tid' : tid }, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); + swal({ + type: 'success', + html: json.msg + }); $('#modal-use-as').modal('hide'); } else { toastr.warning(json.msg); @@ -245,63 +267,104 @@ $('body').on('change', '#preference', function() { }); function changePlayerMame(pid, current_player_name) { - var new_player_name = prompt("请输入角色名(允许数字、字母以及下划线,是否支持中文角色名请参考本站设置):", current_player_name); - - if (!new_player_name) return; - - $.ajax({ - type: "POST", - url: "./player/rename", - dataType: "json", - data: { 'pid' : pid, 'new_player_name' : new_player_name }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - $('td:contains("'+pid+'")').next().html(new_player_name); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + title: '请输入角色名:', + text: '允许数字、字母以及下划线,是否支持中文角色名请参考本站设置', + inputValue: current_player_name, + input: 'text', + showCancelButton: true, + inputValidator: function(value) { + return new Promise(function(resolve, reject) { + if (value) { + resolve(); + } else { + reject('你还没有填写名称哦'); + } + }); + } + }).then(function(new_player_name) { + $.ajax({ + type: "POST", + url: "./player/rename", + dataType: "json", + data: { 'pid' : pid, 'new_player_name' : new_player_name }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); + $('td:contains("'+pid+'")').next().html(new_player_name); + } else { + swal({ + type: 'error', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); } function clearTexture(pid) { - if (!window.confirm('确定要重置该用户的皮肤/披风吗?')) return; - - $.ajax({ - type: "POST", - url: "./player/texture/clear", - dataType: "json", - data: { 'pid' : pid }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: "确定要重置该用户的皮肤/披风吗?", + type: 'warning', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./player/texture/clear", + dataType: "json", + data: { 'pid' : pid }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); + } else { + swal({ + type: 'error', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); } function deletePlayer(pid) { - if (!window.confirm('真的要删除该玩家吗?这将是永久性的删除')) return; - - $.ajax({ - type: "POST", - url: "./player/delete", - dataType: "json", - data: { 'pid' : pid }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - $('#'+pid).remove(); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + title: "真的要删除该玩家吗?", + text: "这将是永久性的删除", + type: 'warning', + showCancelButton: true, + cancelButtonColor: '#3085d6', + confirmButtonColor: '#d33' + }).then(function() { + $.ajax({ + type: "POST", + url: "./player/delete", + dataType: "json", + data: { 'pid' : pid }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); + } else { + swal({ + type: 'error', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); } @@ -313,9 +376,13 @@ function addNewPlayer() { data: { 'player_name' : $('#player_name').val() }, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); - $('#modal-add-player').modal('hide'); - location.reload(); + swal({ + type: 'success', + html: json.msg + }).then(function() { + $('#modal-add-player').modal('hide'); + location.reload(); + }); } else { toastr.warning(json.msg); } @@ -328,29 +395,44 @@ function changeNickName() { var new_nickname = $('#new-nickname').val(); if (!new_nickname) { - toastr.warning('你还没有填写新昵称啊'); + swal({ + type: 'error', + html: '你还没有填写新昵称啊' + }); return; } - if (!window.confirm('确定要将昵称设置为 '+new_nickname+' 吗?')) return; - - $.ajax({ - type: "POST", - url: "./profile?action=nickname", - dataType: "json", - data: { 'new_nickname' : new_nickname }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - $('.nickname').each(function() { - $(this).html(new_nickname); - }); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: '确定要将昵称设置为 ' + new_nickname + ' 吗?', + type: 'question', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./profile?action=nickname", + dataType: "json", + data: { 'new_nickname' : new_nickname }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }); + $('.nickname').each(function() { + $(this).html(new_nickname); + }); + } else { + swal({ + type: 'warning', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); + + } function changePassword() { @@ -378,17 +460,22 @@ function changePassword() { data: { 'current_password': password, 'new_password': new_passwd}, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); - logout(true, function() { - window.setTimeout('window.location = "../auth/login"', 1000); + swal({ + type: 'success', + html: json.msg + }).then(function() { + logout(true, function() { + window.location = "../auth/login"; + }); }); } else { - toastr.warning(json.msg); + swal({ + type: 'warning', + html: json.msg + }); } }, - error: function(json) { - showModal(json.responseText.replace(/\n/g, '
'), 'Fatal Error(请联系作者)', 'danger'); - } + error: showAjaxError }); } return false; @@ -407,40 +494,60 @@ function changeEmail() { var new_email = $('#new-email').val(); if (!new_email) { - toastr.warning('你还没有填写新邮箱啊'); return; + swal({ + type: 'error', + html: '你还没有填写新邮箱啊' + }); + return; } // check valid email address if (!/\S+@\S+\.\S+/.test(new_email)) { - toastr.warning('邮箱格式不正确!'); return; + swal({ + type: 'warning', + html: '邮箱格式不正确' + }); return; } - if (!window.confirm('确定要将用户邮箱更改为 '+new_email+' 吗?')) return; - - $.ajax({ - type: "POST", - url: "./profile?action=email", - dataType: "json", - data: { 'new_email' : new_email, 'password' : $('#current-password').val() }, - success: function(json) { - if (json.errno == 0) { - toastr.success(json.msg); - logout(true, function() { - window.setTimeout('window.location = "../auth/login"', 1000); - }); - } else { - toastr.warning(json.msg); - } - }, - error: showAjaxError + swal({ + text: '确定要将用户邮箱更改为 '+new_email+' 吗?', + type: 'question', + showCancelButton: true + }).then(function() { + $.ajax({ + type: "POST", + url: "./profile?action=email", + dataType: "json", + data: { 'new_email' : new_email, 'password' : $('#current-password').val() }, + success: function(json) { + if (json.errno == 0) { + swal({ + type: 'success', + html: json.msg + }).then(function() { + logout(true, function() { + window.location = "../auth/login"; + }); + }); + } else { + swal({ + type: 'warning', + html: json.msg + }); + } + }, + error: showAjaxError + }); }); } function deleteAccount() { - var password = $('.modal-body>#password').val(); if (!password) { - toastr.warning('请先输入当前用户密码'); return; + swal({ + type: 'warning', + html: '请先输入当前用户密码' + }); return; } $.ajax({ @@ -450,12 +557,19 @@ function deleteAccount() { data: { 'password' : password }, success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); - logout(true, function() { - window.setTimeout('window.location = "../auth/login"', 1000); + swal({ + type: 'success', + html: json.msg + }).then(function() { + logout(true, function() { + window.location = "../auth/login"; + }); }); } else { - toastr.warning(json.msg); + swal({ + type: 'warning', + html: json.msg + }); } }, error: showAjaxError @@ -495,10 +609,14 @@ function sign() { dataType: "json", success: function(json) { if (json.errno == 0) { - toastr.success(json.msg); - $('#score').html(json.score); - var dom = '  '+json.remaining_time+' 小时后可签到'; - $('#sign-button').attr('disabled', 'disabled').html(dom); + swal({ + type: 'success', + html: json.msg + }).then(function() { + $('#score').html(json.score); + var dom = '  '+json.remaining_time+' 小时后可签到'; + $('#sign-button').attr('disabled', 'disabled').html(dom); + }); } else { toastr.warning(json.msg); } diff --git a/assets/src/js/utils.js b/assets/src/js/utils.js index 3400f5b6..a5fd1a5a 100644 --- a/assets/src/js/utils.js +++ b/assets/src/js/utils.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-16 09:02:32 * @Last Modified by: printempw - * @Last Modified time: 2016-08-06 18:52:23 + * @Last Modified time: 2016-08-14 13:27:11 */ function showModal(msg, title, type, callback) { @@ -42,25 +42,41 @@ function getQueryString(key) { function logout(with_out_confirm, callback) { if (!with_out_confirm) { - if (!window.confirm('确定要登出吗?')) return; - } + swal({ + text: '确定要登出吗?', + type: 'warning', + showCancelButton: true, + confirmButtonText: '确定', + cancelButtonText: '取消' + }).then(function() { + $.ajax({ + type: "POST", + url: "../auth/logout", + dataType: "json", + success: function(json) { + docCookies.removeItem("email", "/"); + docCookies.removeItem("token", "/"); + + swal({ + type: 'success', + html: json.msg + }); + } + }); + }); + } else { + $.ajax({ + type: "POST", + url: "../auth/logout", + dataType: "json", + success: function(json) { + docCookies.removeItem("email", "/"); + docCookies.removeItem("token", "/"); - $.ajax({ - type: "POST", - url: "../auth/logout", - dataType: "json", - success: function(json) { - docCookies.removeItem("email", "/"); - docCookies.removeItem("token", "/"); - // silent - if (!with_out_confirm) { - toastr.success(json.msg); - window.setTimeout('window.location = "../"', 1000); - } else { if (callback) callback(json); } - } - }); + }); + } } /** @@ -106,4 +122,3 @@ var docCookies = { return aKeys; } }; - diff --git a/assets/src/sass/skinlib.scss b/assets/src/sass/skinlib.scss index 26c19482..a71f02da 100644 --- a/assets/src/sass/skinlib.scss +++ b/assets/src/sass/skinlib.scss @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-10 17:17:07 * @Last Modified by: printempw - * @Last Modified time: 2016-08-14 09:00:16 + * @Last Modified time: 2016-08-14 12:37:06 */ @import "style.scss"; diff --git a/assets/src/sass/style.scss b/assets/src/sass/style.scss index 7063b170..a13a9863 100644 --- a/assets/src/sass/style.scss +++ b/assets/src/sass/style.scss @@ -2,9 +2,11 @@ * @Author: printempw * @Date: 2016-06-04 20:55:09 * @Last Modified by: printempw - * @Last Modified time: 2016-08-14 09:02:03 + * @Last Modified time: 2016-08-14 12:58:39 */ +$font_stack: Ubuntu, 'Segoe UI', 'Microsoft Yahei', 'Microsoft Jhenghei', sans-serif; + @font-face { font-family: 'Ubuntu'; src: url('../../fonts/ubuntu.woff2') format('woff2'); @@ -21,7 +23,16 @@ } body, h1, h2, h3, h4, h5, h6, .logo { - font-family: Ubuntu, 'Segoe UI', 'Microsoft Yahei', 'Microsoft Jhenghei', sans-serif !important; + font-family: $font_stack !important; +} + +.swal2-modal, .swal2-content { + font-family: $font_stack; + font-weight: 400; +} + +.swal2-modal h2 { + font-size: 25px; } /* fucking webkit autofill */ diff --git a/bower.json b/bower.json index 803fc54a..867479f8 100644 --- a/bower.json +++ b/bower.json @@ -23,6 +23,7 @@ "toastr": "^2.1.2", "font-awesome": "Font-Awesome#^4.6.3", "bootstrap-fileinput": "^4.3.3", - "bootstrap": "^3.3.6" + "bootstrap": "^3.3.6", + "sweetalert2": "^4.1.6" } } diff --git a/gulpfile.js b/gulpfile.js index fd3c5829..1d7b3cba 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-07-21 13:38:26 * @Last Modified by: printempw -* @Last Modified time: 2016-08-06 22:14:40 +* @Last Modified time: 2016-08-14 13:33:51 */ var gulp = require('gulp'), @@ -78,6 +78,15 @@ gulp.task('copy', function(cb) { gulp.src('./assets/bower_components/toastr/toastr.min.js') .pipe(gulp.dest('./assets/libs/js/')); + + gulp.src('./assets/bower_components/sweetalert2/dist/sweetalert2.min.css') + .pipe(gulp.dest('./assets/libs/css/')); + + gulp.src('./assets/bower_components/sweetalert2/dist/sweetalert2.min.js') + .pipe(gulp.dest('./assets/libs/js/')); + + gulp.src('./assets/bower_components/es6-promise/es6-promise.min.js') + .pipe(gulp.dest('./assets/libs/js/')); }); gulp.task('lint', function() { @@ -93,7 +102,8 @@ gulp.task('lib-css', function() { './assets/libs/css/fileinput.min.css', './assets/libs/css/font-awesome.min.css', './assets/libs/css/blue.css', - './assets/libs/css/toastr.min.css' + './assets/libs/css/toastr.min.css', + './assets/libs/css/sweetalert2.min.css' ]) .pipe(concat('app.min.css')) .pipe(cleanCss()) @@ -108,6 +118,8 @@ gulp.task('lib-scripts', function() { './assets/libs/js/icheck.min.js', './assets/libs/js/fileinput.min.js', './assets/libs/js/toastr.min.js', + './assets/libs/js/es6-promise.min.js', + './assets/libs/js/sweetalert2.min.js', './assets/src/js/utils.js' ]) .pipe(concat('app.min.js')) @@ -144,14 +156,14 @@ gulp.task('scripts', function() { gulp.task('minify', ['sass', 'scripts']); -gulp.task('clean', ['concat', 'minify'], function (cb) { +gulp.task('clean', function (cb) { return del([ './assets/libs/css/**', './assets/libs/js/**' ], cb); }); -gulp.task('build', ['concat', 'minify', 'clean']); +gulp.task('build', ['concat', 'minify']); // release gulp.task('zip', function() { diff --git a/resources/views/user/closet.tpl b/resources/views/user/closet.tpl index 2ec0bfe8..1b8f8450 100644 --- a/resources/views/user/closet.tpl +++ b/resources/views/user/closet.tpl @@ -44,14 +44,14 @@

{{ $item->name }} ({{ $item->type }})

+ + - - @empty