Skip to content

Commit

Permalink
Temporarily add Preview and Publish buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSmith-LT committed May 11, 2014
1 parent edf39e8 commit 15fd551
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions editor/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ jQuery(document).ready(function($) {
buttons.append(button);
});
$('.ui-layout-west .header').append(buttons);

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},
])
.each(function(index, value) {
var button = $('<button>')
.attr('id', value.id)
.click(value.click)
.append($('<img>').attr('src', value.icon).height(14))
.append(value.name);
buttons.append(button);
});
$('.ui-layout-east .content').append(buttons);

})();

(function(){
Expand Down
10 changes: 9 additions & 1 deletion editor/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function getOptionValue(all_options, key)
value = all_options[i].value;
break;
}
};
}
return value;
}

Expand Down Expand Up @@ -227,6 +227,14 @@ function convertColorPickers()
});
}

function preview() {
console.log("preview clicked");
}

function publish() {
console.log("publish clicked");
}

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

0 comments on commit 15fd551

Please sign in to comment.