Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 45823 Details for
Bug 72583
[patch]
Updated patch to include change to string ID in editor.properties
BugFix_72583.txt (text/plain), 9.09 KB, created by
Charles Manske
(
hide
)
Description:
Updated patch to include change to string ID in editor.properties
Filename:
MIME Type:
Creator:
Charles Manske
Size:
9.09 KB
patch
obsolete
>Index: content/EdDialogCommon.js >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdDialogCommon.js,v >retrieving revision 1.97 >diff -u -r1.97 EdDialogCommon.js >--- EdDialogCommon.js 2001/07/24 19:47:27 1.97 >+++ EdDialogCommon.js 2001/08/14 19:02:32 >@@ -1136,4 +1144,137 @@ > ^ldap:|^ldaps:|^gopher:|^finger:|^javascript:/); > } > return false; >+} >+ >+function MakeInputValueRelative(inputID) >+{ >+ var docURL = editorShell.editorDocument.location.href; >+ if (docURL == "about:blank") >+ { >+ editorShell.AlertWithTitle(GetString("Alert"), GetString("SaveToUseRelativeUrl")); >+ window.focus(); >+ } >+ else >+ { >+ var input = document.getElementById(inputID); >+ if (input) >+ input.value = MakeRelativeUrl(input.value); >+ } >+} >+ >+function MakeRelativeUrl(url) >+{ >+ if (!url) >+ return null; >+ >+ url = TrimString(url); >+ >+ // Get the filespec relative to current document's location >+ // NOTE: Can't do this if file isn't saved yet! >+ var docURL = editorShell.editorDocument.location.href; >+ if (docURL != "about:blank") >+ { >+ var CID = Components.classes["@mozilla.org/network/io-service;1"]; >+ var uriService = CID.getService(Components.interfaces.nsIIOService); >+ if (!uriService) >+ return url; >+ >+ var docUri, uri; >+ try { >+ docUri = uriService.newURI(docURL, null); >+ // This will fail if supplied url is not full, proper format >+ uri = uriService.newURI(url, null); >+ } catch(e) {} >+ >+ if (!docURL || !uri) >+ return url; >+ >+ var uriScheme = uri.scheme; >+ if (docUri.scheme == uriScheme) >+ { >+ var docPath = docUri.path; >+ var path = uri.path; >+ // URI always starts with "/" >+ var firstSlash = 0; >+ >+ // Be sure we are on the same drive or volume (don't do for UNIX) >+ if (uriScheme == "file") >+ { >+ var isUNIX = (navigator.appVersion.indexOf("X11") || >+ navigator.appVersion.indexOf("nux")) != -1; >+ if (!isUNIX) >+ { >+ var docVolume = GetVolumeName(docURL); >+ var urlVolume = GetVolumeName(url); >+ if (docVolume.toLowerCase() != urlVolume.toLowerCase()) >+ return url; >+ >+ // Move pointer to after the volume name >+ //firstSlash = + docVolume.length; >+ var nextSlash = docPath.indexOf("\/", docPath.indexOf(docVolume)); >+ docPath = docPath.slice(nextSlash); >+ nextSlash = path.indexOf("\/", path.indexOf(urlVolume)); >+ path = path.slice(nextSlash); >+ } >+ } >+ >+ var siblingLevels = 0; >+ var lastSlash = 0; >+ var dirMatch = false; >+ >+ if (docPath == "\/") >+ { >+ // Special case of document in a root diretory >+ // Simply use everything after initial "/" in URL's path >+ path = path.slice(1); >+ dirMatch = true; >+ } >+ else do { >+ // Look for last slash, starting just before the last character >+ lastSlash = docPath.lastIndexOf("\/", docPath.length-2); >+ if (lastSlash >= firstSlash) >+ { >+ // Remove everything after the '/' >+ docPath = docPath.slice(0, lastSlash+1); >+ >+ var baseIndex = path.search(docPath); >+ if (lastSlash == firstSlash || baseIndex == 0) >+ { >+ // We found a match with base, extract remainder >+ // after last-matching "/" >+ path = path.slice(docPath.length); >+ dirMatch = true; >+ break; >+ } >+ } >+ // Didn't find base, try next subdir down a level >+ siblingLevels++; >+ } >+ while (lastSlash >= firstSlash); >+ >+ if (dirMatch) >+ { >+ while (0 < siblingLevels-- ) >+ path = "../" + path; >+ >+ url = path; >+ } >+ } >+ } >+ >+ return url; >+} >+ >+// Extract string between ":///" and the next "/" >+function GetVolumeName(path) >+{ >+ >+ var start = path.indexOf(":\/\/\/"); >+ if (start >= 0) >+ { >+ var end = path.indexOf("\/", start+4); >+ if (end > start) >+ return path.slice(start+4, end); >+ } >+ return ""; > } >Index: content/EdImageMap.js >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdImageMap.js,v >retrieving revision 1.14 >diff -u -r1.14 EdImageMap.js >--- EdImageMap.js 2001/06/28 13:47:07 1.14 >+++ EdImageMap.js 2001/08/14 19:02:33 >@@ -67,7 +67,7 @@ > //check for relative url > if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ > if (editorShell.editorDocument.location == "about:blank"){ >- alert(GetString("ImapRelative")); >+ alert(GetString("SaveToUseRelativeUrl")); > window.close(); > //TODO: add option to save document now > } >Index: content/EdImageProps.js >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdImageProps.js,v >retrieving revision 1.78 >diff -u -r1.78 EdImageProps.js >--- EdImageProps.js 2001/08/10 22:29:10 1.78 >+++ EdImageProps.js 2001/08/14 19:02:34 >@@ -414,6 +414,7 @@ > wasEnableAll = canEnableOk; > > SetElementEnabledById("ok", canEnableOk ); >+ SetElementEnabledById("MakeRelativeUrl", canEnableOk); > > SetElementEnabledById( "imagemapLabel", canEnableOk ); > //TODO: Restore when Image Map editor is finished >Index: content/EdImageProps.xul >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdImageProps.xul,v >retrieving revision 1.85 >diff -u -r1.85 EdImageProps.xul >--- EdImageProps.xul 2001/08/07 01:53:41 1.85 >+++ EdImageProps.xul 2001/08/14 19:02:35 >@@ -294,6 +292,10 @@ > <!-- buttons along bottom --> > <spring class="spacer"/> > <hbox> >+ <button >+ id = "MakeRelativeUrl" >+ label = "&makeRelativeUrl.label;" >+ oncommand = "MakeInputValueRelative('srcInput')"/> > <spring flex="1"/> > <!-- From EdDialogOverlay --> > <button id="AdvancedEditButton2"/> >Index: content/EdLinkProps.xul >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/content/EdLinkProps.xul,v >retrieving revision 1.65 >diff -u -r1.65 EdLinkProps.xul >--- EdLinkProps.xul 2001/08/13 23:58:02 1.65 >+++ EdLinkProps.xul 2001/08/14 19:02:37 >@@ -75,6 +75,12 @@ > <treecolgroup><treecol flex="1"/></treecolgroup> > </tree> > <text class="label" flex="1" value="&HeadingMsg2.label;"/> >+ <hbox> >+ <spring flex="1"/> >+ <button id="MakeRelativeUrl" label="&makeRelativeUrl.label;" >+ oncommand = "MakeInputValueRelative('hrefInput')"/> >+ <spring flex="1"/> >+ </hbox> > </vbox> > </groupbox> > </vbox> >Index: locale/en-US/EditorImageProperties.dtd >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/locale/en-US/EditorImageProperties.dtd,v >retrieving revision 1.20 >diff -u -r1.20 EditorImageProperties.dtd >--- EditorImageProperties.dtd 2001/08/07 01:53:44 1.20 >+++ EditorImageProperties.dtd 2001/08/14 19:02:38 >@@ -70,6 +70,8 @@ > <!ENTITY topBottomEditField.label "Top and Bottom:"> > <!ENTITY borderEditField.label "Solid Border:"> > >+<!ENTITY makeRelativeUrl.label "Make URL Relative to Page Location"> >+ > <!-- These controls may be added some day; currently not used --> > <!ENTITY makePageBackgroundCheckbox.label "Make Page Background"> > <!ENTITY makePageBackgroundCheckbox.tooltip "Use image as background for your page"> >Index: locale/en-US/EditorLinkProperties.dtd >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/dialogs/locale/en-US/EditorLinkProperties.dtd,v >retrieving revision 1.11 >diff -u -r1.11 EditorLinkProperties.dtd >--- EditorLinkProperties.dtd 2000/08/11 03:20:45 1.11 >+++ EditorLinkProperties.dtd 2001/08/14 19:02:38 >@@ -28,3 +28,4 @@ > <!ENTITY HeadingMsg.label "or select a Heading:"> > <!ENTITY HeadingMsg2.label "(A named anchor will be created automatically)"> > <!ENTITY RemoveLinkMsg.label "(Clear text to remove existing link from page.)"> >+<!ENTITY makeRelativeUrl.label "Make Link Relative to Page Location"> >Index: editor.properties >=================================================================== >RCS file: /cvsroot/mozilla/editor/ui/composer/locale/en-US/editor.properties,v >retrieving revision 1.54 >diff -u -r1.54 editor.properties >--- editor.properties 2001/08/07 21:39:06 1.54 >+++ editor.properties 2001/08/14 19:40:21 >@@ -93,7 +93,7 @@ > HideToolbar=Hide Toolbar > ImapError=Unable to load image > ImapCheck=\nPlease select a new location (URL) and try again. >-ImapRelative=Relative URLs can only be used on documents which have been saved >+SaveToUseRelativeUrl=Relative URLs can only be used on pages which have been saved > NoNamedAnchors=(No named anchors in this page) > NoHeadings=(No headings without anchors) > TextColor=Text Color
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 72583
:
36844
|
37666
|
37667
|
37697
|
45822
|
45823
|
47458
|
47555
|
47605
|
47655
|
47658
|
47663
|
47775
|
48543
|
48589
|
49148
|
50046
|
50173
|
50174