Changeset 5761


Ignore:
Timestamp:
Nov 28, 2019, 9:06:32 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1207: Replace the "Nothing yet" in the activity log with a quote-of-the-day

Implemented a static qoute from our old friend Indy.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/index.js

    r5740 r5761  
    228228        html += '<span class="activity-time">'+Strings.encodeTags(activity.time)+'</span>';
    229229        html += '<span class="activity-message">' + Strings.encodeTags(activity.message) + '</span>';
     230        if (activity.quoteOfTheDay && activityNo == 0)
     231        {
     232          html += '<span class="activity-author">' + Strings.encodeTags(activity.author) + '</span>';
     233          html += '<div class="activity-link">';
     234          html += '<a href="https://theysaidso.com" title="Powered by quotes from The Said So" target="_blank" rel="noopener noreferrer">theysaidso.com</a>';
     235          html += '</div>';
     236        }
    230237        html += '</div>';
     238        if (activity.quoteOfTheDay && activityNo == 0)
     239        {
     240          Doc.element('quote-of-the-day').innerHTML = html;
     241          html = '';
     242        }
    231243      }
    232244      Doc.element('activity-log-entries').innerHTML = html;
  • extensions/net.sf.basedb.reggie/trunk/resources/index.jsp

    r5737 r5761  
    218218}
    219219
     220
     221#activity-log .activity.quote-of-the-day
     222{
     223  font-style: italic;
     224  white-space: normal;
     225  text-align: center;
     226  margin: 1em 1em 0.5em 0;
     227  border-top-width: 1px;
     228  border-top-style: dotted;
     229  padding-top: 0.5em;
     230}
     231
     232#activity-log .activity-author
     233{
     234  white-space: nowrap;
     235}
     236
     237#activity-log .activity-author:before
     238{
     239  content: '–';
     240  padding-left: 0.5em;
     241  padding-right: 0.25em;
     242}
     243
     244#activity-log .quote-of-the-day .activity-link
     245{
     246  text-align: right;
     247  border-top-width: 1px;
     248  border-top-style: dotted;
     249  margin-top: 0.5em;
     250}
     251
    220252#activity-log .activity-time
    221253{
     
    223255  color: #666666;
    224256}
     257
     258#activity-log .quote-of-the-day .activity-time
     259{
     260  display: none;
     261}
     262
    225263#activity-log-rss
    226264{
     
    12291267
    12301268          <div id="activity-log">
     1269            <div id="quote-of-the-day"></div>
    12311270            <a id="activity-log-rss" href="<%=servletHome%>/ActivityLog.rss"
    12321271              title="Get the activity log as an RSS feed"><img src="images/rss.png"></a>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/activity/ActivityLog.java

    r5740 r5761  
    108108 
    109109  private volatile byte[] rssFeed;
     110  private volatile QuoteOfTheDay quoteOfTheDay;
    110111 
    111112  private ActivityLog()
     
    188189  }
    189190
     191  public QuoteOfTheDay getQuoteOfTheDay()
     192  {
     193    if (quoteOfTheDay == null)
     194    {
     195      QuoteOfTheDay tmp = new QuoteOfTheDay();
     196      tmp.setAuthor("Indiana Jones - Raiders of the Lost Ark");
     197      tmp.setQuote("There's a big snake in the plane, Jock!");
     198      quoteOfTheDay = tmp;
     199    }
     200    return quoteOfTheDay;
     201  }
    190202 
    191203  /**
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SessionServlet.java

    r5740 r5761  
    2929import net.sf.basedb.reggie.activity.ActivityEntry;
    3030import net.sf.basedb.reggie.activity.ActivityLog;
     31import net.sf.basedb.reggie.activity.QuoteOfTheDay;
    3132import net.sf.basedb.reggie.converter.DateToStringConverter;
    3233import net.sf.basedb.reggie.counter.CounterService;
     
    155156        if (!"Today".equals(firstDay))
    156157        {
    157           // Add 'Nothing yet' as first entry of Today
    158158          JSONObject jsonActivity = new JSONObject();
    159           jsonActivity.put("day", "Today");
    160           jsonActivity.put("message", "Nothing yet");
    161159          jsonActivity.put("time", toTime.convert(new Date()));
    162           jsonActivity.put("subclass", "nothing-yet");
     160          QuoteOfTheDay qod = ActivityLog.getInstance().getQuoteOfTheDay();
     161          if (qod != null)
     162          {
     163            jsonActivity.put("message", qod.getQuote());
     164            jsonActivity.put("author", qod.getAuthor());
     165            jsonActivity.put("subclass", "quote-of-the-day");
     166            jsonActivity.put("quoteOfTheDay", true);
     167          }
     168          else
     169          {
     170            // Add 'Nothing yet' as first entry of Today
     171            jsonActivity.put("day", "Today");
     172            jsonActivity.put("message", "Nothing yet");
     173            jsonActivity.put("subclass", "nothing-yet");
     174          }
    163175          jsonActivityLog.add(0, jsonActivity);
    164176        }
     
    285297  }
    286298 
    287  
    288299}
Note: See TracChangeset for help on using the changeset viewer.