summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-09-30 13:25:45 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-09-30 13:25:45 (GMT)
commit70fd09b335f60be7b68f258c47abe2bb092d5775 (patch)
treecef95cddc6adad7d7efb2adb74e423e43ba04322 /doc
parent6700a9f41692912f221fac55e4cae1809549fa13 (diff)
parent8c65dc25962e167237c2573979b1dfff88c29326 (diff)
downloadQt-70fd09b335f60be7b68f258c47abe2bb092d5775.zip
Qt-70fd09b335f60be7b68f258c47abe2bb092d5775.tar.gz
Qt-70fd09b335f60be7b68f258c47abe2bb092d5775.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'doc')
-rw-r--r--doc/src/declarative/examples.qdoc2
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc18
-rw-r--r--doc/src/development/qmake-manual.qdoc3
-rw-r--r--doc/src/getting-started/examples.qdoc50
-rw-r--r--doc/src/painting-and-printing/printing.qdoc11
-rw-r--r--doc/src/snippets/widgetprinting.cpp93
-rwxr-xr-xdoc/src/template/scripts/functions.js268
-rw-r--r--doc/src/template/scripts/narrow.js108
-rw-r--r--doc/src/template/style/narrow.css13
-rwxr-xr-xdoc/src/template/style/style.css102
10 files changed, 472 insertions, 196 deletions
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 9929cfe..3f075bb 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -28,7 +28,7 @@
/*!
\page qdeclarativeexamples.html
\title QML Examples and Demos
- \brief Building UI's with QML
+ \brief Building UIs with QML
\ingroup all-examples
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
index ea21852..64c312c 100644
--- a/doc/src/declarative/qdeclarativedebugging.qdoc
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -79,20 +79,8 @@ QDeclarativeImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
\section1 Debugging with Qt Creator
\l{http://qt.nokia.com/products/developer-tools}{Qt Creator} provides built-in
-support for QML debugging. Open a QML project in Creator and enter Debug mode,
-or click the "Start Debugging" option from the menu, and Creator will
-show QML debugging information and options for your application, including
-object inspection, property monitoring and application frame-rate analysis.
-
-Creator can be used to debug both local and remote QML applications. To
-enable remote debugging, start the \l {QML Viewer}
-on the remote device with a debugging port defined, like this:
-
-\code
- QML_DEBUG_SERVER_PORT=3768 qmlviewer myqmlfile.qml
-\endcode
-
-In Creator, open the project settings pane and set the server and port
-details for the remote device, then start debugging.
+support for QML debugging. QML projects and standalone C++ applications that
+utilize QML can be debugged on desktops as well as on remote devices.
+For more information, see the Qt Creator Manual.
*/
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index f4becf8..754b8ad 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1602,6 +1602,9 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 36
+ Note that \c qmake will skip files that are executable. If you need to install
+ executable files, you can unset the files' executable flags.
+
\target LEXIMPLS
\section1 LEXIMPLS
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index e8c85e6..a5f3446 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -273,7 +273,7 @@
\page examples-painting.html
\ingroup all-examples
\title Painting Examples
- \brief How to use the Qt painting system
+ \brief How to use the Qt painting system.
\image painting-examples.png
@@ -303,7 +303,7 @@
\page examples-richtext.html
\ingroup all-examples
\title Rich Text Examples
- \brief Using the document-oriented rich text engine
+ \brief Using the document-oriented rich text engine.
\image richtext-examples.png
@@ -324,7 +324,7 @@
\page examples-desktop.html
\ingroup all-examples
\title Desktop Examples
- \brief Integrating your Qt application with your favorite desktop
+ \brief Integrating your Qt application with your favorite desktop.
\image desktop-examples.png
@@ -371,7 +371,7 @@
\page examples-threadandconcurrent.html
\ingroup all-examples
\title Threading and Concurrent Programming Examples
- \brief Threading and concurrent programming in Qt
+ \brief Threading and concurrent programming in Qt.
\image thread-examples.png
@@ -409,7 +409,7 @@
\page examples.tools.html
\ingroup all-examples
\title Tools Examples
- \brief Using Qt's containers, iterators, and other tool classes
+ \brief Using Qt's containers, iterators, and other tool classes.
\image tool-examples.png
@@ -445,7 +445,7 @@
\page examples-network.html
\ingroup all-examples
\title Network Examples
- \brief How to do network programming in Qt
+ \brief How to do network programming in Qt.
\image network-examples.png
@@ -482,7 +482,7 @@
\page examples-ipc.html
\ingroup all-examples
\title IPC Examples
- \brief Inter-Process Communication with Qt
+ \brief Inter-Process Communication with Qt.
\image ipc-examples.png
@@ -497,7 +497,7 @@
\page examples-opengl.html
\ingroup all-examples
\title OpenGL Examples
- \brief Accessing OpenGL from Qt
+ \brief Accessing OpenGL from Qt.
\image opengl-examples.png
@@ -529,7 +529,7 @@
\page examples-openvg.html
\ingroup all-examples
\title OpenVG Examples
- \brief Accessing OpenVG from Qt
+ \brief Accessing OpenVG from Qt.
\image opengl-examples.png
@@ -548,7 +548,7 @@
\page examples-multimedia.html
\ingroup all-examples
\title Multimedia Examples
- \brief Audio, video, and Phonon with Qt
+ \brief Audio, video, and Phonon with Qt.
\image phonon-examples.png
@@ -595,7 +595,7 @@
\page examples-sql.html
\ingroup all-examples
\title SQL Examples
- \brief Accessing your SQL database from Qt
+ \brief Accessing your SQL database from Qt.
\image sql-examples.png
@@ -623,7 +623,7 @@
\page examples-xml.html
\ingroup all-examples
\title XML Examples
- \brief Using XML with Qt
+ \brief Using XML with Qt.
\image xml-examples.png XML
@@ -658,7 +658,7 @@
\page examples-designer.html
\ingroup all-examples
\title Qt Designer Examples
- \brief Using Qt Designer to build your UI
+ \brief Using Qt Designer to build your UI.
\image designer-examples.png QtDesigner
@@ -681,7 +681,7 @@
\page examples-uitools.html
\ingroup all-examples
\title UiTools Examples
- \brief Using the QtUiTools module
+ \brief Using the QtUiTools module.
\image uitools-examples.png UiTools
@@ -695,7 +695,7 @@
\page examples-linguist.html
\ingroup all-examples
\title Qt Linguist Examples
- \brief Using Qt Linguist to internationalize your Qt application
+ \brief Using Qt Linguist to internationalize your Qt application.
\image linguist-examples.png
@@ -713,7 +713,7 @@
\page examples-script.html
\ingroup all-examples
\title Qt Script Examples
- \brief Using the Qt scripting environment
+ \brief Using the Qt scripting environment.
\image qtscript-examples.png QtScript
@@ -740,7 +740,7 @@
\page examples-webkit.html
\ingroup all-examples
\title WebKit Examples
- \brief Using WebKit in your Qt application
+ \brief Using WebKit in your Qt application.
\image webkit-examples.png WebKit
@@ -779,7 +779,7 @@
\page examples-helpsystem.html
\ingroup all-examples
\title Help System Examples
- \brief Adding interactive help to your Qt application
+ \brief Adding interactive help to your Qt application.
\image assistant-examples.png HelpSystem
@@ -800,7 +800,7 @@
\page examples-statemachine.html
\ingroup all-examples
\title State Machine Examples
- \brief Using Qt's finite state machine classes
+ \brief Using Qt's finite state machine classes.
\image statemachine-examples.png StateMachine
@@ -824,7 +824,7 @@
\page examples-animation.html
\ingroup all-examples
\title Animation Framework Examples
- \brief Doing animations with Qt
+ \brief Doing animations with Qt.
\image animation-examples.png Animation
@@ -844,7 +844,7 @@
\page examples-touch.html
\ingroup all-examples
\title Touch Input Examples
- \brief Using Qt's touch input capability
+ \brief Using Qt's touch input capability.
Support for touch input makes it possible for developers to create
extensible and intuitive user interfaces.
@@ -861,7 +861,7 @@
\page examples-gestures.html
\ingroup all-examples
\title Gestures Examples
- \brief Gesture programming examples
+ \brief Gesture programming examples.
The API of the gesture framework is not yet finalized and
still subject to change.
@@ -875,7 +875,7 @@
\page examples-dbus.html
\ingroup all-examples
\title D-Bus Examples
- \brief Using D-Bus from Qt applications
+ \brief Using D-Bus from Qt applications.
\list
\o \l{dbus/dbus-chat}{Chat}
@@ -892,7 +892,7 @@
\page examples-embeddedlinux.html
\ingroup all-examples
\title Qt for Embedded Linux Examples
- \brief Using Qt in Embedded Linux
+ \brief Using Qt in Embedded Linux.
\image qt-embedded-examples.png QtEmbedded
@@ -912,7 +912,7 @@
\page examples-activeqt.html
\ingroup all-examples
\title ActiveQt Examples
- \brief Using ActiveX from Qt applications
+ \brief Using ActiveX from Qt applications.
\image activeqt-examples.png ActiveQt
diff --git a/doc/src/painting-and-printing/printing.qdoc b/doc/src/painting-and-printing/printing.qdoc
index 62c8192..97cd92f 100644
--- a/doc/src/painting-and-printing/printing.qdoc
+++ b/doc/src/painting-and-printing/printing.qdoc
@@ -136,6 +136,17 @@
used is constructed using the form of the constructor that accepts a
QPaintDevice argument.
+ \section1 Printing Widgets
+
+ To print a widget, you can use the QWidget::render() function. As mentioned,
+ the printer's resolution is usually higher than the screen resolution, so you
+ will have to scale the painter. You may also want to position the widget on the
+ page. The following code sample shows how this may look.
+
+ \snippet doc/src/snippets/widgetprinting.cpp 0
+
+ This will center the widget on the page and scale it so that it fits the page.
+
\section1 Printing from Complex Widgets
Certain widgets, such as QTextEdit and QGraphicsView, display rich content
diff --git a/doc/src/snippets/widgetprinting.cpp b/doc/src/snippets/widgetprinting.cpp
new file mode 100644
index 0000000..47839d8
--- /dev/null
+++ b/doc/src/snippets/widgetprinting.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+class Window : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Window() {
+ myWidget = new QPushButton("Print Me");
+ connect(myWidget, SIGNAL(clicked()), this, SLOT(print()));
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(myWidget);
+ setLayout(layout);
+ }
+
+private slots:
+ void print() {
+ QPrinter printer(QPrinter::HighResolution);
+
+ printer.setOutputFileName("test.pdf");
+
+//! [0]
+ QPainter painter;
+ painter.begin(&printer);
+ double xscale = printer.pageRect().width()/double(myWidget->width());
+ double yscale = printer.pageRect().height()/double(myWidget->height());
+ double scale = qMin(xscale, yscale);
+ painter.translate(printer.paperRect().x() + printer.pageRect().width()/2,
+ printer.paperRect().y() + printer.pageRect().height()/2);
+ painter.scale(scale, scale);
+ painter.translate(-width()/2, -height()/2);
+
+ myWidget->render(&painter);
+//! [0]
+ }
+
+private:
+ QPushButton *myWidget;
+};
+
+int main(int argv, char **args)
+{
+ QApplication app(argv, args);
+
+ Window window;
+ window.show();
+
+ return app.exec();
+}
+
+#include "main.moc"
+
diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js
index faa4ca4..0bb88a8 100755
--- a/doc/src/template/scripts/functions.js
+++ b/doc/src/template/scripts/functions.js
@@ -1,38 +1,57 @@
+// Removing search results
+function hideSearchResults() {
+/* hiding search results as the user clicks on the different categories */
+ $('#resultdialog').removeClass('active');
+ $("#resultlist").removeClass().addClass('all');
+ $("#resultlinks").removeClass().addClass('all');
+ $("#searchcount").removeClass().addClass('all');
+}
+/* closing the searhc result dialog */
+$('#resultclose').click(function(e) {
+ e.preventDefault();
+ hideSearchResults();
+});
+
+$(document.body).click(function() {
+});
+
/* START non link areas where cursor should change to pointing hand */
$('.t_button').mouseover(function() {
$('.t_button').css('cursor','pointer');
- /*document.getElementById(this.id).style.cursor='pointer';*/
});
/* END non link areas */
+/* Changing font size to smaller */
$('#smallA').click(function() {
- $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller');
+ $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
+/* Reset font size */
$('#medA').click(function() {
- $('.content .heading').css('font','600 16px/1 Arial');
- $('.content h1').css('font','600 18px/1.2 Arial');
- $('.content h2').css('font','600 16px/1.2 Arial');
- $('.content h3').css('font','600 14px/1.2 Arial');
- $('.content p').css('font','13px/20px Verdana');
- $('.content li').css('font','400 13px/1 Verdana');
- $('.content li').css('line-height','14px');
- $('.content .toc li').css('font', 'normal 10px/1.2 Verdana');
- $('.content table').css('font','13px/1.2 Verdana');
- $('.content .heading').css('font','600 16px/1 Arial');
- $('.content .indexboxcont li').css('font','600 13px/1 Verdana');
+ $('.mainContent .heading').css('font','600 16px/1 Arial');
+ $('.mainContent h1').css('font','600 18px/1.2 Arial');
+ $('.mainContent h2').css('font','600 16px/1.2 Arial');
+ $('.mainContent h3').css('font','600 14px/1.2 Arial');
+ $('.mainContent p').css('font','13px/20px Verdana');
+ $('.mainContent li').css('font','400 13px/1 Verdana');
+ $('.mainContent li').css('line-height','14px');
+ $('.mainContent .toc li').css('font', 'normal 10px/1.2 Verdana');
+ $('.mainContent table').css('font','13px/1.2 Verdana');
+ $('.mainContent .heading').css('font','600 16px/1 Arial');
+ $('.mainContent .indexboxcont li').css('font','600 13px/1 Verdana');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
-
+/* Changing font size to bigger */
$('#bigA').click(function() {
- $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large');
- $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px');
+ $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large');
+ $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px');
$('.t_button').removeClass('active')
$(this).addClass('active')
});
+/* Show page content after closing feedback box */
$('.feedclose').click(function() {
$('.bd').show();
$('.hd').show();
@@ -41,6 +60,7 @@ $('.feedclose').click(function() {
$('#blurpage').hide();
});
+/* Hide page content and show feedback box */
$('.feedback').click(function() {
$('.bd').hide();
$('.hd').hide();
@@ -48,75 +68,117 @@ $('.feedback').click(function() {
$('#feedbackBox').show();
$('#blurpage').show();
});
-var lookupCount = 0;
-var articleCount = 0;
-var exampleCount = 0;
-var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links
+/* Default search URL */
+var qturl = "";
+
+/* The next function handles the response data (in xml) returned by the search engine */
+
+// Process data sent back from the server. The data is structured as a XML.
+/*
+XML structure handled by function processNokiaData()
+<page> - container for each page returned
+<pageWords/> - contains keywords
+<pageTitle/> - contains page title/header content
+<pageUrl/> - contains page URL - URL relative to root
+<pageType> - contains page type - APIPage/Article/Example
+</page>
+*/
+
function processNokiaData(response){
+/* fetch the responce from the server using page as the root element */
var propertyTags = response.getElementsByTagName('page');
-
- for (var i=0; i< propertyTags.length; i++) {
- var linkStart = "<li class=\"liveResult\"><a href='"+qturl+"";
- var linkEnd = "</a></li>";
-
- if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){
- lookupCount++;
-
- for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
- full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
- full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd;
- $('#ul001').append(full_li_element);
- $('#ul001 .defaultLink').css('display','none');
-
- }
- }
-
- if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){
- articleCount++;
-
- for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
- full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
- full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
-
- $('#ul002').append(full_li_element);
- $('#ul002 .defaultLink').css('display','none');
-
- }
+ /* reset counters */
+ var lookupCount = 0;
+ var articleCount = 0;
+ var exampleCount = 0;
+ var full_li_element;
+
+/* remove any old results */
+ $('#resultlist li').remove();
+
+
+ /* running through the elements in the xml structure */
+ for (var i=0; i<propertyTags.length; i++) {
+ /* for every element named pageWords*/
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++) {
+ /* start a new list element */
+ full_li_element = '<li';
+ /* if the pageType element reads APIPage, add class name api */
+ if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage') {
+ full_li_element += ' class="api"';
+ apiCount++;
+ }
+ /* if the pageType element reads Article, add class name article */
+ else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article') {
+ full_li_element += ' class="article"';
+ articleCount++;
+ }
+ /* if the pageType element reads Example, add class name example */
+ else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example') {
+ full_li_element += ' class="example"';
+ exampleCount++;
+ }
+ /* adding the link element*/
+ full_li_element += '><a href="'+qturl;
+ /* adding the URL attribute*/
+ full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ /* adding the link title and closing the link and list elements */
+ full_li_element += '">' + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + '</a></li>';
+ /* appending the list element to the #resultlist div*/
+ $('#resultlist').append(full_li_element);
+ }
+ }
+
+ /* if the result is not empty */
+ if (propertyTags.length > 0) {
+ /* add class name active to show the dialog */
+ $('#resultdialog').addClass('active');
+ /* setting number of hits*/
+ $('#resultcount').html(propertyTags.length);
+ $('#apicount').html(apiCount);
+ $('#articlecount').html(articleCount);
+ $('#examplecount').html(exampleCount);
+ }
+
+
+ // Filtering results in display
+ $('p#resultlinks a').click(function(e) {
+ e.preventDefault();
+ // Displays API ref pages
+ if (this.id == "showapiresults") {
+ $("#resultlist").removeClass().addClass('api');
+ $("#resultlinks").removeClass().addClass('api');
+ $("#searchcount").removeClass().addClass('api');
+ }
+ // Displays Articles
+ else if (this.id == "showarticleresults") {
+ $("#resultlist").removeClass().addClass('article');
+ $("#resultlinks").removeClass().addClass('article');
+ $("#searchcount").removeClass().addClass('article');
}
- if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){
- exampleCount++;
-
-
- for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
- full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
- full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
-
- $('#ul003').append(full_li_element);
- $('#ul003 .defaultLink').css('display','none');
-
- }
- }
- if(i==propertyTags.length){$('#pageType').removeClass('loading');}
-
- }
- if(lookupCount > 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('<li class=\"menuAlert liveResult hit\">Found ' + lookupCount + ' hits</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');}
- if(articleCount > 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('<li class=\"menuAlert liveResult hit\">Found ' + articleCount + ' hits</li>');$('#ul002 li').css('display','block');}
- if(exampleCount > 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('<li class=\"menuAlert liveResult hit\">Found ' + articleCount + ' hits</li>');$('#ul003 li').css('display','block');}
-
- if(lookupCount == 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');}
- if(articleCount == 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul002 li').css('display','block');}
- if(exampleCount == 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul003 li').css('display','block');}
- // reset count variables;
- lookupCount=0;
- articleCount = 0;
- exampleCount = 0;
-
+ // Displays Examples
+ if (this.id == "showexampleresults") {
+ $("#resultlist").removeClass().addClass('example');
+ $("#resultlinks").removeClass().addClass('example');
+ $("#searchcount").removeClass().addClass('example');
+ }
+ // Displays All
+ if (this.id == "showallresults") {
+ $("#resultlist").removeClass().addClass('all');
+ $("#resultlinks").removeClass().addClass('all');
+ $("#searchcount").removeClass().addClass('all');
+ }
+ });
}
+
//build regular expression object to find empty string or any number of blank
var blankRE=/^\s*$/;
+
+
function CheckEmptyAndLoadList()
{
+ /* Start Extracting information for feedback and adding this to the feedback form */
var pageUrl = window.location.href;
var pageVal = $('title').html();
$('#feedUrl').remove();
@@ -124,55 +186,52 @@ function CheckEmptyAndLoadList()
$('.menuAlert').remove();
$('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
$('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
- $('.liveResult').remove();
- $('.defaultLink').css('display','block');
+ /* End Extracting information for feedback and adding this to the feedback form */
+
+ /* extracts search query */
var value = document.getElementById('pageType').value;
+ /* if the search is less than three chars long remove class names and remove elements from old search*/
if((blankRE.test(value)) || (value.length < 3))
{
- //empty inputbox
- // load default li elements into the ul if empty
- // loadAllList(); // replaced
- $('.defaultLink').css('display','block');
- // $('.liveResult').css('display','none');
- }else{
- $('.defaultLink').css('display','none');
+ $('#resultdialog').removeClass('active');
+ $('#resultlist li').remove();
}
}
-/*
-$(window).resize(function(){
-if($(window).width()<400)
- $('body').addClass('offline');
-else
- $('body').removeClass('offline');
- });
- */
-// Loads on doc ready
+
+// Loads on doc ready - prepares search
$(document).ready(function () {
- //alert(pageUrl);
- //$('#pageUrl').attr('foo',pageUrl);
+ /* fetch page title*/
var pageTitle = $('title').html();
+ /* getting content from search box */
var currentString = $('#pageType').val() ;
+ /* if the search box is not empty run CheckEmptyAndLoadList*/
if(currentString.length < 1){
- $('.defaultLink').css('display','block');
CheckEmptyAndLoadList();
}
+ /* on key-up in the search box execute the following */
$('#pageType').keyup(function () {
+ /* extract the search box content */
var searchString = $('#pageType').val() ;
+ /* if the string is less than three characters */
if ((searchString == null) || (searchString.length < 3)) {
+ /* remove classes and elements*/
$('#pageType').removeClass('loading');
- $('.liveResult').remove();
$('.searching').remove();
+ /* run CheckEmptyAndLoadList */
CheckEmptyAndLoadList();
+
$('.report').remove();
- // debug$('.content').prepend('<li>too short or blank</li>'); // debug
return;
}
+ /* if timer checks out */
if (this.timer) clearTimeout(this.timer);
this.timer = setTimeout(function () {
+ /* add loading image by adding loading class */
$('#pageType').addClass('loading');
$('.searching').remove();
- $('.list ul').prepend('<li class="menuAlert searching">Searching...</li>');
+
+ /* run the actual search */
$.ajax({
contentType: "application/x-www-form-urlencoded",
url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
@@ -180,15 +239,14 @@ else
dataType:'xml',
type: 'post',
success: function (response, textStatus) {
-
- $('.liveResult').remove();
+ /* on success remove loading img */
$('.searching').remove();
$('#pageType').removeClass('loading');
- $('.list ul').prepend('<li class="menuAlert searching">Searching...</li>');
+
processNokiaData(response);
}
});
- }, 500);
+ }, 500); /* timer set to 500 ms */
});
- });
+ }); \ No newline at end of file
diff --git a/doc/src/template/scripts/narrow.js b/doc/src/template/scripts/narrow.js
index 35c81bf..a5e8b97 100644
--- a/doc/src/template/scripts/narrow.js
+++ b/doc/src/template/scripts/narrow.js
@@ -1,17 +1,15 @@
+/* This function generates menus and search box in narrow/slim fit mode */
var narrowInit = function() {
- /* TODO:
- Could probably be more efficient, not hardcoding each element to be created
- */
- // 1: Create search form
+ /* 1: Create search form */
var narrowSearch = $('<div id="narrowsearch"></div>');
var searchform = $("#qtdocsearch");
narrowSearch.append(searchform);
$("#qtdocheader .content .qtref").after(narrowSearch);
- // 2: Create dropdowns
+ /* 2: Create dropdowns */
var narrowmenu = $('<ul id="narrowmenu" class="sf-menu"></ul>');
- // Lookup
+ /* Lookup */
var lookuptext = $("#lookup h2").attr("title");
$("#lookup ul").removeAttr("id");
$("#lookup ul li").removeAttr("class");
@@ -24,7 +22,7 @@ var narrowInit = function() {
lookuplist.append(lookupul);
narrowmenu.append(lookuplist);
- // Topics
+ /* Topics */
var topicstext = $("#topics h2").attr("title");
$("#topics ul").removeAttr("id");
$("#topics ul li").removeAttr("class");
@@ -37,7 +35,7 @@ var narrowInit = function() {
topicslist.append(topicsul);
narrowmenu.append(topicslist);
- // Examples
+ /* Examples */
var examplestext = $("#examples h2").attr("title");
$("#examples ul").removeAttr("id");
$("#examples ul li").removeAttr("class");
@@ -58,32 +56,78 @@ var narrowInit = function() {
});
}
+/* Executes on doc ready */
$(document).ready(function(){
-/* if ($('body').hasClass('narrow')) {
- narrowInit();
- }
- */
- if($(window).width()<600) {
- $('body').addClass('narrow');
-
- if ($("#narrowsearch").length == 0) {
- narrowInit();
- }
- }
- else {
- $('body').removeClass('narrow');
+ /* check if body has the narrow class */
+ if ($('body').hasClass('narrow')) {
+ /* run narrowInit */
+ narrowInit();
+ }
+
+ /* messure window width and add class if it is smaller than 600 px */
+ if($(window).width()<600) {
+ $('body').addClass('narrow');
+ /* if the search box contains */
+ if ($("#narrowsearch").length == 0) {
+ /* run narrowInit */
+ narrowInit();
+ }
+ }
+ else { /* if the window is wider than 600 px, narrow is removed */
+ $('body').removeClass('narrow');
+ if ($("#narrowsearch").length == 0) {
+ }
+ }
+});
+/* binding resize event to this funciton */
+$(window).bind('resize', function () {
+ /* if the window is wider than 600 px, narrow class is added */
+ if($(window).width()<600) {
+ $('body').addClass('narrow');
+ if ($("#narrowsearch").length == 0) {
+ narrowInit();
+ }
+ }
+ else {
+ /* else we remove the narrow class */
+ $('body').removeClass('narrow');
}
});
-$(window).bind('resize', function () {
- if($(window).width()<600) {
- $('body').addClass('narrow');
+ $('#narrowsearch').keyup(function () {
+ /* extract the search box content */
+ var searchString = $('#narrowsearch').val();
+ /* if the string is less than three characters */
+ if ((searchString == null) || (searchString.length < 3)) {
+ /* remove classes and elements*/
+ $('#narrowsearch').removeClass('loading');
+ $('.searching').remove();
+ /* run CheckEmptyAndLoadList */
+ CheckEmptyAndLoadList();
+
+ $('.report').remove();
+ return;
+ }
+ /* if timer checks out */
+ if (this.timer) clearTimeout(this.timer);
+ this.timer = setTimeout(function () {
+ /* add loading image by adding loading class */
+ $('#narrowsearch').addClass('loading');
+ $('.searching').remove();
- if ($("#narrowsearch").length == 0) {
- narrowInit();
- }
- }
- else {
- $('body').removeClass('narrow');
- }
-}); \ No newline at end of file
+ /* run the actual search */
+ $.ajax({
+ contentType: "application/x-www-form-urlencoded",
+ url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
+ data: 'searchString='+searchString,
+ dataType:'xml',
+ type: 'post',
+ success: function (response, textStatus) {
+ /* on success remove loading img */
+ $('.searching').remove();
+ $('#narrowsearch').removeClass('loading');
+ processNokiaData(response);
+ }
+ });
+ }, 500); /* timer set to 500 ms */
+ }); \ No newline at end of file
diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css
index de5b0a0..8e42a0d 100644
--- a/doc/src/template/style/narrow.css
+++ b/doc/src/template/style/narrow.css
@@ -6,7 +6,7 @@
}
.narrow a {
- color: #44a51c;
+ color: #00732f;
}
.narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper {
@@ -45,7 +45,7 @@
{
width: auto;
height: auto;
- color: #363534;
+ color: #00732f;
position: static;
float: left;
margin-left: 25px;
@@ -163,7 +163,7 @@
}
.narrow .wrap .breadcrumb ul li a {
- color: #44a51c;
+ color: #00732f;
}
.narrow .wrap .breadcrumb ul li.last a {
@@ -203,11 +203,7 @@
*border: 1px solid #fff;
*height: 17px;
_height: 18px;
- /* to be fixed */
- display: none;
- /* to be fixed */
}
-
.narrow .indexbox .indexIcon {
display: none;
}
@@ -268,3 +264,6 @@
}
/* end narrow mode */
+ .creator #narrowsearch, .creator #narrowmenu{
+ display:none;
+ }
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 51c4f7e..5833266 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -627,17 +627,94 @@
background:url("../images/spinner.gif") no-repeat scroll right center transparent;
}
-.floatingResult{
- z-index:1;
- position:relative;
- padding-top:0px;
- background-color:white;
- border:solid 1px black;
- height:250px;
- width:600px;
- overflow-x:hidden;
- overflow-y:auto;
-}
+ .sidebar .search form {
+ _height: 23px;
+ _width: 169px;
+ }
+
+ #resultdialog {
+ display: none;
+ position: absolute;
+ *left: 30px;
+ _left: 0;
+ *top: 35px;
+ _top: 30px;
+ _zoom: 1;
+ background-color: #fff;
+ border: 1px solid #666;
+ z-index: 4;
+ margin-top: 5px;
+ _margin: 0 0 0 -20px;
+ padding: 10px;
+ width: 220px;
+ _width: 196px;
+ height: 250px;
+ overflow: auto;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ border-radius: .5em;
+ -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
+ -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
+ box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
+ }
+
+ #resultdialog.active {
+ display: block;
+ }
+
+ #resultdialog #resultclose {
+ float: right;
+ }
+
+ #resultdialog p,
+ #resultdialog ul {
+ clear: both;
+ margin: 3px 0;
+ }
+
+ p#searchcount span {
+ display: none;
+ }
+
+ p#searchcount.all span#resultcount,
+ p#searchcount.api span#apicount,
+ p#searchcount.article span#articlecount,
+ p#searchcount.example span#examplecount {
+ display: inline;
+ }
+
+ #resultlist li {
+ display: none;
+ }
+
+ #resultlist.api li.api,
+ #resultlist.article li.article,
+ #resultlist.example li.example,
+ #resultlist.all li {
+ display: block;
+ }
+
+ #resultlinks.api a#showapiresults,
+ #resultlinks.api a#showapiresults:hover,
+ #resultlinks.article a#showarticleresults,
+ #resultlinks.article a#showarticleresults:hover,
+ #resultlinks.example a#showexampleresults,
+ #resultlinks.example a#showexampleresults:hover,
+ #resultlinks.all a#showallresults,
+ #resultlinks.all a#showallresults:hover {
+ color: #B0ADAB;
+ }
+ .floatingResult{
+ z-index:1;
+ position:relative;
+ padding-top:0px;
+ background-color:white;
+ border:solid 1px black;
+ height:250px;
+ width:600px;
+ overflow-x:hidden;
+ overflow-y:auto;
+ }
.floatingResult:hover{
display:block;
@@ -837,6 +914,9 @@
padding-left: 25px;
padding-top: 10px;
}
+ .wrap .content ul img {
+ vertical-align:middle;
+ }
a:hover
{
color: #4c0033;