3
* Shows the actual UI elements. If there is no JavaScript enabled, this
4
* function will not be called and the user will see the message shown
5
* in <noscript> rather than the UI which requires JavaScript to run.
7
jQuery.fn.enableUi = function() {
8
this.find(".disabled-ui").removeClass("disabled-ui");
12
* Dynamically adds markup required by the specific skin.
14
jQuery.enhanceMarkup = function() {
15
// Extra wrappers for tabs
16
$("#source-tabs li.tab").wrapInner('<div class="tab-left"><div class="tab-right"><div class="tab-inside"></div></div></div>');
18
// A lead-in element for tabs
19
$("#source-tabs").prepend('<div id="tab-lead-in"></div>');
22
$("#query").glow("glow-small");
23
$("#search").glow("glow-big");
27
* Adds the markup required to create a glow effect.
29
jQuery.fn.glow = function(glowClass) {
30
this.each(function() {
33
// Get content dimensions
34
var contentWidth = $this.outerWidth();
35
var contentHeight = $this.outerHeight();
38
var $glowDiv = $("<span class='" + glowClass + "'></span>");
39
$this.before($glowDiv);
40
$glowDiv.append("<span class='tl'></span><span class='t'></span><span class='tr'></span><span class='l'></span>");
41
$glowDiv.append($this);
42
$glowDiv.append("<span class='r'></span><span class='bl'></span><span class='b'></span><span class='br'></span>");
44
// Extract border sizes
45
var borderWidth = $glowDiv.find(".tl").width();
46
var borderHeight = $glowDiv.find(".tl").height();
48
// Add appropriate dimensions to the newly created markup
49
$glowDiv.width(contentWidth + borderWidth * 2);
50
$glowDiv.height(contentHeight + borderHeight * 2);
51
$glowDiv.find(".t, .b").width(contentWidth);
52
$glowDiv.find(".l, .r").height(contentHeight);