| 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 |
.toggle_icon{ |
| 90 |
background: url(<?php echo $this->plugin_url.'img/arrow_right_32.png' ?>) no-repeat; |
| 91 |
background-size:contain; |
| 92 |
width:24px; |
| 93 |
height:24px; |
| 94 |
display:inline-block; |
| 95 |
vertical-align: middle; |
| 96 |
} |
| 97 |
|
| 98 |
.toggle_icon_on{ |
| 99 |
-ms-transform: rotate(90deg); /* IE 9 */ |
| 100 |
-webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */ |
| 101 |
transform: rotate(90deg); |
| 102 |
} |
| 103 |
.apply_button{ |
| 104 |
margin-top: 20px !important; |
| 105 |
} |
| 106 |
|
| 107 |
</style> |
| 108 |
|
| 109 |
<div class="taboola-container"> |
| 110 |
<img src='<?php echo $this->plugin_url.'img/taboola.png' ?>' style='width:200px;'/> |
| 111 |
<hr> |
| 112 |
|
| 113 |
<form method="POST"> |
| 114 |
<table> |
| 115 |
<tr> |
| 116 |
<td>Publisher ID</td> |
| 117 |
<td> |
| 118 |
<input type="text" name="publisher_id" placeholder="publisher" value="<?php echo htmlspecialchars($settings->publisher_id) ?>"/> |
| 119 |
</td> |
| 120 |
<td class='tooltip'> |
| 121 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 122 |
<div>Please contact your Taboola representative to receive the Publisher ID </div> |
| 123 |
</td> |
| 124 |
</tr> |
| 125 |
<tr> |
| 126 |
<td colspan='2' style='line-height: 26px; font-size: 13px;'> |
| 127 |
Don't have a Publisher ID? |
| 128 |
<a style='float: inherit; margin-left:5px; class='request_link' href=' http://taboola.com/contact' target='_blank'>Contact Taboola here</a> |
| 129 |
</td> |
| 130 |
</tr> |
| 131 |
</table> |
| 132 |
|
| 133 |
<hr style='margin-bottom: 25px; margin-top: 5px;'> |
| 134 |
|
| 135 |
<div class='checkbox'> |
| 136 |
<input id="first_bc_enabled" type="checkbox" <?php echo $settings->first_bc_enabled ? "checked='checked'" : "" ?> name="first_bc_enabled"/> |
| 137 |
Below Article |
| 138 |
</div> |
| 139 |
<table> |
| 140 |
<tr> |
| 141 |
<td>Widget ID</td> |
| 142 |
<td> |
| 143 |
<input type="text" value="<?php echo $settings->first_bc_widget_id ?>" name="first_bc_widget_id" placeholder="Widget ID" /> |
| 144 |
</td> |
| 145 |
<td class='tooltip'> |
| 146 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 147 |
<div>Please contact your Taboola representative to receive the Widget ID</div> |
| 148 |
</td> |
| 149 |
</tr> |
| 150 |
|
| 151 |
</table> |
| 152 |
<hr> |
| 153 |
|
| 154 |
<div class='checkbox'> |
| 155 |
<input id="second_bc_enabled" type="checkbox" <?php echo $settings->second_bc_enabled ? "checked='checked'" : "" ?> name="second_bc_enabled"/> |
| 156 |
Below Article 2nd |
| 157 |
</div> |
| 158 |
|
| 159 |
<table> |
| 160 |
<tr> |
| 161 |
<td>Widget ID</td> |
| 162 |
<td> |
| 163 |
<input type="text" value="<?php echo htmlspecialchars($settings->second_bc_widget_id) ?>" name="second_bc_widget_id" placeholder="Widget ID" /> |
| 164 |
</td> |
| 165 |
<td class='tooltip'> |
| 166 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 167 |
<div>Please contact your Taboola representative to receive the Widget ID</div> |
| 168 |
</td> |
| 169 |
</tr> |
| 170 |
|
| 171 |
</table> |
| 172 |
<hr style='border-bottom: 1px solid #fafafa;'> |
| 173 |
|
| 174 |
<?php $location_defined = (htmlspecialchars($settings->location_string) != ""); ?> |
| 175 |
|
| 176 |
|
| 177 |
<div class='toggle_intercept checkbox'> |
| 178 |
<?php if ($location_defined): ?> |
| 179 |
<div class='toggle_icon toggle_icon_on'></div> |
| 180 |
Advanced Settings |
| 181 |
</div> |
| 182 |
<table class='location_section'> |
| 183 |
|
| 184 |
<?php else: ?> |
| 185 |
<div class='toggle_icon'></div> |
| 186 |
Advanced Settings |
| 187 |
</div> |
| 188 |
<table class='location_section' style='display:none'> |
| 189 |
|
| 190 |
<?php endif; ?> |
| 191 |
|
| 192 |
|
| 193 |
<tr> |
| 194 |
<td>Location</td> |
| 195 |
<td> |
| 196 |
<input type="text" value="<?php echo htmlspecialchars($settings->location_string) ?>" name="location_string" placeholder="" /> |
| 197 |
</td> |
| 198 |
<td class='tooltip'> |
| 199 |
<img src='<?php echo $this->plugin_url.'img/question-mark.png' ?>'/> |
| 200 |
<div>This field controls the location of these widgets on the page. If you would like to move your widget from its default location directly below the article a Taboola representative will provide you with the necessary information.</div> |
| 201 |
</td> |
| 202 |
</tr> |
| 203 |
|
| 204 |
</table> |
| 205 |
<input class='button-secondary apply_button' type="submit" value="Apply Changes ✔"/> |
| 206 |
<!-- <a class='request_link' href=' http://taboola.com/contact' target='_blank'>Request Widget</a> --> |
| 207 |
</form> |
| 208 |
<div style='clear:both'></div> |
| 209 |
<?php |
| 210 |
if($_SERVER['REQUEST_METHOD'] == 'POST' && count($taboola_errors) == 0){ |
| 211 |
echo "<span class='label-success'>Your changes have been made! You can now see them on your site</span>"; |
| 212 |
} |
| 213 |
if(count($taboola_errors) > 0){ |
| 214 |
for($i = 0; $i < count($taboola_errors); $i++){ |
| 215 |
echo "<span class='label-error'>".$taboola_errors[$i]."</span>"; |
| 216 |
} |
| 217 |
} |
| 218 |
?> |
| 219 |
</div> |
| 220 |
<script> |
| 221 |
function sync_checkboxes(){ |
| 222 |
if(jQuery('#first_bc_enabled').attr("checked")){ |
| 223 |
jQuery('#second_bc_enabled').attr('disabled',false) |
| 224 |
} else { |
| 225 |
jQuery('#second_bc_enabled').attr('checked', false); |
| 226 |
jQuery('#second_bc_enabled').attr('disabled',true) |
| 227 |
} |
| 228 |
} |
| 229 |
jQuery('#first_bc_enabled').change(sync_checkboxes); |
| 230 |
setTimeout(function(){jQuery('.label-success').fadeOut()}, 6000); |
| 231 |
setTimeout(function(){jQuery('.label-error').fadeOut()}, 6000); |
| 232 |
sync_checkboxes() |
| 233 |
|
| 234 |
jQuery('.toggle_intercept').click(function(){ |
| 235 |
if (jQuery('.location_section').fadeToggle != undefined){ |
| 236 |
jQuery('.location_section').fadeToggle('fast'); |
| 237 |
}else{ |
| 238 |
jQuery('.location_section').toggle(); |
| 239 |
} |
| 240 |
jQuery('.toggle_icon').toggleClass('toggle_icon_on'); |
| 241 |
}); |
| 242 |
</script> |