Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. var App = function() {
  2. this.page = window.location.pathname.split("/public/portal/")[1].split("/")[0];
  3. }
  4.  
  5. $.extend(App.prototype, {
  6.  
  7. // This will set the variables in the box and display / hide
  8. setVariables: function(ele, vars){
  9. this.variables = vars || variables;
  10. var list = $("#page_variables .text_variables");
  11.  
  12. // Create the variable box
  13. $('li', list).remove(); // first remove all variables currently in the box
  14. console.log(ele);
  15.  
  16. ele.bind('focus', function(){
  17. list.fadeIn();
  18. })
  19. .bind('blur', function(){
  20. list.fadeOut();
  21. });
  22. }
  23. });
  24.  
  25. (function($, undefined){
  26. $(".tvar_text").focus(function(){
  27. port.setVariables($(this), null);
  28. });
  29. })(jQuery);
  30.  
  31. <div id="page_variables">
  32. <div class="text_variables" style="display:none">
  33. <ul>
  34. <strong style="text-decoration: underline;">VARIABLES</strong>
  35. <li>{provider}</li>
  36. <li>{date}</li>
  37. <li>{callerid}</li>
  38. <li>{time}</li>
  39. <li>{location}</li>
  40. <li>{recipient}</li>
  41. <li>{misc1}</li>
  42. <li>{misc2}</li>
  43. <li>{misc3}</li>
  44. <li>{misc4}</li>
  45. </ul>
  46. </div>
  47. </div>
  48.  
  49. <textarea class="tvar_text" name="Vtmpl" cols="50" rows="10" style="min-height: 200px; overflow: hidden; resize: none; height: 50px;"></textarea>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement