-
Notifications
You must be signed in to change notification settings - Fork 2
/
jotform-wp-feedback.js
36 lines (30 loc) · 1.21 KB
/
jotform-wp-feedback.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Plugin Name: JotForm Feedback Button
Plugin URI: http://www.jotform.com/labs/wordpress
Description: Display a beautiful feedback button on the side of your blog. When a reader clicks on it a feedback form pops up. Completely customizable.
Version: 1.0.4
Author: JotForm.com
Author URI: http://www.jotform.com
License: MIT
*/
jQuery(document).ready(function($){
$.getScript("//js.jotform.com/JotFormFormPicker.js", function(data, textStatus, jqxhr) {
$('#pickForm').on("click",function() {
event.preventDefault();
var jotformFormPicker = new JotFormFormPicker();
jotformFormPicker.openWizard(setFormID);
});
});
$('.jotform-color-field').wpColorPicker();
if(jQuery("#lightBoxType").val() != "") {
jQuery("[data-value='"+jQuery("#lightBoxType").val()+"']").parent().addClass("selectedStyle");
}
$('.styleBrowser').on("click",function(){
$(".selectedStyle").removeClass("selectedStyle");
$(this).addClass("selectedStyle");
jQuery("#lightBoxType").val($(this).find("div").attr("data-value"));
});
function setFormID(formObject){
$("#formID").val(formObject.id || false);
}
});