Class: F2h::Boilerplate
- Inherits:
-
Object
- Object
- F2h::Boilerplate
- Defined in:
- lib/boilerplate.rb
Instance Method Summary collapse
-
#banner_css_boilerplate ⇒ Object
BANNER BOILERPLATE ##########################.
- #banner_js_boilerplate ⇒ Object
- #box_css_boilerplate ⇒ Object
- #box_js_boilerplate ⇒ Object
-
#html_boilerplate(foldername, type) ⇒ Object
BOX BOILERPLATE ==============================.
- #img_css(filename) ⇒ Object
-
#img_html(filename, loc) ⇒ Object
.
- #img_js(filename) ⇒ Object
- #pdf_html ⇒ Object
Instance Method Details
#banner_css_boilerplate ⇒ Object
BANNER BOILERPLATE ##########################
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/boilerplate.rb', line 175 def "body{\n position: fixed;\n padding: 0;\n margin: 0;\n top: 0;\n left: 0;\n}\n\n#overall_mask{\n position: absolute;\n height: 90px;\n width: 728px;\n}\n\n\n\n\n\n\n\n /* Start-of-the-ISI */\n#isi{\n position: absolute;\n background-color: white;\n border-left: 1px solid gray;\n top: 18px;\n left: 428px;\n width: 300px;\n height: 72px;\n font-size: 11px;\n overflow-y: scroll;\n overflow-x: hidden;\n font-family: \"Arial-Narrow\";\n padding-left: 5px;\n}\n\n#isi::-webkit-scrollbar {\n width: 30px;\n margin-top: 10px\n}\n\n#isi::-webkit-scrollbar-button:vertical:start:increment{\n display: block;\n background-image: url();\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#isi::-webkit-scrollbar-button:vertical:end:increment{\n display: block;\n background-image: url();\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#isi::-webkit-scrollbar-track {\n background-image: url();\n background-position: center;\n background-repeat: no-repeat;\n background-size: 4px 90%;\n}\n\n#isi::-webkit-scrollbar-thumb {\n height: 25px;\n background-image: url();\n background-position: center;\n background-repeat: no-repeat;\n}\n /* End-of-the-ISI */\n\n" end |
#banner_js_boilerplate ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/boilerplate.rb', line 250 def "$(function(){\n// WebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.flashAdImpressionTrack('banner-ad')\");\n\n //Start-of-the-animation-code\n //End-of-the-animation-code\n\n\n\n\n\n\n\nfunction autoScroll(){\nascroll = setInterval(function(){\n elem = $(\"#isi\")[0];\n if (elem.scrollTop != 1075){\n elem.scrollTop += 2;\n }\n}, 200);\n }\n\n $(document).on(\"touchstart\", \"#isi\", function(){\n clearInterval(ascroll);\n });\n\n\n $(\"#overall_mask\").on(\"click\", function(){\nconsole.log(\"overall mask was clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('', '<div data-advtype=banner-mainClickThrough/>')\");\n });\n\n $(\"#fdaBtn\").on(\"click\", function(){\nconsole.log(\"fda btn open button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://www.fda.gov/medwatch/', '<div data-advtype=banner-fda-medwatch/>')\");\n });\n\n $(\"#pi\").on(\"click\", function(){\nconsole.log(\"pi button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=banner-pres-info/>')\");\n });\n\n $(\"#medguide\").on(\"click\", function(){\nconsole.log(\"medguide button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=banner-med-guide/>')\");\n });\n\n\n});\n\n" end |
#box_css_boilerplate ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/boilerplate.rb', line 35 def box_css_boilerplate "body{\n position: fixed;\n padding: 0;\n margin: 0;\n top: 0;\n left: 0;\n}\n\n#overall_mask{\n position: absolute;\n height: 250px;\n width: 300px;\n}\n\n\n\n\n\n\n /* Start-of-the-ISI */\n#isi{\n position: absolute;\n background-color: white;\n top: 250px;\n width: 300px;\n height: 76px;\n font-size: 12px;\n overflow-y: scroll;\n overflow-x: hidden;\n font-family: \"Arial-Narrow\";\n padding-left: 5px;\n}\n\n#isi::-webkit-scrollbar {\n width: 20px;\n}\n\n#isi::-webkit-scrollbar-button:vertical:start:increment{\n display: block;\n background-image: url();\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#isi::-webkit-scrollbar-button:vertical:end:increment{\n display: block;\n background-image: url();\n background-repeat: no-repeat;\n background-position: center;\n }\n\n#isi::-webkit-scrollbar-track {\n background-image: url();\n background-position: center;\n background-repeat: no-repeat;\n background-size: 4px 97%;\n}\n\n#isi::-webkit-scrollbar-thumb {\n height: 25px;\n background-image: url();\n background-position: center;\n background-repeat: no-repeat;\n}\n /* End-of-the-ISI */\n\n" end |
#box_js_boilerplate ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/boilerplate.rb', line 106 def box_js_boilerplate "$(function(){\n// WebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.flashAdImpressionTrack('box-ad')\");\n\n //Start-of-the-animation-code\n //End-of-the-animation-code\n\n\n\n\n\n\n\n\n\n\nfunction autoScroll(){\nascroll = setInterval(function(){\n elem = $(\"#isi\")[0];\n if (elem.scrollTop != 1075){\n elem.scrollTop += 2;\n }\n}, 200);\n }\n\n $(document).on(\"touchstart\", \"#isi\", function(){\n clearInterval(ascroll);\n });\n\n\n $(\"#overall_mask\").on(\"click\", function(){\nconsole.log(\"overall mask was clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('', '<div data-advtype=box-mainClickThrough/>')\");\n });\n\n $(\"#fdaBtn\").on(\"click\", function(){\nconsole.log(\"fda btn open button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://www.fda.gov/medwatch/', '<div data-advtype=box-fda-medwatch/>')\");\n });\n\n $(\"#pi\").on(\"click\", function(){\nconsole.log(\"pi button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-pres-info/>')\");\n });\n\n $(\"#medguide\").on(\"click\", function(){\nconsole.log(\"medguide button clicked\");\nWebViewCommunicator.sendJavascriptTo(\"main\", \"javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-med-guide/>')\");\n });\n\n\n});\n\n" end |
#html_boilerplate(foldername, type) ⇒ Object
BOX BOILERPLATE ==============================
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/boilerplate.rb', line 7 def html_boilerplate(foldername, type) "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title></title>\n <link rel=\"stylesheet\" href=\"css/\#{foldername}_\#{type}.css\">\n <script src=\"js/jquery.min.js\"></script>\n <script src=\"js/TweenMax.min.js\"></script>\n <script src=\"js/\#{foldername}_\#{type}.js\"></script>\n</head>\n<body>\n\n <div id=\"overall_mask\"></div>\n\n <!-- Start-of-the-Image-Tags -->\n <!-- End-of-the-Image-Tags -->\n\n <!-- Start-of-the-ISI -->\n <div id=\"isi\"></div>\n <!-- End-of-the-ISI -->\n\n</body>\n</html>\n" end |
#img_css(filename) ⇒ Object
336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/boilerplate.rb', line 336 def img_css(filename) "\n#\#{filename}{\n position: absolute;\n top: 0;\n left: 0;\n}\n\n" end |
#img_html(filename, loc) ⇒ Object
330 331 332 333 334 |
# File 'lib/boilerplate.rb', line 330 def img_html(filename, loc) "<img id=\"\#{filename}\" src=\"\#{loc}_images/\#{filename}.png\" alt=\"\">\n" end |
#img_js(filename) ⇒ Object
348 349 350 351 352 |
# File 'lib/boilerplate.rb', line 348 def img_js(filename) "TweenMax.to(\#{filename}, 0.0, {});\n" end |
#pdf_html ⇒ Object
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/boilerplate.rb', line 304 def pdf_html "<!doctype html>\n<html>\n <head>\n<meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<title></title>\n<style>\nimg{\n display: block;\n width:100%;\n}\n</style>\n </head>\n\n <body>\n </body>\n</html>\n" end |