Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

lib.Bootstrap.asp 3.9KB

před 8 měsíci
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <%
  2. '=======================================================================================================================
  3. ' Bootstrap Helper - Provides some convenience methods for Bootstrap use
  4. '=======================================================================================================================
  5. Class Bootstrap_Helper_Class
  6. '---------------------------------------------------------------------------------------------------------------------
  7. ' Forms
  8. '---------------------------------------------------------------------------------------------------------------------
  9. 'Creates .control-label for Bootstrap styling
  10. Public Function ControlLabel(name, for_name)
  11. ControlLabel = HTML.LabelExt(name, for_name, Array("class", "control-label"))
  12. End Function
  13. Public Function Control(label_text, control_name, controls_html)
  14. Control = "<div class='control-group'>" & ControlLabel(label_text, control_name) & "<div class='controls'>" & controls_html & "</div></div>"
  15. End Function
  16. '---------------------------------------------------------------------------------------------------------------------
  17. ' Modals
  18. '---------------------------------------------------------------------------------------------------------------------
  19. Public Function ModalLinkTo(link_text, controller_name, action_name, modal_name, html_class_attrib)
  20. ModalLinkTo = ModalLinkToExt(link_text, controller_name, action_name, params_array, modal_name, html_class_attrib, empty)
  21. End Function
  22. Public Function ModalLinkToExt(link_text, controller_name, action_name, params_array, modal_name, html_class_attrib, html_attribs_array)
  23. ModalLinkToExt = "<a href='" & Server.HTMLEncode(Routes.UrlTo(controller_name, action_name, params_array)) & "'" &_
  24. " class='" & html_class_attrib & " modal-link' data-modal='" & modal_name & "' " &_
  25. HTML.HtmlAttribs(html_attribs_array) & ">" & link_text & "</a>"
  26. End Function
  27. 'Generates the jQuery handler for the modal dialogs
  28. Public Function ModalHandlerScript()
  29. dim s
  30. s = " <script type='text/javascript'> " & vbCR &_
  31. " // when a .modal-link is clicked, display the href target in the popup modal " & vbCR &_
  32. " $(function() { " & vbCR &_
  33. " $('a.modal-link').click(function(event) { " & vbCR &_
  34. " event.preventDefault(); " & vbCR &_
  35. " var modalName = $(this).attr('data-modal'); " & vbCR &_
  36. " $('#' + modalName).removeData('modal').modal( { remote: $(this).attr('href') } ); " & vbCR &_
  37. " }); " & vbCR &_
  38. " }); " & vbCR &_
  39. " </script> "
  40. ModalHandlerScript = s
  41. End Function
  42. End Class
  43. dim Bootstrap_Helper_Class__Singleton
  44. Function Bootstrap()
  45. If IsEmpty(Bootstrap_Helper_Class__Singleton) then set Bootstrap_Helper_Class__Singleton = new Bootstrap_Helper_Class
  46. set Bootstrap = Bootstrap_Helper_Class__Singleton
  47. End Function
  48. %>

Powered by TurnKey Linux.