Fix bug.
This commit is contained in:
parent
37aff562a7
commit
7bdccc3b60
|
@ -31,8 +31,8 @@
|
||||||
<div class="slide-img" style=" background: url('<%= image.exchange_item == "1" ? image.file.thumb.url : image.youtube_thumb %>'); background-size: cover; background-position: center;"></div>
|
<div class="slide-img" style=" background: url('<%= image.exchange_item == "1" ? image.file.thumb.url : image.youtube_thumb %>'); background-size: cover; background-position: center;"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div>
|
<div class="slide-img" style="background: url('https://via.placeholder.com/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div>
|
||||||
<div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div>
|
<div class="slide-img" style="background: url('https://via.placeholder.com/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -186,9 +186,9 @@
|
||||||
|
|
||||||
<!-- Link -->
|
<!-- Link -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t(:link) %></label>
|
<label class="control-label muted" for="ad_image_out_link"><%= t(:link) %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= 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' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -274,25 +274,33 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
jplayer_ready_func_1();
|
jplayer_ready_func_1();
|
||||||
$('#ad_image_video_file').change(function(){
|
$('#ad_image_video_file').change(function(){
|
||||||
var file = this.files ? this.files[0] : null;
|
var file = this.files ? this.files[0] : null;
|
||||||
var value = this.value;
|
var value = this.value;
|
||||||
if(file || value){
|
if(file || value){
|
||||||
var file_name = file ? file.name : value.split(/[\/\\]/).last();
|
var file_name = file ? file.name : value.split(/[\/\\]/).last();
|
||||||
var type = get_video_type(file_name);
|
var type = get_video_type(file_name);
|
||||||
var file_url = window.URL ? window.URL.createObjectURL(file) : "file://"+ value;
|
var file_url = window.URL ? window.URL.createObjectURL(file) : "file://"+ value;
|
||||||
$("#jquery_jplayer_1").parents('.fileupload-new').css('display','');
|
$("#jquery_jplayer_1").parents('.fileupload-new').css('display','');
|
||||||
$("#jquery_jplayer_1").jPlayer('destroy');
|
$("#jquery_jplayer_1").jPlayer('destroy');
|
||||||
jPlayer_1_data["title"] = file_name;
|
jPlayer_1_data["title"] = file_name;
|
||||||
jPlayer_1_data[type] = file_url;
|
jPlayer_1_data[type] = file_url;
|
||||||
$("#jquery_jplayer_1").jPlayer(jPlayer_1);
|
$("#jquery_jplayer_1").jPlayer(jPlayer_1);
|
||||||
}
|
}
|
||||||
})
|
|
||||||
$('#exchange_item_3 [data-dismiss="fileupload"]').on("click",function(){
|
|
||||||
$("#jquery_jplayer_1").parents('.fileupload-new').css('display','none');
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
$('#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);
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue