Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1.  
  2. self.genStr = function genStr(title, image, lat, lng, portalGuid) {
  3. console.log(title,image,lat,lng,portalGuid);
  4. //var href = lat + "," + lng;
  5. var str= title;
  6.  
  7. str = str.replace(/[\u005B-\u0060]/g, function(chr) {
  8. return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4)
  9. });
  10. str = str.replace(/[\u007B-\uFFFF]/g, function(chr) {
  11. return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4)
  12. });
  13.  
  14. str = str.replace(/[\u0000-\u002F]/g, function(chr) {
  15. return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4)
  16. });
  17. str = str.replace(/[\u003A-\u0040]/g, function(chr) {
  18. return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4)
  19. });
  20.  
  21. str = str + ";" + image + ";" + portalGuid;
  22. if (window.plugin.keys && (typeof window.portals[portalGuid] !== "undefined")) {
  23. var keyCount =window.plugin.keys.keys[portalGuid] || 0;
  24. str = str + ";" + keyCount;
  25.  
  26. }
  27.  
  28.  
  29.  
  30. console.log(str);
  31. return str;
  32. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement