1var footer = { 2 view: "toolbar", 3 id: "footerId", 4 cols: [ 5 { 6 view: "template", 7 template: isAndroid 8 ? "<a href='https://play.google.com/store/apps/details?id=com.burak.risaleinur'><img alt='Get it on Google Play' style='height:100%' src='img/android_icon.png'/></a>" 9 : "<a href='https://apps.apple.com/app/id1502903479'><img alt='Get it on App Store' style='height:90%' src='img/apple_icon.svg'/></a>", 10 height: 50, 11 borderless: true, 12 css: { "text-align": "center" }, 13 }, 14 { 15 view: "icon", 16 icon: "mdi mdi-close", 17 click: () => { 18 webix.$$("footerId").hide(); 19 }, 20 }, 21 ], 22}; 23 24var toolbar = { 25 view: "toolbar", 26 id: "toolbarId", 27 padding: 3, 28 elements: [ 29 { 30 view: "icon", 31 icon: "mdi mdi-menu", 32 id: "menuIconId", 33 tooltip: _("Expand menu"), 34 click: function () { 35 $$("sidebarId").toggle(); 36 }, 37 }, 38 { hidden: isMobile, gravity: 0.7 }, 39 { 40 view: "label", 41 label: _("Risale-i Nur Comparative"), 42 id: "mainLabelId", 43 css: "mainLabelCss", 44 }, 45 { 46 view: "button", 47 type: "icon", 48 icon: "mdi mdi-undo", 49 label: _("Back"), 50 width: 100, 51 on: { 52 onItemClick: (id, e) => { 53 window.history.back(); 54 }, 55 }, 56 }, 57 ], 58}; 59 60var sidebar = { 61 view: "sidebar", 62 id: "sidebarId", 63 width: 200, 64 scroll: isMobile, 65 collapsed: isMobile, 66 data: [ 67 { id: "langId", icon: "mdi mdi-flag-outline", value: _("Languages") }, 68 { id: "languageId", icon: "mdi mdi-book", value: _("Web Language") }, 69 { id: "aboutId", icon: "mdi mdi-sticker-alert-outline", value: _("About Us") }, 70 { id: "callId", icon: "mdi mdi-comment-text-outline", value: _("Contact Us") }, 71 { id: "shareId", icon: "mdi mdi-share", value: _("Share") }, 72 { id: "androidId", icon: "mdi mdi-android", value: _("Android App") }, 73 { id: "iosId", icon: "mdi mdi-apple", value: _("IOS App") }, 74 ], 75 on: { 76 onAfterSelect: function (id) { 77 getSelectedView(id); 78 }, 79 }, 80}; 81 82function getSelectedView(viewId) { 83 var myView; 84 switch (viewId) { 85 case "langId": 86 myView = getLangView(); 87 window.history.pushState("lang", null, ""); 88 break; 89 case "trDictId": 90 window.open("https://www.luggat.com/", "_blank"); 91 $$("sidebarId").unselectAll(); 92 break; 93 case "engDictId": 94 window.open("https://dictionary.cambridge.org/", "_blank"); 95 $$("sidebarId").unselectAll(); 96 break; 97 case "downloadId": 98 window.open("http://www.kuranikerim.net.tr/risale-kulliyati.html", "_blank"); 99 $$("sidebarId").unselectAll(); 100 break; 101 case "languageId": 102 showLangMenu(); 103 $$("sidebarId").unselectAll(); 104 break; 105 case "aboutId": 106 showTextWindow("aboutUsId", _("About Us"), _("About Text"), [300, 300]); 107 $$("sidebarId").unselectAll(); 108 break; 109 case "callId": 110 window.location.href = "mailto:[email protected]"; 111 $$("sidebarId").unselectAll(); 112 break; 113 case "shareId": 114 shareApp(); 115 $$("sidebarId").unselectAll(); 116 break; 117 case "androidId": 118 window.open("https://play.google.com/store/apps/details?id=com.burak.risaleinur"); 119 break; 120 case "iosId": 121 window.open("https://apps.apple.com/app/id1502903479"); 122 break; 123 } 124 if (myView) webix.ui(myView, $$("mainViewId")); 125} 126 127function shareApp() { 128 if (navigator.share) { 129 navigator.share({ 130 title: _("Risale-i Nur Comparative"), 131 text: _("Share Risale-i Nur Comparative"), 132 url: "https://risaleglobal.com/", 133 }); 134 } else { 135 let shareTxt = _("Risale-i Nur Comparative") + "\n" + _("Share Risale-i Nur Comparative") + "https://risaleglobal.com/"; 136 navigator.clipboard.writeText(shareTxt).then(function () { 137 webix.message(_("Url copied")); 138 }); 139 } 140} 141 142function showLangMenu() { 143 var result = { 144 view: "window", 145 head: false, 146 modal: true, 147 position: "center", 148 id: "langMenuId", 149 scroll: true, 150 body: { 151 padding: 5, 152 rows: [ 153 { 154 view: "icon", 155 align: "right", 156 icon: "mdi mdi-window-close", 157 click: () => { 158 webix.$$("langMenuId").close(); 159 }, 160 }, 161 { 162 view: "radio", 163 vertical: true, 164 width: 250, 165 value: window.rnk.lang, 166 on: { 167 onChange: (newVal, oldVal) => { 168 myStorage("put", "rnkLang", newVal); 169 window.rnk.lang = newVal; 170 location.reload(); 171 }, 172 }, 173 options: [ 174 { id: Language.Turkish, value: _("Turkish") + " - " + _("Turkish", Language.Turkish) }, 175 { id: Language.English, value: _("English") + " - " + _("English", Language.English) }, 176 { id: Language.Kyrgyz, value: _("Kyrgyz") + " - " + _("Kyrgyz", Language.Kyrgyz) }, 177 { id: Language.Arabic, value: _("Arabic") + " - " + _("Arabic", Language.Arabic) }, 178 { id: Language.Russian, value: _("Russian") + " - " + _("Russian", Language.Russian) }, 179 { id: Language.French, value: _("French") + " - " + _("French", Language.French) }, 180 { id: Language.German, value: _("German") + " - " + _("German", Language.German) }, 181 { id: Language.Chinese, value: _("Chinese") + " - " + _("Chinese", Language.Chinese) },
182 { id: Language.Indonesian, value: _("Indonesian") + " - " + _("Indonesian", Language.Indonesian) }, 183 { id: Language.Japanese, value: _("Japanese") + " - " + _("Japanese", Language.Japanese) }, 184 { id: Language.Persian, value: _("Persian") + " - " + _("Persian", Language.Persian) }, 185 { id: Language.Uzbek, value: _("Uzbek") + " - " + _("Uzbek", Language.Uzbek) }, 186 { id: Language.Spanish, value: _("Spanish") + " - " + _("Spanish", Language.Spanish) }, 187 { id: Language.Korean, value: _("Korean") + " - " + _("Korean", Language.Korean) }, 188 { id: Language.Dutch, value: _("Dutch") + " - " + _("Dutch", Language.Dutch) }, 189 { id: Language.Urdu, value: _("Urdu") + " - " + _("Urdu", Language.Urdu) }, 190 { id: Language.Vietnamese, value: _("Vietnamese") + " - " + _("Vietnamese", Language.Vietnamese) }, 191 ], 192 }, 193 ], 194 }, 195 }; 196 197 webix.ui(result).show(); 198} 199 200var mainLayout = { 201 rows: [ 202 isMobile ? footer : { hidden: true }, 203 toolbar, 204 { 205 cols: [sidebar, { view: "template", id: "mainViewId" }], 206 }, 207 ], 208}; 209 210webix.ui(mainLayout); 211webix.ui.fullScreen(); 212 213webix.ready(async () => { 214 await fetchAllBooksData(); 215 216 changePageTitle(_("Risale-i Nur Comparative")); 217 changeMainLabel(_("Risale-i Nur Comparative")); 218 219 $$("sidebarId").select("langId"); 220 if (!myStorage("get", "rnkLang")) { 221 myStorage("put", "rnkLang", getMatchedLang()); 222 } 223 if (window.rnk.sharePrg) { 224 if (window.rnk.sharePrg.lang) { 225 webix.$$("langShelfId").select(window.rnk.sharePrg.lang); 226 } 227 if (window.rnk.sharePrg.book) { 228 webix.$$("mainViewId").select(window.rnk.sharePrg.book); 229 } 230 } 231 window.onbeforeunload = function () { 232 try { 233 let data = getCurrentPageInfo(); 234 if (data) myStorage("put", data.lang + "_" + data.book, data); 235 } catch (error) {} 236 }; 237}); 238 239window.onpopstate = function (e) { 240 fullScreen(false); 241 switch (e.state) { 242 case "lang": 243 webix.ui(getLangView(), $$("mainViewId")); 244 break; 245 case "shelf": 246 webix.ui(getBookShelfView(window.rnk.selectedLang), $$("mainViewId")); 247 break; 248 case "book": 249 webix.ui(displayBook(window.rnk.book, 0, "main"), $$("mainViewId")); 250 break; 251 } 252}; 253 254webix.ui({ 255 view: "popup", 256 id: "fullScreenOff", 257 left: 10, 258 top: 25, 259 escHide: false, 260 relative: "right", 261 css: { opacity: "0.8" }, 262 body: { 263 view: "button", 264 type: "icon", 265 icon: "mdi mdi-fullscreen-exit", 266 width: 40, 267 tooltip: _("Exit Full Screen"), 268 css: "webix_secondary", 269 on: { 270 onItemClick: (id, e) => { 271 fullScreen(false); 272 }, 273 }, 274 }, 275});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.