From 51c14fa5dfdce1fe6261e2ee61c35afd2e2ac7d6 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Tue, 3 Jan 2017 19:31:15 -0500 Subject: Update plugin wp-syntax to 1.1 --- plugins/wp-syntax/js/wp-syntax.js | 78 +++++++++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 8 deletions(-) (limited to 'plugins/wp-syntax/js') diff --git a/plugins/wp-syntax/js/wp-syntax.js b/plugins/wp-syntax/js/wp-syntax.js index f7f6c739..8472db3e 100644 --- a/plugins/wp-syntax/js/wp-syntax.js +++ b/plugins/wp-syntax/js/wp-syntax.js @@ -6,14 +6,14 @@ jQuery(document).ready(function($) { var w = $(this).find('table').outerWidth(); var hw = $(document).width() - $(this).offset().left - 20; - + /* * Test code. */ /*var left, top; left = $(this).offset().left; top = $(this).offset().top; - + $(this) .appendTo('body') .css({ @@ -22,13 +22,75 @@ jQuery(document).ready(function($) 'top': top + 'px' }); */ - - if(w > $(this).outerWidth()) - $(this).css({'position':'relative', 'z-index':'9999', 'box-shadow':'5px 5px 5px #888', 'width':(w > hw ? hw : w)+'px'}); + + if(w > $(this).outerWidth()) { + // $(this).css({'position':'relative', 'z-index':'9999', 'box-shadow':'5px 5px 5px #888', 'width':(w > hw ? hw : w)+'px'}); + $(this).css({'position':'relative', 'z-index':'9999', 'width':(w > hw ? hw : w)+'px'}); + } }, mouseout: function() { - //$(this).removeAttr('style'); - } + // $(this).removeAttr('style'); + $(this).css({'position':'relative', 'z-index':'', 'width':'auto'}); + }, + dblclick: function() + { + //Create text area on top of code on double click + //This can make copying of the code easier + + var jthis = $(this); + if (!jthis.data('hasTextArea')) { + var code = jthis.find(".theCode").html(); + var ta = $('