From a48175e69474b76a9aa2443ec7b2e8e9d68df1aa Mon Sep 17 00:00:00 2001 From: zuber Date: Tue, 22 Sep 2009 12:26:39 +0200 Subject: [PATCH 1/1] =?utf8?q?Przeniesienie=20zewn=C4=99trznych=20u=C5=BCy?= =?utf8?q?wanych=20przez=20nas=20skrypt=C3=B3w=20do=20katalogu=20/static/j?= =?utf8?q?s/lib=20oraz=20usuni=C4=99cie=20nieu=C5=BCywanych=20skrypt=C3=B3?= =?utf8?q?w.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- project/static/js/jquery.autoscroll.js | 47 ------------- project/static/js/jquery.paginate.js | 66 ------------------- .../js/{ => lib}/codemirror/codemirror.js | 0 .../static/js/{ => lib}/codemirror/editor.js | 0 .../js/{ => lib}/codemirror/parsexml.js | 0 .../static/js/{ => lib}/codemirror/select.js | 0 .../js/{ => lib}/codemirror/stringstream.js | 0 .../js/{ => lib}/codemirror/tokenize.js | 0 .../static/js/{ => lib}/codemirror/undo.js | 0 .../static/js/{ => lib}/codemirror/util.js | 0 project/static/js/{ => lib}/jquery.cookie.js | 0 project/static/js/{ => lib}/jquery.hpanel.js | 0 project/static/js/{ => lib}/jquery.js | 0 project/static/js/{ => lib}/jquery.json.js | 0 .../static/js/{ => lib}/jquery.lazyload.js | 0 project/static/js/{ => lib}/jquery.logging.js | 0 project/static/js/{ => lib}/jquery.modal.js | 0 .../static/js/{ => lib}/jquery.wtooltip.js | 0 project/templates/base.html | 4 +- project/templates/explorer/editor.html | 13 ++-- .../templates/explorer/panels/xmleditor.html | 2 +- 21 files changed, 9 insertions(+), 123 deletions(-) delete mode 100644 project/static/js/jquery.autoscroll.js delete mode 100644 project/static/js/jquery.paginate.js rename project/static/js/{ => lib}/codemirror/codemirror.js (100%) rename project/static/js/{ => lib}/codemirror/editor.js (100%) rename project/static/js/{ => lib}/codemirror/parsexml.js (100%) rename project/static/js/{ => lib}/codemirror/select.js (100%) rename project/static/js/{ => lib}/codemirror/stringstream.js (100%) rename project/static/js/{ => lib}/codemirror/tokenize.js (100%) rename project/static/js/{ => lib}/codemirror/undo.js (100%) rename project/static/js/{ => lib}/codemirror/util.js (100%) rename project/static/js/{ => lib}/jquery.cookie.js (100%) rename project/static/js/{ => lib}/jquery.hpanel.js (100%) rename project/static/js/{ => lib}/jquery.js (100%) rename project/static/js/{ => lib}/jquery.json.js (100%) rename project/static/js/{ => lib}/jquery.lazyload.js (100%) rename project/static/js/{ => lib}/jquery.logging.js (100%) rename project/static/js/{ => lib}/jquery.modal.js (100%) rename project/static/js/{ => lib}/jquery.wtooltip.js (100%) diff --git a/project/static/js/jquery.autoscroll.js b/project/static/js/jquery.autoscroll.js deleted file mode 100644 index f8c07fbd..00000000 --- a/project/static/js/jquery.autoscroll.js +++ /dev/null @@ -1,47 +0,0 @@ -(function($) { - $.fn.autoscroll = function(synchronizeWith, options) { - var $this = $(this); - var self = $this; - var selfContainer = self.parent(); - var synchronizeWith = $(synchronizeWith); - var synchronizeWithContainer = synchronizeWith.parent(); - var eventContainer = synchronizeWithContainer; - - // Hack for iframes - if (self.is('iframe')) { - selfContainer = $('body', $('iframe').contents()); - self = selfContainer; - } - - if (synchronizeWith.is('iframe')) { - eventContainer = synchronizeWith.contents(); - synchronizeWithContainer = $('body', eventContainer); - synchronizeWith = synchronizeWithContainer; - } - - $this.data('autoscroll:enabled', true); - synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop', synchronizeWithContainer.scrollTop()); - - eventContainer.scroll(function() { - if ($this.data('autoscroll:enabled')) { - var distanceScrolled = synchronizeWithContainer.scrollTop() - synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop'); - var percentScrolled = distanceScrolled / synchronizeWith.height(); - selfContainer.scrollTop(selfContainer.scrollTop() + percentScrolled * self.height()); - } - synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop', synchronizeWithContainer.scrollTop()); - }); - }, - - $.fn.enableAutoscroll = function() { - $(this).data('autoscroll:enabled', true); - }, - - $.fn.disableAutoscroll = function() { - $(this).data('autoscroll:enabled', false); - }, - - $.fn.toggleAutoscroll = function() { - $(this).data('autoscroll:enabled', !$(this).data('autoscroll:enabled')); - } -})(jQuery); - diff --git a/project/static/js/jquery.paginate.js b/project/static/js/jquery.paginate.js deleted file mode 100644 index 710b1846..00000000 --- a/project/static/js/jquery.paginate.js +++ /dev/null @@ -1,66 +0,0 @@ -(function($) { - - var settings = { - items: [], - itemsPerPage: 20, - page: 0 - }; - - $.fn.filterItems = function(condition) - { - settings.items = $('p', this); - - if(condition) settings.items = settings.items.filter(function() { - return condition( $(this).attr('title') ); - }); - - var pageCount = Math.ceil(settings.items.length / settings.itemsPerPage); - var buttons = $('.page-nav-wrap button', this.parent()); - buttons.show().filter(function(i) { return i >= pageCount; }).hide(); - this.switchToPage(); - }; - - $.fn.switchToPage = function(index) - { - index = index || settings.page; - var start = index * settings.itemsPerPage; - var end = start + settings.itemsPerPage; - $('p', this).hide(); - - var visibleItems = settings.items.filter(function(i) { return i >= start && i < end; }); - visibleItems.show(); - } - - $.fn.paginate = function(options) - { - var list = this; - - // apply defaults - if (options) $.extend(settings, options); - settings.items = $('p', list); - - var nav = $(''); - list.before(nav); - var pageCount = Math.floor(settings.items.length / settings.itemsPerPage); - var orphanCount = settings.items.length - (pageCount * settings.itemsPerPage); - var button = null; - - for(var i=0; i < pageCount; i++) - { - button = $(""); - button.bind('click', i, function(event) { list.switchToPage(event.data); }); - nav.append(button); - } - - if(orphanCount > 0) - { - i = pageCount; - button = $(""); - button.bind('click', i, function(event) { list.switchToPage(event.data); }); - nav.append(button); - } - - list.filterItems(function(){return true;}); - list.switchToPage(0); - }; -})(jQuery); diff --git a/project/static/js/codemirror/codemirror.js b/project/static/js/lib/codemirror/codemirror.js similarity index 100% rename from project/static/js/codemirror/codemirror.js rename to project/static/js/lib/codemirror/codemirror.js diff --git a/project/static/js/codemirror/editor.js b/project/static/js/lib/codemirror/editor.js similarity index 100% rename from project/static/js/codemirror/editor.js rename to project/static/js/lib/codemirror/editor.js diff --git a/project/static/js/codemirror/parsexml.js b/project/static/js/lib/codemirror/parsexml.js similarity index 100% rename from project/static/js/codemirror/parsexml.js rename to project/static/js/lib/codemirror/parsexml.js diff --git a/project/static/js/codemirror/select.js b/project/static/js/lib/codemirror/select.js similarity index 100% rename from project/static/js/codemirror/select.js rename to project/static/js/lib/codemirror/select.js diff --git a/project/static/js/codemirror/stringstream.js b/project/static/js/lib/codemirror/stringstream.js similarity index 100% rename from project/static/js/codemirror/stringstream.js rename to project/static/js/lib/codemirror/stringstream.js diff --git a/project/static/js/codemirror/tokenize.js b/project/static/js/lib/codemirror/tokenize.js similarity index 100% rename from project/static/js/codemirror/tokenize.js rename to project/static/js/lib/codemirror/tokenize.js diff --git a/project/static/js/codemirror/undo.js b/project/static/js/lib/codemirror/undo.js similarity index 100% rename from project/static/js/codemirror/undo.js rename to project/static/js/lib/codemirror/undo.js diff --git a/project/static/js/codemirror/util.js b/project/static/js/lib/codemirror/util.js similarity index 100% rename from project/static/js/codemirror/util.js rename to project/static/js/lib/codemirror/util.js diff --git a/project/static/js/jquery.cookie.js b/project/static/js/lib/jquery.cookie.js similarity index 100% rename from project/static/js/jquery.cookie.js rename to project/static/js/lib/jquery.cookie.js diff --git a/project/static/js/jquery.hpanel.js b/project/static/js/lib/jquery.hpanel.js similarity index 100% rename from project/static/js/jquery.hpanel.js rename to project/static/js/lib/jquery.hpanel.js diff --git a/project/static/js/jquery.js b/project/static/js/lib/jquery.js similarity index 100% rename from project/static/js/jquery.js rename to project/static/js/lib/jquery.js diff --git a/project/static/js/jquery.json.js b/project/static/js/lib/jquery.json.js similarity index 100% rename from project/static/js/jquery.json.js rename to project/static/js/lib/jquery.json.js diff --git a/project/static/js/jquery.lazyload.js b/project/static/js/lib/jquery.lazyload.js similarity index 100% rename from project/static/js/jquery.lazyload.js rename to project/static/js/lib/jquery.lazyload.js diff --git a/project/static/js/jquery.logging.js b/project/static/js/lib/jquery.logging.js similarity index 100% rename from project/static/js/jquery.logging.js rename to project/static/js/lib/jquery.logging.js diff --git a/project/static/js/jquery.modal.js b/project/static/js/lib/jquery.modal.js similarity index 100% rename from project/static/js/jquery.modal.js rename to project/static/js/lib/jquery.modal.js diff --git a/project/static/js/jquery.wtooltip.js b/project/static/js/lib/jquery.wtooltip.js similarity index 100% rename from project/static/js/jquery.wtooltip.js rename to project/static/js/lib/jquery.wtooltip.js diff --git a/project/templates/base.html b/project/templates/base.html index 54809993..dacd73b4 100644 --- a/project/templates/base.html +++ b/project/templates/base.html @@ -5,8 +5,8 @@ {% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%} - - + + {% block extrahead %} {% endblock %} diff --git a/project/templates/explorer/editor.html b/project/templates/explorer/editor.html index 610a9600..428f3546 100644 --- a/project/templates/explorer/editor.html +++ b/project/templates/explorer/editor.html @@ -6,13 +6,12 @@ - - - - - - - + + + + + + diff --git a/project/templates/explorer/panels/xmleditor.html b/project/templates/explorer/panels/xmleditor.html index 4a8362dd..4ec75d2a 100644 --- a/project/templates/explorer/panels/xmleditor.html +++ b/project/templates/explorer/panels/xmleditor.html @@ -16,7 +16,7 @@ panel_hooks = { var texteditor = CodeMirror.fromTextArea(textareaId, { parserfile: 'parsexml.js', - path: "{{STATIC_URL}}js/codemirror/", + path: "{{STATIC_URL}}js/lib/codemirror/", stylesheet: "{{STATIC_URL}}css/xmlcolors.css", parserConfig: {useHTMLKludges: false}, onChange: function() { -- 2.20.1