Does anyone has experience in this?

I tried lightgallery (http://code.google.com/p/lightgallery/wiki/InstallationInstructions).

I have:
1) added setRel() method to wt
2) loaded library from application constructor:
  require("lightgallery/lightgallery.min.js");
  useStyleSheet("lightgallery/skins/default/style.css");

3) initialized library with
  doJavaScript("lightgallery.init();")

But nothing works (seems library is not loaded at all when it's needed). No java script errors in console.

setRel() method is in attachment.

--
Andrii Arsirii
Streamco
http://streamco.org.ua

Index: src/Wt/WAnchor
===================================================================
--- src/Wt/WAnchor	(revision 170)
+++ src/Wt/WAnchor	(working copy)
@@ -102,6 +102,8 @@
    */
   void setRef(const std::string& url);
 
+  void setRel(const std::string& url);
+
   /*! \brief Set the destination URL to an internal path.
    *
    * Sets the anchor to point to the internal path <i>path</i>. When
@@ -139,6 +141,12 @@
    */
   const std::string& ref() const { return ref_; }
 
+  /*! \brief Returns the rel attribute.
+   *
+   * \sa setRel()
+   */
+  const std::string& rel() const { return rel_; }
+
   /*! \brief Set a destination resource.
    *
    * A resource specifies application-dependent content, which may be
@@ -240,8 +248,10 @@
 private:
   static const int BIT_REF_CHANGED = 0;
   static const int BIT_TARGET_CHANGED = 1;
+  static const int BIT_REL_CHANGED = 2;
 
   std::string    ref_;
+  std::string    rel_;
   WResource     *resource_;
   WText         *text_;
   WImage        *image_;
Index: src/Wt/WAnchor.C
===================================================================
--- src/Wt/WAnchor.C	(revision 170)
+++ src/Wt/WAnchor.C	(working copy)
@@ -127,6 +127,16 @@
   }
 }
 
+void WAnchor::setRel(const std::string& rel)
+{
+  if (rel_ != rel) {
+    rel_ = rel;
+    flags_.set(BIT_REL_CHANGED);
+
+    repaint(RepaintPropertyIEMobile);
+  }
+}
+
 void WAnchor::setRefInternalPath(const std::string& path)
 {
   WApplication *app = WApplication::instance();
@@ -226,6 +236,12 @@
     flags_.reset(BIT_REF_CHANGED);
   }
 
+  if (flags_.test(BIT_REL_CHANGED) || all) {
+    element.setAttribute("rel", rel_);
+
+    flags_.reset(BIT_REL_CHANGED);
+  }
+
   if (flags_.test(BIT_TARGET_CHANGED) || all) {
     switch (target_) {
     case TargetSelf:
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to