Difference between revisions of "Widget:ApprovedMaterials"

From LNF Wiki
Jump to navigation Jump to search
(Changed google docs link, attempting to fix CORS error)
 
(5 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
     google.setOnLoadCallback(init);
 
     google.setOnLoadCallback(init);
  
     var dataSourceUrlTools = 'https://spreadsheets.google.com/tq?key=1Zte9fjJZwD9I9xH3vhPDzumTvd3adLVZmWMz4KICa5U&gid=2061549768';
+
     var dataSourceUrlTools = 'https://docs.google.com/spreadsheets/d/1Zte9fjJZwD9I9xH3vhPDzumTvd3adLVZmWMz4KICa5U/gviz/tq?gid=2061549768';
     var dataSourceUrlMaterials = 'https://spreadsheets.google.com/tq?key=1Zte9fjJZwD9I9xH3vhPDzumTvd3adLVZmWMz4KICa5U&gid=821540815';
+
     var dataSourceUrlMaterials = 'https://docs.google.com/spreadsheets/d/1Zte9fjJZwD9I9xH3vhPDzumTvd3adLVZmWMz4KICa5U/gviz/tq?gid=821540815';
  
  
Line 44: Line 44:
 
         }
 
         }
  
         someString = "<h4>Approved Materials</h4><table><tr>";
+
         //someString = "<h4>Approved Materials</h4><table><tr>";
 +
someString = "<table><tr>";
  
 
         for(var catKey in uniqueCategories){
 
         for(var catKey in uniqueCategories){
Line 67: Line 68:
  
  
         Now do the same thing for non-approved materials
+
         //Now do the same thing for non-approved materials
 
         // someString2 = "<h4>Materials Not Allowed</h4><table><tr>";
 
         // someString2 = "<h4>Materials Not Allowed</h4><table><tr>";
  
Line 90: Line 91:
 
          
 
          
 
         document.getElementById("approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString;
 
         document.getElementById("approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString;
         document.getElementById("non_approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString2;
+
         //document.getElementById("non_approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString2;
  
 
     }
 
     }

Latest revision as of 08:24, 28 July 2020

This widget will display the approved and restricted materials for a tool based on its toolid. Use the following code:

{{#widget:ApprovedMaterials|toolid=#####|header=Y/N}}