e9_vendors 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/decorators/vendor_member_decorator.rb +2 -2
- data/lib/e9_vendors/version.rb +1 -1
- data/lib/generators/e9_vendors/templates/javascripts/{e9_vendors.js → e9-vendors.js} +0 -0
- data/lib/generators/e9_vendors/templates/javascripts/{widget.js → vendor-widget.js} +91 -93
- data/lib/generators/e9_vendors/templates/stylesheets/{vb-widget-ie.scss → e9-widget-ie.scss} +3 -3
- data/lib/generators/e9_vendors/templates/stylesheets/{vb-widget.scss → e9-widget.scss} +22 -22
- metadata +5 -5
@@ -31,7 +31,7 @@ class VendorMemberDecorator < VendorsDecorator
|
|
31
31
|
<script type="text/javascript" src="#{script_url}"></script>
|
32
32
|
<script type="text/javascript">
|
33
33
|
try {
|
34
|
-
new
|
34
|
+
new E9.VendorWidget({
|
35
35
|
code: "#{model.md5_hash}"
|
36
36
|
}).render();
|
37
37
|
} catch (e) {}
|
@@ -43,7 +43,7 @@ class VendorMemberDecorator < VendorsDecorator
|
|
43
43
|
|
44
44
|
def script_url
|
45
45
|
dir = Rails.env.development? && 'javascripts' || 'assets'
|
46
|
-
Linkable.urlify_path("/#{dir}/widget.js")
|
46
|
+
Linkable.urlify_path("/#{dir}/vendor-widget.js")
|
47
47
|
end
|
48
48
|
|
49
49
|
def liquid_context
|
data/lib/e9_vendors/version.rb
CHANGED
File without changes
|
@@ -1,14 +1,14 @@
|
|
1
1
|
/*!
|
2
|
-
* e9Digital
|
2
|
+
* e9Digital Vendor Widget - http://www.e9digital.com
|
3
3
|
* Copyright (C) 2011 e9Digital
|
4
4
|
* Author: Travis Cox
|
5
5
|
*
|
6
|
-
* For the documented source see http://www.e9digital.com/javascripts/
|
6
|
+
* For the documented source see http://www.e9digital.com/javascripts/vendor-widget.js
|
7
7
|
*
|
8
8
|
* Basic Usage:
|
9
|
-
<script type="text/javascript" src="http://%{Your Host}/assets/
|
9
|
+
<script type="text/javascript" src="http://%{Your Host}/assets/vendor-widget.js"></script>
|
10
10
|
<script type="text/javascript">
|
11
|
-
new E9.
|
11
|
+
new E9.VendorWidget({
|
12
12
|
code: "your provided widget code"
|
13
13
|
}).render();
|
14
14
|
</script>
|
@@ -19,23 +19,22 @@
|
|
19
19
|
*/
|
20
20
|
|
21
21
|
/**
|
22
|
-
* @namespace E9
|
22
|
+
* @namespace E9 VendorWidget public namespace
|
23
23
|
*/
|
24
24
|
E9 = window.E9 || {};
|
25
25
|
|
26
|
-
|
27
26
|
(function() {
|
28
|
-
if (E9 && E9.
|
27
|
+
if (E9 && E9.VendorWidget) return;
|
29
28
|
|
30
29
|
/**
|
31
30
|
* @constructor
|
32
31
|
* @param {Object} opts the configuration options for the page
|
33
32
|
*/
|
34
|
-
E9.
|
33
|
+
E9.VendorWidget = function(opts) {
|
35
34
|
this.init(opts);
|
36
35
|
}
|
37
36
|
|
38
|
-
E9.
|
37
|
+
E9.VendorWidget.jsonP = function(url, callback) {
|
39
38
|
var script = document.createElement('script');
|
40
39
|
script.type = 'text/javascript';
|
41
40
|
script.src = url;
|
@@ -236,7 +235,7 @@ E9 = window.E9 || {};
|
|
236
235
|
|
237
236
|
retv += tag('input', attrs);
|
238
237
|
|
239
|
-
if (label) retv += tag('label', {'class':'
|
238
|
+
if (label) retv += tag('label', {'class':'e9-label'}, label);
|
240
239
|
|
241
240
|
return retv;
|
242
241
|
},
|
@@ -273,7 +272,7 @@ E9 = window.E9 || {};
|
|
273
272
|
},
|
274
273
|
|
275
274
|
resetForm = function() {
|
276
|
-
var form = document.getElementById('
|
275
|
+
var form = document.getElementById('e9-form'),
|
277
276
|
inputs = form.getElementsByTagName('input');
|
278
277
|
|
279
278
|
for (var i=0;i<inputs.length;i++) {
|
@@ -281,12 +280,12 @@ E9 = window.E9 || {};
|
|
281
280
|
}
|
282
281
|
}
|
283
282
|
|
284
|
-
E9.
|
285
|
-
E9.
|
286
|
-
<h3 id="
|
283
|
+
E9.VendorWidget.COUNT = 0;
|
284
|
+
E9.VendorWidget.ERROR_MESSAGE = '\
|
285
|
+
<h3 id="e9-timeout-message">Error loading content.</h3>\
|
287
286
|
<p>The vendor list is down for scheduled maintenance. Please check back soon.</p>';
|
288
287
|
|
289
|
-
E9.
|
288
|
+
E9.VendorWidget.prototype = function () {
|
290
289
|
var
|
291
290
|
|
292
291
|
// recaptcha key is unchangeable client side as it corresponds to
|
@@ -309,14 +308,14 @@ E9 = window.E9 || {};
|
|
309
308
|
* The init process first looks for an existing element by this ID.
|
310
309
|
* If found it will use it as the base HTML element where the widget is
|
311
310
|
* written. If not found, it will create it in place wherever
|
312
|
-
* E9.
|
311
|
+
* E9.VendorWidget#render is called, with the ID defined here.
|
313
312
|
*
|
314
|
-
* This means there are two ways to call
|
313
|
+
* This means there are two ways to call VendorWidget#render:
|
315
314
|
*
|
316
315
|
* A. Inline:
|
317
316
|
* <div id="foo">
|
318
317
|
* <script type="text/javascript">
|
319
|
-
* new E9.
|
318
|
+
* new E9.VendorWidget({
|
320
319
|
* code: 'yourcode'
|
321
320
|
* }).render();
|
322
321
|
* </script>
|
@@ -326,7 +325,7 @@ E9 = window.E9 || {};
|
|
326
325
|
* <div id="foo"></div>
|
327
326
|
* ...
|
328
327
|
* <script type="text/javascript">
|
329
|
-
* new E9.
|
328
|
+
* new E9.VendorWidget({
|
330
329
|
* code: 'yourcode',
|
331
330
|
* elementId: 'foo'
|
332
331
|
* }).render();
|
@@ -341,7 +340,7 @@ E9 = window.E9 || {};
|
|
341
340
|
* the widget will still write itself in place, but inside an element
|
342
341
|
* with the ID passed.
|
343
342
|
*/
|
344
|
-
elementId: '
|
343
|
+
elementId: 'e9-widget-container',
|
345
344
|
|
346
345
|
/**
|
347
346
|
* By default the widget prepends a stylesheet link to <head> which
|
@@ -359,7 +358,7 @@ E9 = window.E9 || {};
|
|
359
358
|
*
|
360
359
|
* To manipulate HTML you should not use this, but onRender
|
361
360
|
*
|
362
|
-
* @param {Function} widget The E9.
|
361
|
+
* @param {Function} widget The E9.VendorWidget instance being created
|
363
362
|
*/
|
364
363
|
onInit: function(widget) {},
|
365
364
|
|
@@ -368,7 +367,7 @@ E9 = window.E9 || {};
|
|
368
367
|
* before it is made visible. At this point you have access to all the
|
369
368
|
* HTML generated by the widget, referenced by the widget property 'element'.
|
370
369
|
*
|
371
|
-
* @param {Function} widget the E9.
|
370
|
+
* @param {Function} widget the E9.VendorWidget instance being created
|
372
371
|
*/
|
373
372
|
onRender: function(widget) {},
|
374
373
|
|
@@ -392,13 +391,13 @@ E9 = window.E9 || {};
|
|
392
391
|
|
393
392
|
/**
|
394
393
|
* The html tag used for widget headings. The class of these elements
|
395
|
-
* is '
|
394
|
+
* is 'e9-heading', regardless of the tag.
|
396
395
|
*/
|
397
396
|
headingTag: 'h2',
|
398
397
|
|
399
398
|
/**
|
400
399
|
* The html tag used for widget subheadings. The class of these elements
|
401
|
-
* is '
|
400
|
+
* is 'e9-subheading', regardless of the tag.
|
402
401
|
*/
|
403
402
|
subheadingTag: 'h3',
|
404
403
|
|
@@ -441,10 +440,10 @@ E9 = window.E9 || {};
|
|
441
440
|
if (/\/$/.test(this.url)) this.url = this.url.substr(0, this.url.length - 1);
|
442
441
|
|
443
442
|
// defines a callback in case of more than one widget on a page (unlikely)...
|
444
|
-
this.callback = 'cb' + ++E9.
|
443
|
+
this.callback = 'cb' + ++E9.VendorWidget.COUNT;
|
445
444
|
|
446
|
-
// and defines a global callback on E9.
|
447
|
-
E9.
|
445
|
+
// and defines a global callback on E9.VendorWidget for jsonp
|
446
|
+
E9.VendorWidget[this.callback] = function(response) {
|
448
447
|
clearTimeout(that.jsonRequestTimer);
|
449
448
|
that.renderHtmlFromResponse(response);
|
450
449
|
that.removeScriptElement();
|
@@ -452,10 +451,10 @@ E9 = window.E9 || {};
|
|
452
451
|
|
453
452
|
// code must be passed
|
454
453
|
if (!opts.code) {
|
455
|
-
html = tag('h3', {'class':'
|
454
|
+
html = tag('h3', {'class':'e9-error'}, 'E9.VendorWidget requires that you pass a code identifying yourself as a member');
|
456
455
|
} else {
|
457
|
-
html = tag('h3', {'class':'
|
458
|
-
this.scriptUrl = this.url + '/directory/members/' + opts.code + '.json?jsonp=E9.
|
456
|
+
html = tag('h3', {'class':'e9-loading'}, 'Loading...');
|
457
|
+
this.scriptUrl = this.url + '/directory/members/' + opts.code + '.json?jsonp=E9.VendorWidget.' + this.callback;
|
459
458
|
this.formUrl = this.url + '/contact_requests.json';
|
460
459
|
}
|
461
460
|
|
@@ -503,7 +502,7 @@ E9 = window.E9 || {};
|
|
503
502
|
},
|
504
503
|
|
505
504
|
displayReCAPTCHA: function() {
|
506
|
-
Recaptcha.create(this.recaptchaPublicKey, "
|
505
|
+
Recaptcha.create(this.recaptchaPublicKey, "e9-recaptcha", {
|
507
506
|
theme: this.recaptchaTheme,
|
508
507
|
callback: function() {}
|
509
508
|
});
|
@@ -511,14 +510,14 @@ E9 = window.E9 || {};
|
|
511
510
|
|
512
511
|
addStylesheets: function() {
|
513
512
|
var link = document.createElement("link");
|
514
|
-
link.href = this.url + "/stylesheets/
|
513
|
+
link.href = this.url + "/stylesheets/e9-widget.css";
|
515
514
|
link.rel = "stylesheet";
|
516
515
|
link.type = "text/css";
|
517
516
|
addHeadElement(link);
|
518
517
|
|
519
518
|
if (browser().version < 8) {
|
520
519
|
link = document.createElement("link");
|
521
|
-
link.href = this.url + "/stylesheets/
|
520
|
+
link.href = this.url + "/stylesheets/e9-widget-ie.css";
|
522
521
|
link.rel = "stylesheet";
|
523
522
|
link.type = "text/css";
|
524
523
|
addHeadElement(link);
|
@@ -528,16 +527,16 @@ E9 = window.E9 || {};
|
|
528
527
|
setTimeout: function(e) {
|
529
528
|
var that = this;
|
530
529
|
this.jsonRequestTimer = window.setTimeout(function() {
|
531
|
-
that.element.innerHTML = E9.
|
530
|
+
that.element.innerHTML = E9.VendorWidget.ERROR_MESSAGE;
|
532
531
|
}, this.timeout);
|
533
532
|
},
|
534
533
|
|
535
534
|
getFieldElements: function() {
|
536
535
|
var elements = new Array();
|
537
536
|
try {
|
538
|
-
elements.push(document.getElementById('
|
539
|
-
elements.push(document.getElementById('
|
540
|
-
elements.push(document.getElementById('
|
537
|
+
elements.push(document.getElementById('e9-form-name'));
|
538
|
+
elements.push(document.getElementById('e9-form-phone'));
|
539
|
+
elements.push(document.getElementById('e9-form-email'));
|
541
540
|
} catch(e) {
|
542
541
|
} finally {
|
543
542
|
return elements;
|
@@ -547,9 +546,9 @@ E9 = window.E9 || {};
|
|
547
546
|
getShowLinks: function() {
|
548
547
|
var showlinks = new Array();
|
549
548
|
try {
|
550
|
-
var links = document.getElementById('
|
549
|
+
var links = document.getElementById('e9-vendor-list').getElementsByTagName('a');
|
551
550
|
for(var i=0;i<links.length;i++) {
|
552
|
-
if(links[i].name == '
|
551
|
+
if(links[i].name == 'e9-ldl') { showlinks.push(links[i]); }
|
553
552
|
}
|
554
553
|
} catch (e) {
|
555
554
|
} finally {
|
@@ -568,24 +567,24 @@ E9 = window.E9 || {};
|
|
568
567
|
Recaptcha.reload();
|
569
568
|
|
570
569
|
// re-enable the submit button if it was disabled on press
|
571
|
-
var submit = document.getElementById('
|
570
|
+
var submit = document.getElementById('e9-form-submit');
|
572
571
|
if (submit) { submit.removeAttribute('disabled'); }
|
573
572
|
|
574
|
-
var m = document.getElementById('
|
573
|
+
var m = document.getElementById('e9-feedback');
|
575
574
|
|
576
575
|
if (isEmpty(response.errors)) {
|
577
|
-
m.className = '
|
576
|
+
m.className = 'e9-feedback e9-feedback-success';
|
578
577
|
resetForm();
|
579
578
|
|
580
579
|
html = 'Your request has been submitted.';
|
581
580
|
} else {
|
582
581
|
var field;
|
583
|
-
m.className = '
|
582
|
+
m.className = 'e9-feedback e9-feedback-error';
|
584
583
|
for (var e in response.errors) {
|
585
|
-
if (field = document.getElementById('
|
586
|
-
field.className = '
|
584
|
+
if (field = document.getElementById('e9-form-' + e)) {
|
585
|
+
field.className = 'e9-field e9-field-error';
|
587
586
|
}
|
588
|
-
html += div({'class':'
|
587
|
+
html += div({'class':'e9-feedback-error-field'}, response.errors[e])
|
589
588
|
}
|
590
589
|
}
|
591
590
|
|
@@ -606,9 +605,9 @@ E9 = window.E9 || {};
|
|
606
605
|
optionList += tag('option', {'value': c.id }, c.name);
|
607
606
|
});
|
608
607
|
|
609
|
-
contentHtml += tag(that.subheadingTag, {'id':'
|
610
|
-
contentHtml += tag('select', {'id':'
|
611
|
-
contentHtml += div({'class':'
|
608
|
+
contentHtml += tag(that.subheadingTag, {'id':'e9-contact-form-heading','class':'e9-subheading'}, response.widget_form_title);
|
609
|
+
contentHtml += tag('select', {'id':'e9-category-select'}, optionList);
|
610
|
+
contentHtml += div({'class':'e9-text'}, response.widget_form_text);
|
612
611
|
|
613
612
|
response.vendors.forEach(function(vendor) {
|
614
613
|
vHtml = '';
|
@@ -621,27 +620,27 @@ E9 = window.E9 || {};
|
|
621
620
|
|
622
621
|
// logo
|
623
622
|
if (vendor.logo) {
|
624
|
-
vHtmlInner += div({'class':'
|
623
|
+
vHtmlInner += div({'class':'e9-vendor-logo'}, tag('img', {'src':vendor.logo}));
|
625
624
|
}
|
626
625
|
|
627
|
-
var cbHtml = '', vendorClass = '
|
626
|
+
var cbHtml = '', vendorClass = 'e9-vendor';
|
628
627
|
|
629
628
|
// title
|
630
|
-
cbHtml += div({'class':'
|
629
|
+
cbHtml += div({'class':'e9-vendor-name'}, vendor.name);
|
631
630
|
|
632
631
|
// short desc & link
|
633
|
-
cbHtml += div({'class':'
|
632
|
+
cbHtml += div({'class':'e9-vendor-short-description'},
|
634
633
|
vendor.short_description + ' ' +
|
635
|
-
tag('a', {'data-id':vendor.id, 'class':'
|
634
|
+
tag('a', {'data-id':vendor.id, 'class':'e9-show-desc-link', 'name':'e9-ldl', href:'javascript:;'}, that.showDescText)
|
636
635
|
);
|
637
636
|
|
638
637
|
// long desc
|
639
|
-
cbHtml += div({'style':'display:none', 'class':'
|
638
|
+
cbHtml += div({'style':'display:none', 'class':'e9-vendor-long-description', 'id':'e9-ld'+vendor.id}, vendor.long_description);
|
640
639
|
|
641
|
-
vHtmlInner += div({'class':'
|
640
|
+
vHtmlInner += div({'class':'e9-vendor-content'}, cbHtml);
|
642
641
|
|
643
642
|
vendor.categories.forEach(function(cat) {
|
644
|
-
vendorClass += '
|
643
|
+
vendorClass += ' e9-c' + cat.id;
|
645
644
|
});
|
646
645
|
|
647
646
|
// wrap it up
|
@@ -651,77 +650,77 @@ E9 = window.E9 || {};
|
|
651
650
|
if (!that.showForm || !vendor.display_on_widget_contact_form) return;
|
652
651
|
|
653
652
|
// otherwise add them
|
654
|
-
formHtmlInner += div({'class':'
|
653
|
+
formHtmlInner += div({'class':'e9-field'},
|
655
654
|
tag('input', {
|
656
655
|
'name':'contact_request[vendor_detail_ids][]',
|
657
656
|
'type':'checkbox',
|
658
657
|
'value':vendor.id,
|
659
658
|
'checked':'checked'
|
660
659
|
}) +
|
661
|
-
tag('label', {'class':'
|
660
|
+
tag('label', {'class':'e9-label'}, vendor.name)
|
662
661
|
);
|
663
662
|
|
664
663
|
if (formHtmlInner.length) {
|
665
|
-
fHtml = div({'class':'
|
666
|
-
fHtml += div({'class':'
|
667
|
-
formHtml += div({'class':'
|
664
|
+
fHtml = div({'class':'e9-vendor-category-name'}, vc),
|
665
|
+
fHtml += div({'class':'e9-vendors'}, formHtmlInner);
|
666
|
+
formHtml += div({'class':'e9-vendor-category'}, fHtml);
|
668
667
|
}
|
669
668
|
});
|
670
669
|
|
671
|
-
contentHtml += div({'id':'
|
670
|
+
contentHtml += div({'id':'e9-vendor-list'}, vendorlist);
|
672
671
|
|
673
672
|
if (that.showForm) {
|
674
673
|
// if vendors were added to formHtml, wrap them in fieldset
|
675
674
|
if (formHtml.length) {
|
676
675
|
formHtml =
|
677
|
-
tag('fieldset', {'class':'
|
678
|
-
tag('legend', '
|
676
|
+
tag('fieldset', {'class':'e9-fieldset e9-checkbox'},
|
677
|
+
tag('legend', 'e9-fieldset-legend', 'Vendors') +
|
679
678
|
formHtml
|
680
679
|
)
|
681
680
|
;
|
682
681
|
}
|
683
682
|
|
684
|
-
formHtml += div({'class':'
|
685
|
-
tag('label', {'class':'
|
683
|
+
formHtml += div({'class':'e9-field', 'id':'e9-form-name'},
|
684
|
+
tag('label', {'class':'e9-label e9-req'}, 'Full Name *') +
|
686
685
|
tag('input', { 'name':'contact_request[name]', 'type':'text' })
|
687
686
|
);
|
688
687
|
|
689
|
-
formHtml += div({'class':'
|
690
|
-
tag('label', {'class':'
|
688
|
+
formHtml += div({'class':'e9-field', 'id':'e9-form-email'},
|
689
|
+
tag('label', {'class':'e9-label e9-req'}, 'Contact Email *') +
|
691
690
|
tag('input', { 'name':'contact_request[email]', 'type':'text' })
|
692
691
|
);
|
693
692
|
|
694
|
-
formHtml += div({'class':'
|
695
|
-
tag('label', {'class':'
|
693
|
+
formHtml += div({'class':'e9-field', 'id':'e9-form-phone'},
|
694
|
+
tag('label', {'class':'e9-label'}, 'Contact Phone') +
|
696
695
|
tag('input', { 'name':'contact_request[phone]', 'type':'text' })
|
697
696
|
);
|
698
697
|
|
699
|
-
formHtml += div("
|
698
|
+
formHtml += div("e9-recaptcha", '');
|
700
699
|
|
701
|
-
formHtml += div({'class':'
|
700
|
+
formHtml += div({'class':'e9-actions'},
|
702
701
|
tag('input', {
|
703
|
-
'id':'
|
704
|
-
'name':'
|
702
|
+
'id':'e9-form-submit',
|
703
|
+
'name':'e9-form-submit',
|
705
704
|
'type':'submit',
|
706
705
|
'value':'Submit'
|
707
706
|
})
|
708
707
|
);
|
709
708
|
|
710
|
-
contentHtml += div({'id':'
|
711
|
-
contentHtml += div({'id':'
|
709
|
+
contentHtml += div({'id':'e9-form'}, formHtml);
|
710
|
+
contentHtml += div({'id':'e9-feedback', 'class':'e9-feedback', 'style':'display:none'}, '');
|
712
711
|
}
|
713
712
|
|
714
|
-
html += tag(that.headingTag, {'id':'
|
715
|
-
html += div('
|
713
|
+
html += tag(that.headingTag, {'id':'e9-heading','class':'e9-heading'}, response.widget_title);
|
714
|
+
html += div('e9-content', contentHtml);
|
716
715
|
|
717
716
|
// hide the element so it can be manipulated by onRender
|
718
717
|
this.element.style.display = 'none';
|
719
718
|
|
720
|
-
this.element.innerHTML = div('
|
719
|
+
this.element.innerHTML = div('e9-widget', html);
|
721
720
|
|
722
|
-
var select = document.getElementById('
|
721
|
+
var select = document.getElementById('e9-category-select'),
|
723
722
|
el = this.element,
|
724
|
-
vendors = document.getElementsByClassName('
|
723
|
+
vendors = document.getElementsByClassName('e9-vendor', 'div', el);
|
725
724
|
|
726
725
|
function toggleViz(v, els) {
|
727
726
|
for (i in els) {
|
@@ -734,7 +733,7 @@ E9 = window.E9 || {};
|
|
734
733
|
toggleViz(true, vendors);
|
735
734
|
} else {
|
736
735
|
toggleViz(false, vendors);
|
737
|
-
toggleViz(true, getElementsByClassName('
|
736
|
+
toggleViz(true, getElementsByClassName('e9-c'+this.value, 'div', el));
|
738
737
|
}
|
739
738
|
}
|
740
739
|
|
@@ -742,7 +741,7 @@ E9 = window.E9 || {};
|
|
742
741
|
for (var i=0;i<showlinks.length;i++) {
|
743
742
|
showlink = showlinks[i];
|
744
743
|
|
745
|
-
showlink['element'] = document.getElementById('
|
744
|
+
showlink['element'] = document.getElementById('e9-ld' + showlink.attributes['data-id'].value);
|
746
745
|
|
747
746
|
showlink.onclick = function() {
|
748
747
|
this.element.style.display = this.element.style.display == 'none' ? 'block' : 'none';
|
@@ -755,15 +754,15 @@ E9 = window.E9 || {};
|
|
755
754
|
}
|
756
755
|
|
757
756
|
if (this.showForm) {
|
758
|
-
var form = document.getElementById('
|
759
|
-
submit = document.getElementById('
|
757
|
+
var form = document.getElementById('e9-form'),
|
758
|
+
submit = document.getElementById('e9-form-submit');
|
760
759
|
|
761
760
|
submit.onclick = function(e) {
|
762
761
|
this.setAttribute("disabled", "disabled");
|
763
762
|
|
764
763
|
var fields = that.getFieldElements();
|
765
764
|
for(var i=0;i<fields.length;i++) {
|
766
|
-
fields[i].className = '
|
765
|
+
fields[i].className = 'e9-field';
|
767
766
|
}
|
768
767
|
|
769
768
|
var inputs = form.getElementsByTagName('input');
|
@@ -778,10 +777,10 @@ E9 = window.E9 || {};
|
|
778
777
|
formData += '&';
|
779
778
|
}
|
780
779
|
|
781
|
-
formData += 'jsonp=E9.
|
780
|
+
formData += 'jsonp=E9.VendorWidget.' + that.callback;
|
782
781
|
|
783
782
|
that.setTimeout();
|
784
|
-
E9.
|
783
|
+
E9.VendorWidget.jsonP(that.formUrl + '?' + formData, function(el) {
|
785
784
|
that.scriptElement = el;
|
786
785
|
});
|
787
786
|
|
@@ -796,7 +795,7 @@ E9 = window.E9 || {};
|
|
796
795
|
}
|
797
796
|
} else {
|
798
797
|
this.element.style.display = 'none';
|
799
|
-
this.element.innerHTML = E9.
|
798
|
+
this.element.innerHTML = E9.VendorWidget.ERROR_MESSAGE;
|
800
799
|
this.onError(this);
|
801
800
|
this.element.style.display = 'block';
|
802
801
|
}
|
@@ -816,7 +815,7 @@ E9 = window.E9 || {};
|
|
816
815
|
if (this.scriptUrl) {
|
817
816
|
function loadJSON() {
|
818
817
|
that.setTimeout();
|
819
|
-
E9.
|
818
|
+
E9.VendorWidget.jsonP(that.scriptUrl, function(el) { that.scriptElement = el; });
|
820
819
|
}
|
821
820
|
|
822
821
|
if (this.showForm) {
|
@@ -824,7 +823,7 @@ E9 = window.E9 || {};
|
|
824
823
|
wait({
|
825
824
|
timeout : that.recaptcha_timeout,
|
826
825
|
until : function(elapsed) { return typeof Recaptcha !== 'undefined'; },
|
827
|
-
error : function() { that.element.innerHTML = E9.
|
826
|
+
error : function() { that.element.innerHTML = E9.VendorWidget.ERROR_MESSAGE; },
|
828
827
|
success : loadJSON
|
829
828
|
});
|
830
829
|
} else {
|
@@ -836,4 +835,3 @@ E9 = window.E9 || {};
|
|
836
835
|
};
|
837
836
|
}();
|
838
837
|
})();
|
839
|
-
|
data/lib/generators/e9_vendors/templates/stylesheets/{vb-widget-ie.scss → e9-widget-ie.scss}
RENAMED
@@ -1,13 +1,13 @@
|
|
1
|
-
* html #
|
1
|
+
* html #e9-widget legend {
|
2
2
|
margin: 0px -8px 16px 0;
|
3
3
|
padding: 0;
|
4
4
|
}
|
5
5
|
|
6
|
-
html > #
|
6
|
+
html > #e9-widget p code {
|
7
7
|
*white-space: normal;
|
8
8
|
}
|
9
9
|
|
10
|
-
#
|
10
|
+
#e9-widget {
|
11
11
|
img {
|
12
12
|
-ms-interpolation-mode: bicubic;
|
13
13
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@import "compass/utilities/general/clearfix";
|
2
2
|
|
3
|
-
#
|
3
|
+
#e9-widget {
|
4
4
|
$input_width: 300px;
|
5
5
|
$textarea_width: 390px;
|
6
6
|
$textarea_height: 250px;
|
@@ -19,15 +19,15 @@
|
|
19
19
|
label {
|
20
20
|
display: block;
|
21
21
|
}
|
22
|
-
fieldset, .
|
22
|
+
fieldset, .e9-field {
|
23
23
|
margin: 0 0 1em 0;
|
24
24
|
}
|
25
25
|
fieldset {
|
26
26
|
padding: 0.5em 0.75em 0.75em;
|
27
|
-
.
|
27
|
+
.e9-field {
|
28
28
|
margin: 0 0 0.25em 0;
|
29
29
|
}
|
30
|
-
&.
|
30
|
+
&.e9-checkbox {
|
31
31
|
input[type=checkbox] {
|
32
32
|
margin-right: 0.3em;
|
33
33
|
}
|
@@ -58,38 +58,38 @@
|
|
58
58
|
select {
|
59
59
|
margin: 0.5em 0;
|
60
60
|
}
|
61
|
-
.
|
61
|
+
.e9-heading, .e9-subheading {
|
62
62
|
margin: 0.25em 0;
|
63
63
|
}
|
64
|
-
.
|
64
|
+
.e9-vendor-category {
|
65
65
|
margin: 0 0 0.5em;
|
66
66
|
padding: 0.5em 0 0;
|
67
67
|
}
|
68
|
-
.
|
68
|
+
.e9-vendor-category-name {
|
69
69
|
font-size: 1.1em;
|
70
70
|
margin: 0 0 0.25em 0;
|
71
71
|
}
|
72
|
-
.
|
72
|
+
.e9-actions {
|
73
73
|
margin: 1em 0;
|
74
74
|
}
|
75
|
-
.
|
75
|
+
.e9-vendor {
|
76
76
|
@include clearfix;
|
77
77
|
margin-bottom: 1em;
|
78
|
-
.
|
78
|
+
.e9-vendor-content {
|
79
79
|
float: none;
|
80
|
-
.
|
80
|
+
.e9-vendor-name {
|
81
81
|
font-size: 1.25em;
|
82
82
|
}
|
83
83
|
}
|
84
|
-
.
|
84
|
+
.e9-vendor-logo {
|
85
85
|
float: left;
|
86
86
|
margin-right: 0.5em;
|
87
87
|
}
|
88
88
|
}
|
89
|
-
.
|
89
|
+
.e9-show-desc-link {
|
90
90
|
white-space: nowrap;
|
91
91
|
}
|
92
|
-
.
|
92
|
+
.e9-text {
|
93
93
|
padding: 0.25em 0;
|
94
94
|
}
|
95
95
|
input {
|
@@ -119,24 +119,24 @@
|
|
119
119
|
}
|
120
120
|
}
|
121
121
|
|
122
|
-
.
|
123
|
-
.
|
124
|
-
.
|
125
|
-
.
|
122
|
+
.e9-feedback.e9-feedback-error,
|
123
|
+
.e9-field-error input[type=email],
|
124
|
+
.e9-field-error input[type=text],
|
125
|
+
.e9-field-error input[type=password] {
|
126
126
|
background-color: $feedback_error_background_color;
|
127
127
|
border-color: $feedback_error_border_color;
|
128
128
|
}
|
129
|
-
.
|
129
|
+
.e9-feedback.e9-feedback-error, .e9-field-error {
|
130
130
|
color: $feedback_error_color;
|
131
131
|
a {
|
132
132
|
color: $feedback_error_color;
|
133
133
|
}
|
134
134
|
}
|
135
|
-
.
|
135
|
+
.e9-feedback {
|
136
136
|
padding: 0.5em 0.75em;
|
137
137
|
margin-bottom: 1em;
|
138
138
|
border: 1px solid $fieldset_border_color;
|
139
|
-
&.
|
139
|
+
&.e9-feedback-success {
|
140
140
|
background-color: $feedback_success_background_color;
|
141
141
|
border-color: $feedback_success_border_color;
|
142
142
|
color: $feedback_success_color;
|
@@ -144,7 +144,7 @@
|
|
144
144
|
color: $feedback_success_color;
|
145
145
|
}
|
146
146
|
}
|
147
|
-
.
|
147
|
+
.e9-feedback-error-field {
|
148
148
|
margin: 0.25em 0;
|
149
149
|
}
|
150
150
|
}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: e9_vendors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Travis Cox
|
@@ -93,11 +93,11 @@ files:
|
|
93
93
|
- lib/e9_vendors/model.rb
|
94
94
|
- lib/e9_vendors/version.rb
|
95
95
|
- lib/generators/e9_vendors/install_generator.rb
|
96
|
-
- lib/generators/e9_vendors/templates/javascripts/
|
97
|
-
- lib/generators/e9_vendors/templates/javascripts/widget.js
|
96
|
+
- lib/generators/e9_vendors/templates/javascripts/e9-vendors.js
|
97
|
+
- lib/generators/e9_vendors/templates/javascripts/vendor-widget.js
|
98
98
|
- lib/generators/e9_vendors/templates/migration.rb
|
99
|
-
- lib/generators/e9_vendors/templates/stylesheets/
|
100
|
-
- lib/generators/e9_vendors/templates/stylesheets/
|
99
|
+
- lib/generators/e9_vendors/templates/stylesheets/e9-widget-ie.scss
|
100
|
+
- lib/generators/e9_vendors/templates/stylesheets/e9-widget.scss
|
101
101
|
has_rdoc: true
|
102
102
|
homepage: http://github.com/e9digital/e9_vendors
|
103
103
|
licenses: []
|