Catégorie : Niveau intermédiaire

Envoie d’email et spam (via OVH)

Si on envoie des emails depuis notre propre serveur, avec notre propre domaine, certaines mailbox (comme Gmail) pourraient vous détecter comme du spam ! Pour éviter cela, il faut prendre quelques précautions. Type « SPF » Tout d’abord, il faut ajouter une entrée SPF via le gestionnaire de domaine d’OVH. Le wizard va aider à composer la […]

Émuler Raspberry Pi sous Windows

Depuis que j’ai fait assistant-plugins, j’ai plusieurs utilisateurs qui m’ont demandé comment l’installer sur leur Raspberry. Ce système est censé être similaire à une Debian, cependant ils semblent y avoir des différences… J’ai donc cherché à émuler cet OS sous mon Windows 10. Sources : https://blogs.msdn.microsoft.com/iliast/2016/11/10/how-to-emulate-raspberry-pi/ https://enavarro.me/emuler-un-raspberry-pi-avec-qemu.html Voici les étapes : Télécharger la dernière version […]

Overwrite the Created field for a Sharepoint list item

Sharepoint provides automatic fields, like « Created » that contains the creation date of a list item. It’s a readonly field. You could use a webservice to change the ReadOnly property in order to overwrite its value. Using SharepointPlus the code is: // don’t change the below information // the details about this field are found using […]

Classic ASP to get a remote page with NTLM authenticate

It’s very frustrating to have to work with ASP again, after so many years… I wanted to use an ASP page to get a remote page. However I needed to pass some NTLM authenticate to it. After a few searches I found this solution: <% ‘ I want this page to be accessible for Cross […]

Sharepoint WopiFrame allow framing

In Sharepoint you can use <WebPartPages:AllowFraming runat= »server » /> to disable the SAMEORIGIN for X-FRAME-OPTION giving you the opportunity to call your page from an iframe (see this other article). However you cannot use the same trick to preview a file into the browser with WopiFrame.aspx. But there is a way to do it, using the […]

Change a « Choice with Fill-In » field into a magic dropdown [Sharepoint]

Sometimes you want to modify the options for a dropdown box by removing some existing options, however you want to be able to keep these old values for reporting or whatever reasons. Below is a way to do it by using jQuery and SharepointPlus. It will hide the « Specify your own value » stuff, and add […]

Trigger an event when a file is uploaded on Sharepoint 2013 by drag and drop

If you want to trigger an event after a drag&drop a file for an upload operation on Sharepoint, then you’ll have to add some JavaScript into your page. // we need to make sure sp.core.js is loaded SP.SOD.executeOrDelayUntilScriptLoaded(function() { window.UploadFinishFunc=function(b, a) { typeof g_currentControl.postUploadFunc == « function » && a.status != UploadStatus.CANCELLED && g_currentControl.postUploadFunc(a.files); a.status != UploadStatus.CANCELLED […]

Adding a custom action to a callout in SharePoint 2013

This article has been VERY useful. But I wanted something lightly different: I wanted to add a custom action, but also have the « EDIT » button (but not the « SHARE »), and to use the current item info for my custom action. Here is the result: // source: https://www.eliostruyf.com/adding-a-custom-action-to-a-callout-in-sharepoint-2013/ // add a special callout action for our […]

Trigger an event when an element is visible in a scrollable area [JavaScript]

EDIT in 2022 It might also be interesting to look at Intersection Observer that is now available in most browsers, and there is also a polyfill. const observer = new IntersectionObserver((entries, observer) => { entries.forEach((entry) => { let isVisible=(entry.intersectionRatio===1); }); }, {threshold:1}); observer.observe(document.querySelector(‘#element’); END EDIT I have this specific need that is to trigger an […]