Added Bing verifying file

This commit is contained in:
benweet 2013-05-18 14:40:16 +01:00
parent 5b4ceb7462
commit c91a80ace6
5 changed files with 57 additions and 47 deletions

4
BingSiteAuth.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<users>
<user>5E47EE6F67B069C17E3CDD418351A612</user>
</users>

View File

@ -75,7 +75,7 @@
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="viewer.html" title="Viewer"><i <li><a href="viewer.html" title="Viewer"><i
class="icon-fullscreen"></i> Open in viewer</a></li> class="icon-fullscreen"></i> Open viewer</a></li>
<li><a class="action-download-md" href="#"><i <li><a class="action-download-md" href="#"><i
class="icon-download-alt"></i> Save as Markdown</a></li> class="icon-download-alt"></i> Save as Markdown</a></li>
<li><a class="action-download-html" href="#"><i <li><a class="action-download-html" href="#"><i
@ -111,7 +111,7 @@
</ul></li> </ul></li>
<li><a href="#" data-toggle="modal" <li><a href="#" data-toggle="modal"
data-target="#modal-manage-publish" class="action-reset-input"><i data-target="#modal-manage-publish" class="action-reset-input"><i
class="icon-share"></i> Manage publishing</a></li> class="icon-share"></i> Manage publication</a></li>
<li class="divider"></li> <li class="divider"></li>
<li><a href="#" data-toggle="modal" <li><a href="#" data-toggle="modal"
data-target="#modal-settings" class="action-load-settings"><i data-target="#modal-settings" class="action-load-settings"><i
@ -363,7 +363,8 @@
</div> </div>
</div> </div>
<div class="control-group modal-publish-wordpress"> <div class="control-group modal-publish-wordpress">
<label class="control-label" for="input-publish-tumblr-hostname">WordPress site</label> <label class="control-label" for="input-publish-tumblr-hostname">WordPress
site</label>
<div class="controls"> <div class="controls">
<input type="text" id="input-publish-wordpress-site" <input type="text" id="input-publish-wordpress-site"
placeholder="exemple.wordpress.com"> placeholder="exemple.wordpress.com">
@ -385,7 +386,8 @@
placeholder="Label1, Label2"> placeholder="Label1, Label2">
</div> </div>
</div> </div>
<div class="control-group modal-publish-tumblr modal-publish-wordpress"> <div
class="control-group modal-publish-tumblr modal-publish-wordpress">
<label class="control-label" for="input-publish-tags">Tags <label class="control-label" for="input-publish-tags">Tags
(comma separated)</label> (comma separated)</label>
<div class="controls"> <div class="controls">
@ -451,7 +453,7 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" <button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button> aria-hidden="true">&times;</button>
<h3>Publishing</h3> <h3>Publication</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p class="msg-publish-list hide">"<span class="file-title"></span>" <p class="msg-publish-list hide">"<span class="file-title"></span>"
@ -714,7 +716,7 @@
<div id="modal-app-reset" class="modal hide"> <div id="modal-app-reset" class="modal hide">
<div class="modal-header"> <div class="modal-header">
<h3>Application reset</h3> <h3>Reset application</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>This will delete all your local documents.</p> <p>This will delete all your local documents.</p>

View File

@ -44,7 +44,7 @@ define([ "core", "underscore" ], function(core) {
}; };
/** /**
* chain() calls the next onRun callback or the onSuccess callbacks when * chain() calls the next onRun callback or the onSuccess callbacks when
* finished. The optional callback parameter can be used to add a onRun * finished. The optional callback parameter can be used to pass an onRun
* callback during execution. * callback during execution.
*/ */
task.chain = function(callback) { task.chain = function(callback) {
@ -72,7 +72,7 @@ define([ "core", "underscore" ], function(core) {
runCallback(); runCallback();
}; };
/** /**
* error() calls the onError callbacks with the error parameter and ends * error() calls the onError callbacks passing the error parameter and ends
* the task by throwing an exception. * the task by throwing an exception.
*/ */
task.error = function(error) { task.error = function(error) {
@ -110,7 +110,9 @@ define([ "core", "underscore" ], function(core) {
}; };
// Run the next task in the queue if any and no other running // Run the next task in the queue if any and no other running
function runTask() { asyncRunner.runTask = function() {
// Use defer to avoid stack overflow
_.defer(function() {
// If there is a task currently running // If there is a task currently running
if (currentTaskRunning === true) { if (currentTaskRunning === true) {
@ -138,11 +140,7 @@ define([ "core", "underscore" ], function(core) {
currentTaskRunning = true; currentTaskRunning = true;
currentTask.chain(); currentTask.chain();
} }
} });
asyncRunner.runTask = function() {
// Use defer to avoid stack overflow
_.defer(runTask);
}; };
// Run runTask function periodically // Run runTask function periodically
core.addPeriodicCallback(asyncRunner.runTask); core.addPeriodicCallback(asyncRunner.runTask);

View File

@ -5,14 +5,14 @@ define(
var core = {}; var core = {};
// Usage: callback = callback || core.doNothing; // For convenience
core.doNothing = function() {}; core.doNothing = function() {};
// Time shared by others modules // Time shared by others modules
core.currentTime = new Date().getTime();
function updateCurrentTime() { function updateCurrentTime() {
core.currentTime = new Date().getTime(); core.currentTime = new Date().getTime();
} }
updateCurrentTime();
// Used for periodic tasks // Used for periodic tasks
var intervalId = undefined; var intervalId = undefined;

View File

@ -52,6 +52,7 @@ define(["jquery", "core", "synchronizer", "publisher", "sharing", "text!../WELCO
fileIndex = fileManager.getCurrentFileIndex(); fileIndex = fileManager.getCurrentFileIndex();
$("#wmd-input").val(localStorage[fileIndex + ".content"]); $("#wmd-input").val(localStorage[fileIndex + ".content"]);
core.createEditor(function() { core.createEditor(function() {
// Callback to save content when textarea changes
fileManager.saveFile(); fileManager.saveFile();
}); });
}; };
@ -81,11 +82,14 @@ define(["jquery", "core", "synchronizer", "publisher", "sharing", "text!../WELCO
// Create the file in the localStorage // Create the file in the localStorage
localStorage[fileIndex + ".content"] = content; localStorage[fileIndex + ".content"] = content;
localStorage[fileIndex + ".title"] = title; localStorage[fileIndex + ".title"] = title;
// Store syncIndexes associated to the file
var sync = _.reduce(syncIndexes, function(sync, syncIndex) { var sync = _.reduce(syncIndexes, function(sync, syncIndex) {
return sync + syncIndex + ";"; return sync + syncIndex + ";";
}, ";"); }, ";");
localStorage[fileIndex + ".sync"] = sync; localStorage[fileIndex + ".sync"] = sync;
// Store publishIndexes associated to the file
localStorage[fileIndex + ".publish"] = ";"; localStorage[fileIndex + ".publish"] = ";";
// Add the index to the file list
if(!isTemporary) { if(!isTemporary) {
localStorage["file.list"] += fileIndex + ";"; localStorage["file.list"] += fileIndex + ";";
} }
@ -104,21 +108,23 @@ define(["jquery", "core", "synchronizer", "publisher", "sharing", "text!../WELCO
_.each(syncIndexList, function(syncIndex) { _.each(syncIndexList, function(syncIndex) {
fileManager.removeSync(syncIndex); fileManager.removeSync(syncIndex);
}); });
localStorage.removeItem(fileIndex + ".sync");
// Remove publish locations // Remove publish locations
var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";")); var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";"));
_.each(publishIndexList, function(publishIndex) { _.each(publishIndexList, function(publishIndex) {
fileManager.removePublish(publishIndex); fileManager.removePublish(publishIndex);
}); });
localStorage.removeItem(fileIndex + ".publish");
// Remove the index from the file list
localStorage["file.list"] = localStorage["file.list"].replace(";" localStorage["file.list"] = localStorage["file.list"].replace(";"
+ fileIndex + ";", ";"); + fileIndex + ";", ";");
localStorage.removeItem(fileIndex + ".title"); localStorage.removeItem(fileIndex + ".title");
localStorage.removeItem(fileIndex + ".content"); localStorage.removeItem(fileIndex + ".content");
localStorage.removeItem(fileIndex + ".sync");
localStorage.removeItem(fileIndex + ".publish");
}; };
// Save current file in localStorage
fileManager.saveFile = function() { fileManager.saveFile = function() {
var content = $("#wmd-input").val(); var content = $("#wmd-input").val();
var fileIndex = fileManager.getCurrentFileIndex(); var fileIndex = fileManager.getCurrentFileIndex();