@@ -565,13 +643,9 @@ background:rgba(0,0,0,0.6); z-index: 999;display: none;">
+
+
+ $(".giftSecond .getGift-heard>a").click(function(){
+ $(".giftSecond").hide()
+ $(".giftStep").show()
+ });
+ $(".giftStep .getGift-heard>a").click(function(){
+ $(".giftSecond").hide()
+ $(".giftStep").hide()
+ $('.mode').hide()
+ document.body.style.overflow = 'auto';
+ });
+
+ $(".getGift-info").on('click', '.show-giftbag', function() {
+ /* $(this).html('已领取');
+ $(this).css({
+ "background":"rgba(242,242,244,1)",
+ "color":"rgba(169,169,169,1)",
+ "border": "0"
+ }); */
+ var giftId = $(this).parents('.getGift-infoBox').eq(0).attr('data-id')
+ for (var key in giftbags) {
+ if (giftbags[key].id == giftId) {
+ if (giftbags[key].get_status == 1) {
+ $('.giftSecond .getGift-box').find('.get-novice').html('已领取')
+ $('.giftSecond .getGift-box').find('.get-novice').addClass('has-get')
+ $('.giftSecond .getGift-box').find('.novice-value').html(giftbags[key].novice)
+ $(".getGift-activation").show();
+ $(".getGift-second").css({"height" : "1.26rem"});
+ $(".getGift-secondInfo").css({"height" : "1.93rem"})
+ } else {
+ $('.giftSecond .getGift-box').find('.get-novice').html('领取')
+ $('.giftSecond .getGift-box').find('.get-novice').removeClass('has-get')
+ $(".getGift-activation").hide();
+ $(".getGift-second").css({"height" : "0.86rem"});
+ $(".getGift-secondInfo").css({"height" : "2.33rem"})
+ }
+ $('.giftSecond .getGift-box').find('.get-novice').attr('data-gift-id', giftbags[key].id)
+ $('.giftSecond .getGift-box').find('.giftbag-name').html(giftbags[key].giftbag_name)
+ // $('.giftSecond .getGift-box').find('.novice-count').html(giftbags[key].novice_num)
+
+ $('.giftSecond .getGift-box').find('.useful-date').html(giftbags[key].useful_date)
+ $('.giftSecond .getGift-box').find('.desribe').html(giftbags[key].desribe)
+ $('.giftSecond .getGift-box').find('.digest').html(giftbags[key].digest)
+ break;
+ }
+ }
+ $(".giftStep").hide();
+ $(".giftSecond").show();
+ })
+
+ $(".getGift-second .btn").click(function() {
+ if ($(this).hasClass('has-get')) {
+ return layer.msg('您已经领取过该礼包');
+ }
+ if (!isLogin()) {
+ layer.msg('请先登录');
+ goLogin()
+ return
+ }
+ var giftId = $(this).attr('data-gift-id')
+ var novice = getNovice(giftId)
+ if (novice !== '') {
+ $('.giftSecond .getGift-box').find('.novice-value').html(novice)
+ $(this).addClass('has-get')
+ $(this).html('已领取')
+ $(".getGift-activation").show();
+ $(".getGift-second").css({"height" : "1.26rem"});
+ $(".getGift-secondInfo").css({"height" : "1.93rem"})
+ }
+ });
+ // 复制
+ $(".copy").click(function(){
+ var qrcodeLink = $(".code>span").html()
+ var clipboard = new Clipboard('.copy', {
+ text: function() {
+ return qrcodeLink;
+ }
+ });
+ clipboard.on('success', function(e) {
+ $(".copy").html('已复制')
+ });
+
+ clipboard.on('error', function(e) {
+ $(".copy").html('未复制')
+ });
+ })
+
+ function getGiftbags(gameId) {
+ $.ajax({
+ url: '/mobile.php?s=/Gift/getTFGiftbags.html',
+ data: { game_id: gameId },
+ dataType: 'json',
+ type: 'post',
+ success: function(response) {
+ if (response.status) {
+ giftbags = response.data.records
+ if (giftbags.length == 0) {
+ $('.giftStep .getGiftNot').show()
+ $('.giftStep .getGift-box').hide()
+ return
+ }
+ // $('.giftbag-count').html(giftbags.length)
+ var html = ''
+ for (var key in giftbags) {
+ var item = giftbags[key];
+ var btnHtml = '
去领取
'
+ if (item.get_status == 1) {
+ btnHtml = '
已领取
'
+ }
+ html += '
'
+ + '
'
+ + '
' + item.giftbag_name + '
'
+ + '
' + item.desribe + '
'
+ + '
'
+ + btnHtml
+ + '
';
+ }
+ $('.getGift-info').html(html)
+ $('.giftStep .getGiftNot').hide()
+ $('.giftStep .getGift-box').show()
+ } else {
+ layer.msg(response.message);
+ }
+ }
+ })
+ }
+
+ function goLogin() {
+ $(".commonWindow").hide();
+ $(".giftStep").hide();
+ $(".giftSecond").hide();
+ $(".login").show();
+ }
+
+ function getNovice(giftId) {
+ var novice = ''
+ $.ajax({
+ url: '/mobile.php?s=/Gift/getNovice.html',
+ data: { gift_id: giftId},
+ dataType: 'json',
+ async: false,
+ type: 'post',
+ success: function(response) {
+ if (response.status) {
+ layer.msg(response.message);
+ novice = response.data.novice
+ } else {
+ if (response.code == '1001') {
+ goLogin()
+ }
+ layer.msg(response.message);
+ }
+ }
+ })
+ return novice
+ }
+ })
+
diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php
index 4b529b08e..2a7b42f8d 100644
--- a/Application/Mobile/Controller/CommonController.class.php
+++ b/Application/Mobile/Controller/CommonController.class.php
@@ -2,6 +2,7 @@
namespace Mobile\Controller;
use Org\Ipa365SDK\Ipa365;
use User\Api\MemberApi;
+use User\Api\SuserApi;
use Think\Log;
use Base\Service\ApplyService;
use Base\Tool\TaskClient;
@@ -47,21 +48,22 @@ class CommonController extends BaseController {
$this->respondError('请输入账号');
}
+ $loginType = 1;
if ($mobile != '') {
$user = M('user', 'tab_')->field(['id', 'account'])->where(['phone' => $mobile])->find();
if (!$user) {
$this->respondError('手机号错误');
}
- $account = $user->account;
- if (!$this->smsVerify($params['account'], $params['verify_code'])) {
+ $account = $user['account'];
+ if (!$this->smsVerify($mobile, $verifyCode)) {
$this->respondError('验证失败');
}
+ $loginType = -1;
}
-
- $promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
- $userApi = new MemberApi();
- $userId = $userApi->login($account, $password, 1); //调用登录
+ $promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($account, $password, $loginType); //调用登录
$resMsg = "登录成功";
if ($userId <= 0) {
switch ($userId) {
@@ -136,8 +138,8 @@ class CommonController extends BaseController {
}
//添加自动登录
- $userApi = new MemberApi();
- $userId = $userApi->login($params['account'], $params['password'], 1);
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($params['account'], $params['password'], 1);
$_SESSION['user_id'] = $userId;
$this->setData(['user_id' => $userId])->respondSuccess('添加成功');
}
@@ -182,8 +184,8 @@ class CommonController extends BaseController {
}
//添加自动登录
- $userApi = new MemberApi();
- $userId = $userApi->login($account, $password, 1);
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($account, $password, 1);
$_SESSION['user_id'] = $userId;
$this->setData(['user_id' => $userId])->respondSuccess('注册成功');
}
diff --git a/Application/Mobile/Controller/GiftController.class.php b/Application/Mobile/Controller/GiftController.class.php
index f767cd0ae..67812cd73 100644
--- a/Application/Mobile/Controller/GiftController.class.php
+++ b/Application/Mobile/Controller/GiftController.class.php
@@ -258,4 +258,79 @@ class GiftController extends BaseController {
$this->success("领取成功",$novice);
}
+ public function getTFGiftbags() {
+ $game_id = I('post.game_id');
+ $status = 0;
+ $row = C('LIST_ROWS');
+ $map['status'] = 1;
+ $time = NOW_TIME;
+ $map['game_id'] = $game_id;
+ $map['giftbag_version'] = 4;
+ $map['novice'] = array('neq','');
+ //$map['start_time'] = ['elt',$time];
+ $map['_string'] = "end_time > {$time} or end_time = 0";
+ $lists = D('Giftbag')
+ ->field("tab_giftbag.*,g.icon,g.relation_game_name")
+ ->join("left join tab_game g on g.id = tab_giftbag.game_id and g.game_status=1 and g.display_site like '%". DISPLAY_SITE ."%' ")
+ ->where($map)
+ ->select();
+
+ $existRecords = [];
+ if (count($lists) > 0 && $this->islogin()) {
+ $member = new SuserApi;
+ $logininfo = $member->login_info();
+ $conditions = [];
+ $conditions['user_id'] = $logininfo['user_id'];
+ $conditions['gift_id'] = ['in', array_column($lists, 'id')];
+ $existRecords = M("gift_record",'tab_')->field(['id', 'gift_id', 'novice'])->where($conditions)->select();
+ $existRecords = index_by_column('gift_id', $existRecords);
+
+ }
+ $records = [];
+ foreach ($lists as $key => $val){
+ $novices = str2arr($val['novice'],',');
+ $noviceNum = count(array_filter($novices));
+ $novice = '';
+ if (isset($existRecords[$val['id']])) {
+ $getStatus = 1;
+ $novice = $existRecords[$val['id']]['novice'];
+ } else {
+ $getStatus = 0;
+ }
+ $records[$key]['id'] = $val['id'];
+ $records[$key]['desribe'] = $val['desribe'];
+ $records[$key]['giftbag_name'] = $val['giftbag_name'];
+ $records[$key]['digest'] = $val['digest'];
+ $records[$key]['get_status'] = $getStatus;
+ $records[$key]['novice'] = $novice;
+ $records[$key]['novice_num'] = $noviceNum;
+ $records[$key]['game_icon'] = get_cover($val['icon'],'path');
+ $records[$key]['game_name'] = $val['giftbag_name'];
+ $records[$key]['useful_date'] = set_show_time($val['start_time'],'date') . ' 至 '. set_show_time($val['end_time'],'date','forever');
+ }
+
+ echo json_encode(['status' => true, 'message' => '获取成功', 'data' => ['records' => $records]]);
+ }
+
+ public function getNovice($gift_id){
+ if(!$this->islogin()) {
+ echo json_encode(['status' => false, 'code' => '1001', 'message' => '请先登录']); exit();
+ }
+
+ $giftId = I('post.gift_id');
+ $member = new SuserApi;
+ $logininfo = $member->login_info();
+
+ $model = D("Giftbag");
+ $exist = $model->checkAccountGiftExist($logininfo['user_id'], $giftId);
+ if($exist){
+ echo json_encode(['status' => false, 'code' => '1000', 'message' => '您已经领取过该礼包!']); exit();
+ }
+ $novice = $model->getNovice($logininfo['user_id'], $logininfo['account'], $giftId);
+
+ if(empty($novice)){
+ echo json_encode(['status' => false, 'code' => '1000', 'message' => '暂无激活码']); exit();
+ }
+ echo json_encode(['status' => true, 'code' => '0000', 'message' => '领取成功', 'data' => ['novice' => $novice]]); exit();
+ }
}
diff --git a/Application/Mobile/Model/GiftbagModel.class.php b/Application/Mobile/Model/GiftbagModel.class.php
index c4b456590..4759cc4cb 100644
--- a/Application/Mobile/Model/GiftbagModel.class.php
+++ b/Application/Mobile/Model/GiftbagModel.class.php
@@ -237,6 +237,10 @@ class GiftbagModel extends Model{
$record['game_name'] = $data['game_name'];//get_game_name($data['game_id']);
$record['gift_id'] = $gift_id;
$record['gift_name'] = $data['giftbag_name'];
+
+ $record['server_id'] = $data['server_id'];
+ $record['server_name'] = $data['server_name'];
+
$record['status'] = 0;
$record['novice'] = $novice;
$record['user_id'] = $user_id;
diff --git a/Public/Home/css/giftbag.css b/Public/Home/css/giftbag.css
new file mode 100644
index 000000000..3eb234a5f
--- /dev/null
+++ b/Public/Home/css/giftbag.css
@@ -0,0 +1,286 @@
+body.dialog-open {
+ position: fixed;
+ width: 100%;
+ }
+.mode{
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.4);
+ top: 0;
+ left: 0;
+ font-size: 0.2rem;
+}
+.giftBag_mode{
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.4);
+ top: 0;
+ left: 0;
+ font-size: 0.2rem;
+ z-index: 1000;
+}
+.giftBag_mode>div{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ justify-content: flex-end;
+ padding-top: 6.47rem;
+ margin-right: 0.97rem;
+ font-size: 0.2rem;
+}
+.giftBag_mode>div>.img1{
+ width: 0.82rem;
+ height: 0.82rem;
+}
+.giftBag_mode>div>.img2{
+ width: 2.97rem;
+ height: 0.52rem;
+}
+.getGift{
+ position: fixed;
+ width: 6.5rem;
+ height: 4rem;
+ top: 50%;
+ margin-top: -2rem;
+ left: 50%;
+ margin-left: -3.25rem;
+ background-color: #fff;
+ border-radius: 0.3rem;
+ z-index: 1000;
+}
+.getGift-heard{
+ height: 0.8rem;
+ width: 100%;
+ text-align: center;
+ line-height: 0.8rem;
+ background-color: #489EF6;
+ font-size: 0.28rem;
+ color: #fff;
+ font-weight: 500;
+ border-top-left-radius: 0.3rem;
+ border-top-right-radius: 0.3rem;
+ position: relative;
+ border-top-left-radius:0.3rem;
+ border-top-right-radius:0.3rem;
+}
+.getGift-heard>a{
+ position: absolute;
+ left: 0.4rem;
+ top: 50%;
+ margin-top: -0.15rem;
+ width: 0.17rem;
+ height: 0.3rem;
+ background: url("../images/20191225/fanhui.png");
+ background-size: 100% 100%;
+}
+.getGift-box{
+ padding: 0 0.3rem;
+ border-bottom-right-radius: 0.3rem;
+ border-bottom-left-radius: 0.3rem;
+}
+.getGift-game{
+ width: 100%;
+ display: flex;
+ align-items: center;
+ height: 1.03rem;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-game>img{
+ width: 0.6rem;
+ height: 0.6rem;
+ margin-right: 0.2rem;
+}
+.getGift-game>div{
+ display: flex;
+ align-items: flex-start;
+ justify-content: center;
+ flex-direction: column;
+}
+.getGift-game>div .title{
+ font-size:0.26rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-game>div .number{
+ font-size:0.18rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+}
+.getGift-info{
+ height: 2.16rem;
+ overflow-y: auto;
+}
+.getGift-infoBox{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 0.9rem;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-infoBox:last-child{
+ border: 0;
+}
+.getGift-infoBox .info-left{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+.getGift-infoBox .info-left .title{
+ font-size:0.22rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-infoBox .info-left .del{
+ width: 2.91rem;
+ font-size:0.186rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+}
+.getGift-infoBox .btn,.getGift-second .btn{
+ width:1rem;
+ height:0.4rem;
+ background:rgba(169,169,169,0);
+ border:1px solid rgba(33, 177, 235, 1);
+ border-radius:0.16rem;
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(33,177,235,1);
+ text-align: center;
+ line-height: 0.4rem;
+}
+.getGift-second{
+ height: 0.86rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-bag{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.getGift-second .second-left{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+.getGift-second .second-left .title{
+ font-size:0.26rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-second .second-left .number{
+ font-size:0.18rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+}
+.getGift-second .second-left .number>span{
+ color: #262626;
+}
+.getGift-activation{
+ display: flex;
+ align-items: center;
+ margin-top: 0.12rem;
+ justify-content: space-between;
+}
+.getGift-activation .code{
+ width:3.9rem;
+ height:0.3rem;
+ background:rgba(242,242,244,1);
+ border-radius:0.1rem;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ text-align: center;
+ line-height: 0.3rem;
+}
+.getGift-activation .copy{
+ width:1rem;
+ height:0.4rem;
+ background:rgba(33,177,235,1);
+ border-radius:0.1rem;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(254,254,254,1);
+ text-align: center;
+ line-height: 0.4rem;
+ margin-left: 0.2rem;
+}
+.getGift-secondInfo{
+ height: 2.33rem;
+ overflow-y: auto;
+}
+.getGift-secondInfo .infoBox{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ margin-top: 0.23rem;
+}
+.getGift-secondInfo .infoBox .title{
+ font-size:0.22rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(41,41,41,1);
+}
+.getGift-secondInfo .infoBox .del{
+ width: 100%;
+ font-size:0.18rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ margin-top: 0.1rem;
+}
+.getGiftNot{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 3.2rem;
+}
+.getGiftNot-img{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGiftNot-img>img{
+ width: 2.06rem;
+ height: 1.58rem;
+}
+.getGiftNot>.btn{
+ width:1.2rem;
+ height:0.4rem;
+ background:rgba(34,129,245,1);
+ border-radius:0.2rem;
+ font-size:0.24rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(255,255,255,1);
+ text-align: center;
+ line-height: 0.4rem;
+ margin-top: 0.32rem;
+}
+.getGift-box .btn.has-get {
+ background:rgba(242,242,244,1);
+ color:rgba(169,169,169,1);
+ border:0
+}
\ No newline at end of file
diff --git a/Public/Home/images/libao.png b/Public/Home/images/libao.png
new file mode 100644
index 000000000..687c7916b
Binary files /dev/null and b/Public/Home/images/libao.png differ
diff --git a/Public/Home/images/libao2.png b/Public/Home/images/libao2.png
new file mode 100644
index 000000000..8551b8309
Binary files /dev/null and b/Public/Home/images/libao2.png differ
diff --git a/Public/Home/images/lingqu.png b/Public/Home/images/lingqu.png
new file mode 100644
index 000000000..c2105fff4
Binary files /dev/null and b/Public/Home/images/lingqu.png differ
diff --git a/Public/Home/images/wu.png b/Public/Home/images/wu.png
new file mode 100644
index 000000000..ca980f3dc
Binary files /dev/null and b/Public/Home/images/wu.png differ
diff --git a/Public/static/clipboard-1.6.1.min.js b/Public/static/clipboard-1.6.1.min.js
new file mode 100644
index 000000000..136931ffe
--- /dev/null
+++ b/Public/static/clipboard-1.6.1.min.js
@@ -0,0 +1,7 @@
+/*!
+ * clipboard.js v1.6.1
+ * https://zenorocha.github.io/clipboard.js
+ *
+ * Licensed MIT 漏 Zeno Rocha
+ */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,o){function i(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n?n:e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a
0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,o){!function(i,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(e,t,n,o){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var u=i(t),s=i(n),f=i(o),d=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new u.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof t?[t]:t,o=!!document.queryCommandSupported;return n.forEach(function(e){o=o&&!!document.queryCommandSupported(e)}),o}}]),t}(s.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
\ No newline at end of file