You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app_icon.js 643 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. // MIT License. See license.txt
  3. wn.provide("wn.ui")
  4. wn.ui.app_icon = {
  5. get_html: function(app, small) {
  6. var icon = wn.modules[app].icon;
  7. var color = wn.modules[app].color;
  8. if(icon.split(".").slice(-1)[0]==="svg") {
  9. $.ajax({
  10. url: icon,
  11. dataType: "text",
  12. async: false,
  13. success: function(data) {
  14. icon = data;
  15. }
  16. })
  17. icon = '<object>'+icon+'</object>';
  18. } else {
  19. icon = '<i class="'+icon+'"></i>'
  20. }
  21. return '<div class="app-icon'+ (small ? " app-icon-small" : "")
  22. +'" style="background-color:'+color+'">'+icon+'</div>'
  23. }
  24. }