Sha256: 41c99e661f47bb6575590bc7433478004bef37912d273090a71599770e999bb0

Contents?: true

Size: 1.19 KB

Versions: 19

Compression:

Stored size: 1.19 KB

Contents

if (typeof(Alchemy) === 'undefined') {
	var Alchemy = {};
}

Alchemy.loadAlchemyMenuBar = function (options) {

	Alchemy.Menubar = {

		show: function() {
			$('body').prepend(Alchemy.Menubar.build());
		},

		build: function() {
			var bar = $('<div id="alchemy_menubar"/>')
				.append('<ul/>');
			bar.find('ul')
				.append('<li><a href="'+options.route+'/admin">'+Alchemy.Menubar.t("to_alchemy")+'</a></li>')
				.append('<li><a href="'+options.route+'/admin/pages/'+options.page_id+'/edit">'+Alchemy.Menubar.t("edit_page")+'</a></li>')
				.append('<li><a href="'+options.route+'/admin/logout">'+Alchemy.Menubar.t("logout")+'</a></li>');
			return bar;
		},

		translations: {
			'to_alchemy' : {
				'de' : 'zu Alchemy',
				'en' : 'To Alchemy'
			},
			'edit_page' : {
				'de' : 'Seite bearbeiten',
				'en' : 'Edit Page'
			},
			'logout' : {
				'de' : 'abmelden',
				'en' : 'Log out'
			}
		},

		t : function(id) {
			var translation = Alchemy.Menubar.translations[id];
			if (translation) {
				return translation[options.locale];
			} else {
				return id;
			}
		}

	};

	if (typeof(jQuery) === 'undefined') {
		Alchemy.loadjQuery(Alchemy.Menubar.show);
	} else {
		Alchemy.Menubar.show();
	}

};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.11 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.9.1 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.9 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.8.1 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.8 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.7 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.6 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.5 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.4 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.3 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.2 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.1 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.rc6 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.rc5 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.rc4 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.rc3 app/assets/javascripts/alchemy/alchemy.menubar.js
alchemy_cms-2.1.rc2 app/assets/javascripts/alchemy/alchemy.menubar.js