Browse files

Merge pull request #82 from mobify/remove-studio

Remove deprecated StudioJS logic.
  • Loading branch information...
2 parents ab951f8 + d955615 commit 32ca37363c55941bae58f03b5ea3fbb0a1c71bbf @johnboxall johnboxall committed Jan 8, 2013
Showing with 2 additions and 62 deletions.
  1. +0 −58 api/studioJS.js
  2. +2 −3 konf/base.konf
  3. +0 −1 tests/index.html
View
58 api/studioJS.js
@@ -1,58 +0,0 @@
-(function($, Mobify) {
-
-if (!window.enableStudioJS) return;
-
-var _tagIndex = 0;
-var indexTags = function(html) {
- var tagIndex = /<![\s\S]*?>|[^<]+|<!--[\s\S]*?-->|(<script)([\s\S]*?<\/script>)|(<\w+)((?:[^>'"]*|'[^']*?'|"[^"]*?")*\/?>)/gi
- , result = html.replace(tagIndex, function(all, scriptName, scriptTail, name, tail) {
- name = name || scriptName;
- tail = tail || scriptTail;
- if (!name) return all;
- return name + ' mobifyjsindex="src' + tagIndex++ + '"' + tail;
- });
- return result;
-};
-
-var get = function(key, callback) {
- var handler = function(ev) {
- if ((ev.data.command === 'html')
- && (ev.data.dest === 'page')
- && (ev.data.key === key)
- && (ev.source === window)) {
- window.removeEventListener("message", handler, false);
- callback(ev.data.value, ev.data.key);
- }
- }
- window.addEventListener("message", handler, false);
-};
-
-var set = function(key, value) {
- window.postMessage({
- dest : 'extension',
- command : 'html',
- key: key,
- value: value
- }, '*');
-};
-
-var oldEmitMarkup = Mobify.emitMarkup;
-Mobify.emitMarkup = function(markup) {
- Mobify.studioJS.get('renderHTML', function(markup) {
- oldEmitMarkup(markup);
- });
- Mobify.studioJS.set('resultHTML', markup);
-};
-
-var oldExtractHTML = Mobify.html.extractHTML;
-Mobify.html.extractHTML = function() {
- var captured = oldExtractHTML(markup);
- $.each(captured, function(key, value) {
- captured[key] = indexTags(value);
- });
-
- Mobify.studioJS.set('sourceHTML', captured.all());
- return result;
-};
-
-})(Mobify.$, Mobify);
View
5 konf/base.konf
@@ -41,7 +41,6 @@
{>"/base/api/stack.js"/}
{>"/base/api/cont.js"/}
{>"/base/api/tmpl.js"/}
- {>"/base/api/studioJS.js"/}
{/dust}
{>"/base/konf/build_config.konf"/}
@@ -65,10 +64,10 @@
{+main}
Mobify.transform.run({+rawconf}function() {
- var $ = this.$, M = this;
+ var $ = this.$, M = this;
return { data: $.extend(
{>"/base/konf/defaults.konf"/},
- {+konf}
+ {+konf}
{! Use konf for plain JS configs, and data for legacy kaffeine ones. !}
{#kaffeine}
{+data}{/data}
View
1 tests/index.html
@@ -47,7 +47,6 @@ <h2 id="qunit-userAgent"></h2>
<script src="../api/stack.js"></script>
<script src="../api/cont.js"></script>
<script src="../api/tmpl.js"></script>
- <script src="../api/studioJS.js"></script>
<script src="../api/config.js"></script>
<script src="../api/orientation.js"></script>

0 comments on commit 32ca373

Please sign in to comment.