From a3a778ec7c2fe89c4cb48f42be3b0821530199d8 Mon Sep 17 00:00:00 2001 From: zuber Date: Thu, 1 Oct 2009 14:37:22 +0200 Subject: [PATCH] Dodanie przycisku reload. --- project/static/css/html.css | 7 +++++-- project/static/css/master.css | 12 +++++++++++- project/static/js/views/gallery.js | 2 ++ project/static/js/views/html.js | 12 +++++++----- project/static/js/views/panel_container.js | 15 +++++++++++++-- project/static/js/views/xml.js | 12 +++++++----- project/templates/explorer/editor.html | 2 +- 7 files changed, 46 insertions(+), 16 deletions(-) diff --git a/project/static/css/html.css b/project/static/css/html.css index 85734491..4904a0d6 100644 --- a/project/static/css/html.css +++ b/project/static/css/html.css @@ -1,9 +1,12 @@ +/* Style widoku HTML. Nie należy tu ustawiać position ani marginesów */ .htmlview { font-size: 16px; font: Georgia, "Times New Roman", serif; line-height: 1.5em; - margin: 0; - margin: 3em; + padding: 3em; +} + +.htmlview div { max-width: 36em; } diff --git a/project/static/css/master.css b/project/static/css/master.css index 1649a4be..5f81f17e 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -210,7 +210,7 @@ text#commit-dialog-message { right: 0; bottom: 0; left: 0; - overflow: none; + overflow: hidden; } .panel-main-toolbar { @@ -323,6 +323,16 @@ input.image-gallery-current-page { padding: 0px; } +.htmlview { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: auto; + margin: 0; +} + .image-gallery-page-container img { /* border: 2px solid green; */ margin: 0px; diff --git a/project/static/js/views/gallery.js b/project/static/js/views/gallery.js index ad17c4be..fe54b933 100644 --- a/project/static/js/views/gallery.js +++ b/project/static/js/views/gallery.js @@ -79,6 +79,8 @@ var ImageGalleryView = View.extend({ this.$pageInput.val( (this.currentPage+1) ); }, + reload: function() {}, + modelStateChanged: function(property, value) { if (value == 'loading') { this.parent.freeze('Ładowanie...'); diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 2e5f7cf0..8057138e 100644 --- a/project/static/js/views/html.js +++ b/project/static/js/views/html.js @@ -24,18 +24,20 @@ var HTMLView = View.extend({ modelStateChanged: function(property, value) { if (value == 'synced' || value == 'dirty') { - this.parent.unfreeze(); + this.unfreeze(); } else if (value == 'unsynced') { - this.parent.freeze('Niezsynchronizowany...'); + this.freeze('Niezsynchronizowany...'); } else if (value == 'loading') { - this.parent.freeze('Ładowanie...'); + this.freeze('Ładowanie...'); } else if (value == 'saving') { - this.parent.freeze('Zapisywanie...'); + this.freeze('Zapisywanie...'); } else if (value == 'error') { - this.parent.freeze(this.model.get('error')); + this.freeze(this.model.get('error')); } }, + reload: function() {}, + dispose: function() { this.model.removeObserver(this); this._super(); diff --git a/project/static/js/views/panel_container.js b/project/static/js/views/panel_container.js index 332e83a6..aead0e77 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -10,7 +10,10 @@ var PanelContainerView = View.extend({ init: function(element, model, template) { this._super(element, model, template); - $('select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this)); + $('.panel-main-toolbar select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this)); + $('.panel-main-toolbar .refresh', this.element.get(0)) + .bind('click.panel-container-view', this.refreshButtonClicked.bind(this)) + .attr('disabled', 'disabled'); }, selectChanged: function(event) { @@ -22,10 +25,18 @@ var PanelContainerView = View.extend({ } this.contentView = new klass($('.content-view', this.element.get(0)), this.model.contentModels[value], this); + $('.panel-main-toolbar .refresh', this.element.get(0)).attr('disabled', null); + }, + + refreshButtonClicked: function(event) { + if (this.contentView) { + this.contentView.reload(); + } }, dispose: function() { - $('select', this.element.get(0)).unbind('change.panel-container-view'); + $('.panel-main-toolbar .refresh', this.element.get(0)).unbind('click.panel-container-view'); + $('.panel-main-toolbar select', this.element.get(0)).unbind('change.panel-container-view'); this._super(); } }); diff --git a/project/static/js/views/xml.js b/project/static/js/views/xml.js index d272e277..20e2ee98 100644 --- a/project/static/js/views/xml.js +++ b/project/static/js/views/xml.js @@ -35,6 +35,8 @@ var XMLView = View.extend({ $('.xmlview', this.element).height(height); }, + reload: function() {}, + editorDidLoad: function(editor) { $(editor.frame).css({width: '100%', height: '100%'}); this.model @@ -65,15 +67,15 @@ var XMLView = View.extend({ modelStateChanged: function(property, value) { if (value == 'synced' || value == 'dirty') { - this.parent.unfreeze(); + this.unfreeze(); } else if (value == 'unsynced') { - this.parent.freeze('Niezsynchronizowany...'); + this.freeze('Niezsynchronizowany...'); } else if (value == 'loading') { - this.parent.freeze('Ładowanie...'); + this.freeze('Ładowanie...'); } else if (value == 'saving') { - this.parent.freeze('Zapisywanie...'); + this.freeze('Zapisywanie...'); } else if (value == 'error') { - this.parent.freeze(this.model.get('error')); + this.freeze(this.model.get('error')); } }, diff --git a/project/templates/explorer/editor.html b/project/templates/explorer/editor.html index b047287d..40b5f7ae 100644 --- a/project/templates/explorer/editor.html +++ b/project/templates/explorer/editor.html @@ -38,7 +38,7 @@ <% for (panel in panels) { %> <% }; %> -

+

-- 2.20.1