Playground: Difference between revisions
m (some cosmetics) |
m (Triple ai) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
q: How do we get a WikiMedia+WysiWyg+extension, i.e. a graphical editor? | q: How do we get a WikiMedia+WysiWyg+extension, i.e. a graphical editor? | ||
g: | g: Wikipedia+WysiWyg+extension | ||
f: Thank you, here it is: | f: Thank you, here it is: MediaWiki+Extension+WYSIWYG | ||
q: Isn't there a shorter name for such a WysiWyg editor? | q: Isn't there a shorter name for such a WysiWyg editor? | ||
b: Here it is: | b: Here it is: MediaWiki+VisualEditor+UserGuide. | ||
f: Hallo Falk, do you have experience how to configurate the VisualEditor? Actually, we don't need it yet. | f: Hallo Falk, do you have experience how to configurate the VisualEditor? Actually, we don't need it yet. | ||
<html> | |||
q: What is the meaning of the tiny link, named "ai"<p> | |||
f: Click the following "ai" to WikiFy the page. -> | |||
javascript:function ai(){var WikiMap=['http://google.com/search?q=','https://aipedia.eu/index.php?title='],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,' °',' ¹',' ²',' ³'];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);}}}msg='alca enabled with:\n'+'\nMainLink:'+WikiMap[0]+'\n0:'+WikiMap[1]+'\n1:'+WikiMap[2]+'\n2:'+WikiMap[3]+'\n3:'+WikiMap[4]+'\n:'+'\n:'+'Intermediate Webpages:'+'\n:'+document.location;}ai(); | <a href="javascript:function ai(){var WikiMap=['http://google.com/search?q=','https://aipedia.eu/index.php?title='],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,' °',' ¹',' ²',' ³'];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);}}}msg='alca enabled with:\n'+'\nMainLink:'+WikiMap[0]+'\n0:'+WikiMap[1]+'\n1:'+WikiMap[2]+'\n2:'+WikiMap[3]+'\n3:'+WikiMap[4]+'\n:'+'\n:'+'Intermediate Webpages:'+'\n:'+document.location;}ai();">ai</a> | ||
</html> | </html> | ||
q: And how do I get rid of the dynamical link, created by our tiny ai? | |||
f: Refresh this page in your Browser. | |||
q: Can we use this Bookmarklet ai on any Webpage? | |||
f: Yes, rather on any page, i.e. on any page built by DOM. | |||
q: How do we do that? | |||
f: DragAndDrop this AiBookmarklet into your BookmarkList. Then go to another textbased page and click ai in the BookmarkList. | |||
q: Why did you modify the external links into CamelCasoid (sic) ? | |||
ai: Because I will do it for you with DynamicLinks. | |||
q: What are the benefits if you do it. | |||
ai: You'll find the answer in DynamicLinks. | |||
<html><a href="javascript:function ai(){var WikiMap=['http://google.com/search?q=','https://aipedia.eu/index.php?title=','https://etherpad.wikimedia.org/p/'],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,' °',' ¹',' ²',' ³'];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);}}}msg='alca enabled with:\n'+'\nMainLink:'+WikiMap[0]+'\n0:'+WikiMap[1]+'\n1:'+WikiMap[2]+'\n2:'+WikiMap[3]+'\n3:'+WikiMap[4]+'\n:'+'\n:'+'Intermediate Webpages:'+'\n:'+document.location;}ai();"><bold> => ai </bold></a> | |||
</html> | |||
( ai: I create MultiLinks for: MainLink=GoogleSearch, 0=AiPedia, 1=MediaWikiEtherpad, in prealpha mostly empty, but helpful for bootstrapping. ) |
Latest revision as of 02:32, 14 November 2017
q: What's this page good for?
f: Every decent Wiki needs a playground, where we can test the capabilities.
q: How do we get a WikiMedia+WysiWyg+extension, i.e. a graphical editor?
g: Wikipedia+WysiWyg+extension
f: Thank you, here it is: MediaWiki+Extension+WYSIWYG
q: Isn't there a shorter name for such a WysiWyg editor?
b: Here it is: MediaWiki+VisualEditor+UserGuide.
f: Hallo Falk, do you have experience how to configurate the VisualEditor? Actually, we don't need it yet.
q: What is the meaning of the tiny link, named "ai"
f: Click the following "ai" to WikiFy the page. -> ai
q: And how do I get rid of the dynamical link, created by our tiny ai?
f: Refresh this page in your Browser.
q: Can we use this Bookmarklet ai on any Webpage?
f: Yes, rather on any page, i.e. on any page built by DOM.
q: How do we do that?
f: DragAndDrop this AiBookmarklet into your BookmarkList. Then go to another textbased page and click ai in the BookmarkList.
q: Why did you modify the external links into CamelCasoid (sic) ?
ai: Because I will do it for you with DynamicLinks.
q: What are the benefits if you do it.
ai: You'll find the answer in DynamicLinks.
( ai: I create MultiLinks for: MainLink=GoogleSearch, 0=AiPedia, 1=MediaWikiEtherpad, in prealpha mostly empty, but helpful for bootstrapping. )