FLUID-2896: solve problem of preview not working for http://fluidproject.org

Metadata

Source
FLUID-2896
Type
Sub-issue
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Laurel Williams
Reporter
Laurel Williams
Created
2009-06-02T16:20:28.000-0400
Updated
2009-06-04T14:53:06.000-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Website

Description

In the javascript to use ui options, you need to load the ui options template from an html page on the server. Because of ?security issues? I have had to use the exact url in the javascript to load the UIOptions template (see javascript snippet below). I would prefer to have used a relative url, but get security errors when I do.

var loadUIOptions = function() {
var urlSelector = "http://" + location.host + "/uploads/ui-options/UIOptions.html .uiOptions";
$("#dialogContent").load(urlSelector, initUIOptions);
};

I figured out that using the location.host above solved the problem of having two possible urls - http://www.fluidproject.org or http://fluidproject.org

However, I have a similar problem in the template - which loads the preview template. I am really not sure how to address this issue.

Ideally it would be best to solve the security issue and go back to the relative url, but otherwise a solution to the preview problem would also work.

Comments

  • Laurel Williams commented 2009-06-03T10:57:24.000-0400

    Added a code snipit into initUIOptions as noted below.

    var initUIOptions = function() {
    var options = {
    listeners: {
    afterRender: function() {
    $('.uiOptions .fl-col:eq(0)').accordion({
    header: 'h2',
    clearStyle: true,
    autoHeight: false
    });
    $('.uiOptions .fl-col h2:eq(0)').focus();
    },
    onCancel: function() {
    $("#uiOptionsContainer").dialog("close");
    },
    onSave: function() {
    $("#uiOptionsContainer").dialog("close");
    }
    }
    };

    // solves the uri security issue
    // remove if we can get relative uri working
    //locate .flc-uiOptions-preview-frame in the template
    //replace the src parameter with the appropriate value
    $(".flc-uiOptions-preview-frame").attr("src", "http://" + location.host +
    "/uploads/ui-options/UIOptionsPreview.html");

    uiOptions = fluid.uiOptions("#uiOptionsContainer", options);
    $("#uiOptionsContainer").dialog('option', 'position', 'center');
    };

  • Laurel Williams commented 2009-06-04T14:52:43.000-0400

    Ended up removing this code after forcing website to have http://fluidproject.org url only. FLUID-2909