src/eric7/WebBrowser/data/html/speeddialPage.html

branch
eric7
changeset 9678
32ddecc54baf
parent 9209
b99e7fd55fd3
child 9682
e89a7f82ca92
--- a/src/eric7/WebBrowser/data/html/speeddialPage.html	Thu Jan 05 11:24:18 2023 +0100
+++ b/src/eric7/WebBrowser/data/html/speeddialPage.html	Fri Jan 06 14:45:32 2023 +0100
@@ -138,6 +138,7 @@
     margin-left: auto;
     margin-right: auto;
     margin-top: 15px;
+    color: #ffffff;
 }
 .formTable input[type="text"] {
     width: 100%;
@@ -293,9 +294,9 @@
     var boxUrl = $(box).children('a').first().attr('href');
     var boxTitle = escapeTitle($(box).children('span').first().text());
     if (boxUrl === '')
-        boxUrl = 'http://';
+        boxUrl = 'https://';
 
-    $('body').append('<div id="fadeOverlay" style="opacity:0.9;display:none;position:fixed;left:0;' +
+    $('body').append('<div id="fadeOverlay" style="opacity:1.0;display:none;position:fixed;left:0;' +
                      'top:0;width:100%;height:100%;z-index:9999;background:#85784A;">' +
                      '<div id="overlay-edit" onkeypress="return onEditKeyPress(event)">' +
                      '<img src="' + $(box).children('img').first().attr('src') + '"> ' +
@@ -333,12 +334,12 @@
     if (editingId == -1)
         return;
 
-    external.speedDial.urlFromUserInput($('#formUrl').attr("value"), function(newUrl) {
+    external.speedDial.urlFromUserInput($('#formUrl').val(), function(newUrl) {
         var box = document.getElementById('quickdial').getElementsByTagName('div')[editingId];
         var a = box.getElementsByTagName('a')[0];
         var originalUrl = a.getAttribute('href');
         setBoxUrl(editingId, newUrl);
-        setBoxTitle(editingId, $('#formTitle').attr("value"));
+        setBoxTitle(editingId, $('#formTitle').val());
         var changedUrl = a.getAttribute('href');
         var fetchTitleChecked = document.getElementById('fetchTitle').checked;
 
@@ -351,8 +352,8 @@
             $('#fadeOverlay').fadeOut("slow", function() {
                 $("#fadeOverlay").remove();
             });
-                external.speedDial.loadThumbnail(a.getAttribute('href'), fetchTitleChecked);
-                external.speedDial.removeImageForUrl(a.getAttribute('href'));
+            external.speedDial.loadThumbnail(a.getAttribute('href'), fetchTitleChecked);
+            external.speedDial.removeImageForUrl(a.getAttribute('href'));
         } else {
             hideEditBox();
         }
@@ -384,6 +385,7 @@
     a.setAttribute('class', 'boxUrl');
     var span1 = document.createElement('span');
     span1.setAttribute('class', 'boxTitle');
+    span1.setAttribute('title', unescapeTitle(title));
     span1.innerText = unescapeTitle(title);
     var span2 = document.createElement('span');
     span2.setAttribute('class', 'edit');
@@ -444,7 +446,8 @@
         }
     }
 
-    emitChanged(allPages());
+    if (changed)
+      emitChanged(allPages());
 }
 
 function setImageToUrl(url, img_source) {
@@ -452,7 +455,7 @@
     $(aElement).each(function() {
         var box = $(this).parent();
         var imgElement = $(box).children("img").first();
-        if ($(imgElement).size() == 0)
+        if ($(imgElement).size == 0)
             return;
 
         $(imgElement).attr('src', img_source);
@@ -492,14 +495,16 @@
 }
 
 function alignPage() {
-    $('head').append('<style>#quickdial img[src*=".png"]{height:auto;width:'+DIAL_WIDTH+'px}</style>');
-    $('#quickdial div.entry').css({'width' : DIAL_WIDTH + 'px',
-                                   'height' : Math.round(DIAL_WIDTH / 1.54) + 'px'});
+    var dialWidth = parseInt(DIAL_WIDTH);
+    var dialHeight = Math.floor(Math.round(dialWidth / 1.54));
+    $('head').append('<style>#quickdial img[src*=".png"]{height:auto;width:'+dialWidth+'px}</style>');
+    $('#quickdial div.entry').css({'width' : dialWidth + 'px',
+                                   'height' : dialHeight + 'px'});
 
     var width = $(window).width();
     var height = $(window).height();
-    var boxWidth = Math.floor(DIAL_WIDTH + 30);
-    var boxHeight = Math.floor(Math.round(DIAL_WIDTH / 1.54) + 40);
+    var boxWidth = Math.floor(dialWidth + 30);
+    var boxHeight = dialHeight + 40;
 
     var maxBoxes = Math.floor(width / boxWidth);
     if (maxBoxes > MAX_PAGES_ROW) maxBoxes = MAX_PAGES_ROW;
@@ -508,10 +513,9 @@
     var maxwidth = maxBoxes * boxWidth;
     $("#quickdial").css('width', maxwidth + 'px');
 
-    var boxesCount = $("#quickdial").children("div").size();
+    var boxesCount = $("#quickdial").children("div").length;
     var rows = Math.ceil(boxesCount / maxBoxes);
     var margintop = (height - rows * boxHeight) / 2;
-
     if (margintop < 0) margintop = 0;
 
     $("#quickdial").css('margin-top', margintop + 'px');
@@ -533,8 +537,8 @@
     var SdSizeSl = document.getElementById('sliderValueSd');
 
     SdSize.disabled = (check.checked ? false : true);
-    SdSize.value = (check.checked ? SdSize.value : 231);
-    SdSizeSl.innerHTML = (check.checked ? DIAL_WIDTH : 231);
+    SdSize.value = (check.checked ? SdSize.value : 240);
+    SdSizeSl.innerHTML = (check.checked ? DIAL_WIDTH : 240);
 }
 
 function configureSpeedDial() {

eric ide

mercurial