1 module uim.html.elements.a; 2 3 import uim.html; 4 5 class DH5A : DH5Obj { 6 mixin(H5This!"a"); 7 } 8 mixin(H5Short!"A"); 9 10 unittest { 11 assert(Assert(H5A,"<a></a>")); 12 } 13 14 /** 15 * DH5A, H5A, H5.A defines a hyperlink to link from one page to another. 16 The href attribute indicates the link's destination. 17 Hint: By default, links will appear as follows in all browsers: 18 An unvisited link is underlined and blue 19 A visited link is underlined and purple 20 An active link is underlined and red 21 * / 22 23 /** 24 * Hyperlinks, auch „Verweise“ genannt, werden durch a-Elemente realisiert. 25 * Sie sind ein entscheidender Bestandteil jedes Hypertext-Projekts und der „intelligente Mehrwert“ des World Wide Web. a bedeutet anchor, Anker, 26 * weil ein anderes Dokument durch einen Link verankert wird. 27 * / 28 class DH5A : DH5Obj { 29 mixin(H5This!"a"); 30 31 /* download specifies that the target (a file) will be downloaded when a user clicks on the link (attribute href) instead of navigating to the file). * / 32 /* if value not empty ("") => new filename for the downloaded file. * / 33 mixin(MyAttribute!"download"); 34 unittest { 35 assert(Assert(H5A.download("download"), `<a download="download"></a>`); 36 assert(Assert(H5A.download("fileName.txt"), `<a download="fileName.txt"></a>`); 37 } 38 39 /* href specifies the URL of the page goes to. * 40 / 41 mixin(MyAttribute!"href"); 42 unittest { 43 assert(Assert(H5A.href("test.html"), `<a href="test.html"></a>`); 44 // <a href="javascript:alert('Hello World!');">Execute JavaScript</a> 45 } 46 47 mixin(MyAttribute!"hreflang"); 48 unittest { 49 assert(Assert(H5A.hreflang("test"), `<a hreflang="test"></a>`); 50 } 51 52 mixin(MyAttribute!"ping"); 53 unittest { 54 assert(Assert(H5A.ping("test"), `<a ping="test"></a>`); 55 } 56 57 mixin(MyAttribute!"referrerpolicy"); 58 unittest { 59 assert(Assert(H5A.referrerpolicy("test"), `<a referrerpolicy="test"></a>`); 60 } 61 62 mixin(MyAttribute!"rel"); 63 unittest { 64 assert(Assert(H5A.rel("test"), `<a rel="test"></a>`); 65 } 66 mixin(MyAttribute!"target"); 67 unittest { 68 assert(Assert(H5A.target("test"), `<a target="test"></a>`); 69 } 70 71 mixin(MyAttribute!"type"); 72 unittest { 73 assert(Assert(H5A.type("test"), `<a type="test"></a>`); 74 } 75 } 76 mixin(H5Short!"A"); 77 78 unittest { 79 assert(Assert(H5A == "<a></a>"); 80 } 81 */