Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSmith-LT committed May 11, 2014
1 parent adbdb3f commit 94445b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 43 deletions.
20 changes: 9 additions & 11 deletions editor/js/application.js
Expand Up @@ -25,9 +25,9 @@ jQuery(document).ready(function($) {

buttons = $('<div />').attr('id', 'top_buttons');
$([
{name:'Insert', icon:'img/insert.png', id:'insert_button', click:insert_page},
{name:'Copy', icon:'img/copy.png', id:'copy_button', click:duplicate_page},
{name:'Delete', icon:'img/delete.gif', id:'delete_button', click:delete_page}
{name:'Insert', icon:'editor/img/insert.png', id:'insert_button', click:insert_page},
{name:'Copy', icon:'editor/img/copy.png', id:'copy_button', click:duplicate_page},
{name:'Delete', icon:'editor/img/delete.gif', id:'delete_button', click:delete_page}
])
.each(function(index, value) {
var button = $('<button>')
Expand All @@ -41,8 +41,8 @@ jQuery(document).ready(function($) {

buttons = $('<div />').attr('id', 'save_buttons');
$([
{name:'Preview', icon:'img/insert.png', id:'insert_button', click:preview},
{name:'Publish', icon:'img/copy.png', id:'copy_button', click:publish},
{name:'Preview', icon:'editor/img/insert.png', id:'insert_button', click:preview},
{name:'Publish', icon:'editor/img/copy.png', id:'copy_button', click:publish},
])
.each(function(index, value) {
var button = $('<button>')
Expand All @@ -53,14 +53,13 @@ jQuery(document).ready(function($) {
buttons.append(button);
});
$('.ui-layout-east .content').append(buttons);

})();

(function(){
// load and parse the wizard xml
$.ajax({
type: "GET",
url: "./data.xwd",
url: originalpathvariable + "wizards/" + languagecodevariable + "/data.xwd",
dataType: "text",
success: function(xml) {

Expand Down Expand Up @@ -242,7 +241,7 @@ jQuery(document).ready(function($) {
$menu.menu({
select: function(event, ui) {
if (ui.item.children().attr('hint') != undefined) {
$("#insert-info img").attr("src", "../modules/xerte/parent_templates/Nottingham/" + ui.item.children().attr('thumb'));
$("#insert-info img").attr("src", "modules/xerte/parent_templates/Nottingham/" + ui.item.children().attr('thumb'));
$("#insert-info span").text(ui.item.children().attr('hint'));
$("#insert-buttons").show();
}
Expand All @@ -263,7 +262,7 @@ jQuery(document).ready(function($) {
// get xml data and sorts it
$.ajax({
type: "GET",
url: "./data.xml",
url: xmlvariable,
dataType: "text",
success: function(text) {
// replace all line breaks in attributes with ascii code - otherwise these are replaced with spaces when parsed to xml
Expand Down Expand Up @@ -384,5 +383,4 @@ jQuery(document).ready(function($) {

init();

});

});
36 changes: 4 additions & 32 deletions editor/js/functions.js
Expand Up @@ -58,40 +58,12 @@ function build_lo_data(xmlData, parent_id) {
lo_data[key]['data'] = xmlData[0].firstChild.data;
}

// Build the JSON object for the treeview
/* For version 1 jsTree
var this_json = {
data: {
title : (xmlData[0].attributes['name'] ? xmlData[0].attributes['name'].value : xmlData[0].nodeName),
icon : 'img/page_types/' + xmlData[0].nodeName + '.png'
},
metadata: {
id: key,
parent_id: parent_id
}
};
// if we are at top level then make sure it's open and display node data
if (parent_id == null) {
this_json.state = "open";
//showNodeData(key);
}
if (xmlData.children()[0]) {
this_json.children = [];
xmlData.children().each(function(i) {
this_json.children.push( build_lo_data($(this), key) );
});
}
*/

// Build the JSON object for the treeview
// For version 3 jsTree
var this_json = {
id : key,
text : (xmlData[0].attributes['name'] ? xmlData[0].attributes['name'].value : xmlData[0].nodeName),
icon : 'img/page_types/' + xmlData[0].nodeName + '.png'
icon : 'editor/img/page_types/' + xmlData[0].nodeName + '.png'
}

// if we are at top level then make sure it's open and display node data
Expand Down Expand Up @@ -159,7 +131,7 @@ function displayParameter(id, all_options, name, value, key)
var output_string = '<tr class="wizardattribute">';
if (options.optional == 'true')
{
output_string += '<td class="wizardoptional"><img src="img/optional.gif" />&nbsp;</td>';
output_string += '<td class="wizardoptional"><img src="editor/img/optional.gif" />&nbsp;</td>';
}
else
{
Expand Down Expand Up @@ -235,7 +207,7 @@ function publish() {
console.log("publish clicked");
}

function duplicateSelectedNodes() {
function duplicateSelectedNodes() {
var tree = $.jstree.reference("#treeview");
var copy_node, new_node, id, ids = tree.get_selected();

Expand All @@ -253,7 +225,7 @@ function duplicateSelectedNodes() {

tree.copy_node(current_node, parent_node, 'last');

return true; // Successful
return true; // Successful
}

function deleteSelectedNodes() {
Expand Down

0 comments on commit 94445b7

Please sign in to comment.