js:wrap_fetch

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
js:wrap_fetch [2024/11/04 12:47] – créée avillepreuxjs:wrap_fetch [2024/11/04 15:54] (Version actuelle) avillepreux
Ligne 1: Ligne 1:
  
 <CSS> <CSS>
 +
 +.redmine-stats table.table > :is(thead, tbody) > tr > :is(th,td) {
 +    padding: .1em 1ch .1em 3ch;
 +    text-align: right;
 +}
 </CSS> </CSS>
 <JS> <JS>
Ligne 8: Ligne 13:
   console.log("CYA EMBED", "Parsing...");   console.log("CYA EMBED", "Parsing...");
  
-  jQuery(".plugin_wrap.wrap_embed").each(function() {+  jQuery(".plugin_wrap.wrap_embed, .plugin_wrap.wrap_fetch").each(function() {
      
     var wrap = jQuery(this);     var wrap = jQuery(this);
 +    var html = wrap.text().trim();
     var url  = "";     var url  = "";
          
-    if (wrap.attr("service") == "redmine-stats"{+    var params = html.split("/");
          
-    url = "https://web.cyanide-studio.com/tools/redmine/?key=cron-trd6soihq4hedr687ioj685re5364se&format=md&project=" + wrap.attr("project");+    wrap.html("...");
          
 +    console.log("CYA EMBED", "Parsing...", "Found", this, params);
 +    
 +    if (params.length >= 2 && params[0] == "redmine-stats") {
 +    
 +    console.log("CYA EMBED", "Parsing...", "Found known service", params[0]);
 +    url = "https://web.cyanide-studio.com/tools/redmine/?key=cron-trd6soihq4hedr687ioj685re5364se&format=html&project=" + params[1];
     }     }
          
     if (url != "") {     if (url != "") {
          
-      console.log("CYA EMBED", "Found URL");+      console.log("CYA EMBED", "Found URL", url);
          
       jQuery.ajax({       jQuery.ajax({
Ligne 29: Ligne 41:
         async:      true,         async:      true,
         success:    function(html) {         success:    function(html) {
 +        
    this.addClass("redmine-stats");    this.addClass("redmine-stats");
           this.html(html);           this.html(html);
           console.log("CYA EMBED", "Embeded !");           console.log("CYA EMBED", "Embeded !");
 +        },
 +        error: function(html) {
 +        
 +   console.log("CYA EMBED", "Error !", html);
 +        },
 +        complete:    function(html) {
 +        
 +   console.log("CYA EMBED", "Complete !", html);
         }         }
       });       });
  • js/wrap_fetch.1730720842.txt.gz
  • Dernière modification : 2024/11/04 12:47
  • de avillepreux