js

Différences

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

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
js [2023/02/14 16:13] avillepreuxjs [2024/04/22 14:36] (Version actuelle) avillepreux
Ligne 1: Ligne 1:
- 
-<html><script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"></script></html> 
- 
 <JS> <JS>
  
 /* THIS SCRIPT IS COMMON TO ALL INTRANET - MODIFY WITH CARE  */ /* THIS SCRIPT IS COMMON TO ALL INTRANET - MODIFY WITH CARE  */
  
-jQuery(document).ready(function() +console.log("Loading cyanide scripts");
-+
-    // Gérer les ancres "<WRAP anchor #ancre/>" +
- +
-    jQuery('.wrap_anchor').each(function()  +
-    { +
-        var id = jQuery(this).attr('id'); +
-         +
-        jQuery(this).replaceWith('<a class="anchorjs-link " href="#'+id+'" aria-label="Anchor link for: '+id+'" data-anchorjs-icon="" style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1; padding-left: 0.375em;"></a>'); +
-    }); +
-     +
-//  Bouton "élargir la page" +
- +
-    if (typeof(fullwidth_toggle) === 'undefined'+
-    { +
-        fullwidth_toggle = true; +
-     +
-        jQuery('.dw-page-icons>ul').prepend('<li><a class="fullwidth_toggle" href="javascript:void(0);" style="text-decoration: none">◁▷</a></li>'); +
- +
-        jQuery(".fullwidth_toggle").click(function() { if (jQuery(".fullwidth_toggle").html().indexOf("◁▷") > -1) { jQuery(".fullwidth_toggle").html('▷◁'); jQuery(".container").css("width", "calc(100vw - 18px)"); jQuery(".container").css("max-width", "100%");       }  +
-                                                                                                              else { jQuery(".fullwidth_toggle").html('◁▷'); jQuery(".container").css("width", "calc(100vw - 18px)"); jQuery(".container").css("max-width", "1300px");     } }); +
-    } +
-     +
-    jQuery(".tools-animation").removeClass("tools-animation"); +
-     +
-//  On Clipboard copy +
-/* +
- +
-    jQuery("body").bind("copy", function(e) { +
- +
-        console.log("Clipboard copy detected"); +
- +
-        var c = e.originalEvent.clipboardData; +
-     +
-        if (c.types.length > 0) +
-        { +
-            var data = c.getData(c.types[0]); +
-            console.log(data); +
-        } +
-        else +
-        { +
-            navigator.clipboard.read().then(function(items) +
-            {             +
-                for (let i = 0; i < items.length; i++)  +
-                { +
-                    for (let t = 0; t < items[i].types.length; t++)  +
-                    { +
-                        if (items[i].types[t] == "text/html")  +
-                        { +
-                            items[i].getType(items[i].types[t]).then(function(blob)  +
-                            { +
-                                blob.text().then(function(html)  +
-                                { +
-                                    var modified = false; +
-                                     +
-                                    while (true) +
-                                    { +
-                                        var bgn_tag = '<'+'div class="secedit editbutton'; +
-                                        var end_tag = '<'+'/button'+'><'+'/div'+'><'+'/form'+'><'+'/div'+'>'; +
-                                     +
-                                        var bgn_pos = html.indexOf(bgn_tag); +
-                                        var end_pos = html.indexOf(end_tag); +
-                                     +
-                                        if (bgn_pos < 0 || end_pos < 0) break; +
-                                         +
-                                        modified = true; +
-                                         +
-                                        html = html.substring(0, bgn_pos) + html.substring(end_pos + end_tag.length); +
-                                    } +
-                                     +
-                                    if (modified) +
-                                    {       +
-                                        const data = new Blob([html], {type: 'text/html'}) +
-                                        const item = new ClipboardItem({'text/html': data}); +
-                                        navigator.clipboard.write([item]); +
-                                         +
-                                        c.setData('text/html', html); +
-                                                                             +
-                                        console.log("Clipboard content cleaned!"); +
-                                    } +
-                                }); +
-                            }); +
-                        } +
-                    } +
-                }             +
-            }); +
-        } +
-    }); +
-     +
-    */ +
-  +
-});+
  
 </JS> </JS>
  
 +<html><script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"></script></html>
  
-<JS> +{{page>/js/new_dokuwiki}} 
- +{{page>/js/clipboard}}
-/* Teams doc embedding via custom WRAP teamsdoc */ +
- +
-jQuery(function() { +
- +
-    if (typeof(wrap_teamsdoc) === 'undefined'+
-    { +
-        wrap_teamsdoc = true; +
-         +
-        var original_url = jQuery(".wrap_teamsdoc").text(); +
-     +
-        var url = original_url; +
-         +
-        url = url.replace("&mobileredirect=true", ""); +
-        url = url.replace("&action=default",      ""); +
-         +
-        url = url.replace("%7B", "{"); +
-        url = url.replace("%7D", "}"); +
-         +
-        var pos = url.indexOf("&file="); +
-         +
-        if (pos > 0) { +
-            url = url.substring(0, url.indexOf("&file=")); +
-            +
-         +
-        if (url != ""+
-            +
-            url = url.trim() + "&amp;action=embedview"; +
-         +
-            console.log("CYA : TEAMSDOC", url); +
-         +
-            jQuery(".wrap_teamsdoc").html('<iframe src="' + url + '" width="100%" height="auto" frameborder="0"><a target="_blank" href="' + original_url + '">Show doc in Teams</a></iframe><p><a target="_blank" href="' + original_url + '">Show doc in Teams</a>'); +
-     +
-            document.querySelectorAll(".wrap_teamsdoc iframe").forEach(function(e) { +
-     +
-                e.style.aspectRatio = "1 / 2"; +
-         +
-            }); +
-        } +
-    } +
- +
-}); +
- +
- +
-</JS> +
- +
- +
- +
- +
 {{page>/js/inline_toc}} {{page>/js/inline_toc}}
 +{{page>/js/fullwidth_toggle}}
 +{{page>/js/dokuwiki_tools-animation_disable}}
 {{page>/js/layout_filters}} {{page>/js/layout_filters}}
 +{{page>/js/storm_hide}}
 {{page>/js/nacon_hide}} {{page>/js/nacon_hide}}
 {{page>/js/gif}} {{page>/js/gif}}
Ligne 167: Ligne 28:
 {{page>/js/wrap_jenkins}} {{page>/js/wrap_jenkins}}
 {{page>/js/wrap_img-extend}} {{page>/js/wrap_img-extend}}
 +{{page>/js/wrap_diagram-url}}
 +{{page>/js/wrap_teamsdoc}}
 +{{page>/js/wrap_anchor}}
  
  • js.1676387603.txt.gz
  • Dernière modification : 2023/02/14 16:13
  • de avillepreux