PluginProbe
Survey Maker by AYS / 5.2.4.1
Survey Maker by AYS v5.2.4.1
5.2.4.1 5.2.4.0 5.2.3.9 5.2.3.8 5.2.3.7 5.2.3.6 5.2.3.5 5.2.3.4 5.2.3.3 5.2.3.2 5.2.3.1 5.2.3.0 5.2.2.9 5.2.2.8 5.2.2.7 5.2.2.6 5.2.2.5 5.2.2.4 5.2.2.3 5.2.2.2 5.2.2.1 5.2.2.0 5.2.1.9 5.2.1.8 5.2.0.8 All 154 releases
← All changes | admin/js/functions.js +40 -0 5.2.2.0 → 5.2.4.1 View file →
@@ -543,8 +543,48 @@
543 543 textRange.select();
544 544 }
545 545 }
546 546
547 + function copyQuestionIdOnClick(el) {
548 + var $this = jQuery(el);
549 +
550 + // Find ID text
551 + var text = $this.find('.ays-survey-shortcode-box').text().trim();
552 +
553 + // Copy
554 + var textField = document.createElement('textarea');
555 + textField.value = text;
556 +
557 + document.body.appendChild(textField);
558 +
559 + textField.select();
560 + textField.setSelectionRange(0, 99999);
561 +
562 + document.execCommand('copy');
563 +
564 + document.body.removeChild(textField);
565 +
566 + // Tooltip
567 + $this.attr("data-original-title", SurveyMakerAdmin.copied);
568 + $this.attr("title", SurveyMakerAdmin.copied);
569 +
570 + $this.tooltip("show");
571 +
572 + setTimeout(function () {
573 + $this.tooltip("hide");
574 +
575 + $this.attr(
576 + "data-original-title",
577 + SurveyMakerAdmin.clickForCopy
578 + );
579 +
580 + $this.attr(
581 + "title",
582 + SurveyMakerAdmin.clickForCopy
583 + );
584 + }, 1500);
585 + }
586 +
547 587 function selectElementContentsCopy(element) {
548 588 var _this = element;
549 589 var text = _this.attr("data-clipboard-text");
550 590 var newElement = jQuery('<textarea>').appendTo('body').val(text).select();