(function($) {
$(function(){
modalForm();
integratedReviewForm();
pagerDemo();
});
function modalForm(){
var htmlstr = (function(param) {return param[0].replace(/\n|\r/g, "");})`
`;
// if (document.getElementById("mrReviewForm") != null){
// $("#mrModalContainer02").addClass('mrmodalshow');
// }else{
// $('body').append('');
// }
// launch modal
$("body").on('click','#mrReviewBtn',function(e){
e.preventDefault();
// $("#mrModalContainer02").addClass('mrmodalshow');
$('body').append('');
$('#mrrvRaty').raty({
starType: 'i',
score: 3
});
});
}
function integratedReviewForm(){
// $("#mrReviewForm").submit(function(e){
$("body").on("submit","#mrReviewForm",function(e){
// $("body").on("click","#mrrvFormConfirmBtn",function(e){
e.preventDefault();
var rate = $('#mrrvRaty').raty('score');
var name = $("#mrrvFormName").val().trim();
var email = $("#mrrvFormEmail").val().trim();
var review = $("#mrrvFormTa").val().trim();
drawConfirm(rate,name,email,review);
return false;
});
$("body").on("click","#mrrvFormBack",function(e){
e.preventDefault();
$(".mrreview-inputform").removeClass('mrrvconfirm');
$("#mrrvFormName").attr('disabled',false);
$("#mrrvFormEmail").attr('disabled',false);
$("#mrrvFormTa").attr('disabled',false);
});
$("body").on("click","#mrrvFormClose",function(e){
e.preventDefault();
$("#mrModalContainer02").remove();
});
}
function drawConfirm(rate,name,email,review){
console.log('?');
$(".mrreview-inputform").addClass('mrrvconfirm');
$("#mrrvFormName").attr('disabled','disabled');
$("#mrrvFormEmail").attr('disabled','disabled');
$("#mrrvFormTa").attr('disabled','disabled');
}
function pagerDemo(){
$("body").on("click",".pagerDemo",function(e){
e.preventDefault();
$("#mrIntegrated01").html('Loading...
');
var url_path = (
document.currentScript
? document.currentScript.src
: document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1].src
)
.replace(new RegExp('^'+location.origin), '')
.replace(/[^\/]+$/, '');
$.getJSON( url_path + 'dummy.php',
{
'hoge': 'hoge'
},
function (data) {
$("#mrIntegrated01").html(data['html']);
adjustStyles(data);
}
);
});
}
})($1124);