1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Moved all vuejs parts over to angular

This commit is contained in:
Dan Brown
2015-12-30 18:38:18 +00:00
parent 3347b3b2f5
commit 46c2e8b14e
24 changed files with 452 additions and 440 deletions

View File

@ -6,9 +6,32 @@ window.ZeroClipboard.config({
// AngularJS - Create application and load components
var angular = require('angular');
var angularResource = require('angular-resource');
var app = angular.module('bookStack', ['ngResource']);
var directives = require('./directives')(app);
var ngResource = require('angular-resource');
var ngAnimate = require('angular-animate');
var ngSanitize = require('angular-sanitize');
var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize']);
var services = require('./services')(ngApp);
var directives = require('./directives')(ngApp);
var controllers = require('./controllers')(ngApp);
//Global jQuery Config & Extensions
// Smooth scrolling
jQuery.fn.smoothScrollTo = function() {
if(this.length === 0) return;
$('body').animate({
scrollTop: this.offset().top - 60 // Adjust to change final scroll position top margin
}, 800); // Adjust to change animations speed (ms)
return this;
};
// Making contains text expression not worry about casing
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
// Global jQuery Elements
$(function () {
@ -18,9 +41,6 @@ $(function () {
$(this).fadeOut(100);
});
// Dropdown toggles
$('[data-dropdown]').dropDown();
// Chapter page list toggles
$('.chapter-toggle').click(function(e) {
e.preventDefault();
@ -30,6 +50,11 @@ $(function () {
});
function elemExists(selector) {
return document.querySelector(selector) !== null;
}
// TinyMCE editor
if(elemExists('#html-editor')) {
var tinyMceOptions = require('./pages/page-form');