diff --git a/browser/components/bookmarks/content/bookmarksProperties.js b/browser/components/bookmarks/content/bookmarksProperties.js index 84b5aebf4ae..ac3d227f408 100644 --- a/browser/components/bookmarks/content/bookmarksProperties.js +++ b/browser/components/bookmarks/content/bookmarksProperties.js @@ -97,79 +97,6 @@ function Init() var nameNode = document.getElementById("name"); document.title = document.title.replace(/\*\*bm_title\*\*/gi, nameNode.value); - // check bookmark schedule - var scheduleArc = RDF.GetResource(gWEB_NS+"Schedule"); - value = BMDS.GetTarget(gResource, scheduleArc, true); - - if (value) { - value = value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; - - if (value) { - var values = value.split("|"); - if (values.length == 4) { - // get day range - var days = values[0]; - var dayNode = document.getElementById("dayRange"); - var dayItems = dayNode.childNodes[0].childNodes; - for (x=0; x < dayItems.length; ++x) { - if (dayItems[x].getAttribute("value") == days) { - dayNode.selectedItem = dayItems[x]; - break; - } - } - - // get hour range - var hours = values[1].split("-"); - var startHour = ""; - var endHour = ""; - - if (hours.length == 2) { - startHour = hours[0]; - endHour = hours[1]; - } - - // set start hour - var startHourNode = document.getElementById("startHourRange"); - var startHourItems = startHourNode.childNodes[0].childNodes; - for (x=0; x < startHourItems.length; ++x) { - if (startHourItems[x].getAttribute("value") == startHour) { - startHourNode.selectedItem = startHourItems[x]; - break; - } - } - - // set end hour - var endHourNode = document.getElementById("endHourRange"); - var endHourItems = endHourNode.childNodes[0].childNodes; - for (x=0; x < endHourItems.length; ++x) { - if (endHourItems[x].getAttribute("value") == endHour) { - endHourNode.selectedItem = endHourItems[x]; - break; - } - } - - // get duration - var duration = values[2]; - var durationNode = document.getElementById("duration"); - durationNode.value = duration; - - // get notification method - var method = values[3]; - if (method.indexOf("icon") >= 0) - document.getElementById("bookmarkIcon").checked = true; - - if (method.indexOf("sound") >= 0) - document.getElementById("playSound").checked = true; - - if (method.indexOf("alert") >= 0) - document.getElementById("showAlert").checked = true; - - if (method.indexOf("open") >= 0) - document.getElementById("openWindow").checked = true; - } - } - } - // if its a container, disable some things var isContainerFlag = RDFCU.IsContainer(BMDS, gResource); if (!isContainerFlag) { @@ -202,29 +129,8 @@ function Init() document.getElementById("feedurlrow").hidden = true; } - var showScheduling = false; - var url = BMDS.GetTarget(gResource, gProperties[1], true); - if (url) { - url = url.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; - if (!url || - url.substr(0,7).toLowerCase() == "http://" || - url.substr(0,8).toLowerCase() == "https://") - showScheduling = true; - } - - // always hide the scheduling/notification tabs; - // we're diabling scheduling for 1.0 (bug 253478) - //if (!showScheduling || isLivemark) { - // only allow scheduling of http/https URLs that are not livemarks - document.getElementById("ScheduleTab").setAttribute("hidden", "true"); - document.getElementById("NotifyTab").setAttribute("hidden", "true"); - //} - sizeToContent(); - // Set up the enabled of controls on the scheduling panels - dayRangeChange(document.getElementById("dayRange")); - // set initial focus nameNode.focus(); nameNode.select(); @@ -276,61 +182,6 @@ function Commit() } } - // Update bookmark schedule if necessary; - // if the tab was removed, just skip it - var scheduleTab = document.getElementById("ScheduleTab"); - if (scheduleTab) { - var scheduleArc = RDF.GetResource(gWEB_NS+"Schedule"); - oldValue = BMDS.GetTarget(gResource, scheduleArc, true); - newValue = null; - var dayRangeNode = document.getElementById("dayRange"); - var dayRange = dayRangeNode.selectedItem.getAttribute("value"); - - if (dayRange) { - var startHourRangeNode = document.getElementById("startHourRange"); - var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); - - var endHourRangeNode = document.getElementById("endHourRange"); - var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); - - if (parseInt(startHourRange) > parseInt(endHourRange)) { - var temp = startHourRange; - startHourRange = endHourRange; - endHourRange = temp; - } - - var duration = document.getElementById("duration").value; - if (!duration) { - alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); - return false; - } - - var methods = []; - if (document.getElementById("bookmarkIcon").checked) - methods.push("icon"); - if (document.getElementById("playSound").checked) - methods.push("sound"); - if (document.getElementById("showAlert").checked) - methods.push("alert"); - if (document.getElementById("openWindow").checked) - methods.push("open"); - - if (methods.length == 0) { - alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); - return false; - } - - var method = methods.join(); // join string in array with "," - - newValue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; - } - - if (newValue) - newValue = RDF.GetLiteral(newValue); - - changed |= updateAttribute(scheduleArc, oldValue, newValue); - } - if (changed) { var remote = BMDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) @@ -355,44 +206,3 @@ function updateAttribute(aProperty, aOldValue, aNewValue) } return false; } - -function setEndHourRange() -{ - // Get the values of the start-time and end-time as ints - var startHourRangeNode = document.getElementById("startHourRange"); - var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); - var startHourRangeInt = parseInt(startHourRange); - - var endHourRangeNode = document.getElementById("endHourRange"); - var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); - var endHourRangeInt = parseInt(endHourRange); - - var endHourItemNode = endHourRangeNode.firstChild.firstChild; - - // disable all those end-times before the start-time - for (var index=0; index= endHourRangeInt) - endHourRangeNode.selectedItem = endHourItemNode; - - // make sure all the end-times after the start-time are enabled - for (; index < 24; ++index) { - endHourItemNode.removeAttribute("disabled"); - endHourItemNode = endHourItemNode.nextSibling; - } -} - -function dayRangeChange (aMenuList) -{ - var controls = ["startHourRange", "endHourRange", "duration", "bookmarkIcon", - "showAlert", "openWindow", "playSound", "durationSubLabel", - "durationLabel", "startHourRangeLabel", "endHourRangeLabel"]; - for (var i=0; i - + diff --git a/browser/locales/en-US/chrome/browser/bookmarks/bookmarksProperties.dtd b/browser/locales/en-US/chrome/browser/bookmarks/bookmarksProperties.dtd index 1e1ec5fd9c3..df68eac538c 100644 --- a/browser/locales/en-US/chrome/browser/bookmarks/bookmarksProperties.dtd +++ b/browser/locales/en-US/chrome/browser/bookmarks/bookmarksProperties.dtd @@ -41,17 +41,6 @@ - - - - - - - - - - - @@ -59,53 +48,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -