diff --git a/app/views/admin/ad_banners/_index_table.html.erb b/app/views/admin/ad_banners/_index_table.html.erb
index c5487ac..81ea2b3 100644
--- a/app/views/admin/ad_banners/_index_table.html.erb
+++ b/app/views/admin/ad_banners/_index_table.html.erb
@@ -31,8 +31,8 @@
'); background-size: cover; background-position: center;">
<% end %>
<% else %>
-
-
+
+
<% end %>
diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb
index 5ecce59..e6fc794 100644
--- a/app/views/admin/ad_images/_form.html.erb
+++ b/app/views/admin/ad_images/_form.html.erb
@@ -186,9 +186,9 @@
-
+
- <%= f.text_field :out_link, placeholder: t('ad_banner.enter_url') %>
+ <%= f.text_field :out_link, placeholder: t('ad_banner.enter_url'), id: 'ad_image_out_link' %>
@@ -274,25 +274,33 @@
return true;
}
$(document).ready(function(){
- jplayer_ready_func_1();
- $('#ad_image_video_file').change(function(){
- var file = this.files ? this.files[0] : null;
- var value = this.value;
- if(file || value){
- var file_name = file ? file.name : value.split(/[\/\\]/).last();
- var type = get_video_type(file_name);
- var file_url = window.URL ? window.URL.createObjectURL(file) : "file://"+ value;
- $("#jquery_jplayer_1").parents('.fileupload-new').css('display','');
- $("#jquery_jplayer_1").jPlayer('destroy');
- jPlayer_1_data["title"] = file_name;
- jPlayer_1_data[type] = file_url;
- $("#jquery_jplayer_1").jPlayer(jPlayer_1);
- }
- })
- $('#exchange_item_3 [data-dismiss="fileupload"]').on("click",function(){
- $("#jquery_jplayer_1").parents('.fileupload-new').css('display','none');
- })
+ jplayer_ready_func_1();
+ $('#ad_image_video_file').change(function(){
+ var file = this.files ? this.files[0] : null;
+ var value = this.value;
+ if(file || value){
+ var file_name = file ? file.name : value.split(/[\/\\]/).last();
+ var type = get_video_type(file_name);
+ var file_url = window.URL ? window.URL.createObjectURL(file) : "file://"+ value;
+ $("#jquery_jplayer_1").parents('.fileupload-new').css('display','');
+ $("#jquery_jplayer_1").jPlayer('destroy');
+ jPlayer_1_data["title"] = file_name;
+ jPlayer_1_data[type] = file_url;
+ $("#jquery_jplayer_1").jPlayer(jPlayer_1);
+ }
})
+ $('#exchange_item_3 [data-dismiss="fileupload"]').on("click",function(){
+ $("#jquery_jplayer_1").parents('.fileupload-new').css('display','none');
+ })
+ $('#ad_image_out_link').on('paste', function(e){
+ var pastedData = e.originalEvent.clipboardData.getData('text');
+ var _this = $(this);
+ pastedData = pastedData.replace(new RegExp('^http(s|)://' + window.location.host), '')
+ window.setTimeout(function(){
+ _this.val(pastedData);
+ }, 0);
+ })
+ })