3 class SummaryPerspective extends $.wiki.Perspective {
5 var old_callback = options.callback || function() {};
7 options.callback = function() {
10 // first time page is rendered
11 $('#summary-cover-refresh').click(function() {
15 old_callback.call(this);
22 $('#summary-cover-refresh').attr('disabled', 'disabled');
23 this.doc.refreshCover({
24 success: function(text) {
25 $('#summary-cover').attr('src', text);
26 $('#summary-cover-refresh').removeAttr('disabled');
34 $('#charcounts_text').show();
35 $('#charcounts_raw').hide();
36 cc = this.doc.getLength({noFootnotes: true, noThemes: true});
37 $('#charcount').html(cc);
38 $('#charcount_pages').html((Math.round(cc/18)/100).toLocaleString());
40 cc = this.doc.getLength();
41 $('#charcount_full').html(cc);
42 $('#charcount_full_pages').html((Math.round(cc/18)/100).toLocaleString());
45 $('#charcounts_text').hide();
46 $('#charcounts_raw').show();
47 cc = this.doc.text.replace(/\s{2,}/g, ' ').length;
48 $('#charcount_raw').html(cc);
49 $('#charcount_raw_pages').html((Math.round(cc/18)/100).toLocaleString());
53 freezeState = function() {
57 onEnter(success, failure){
62 console.log("Entered summery view");
65 $.wiki.SummaryPerspective = SummaryPerspective;