Changeset 3920


Ignore:
Timestamp:
Oct 28, 2010, 11:22:46 AM (13 years ago)
Author:
Gregory Vincic
Message:

Making javascript context unaware. Context is now defined in ActionFactory? and propagated down to other factories. Which should allow us to have multiple proteios installations. Not tested though.

Location:
trunk/client/servlet
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/gui/web/GUIConverter.java

    r3908 r3920  
    295295        if (action != null)
    296296        {
    297             String jsMethod = "rightGo";
     297            String jsMethod = "goToLocation";
    298298            sb.append(jsMethod + "('");
     299      sb.append(this.contextPath);
     300      sb.append("?action=");
    299301            sb.append(action.toString());
    300302            sb.append("')");
     
    15521554            else
    15531555            {
    1554                 href.setOnClick("rightGo('" + a.toString() + "')");
     1556                href.setOnClick("goToLocation('" + this.contextPath + "?action=" + a.toString() + "')");
    15551557            }
    15561558        }
  • trunk/client/servlet/src/org/proteios/gui/web/HtmlFactory.java

    r3364 r3920  
    137137    cssPath = contextPath + "/static/css/";
    138138    jsPath = contextPath + "/static/js/";
    139     script = new Script();
    140139
    141140    // Use
     
    148147    head.add(createCSSLink(cssPath + "layout2.jsp"));
    149148    head.add(createCSSLink(cssPath + "colors.css"));
    150     script.newCData("var TOGGLE = 0;");
    151     head.add(script);
    152149    head.add(createScript(jsPath + "dom-drag.js"));
    153150    head.add(createScript(jsPath + "script.js"));
  • trunk/client/servlet/www/static/js/script.js

    r3919 r3920  
    1 //  Add var TOGGLE = 0; to a global script
    2 var CONTEXT = "/proteios/app?action=";
    3 
    41function empty()
    52{
     
    74}
    85
    9 function rightGo(action)
    10 {
    11     if(parent.right)
    12     {
    13         parent.right.location = CONTEXT + action;
    14     }
    15     else
    16     {
    17         goToLocation(CONTEXT + action);
    18     }
    19 }
    20 
    21 function popupGo(action)
    22 {
    23     window.open(CONTEXT + action ,'popup','width=500,height=500');
    24 }
    25 
    266function goToLocation(location)
    277{
    28     if(TOGGLE == 0)
    29     {
    30         window.location = location;
    31     }
    32     TOGGLE = 0;
     8  window.location = location;
    339}
    3410
     
    10581function submitFormAs(formId, action)
    10682{
    107     if(TOGGLE == 0)
    108     {
    109         getElement(formId + "action").value = action;
    110         getElement(formId).submit();
    111     }
    112     TOGGLE = 0;
     83    getElement(formId + "action").value = action;
     84    getElement(formId).submit();
    11385}
    11486
Note: See TracChangeset for help on using the changeset viewer.