Juan Carlos Picado Herrera avatar Juan Carlos Picado Herrera committed f4cb46e

ENCUESTAME-243 good progress

Comments (0)

Files changed (6)

encuestame-war/src/main/webapp/WEB-INF/views/home/web/home.jsp

      dojo.require("encuestame.org.core.commons.rated.Comments");
      dojo.require("encuestame.org.core.commons.rated.HashTags");
      dojo.require("encuestame.org.core.commons.rated.Users");
+     dojo.require('encuestame.org.core.commons.stream.HashTagInfo');
      dojo.require("encuestame.org.core.commons.stream.FrontEnd");
 </script>
 <div id="web-main-public-line" class="enme-auto-center">
                        </div>
                        <div class="tags">
                             <c:forEach items="${item.hashTags}" var="h">
-                                <a href="<%=request.getContextPath()%>/tag/${h.hashTagName}/" class="tag">${h.hashTagName}</a>
+                                   <span dojoType="encuestame.org.core.commons.stream.HashTagInfo"
+                                    url="<%=request.getContextPath()%>/tag/${h.hashTagName}/"
+                                    hashTagName="${h.hashTagName}"></span>
                            </c:forEach>
                        </div>
                     </div>

encuestame-war/src/main/webapp/resource/css/public.css

     -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
     border-radius: 3px;
+}
+
+
+/** clod **/
+
+div.cloud {
+  clear: both;
+  margin-bottom: 4px;
+  margin-top: 4px;
+  max-width: 200px;
+  padding: 5px;
+}
+
+div.cloud .cloudItem {
+  display: inline-block;
+  font-size: 20px;
+  font-weight: bold;
+  padding: 2px;
 }

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/hashtags/Cloud.js

 dojo.require("dijit._Widget");
 dojo.require("dijit.layout.ContentPane");
 dojo.require('encuestame.org.core.commons');
+dojo.require('encuestame.org.core.commons.stream.HashTagInfo');
 
 dojo.declare(
     "encuestame.org.core.commons.hashtags.Cloud",
     [dijit._Widget, dijit._Templated],{
         templatePath: dojo.moduleUrl("encuestame.org.core.commons.hashtags", "template/cloud.html"),
 
-        widgetsInTemplate: true
+        widgetsInTemplate: true,
+
+        _hashtagCloud : null,
+
+        /*
+         * Post create.
+         */
+        postCreate : function() {
+            this._loadCloud();
+        },
+
+        _printCloud : function(items){
+            dojo.forEach(items,
+                dojo.hitch(this,function(item) {
+                  var span1 = dojo.doc.createElement("span");
+                  span1.innerHTML = item.hashTagName;
+                  dojo.style(span1, "font-size", item.size+"px");
+                  dojo.addClass(span1, "cloudItem");
+                  this._hashtagCloud.appendChild(span1);
+                }));
+        },
+
+        /*
+         *
+         */
+        _loadCloud : function(){
+            var load = dojo.hitch(this, function(data) {
+                this.arrayAccounts = data.success.cloud;
+                dojo.empty(this._hashtagCloud);
+                console.debug("social", this._hashtagCloud);
+                this._printCloud(data.success.cloud);
+            });
+            var error = function(error) {
+                console.debug("error", error);
+            };
+            encuestame.service.xhrGet(
+                    encuestame.service.list.cloud, {}, load, error);
+        }
 });

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/hashtags/template/cloud.html

-<div>
-cloud
+<div class="cloud" dojoAttachPoint="_hashtagCloud">
 
 </div>

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/stream/HashTagInfo.js

+dojo.provide("encuestame.org.core.commons.stream.HashTagInfo");
+
+dojo.require('dojox.timing');
+dojo.require("dojox.widget.Dialog");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Widget");
+dojo.require("dijit.layout.ContentPane");
+dojo.require('encuestame.org.core.commons');
+
+dojo.declare(
+    "encuestame.org.core.commons.stream.HashTagInfo",
+    [dijit._Widget, dijit._Templated],{
+        templatePath: dojo.moduleUrl("encuestame.org.core.commons.stream", "templates/hashTagInfo.html"),
+
+        widgetsInTemplate: true,
+
+        hashTagName : "",
+
+        url : "#",
+
+        /*
+         * Post create.
+         */
+        postCreate : function() {
+            if (this._hashtag) {
+               // this._hashtag.href = encuestame.contextDefault+"/tag/"+this.hashTagName+"/";
+            }
+        }
+});

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/stream/templates/hashTagInfo.html

+<a href="${url}" dojoAttachPoint="_hashtag" class="tag">${hashTagName}</a>
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.