Sfoglia il codice sorgente

Add files via upload

Daniele Bonini (皮夕): WebDev and DevOps by lots of Sim.pli.city bits 3 anni fa
parent
commit
b3ac6b8169
2 ha cambiato i file con 27 aggiunte e 1 eliminazioni
  1. 20 0
      Public/js/cube-code.js
  2. 7 1
      Public/js/dragndrop-code.js

+ 20 - 0
Public/js/cube-code.js

@@ -82,6 +82,7 @@ function myCube(myname, myformalName, myAPP_HOST) {
   this.name = myname;
   this.map = ["Address", "Contacts", "Other Info", "Menu", "Pictures", "Password"];
   this.formalName = myformalName;
+  this.beauty = "";
   this.guid = "";
   this.password = "";
   this.cats = "";
@@ -110,6 +111,7 @@ function myCube(myname, myformalName, myAPP_HOST) {
   this.gethcur = mygethcur;
   this.getvcur = mygetvcur;
   this.getname = mygetname;
+  this.getbeauty = mygetbeauty;
   this.getguid = mygetguid;
   this.getpassword = mygetpassword;
   this.getxml = mygetxml;
@@ -382,6 +384,15 @@ function myCube(myname, myformalName, myAPP_HOST) {
 
         myObj.xml = xml;
 
+        re = new RegExp("\<beauty\>(.*)\<\/beauty\>", "igsu");
+        a = re.exec(xml);
+        if (!a || a.length===0) {
+          document.write("Data access error (#1a)<br><br>");
+          return;
+        } else {
+          myObj.beauty = a[1];  
+        }  
+
         re = new RegExp("\<guid\>(.*)\<\/guid\>", "igsu");
         a = re.exec(xml);
         if (!a || a.length===0) {
@@ -459,6 +470,15 @@ function myCube(myname, myformalName, myAPP_HOST) {
     //}  
   }
 
+  /*
+   * Get the beauty of the cube
+   * 
+   * @returns string
+   */
+  function mygetbeauty() {
+    return this.beauty;   
+  }  
+
   /*
    * Get the guid of the cube
    * 

+ 7 - 1
Public/js/dragndrop-code.js

@@ -146,9 +146,15 @@ function onDrop(tthis, e) {
     
     newCube = "";
     newCube += "<div class='link-div' title='" + newcube.desc + "' order='" + n + "' onclick='selCube(this);openDetail()' draggable='true' ondragstart='onDragStart(this, event);' onmouseover='onMouseOver();'>";
-    newCube += "<div class='link-title'>" + newcube.title + "</div>";
+    newCube += "<div class='link-title'>" + newcube.title + "<div style='width:25px; float:right;'><img class='imgheart' src='/res/unheart.png' style='height:23px;'></a></div></div>";
     newCube += "<a href='#'><img class='link-img' src='/res/code.png' alt='" + newcube.title + "'></a><br>";
+    newCube += " <br>";
     newCube += "&nbsp;<a class='link-link' href='http://" + newcube.link.replace(/~/g, "/") + "'>" + newcube.label.replace(/~/g, "/") + "</a><br>";
+    newCube += "<div style='position:relative;top:-25px;left:-2px;text-align:right;padding-right:1.5px;'>";
+    newCube += "<img src='/res/fb.png'>";
+    newCube += "<img src='/res/twitter.png'>";
+    newCube += "<img src='/res/whatsapp.png'>";
+    newCube += "</div>";
     newCube += "</div>";
     
     oldHtml = $(tthis).html();