diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/compatibility.js | 8 | ||||
-rw-r--r-- | lib/scripts/edit.js | 2 | ||||
-rw-r--r-- | lib/scripts/index.html | 5 | ||||
-rw-r--r-- | lib/scripts/media.js | 15 | ||||
-rw-r--r-- | lib/scripts/page.js | 29 | ||||
-rw-r--r-- | lib/scripts/qsearch.js | 25 |
6 files changed, 56 insertions, 28 deletions
diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js index 385e45854..76b135b23 100644 --- a/lib/scripts/compatibility.js +++ b/lib/scripts/compatibility.js @@ -165,13 +165,13 @@ toggleWrap = DEPRECATED_WRAP(dw_editor.toggleWrap); setWrap = DEPRECATED_WRAP(dw_editor.setWrap); function findPosX(object){ - DEPRECATED('Use jQuery.position() instead'); - return jQuery(object).position().left; + DEPRECATED('Use jQuery.offset() instead'); + return jQuery(object).offset().left; } function findPosY(object){ - DEPRECATED('Use jQuery.position() instead'); - return jQuery(object).position().top; + DEPRECATED('Use jQuery.offset() instead'); + return jQuery(object).offset().top; } function getElementsByClass(searchClass,node,tag){ diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 33a8f61b5..5a5e829bd 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -40,6 +40,8 @@ function createToolButton(icon,label,key,id,classname){ icon = DOKU_BASE + 'lib/images/toolbar/' + icon; } $ico.attr('src', icon); + $ico.attr('width', 16); + $ico.attr('height', 16); $btn.append($ico); // we have to return a DOM object (for compatibility reasons) diff --git a/lib/scripts/index.html b/lib/scripts/index.html index d614603ac..977f90e10 100644 --- a/lib/scripts/index.html +++ b/lib/scripts/index.html @@ -1,6 +1,5 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<!DOCTYPE html> +<html> <head> <meta http-equiv="refresh" content="0; URL=../../" /> <meta name="robots" content="noindex" /> diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 841baa93f..182d5fefe 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -31,6 +31,7 @@ var dw_mediamanager = { var $content, $tree; $content = jQuery('#media__content'); $tree = jQuery('#media__tree'); + if(!$tree.length) return; dw_mediamanager.prepare_content($content); @@ -434,7 +435,7 @@ var dw_mediamanager = { dw_mediamanager.$resizables().resizable('destroy'); if (update_list) { - dw_mediamanager.list.call(jQuery('input[value="Apply"]')[0]); + dw_mediamanager.list.call(jQuery('#mediamanager__page form.options input[type="submit"]')[0]); } $content.html(data); @@ -494,12 +495,12 @@ var dw_mediamanager = { // set max width of resizable column var widthOtherResizable = widthResizables - jQuery(this).width(); var minWidthNonResizable = parseFloat($filePanel.css("min-width")); - var maxWidth = widthFull - (widthOtherResizable + minWidthNonResizable); + var maxWidth = widthFull - (widthOtherResizable + minWidthNonResizable) - 1; $resizables.resizable( "option", "maxWidth", maxWidth ); - // width of file panel in % = 100% - width of resizables in % - // this calculates with 99.99 and not 100 to overcome rounding errors - var relWidthNonResizable = 99.99 - (100 * widthResizables / widthFull); + // width of file panel in % = 100% - width of resizables in % + // this calculates with 99.9 and not 100 to overcome rounding errors + var relWidthNonResizable = 99.9 - (100 * widthResizables / widthFull); // set width of file panel $filePanel.width(relWidthNonResizable+'%'); @@ -513,6 +514,8 @@ var dw_mediamanager = { }); } + dw_mediamanager.resize(); + dw_mediamanager.opacity_slider(); dw_mediamanager.portions_slider(); } @@ -699,7 +702,7 @@ var dw_mediamanager = { event.preventDefault(); $link = jQuery(this); - id = $link.attr('name').substr(2); + id = $link.attr('id').substr(2); if(!opener){ // if we don't run in popup display example diff --git a/lib/scripts/page.js b/lib/scripts/page.js index 74aca9c06..4ab0bf9b5 100644 --- a/lib/scripts/page.js +++ b/lib/scripts/page.js @@ -22,19 +22,27 @@ dw_page = { jQuery('form.btn_secedit') .mouseover(function(){ var $tgt = jQuery(this).parent(), - nr = $tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2]; - - // Walk the DOM tree up (first previous siblings, then parents) - // until boundary element - while($tgt.length > 0 && !$tgt.hasClass('sectionedit' + nr)) { - // $.last gives the DOM-ordered last element: - // prev if present, else parent. - $tgt = $tgt.prev().add($tgt.parent()).last(); - $tgt.addClass('section_highlight'); + nr = $tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2], + $highlight = jQuery(), // holder for elements in the section to be highlighted + $highlightWrap = jQuery('<div class="section_highlight"></div>'); // section highlight wrapper + + // Walk the dom tree in reverse to find the sibling which is or contains the section edit marker + while($tgt.length > 0 && !($tgt.hasClass('sectionedit' + nr) || $tgt.find('.sectionedit' + nr).length)) { + $tgt = $tgt.prev(); + $highlight = $highlight.add($tgt); } + // insert the section highlight wrapper before the last element added to $highlight + $highlight.filter(':last').before($highlightWrap); + // and move the elements to be highlighted inside the section highlight wrapper + $highlight.detach().appendTo($highlightWrap); }) .mouseout(function(){ - jQuery('.section_highlight').removeClass('section_highlight'); + // find the section highlight wrapper... + var $highlightWrap = jQuery('.section_highlight'); + // ...move its children in front of it (as siblings)... + $highlightWrap.before($highlightWrap.children().detach()); + // ...and remove the section highlight wrapper + $highlightWrap.detach(); }); }, @@ -150,6 +158,7 @@ dw_page = { // Start animation and assure that $toc is hidden/visible $child.dw_toggle(hidden, function () { $content.toggle(hidden); + $content.css('min-height',''); // remove min-height again }); }; diff --git a/lib/scripts/qsearch.js b/lib/scripts/qsearch.js index a309f9e29..c3d0d94fb 100644 --- a/lib/scripts/qsearch.js +++ b/lib/scripts/qsearch.js @@ -92,12 +92,18 @@ var dw_qsearch = { .show() .css('white-space', 'nowrap'); - // shorten namespaces if too long - max = dw_qsearch.$outObj[0].clientWidth; + // disable overflow during shortening + dw_qsearch.$outObj.find('li').css('overflow', 'visible'); + $links = dw_qsearch.$outObj.find('a'); - too_big = (document.documentElement.dir === 'rtl') - ? function (l) { return l.offsetLeft < 0; } - : function (l) { return l.offsetWidth + l.offsetLeft > max; }; + max = dw_qsearch.$outObj[0].clientWidth; // maximum width allowed (but take away paddings below) + if(document.documentElement.dir === 'rtl'){ + max -= parseInt(dw_qsearch.$outObj.css('padding-left')); + too_big = function (l) { return l.offsetLeft < 0; }; + }else{ + max -= parseInt(dw_qsearch.$outObj.css('padding-right')); + too_big = function (l) { return l.offsetWidth + l.offsetLeft > max; }; + } $links.each(function () { var start, length, replace, nsL, nsR, eli, runaway; @@ -106,6 +112,12 @@ var dw_qsearch = { return; } + // make IE's innerText available to W3C conform browsers + if(this.textContent){ + this.__defineGetter__('innerText', function(){ return this.textContent }); + this.__defineSetter__('innerText', function(val){ this.textContent = val }); + } + nsL = this.innerText.indexOf('('); nsR = this.innerText.indexOf(')'); eli = 0; @@ -138,6 +150,9 @@ var dw_qsearch = { nsR = this.innerText.indexOf(')'); } }); + + // reenable overflow + dw_qsearch.$outObj.find('li').css('overflow', 'hidden').css('text-overflow','ellipsis'); } }; |