X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/03c5ba6e50339d7bc470eb6d7f051483eff1e96b..f938afb8ab4cb091d12e0ef0311eaea14b774798:/platforma/static/js/wiki/base.js diff --git a/platforma/static/js/wiki/base.js b/platforma/static/js/wiki/base.js deleted file mode 100644 index 8c626d98..00000000 --- a/platforma/static/js/wiki/base.js +++ /dev/null @@ -1,58 +0,0 @@ -(function($) -{ - $.wiki = {}; - - $.wiki.Perspective = function(document, callback) { - // initialization - }; - - $.wiki.Perspective.toString = function() { - return this.perspective_id; - } - - $.wiki.Perspective.prototype.onEnter = function () { - // called when perspective in initialized - document.location.hash = '#' + this.perspective_id; - console.log(document.location.hash); - }; - - $.wiki.Perspective.prototype.onExit = function () { - // called when user switches to another perspective - }; - - $.wiki.Perspective.prototype.freezeState = function () { - // free UI state (don't store data here) - }; - - $.wiki.Perspective.prototype.unfreezeState = function (frozenState) { - // restore UI state - }; - - $.wiki.renderStub = function($container, $stub, data) - { - var $elem = $stub.clone(); - $elem.removeClass('row-stub'); - $container.append($elem); - - $('*[data-stub-value]', $elem).each(function() { - var $this = $(this); - var field = $this.attr('data-stub-value'); - var value = data[field]; - - if(value === null || value === undefined) return; - - if(!$this.attr('data-stub-target')) { - $this.text(value); - } - else { - $this.attr($this.attr('data-stub-target'), value); - $this.removeAttr('data-stub-target'); - $this.removeAttr('data-stub-value'); - } - }); - - $elem.show(); - return $elem; - }; - -})(jQuery);