|
|
@ -164,6 +164,62 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<script src="/editor-files/editor.js"></script> |
|
|
|
|
|
|
|
<script> |
|
|
|
$(function(){ |
|
|
|
|
|
|
|
<?php if(!Config::$twitterClientID): ?>
|
|
|
|
$.getJSON("/auth/twitter", function(data){ |
|
|
|
// Check if we're already authorized with twitter
|
|
|
|
if(data && data.result == 'ok') { |
|
|
|
$("#twitter-button").val("Connected").addClass("btn-success"); |
|
|
|
} else if(data && data.url) { |
|
|
|
$("#twitter-button").val("Sign In").data("url", data.url).addClass("btn-warning"); |
|
|
|
} else { |
|
|
|
$("#twitter-button").val("Error").addClass("btn-danger"); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$("#twitter-button").click(function(){ |
|
|
|
if($(this).data('url')) { |
|
|
|
window.location = $(this).data('url'); |
|
|
|
} else { |
|
|
|
$.getJSON("/auth/twitter", {login: 1}, function(data){ |
|
|
|
window.location = data.url; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
$("#send-html-content").click(function(){ |
|
|
|
var enabled = $(this).attr("checked") == "checked"; |
|
|
|
$.post("/settings/save", { |
|
|
|
html_content: (enabled ? 1 : 0) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
$("#save-slug-field").click(function(){ |
|
|
|
$.post("/settings/save", { |
|
|
|
slug_field: $("#slug-field-name").val() |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
$("#save-syndicate-to-field").click(function(){ |
|
|
|
$.post("/settings/save", { |
|
|
|
syndicate_field: $("#syndicate-to-field-name").val() |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
$("#reset-login").click(function(){ |
|
|
|
$.post("/auth/reset", function(){ |
|
|
|
window.location = "/"; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
<?= partial('partials/syndication-js') ?>
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |