Ignore:
Timestamp:
2015-03-11T10:12:30+13:00 (9 years ago)
Author:
davidb
Message:

Changes so i) the choose-palette is a single interactive SVG csurface; 2) the JS runs more smoothly when 'started' at one of the later pages; and 3) changes to remove many of the warnings browsers produce when loading the page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nz-flag-design/trunk/main-form/iterative-design.html

    r29767 r29773  
    126126                function reconfigureSvgCanvas(settings) {
    127127                    console.log("*** entered reconfigureSvgCanvas");
    128                     console.log("*** settings: " + settings.backgroundColor);
     128                    console.log("*** settings: background=" + settings.backgroundColor);
     129                    console.log("*** settings: w x h = " + settings.width + " x " + settings.height);
    129130
    130131                    var design_frame = document.getElementById('design-2d-iframe');
    131132                    var svgCanvas = design_frame.contentWindow.svgCanvas;
    132133                    var svgedit = design_frame.contentWindow.svgedit;
     134
     135                    // Set the new canvas size
     136                    svgCanvas.setResolution(settings.width, settings.height);
    133137
    134138                    var widthVar = settings.width;
     
    186190                    // Centres the canvas (somewhat)
    187191                    //svgCanvas.updateCanvas(100, 100);
     192
    188193                }
    189194
     
    195200                    var la_y_dim = $(window).height() * 0.67;
    196201
    197                     $('#side-by-side').show();
    198 
    199                     $('#side-by-side')
    200                     .liteAccordion({ theme : 'stitch', // 'light',
    201                             rounded         : true,
    202                             //responsive      : true,
    203                             containerWidth  : la_x_dim,
    204                             containerHeight : la_y_dim,
    205                             onTriggerSlide : function() {
    206                                 console.log("onTriggerSlide: this = " + this);
    207                                 console.log("onTriggerSlide: id = " + this[0].id);
    208                                 if (this[0].id == "render-3d-div") {
    209                                     console.log("Triggering SVG-Editor exportPNG()");
    210                                     savePNGAsFile("PNG",null);
     202                    $('#side-by-side').show(10,
     203              function() {
     204                        $('#side-by-side')
     205                          .liteAccordion({ theme : 'stitch', // 'light',
     206                                rounded         : true,
     207                                //responsive      : true,
     208                                containerWidth  : la_x_dim,
     209                                containerHeight : la_y_dim,
     210                                onTriggerSlide : function() {
     211                                    console.log("onTriggerSlide: this = " + this);
     212                                    console.log("onTriggerSlide: id = " + this[0].id);
     213                                    if (this[0].id == "render-3d-div") {
     214                                        console.log("Triggering SVG-Editor exportPNG()");
     215                                        savePNGAsFile("PNG",null);
     216                                    }
    211217                                }
    212                             }
    213                         });
     218                            });
     219            });
    214220                }
    215221
    216222                function activateSVGEditor() {
    217223                    console.log("activateSVGEditor()");
    218                     $('#design-2d-iframe').attr("src","svg-edit-trunk/editor/svg-editor.html?noStorageOnLoad=1");
     224                    $('#design-2d-iframe').attr("src","svg-edit-trunk2/editor/svg-editor.html?noStorageOnLoad=1");
    219225                    $('#design-2d-iframe').load(function() {
    220226                        console.log("*** loaded sgv iframe: " + this);
     
    230236
    231237                $(document).on("pageload",function(event,data){
    232                     console.log( "Iterative Design Page: jquerymobile pageload()" );
     238                    console.log( "Iterative Design Page: jquerymobile pageload()");
    233239                    if (!activatedAccordion) {
    234240                        activateAccordion();       
     
    251257                $(document).on("pagebeforeshow",function(event,data) {
    252258                    var active_page = $.mobile.activePage.attr("id");
    253                     console.log("Event: pagebeforeshow() for page " + active_page);
     259                    console.log("Iterative-Design fielding Event: pagebeforeshow() for page " + active_page);
    254260
    255261                    if (active_page == "iterative-design-page") {
Note: See TracChangeset for help on using the changeset viewer.