forked from Archives/Athou_commafeed
removed codemirror as we don't really need it and it's integration with angular is bugged
This commit is contained in:
@@ -19,8 +19,6 @@ import com.commafeed.frontend.references.angular.AngularSanitizeReference;
|
||||
import com.commafeed.frontend.references.angularui.AngularUIReference;
|
||||
import com.commafeed.frontend.references.angularuibootstrap.AngularUIBootstrapReference;
|
||||
import com.commafeed.frontend.references.angularuistate.AngularUIStateReference;
|
||||
import com.commafeed.frontend.references.codemirror.CodeMirrorCssReference;
|
||||
import com.commafeed.frontend.references.codemirror.CodeMirrorReference;
|
||||
import com.commafeed.frontend.references.fontawesome.FontAwesomeReference;
|
||||
import com.commafeed.frontend.references.mousetrap.MouseTrapReference;
|
||||
import com.commafeed.frontend.references.nggrid.NGGridReference;
|
||||
@@ -50,8 +48,6 @@ public class HomePage extends BasePage {
|
||||
SpinJSReference.renderHead(response);
|
||||
MouseTrapReference.renderHead(response);
|
||||
NGGridReference.renderHead(response);
|
||||
CodeMirrorReference.renderHead(response);
|
||||
CodeMirrorCssReference.renderHead(response);
|
||||
FontAwesomeReference.renderHead(response);
|
||||
|
||||
response.render(JavaScriptHeaderItem.forUrl("js/main.js"));
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.commafeed.frontend.references.codemirror;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.wicket.markup.head.HeaderItem;
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||
import org.apache.wicket.request.Url;
|
||||
import org.apache.wicket.request.resource.UrlResourceReference;
|
||||
|
||||
public class CodeMirrorCssReference extends UrlResourceReference {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final CodeMirrorCssReference INSTANCE = new CodeMirrorCssReference();
|
||||
|
||||
private CodeMirrorCssReference() {
|
||||
super(
|
||||
Url.parse("https://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/css.js"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends HeaderItem> getDependencies() {
|
||||
return Arrays.asList(JavaScriptHeaderItem
|
||||
.forReference(CodeMirrorReference.INSTANCE));
|
||||
}
|
||||
|
||||
public static void renderHead(final IHeaderResponse response) {
|
||||
response.render(JavaScriptHeaderItem.forReference(INSTANCE));
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.commafeed.frontend.references.codemirror;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.wicket.markup.head.CssHeaderItem;
|
||||
import org.apache.wicket.markup.head.HeaderItem;
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||
import org.apache.wicket.request.Url;
|
||||
import org.apache.wicket.request.resource.UrlResourceReference;
|
||||
|
||||
public class CodeMirrorReference extends UrlResourceReference {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final CodeMirrorReference INSTANCE = new CodeMirrorReference();
|
||||
|
||||
private CodeMirrorReference() {
|
||||
super(
|
||||
Url.parse("https://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/codemirror.min.js"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends HeaderItem> getDependencies() {
|
||||
return Arrays
|
||||
.asList(CssHeaderItem.forReference(new UrlResourceReference(
|
||||
Url.parse("https://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/codemirror.min.css"))));
|
||||
}
|
||||
|
||||
public static void renderHead(final IHeaderResponse response) {
|
||||
response.render(JavaScriptHeaderItem.forReference(INSTANCE));
|
||||
}
|
||||
}
|
||||
@@ -545,10 +545,7 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) {
|
||||
$scope.$watch('settingsService.settings', function(value) {
|
||||
$scope.settings = angular.copy(value);
|
||||
});
|
||||
$scope.codeMirrorConfig = {
|
||||
mode : 'css',
|
||||
lineNumbers : true
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
SettingsService.init(function() {
|
||||
$location.path('/');
|
||||
@@ -557,7 +554,7 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) {
|
||||
$scope.save = function() {
|
||||
SettingsService.settings = $scope.settings;
|
||||
SettingsService.save(function() {
|
||||
|
||||
$location.path('/');
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -86,8 +86,9 @@ module.directive('category', function($compile) {
|
||||
restrict : 'E',
|
||||
replace : true,
|
||||
templateUrl : 'directives/category.html',
|
||||
controller : function($scope, $dialog, SubscriptionService, SettingsService) {
|
||||
$scope.settingsService=SettingsService;
|
||||
controller : function($scope, $dialog, SubscriptionService,
|
||||
SettingsService) {
|
||||
$scope.settingsService = SettingsService;
|
||||
$scope.unsubscribe = function(subscription) {
|
||||
var title = 'Unsubscribe';
|
||||
var msg = 'Unsubscribe from ' + subscription.name + ' ?';
|
||||
|
||||
@@ -48,13 +48,13 @@ app.config(function($routeProvider, $stateProvider, $urlRouterProvider) {
|
||||
templateUrl : 'templates/admin.settings.html',
|
||||
controller : 'ManageSettingsCtrl'
|
||||
});
|
||||
|
||||
|
||||
$stateProvider.state('settings', {
|
||||
url : '/settings',
|
||||
templateUrl : 'templates/settings.html',
|
||||
controller : 'SettingsCtrl'
|
||||
});
|
||||
|
||||
|
||||
$stateProvider.state('profile', {
|
||||
url : '/profile',
|
||||
templateUrl : 'templates/profile.html',
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="custom-css">
|
||||
<textarea ui-codemirror="codeMirrorConfig"
|
||||
ng-model="settings.customCss" ui-refresh="refreshCodemirror">
|
||||
<textarea ng-model="settings.customCss" class="input-block-level" rows="20">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user