|
@@ -97,6 +97,7 @@ $(document).ready(function(){
|
|
|
|
|
|
//取代码
|
|
|
$("#btn-getcode,#btn-getcode2").click(function(){
|
|
|
+ alert(1);
|
|
|
var zoneId = $(this).attr("value");
|
|
|
var url = ctx+"/operator/main/ad/zone/getCode?zoneId="+zoneId;
|
|
|
$.getJSON(url, function(data) {
|
|
@@ -140,6 +141,52 @@ $(document).ready(function(){
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ //取代码
|
|
|
+ $("#btn-getcode3,#btn-getcode4").click(function(){
|
|
|
+ alert(1);
|
|
|
+ var zoneId = $(this).attr("value");
|
|
|
+ var url = ctx+"/operator/main/ad/zone/getCodeStatistics?zoneId="+zoneId;
|
|
|
+ $.getJSON(url, function(data) {
|
|
|
+ var data_1 = data;
|
|
|
+ $('.bootbox-body').text(data_1);
|
|
|
+ });
|
|
|
+ bootbox.dialog({
|
|
|
+ message:"代码为:",
|
|
|
+ title: "该广告位的代码",
|
|
|
+ locale: 'zh_CN',
|
|
|
+ buttons: {
|
|
|
+ success: {
|
|
|
+ label: "复制",
|
|
|
+ className: "btn-success",
|
|
|
+ callback: function() {
|
|
|
+ var _content = $('.bootbox-body').text();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ main: {
|
|
|
+ label: "关闭",
|
|
|
+ className: "btn-primary",
|
|
|
+ callback: function() {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //以下代码实现复制功能,利用ZeroClipboard插件实现
|
|
|
+ var client = new ZeroClipboard($('.modal-footer .btn-success'));
|
|
|
+ client.on('ready', function(event) {
|
|
|
+ // console.log( 'movie is loaded' );
|
|
|
+ client.on('copy', function(event) {
|
|
|
+ event.clipboardData.setData('text/plain', $('.bootbox-body').text());
|
|
|
+ });
|
|
|
+ client.on('aftercopy', function(event) {
|
|
|
+ console.log('Copied text to clipboard: ' + event.data['text/plain']);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ client.on('error', function(event) {
|
|
|
+ // console.log( 'ZeroClipboard error of type "' + event.name + '": ' + event.message );
|
|
|
+ ZeroClipboard.destroy();
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
/*************************** 创建,编辑广告主 ***************************/
|
|
|
|
|
|
//初始化加载上传控件
|