| 1 |
<style> |
| 2 |
.taboola-container { |
| 3 |
padding: 20px; |
| 4 |
padding-left: 0; |
| 5 |
width: 400px; |
| 6 |
font-size: 14px; |
| 7 |
} |
| 8 |
table { |
| 9 |
width: 380px; |
| 10 |
margin-left: 20px; |
| 11 |
} |
| 12 |
table td img { |
| 13 |
position: relative; |
| 14 |
top: 3px; |
| 15 |
margin-left: 5px; |
| 16 |
} |
| 17 |
/* table { |
| 18 |
padding: 12px; |
| 19 |
border: 3px solid #467FD7; |
| 20 |
border-radius: 5px; |
| 21 |
margin-top: 10px; |
| 22 |
width: 100%; |
| 23 |
}*/ |
| 24 |
table tr td:first-child { |
| 25 |
width: 110px; |
| 26 |
} |
| 27 |
table input { |
| 28 |
width: 100%; |
| 29 |
} |
| 30 |
input[type='text'] { |
| 31 |
border-radius: 3px; |
| 32 |
} |
| 33 |
hr { |
| 34 |
margin-top: 15px; |
| 35 |
margin-bottom: 15px; |
| 36 |
border-bottom: none; |
| 37 |
} |
| 38 |
input[type='checkbox'] { |
| 39 |
|
| 40 |
} |
| 41 |
input[type='submit']{ |
| 42 |
float: right; |
| 43 |
} |
| 44 |
.checkbox { |
| 45 |
margin-bottom: 10px; |
| 46 |
} |
| 47 |
.request_link { |
| 48 |
float: right; |
| 49 |
margin-right: 10px; |
| 50 |
line-height: 26px; |
| 51 |
} |
| 52 |
table .tooltip { |
| 53 |
/* position:relative; |
| 54 |
top:50px; |
| 55 |
left:50px;*/ |
| 56 |
} |
| 57 |
.tooltip div { /* hide and position tooltip */ |
| 58 |
background-color: black; |
| 59 |
color: white; |
| 60 |
border-radius: 5px; |
| 61 |
opacity: 0; |
| 62 |
position: absolute; |
| 63 |
-webkit-transition: opacity 0.5s; |
| 64 |
-moz-transition: opacity 0.5s; |
| 65 |
-ms-transition: opacity 0.5s; |
| 66 |
-o-transition: opacity 0.5s; |
| 67 |
transition: opacity 0.5s; |
| 68 |
width: 200px; |
| 69 |
padding: 10px; |
| 70 |
margin-left: 30px; |
| 71 |
margin-top: -45px; |
| 72 |
} |
| 73 |
table .tooltip:hover div { /* display tooltip on hover */ |
| 74 |
opacity:1; |
| 75 |
} |
| 76 |
.label-success { |
| 77 |
font-size: 17px; |
| 78 |
display: block; |
| 79 |
margin-top: 10px; |
| 80 |
color: green; |
| 81 |
} |
| 82 |
.label-error { |
| 83 |
font-size: 17px; |
| 84 |
display: block; |
| 85 |
margin-top: 10px; |
| 86 |
color: red; |
| 87 |
} |
| 88 |
|
| 89 |
</style> |
| 90 |
|
| 91 |
<div class="taboola-container"> |
| 92 |
<img src='<?php echo $this->plugin_url.'img/taboola.png' ?>' style='width:200px;'/> |
| 93 |
<hr> |
| 94 |
|
| 95 |
<form method="POST"> |
| 96 |
<table> |
| 97 |
<tr> |
| 98 |
<td>Publisher ID</td> |
| 99 |
<td> |
| 100 |
<input type="text" name="publisher_id" placeholder="publisher" value="<?php echo $settings->publisher_id ?>"/> |
| 101 |
</td> |
| 102 |
<td class='tooltip'> |
| 103 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 104 |
<div>Please contact your Taboola representative to receive the Publisher ID </div> |
| 105 |
</td> |
| 106 |
</tr> |
| 107 |
<tr> |
| 108 |
<td colspan='2' style='line-height: 26px; font-size: 13px;'> |
| 109 |
Don't have a Publisher ID? |
| 110 |
<a style='float: inherit; margin-left:5px; class='request_link' href=' http://taboola.com/contact' target='_blank'>Contact Taboola here</a> |
| 111 |
</td> |
| 112 |
</tr> |
| 113 |
</table> |
| 114 |
|
| 115 |
<hr style='margin-bottom: 25px; margin-top: 5px;'> |
| 116 |
|
| 117 |
<div class='checkbox'> |
| 118 |
<input id="first_bc_enabled" type="checkbox" <?php echo $settings->first_bc_enabled ? "checked='checked'" : "" ?> name="first_bc_enabled"/> |
| 119 |
Taboola widget below article |
| 120 |
</div> |
| 121 |
<table> |
| 122 |
<tr> |
| 123 |
<td>Widget ID</td> |
| 124 |
<td> |
| 125 |
<input type="text" value="<?php echo $settings->first_bc_widget_id ?>" name="first_bc_widget_id" placeholder="Widget ID" /> |
| 126 |
</td> |
| 127 |
<td class='tooltip'> |
| 128 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 129 |
<div>Please contact your Taboola representative to receive the Widget ID</div> |
| 130 |
</td> |
| 131 |
</tr> |
| 132 |
<!-- <tr> |
| 133 |
<td>Custom CSS</td> |
| 134 |
<td> |
| 135 |
<input type="text" value="<?php echo $settings->first_bc_custom_css ?>" name="first_bc_custom_css" placeholder="Custom CSS" /> |
| 136 |
</td> |
| 137 |
</tr>--> |
| 138 |
</table> |
| 139 |
<hr> |
| 140 |
|
| 141 |
<div class='checkbox'> |
| 142 |
<input id="second_bc_enabled" type="checkbox" <?php echo $settings->second_bc_enabled ? "checked='checked'" : "" ?> name="second_bc_enabled"/> |
| 143 |
Taboola widget below the first one |
| 144 |
</div> |
| 145 |
|
| 146 |
<table> |
| 147 |
<tr> |
| 148 |
<td>Widget ID</td> |
| 149 |
<td> |
| 150 |
<input type="text" value="<?php echo $settings->second_bc_widget_id ?>" name="second_bc_widget_id" placeholder="Widget ID" /> |
| 151 |
</td> |
| 152 |
<td class='tooltip'> |
| 153 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 154 |
<div>Please contact your Taboola representative to receive the Widget ID</div> |
| 155 |
</td> |
| 156 |
</tr> |
| 157 |
<!-- <tr> |
| 158 |
<td>Custom CSS</td> |
| 159 |
<td> |
| 160 |
<input type="text" value="<?php echo $settings->second_bc_custom_css ?>" name="second_bc_custom_css" placeholder="Custom CSS" /> |
| 161 |
</td> |
| 162 |
</tr>--> |
| 163 |
</table> |
| 164 |
<hr style='border-bottom: 1px solid #fafafa;'> |
| 165 |
|
| 166 |
<input class='button-secondary' type="submit" value="Apply Changes ✔"/> |
| 167 |
<!-- <a class='request_link' href=' http://taboola.com/contact' target='_blank'>Request Widget</a> --> |
| 168 |
</form> |
| 169 |
<div style='clear:both'></div> |
| 170 |
<?php |
| 171 |
if($_SERVER['REQUEST_METHOD'] == 'POST' && count($taboola_errors) == 0){ |
| 172 |
echo "<span class='label-success'>Your changes have been made! You can now see them on your site</span>"; |
| 173 |
} |
| 174 |
if(count($taboola_errors) > 0){ |
| 175 |
for($i = 0; $i < count($taboola_errors); $i++){ |
| 176 |
echo "<span class='label-error'>".$taboola_errors[$i]."</span>"; |
| 177 |
} |
| 178 |
} |
| 179 |
?> |
| 180 |
</div> |
| 181 |
<script> |
| 182 |
function sync_checkboxes(){ |
| 183 |
if(jQuery('#first_bc_enabled').attr("checked")){ |
| 184 |
jQuery('#second_bc_enabled').prop('disabled',false) |
| 185 |
} else { |
| 186 |
jQuery('#second_bc_enabled').prop('checked', false); |
| 187 |
jQuery('#second_bc_enabled').prop('disabled',true) |
| 188 |
} |
| 189 |
} |
| 190 |
jQuery('#first_bc_enabled').change(sync_checkboxes); |
| 191 |
setTimeout(function(){jQuery('.label-success').fadeOut()}, 6000); |
| 192 |
setTimeout(function(){jQuery('.label-error').fadeOut()}, 6000); |
| 193 |
sync_checkboxes() |
| 194 |
</script> |