Created
January 6, 2015 20:49
-
-
Save selfdeceited/3175a44a9f5c87cd4881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.runSpritz = function () { | |
if ($scope.spritzIsActivated) return; | |
var spritzController = null; | |
var onSpritzifySuccess = function (spritzText) { | |
spritzController.startSpritzing(spritzText); | |
}; | |
var onSpritzifyError = function (error) { | |
alert("Unable to Spritz: " + error.message); | |
}; | |
function onStartSpritzClick(event) { | |
var alphabetData = $scope.alphabet.map(function (value) { | |
return value[$scope.outputLang]; | |
}) | |
alphabetData = alphabetData.join(" ") | |
alphabetData = alphabetData.replace(/\ \;/g, " ") | |
.replace(/\<b\>/g, "") | |
.replace(/\<\/b\>/g, "") | |
.replace(/[^a-zа-я0-9 ]/gi, ""); | |
SpritzClient.spritzify(alphabetData.trim(), "ru", onSpritzifySuccess, onSpritzifyError) | |
}; | |
spritzController = new SPRITZ.spritzinc.SpritzerController({ | |
placeholderText: { startText: 'Let\'s Start!' }, | |
redicleWidth: 600, | |
redicleHeight: 100, | |
controlTitles: { | |
play: "Play", | |
rewind: "To Beginning", | |
back: "Previous", | |
forward: "Next" | |
} | |
}); | |
spritzController.attach($("#spritzer")); | |
$scope.spritzIsActivated = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment