Guest User

Untitled

a guest
Oct 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. # Disables (functionally and visually) the ability to upload the same photo
  2. # multiple times.
  3. jQuery.fn.disableSubmission = ->
  4. @val "Adding..."
  5. @attr 'disabled', 'disabled'
  6. @removeClass 'search-btn-green'
  7. @addClass 'search-btn-orange'
  8. return this
  9.  
  10. jQuery ->
  11. class ProfilePane
  12. options:
  13. width: "640px"
  14.  
  15. constructor: (opts) ->
  16. @options = $.extend(@options, opts)
  17. $.colorbox
  18. width: @options.width
  19. href: @options.route
  20.  
  21. $("[data-action=switchChange]").change (_e) ->
  22. window.location.href = $(this).data("route").replace(/business_users\/profiles\/([a-z-_0-9]*)/, "business_users/profiles/#{$(this).val()}")
  23.  
  24. $(".biz-user-tabs.profiles").bind 'tabsload', ->
  25. window.loadCategorySelector()
  26.  
  27. window.ProfilePane = ProfilePane
  28.  
  29. $("#account_stats_form")
  30. .live "ajax:success", (event, data, status, xhr) ->
  31. $(".account_stats_content").html(data)
  32. .live "ajax:error", (event, xhr, status, error) ->
  33. alert("Sorry, an error occurred while updating. Error: " + error)
  34.  
  35. $('[data-action=paidFeature]').live 'click', (_event) ->
  36. $("#paid_features").show()
  37.  
  38. $('[data-action=firstTimePane]').live 'click', (_event) =>
  39. route = $(_event.currentTarget).data('route')
  40. new window.ProfilePane({ route: route })
  41. return false
  42.  
  43. new actions.search.admin.SearchAction(name: 'biz-search', model: "calls", formSelector: "#business_user_search_form")
  44. new actions.search.admin.SortAction(model: "calls", formSelector: "#business_user_search_form")
  45. new actions.search.admin.PaginateAction(model: "calls", selector: ".pagination a", formSelector: "#business_user_search_form")
  46. new actions.rest.UpdateAction(model: "calls", id: "call", item_id_tag: "call-id", fields: ['notes', 'cat'])
  47.  
  48. new actions.calls.RejectAction(model: "calls", id: "call", item_id_tag: "call-id")
  49. new actions.calls.AcceptAction(model: "calls", id: "call", item_id_tag: "call-id")
  50. new actions.calls.UnverifyAction(model: "calls", id: "call", item_id_tag: "call-id")
  51.  
  52. actions.calls.PlayPauseAction.get()
  53. actions.calls.SeekAction.get()
Add Comment
Please, Sign In to add comment