3 function SummaryPerspective(options) {
4 var old_callback = options.callback || function() {};
6 options.callback = function() {
9 // first time page is rendered
10 $('#summary-cover-refresh').click(function() {
14 old_callback.call(this);
17 $.wiki.Perspective.call(this, options);
20 SummaryPerspective.prototype = new $.wiki.Perspective();
22 SummaryPerspective.prototype.refreshCover = function() {
23 $('#summary-cover-refresh').attr('disabled', 'disabled');
24 this.doc.refreshCover({
25 success: function(text) {
26 $('#summary-cover').attr('src', text);
27 $('#summary-cover-refresh').removeAttr('disabled');
32 SummaryPerspective.prototype.showCharCount = function() {
35 cc = this.doc.getLength();
36 $('#charcount_untagged').hide();
39 $('#charcount_untagged').show();
40 cc = this.doc.text.replace(/\s{2,}/g, ' ').length;
42 $('#charcount').html(cc);
43 $('#charcount_pages').html((Math.round(cc/18)/100).toLocaleString());
46 SummaryPerspective.prototype.freezeState = function(){
50 SummaryPerspective.prototype.onEnter = function(success, failure){
51 $.wiki.Perspective.prototype.onEnter.call(this);
55 console.log("Entered summery view");
58 $.wiki.SummaryPerspective = SummaryPerspective;