nlopess         Wed Mar 16 13:04:13 2005 EDT

  Added files:                 
    /phpdoc/htmlhelp/suppfiles/notes    _notes_script.js 

  Modified files:              
    /phpdoc/htmlhelp    user_notes.php 
    /phpdoc/htmlhelp/suppfiles/html     _script.js 
    /phpdoc/htmlhelp/suppfiles/skins/phpZ       skin.js 
  Log:
  fix #31825: notes not skinned when searching
  main patch by Richard Quadling
  new version for Derick: http://mega.ist.utl.pt/~ncpl/php_manual_chm.zip
  
http://cvs.php.net/diff.php/phpdoc/htmlhelp/user_notes.php?r1=1.2&r2=1.3&ty=u
Index: phpdoc/htmlhelp/user_notes.php
diff -u phpdoc/htmlhelp/user_notes.php:1.2 phpdoc/htmlhelp/user_notes.php:1.3
--- phpdoc/htmlhelp/user_notes.php:1.2  Sat Sep  6 12:12:18 2003
+++ phpdoc/htmlhelp/user_notes.php      Wed Mar 16 13:04:11 2005
@@ -90,6 +90,10 @@
 copy("suppfiles/notes/_style.css", "$NOTES_TARGET/_style.css");
 fwrite($nproject, "_style.css\n");
 
+// RAQ : Wednesday, 16 March 2005 01:54 pm : Allow all note pages to have a 
global JavaScript file.
+copy('suppfiles/notes/_notes_script.js', "$NOTES_TARGET/_notes_script.js");
+fwrite($nproject, "_notes_script.js\n");
+
 // Write out a list of files to work around an IE6 bug
 $jsfile = fopen("$NOTES_TARGET/_filelist.js", "w");
 fwrite($jsfile, "note_file_list = ' " . join(" ", $NOTE_FILE_LIST) . " 
';\n\n");
@@ -165,13 +169,15 @@
     }
     
     // start HTML output
+    // RAQ : Wednesday, 16 March 2005 01:54 pm : Allow all note pages to have 
a global JavaScript file and use new notesLoading() function for body's onLoad.
     $notehtml = <<<END_OF_MULTI
 <html>
 <head>
   <title>N: $title</title>
   <link rel="stylesheet" href="_style.css">
+  <script language="JavaScript1.2" src="_notes_script.js"></script>
 </head>
-<body onLoad="if(parent.nbuff) {parent.displayNotes()}">
+<body onLoad="if(parent.nbuff) {parent.displayNotes();} else 
{loadWithNotes();}">
 
 <h3>User contributed notes:</h3>
 END_OF_MULTI;
http://cvs.php.net/diff.php/phpdoc/htmlhelp/suppfiles/html/_script.js?r1=1.7&r2=1.8&ty=u
Index: phpdoc/htmlhelp/suppfiles/html/_script.js
diff -u phpdoc/htmlhelp/suppfiles/html/_script.js:1.7 
phpdoc/htmlhelp/suppfiles/html/_script.js:1.8
--- phpdoc/htmlhelp/suppfiles/html/_script.js:1.7       Tue Nov  9 09:40:53 2004
+++ phpdoc/htmlhelp/suppfiles/html/_script.js   Wed Mar 16 13:04:13 2005
@@ -74,8 +74,27 @@
         chmfile_page = unescape(location.href.substring(Y+3));
     }
 
-    //alert(location.href+"\n\n"+"fullname="+chmfile_fullname+"\n"+"path="+
-    //chmfile_path+"\n"+"name="+chmfile_name+"\n"+"page="+chmfile_page);
+    // RAQ : Wednesday, 16 March 2005 01:56 pm : If this page has been loaded 
because the notes were selected from the search results, then remove the hash.
+    if (location.hash == '#userNotes')
+        chmfile_page = chmfile_page.substring(0, 
chmfile_page.lastIndexOf('#'));
+
+    //alert(
+    // "_script\n\n" +
+    // "location\n"+
+    // "location.hash = '" + location.hash + "'\n" +
+    // "location.host = '" + location.host + "'\n" +
+    // "location.hostname = '" + location.hostname + "'\n" +
+    // "location.href = '" + location.href + "'\n" +
+    // "location.pathname = '" + location.pathname + "'\n" +
+    // "location.port = '" + location.port + "'\n" +
+    // "location.protocol = '" + location.protocol + "'\n" +
+    // "location.search = '" + location.search + "'\n\n" +
+    // "chmfile\n"+
+    // "chmfile_name = '" + chmfile_name + "'\n" +
+    // "chmfile_path = '" + chmfile_path + "'\n" +
+    // "chmfile_page = '" + chmfile_page + "'\n"
+    // );
+ 
 }
 
 // 
=============================================================================
@@ -125,6 +144,11 @@
     // If we have that element, copy notes here [4+]
     if (element) {
         element.innerHTML = parent.nbuff.document.body.innerHTML;
+        // RAQ : Wednesday, 16 March 2005 01:58 pm : Bring the notes into view 
if the hash has been supplied
+        if (location.hash == '#userNotes')
+            {
+            setTimeout('element.scrollIntoView(true);',200);
+            }
     } else {
         alert("Error in user note inclusion");
     }
http://cvs.php.net/diff.php/phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js?r1=1.3&r2=1.4&ty=u
Index: phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js
diff -u phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js:1.3 
phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js:1.4
--- phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js:1.3    Mon Feb 21 15:20:38 2005
+++ phpdoc/htmlhelp/suppfiles/skins/phpZ/skin.js        Wed Mar 16 13:04:13 2005
@@ -38,6 +38,9 @@
        //showPageCode();
        // RAQ : Thursday, 17 February 2005 02:20 pm : Force focus to document 
to allow access keys to function.
        document.focus();
+       // RAQ : Wednesday, 16 March 2005 01:58 pm : Force notes to be 
displayed if hash has been provided.
+       if (location.hash == '#userNotes')
+               showTabPane('pageNotes');
 }
 
 // shows the current page source code (after DHTML) in a separate window

http://cvs.php.net/co.php/phpdoc/htmlhelp/suppfiles/notes/_notes_script.js?r=1.1&p=1
Index: phpdoc/htmlhelp/suppfiles/notes/_notes_script.js
+++ phpdoc/htmlhelp/suppfiles/notes/_notes_script.js
// RAQ : Tuesday, 15 March 2005 03:20 pm : Allow notes from searches to call 
the original manual page and get the notes skinned.
// Get the path and name of the CHM file and assign values
function loadWithNotes() {
        var a, X, Y, Z;
        a = location.href.search(/:/);
        Y = location.href.lastIndexOf("::");

        if (a == 4) {  // file: or http:
                Y = location.href.lastIndexOf("/");
                chmfile_page = unescape(location.href.substring(Y+1));
                if (location.href.substring(0,4) == "file")
                        chmfile_path = unescape(location.href.substring(8, 
Y+1));
        } else {
                if (a == 2)
                        X = 14; // mk:@MSITStore:
                if (a == 7)
                        X = 7;  // ms-its:

                chmfile_fullname = unescape(location.href.substring(X, Y));
                Z = chmfile_fullname.lastIndexOf("\\");
                chmfile_path = unescape(chmfile_fullname.substring(0, Z+1));
                chmfile_name = unescape(chmfile_fullname.substring(Z+1));
                chmfile_page = unescape(location.href.substring(Y+3));
        }
 
 //alert(
 // "_notes_script\n\n" +
 // "location\n"+
 // "location.hash = '" + location.hash + "'\n" +
 // "location.host = '" + location.host + "'\n" +
 // "location.hostname = '" + location.hostname + "'\n" +
 // "location.href = '" + location.href + "'\n" +
 // "location.pathname = '" + location.pathname + "'\n" +
 // "location.port = '" + location.port + "'\n" +
 // "location.protocol = '" + location.protocol + "'\n" +
 // "location.search = '" + location.search + "'\n\n" +
 // "chmfile\n"+
 // "chmfile_name = '" + chmfile_name + "'\n" +
 // "chmfile_path = '" + chmfile_path + "'\n" +
 // "chmfile_page = '" + chmfile_page + "'\n"
 // );
 
        location = location.protocol + '@MSITStore:' + chmfile_path + 
'php_manual_en.chm::/' + chmfile_page + '#userNotes';
}

Reply via email to