How to use the ghost/utils/ghost-paths function in ghost

To help you get started, we’ve selected a few ghost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost-Admin / app / router.js View on Github external
import Ember from 'ember';
import ghostPaths from 'ghost/utils/ghost-paths';
import documentTitle from 'ghost/utils/document-title';

var Router = Ember.Router.extend({
    location: 'trailing-history', // use HTML5 History API instead of hash-tag based URLs
    rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost

    clearNotifications: Ember.on('didTransition', function () {
        this.notifications.closePassive();
        this.notifications.displayDelayed();
    })
});

documentTitle();

Router.map(function () {
    this.route('setup');
    this.route('signin');
    this.route('signout');
    this.route('signup', {path: '/signup/:token'});
    this.route('forgotten');
    this.route('reset', {path: '/reset/:token'});
github cobyism / ghost-on-heroku / core / client / models / base.js View on Github external
type: 'GET'
        });
    },

    save: function () {
        return ic.ajax.request(this.url, {
            type: 'PUT',
            dataType: 'json',
            // @TODO: This is passing _oldWillDestory and _willDestroy and should not.
            data: JSON.stringify(this.getProperties(Ember.keys(this)))
        });
    }
});

BaseModel.apiRoot = ghostPaths().apiRoot;
BaseModel.subdir = ghostPaths().subdir;
BaseModel.adminRoot = ghostPaths().adminRoot;

export default BaseModel;
github cobyism / ghost-on-heroku / core / client / models / base.js View on Github external
return ic.ajax.request(this.url, {
            type: 'GET'
        });
    },

    save: function () {
        return ic.ajax.request(this.url, {
            type: 'PUT',
            dataType: 'json',
            // @TODO: This is passing _oldWillDestory and _willDestroy and should not.
            data: JSON.stringify(this.getProperties(Ember.keys(this)))
        });
    }
});

BaseModel.apiRoot = ghostPaths().apiRoot;
BaseModel.subdir = ghostPaths().subdir;
BaseModel.adminRoot = ghostPaths().adminRoot;

export default BaseModel;
github cobyism / ghost-on-heroku / core / client / models / base.js View on Github external
});
    },

    save: function () {
        return ic.ajax.request(this.url, {
            type: 'PUT',
            dataType: 'json',
            // @TODO: This is passing _oldWillDestory and _willDestroy and should not.
            data: JSON.stringify(this.getProperties(Ember.keys(this)))
        });
    }
});

BaseModel.apiRoot = ghostPaths().apiRoot;
BaseModel.subdir = ghostPaths().subdir;
BaseModel.adminRoot = ghostPaths().adminRoot;

export default BaseModel;
github TryGhost / Ghost / core / client / app / services / ghost-paths.js View on Github external
import Ember from 'ember';
import ghostPaths from 'ghost/utils/ghost-paths';

const {Service, _ProxyMixin} = Ember;

export default Service.extend(_ProxyMixin, {
    content: ghostPaths()
});
github TryGhost / Ghost-Admin / app / assets / lib / uploader.js View on Github external
import Ember from 'ember';
import ghostPaths from 'ghost/utils/ghost-paths';

const {$} = Ember;

let Ghost = ghostPaths();

let UploadUi = function ($dropzone, settings) {
    let $url = '<div class="js-url"><input placeholder="http://" type="url" class="url js-upload-url gh-input"></div>';
    let $cancel = '<a title="Delete" class="image-cancel icon-trash js-cancel"><span class="hidden">Delete</span></a>';
    let $progress =  $('<div>', {
            class: 'js-upload-progress progress progress-success active',
            role: 'progressbar',
            'aria-valuemin': '0',
            'aria-valuemax': '100'
        }).append($('<div>', {
            class: 'js-upload-progress-bar bar',
            style: 'width:0%'
        }));

    $.extend(this, {
        complete: (result) =&gt; {</div></div>
github TryGhost / Ghost-Admin / app / initializers / ghost-paths.js View on Github external
initialize: function (container, application) {
        application.register('ghost:paths', ghostPaths(), {instantiate: false});

        application.inject('route', 'ghostPaths', 'ghost:paths');
        application.inject('model', 'ghostPaths', 'ghost:paths');
        application.inject('controller', 'ghostPaths', 'ghost:paths');
    }
};