fontselect.js
2 years ago
isimb-6310-admin-modal.js
2 years ago
isimb-6310-admin-script.js
10 months ago
isimb-6310-common.js
2 years ago
isimb-6310-nested-point.js
2 years ago
jquery.canvas.js
2 years ago
json-data.js
3 months ago
main-output-file.js
3 months ago
media-uploader.js
2 years ago
zoom-in-out-drag.js
1 year ago
isimb-6310-admin-script.js
761 lines
| 1 | window.orgWidth = 0; |
| 2 | window.orgHeight = 0; |
| 3 | |
| 4 | jQuery(window).load(function () { |
| 5 | isimb_6310_zoom_in_out_code(); |
| 6 | isimb_6310_tooltip_fields(); |
| 7 | //set SVG width and height |
| 8 | let mainImg = jQuery(".isimb-6310-main-image"); |
| 9 | window.orgWidth = mainImg.width(); |
| 10 | window.orgHeight = mainImg.height(); |
| 11 | |
| 12 | jQuery(".isimb-6310-main-svg") |
| 13 | .attr("width", window.orgWidth) |
| 14 | .attr("height", window.orgHeight); |
| 15 | jQuery(".isimb-6310-main-svg").css({ |
| 16 | "background-size": window.orgWidth + "px " + window.orgHeight + "px", |
| 17 | }); |
| 18 | jQuery(".isimb-6310-main-image").hide(); |
| 19 | isimb_6310_default_polygon(window.orgWidth, window.orgHeight); |
| 20 | isimb_6310_icon_image_select(); |
| 21 | |
| 22 | /* Link Setting */ |
| 23 | jQuery("body").on( |
| 24 | "click", |
| 25 | "#isimb-6310-add-point .isimb-6310_link_title_type", |
| 26 | function () { |
| 27 | if (Number(jQuery(this).val()) == 2) { |
| 28 | jQuery("#isimb-6310-add-point .isimb-6310_link").addClass( |
| 29 | "isimb-6310-hide" |
| 30 | ); |
| 31 | } else { |
| 32 | jQuery("#isimb-6310-add-point .isimb-6310_link").removeClass( |
| 33 | "isimb-6310-hide" |
| 34 | ); |
| 35 | if ( |
| 36 | Number( |
| 37 | jQuery( |
| 38 | "#isimb-6310-add-point .isimb-6310_button_link:checked" |
| 39 | ).val() |
| 40 | ) == 2 |
| 41 | ) { |
| 42 | jQuery("#isimb-6310-add-point .isimb-6310_button").addClass( |
| 43 | "isimb-6310-hide" |
| 44 | ); |
| 45 | } else { |
| 46 | jQuery("#isimb-6310-add-point .isimb-6310_button").removeClass( |
| 47 | "isimb-6310-hide" |
| 48 | ); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | ); |
| 53 | |
| 54 | jQuery("body").on( |
| 55 | "click", |
| 56 | "#isimb-6310-add-point .isimb-6310_button_link", |
| 57 | function () { |
| 58 | if (Number(jQuery(this).val()) == 2) { |
| 59 | jQuery("#isimb-6310-add-point .isimb-6310_button").addClass( |
| 60 | "isimb-6310-hide" |
| 61 | ); |
| 62 | } else { |
| 63 | jQuery("#isimb-6310-add-point .isimb-6310_button").removeClass( |
| 64 | "isimb-6310-hide" |
| 65 | ); |
| 66 | } |
| 67 | } |
| 68 | ); |
| 69 | |
| 70 | /* Edit link Setting */ |
| 71 | jQuery("body").on( |
| 72 | "click", |
| 73 | "#isimb-6310-edit-point .isimb-6310_link_title_type", |
| 74 | function () { |
| 75 | if (Number(jQuery(this).val()) == 2) { |
| 76 | jQuery("#isimb-6310-edit-point .isimb-6310_link").addClass( |
| 77 | "isimb-6310-hide" |
| 78 | ); |
| 79 | } else { |
| 80 | jQuery("#isimb-6310-edit-point .isimb-6310_link").removeClass( |
| 81 | "isimb-6310-hide" |
| 82 | ); |
| 83 | if ( |
| 84 | Number( |
| 85 | jQuery( |
| 86 | "#isimb-6310-edit-point .isimb-6310_button_link:checked" |
| 87 | ).val() |
| 88 | ) == 2 |
| 89 | ) { |
| 90 | jQuery("#isimb-6310-edit-point .isimb-6310_button").addClass( |
| 91 | "isimb-6310-hide" |
| 92 | ); |
| 93 | } else { |
| 94 | jQuery("#isimb-6310-edit-point .isimb-6310_button").removeClass( |
| 95 | "isimb-6310-hide" |
| 96 | ); |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | ); |
| 101 | |
| 102 | jQuery("body").on( |
| 103 | "click", |
| 104 | "#isimb-6310-edit-point .isimb-6310_button_link", |
| 105 | function () { |
| 106 | if (Number(jQuery(this).val()) == 2) { |
| 107 | jQuery("#isimb-6310-edit-point .isimb-6310_button").addClass( |
| 108 | "isimb-6310-hide" |
| 109 | ); |
| 110 | } else { |
| 111 | jQuery("#isimb-6310-edit-point .isimb-6310_button").removeClass( |
| 112 | "isimb-6310-hide" |
| 113 | ); |
| 114 | } |
| 115 | } |
| 116 | ); |
| 117 | |
| 118 | /* **************************************************************** */ |
| 119 | |
| 120 | //Add Point Script |
| 121 | let counter = |
| 122 | jQuery(".isimb-6310-main-svg polygon.isimb-6310-pol-loaded").length + 1; |
| 123 | jQuery("body").on("click", ".isimb-6310-add-place-save", function () { |
| 124 | window.currentPoint = counter; |
| 125 | let canvasArea = jQuery(".isimb-6310-canvas-area").val(); |
| 126 | if (!canvasArea) { |
| 127 | alert("Please select area first"); |
| 128 | return; |
| 129 | } |
| 130 | let elementType = Number(jQuery(".isimb-6310-section-select").val()); |
| 131 | if (elementType == 0) { |
| 132 | alert("Please select element type"); |
| 133 | jQuery(".isimb-6310-section-select").focus(); |
| 134 | return; |
| 135 | } |
| 136 | |
| 137 | let jsonObj = isimb_6310_set_generate_json_data("#isimb-6310-add-point "); |
| 138 | let jsonObjParse = JSON.stringify(jsonObj); |
| 139 | let cords = isimb_6310_create_area( |
| 140 | canvasArea, |
| 141 | jsonObj.imageWidth, |
| 142 | jsonObj.imageHeight, |
| 143 | window.orgWidth, |
| 144 | window.orgHeight |
| 145 | ); |
| 146 | let html = ` |
| 147 | <polygon data-id="${window.currentPoint}" class="isimb-6310-pol-loaded isimb-6310-pol-${counter}" points="${cords}"/> |
| 148 | `; |
| 149 | let styleCSS = ` |
| 150 | .isimb-6310-main-svg .isimb-6310-pol-${counter}{ |
| 151 | fill: ${jsonObj.selectAreaColor} !important; |
| 152 | stroke:${jsonObj.areaBorderColor} !important; |
| 153 | stroke-width:${jsonObj.areaBorderSize}px !important; |
| 154 | } |
| 155 | .isimb-6310-main-svg .isimb-6310-pol-${counter}:hover{ |
| 156 | fill: ${jsonObj.selectAreaHoverColor} !important; |
| 157 | stroke:${jsonObj.areaBorderHoverColor} !important; |
| 158 | stroke-width:${jsonObj.areaBorderSize}px !important; |
| 159 | cursor: pointer; |
| 160 | filter: drop-shadow(0px 0px ${jsonObj.areaShadowith}px ${jsonObj.areaShadowColor}); |
| 161 | } |
| 162 | `; |
| 163 | jQuery(".isimb-6310-main-svg").append(html); |
| 164 | jQuery(`.isimb-6310-pol-${counter}`).attr("data-json", jsonObjParse); |
| 165 | jQuery(`<style type='text/css'>${styleCSS}</style>`).appendTo( |
| 166 | `.isimb-6310-builder-box` |
| 167 | ); |
| 168 | |
| 169 | jQuery("#isimb-6310-add-point").fadeOut(500); |
| 170 | jQuery("body").css({ |
| 171 | overflow: "initial", |
| 172 | }); |
| 173 | jQuery(".isimb-6310-builder-box").html( |
| 174 | jQuery(".isimb-6310-builder-box").html() |
| 175 | ); |
| 176 | counter++; |
| 177 | jQuery(".isimb-6310-canvas-area").val(""); |
| 178 | }); |
| 179 | |
| 180 | //Delete Point Script |
| 181 | jQuery("body").on("click", ".isimb-6310-btn-point-delete", function (event) { |
| 182 | event.preventDefault(); |
| 183 | jQuery(`.isimb-6310-point-${window.currentPoint}`).remove(); |
| 184 | jQuery(`#isimb-6310-edit-point`).fadeOut(500); |
| 185 | jQuery("body").css({ |
| 186 | overflow: "initial", |
| 187 | }); |
| 188 | }); |
| 189 | |
| 190 | jQuery("body").on( |
| 191 | "change", |
| 192 | "#isimb-6310-add-point .isimb-6310-section-view-mood-select", |
| 193 | function () { |
| 194 | let val = parseInt(jQuery(this).val()); |
| 195 | setTimeout(function () { |
| 196 | jQuery("#isimb-6310-add-point .isimb-6310-section-select:last").click(); |
| 197 | jQuery( |
| 198 | "#isimb-6310-add-point .isimb-6310-section-select:first" |
| 199 | ).click(); |
| 200 | |
| 201 | if (val == 1) { |
| 202 | jQuery(".isimb-6310-model-content").addClass("isimb-6310-hide"); |
| 203 | jQuery( |
| 204 | ".isimb-6310-link-content, .isimb-6310-linking-area-tr" |
| 205 | ).removeClass("isimb-6310-hide"); |
| 206 | } else { |
| 207 | jQuery(".isimb-6310-model-content").removeClass("isimb-6310-hide"); |
| 208 | jQuery(".isimb-6310-linking-area-tr").addClass("isimb-6310-hide"); |
| 209 | } |
| 210 | }, 100); |
| 211 | } |
| 212 | ); |
| 213 | |
| 214 | jQuery("body").on( |
| 215 | "change", |
| 216 | "#isimb-6310-edit-point .isimb-6310-section-view-mood-select", |
| 217 | function () { |
| 218 | let val = parseInt(jQuery(this).val()); |
| 219 | setTimeout(function () { |
| 220 | jQuery( |
| 221 | "#isimb-6310-edit-point .isimb-6310-section-select:last" |
| 222 | ).click(); |
| 223 | jQuery( |
| 224 | "#isimb-6310-edit-point .isimb-6310-section-select:first" |
| 225 | ).click(); |
| 226 | |
| 227 | if (val == 1) { |
| 228 | jQuery(".isimb-6310-model-content").addClass("isimb-6310-hide"); |
| 229 | jQuery( |
| 230 | ".isimb-6310-link-content, .isimb-6310-linking-area-tr" |
| 231 | ).removeClass("isimb-6310-hide"); |
| 232 | } else { |
| 233 | jQuery(".isimb-6310-model-content").removeClass("isimb-6310-hide"); |
| 234 | jQuery(".isimb-6310-linking-area-tr").addClass("isimb-6310-hide"); |
| 235 | } |
| 236 | }, 100); |
| 237 | } |
| 238 | ); |
| 239 | |
| 240 | // Point Settings script |
| 241 | jQuery("body").on("change", ".isimb-6310-section-select", function () { |
| 242 | let val = parseInt(jQuery(this).val()); |
| 243 | let parentId = jQuery(this).closest(".isimb-6310-modal").attr("id"); |
| 244 | jQuery( |
| 245 | ".isimb-6310-tooltip-link, .isimb-6310-embided, .isimb-6310-external-link, .isimb-6310-templates, .isimb-6310-tooltip-img, .isimb_6310_custom_template, .isimb-6310-direct-link, .isimb-6310-link-content-direct, .isimb_6310_plugin_shortcode" |
| 246 | ).addClass("isimb-6310-hide"); |
| 247 | jQuery(`.isimb-6310-type-${val}, .isimb-6310_link-type`).removeClass( |
| 248 | "isimb-6310-hide" |
| 249 | ); |
| 250 | if (val == 1) { |
| 251 | jQuery(".isimb_6310_textarea").removeClass("isimb-6310-hide"); |
| 252 | jQuery( |
| 253 | ".isimb-6310-tooltip-link, .isimb-6310-templates, .toggle-tabs li[data-id='3']" |
| 254 | ).removeClass("isimb-6310-hide"); |
| 255 | if (parentId == "isimb-6310-edit-point") { |
| 256 | jQuery( |
| 257 | `#${parentId} .isimb-6310-tooltip_img_section .isimb-6310-tooltip-img[data-id='01']` |
| 258 | ).addClass("isimb-6310-hide"); |
| 259 | jQuery( |
| 260 | `#${parentId} .isimb-6310-tooltip_img_section .isimb-6310-tooltip-img[data-id='03'], #isimb_6310_custom_code-html, .isimb_6310_custom_code_popup-html` |
| 261 | ).trigger("click"); |
| 262 | } else { |
| 263 | jQuery( |
| 264 | `#${parentId} .isimb-6310-tooltip_img_section .isimb-6310-tooltip-img[data-id='01']` |
| 265 | ).removeClass("isimb-6310-hide"); |
| 266 | jQuery( |
| 267 | `#${parentId} .isimb-6310-tooltip_img_section .isimb-6310-type-${val}:first, #isimb_6310_custom_code-html, .isimb_6310_custom_code_popup-html` |
| 268 | ).trigger("click"); |
| 269 | } |
| 270 | if ( |
| 271 | jQuery( |
| 272 | `#${parentId} .isimb-6310-section-view-mood-select:checked` |
| 273 | ).val() == "1" |
| 274 | ) { |
| 275 | jQuery( |
| 276 | `#${parentId} .isimb-6310-tooltip-img[data-id='01']` |
| 277 | ).removeClass("isimb-6310-hide"); |
| 278 | jQuery(`#${parentId} .isimb-6310-tooltip-img[data-id='04']`).click(); |
| 279 | jQuery(`#${parentId} .isimb-6310-tooltip-img[data-id='01']`).click(); |
| 280 | } else { |
| 281 | jQuery(`#${parentId} .isimb-6310-tooltip-img[data-id='01']`).addClass( |
| 282 | "isimb-6310-hide" |
| 283 | ); |
| 284 | jQuery(`#${parentId} .isimb-6310-tooltip-img[data-id='03']`).click(); |
| 285 | } |
| 286 | } else if (val == 2) { |
| 287 | jQuery( |
| 288 | ".isimb_6310_textarea, .isimb-6310-embided, .isimb-6310-templates" |
| 289 | ).removeClass("isimb-6310-hide"); |
| 290 | jQuery('.toggle-tabs li[data-id="3"]').addClass("isimb-6310-hide"); |
| 291 | jQuery( |
| 292 | `#${parentId} .isimb-6310-tooltip_img_section .isimb-6310-type-${val}:first, #isimb_6310_custom_code-html, .isimb_6310_custom_code_popup-html` |
| 293 | ).trigger("click"); |
| 294 | } else if (val == 3) { |
| 295 | jQuery(".isimb_6310_custom_template").removeClass("isimb-6310-hide"); |
| 296 | jQuery( |
| 297 | '.isimb_6310_font_prop, .isimb_6310_template_embedded, .toggle-tabs li[data-id="3"], .isimb_6310_template_description' |
| 298 | ).addClass("isimb-6310-hide"); |
| 299 | } else if (val == 4) { |
| 300 | jQuery(".isimb_6310_plugin_shortcode").removeClass("isimb-6310-hide"); |
| 301 | jQuery( |
| 302 | '.isimb_6310_font_prop, .isimb_6310_template_embedded, .toggle-tabs li[data-id="3"], .isimb_6310_custom_template, .isimb_6310_template_description' |
| 303 | ).addClass("isimb-6310-hide"); |
| 304 | } else { |
| 305 | jQuery( |
| 306 | '.toggle-tabs li[data-id="3"], .isimb-6310-direct-link, .isimb-6310_link, .isimb-6310_link-type, .isimb-6310-link-content-direct, .isimb_6310_plugin_shortcode' |
| 307 | ).removeClass("isimb-6310-hide"); |
| 308 | jQuery( |
| 309 | ".isimb_6310_font_prop, .isimb_6310_template_embedded, .isimb_6310_custom_template, .isimb_6310_custom_template, .isimb_6310_template_description" |
| 310 | ).addClass("isimb-6310-hide"); |
| 311 | } |
| 312 | }); |
| 313 | |
| 314 | //Template load script |
| 315 | |
| 316 | jQuery("body").on("click", ".isimb-6310-tooltip-img", function () { |
| 317 | jQuery(".isimb-6310-tooltip-img").removeClass("isimb-6310-active"); |
| 318 | jQuery(this) |
| 319 | .closest(".isimb-6310-tooltip-img") |
| 320 | .addClass("isimb-6310-active"); |
| 321 | let val = jQuery(this).closest(".isimb-6310-tooltip-img").attr("data-id"); |
| 322 | jQuery(".isimb-6310-form").addClass("isimb-6310-hide"); |
| 323 | jQuery(`.isimb-6310-form-${val}`).removeClass("isimb-6310-hide"); |
| 324 | |
| 325 | isimb_6310_set_html_code(val); |
| 326 | }); |
| 327 | |
| 328 | // tooltip embedded code show hide add point |
| 329 | |
| 330 | jQuery("body").on( |
| 331 | "change", |
| 332 | "#isimb-6310-add-point .isimb-6310-open-popup", |
| 333 | function () { |
| 334 | let val = parseInt(jQuery(this).val()); |
| 335 | jQuery( |
| 336 | "#isimb-6310-add-point .popup-user-embedded, .tooltip-custom-html-css, .tooltip-embedded" |
| 337 | ).addClass("isimb-6310-hide"); |
| 338 | if (val == 2) { |
| 339 | jQuery("#isimb-6310-add-point .popup-user-embedded").removeClass( |
| 340 | "isimb-6310-hide" |
| 341 | ); |
| 342 | } |
| 343 | if (val == 1) { |
| 344 | jQuery( |
| 345 | "#isimb-6310-add-point .popup-user-embedded, .tooltip-custom-html-css, .tooltip-embedded" |
| 346 | ).addClass("isimb-6310-hide"); |
| 347 | } |
| 348 | } |
| 349 | ); |
| 350 | jQuery("body").on( |
| 351 | "change", |
| 352 | "#isimb-6310-add-point .isimb-6310-open-popup-custom-use", |
| 353 | function () { |
| 354 | let val = parseInt(jQuery(this).val()); |
| 355 | jQuery("#isimb-6310-add-point .tooltip-embedded").removeClass( |
| 356 | "isimb-6310-hide" |
| 357 | ); |
| 358 | if (val == 2) { |
| 359 | jQuery("#isimb-6310-add-point .tooltip-embedded").removeClass( |
| 360 | "isimb-6310-hide" |
| 361 | ); |
| 362 | jQuery("#isimb-6310-add-point .tooltip-custom-html-css").addClass( |
| 363 | "isimb-6310-hide" |
| 364 | ); |
| 365 | } |
| 366 | if (val == 1) { |
| 367 | jQuery("#isimb-6310-add-point .tooltip-embedded").addClass( |
| 368 | "isimb-6310-hide" |
| 369 | ); |
| 370 | jQuery("#isimb-6310-add-point .tooltip-custom-html-css").removeClass( |
| 371 | "isimb-6310-hide" |
| 372 | ); |
| 373 | } |
| 374 | } |
| 375 | ); |
| 376 | // tooltip embedded code show hide edit point |
| 377 | jQuery("body").on( |
| 378 | "change", |
| 379 | "#isimb-6310-edit-point .isimb-6310-open-popup", |
| 380 | function () { |
| 381 | let val = parseInt(jQuery(this).val()); |
| 382 | if (val == 2) { |
| 383 | jQuery("#isimb-6310-edit-point .popup-user-embedded").removeClass( |
| 384 | "isimb-6310-hide" |
| 385 | ); |
| 386 | } |
| 387 | if (val == 1) { |
| 388 | jQuery( |
| 389 | "#isimb-6310-edit-point .popup-user-embedded, .tooltip-custom-html-css, .tooltip-embedded" |
| 390 | ).addClass("isimb-6310-hide"); |
| 391 | } |
| 392 | } |
| 393 | ); |
| 394 | jQuery("body").on( |
| 395 | "change", |
| 396 | "#isimb-6310-edit-point .isimb-6310-open-popup-custom-use", |
| 397 | function () { |
| 398 | let val = parseInt(jQuery(this).val()); |
| 399 | jQuery("#isimb-6310-edit-point .tooltip-embedded").removeClass( |
| 400 | "isimb-6310-hide" |
| 401 | ); |
| 402 | if (val == 2) { |
| 403 | jQuery("#isimb-6310-edit-point .tooltip-embedded").removeClass( |
| 404 | "isimb-6310-hide" |
| 405 | ); |
| 406 | jQuery("#isimb-6310-edit-point .tooltip-custom-html-css").addClass( |
| 407 | "isimb-6310-hide" |
| 408 | ); |
| 409 | } |
| 410 | if (val == 1) { |
| 411 | jQuery("#isimb-6310-edit-point .tooltip-embedded").addClass( |
| 412 | "isimb-6310-hide" |
| 413 | ); |
| 414 | jQuery("#isimb-6310-edit-point .tooltip-custom-html-css").removeClass( |
| 415 | "isimb-6310-hide" |
| 416 | ); |
| 417 | } |
| 418 | } |
| 419 | ); |
| 420 | |
| 421 | //Combine JSON and push it in an input field |
| 422 | jQuery("body").on("click", ".isimb-6310-insert-ja-data", function () { |
| 423 | let jsonCollection = []; |
| 424 | jQuery(`.isimb-6310-main-svg polygon`).each(function () { |
| 425 | let jsonObj = jQuery(this).attr("data-json"); |
| 426 | if (jsonObj) { |
| 427 | jsonObj = JSON.parse(jsonObj); |
| 428 | jsonObj.points = jQuery(this).attr("points"); |
| 429 | jsonCollection.push(jsonObj); |
| 430 | } |
| 431 | }); |
| 432 | jQuery("#isimb_6310_json_field").val(JSON.stringify(jsonCollection)); |
| 433 | }); |
| 434 | |
| 435 | //Manage icon remove start |
| 436 | jQuery("body").on("click", ".fa-minus-circle", function () { |
| 437 | jQuery(this).closest("td").find("input").val(""); |
| 438 | }); |
| 439 | //Manage icon remove end |
| 440 | }); |
| 441 | |
| 442 | function isimb_6310_set_html_code(val) { |
| 443 | let htmlCode = ""; |
| 444 | if (val == "01") { |
| 445 | htmlCode = ` |
| 446 | <div class="isimb-6310-tooltip isimb-6310-template-01"> |
| 447 | <a href="#">Hover here</a> |
| 448 | <div class="isimb-6310-template-01-hover-content">Tooltip text</div> |
| 449 | </div> |
| 450 | `; |
| 451 | } else if (val == "03") { |
| 452 | htmlCode = ` |
| 453 | <div class="isimb-6310-tooltip isimb-6310-template-03 isimb-6310-hide"> |
| 454 | <a href="#"><img src="img/4 (2).png" alt="" ></a> |
| 455 | <div class="isimb-6310-template-03-hover-content"> |
| 456 | <div class="isimb-6310-template-03-tooltip-testimonial"> |
| 457 | <div class="isimb-6310-template-03-tooltip-pic"> |
| 458 | <img src="img/7.png" alt=""> |
| 459 | </div> |
| 460 | <div class="isimb-6310-template-03-tooltip-testimonial-content"> |
| 461 | <div class="isimb-6310-template-03-tooltip-testimonial-title">Williamson |
| 462 | <div class="isimb-6310-template-03-tooltip-post">Web Designer</div> |
| 463 | </div> |
| 464 | <div class="isimb-6310-template-03-tooltip-description"> |
| 465 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. A aliquam amet animi blanditiis consequatur |
| 466 | debitis dicta distinctio, enim error eum iste libero modi nam natus perferendis possimus quasi sint sit |
| 467 | tempora voluptatem. Est, exercitationem id ipsa ipsum laboriosam perferendis temporibus! |
| 468 | </div> |
| 469 | </div> |
| 470 | </div> |
| 471 | </div> |
| 472 | </div> |
| 473 | `; |
| 474 | } else if (val == "04") { |
| 475 | htmlCode = ` |
| 476 | <div class="isimb-6310-tooltip isimb-6310-template-04 isimb-6310-hide"> |
| 477 | <a href="#"><img src="img/4 (2).png" alt=""></a> |
| 478 | <div class="isimb-6310-template-04-tooltip-testimonial"> |
| 479 | <div class="isimb-6310-template-04-tooltip-testimonial-content"> |
| 480 | <div class="isimb-6310-template-04-tooltip-pic"> |
| 481 | <img src="img/7.png"> |
| 482 | </div> |
| 483 | <div class="isimb-6310-template-04-tooltip-title">Williamson</div> |
| 484 | <div class="isimb-6310-template-04-tooltip-post">Web Developer</div> |
| 485 | </div> |
| 486 | <div class="isimb-6310-template-04-tooltip-description"> |
| 487 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dolor tellus, efficitur ut tortor id, |
| 488 | molestie egestas nibh. In blandit ex at erat vehicula molestie. Mauris vel volutpat nulla. Suspendisse lorem |
| 489 | ex, congue at elit id, tincidunt tempor orci. Nullam nec augue ac tellus rhoncus tincidunt nec ut ligula. |
| 490 | Praesent. |
| 491 | </div> |
| 492 | </div> |
| 493 | </div> |
| 494 | `; |
| 495 | } else if (val == "05") { |
| 496 | htmlCode = ` |
| 497 | <div class="isimb-6310-tooltip isimb-6310-template-05 isimb-6310-hide"> |
| 498 | <a href="#"><img src="img/4 (2).png" alt=""></a> |
| 499 | <div class="isimb-6310-template-05-hover-content"> |
| 500 | <div class="isimb-6310-template-05-tooltip-testimonial"> |
| 501 | <div class="isimb-6310-template-05-tooltip-testimonial-content"> |
| 502 | <div class="isimb-6310-template-05-tooltip-pic"> |
| 503 | <img src="img/7.png"> |
| 504 | </div> |
| 505 | <div class="isimb-6310-template-05-tooltip-title">Williamson</div> |
| 506 | <div class="isimb-6310-template-05-tooltip-post">Web Developer</div> |
| 507 | </div> |
| 508 | <div class="isimb-6310-template-05-tooltip-description"> |
| 509 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dolor tellus, efficitur ut tortor id, |
| 510 | molestie egestas nibh. In blandit ex at erat vehicula molestie. Mauris vel volutpat nulla. Suspendisse lorem |
| 511 | ex, congue at elit id, tincidunt tempor orci. Nullam nec augue ac tellus rhoncus tincidunt nec ut ligula. |
| 512 | Praesent. |
| 513 | </div> |
| 514 | </div> |
| 515 | </div> |
| 516 | </div> |
| 517 | `; |
| 518 | } else if (val == "02") { |
| 519 | htmlCode = ` |
| 520 | <div class="isimb-6310-tooltip isimb-6310-template-02"> |
| 521 | <div class="isimb-6310-template-02-hover-content"> |
| 522 | <div class="isimb-6310-template-02-content"> |
| 523 | <iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d25125110.814096835!2d94.35061650599457!3d23.913222352616348!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sbd!4v1636176093357!5m2!1sen!2sbd" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe> |
| 524 | </div> |
| 525 | </div> |
| 526 | </div> |
| 527 | `; |
| 528 | } |
| 529 | |
| 530 | jQuery(`textarea[name='isimb_6310_custom_code']`).val(htmlCode); |
| 531 | jQuery( |
| 532 | `#isimb_6310_custom_code-html, .isimb_6310_custom_code_popup-html` |
| 533 | ).trigger("click"); |
| 534 | } |
| 535 | |
| 536 | function isimb_6310_icon_image_select() { |
| 537 | //Manage icon Start |
| 538 | jQuery("#icon-filter").on("keyup", function () { |
| 539 | var value = jQuery(this).val().toLowerCase(); |
| 540 | jQuery(".isimb-6310-choose-icon li").filter(function () { |
| 541 | jQuery(this).toggle( |
| 542 | jQuery(this).attr(`data-icon-name`).toLowerCase().indexOf(value) > -1 |
| 543 | ); |
| 544 | }); |
| 545 | }); |
| 546 | |
| 547 | jQuery("body").on( |
| 548 | "click", |
| 549 | "#isimb-6310-font-icon-close, .isimb-6310-font-awesome-close", |
| 550 | function () { |
| 551 | jQuery("#isimb_6310_social_icon").fadeOut(500); |
| 552 | } |
| 553 | ); |
| 554 | |
| 555 | jQuery("body").on( |
| 556 | "click", |
| 557 | "isimb-6310-plus-icons, .isimb-6310-plus-icons i", |
| 558 | function () { |
| 559 | let selIds = jQuery(this) |
| 560 | .closest(".isimb-6310-plus-icons") |
| 561 | .siblings(".isimb-6310-form-input") |
| 562 | .attr("id"); |
| 563 | jQuery("ul.isimb-6310-choose-icon").attr("data-current-id", selIds); |
| 564 | if (jQuery("#icon-filter").val()) { |
| 565 | jQuery("#icon-filter").val(""); |
| 566 | jQuery(".isimb-6310-choose-icon li").filter(function () { |
| 567 | jQuery(this).toggle(); |
| 568 | }); |
| 569 | } |
| 570 | jQuery("#isimb_6310_social_icon").fadeIn(500); |
| 571 | jQuery("body").css({ |
| 572 | overflow: "hidden", |
| 573 | }); |
| 574 | jQuery("#icon-filter").focus(); |
| 575 | return false; |
| 576 | } |
| 577 | ); |
| 578 | |
| 579 | jQuery("body").on("click", "ul.isimb-6310-choose-icon li", function () { |
| 580 | let cls = jQuery(this).find("i").attr("class"); |
| 581 | jQuery( |
| 582 | `.` + jQuery("ul.isimb-6310-choose-icon").attr("data-current-id") |
| 583 | ).val(cls); |
| 584 | jQuery("#isimb_6310_social_icon").fadeOut(500); |
| 585 | }); |
| 586 | //Manage icon End |
| 587 | |
| 588 | /* Main Image Upload ########### */ |
| 589 | jQuery("body").on("click", ".isimb-6310-upload-image", function (e) { |
| 590 | e.preventDefault(); |
| 591 | var image = wp |
| 592 | .media({ |
| 593 | title: "Upload Image", |
| 594 | multiple: false, |
| 595 | }) |
| 596 | .open() |
| 597 | .on("select", function (e) { |
| 598 | var uploaded_image = image.state().get("selection").first(); |
| 599 | var image_url = uploaded_image.toJSON().url; |
| 600 | jQuery(`.isimb-6310-main-image`).attr("src", image_url); |
| 601 | jQuery(`input[name='main_image']`).val(image_url); |
| 602 | jQuery(`svg.isimb-6310-main-svg, svg.isimb-6310-main-multiple-svg`).css( |
| 603 | { |
| 604 | "background-image": `url(${image_url})`, |
| 605 | } |
| 606 | ); |
| 607 | jQuery( |
| 608 | "input.isimb-6310-canvas-area, .isimb-6310-canvas-area-nested-edit, .isimb-6310-canvas-area-nested" |
| 609 | ).attr("isimb-6310-image-url", image_url); |
| 610 | setTimeout(function () { |
| 611 | let mainImg = jQuery(".isimb-6310-main-image"); |
| 612 | window.orgWidth = mainImg.width(); |
| 613 | window.orgHeight = mainImg.height(); |
| 614 | jQuery(".isimb-6310-main-svg") |
| 615 | .attr("width", window.orgWidth) |
| 616 | .attr("height", window.orgHeight); |
| 617 | jQuery(".isimb-6310-main-svg").css({ |
| 618 | "background-size": |
| 619 | window.orgWidth + "px " + window.orgHeight + "px", |
| 620 | }); |
| 621 | }, 500); |
| 622 | }); |
| 623 | |
| 624 | jQuery("#isimb_6310_add_new_media").css({ |
| 625 | "overflow-x": "hidden", |
| 626 | "overflow-y": "auto", |
| 627 | }); |
| 628 | }); |
| 629 | |
| 630 | //Add Point |
| 631 | jQuery("body").on("change", ".isimb-6310_icon_type", function (e) { |
| 632 | let value = Number(jQuery(this).val()); |
| 633 | jQuery(".isimb-6310-marker").addClass("isimb-6310-hide"); |
| 634 | jQuery(`.isimb-6310-marker-type-${value}`).removeClass("isimb-6310-hide"); |
| 635 | }); |
| 636 | |
| 637 | /* ######### Custom Icon Media Start ########### */ |
| 638 | jQuery("body").on("click", ".isimb-6310-icon-upload", function (e) { |
| 639 | e.preventDefault(); |
| 640 | let dataId = jQuery(this).attr("data-id"); |
| 641 | |
| 642 | var image = wp |
| 643 | .media({ |
| 644 | title: "Upload Image", |
| 645 | multiple: false, |
| 646 | }) |
| 647 | .open() |
| 648 | .on("select", function (e) { |
| 649 | var uploaded_image = image.state().get("selection").first(); |
| 650 | var image_url = uploaded_image.toJSON().url; |
| 651 | jQuery(`.${dataId}`).val(image_url); |
| 652 | }); |
| 653 | |
| 654 | jQuery("#isimb_6310_add_new_media").css({ |
| 655 | "overflow-x": "hidden", |
| 656 | "overflow-y": "auto", |
| 657 | }); |
| 658 | }); |
| 659 | /* ######### Custom Icon Media End ########### */ |
| 660 | } |
| 661 | |
| 662 | function isimb_6310_zoom_in_out_code() { |
| 663 | /* ######### Custom Icon For Zoom In/Out Start ########### */ |
| 664 | /* Main Image Upload ########### */ |
| 665 | jQuery("body").on("click", ".isimb-6310-zoom-icon", function (e) { |
| 666 | e.preventDefault(); |
| 667 | const closest = jQuery(this); |
| 668 | var image = wp |
| 669 | .media({ |
| 670 | title: "Upload Icon", |
| 671 | multiple: false, |
| 672 | }) |
| 673 | .open() |
| 674 | .on("select", function (e) { |
| 675 | var uploaded_image = image.state().get("selection").first(); |
| 676 | var image_url = uploaded_image.toJSON().url; |
| 677 | closest.closest("td").find(`img`).attr("src", image_url); |
| 678 | closest.closest("td").find(`input[type='hidden']`).val(image_url); |
| 679 | }); |
| 680 | |
| 681 | jQuery("#isimb_6310_add_new_media").css({ |
| 682 | "overflow-x": "hidden", |
| 683 | "overflow-y": "auto", |
| 684 | }); |
| 685 | }); |
| 686 | /* ######### Custom Icon For Zoom In/Out End ########### */ |
| 687 | |
| 688 | const zoomFeature = Number( |
| 689 | jQuery("input[name='zoom_feature']:checked").val() |
| 690 | ); |
| 691 | zoomFeature > 1 |
| 692 | ? jQuery(".toggle-zoom-feature").show() |
| 693 | : jQuery(".toggle-zoom-feature").hide(); |
| 694 | |
| 695 | let zoomValue = jQuery("select[name='icon_position']").val(); |
| 696 | if ( |
| 697 | (zoomValue === "right-top" || |
| 698 | zoomValue === "right-bottom" || |
| 699 | zoomValue === "left-top" || |
| 700 | zoomValue === "left-bottom") && |
| 701 | zoomFeature > 1 |
| 702 | ) { |
| 703 | jQuery(".toggle-zoom-feature-background").show(); |
| 704 | } else { |
| 705 | jQuery(".toggle-zoom-feature-background").hide(); |
| 706 | } |
| 707 | |
| 708 | jQuery("body").on("change", "input[name='zoom_feature']", function () { |
| 709 | const value = Number(jQuery(this).val()); |
| 710 | value > 1 |
| 711 | ? jQuery(".toggle-zoom-feature").show() |
| 712 | : jQuery(".toggle-zoom-feature").hide(); |
| 713 | |
| 714 | const zoomValue = jQuery("select[name='icon_position']").val(); |
| 715 | if ( |
| 716 | (zoomValue === "right-top" || |
| 717 | zoomValue === "right-bottom" || |
| 718 | zoomValue === "left-top" || |
| 719 | zoomValue === "left-bottom") && |
| 720 | value > 1 |
| 721 | ) { |
| 722 | jQuery(".toggle-zoom-feature-background").show(); |
| 723 | } else { |
| 724 | jQuery(".toggle-zoom-feature-background").hide(); |
| 725 | } |
| 726 | }); |
| 727 | |
| 728 | jQuery("body").on("change", "select[name='icon_position']", function () { |
| 729 | const value = jQuery(this).val(); |
| 730 | if ( |
| 731 | value === "right-top" || |
| 732 | value === "right-bottom" || |
| 733 | value === "left-top" || |
| 734 | value === "left-bottom" |
| 735 | ) { |
| 736 | jQuery(".toggle-zoom-feature-background").show(); |
| 737 | } else { |
| 738 | jQuery(".toggle-zoom-feature-background").hide(); |
| 739 | } |
| 740 | }); |
| 741 | } |
| 742 | |
| 743 | function isimb_6310_tooltip_fields() { |
| 744 | const field = jQuery('select[name="tooltip_position"]'); |
| 745 | Number(field.val()) |
| 746 | ? jQuery(".tooltip-attribute").show() |
| 747 | : jQuery(".tooltip-attribute").hide(); |
| 748 | |
| 749 | jQuery("body").on("change", 'select[name="tooltip_position"]', function () { |
| 750 | const value = Number(jQuery(this).val()); |
| 751 | if (value && value !== 2 && value !== 5 && value !== 7) { |
| 752 | jQuery(".tooltip-attribute").show(); |
| 753 | let selectedText = jQuery(this).find("option:selected").text().split(" "); |
| 754 | jQuery(".tooltip-attribute-text-1").text("Gap From " + selectedText[0]); |
| 755 | jQuery(".tooltip-attribute-text-2").text("Gap From " + selectedText[1]); |
| 756 | } else { |
| 757 | jQuery(".tooltip-attribute").hide(); |
| 758 | } |
| 759 | }); |
| 760 | } |
| 761 |