use sweetalert2 to show message in some cases

This commit is contained in:
printempw 2016-08-14 13:38:46 +08:00
parent 08c54acae7
commit 01e4289f77
9 changed files with 479 additions and 249 deletions

View File

@ -2,7 +2,7 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-17 10:54:22 * @Date: 2016-07-17 10:54:22
* @Last Modified by: printempw * @Last Modified by: printempw
* @Last Modified time: 2016-07-29 11:10:21 * @Last Modified time: 2016-08-14 13:22:35
*/ */
'use strict'; 'use strict';
@ -63,12 +63,20 @@ $('#login-button').click(function() {
docCookies.setItem('email', data.email, time, '/'); docCookies.setItem('email', data.email, time, '/');
docCookies.setItem('token', json.token, time, '/'); docCookies.setItem('token', json.token, time, '/');
showMsg(json.msg, 'success'); swal({
type: 'success',
html: json.msg
});
window.setTimeout('window.location = "../user"', 1000); window.setTimeout('window.location = "../user"', 1000);
} else { } else {
if (json.login_fails > 3) { if (json.login_fails > 3) {
swal({
type: 'error',
html: '你尝试的次数太多啦,请输入验证码'
});
$('#captcha-form').show(); $('#captcha-form').show();
toastr.warning('你尝试的次数太多啦,请输入验证码');
freshCaptcha(); freshCaptcha();
} }
@ -138,7 +146,10 @@ $('#register-button').click(function() {
docCookies.setItem('email', email, null, '/'); docCookies.setItem('email', email, null, '/');
docCookies.setItem('token', json.token, null, '/'); docCookies.setItem('token', json.token, null, '/');
showMsg(json.msg, 'success'); swal({
type: 'success',
html: json.msg
});
window.setTimeout('window.location = "../user"', 1000); window.setTimeout('window.location = "../user"', 1000);
} else { } else {
showMsg(json.msg, 'warning'); showMsg(json.msg, 'warning');
@ -225,8 +236,12 @@ $('#reset-button').click(function() {
}, },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
showMsg('重置成功,请登录~', 'success'); swal({
window.setTimeout('window.location = "./login"', 1000); type: '重置成功,请重新登录~',
html: json.msg
}).then(function() {
window.location = "./login";
});
} else { } else {
showMsg(json.msg, 'warning'); showMsg(json.msg, 'warning');
$('#reset-button').html('重置').prop('disabled', ''); $('#reset-button').html('重置').prop('disabled', '');
@ -239,5 +254,4 @@ $('#reset-button').click(function() {
}); });
} }
return false; return false;
}); });

View File

@ -2,11 +2,18 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-19 10:46:38 * @Date: 2016-07-19 10:46:38
* @Last Modified by: printempw * @Last Modified by: printempw
* @Last Modified time: 2016-08-13 23:23:14 * @Last Modified time: 2016-08-14 13:20:38
*/ */
'use strict'; 'use strict';
$(document).ready(function() {
swal.setDefaults({
confirmButtonText: '确定',
cancelButtonText: '取消'
});
});
$('#page-select').on('change', function() { $('#page-select').on('change', function() {
// if has query strings // if has query strings
if (getQueryString('filter') != "" || getQueryString('sort') != "") { if (getQueryString('filter') != "" || getQueryString('sort') != "") {
@ -26,29 +33,33 @@ $('#private').on('ifToggled', function() {
function addToCloset(tid) { function addToCloset(tid) {
$.getJSON('../skinlib/info/'+tid, function(json) { $.getJSON('../skinlib/info/'+tid, function(json) {
var dom = '<div class="form-group">'+ swal({
'<label for="new-name">给你的皮肤起个名字吧~</label>'+ title: '给你的皮肤起个名字吧~',
'<input id="new-name" class="form-control" type="text" value="'+json.name+'" />'+ inputValue: json.name,
'</div><br />'; input: 'text',
showModal(dom, '收藏新皮肤', 'default', 'ajaxAddToCloset('+tid+')'); showCancelButton: true,
return; 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 // remove interference of modal which is hide
$('.modal').each(function() { $('.modal').each(function() {
if ($(this).css('display') == "none") if ($(this).css('display') == "none")
$(this).remove(); $(this).remove();
}); });
var name = $('#new-name').val();
if (name == "") {
toastr.info('你还没有填写名称哦');
$('#name').focus(); return;
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "../user/closet/add", url: "../user/closet/add",
@ -56,7 +67,11 @@ function ajaxAddToCloset(tid) {
data: { 'tid': tid, 'name': name }, data: { 'tid': tid, 'name': name },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
type: 'success',
html: json.msg
});
$('.modal').modal('hide'); $('.modal').modal('hide');
$('a[tid='+tid+']').attr('href', 'javascript:removeFromCloset('+tid+');').attr('title', '从衣柜中移除').addClass('liked'); $('a[tid='+tid+']').attr('href', 'javascript:removeFromCloset('+tid+');').attr('title', '从衣柜中移除').addClass('liked');
$('#'+tid).attr('href', 'javascript:removeFromCloset('+tid+');').html('从衣柜中移除'); $('#'+tid).attr('href', 'javascript:removeFromCloset('+tid+');').html('从衣柜中移除');
@ -70,23 +85,36 @@ function ajaxAddToCloset(tid) {
} }
function removeFromCloset(tid) { function removeFromCloset(tid) {
$.ajax({ swal({
type: "POST", text: '确定要从衣柜中移除此材质吗?',
url: "../user/closet/remove", type: 'warning',
dataType: "json", showCancelButton: true,
data: { 'tid' : tid }, cancelButtonColor: '#3085d6',
success: function(json) { confirmButtonColor: '#d33'
if (json.errno == 0) { }).then(function() {
toastr.success(json.msg); $.ajax({
$('a[tid='+tid+']').attr('href', 'javascript:addToCloset('+tid+');').attr('title', '添加至衣柜').removeClass('liked'); type: "POST",
$('#'+tid).attr('href', 'javascript:addToCloset('+tid+');').html('添加至衣柜'); url: "../user/closet/remove",
$('#likes').html(parseInt($('#likes').html()) - 1); dataType: "json",
} else { data: { 'tid' : tid },
toastr.warning(json.msg); success: function(json) {
} if (json.errno == 0) {
}, swal({
error: showAjaxError 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() { function init3dCanvas() {
@ -183,17 +211,25 @@ function upload() {
}, },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
toastr.info('正在跳转...'); type: 'success',
window.setTimeout('window.location = "./show?tid='+json.tid+'"', 2500); html: json.msg
}).then(function() {
toastr.info('正在跳转...');
window.setTimeout('window.location = "./show?tid='+json.tid+'"', 1000);
});
} else { } else {
$('#upload-button').html('确认上传').prop('disabled', ''); swal({
toastr.warning(json.msg); type: 'warning',
html: json.msg
}).then(function() {
$('#upload-button').html('确认上传').prop('disabled', '');
});
} }
}, },
error: function(json) { error: function(json) {
$('#upload-button').html('确认上传').prop('disabled', ''); $('#upload-button').html('确认上传').prop('disabled', '');
showModal(json.responseText.replace(/\n/g, '<br />'), 'Fatal Error请联系作者', 'danger'); showAjaxError(json);
} }
}); });
} }
@ -201,24 +237,35 @@ function upload() {
} }
function changeTextureName(tid) { function changeTextureName(tid) {
var new_name = prompt("请输入新的材质名称:"); swal({
text: '请输入新的材质名称:',
if (!new_name) return; input: 'text',
showCancelButton: true,
$.ajax({ inputValidator: function(value) {
type: "POST", return new Promise(function(resolve, reject) {
url: "./rename", if (value) {
dataType: "json", resolve();
data: { 'tid': tid, 'new_name': new_name }, } else {
success: function(json) { reject('你还没有填写名称哦');
if (json.errno == 0) { }
$('#name').text(new_name); });
toastr.success(json.msg); }
} else { }).then(function(new_name) {
toastr.warning(json.msg); $.ajax({
} type: "POST",
}, url: "./rename",
error: showAjaxError 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) { function deleteTexture(tid) {
if (!window.confirm('真的要删除此材质吗?积分将会被返还')) return; swal({
text: '真的要删除此材质吗?积分将会被返还',
$.ajax({ type: 'warning',
type: "POST", showCancelButton: true
url: "./delete", }).then(function() {
dataType: "json", $.ajax({
data: { 'tid': tid }, type: "POST",
success: function(json) { url: "./delete",
if (json.errno == 0) { dataType: "json",
toastr.success(json.msg); data: { 'tid': tid },
window.setTimeout('window.location = "./"', 1000); success: function(json) {
} else { if (json.errno == 0) {
toastr.warning(json.msg); swal({
} type: 'success',
}, html: json.msg
error: showAjaxError }).then(function() {
toastr.info('正在跳转...');
window.setTimeout('window.location = "./', 1000);
});
} else {
swal({
type: 'warning',
html: json.msg
});
}
},
error: showAjaxError
});
}); });
} }

View File

@ -2,7 +2,7 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-16 10:02:24 * @Date: 2016-07-16 10:02:24
* @Last Modified by: printempw * @Last Modified by: printempw
* @Last Modified time: 2016-07-24 12:28:52 * @Last Modified time: 2016-08-14 13:03:37
*/ */
'use strict'; 'use strict';
@ -146,43 +146,58 @@ $('body').on('click', '.item', function() {
}); });
function removeFromCloset(tid) { 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({ $('div[tid='+tid+']').remove();
type: "POST", } else {
url: "./closet/remove", toastr.warning(json.msg);
dataType: "json", }
data: { "tid": tid }, },
success: function(json) { error: showAjaxError
if (json.errno == 0) });
toastr.success(json.msg);
else
toastr.warning(json.msg);
},
error: showAjaxError
}); });
} }
function setAsAvatar(tid) { function setAsAvatar(tid) {
if (!window.confirm('真的要将此材质设置为用户头像吗?(将会自动截取皮肤头部)')) return; swal({
title: '确定要将此材质设置为用户头像吗?',
$.ajax({ text: '将会自动截取皮肤头部',
type: "POST", type: 'question',
url: "./profile/avatar", showCancelButton: true
dataType: "json", }).then(function() {
data: { "tid": tid }, $.ajax({
success: function(json) { type: "POST",
if (json.errno == 0) { url: "./profile/avatar",
toastr.success(json.msg); dataType: "json",
// refersh avatars data: { "tid": tid },
$('[alt="User Image"]').each(function() { success: function(json) {
$(this).prop('src', $(this).attr('src') + '?' + new Date().getTime()); if (json.errno == 0) {
}) toastr.success(json.msg);
} else { // refersh avatars
toastr.warning(json.msg); $('[alt="User Image"]').each(function() {
} $(this).prop('src', $(this).attr('src') + '?' + new Date().getTime());
}, })
error: showAjaxError } else {
toastr.warning(json.msg);
}
},
error: showAjaxError
});
}); });
} }
@ -190,6 +205,10 @@ $(document).ready(function() {
$('input[type=radio]').iCheck({ $('input[type=radio]').iCheck({
radioClass: 'iradio_square-blue' radioClass: 'iradio_square-blue'
}); });
swal.setDefaults({
confirmButtonText: '确定',
cancelButtonText: '取消'
});
}); });
function setTexture() { function setTexture() {
@ -213,7 +232,10 @@ function setTexture() {
data: { 'pid' : pid, 'tid' : tid }, data: { 'pid' : pid, 'tid' : tid },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
type: 'success',
html: json.msg
});
$('#modal-use-as').modal('hide'); $('#modal-use-as').modal('hide');
} else { } else {
toastr.warning(json.msg); toastr.warning(json.msg);
@ -245,63 +267,104 @@ $('body').on('change', '#preference', function() {
}); });
function changePlayerMame(pid, current_player_name) { function changePlayerMame(pid, current_player_name) {
var new_player_name = prompt("请输入角色名(允许数字、字母以及下划线,是否支持中文角色名请参考本站设置):", current_player_name); swal({
title: '请输入角色名:',
if (!new_player_name) return; text: '允许数字、字母以及下划线,是否支持中文角色名请参考本站设置',
inputValue: current_player_name,
$.ajax({ input: 'text',
type: "POST", showCancelButton: true,
url: "./player/rename", inputValidator: function(value) {
dataType: "json", return new Promise(function(resolve, reject) {
data: { 'pid' : pid, 'new_player_name' : new_player_name }, if (value) {
success: function(json) { resolve();
if (json.errno == 0) { } else {
toastr.success(json.msg); reject('你还没有填写名称哦');
$('td:contains("'+pid+'")').next().html(new_player_name); }
} else { });
toastr.warning(json.msg); }
} }).then(function(new_player_name) {
}, $.ajax({
error: showAjaxError 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) { function clearTexture(pid) {
if (!window.confirm('确定要重置该用户的皮肤/披风吗?')) return; swal({
text: "确定要重置该用户的皮肤/披风吗?",
$.ajax({ type: 'warning',
type: "POST", showCancelButton: true
url: "./player/texture/clear", }).then(function() {
dataType: "json", $.ajax({
data: { 'pid' : pid }, type: "POST",
success: function(json) { url: "./player/texture/clear",
if (json.errno == 0) { dataType: "json",
toastr.success(json.msg); data: { 'pid' : pid },
} else { success: function(json) {
toastr.warning(json.msg); if (json.errno == 0) {
} swal({
}, type: 'success',
error: showAjaxError html: json.msg
});
} else {
swal({
type: 'error',
html: json.msg
});
}
},
error: showAjaxError
});
}); });
} }
function deletePlayer(pid) { function deletePlayer(pid) {
if (!window.confirm('真的要删除该玩家吗?这将是永久性的删除')) return; swal({
title: "真的要删除该玩家吗?",
$.ajax({ text: "这将是永久性的删除",
type: "POST", type: 'warning',
url: "./player/delete", showCancelButton: true,
dataType: "json", cancelButtonColor: '#3085d6',
data: { 'pid' : pid }, confirmButtonColor: '#d33'
success: function(json) { }).then(function() {
if (json.errno == 0) { $.ajax({
toastr.success(json.msg); type: "POST",
$('#'+pid).remove(); url: "./player/delete",
} else { dataType: "json",
toastr.warning(json.msg); data: { 'pid' : pid },
} success: function(json) {
}, if (json.errno == 0) {
error: showAjaxError 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() }, data: { 'player_name' : $('#player_name').val() },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
$('#modal-add-player').modal('hide'); type: 'success',
location.reload(); html: json.msg
}).then(function() {
$('#modal-add-player').modal('hide');
location.reload();
});
} else { } else {
toastr.warning(json.msg); toastr.warning(json.msg);
} }
@ -328,29 +395,44 @@ function changeNickName() {
var new_nickname = $('#new-nickname').val(); var new_nickname = $('#new-nickname').val();
if (!new_nickname) { if (!new_nickname) {
toastr.warning('你还没有填写新昵称啊'); swal({
type: 'error',
html: '你还没有填写新昵称啊'
});
return; return;
} }
if (!window.confirm('确定要将昵称设置为 '+new_nickname+' 吗?')) return; swal({
text: '确定要将昵称设置为 ' + new_nickname + ' 吗?',
$.ajax({ type: 'question',
type: "POST", showCancelButton: true
url: "./profile?action=nickname", }).then(function() {
dataType: "json", $.ajax({
data: { 'new_nickname' : new_nickname }, type: "POST",
success: function(json) { url: "./profile?action=nickname",
if (json.errno == 0) { dataType: "json",
toastr.success(json.msg); data: { 'new_nickname' : new_nickname },
$('.nickname').each(function() { success: function(json) {
$(this).html(new_nickname); if (json.errno == 0) {
}); swal({
} else { type: 'success',
toastr.warning(json.msg); html: json.msg
} });
}, $('.nickname').each(function() {
error: showAjaxError $(this).html(new_nickname);
});
} else {
swal({
type: 'warning',
html: json.msg
});
}
},
error: showAjaxError
});
}); });
} }
function changePassword() { function changePassword() {
@ -378,17 +460,22 @@ function changePassword() {
data: { 'current_password': password, 'new_password': new_passwd}, data: { 'current_password': password, 'new_password': new_passwd},
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
logout(true, function() { type: 'success',
window.setTimeout('window.location = "../auth/login"', 1000); html: json.msg
}).then(function() {
logout(true, function() {
window.location = "../auth/login";
});
}); });
} else { } else {
toastr.warning(json.msg); swal({
type: 'warning',
html: json.msg
});
} }
}, },
error: function(json) { error: showAjaxError
showModal(json.responseText.replace(/\n/g, '<br />'), 'Fatal Error请联系作者', 'danger');
}
}); });
} }
return false; return false;
@ -407,40 +494,60 @@ function changeEmail() {
var new_email = $('#new-email').val(); var new_email = $('#new-email').val();
if (!new_email) { if (!new_email) {
toastr.warning('你还没有填写新邮箱啊'); return; swal({
type: 'error',
html: '你还没有填写新邮箱啊'
});
return;
} }
// check valid email address // check valid email address
if (!/\S+@\S+\.\S+/.test(new_email)) { if (!/\S+@\S+\.\S+/.test(new_email)) {
toastr.warning('邮箱格式不正确!'); return; swal({
type: 'warning',
html: '邮箱格式不正确'
}); return;
} }
if (!window.confirm('确定要将用户邮箱更改为 '+new_email+' 吗?')) return; swal({
text: '确定要将用户邮箱更改为 '+new_email+' 吗?',
$.ajax({ type: 'question',
type: "POST", showCancelButton: true
url: "./profile?action=email", }).then(function() {
dataType: "json", $.ajax({
data: { 'new_email' : new_email, 'password' : $('#current-password').val() }, type: "POST",
success: function(json) { url: "./profile?action=email",
if (json.errno == 0) { dataType: "json",
toastr.success(json.msg); data: { 'new_email' : new_email, 'password' : $('#current-password').val() },
logout(true, function() { success: function(json) {
window.setTimeout('window.location = "../auth/login"', 1000); if (json.errno == 0) {
}); swal({
} else { type: 'success',
toastr.warning(json.msg); html: json.msg
} }).then(function() {
}, logout(true, function() {
error: showAjaxError window.location = "../auth/login";
});
});
} else {
swal({
type: 'warning',
html: json.msg
});
}
},
error: showAjaxError
});
}); });
} }
function deleteAccount() { function deleteAccount() {
var password = $('.modal-body>#password').val(); var password = $('.modal-body>#password').val();
if (!password) { if (!password) {
toastr.warning('请先输入当前用户密码'); return; swal({
type: 'warning',
html: '请先输入当前用户密码'
}); return;
} }
$.ajax({ $.ajax({
@ -450,12 +557,19 @@ function deleteAccount() {
data: { 'password' : password }, data: { 'password' : password },
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
logout(true, function() { type: 'success',
window.setTimeout('window.location = "../auth/login"', 1000); html: json.msg
}).then(function() {
logout(true, function() {
window.location = "../auth/login";
});
}); });
} else { } else {
toastr.warning(json.msg); swal({
type: 'warning',
html: json.msg
});
} }
}, },
error: showAjaxError error: showAjaxError
@ -495,10 +609,14 @@ function sign() {
dataType: "json", dataType: "json",
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
toastr.success(json.msg); swal({
$('#score').html(json.score); type: 'success',
var dom = '<i class="fa fa-calendar-check-o"></i> &nbsp;'+json.remaining_time+' 小时后可签到'; html: json.msg
$('#sign-button').attr('disabled', 'disabled').html(dom); }).then(function() {
$('#score').html(json.score);
var dom = '<i class="fa fa-calendar-check-o"></i> &nbsp;'+json.remaining_time+' 小时后可签到';
$('#sign-button').attr('disabled', 'disabled').html(dom);
});
} else { } else {
toastr.warning(json.msg); toastr.warning(json.msg);
} }

View File

@ -2,7 +2,7 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-16 09:02:32 * @Date: 2016-07-16 09:02:32
* @Last Modified by: printempw * @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) { function showModal(msg, title, type, callback) {
@ -42,25 +42,41 @@ function getQueryString(key) {
function logout(with_out_confirm, callback) { function logout(with_out_confirm, callback) {
if (!with_out_confirm) { 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); if (callback) callback(json);
} }
} });
}); }
} }
/** /**
@ -106,4 +122,3 @@ var docCookies = {
return aKeys; return aKeys;
} }
}; };

View File

@ -2,7 +2,7 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-10 17:17:07 * @Date: 2016-07-10 17:17:07
* @Last Modified by: printempw * @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"; @import "style.scss";

View File

@ -2,9 +2,11 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-06-04 20:55:09 * @Date: 2016-06-04 20:55:09
* @Last Modified by: printempw * @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-face {
font-family: 'Ubuntu'; font-family: 'Ubuntu';
src: url('../../fonts/ubuntu.woff2') format('woff2'); src: url('../../fonts/ubuntu.woff2') format('woff2');
@ -21,7 +23,16 @@
} }
body, h1, h2, h3, h4, h5, h6, .logo { 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 */ /* fucking webkit autofill */

View File

@ -23,6 +23,7 @@
"toastr": "^2.1.2", "toastr": "^2.1.2",
"font-awesome": "Font-Awesome#^4.6.3", "font-awesome": "Font-Awesome#^4.6.3",
"bootstrap-fileinput": "^4.3.3", "bootstrap-fileinput": "^4.3.3",
"bootstrap": "^3.3.6" "bootstrap": "^3.3.6",
"sweetalert2": "^4.1.6"
} }
} }

View File

@ -2,7 +2,7 @@
* @Author: prpr * @Author: prpr
* @Date: 2016-07-21 13:38:26 * @Date: 2016-07-21 13:38:26
* @Last Modified by: printempw * @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'), var gulp = require('gulp'),
@ -78,6 +78,15 @@ gulp.task('copy', function(cb) {
gulp.src('./assets/bower_components/toastr/toastr.min.js') gulp.src('./assets/bower_components/toastr/toastr.min.js')
.pipe(gulp.dest('./assets/libs/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() { gulp.task('lint', function() {
@ -93,7 +102,8 @@ gulp.task('lib-css', function() {
'./assets/libs/css/fileinput.min.css', './assets/libs/css/fileinput.min.css',
'./assets/libs/css/font-awesome.min.css', './assets/libs/css/font-awesome.min.css',
'./assets/libs/css/blue.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(concat('app.min.css'))
.pipe(cleanCss()) .pipe(cleanCss())
@ -108,6 +118,8 @@ gulp.task('lib-scripts', function() {
'./assets/libs/js/icheck.min.js', './assets/libs/js/icheck.min.js',
'./assets/libs/js/fileinput.min.js', './assets/libs/js/fileinput.min.js',
'./assets/libs/js/toastr.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' './assets/src/js/utils.js'
]) ])
.pipe(concat('app.min.js')) .pipe(concat('app.min.js'))
@ -144,14 +156,14 @@ gulp.task('scripts', function() {
gulp.task('minify', ['sass', 'scripts']); gulp.task('minify', ['sass', 'scripts']);
gulp.task('clean', ['concat', 'minify'], function (cb) { gulp.task('clean', function (cb) {
return del([ return del([
'./assets/libs/css/**', './assets/libs/css/**',
'./assets/libs/js/**' './assets/libs/js/**'
], cb); ], cb);
}); });
gulp.task('build', ['concat', 'minify', 'clean']); gulp.task('build', ['concat', 'minify']);
// release // release
gulp.task('zip', function() { gulp.task('zip', function() {

View File

@ -44,14 +44,14 @@
<p class="texture-name"> <p class="texture-name">
<span title="{{ $item->name }}">{{ $item->name }} <small>({{ $item->type }})</small></span> <span title="{{ $item->name }}">{{ $item->name }} <small>({{ $item->type }})</small></span>
</p> </p>
<a href="../skinlib/show?tid={{ $item->tid }}" title="在皮肤库中查看" class="more" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-share"></i></a> <a href="../skinlib/show?tid={{ $item->tid }}" title="在皮肤库中查看" class="more" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-share"></i></a>
<span title="更多" class="more" data-toggle="dropdown" aria-haspopup="true" id="share-button"><i class="fa fa-cog"></i></span>
<ul class="dropdown-menu" aria-labelledby="share-button"> <ul class="dropdown-menu" aria-labelledby="share-button">
<li><a href="javascript:removeFromCloset({{ $item->tid }});">从衣柜中移除</a></li> <li><a href="javascript:removeFromCloset({{ $item->tid }});">从衣柜中移除</a></li>
<li><a href="javascript:setAsAvatar({{ $item->tid }});">设为头像</a></li> <li><a href="javascript:setAsAvatar({{ $item->tid }});">设为头像</a></li>
</ul> </ul>
<span title="更多" class="more" data-toggle="dropdown" aria-haspopup="true" id="share-button"><i class="fa fa-cog"></i></span>
</div> </div>
</div> </div>
@empty @empty