fb2html.cpp 793 B

12345678910111213141516171819202122232425262728
  1. #include "fb2html.h"
  2. #include "fb2utils.h"
  3. //---------------------------------------------------------------------------
  4. // Fb2TextElement
  5. //---------------------------------------------------------------------------
  6. QString Fb2TextElement::location()
  7. {
  8. static const QString javascript = FB2::read(":/js/get_location.js").prepend("var element=this;");
  9. return evaluateJavaScript(javascript).toString();
  10. }
  11. void Fb2TextElement::select()
  12. {
  13. static const QString javascript = FB2::read(":/js/set_cursor.js");
  14. evaluateJavaScript(javascript);
  15. }
  16. bool Fb2TextElement::isSection() const
  17. {
  18. return tagName() == "DIV" && attribute("class").toLower() == "section";
  19. }
  20. bool Fb2TextElement::isTitle() const
  21. {
  22. return tagName() == "DIV" && attribute("class").toLower() == "title";
  23. }