selection_test.mustache 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <p>Consumer Key: <span id="consumer_key"><%= params[:oauth_consumer_key] %></span></p>
  19. <% if params[:ext_content_intended_use] == 'embed' || params[:ext_content_intended_use] == 'homework' %>
  20. <a id="image_link" class="link" href="<%= @return_url %>?return_type=image&url=/images/delete.png&width=16&height=16&alt=delete">image embed</a>
  21. <br/>
  22. <a id="link_link" class="link" href="<%= @return_url %>?embed_type=link&url=/images/delete.png&title=delete&text=delete+link">link embed</a>
  23. <br/>
  24. <% end %>
  25. <a id="basic_lti_link" class="link" href="<%= @return_url %>?return_type=lti_launch_url&url=http://www.example.com&title=lti+link&text=lti+embedded+link">lti link embed</a>
  26. <br/>
  27. <% if params[:ext_content_intended_use] == 'embed' %>
  28. <a id="iframe_link" class="link" href="<%= @return_url %>?return_type=iframe&url=/images/delete.png&width=100&height=100&title=delete">iframe embed</a>
  29. <br/>
  30. <a id="oembed_link" class="link" href="<%= @return_url %>?return_type=oembed&endpoint=<%= CGI.escape("http://www.flickr.com/services/oembed/") %>&url=<%= CGI.escape("http://www.flickr.com/photos/bees/2341623661/") %>">oembed embed</a>
  31. <br/>
  32. <% else %>
  33. <a id="bad_url_basic_lti_link" class="link" href="<%= @return_url %>?return_type=basic_lti&url=asdf&title=lti+link&text=lti+embedded+link">bad lti link embed (bad url)</a>
  34. <br/>
  35. <a id="no_url_basic_lti_link" class="link" href="<%= @return_url %>?return_type=lti_launch_url&title=lti+link&text=lti+embedded+link">bad lti link embed (no url)</a>
  36. <br/>
  37. <a id="no_text_basic_lti_link" class="link" href="<%= @return_url %>?return_type=basic_lti&url=http://www.example.com">bad lti link embed (no text)</a>
  38. <br/>
  39. <% end %>
  40. <% if params[:ext_content_intended_use] == 'homework' %>
  41. <a id="full_url_link" class="link" href="<%= @return_url %>?return_type=url&url=<%= CGI.escape("#{HostUrl.protocol}://#{HostUrl.default_host}/images/delete.png") %>&text=delete&title=delete">full URL link embed</a>
  42. <br/>
  43. <a id="file_link" class="link" href="<%= @return_url %>?return_type=file&url=<%= CGI.escape("#{HostUrl.protocol}://#{HostUrl.default_host}/images/delete.png") %>&text=<%= CGI.escape("delete.png") %>">file embed</a>
  44. <br/>
  45. <a id="mime_type_file_link" class="link" href="<%= @return_url %>?return_type=file&url=<%= CGI.escape("#{HostUrl.protocol}://#{HostUrl.default_host}/robots.txt") %>&text=<%= CGI.escape("robots") %>&content_type=<%= CGI.escape("text/plain") %>">file embed</a>
  46. <br/>
  47. <a id="bad_file_link" class="link" href="<%= @return_url %>?return_type=file&url=<%= CGI.escape("#{HostUrl.protocol}://#{HostUrl.default_host}/images/delete_404.png") %>&text=<%= CGI.escape("delete.png") %>&content_type=<%= CGI.escape("image/png") %>">bad file embed</a>
  48. <br/>
  49. <% end %>
  50. <% if params[:ext_content_intended_use] == 'content_package' %>
  51. <a id="file_link" class="link" href="<%= @return_url %>?return_type=file&url=<%= CGI.escape("#{HostUrl.protocol}://#{HostUrl.default_host}/images/delete.png") %>&text=<%= CGI.escape("delete.png") %>">file embed</a>
  52. <br/>
  53. <% end %>