/* * [GoogleAdSense.java] * * Summary: enum for various types of Google ads. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. */ package com.mindprod.htmlmacros.support; import com.mindprod.fastcat.FastCat; import static com.mindprod.htmlmacros.macro.Global.configuration; /** * enum for various types of Google ads. * * @author Roedy Green, Canadian Mind Products * @version 1.8 2009-02-06 include go package in ZIP bundle. * @since 2009 */ public enum GoogleAdSense { // you get the magic slot numbers by logging in to adsense and looking at my ads. // Actual ad may be smaller than reserved space. // Head and Foot macro decide if ad should appear. // XXXHead macro decides which size of ad should appear. /** * 465x60 banner (CoFoot) */ BANNER( "2227008637", 468, 60 ), /** * 234x60 half banner (not used ) */ @SuppressWarnings( "UnusedDeclaration" ) HALF_BANNER( "4012790150", 234, 60 ), /** * 125x125 button */ @SuppressWarnings( "UnusedDeclaration" ) BUTTON( "2711737157", 125, 125 ), /** * 336x280 large rectangle */ @SuppressWarnings( "UnusedDeclaration" ) LARGE_RECTANGLE( "6009887430", 336, 280 ), /** * 728x90 leaderboard (Foot). Selected in Foot */ LEADERBOARD( "5284935692", 728, 90 ), /** * 300x250 medium rectangle Bgloss top , selectedin BGlossHead etc. * used for all top ads */ MEDIUM_RECTANGLE( "3915217187", 300, 250 ), /** * no ad at all, e.g. Ggloss, Politics */ NONE( "none", 0, 0 ) { /** * Get link to a Google ad for this enum. * @return link to a Google ad for this category @param cssClass */ public String getGoogleAdVis( final String cssClass ) { return ""; } }, /** * 120x600 skyscraper */ @SuppressWarnings( "UnusedDeclaration" ) SKYSCRAPER( "4574227638", 120, 600 ), /** * 180x150 small rectangle * stopped working. No longer used. */ @SuppressWarnings( "UnusedDeclaration" ) SMALL_RECTANGLE( "6855185627", 180, 150 ), /** * 200x200 small square */ @SuppressWarnings( "UnusedDeclaration" ) SMALL_SQUARE( "6983249373", 200, 200 ), /** * 250x250 square */ @SuppressWarnings( "UnusedDeclaration" ) SQUARE( "8899887249", 250, 250 ), /** * 120x240 vertical banner */ @SuppressWarnings( "UnusedDeclaration" ) VERTICAL_BANNER( "5142110886", 120, 240 ), /** * 160x600 wide skyscraper */ @SuppressWarnings( "UnusedDeclaration" ) WIDE_SKYSCRAPER( "2392622153", 160, 600 ); /** * slot of the ad for this enum, e.g. "4012790150" */ private final String slot; /** * height of ad in pixels */ private final int height; /** * width of ad in pixels */ private final int width; /** * GoogleAdSense enum constructor * * @param slot Google slot to find ad descriptor, eg. "4012790150" * @param width ad width in pixels * @param height ad height in pixels */ GoogleAdSense( String slot, int width, int height ) { this.slot = slot; this.width = width; this.height = height; } /** * load for google ads, Needs appear only once at bottom of page. Does not display anything. * * @return link to load Google ad scripts */ public String getGoogleAdInvis() { // note I corrected the missing http: return "\n" + "\n"; } /** * Get link to a Google ad for this enum. * * @param cssClass ad for top of page, adfoot for bottom of page * * @return link to a Google ad for this category */ public String getGoogleAdVis( final String cssClass ) { final FastCat sb = new FastCat( 21 ); sb.append( "\n" ); sb.append( "
\n" ); sb.append( "\n" ); // e.g. "5284935692" for leaderboard sb.append( "
\n" ); return sb.toString(); } }