Skip to content
Snippets Groups Projects
Commit e3227b41 authored by srosse's avatar srosse
Browse files

OO-4597: always allow use of jquery in single page (same as SCORM)

parent 5e5569ff
No related branches found
No related tags found
No related merge requests found
......@@ -482,19 +482,21 @@ public class LinkFileCombiCalloutController extends BasicController {
public boolean isEditorEnabled() {
// enable html editor for html files
if(editable && StringHelper.containsNonWhitespace(relFilePath)) {
return editable && isHtmlFile();
}
public boolean isHtmlFile() {
if(StringHelper.containsNonWhitespace(relFilePath)) {
String lowercase = relFilePath.toLowerCase().trim();
if (lowercase.endsWith(".html") || lowercase.endsWith(".htm")) {
return true;
}
}
// disable html editor for all other cases
return false;
}
@Override
protected void doDispose() {
// controllers auto-disposed by basic controller
//
}
}
\ No newline at end of file
......@@ -191,8 +191,12 @@ public class SPEditController extends ActivateableTabbableDefaultController impl
combiLinkCtr.setEditable(hasEditRights(relPath));
moduleConfiguration.set(CONFIG_KEY_FILE, relPath);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
if(!myTabbedPane.containsTab(deliveryOptionsCtrl.getInitialComponent())) {
myTabbedPane.addTab(translate(PANE_TAB_DELIVERYOPTIONS), deliveryOptionsCtrl.getInitialComponent());
if(combiLinkCtr.isHtmlFile()) {
if(!myTabbedPane.containsTab(deliveryOptionsCtrl.getInitialComponent())) {
myTabbedPane.addTab(translate(PANE_TAB_DELIVERYOPTIONS), deliveryOptionsCtrl.getInitialComponent());
}
} else {
myTabbedPane.removeTab(deliveryOptionsCtrl.getInitialComponent());
}
myContent.contextPut("editorEnabled", combiLinkCtr.isEditorEnabled());
}
......@@ -221,7 +225,7 @@ public class SPEditController extends ActivateableTabbableDefaultController impl
myTabbedPane = tabbedPane;
tabbedPane.addTab(translate(PANE_TAB_ACCESSIBILITY), accessibilityCondContr.getWrappedDefaultAccessConditionVC(translate(NLS_CONDITION_ACCESSIBILITY_TITLE)));
tabbedPane.addTab(translate(PANE_TAB_SPCONFIG), myContent);
if(combiLinkCtr != null && combiLinkCtr.isEditorEnabled()) {
if(combiLinkCtr != null && combiLinkCtr.isHtmlFile()) {
tabbedPane.addTab(translate(PANE_TAB_DELIVERYOPTIONS), deliveryOptionsCtrl.getInitialComponent());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment