2     // ========================
 
   3     // = Resizable panels =
 
   4     // ========================
 
   5     function resizePanels() {
 
   6         $('.panel').height($(window).height() - $('.panel').position().top);
 
   7         $('#right-panel-wrap').width($(window).width() - $('#left-panel-wrap').outerWidth());
 
  10     $(window).resize(function() {
 
  14     $('#left-panel-wrap').bind('resizable:resize', resizePanels)
 
  15         .resizable('#slider', {minWidth: 8});
 
  19     $('.panel-toolbar select').change(function() {
 
  20         console.log('loading panel', $(this).val(), 'into', $('.panel-contents', $(this).parent()));
 
  22     // $('#id_folders').change(function() {
 
  23     //     $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
 
  24     //         $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
 
  30     // var editor = CodeMirror.fromTextArea("id_text", {
 
  31     //     parserfile: 'parsexml.js',
 
  32     //     path: "/static/js/codemirror/",
 
  33     //     stylesheet: "/static/css/xmlcolors.css",
 
  34     //     parserConfig: {useHTMLKludges: false},
 
  35     //     initCallback: function() {
 
  36     //         $('#images').autoscroll('iframe');
 
  37     //         $('.toggleAutoscroll').toggle(function() {
 
  38     //             $(this).html('Synchronizuj przewijanie');
 
  39     //             $('#images').disableAutoscroll();
 
  41     //             $(this).html('Nie synchronizuj przewijania');
 
  42     //             $('#images').enableAutoscroll();
 
  46     //         $('#toolbar-tabs li').click(function() {
 
  47     //             var id = $(this).attr('p:button-list');
 
  48     //             $('#toolbar-tabs li').removeClass('active');
 
  49     //             $(this).addClass('active');
 
  50     //             if (!$('#' + id).is(':visible')) {
 
  51     //                 $('#toolbar-buttons ol').not('#' + id).hide();
 
  52     //                 $('#' + id).show();
 
  57     //         $('#toolbar-buttons li').each(function() {
 
  58     //             var tag = $(this).attr('p:tag');
 
  59     //             var handler = function() {
 
  60     //                 var text = editor.selection();
 
  61     //                 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
 
  62     //                 if (text.length == 0) {
 
  63     //                     var pos = editor.cursorPosition();
 
  64     //                     editor.selectLines(pos.line, pos.character + tag.length + 2);
 
  67     //             if ($(this).attr('p:key')) {
 
  68     //                 keys[$(this).attr('p:key')] = handler;
 
  70     //             $(this).click(handler)
 
  73     //         editor.grabKeys(function(event) { 
 
  74     //             if (keys[event.keyCode]) {
 
  75     //                 keys[event.keyCode]();
 
  77     //         }, function(event) {
 
  78     //             return event.altKey && keys[event.keyCode];
 
  87     // $('#toolbar-buttons li').wTooltip({
 
  90     //         border: "1px solid #7F7D67",
 
  92     //         background: "#FBFBC6", 
 
  97     // $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});