Guest User

Untitled

a guest
Oct 11th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head runat="server">
  3. <title></title>
  4.  
  5. <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
  6. <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
  7. <script type="text/javascript" src="../Scripts/CustomJS.js"></script>
  8. <script type="text/javascript">
  9. var hostweburl;
  10. $(document).ready(function () {
  11. hostweburl =
  12. decodeURIComponent(
  13. getQueryStringParameter("SPHostUrl")
  14. );
  15. var scriptbase = hostweburl + "/_layouts/15/";
  16. //Do not change the order, scripts should load by order.
  17.  
  18. $.getScript(scriptbase + "init.js").done(function () {
  19. $.getScript(scriptbase + "sp.runtime.js").done(function () {
  20. $.getScript(scriptbase + "sp.js").done(function () {
  21. $.getScript(scriptbase + "ScriptResx.ashx?name=sp.res&culture=en-us").done(function () {
  22. $.getScript(scriptbase + "sp.init.js").done(function () {
  23. $.getScript(scriptbase + "sp.ui.dialog.js").done(function () {
  24. $.getStylesheet(scriptbase + '/1033/styles/corev15.css').done(function () {
  25. sharePointReady(hostweburl);
  26. })
  27. })
  28. })
  29. })
  30. })
  31. })
  32. })
  33. });
  34. (function ($) {
  35. $.getStylesheet = function (href) {
  36. var $d = $.Deferred();
  37. var $link = $('<link/>', {
  38. rel: 'stylesheet',
  39. type: 'text/css',
  40. href: href
  41. }).appendTo('head');
  42. $d.resolve($link);
  43. return $d.promise();
  44. };
  45. })(jQuery);
  46. function getQueryStringParameter(paramToRetrieve) {
  47. var params =
  48. document.URL.split("?")[1].split("&");
  49. var strParams = "";
  50. for (var i = 0; i < params.length; i = i + 1) {
  51. var singleParam = params[i].split("=");
  52. if (singleParam[0] == paramToRetrieve)
  53. return singleParam[1];
  54. }
  55. }
  56. </script>
  57. </head>
  58. <body>
  59. <form id="form1" runat="server">
  60. <div>
  61. </div>
  62. </form>
  63. </body>
  64. </html>
  65.  
  66. function sharePointReady(hostweburl) {
  67. var _html = document.createElement('h1');
  68. _html.innerHTML = 'SharePoint Ready';
  69. var _options = { html: _html };
  70. SP.UI.ModalDialog.showModalDialog(_options);
  71. //fix for close button
  72. $('.ms-dlgCloseBtnImg').attr('src', hostweburl + '/_layouts/15/images/fgimg.png?rev=44');
  73.  
  74. }
Add Comment
Please, Sign In to add comment