SandBox: Difference between revisions

From fridemar.ai
Jump to navigation Jump to search
mNo edit summary
m (cgpt work in progress)
Line 85: Line 85:


</html>
</html>
---


<html>
<html>


<a href="javascript:function cgpt() {
<a href="javascript:function cgpt() {
     var WikiMap = ['http://google.com/search?q=','https://everipedia.org/wiki/','https://wikipedia.org/wiki/','https://twitter.com/search?q=','https://twitter.com/hashtag/','https://www.youtube.com/results?search_query=', 'https://aipedia.eu/wiki/' ],
      
        i, j, k, len, llen, link, linkpatt,
      
        linkText, linkTextArray = [], msg, myArray, node, txt, href, a, reg, span,
        lastLastIndex, textNodeXpath, textNodes;
 
    textNodeXpath = './/text()[not(ancestor::a) and not(ancestor::head)and not(ancestor::option) and not(ancestor::textarea)]';
    textNodes = document.evaluate(textNodeXpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
 
    len = textNodes.snapshotLength;
    reg = /^\s+$/g;
    linkpatt = /\b(?:([a-z0-9äöü]*(?:[A-ZÄÖÜ_]|_)[a-z0-9äöü_]*){2,})\b/g;
 
    for (i = 0; i < len; i++) {
        node = textNodes.snapshotItem(i);
        txt = node.nodeValue; txt = txt.replace(reg, '');
 
        if (linkpatt.test(txt)) {
            span = document.createElement('span');
            lastLastIndex = 0;
            linkpatt.lastIndex = 0;
            try {
                while (true) {
                    myArray = linkpatt.exec(txt);
                    if (!myArray) break;
 
                    link = myArray[0];
                    linkTextArray = [link, ' (e', ' w', ' t', ' h', ' y', ' a)'];
                    span.appendChild(document.createTextNode(txt.substring(lastLastIndex, myArray.index)));
                    lastLastIndex = linkpatt.lastIndex;
                    linkText = myArray[1];
                    link = myArray[0];
                    llen = link.length;
 
                    if (link.substring(0, 2) === '' && link.substring(llen - 2, llen) === '') {
                        link = link.substring(2, llen - 2);
                    }
 
                    for (j = 0; j < Math.min(WikiMap.length, linkTextArray.length); j++) {
                        href = WikiMap[j] + link;
                        a = document.createElement('a');
                        a.setAttribute('href', href);
                        a.appendChild(document.createTextNode(linkTextArray[j]));
                        span.appendChild(a);
                    }
                }
                span.appendChild(document.createTextNode(txt.substring(lastLastIndex)));
                node.parentNode.replaceChild(span, node);
            } catch (e) {
                alert(e);
            }
        }
     }
}
}
cgpt();">chatGpt</a>
cgpt();">chatGpt</a>


</html>
</html>

Revision as of 23:30, 28 June 2023

This is a WikiPage, where users can test out features of a Wiki.

Each Wiki should have such a place for helping new users to test out Wiki features. too.

From YouBot

To list external URLs in a wiki page, use the following code:


https://ai-commons.org https://www.aicrowd.com http://aiwiki.org https://aihub.org https://aiwikiproject.org https://aiwikibook.org


Code Assistance in the NetBeans IDE Java Editor: A Reference Guide https://netbeans.apache.org/kb/docs/java/editor-codereference.html GitLab Flavored Markdown (GLFM) | GitLab https://docs.gitlab.com/ee/user/markdown.html REDCap Frequently Asked Questions - Wiki@UCSF https://wiki.library.ucsf.edu/display/RKB/REDCap+Frequently+Asked+Questions

WikifyWeb ---


chatGpt