* CSS to SCSS

* Use sprockets

* Use Sprockets helpers

* Fix gollum.editor.js error when changing language

* Add keybinding files required by ace and some ace ext files that are required or might be useful.

* Move app paths to /gollum namespace, add route helpers for view templates

* Use path helper for links in page view

* Use path helper methods in javascript assets

* Refactored sprockets helpers for mustache

* Remove debugging
This commit is contained in:
Dawa Ometto
2018-10-14 15:46:10 +02:00
committed by GitHub
parent fd73eb6d05
commit 197a2bd57b
24 changed files with 513 additions and 461 deletions
+1 -1
View File
@@ -28,4 +28,4 @@
//= require ace-1.3.1/ext-textarea.js
//= require ace-1.3.1/ext-themelist.js
//= require ace-1.3.1/ext-whitespace.js
//= require jquery.resize
//= require jquery.resize
@@ -209,7 +209,7 @@
formData.append('file', file);
$.ajax({
url: baseUrl + '/uploadFile',
url: '<%= upload_file_path %>',
data: formData,
cache: false,
contentType: false,
@@ -47,7 +47,7 @@ $(document).ready(function() {
$('#delete-link').click( function(e) {
var ok = confirm($(this).data('confirm'));
if ( ok ) {
var loc = baseUrl + '/delete/' + pageFullPath;
var loc = '<%= delete_path %>/' + pageFullPath;
window.location = loc;
}
// Don't navigate on cancel.
@@ -162,7 +162,7 @@ $(document).ready(function() {
{
type: 'file',
context: 'Your uploaded file will be accessible at<br>/'+uploadDest+'/[filename]',
action: baseUrl + '/uploadFile'
action: '<%= upload_file_path %>'
}
],
OK: function( res ) {
@@ -226,10 +226,14 @@ $(document).ready(function() {
// In the pages view, pageFullPath isn't defined.
// The new button will still expect a value however.
// So we try to figure one out from window.location
path = baseUrl == '' ? window.location.pathname.substr(1)
: window.location.pathname.substr(baseUrl.length + 1);
path = window.location.pathname.substr(1)
// Remove the page viewer part of the url.
path = path.replace(/^pages\/?/,'')
<%
pages_path_uri = pages_path
pages_path_uri = pages_path_uri[1..-1] if pages_path_uri[0] == '/'
pages_path_uri = pages_path_uri.gsub('/','\/')
%>
path = path.replace(/^<%= pages_path_uri %>\/?/,'')
// For consistency remove the trailing /
path = path.replace(/\/$/,'')
}
@@ -260,7 +264,7 @@ $(document).ready(function() {
for( var i=0; i < name_parts.length; i++ ){
name_encoded.push(encodeURIComponent(name_parts[i]));
}
window.location = baseUrl + name_encoded.join('/');
window.location = '<%= create_path %>' + name_encoded.join('/');
}
});
});
@@ -315,7 +319,7 @@ $(document).ready(function() {
if( $("#last-edit").length ) {
$("#page-info-toggle").click ( function () {
$.ajax({
url: '/last-commit-info',
url: '<%= last_commit_info_path %>',
data: {path: $("#page-info-toggle").data('pagepath')},
success: function ( data ) {
$("#last-edit").html('Last edited by <b>' + data.author + '</b>, ' + data.date);
@@ -325,7 +325,7 @@ a {
@include alt-box-model;
}
}
/* @control title */