The branch, xhtml/new_features/assets-separate-directory, has been created.
        at  6e6fbb61ee885f4f21ad2742f264376e5258e317 (commit)

- Log -----------------------------------------------------------------

commit 6e6fbb61ee885f4f21ad2742f264376e5258e317
Author: Josh Hieronymus <[email protected]>
Date:   Sat Jul 27 18:18:21 2013 -0400

    Fix typo preventing checkbox value from being written to file

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index eae06a4..ea751e5 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1177,7 +1177,7 @@ void BufferParams::writeFile(ostream & os) const
           << "\\output_changes " << convert<string>(outputChanges) << '\n'
           << "\\html_math_output " << html_math_output << '\n'
           << "\\html_css_as_file " << html_css_as_file << '\n'
-          << "\\html_css_in_separate_directory" << 
html_css_in_separate_directory << '\n'
+          << "\\html_css_in_separate_directory " << 
html_css_in_separate_directory << '\n'
           << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
 
        if (html_math_img_scale != 1.0)

commit b8aaaca6899e1bbece3c94bdcf70f9931871c76f
Author: Josh Hieronymus <[email protected]>
Date:   Sat Jul 27 11:52:29 2013 -0400

    Write images to "images" directory on XHTML export

diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 70b43c4..771a2e3 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -917,7 +917,7 @@ string InsetGraphics::prepareHTMLFile(OutputParams const & 
runparams) const
        if (status == FAILURE)
                return string();
 
-       string output_file = onlyFileName(temp_file.absFileName());
+       string output_file = "images/" + onlyFileName(temp_file.absFileName());
 
        string const from = formats.getFormatFromFile(temp_file);
        if (from.empty())

commit 0a9d8781ec25cefe49c6d816ec92150ec37882da
Author: Josh Hieronymus <[email protected]>
Date:   Sat Jul 27 08:52:37 2013 -0400

    Remove checked property from CSS checkbox

diff --git a/src/frontends/qt4/ui/OutputUi.ui b/src/frontends/qt4/ui/OutputUi.ui
index d29c524..db299e6 100644
--- a/src/frontends/qt4/ui/OutputUi.ui
+++ b/src/frontends/qt4/ui/OutputUi.ui
@@ -228,9 +228,6 @@
         <property name="text">
          <string>Write CSS to Separate Directory</string>
         </property>
-        <property name="checked">
-         <bool>false</bool>
-        </property>
        </widget>
       </item>
      </layout>

commit 104dfaa891a92cf21def4f643f5e9381d36189f8
Author: Josh Hieronymus <[email protected]>
Date:   Fri Jul 26 20:44:28 2013 -0400

    Add option to write CSS file to "styles" directory

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 85ab3b5..9fd7862 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1914,7 +1914,7 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
                docstring const dstyles = css.str();
                if (!dstyles.empty()) {
                        bool written = false;
-                       if (params().html_css_as_file) {
+                       if (params().html_css_as_file || 
params().html_css_in_separate_directory) {
                                // open a file for CSS info
                                ofdocstream ocss;
                                string const fcssname = addName(temppath(), 
"docstyle.css");
@@ -1923,11 +1923,18 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
                                        ocss << dstyles;
                                        ocss.close();
                                        written = true;
-                                       // write link to header
-                                       os << "<link rel='stylesheet' 
href='styles/docstyle.css' type='text/css' />\n";
-                                       // register file
-                                       string const fcssfileinstylesdir = 
filePath() + "styles/docstyle.css";
-                                       
runparams.exportdata->addExternalFile("xhtml", fcssfile, fcssfileinstylesdir);
+                                       if (params().html_css_as_file) {
+                                               // write link to header
+                                               os << "<link rel='stylesheet' 
href='docstyle.css' type='text/css' />\n";
+                                               // register file
+                                               
runparams.exportdata->addExternalFile("xhtml", fcssfile);
+                                       } else {
+                                               // write link to header
+                                               os << "<link rel='stylesheet' 
href='styles/docstyle.css' type='text/css' />\n";
+                                               // register file
+                                               string const 
fcssfileinstylesdir = filePath() + "styles/docstyle.css";
+                                               
runparams.exportdata->addExternalFile("xhtml", fcssfile, fcssfileinstylesdir);
+                                       }
                                }
                        }
                        // we are here if the CSS is supposed to be written to 
the header
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index c98e1f9..eae06a4 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -415,6 +415,7 @@ BufferParams::BufferParams()
        html_math_output = MathML;
        html_math_img_scale = 1.0;
        html_css_as_file = false;
+       html_css_in_separate_directory = false;
 
        output_sync = false;
        use_refstyle = true;
@@ -905,6 +906,8 @@ string BufferParams::readToken(Lexer & lex, string const & 
token,
                lex >> html_be_strict;
        } else if (token == "\\html_css_as_file") {
                lex >> html_css_as_file;
+       } else if (token == "\\html_css_in_separate_directory") {
+               lex >> html_css_in_separate_directory;
        } else if (token == "\\html_math_img_scale") {
                lex >> html_math_img_scale;
        } else if (token == "\\html_latex_start") {
@@ -1174,6 +1177,7 @@ void BufferParams::writeFile(ostream & os) const
           << "\\output_changes " << convert<string>(outputChanges) << '\n'
           << "\\html_math_output " << html_math_output << '\n'
           << "\\html_css_as_file " << html_css_as_file << '\n'
+          << "\\html_css_in_separate_directory" << 
html_css_in_separate_directory << '\n'
           << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
 
        if (html_math_img_scale != 1.0)
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 9c558a6..213b8fa 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -470,6 +470,8 @@ public:
        std::string html_latex_end;
        ///
        bool html_css_as_file;
+       ///
+       bool html_css_in_separate_directory;
        /// generate output usable for reverse/forward search
        bool output_sync;
        /// custom LaTeX macro from user instead our own
diff --git a/src/frontends/qt4/GuiDocument.cpp 
b/src/frontends/qt4/GuiDocument.cpp
index 4fd3d53..2b90cf8 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -753,6 +753,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(outputModule->cssCB, SIGNAL(stateChanged(int)),
                this, SLOT(change_adaptor()));
+       connect(outputModule->css_in_separate_directoryCB, 
SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
        connect(outputModule->mathoutCB, SIGNAL(currentIndexChanged(int)),
                this, SLOT(change_adaptor()));
 
@@ -2786,6 +2788,7 @@ void GuiDocument::applyView()
        bp_.html_math_output = mo;
        bp_.html_be_strict = outputModule->strictCB->isChecked();
        bp_.html_css_as_file = outputModule->cssCB->isChecked();
+       bp_.html_css_in_separate_directory = 
outputModule->css_in_separate_directoryCB->isChecked();
        bp_.html_math_img_scale = outputModule->mathimgSB->value();
 
        // fonts
@@ -3320,6 +3323,7 @@ void GuiDocument::paramsToDialog()
        outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
        outputModule->strictCB->setChecked(bp_.html_be_strict);
        outputModule->cssCB->setChecked(bp_.html_css_as_file);
+       
outputModule->css_in_separate_directoryCB->setChecked(bp_.html_css_in_separate_directory);
 
        // paper
        bool const extern_geometry =
diff --git a/src/frontends/qt4/ui/OutputUi.ui b/src/frontends/qt4/ui/OutputUi.ui
index 812d736..d29c524 100644
--- a/src/frontends/qt4/ui/OutputUi.ui
+++ b/src/frontends/qt4/ui/OutputUi.ui
@@ -126,7 +126,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
+      <item row="2" column="0">
        <widget class="QLabel" name="mathoutLA">
         <property name="font">
          <font>
@@ -142,7 +142,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
+      <item row="2" column="1">
        <widget class="QComboBox" name="mathoutCB">
         <property name="font">
          <font>
@@ -175,7 +175,7 @@
         </item>
        </widget>
       </item>
-      <item row="2" column="0">
+      <item row="3" column="0">
        <widget class="QLabel" name="mathimgLA">
         <property name="font">
          <font>
@@ -191,7 +191,7 @@
         </property>
        </widget>
       </item>
-      <item row="2" column="1">
+      <item row="3" column="1">
        <widget class="QDoubleSpinBox" name="mathimgSB">
         <property name="font">
          <font>
@@ -223,6 +223,16 @@
         </property>
        </widget>
       </item>
+      <item row="1" column="1">
+       <widget class="QCheckBox" name="css_in_separate_directoryCB">
+        <property name="text">
+         <string>Write CSS to Separate Directory</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>

commit d142e8eab518c6c33a20b54c410876cae5730629
Author: Josh Hieronymus <[email protected]>
Date:   Fri Jul 26 16:40:48 2013 -0400

    Write external CSS file to "styles" directory
    
    When the "Write CSS to File" option is selected in the Document >
    Settings > Output dialog box, write CSS to an external file
    "docstyle.css" located in the "styles" directory, a subdirectory of the
    directory in which the LyX and XHTML files are saved.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 73d6ad5..85ab3b5 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1924,9 +1924,10 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
                                        ocss.close();
                                        written = true;
                                        // write link to header
-                                       os << "<link rel='stylesheet' 
href='docstyle.css' type='text/css' />\n";
+                                       os << "<link rel='stylesheet' 
href='styles/docstyle.css' type='text/css' />\n";
                                        // register file
-                                       
runparams.exportdata->addExternalFile("xhtml", fcssfile);
+                                       string const fcssfileinstylesdir = 
filePath() + "styles/docstyle.css";
+                                       
runparams.exportdata->addExternalFile("xhtml", fcssfile, fcssfileinstylesdir);
                                }
                        }
                        // we are here if the CSS is supposed to be written to 
the header

-----------------------------------------------------------------------


hooks/post-receive
-- 
Repositories for GSOC work

Reply via email to