f2h 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95f26e4ffd924b314bcbed22380ae1652aff7440
4
- data.tar.gz: f44db5163e43dc7470a9e6aad7e9cffdb48cf805
3
+ metadata.gz: eb77db84c32d981db240be606389697401c33a3d
4
+ data.tar.gz: 2efe5b2bc3a256f27ea2e55633b1f6d69449a344
5
5
  SHA512:
6
- metadata.gz: 2e2728c0dab5b85887e16cf1a6c016a60f7770d21f3b123d513dfceab04d4a646fe85b5a9f18c1c5387b45b7c2dc4e25591b13d3135b2ffd87cd851849d5f6e8
7
- data.tar.gz: 5d35d290269e0055f704c2323e4f5a474bff32ce44856ba22c6fed97af5eb49d5ffaf917eaf109c5c60cf5e4cc945c6c32854f2642aea78b8da1f1687813409c
6
+ metadata.gz: f773cf4c47a0cf37a189772265ed5046369a3b902a14644f1188c0f19315db292ee55ce329c99ad09e876bc0f9d42f26c2adcfeb47a826ffdeffe19ee19ef0ba
7
+ data.tar.gz: 159db7b2bd125509e8a91bfbd976b21aeb4f52e07e7b2eac740a90d6594cfd746a0dd6dc6ce7340a2c86743cb018a111397fe5517c781b9a45d16e8e080af8b1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Flash2HTML
2
2
 
3
- ##### Current Version: 0.9.2
3
+ ##### Current Version: 0.9.4
4
4
 
5
5
  Boilerplate code that provides sane default settings when making html5 assets using html,css and js from Flash creatives
6
6
  We use GreenSock TweenMax library to create javascript animations for images
@@ -387,130 +387,6 @@ $(function(){
387
387
 
388
388
 
389
389
 
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
- Use the following command to generate image tags in html
402
-
403
- ```ruby
404
- f2h g img box | banner | both <filename>
405
- ```
406
-
407
- * We can pass `box` , `banner` or `both` to specify in what type of image tags needs to be inserted in.
408
- * Currently all the filenames that are passed into as args are appended the extension of PNG
409
- * When image is inserted in the html, it yanks the name and uses it to define as the id
410
- * Using the id selector the tag is generated in CSS and JS as well
411
-
412
- Example if we run `f2h g img box ipsum`
413
-
414
- ####Lorem_box.html
415
-
416
- ```
417
- ...
418
-
419
- <img id="ipsum" src="box_images/ipsum.png" alt="">
420
-
421
- ...
422
- ```
423
-
424
- ####Lorem_box.css
425
-
426
- ```
427
- ...
428
-
429
- #ipsum{
430
- position: absolute;
431
- top: 0;
432
- left: 0;
433
- }
434
-
435
- ...
436
- ```
437
- ####Lorem_box.js
438
-
439
- ```
440
- ...
441
-
442
- TweenMax.to(ipsum, 0.0, {});
443
-
444
- ...
445
- ```
446
-
447
-
448
-
449
-
450
- ## Development
451
- [x] Generate Tags in HTML, CSS and JS
452
-
453
- [] Implement Destroy method to delete generated tags in all 3 files ( HTML, CSS, JS)
454
-
455
- [] Migrate to TimeLine instead of using TweenMax for animations
456
-
457
- ## Contributing
458
-
459
- Bug reports and pull requests are welcome on GitHub at https://github.com/ismk/Flash2HTML. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
460
-
461
-
462
- ## License
463
-
464
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
465
-
466
- elem.scrollTop += 2;
467
- }
468
- }, 200);
469
- }
470
-
471
- $(document).on("touchstart", "#isi", function(){
472
- clearInterval(ascroll);
473
- });
474
-
475
-
476
- $("#overall_mask").on("click", function(){
477
- console.log("overall mask was clicked");
478
- WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('', '<div data-advtype=box-mainClickThrough/>')");
479
- });
480
-
481
- $("#fdaBtn").on("click", function(){
482
- console.log("fda btn open button clicked");
483
- WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://www.fda.gov/medwatch/', '<div data-advtype=box-fda-medwatch/>')");
484
- });
485
-
486
- $("#pi").on("click", function(){
487
- console.log("pi button clicked");
488
- WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-pres-info/>')");
489
- });
490
-
491
- $("#medguide").on("click", function(){
492
- console.log("medguide button clicked");
493
- WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-med-guide/>')");
494
- });
495
-
496
-
497
- });
498
-
499
- ```
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
390
  Use the following command to generate image tags in html
515
391
 
516
392
  ```ruby
@@ -563,9 +439,9 @@ Example if we run `f2h g img box ipsum` the following code will be inserted in t
563
439
  ## Development
564
440
  [x] Generate Tags in HTML, CSS and JS
565
441
 
566
- [] Implement Destroy method to delete generated tags in all 3 files ( HTML, CSS, JS)
442
+ [ ] Implement Destroy method to delete generated tags in all 3 files ( HTML, CSS, JS)
567
443
 
568
- [] Migrate to TimeLine instead of using TweenMax for animations
444
+ [ ] Migrate to TimeLine instead of using TweenMax for animations
569
445
 
570
446
  ## Contributing
571
447
 
@@ -2,6 +2,201 @@ module F2h
2
2
  class Boilerplate
3
3
 
4
4
 
5
+
6
+
7
+ #===================== WALLBOARD BOX BOILERPLATE ==============================
8
+
9
+ def html_boilerplate(foldername, type)
10
+ <<-eos
11
+ <!DOCTYPE html>
12
+ <html lang="en">
13
+ <head>
14
+ <meta charset="UTF-8">
15
+ <title></title>
16
+ <link rel="stylesheet" href="css/#{foldername}_#{type}.css">
17
+ <script src="js/jquery.min.js"></script>
18
+ <script src="js/TweenMax.min.js"></script>
19
+ <script src="js/#{foldername}_#{type}.js"></script>
20
+ </head>
21
+ <body>
22
+ <div id="overall_mask"></div>
23
+ <!-- Start-of-the-Image-Tags -->
24
+ <!-- End-of-the-Image-Tags -->
25
+ <!-- Start-of-the-ISI -->
26
+ <div id="isi"></div>
27
+ <!-- End-of-the-ISI -->
28
+ </body>
29
+ </html>
30
+
31
+ eos
32
+ end
33
+
34
+ def wallboard_html_biolerplate(foldername, type)
35
+ <<-eos
36
+ <!DOCTYPE html>
37
+ <html lang="en">
38
+ <head>
39
+ <meta charset="UTF-8">
40
+ <title></title>
41
+ <link rel="stylesheet" href="css/#{foldername}_#{type}.css">
42
+ <script src="js/jquery.min.js"></script>
43
+ <script src="js/TweenMax.min.js"></script>
44
+ <script src="js/#{foldername}_#{type}.js"></script>
45
+ </head>
46
+ <body>
47
+
48
+ <div id="top_mask"></div>
49
+
50
+ <!-- Start-of-the-Image-Tags -->
51
+ <img id="main_image" src="banner_images/main_image.png" alt="">
52
+ <div id="overall_mask"></div>
53
+ <!-- End-of-the-Image-Tags -->
54
+ <div class="pi_mask" id="pi_mask_main"></div>
55
+ <div id="ppi_mask"></div>
56
+
57
+ <!-- Start-of-the-ISI -->
58
+ <div id="isi">
59
+ <div class="pi_mask" id="pi_mask_isi"></div>
60
+ </div>
61
+ <!-- End-of-the-ISI -->
62
+
63
+ </body>
64
+ </html>
65
+
66
+ eos
67
+ end
68
+
69
+ def box_css_boilerplate
70
+ <<-eos
71
+ body{
72
+ position: fixed;
73
+ padding: 0;
74
+ margin: 0;
75
+ top: 0;
76
+ left: 0;
77
+ }
78
+
79
+ #overall_mask{
80
+ position: absolute;
81
+ height: 250px;
82
+ width: 300px;
83
+ }
84
+
85
+
86
+
87
+
88
+
89
+
90
+ /* Start-of-the-ISI */
91
+ #isi{
92
+ position: absolute;
93
+ background-color: white;
94
+ top: 250px;
95
+ width: 300px;
96
+ height: 76px;
97
+ font-size: 12px;
98
+ overflow-y: scroll;
99
+ overflow-x: hidden;
100
+ font-family: "Arial-Narrow";
101
+ padding-left: 5px;
102
+ }
103
+
104
+ #isi::-webkit-scrollbar {
105
+ width: 20px;
106
+ }
107
+
108
+ #isi::-webkit-scrollbar-button:vertical:start:increment{
109
+ display: block;
110
+ background-image: url();
111
+ background-repeat: no-repeat;
112
+ background-position: center;
113
+ }
114
+
115
+ #isi::-webkit-scrollbar-button:vertical:end:increment{
116
+ display: block;
117
+ background-image: url();
118
+ background-repeat: no-repeat;
119
+ background-position: center;
120
+ }
121
+
122
+ #isi::-webkit-scrollbar-track {
123
+ background-image: url();
124
+ background-position: center;
125
+ background-repeat: no-repeat;
126
+ background-size: 4px 97%;
127
+ }
128
+
129
+ #isi::-webkit-scrollbar-thumb {
130
+ height: 25px;
131
+ background-image: url();
132
+ background-position: center;
133
+ background-repeat: no-repeat;
134
+ }
135
+ /* End-of-the-ISI */
136
+
137
+ eos
138
+ end
139
+
140
+ def box_js_boilerplate
141
+ <<-eos
142
+ $(function(){
143
+ // WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.flashAdImpressionTrack('box-ad')");
144
+
145
+ //Start-of-the-animation-code
146
+ //End-of-the-animation-code
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ function autoScroll(){
158
+ ascroll = setInterval(function(){
159
+ elem = $("#isi")[0];
160
+ if (elem.scrollTop != 1075){
161
+ elem.scrollTop += 2;
162
+ }
163
+ }, 200);
164
+ }
165
+
166
+ $(document).on("touchstart", "#isi", function(){
167
+ clearInterval(ascroll);
168
+ });
169
+
170
+
171
+ $("#overall_mask").on("click", function(){
172
+ console.log("overall mask was clicked");
173
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('', '<div data-advtype=box-mainClickThrough/>')");
174
+ });
175
+
176
+ $("#fdaBtn").on("click", function(){
177
+ console.log("fda btn open button clicked");
178
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://www.fda.gov/medwatch/', '<div data-advtype=box-fda-medwatch/>')");
179
+ });
180
+
181
+ $("#pi").on("click", function(){
182
+ console.log("pi button clicked");
183
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-pres-info/>')");
184
+ });
185
+
186
+ $("#medguide").on("click", function(){
187
+ console.log("medguide button clicked");
188
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/', '<div data-advtype=box-med-guide/>')");
189
+ });
190
+
191
+
192
+ });
193
+
194
+ eos
195
+ end
196
+
197
+
198
+
199
+
5
200
  #===================== BOX BOILERPLATE ==============================
6
201
 
7
202
  def html_boilerplate(foldername, type)
@@ -101,7 +296,7 @@ body{
101
296
  /* End-of-the-ISI */
102
297
 
103
298
  eos
104
- end
299
+ end
105
300
 
106
301
  def box_js_boilerplate
107
302
  <<-eos
@@ -157,18 +352,168 @@ $(function(){
157
352
 
158
353
  });
159
354
 
355
+ eos
356
+ end
357
+
358
+
359
+
360
+ ######################## BANNER WALLBOARD BOILERPLATE ##########################
361
+
362
+ def wallboard_banner_css_boilerplate
363
+ <<-eos
364
+ body{
365
+ position: fixed;
366
+ padding: 0;
367
+ margin: 0;
368
+ top: 0;
369
+ left: 0;
370
+ }
371
+
372
+ #overall_mask{
373
+ position: absolute;
374
+ height: 1920px;
375
+ width: 1080px;
376
+ }
377
+
378
+ #top_mask{
379
+ position: absolute;
380
+ height: 150px;
381
+ width: 1080px;
382
+ /*background-color: purple;*/
383
+ }
384
+
385
+ #main_image{
386
+ position: absolute;
387
+ }
388
+
389
+ .isi_image{
390
+ position: relative;
391
+ display: inline-block;
392
+ width: 100%;
393
+ }
394
+
395
+ #pi_mask_main{
396
+ position: absolute;
397
+ width: 248px;
398
+ height: 35px;
399
+ top: 157px;
400
+ left: 250px;
401
+ }
402
+
403
+ #ppi_mask{
404
+ position: absolute;
405
+ width: 290px;
406
+ height: 35px;
407
+ top: 157px;
408
+ left: 516px;
409
+ }
410
+
411
+ #pi_mask_isi{
412
+ position: absolute;
413
+ width: 240px;
414
+ height: 30px;
415
+ top: 3733px;
416
+ left: 223px;
417
+ }
418
+
419
+ /* Start-of-the-ISI */
420
+ #isi{
421
+ position: absolute;
422
+ background-color: white;
423
+ top: 1147px;
424
+ width: 1080px;
425
+ height: 772px;
426
+ font-size: 11px;
427
+ overflow-y: scroll;
428
+ overflow-x: hidden;
429
+ font-family: "Arial-Narrow";
430
+ padding-left: 5px;
431
+ }
432
+
433
+ #isi::-webkit-scrollbar {
434
+ width: 30px;
435
+ margin-top: 10px
436
+ }
437
+
438
+ #isi::-webkit-scrollbar-track {
439
+ background-position: center;
440
+ background-repeat: no-repeat;
441
+ background-color: black;
442
+ background-size: 4px 90%;
443
+ }
444
+
445
+ #isi::-webkit-scrollbar-thumb {
446
+ height: 25px;
447
+ background-color: gray;
448
+ background-position: center;
449
+ background-repeat: no-repeat;
450
+ }
451
+ /* End-of-the-ISI */
452
+
160
453
  eos
161
454
  end
162
455
 
456
+ def wallboard_banner_js_boilerplate
457
+ <<-eos
458
+ $(function(){
459
+ // WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.flashAdImpressionTrack('banner-ad')");
460
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.idleSlideTimeSeconds(20)");
163
461
 
462
+ $(".pi_mask").on("click", function(){
463
+ console.log("pi button clicked");
464
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/atripla_wallboard/pi_atripla.html', '<div data-advtype=banner-pres-info/>')");
465
+ });
164
466
 
467
+ $("#ppi_mask").on("click", function(){
468
+ console.log("ppi button clicked");
469
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.openChildBrowser('http://127.0.0.1:8081/atripla_wallboard/ppi_atripla.html', '<div data-advtype=banner-med-guide/>')");
470
+ });
471
+
472
+ var pressTimer;
473
+
474
+ $("#overall_mask").on("touchend", function(){
475
+ clearTimeout(pressTimer);
476
+ return false;
477
+ }).on("touchstart", function(){
478
+ pressTimer = window.setTimeout(function(){
479
+ WebViewCommunicator.sendJavascriptTo("main", "javascript:appRouter.homeView.idleSlideActivateLauncherPanel('100', '700')");
480
+ },1000)
481
+ return false;
482
+ });
165
483
 
484
+ });
166
485
 
486
+ function startScrolling(){
487
+ setTimeout(function autoScroll(){
488
+ ascroll = setInterval(function(){
489
+ elem = $("#isi")[0];
490
+ if (elem.scrollTop != 3200){
491
+ elem.scrollTop += 2;
492
+ }
493
+ }, 12);
494
+ }, 0);
495
+ }
167
496
 
497
+ $(document).on("touchstart", "#isi", function(){
498
+ clearInterval(ascroll);
499
+ });
168
500
 
501
+ function onWallboardIdleSlideDisplay(){
502
+ console.log("onWallboardIdleSlideDisplay");
503
+ }
169
504
 
505
+ function onWallboardIdleSlideTimerStart(){
506
+ console.log("onWallboardIdleSlideTimerStart");
507
+ startScrolling();
508
+ }
170
509
 
510
+ function onWallboardIdleSlideTimerStop(){
511
+ clearInterval(ascroll);
512
+ }
513
+
171
514
 
515
+ eos
516
+ end
172
517
 
173
518
  ######################## BANNER BOILERPLATE ##########################
174
519
 
data/lib/f2h.rb CHANGED
@@ -24,6 +24,8 @@ module F2h
24
24
  case opts[0]
25
25
  when "new"
26
26
  @init.make_files
27
+ when "wallboard"
28
+ @init.make_wallboard_files
27
29
  when "g", "generate"
28
30
  case opts[1]
29
31
  when "img"
@@ -70,18 +72,18 @@ module F2h
70
72
  def help
71
73
  <<-eos
72
74
  Flags are:
73
- -new
74
- : Which Generates html,css and js files for Box and Banners
75
- : Also downloads the current verison of jQuery and TweenMax
75
+ -new
76
+ : Which Generates html,css and js files for Box and Banners
77
+ : Also downloads the current verison of jQuery and TweenMax
76
78
 
77
- -g or genrate
78
- : The Generate Flag is to be used in conjunction with either
79
- -img
80
- :Generates tags in html, css and js
79
+ -g or genrate
80
+ : The Generate Flag is to be used in conjunction with either
81
+ -img
82
+ :Generates tags in html, css and js
81
83
 
82
- -pdf
83
- :Extracts imgages from the source PDF passed in as args
84
- Creates a Folder and html file with all the images as tags
84
+ -pdf
85
+ :Extracts imgages from the source PDF passed in as args
86
+ Creates a Folder and html file with all the images as tags
85
87
  eos
86
88
  end
87
89
 
@@ -1,3 +1,3 @@
1
1
  module F2h
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
@@ -31,11 +31,37 @@ module F2h
31
31
  exec('curl -o js/TweenMax.min.js http://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js;curl -o js/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js')
32
32
  end
33
33
 
34
+ def make_wallboard_files
35
+ make_wallboard_dirs
36
+ @types.drop(1).each do |t|
37
+ @ext.each do |k,value|
38
+ if value
39
+ File.open("#{k}/"+@get_current_foldername+"_#{t}.#{k}", 'w+') do |file|
40
+ k.eql?("js") ? t.eql?("box") ? to_write = @bp.box_js_boilerplate : to_write = @bp.wallboard_banner_js_boilerplate : t.eql?("box") ? to_write = @bp.box_css_boilerplate : to_write = @bp.wallboard_banner_css_boilerplate
41
+ # file.write(send("#{@bp}.#{t}_#{k}_boilerplate"))
42
+ file.write(to_write)
43
+ end
44
+ else
45
+ File.open(@get_current_foldername+"_#{t}.#{k}", 'w+') do |file|
46
+ to_write = @bp.wallboard_html_biolerplate(@get_current_foldername, t)
47
+ file.write(to_write)
48
+ end
49
+ end
50
+ end
51
+ end
52
+ exec('curl -o js/TweenMax.min.js http://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js;curl -o js/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js')
53
+ end
54
+
34
55
  def make_dirs
35
56
  Dir.mkdir("js") unless Dir.exist?("js")
36
57
  Dir.mkdir("css") unless Dir.exist?("css")
37
58
  Dir.mkdir("box_images") unless Dir.exist?("box_images")
38
59
  Dir.mkdir("banner_images") unless Dir.exist?("banner_images")
39
60
  end
61
+ def make_wallboard_dirs
62
+ Dir.mkdir("js") unless Dir.exist?("js")
63
+ Dir.mkdir("css") unless Dir.exist?("css")
64
+ Dir.mkdir("banner_images") unless Dir.exist?("banner_images")
65
+ end
40
66
  end
41
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: f2h
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismail Kalimi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-04 00:00:00.000000000 Z
11
+ date: 2016-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.4.7
120
+ rubygems_version: 2.5.1
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Generates boilerplate code for HTML5 creatives from Flash files