can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21766: LJSUP-11651: Add release number into par...

Committer: dpetrov
LJSUP-11651: Add release number into param of version for RTE static files
U   trunk/htdocs/js/basic.js
U   trunk/htdocs/tools/ck_poll_questions.bml
U   trunk/htdocs/tools/ck_poll_setup.bml
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-04-20 11:21:52 UTC (rev 21765)
+++ trunk/htdocs/js/basic.js	2012-04-20 11:23:01 UTC (rev 21766)
@@ -238,7 +238,69 @@
 	}
 };
 
+LJ.console = function() {
+	var consoleExists = function() { return 'console' in window },
+		runIfExists = function(method, args) {
+			if (consoleExists() && console[method]) {
+				console[method].apply(console, args);
+				return true;
+			}
 
+			return false;
+		};
+
+	var consoleShim = {
+		log: function() {
+			if (jQuery.browser.msie && consoleExists()) {
+				console.log( [].join.apply(arguments) );
+			} else {
+				runIfExists('log', arguments);
+			}
+		}
+	};
+
+	var timers = {};
+	consoleShim.time = function(label) {
+		if (!runIfExists('time', arguments) && !timers[label]) {
+			timers[label] = +new Date();
+		}
+	}
+
+	consoleShim.timeEnd = function(label) {
+		if (!runIfExists('timeEnd', arguments) && timers[label]) {
+			var now = +new Date();
+			consoleShim.log(label + ': ' + (now - timers[label]) + 'ms');
+			delete timers[label];
+		}
+	}
+
+	return consoleShim;
+}();
+
+LJ.DOM = LJ.DOM || {};
+
+
+/**
+ * Inject stylesheet into page.
+ *
+ * @param {string} Stylesheet filename to inject.
+ * @param {global} Global object.
+ */
+LJ.DOM.injectStyle = function(fileName, _window) {
+	var w = _window || window,
+		head = w.document.getElementsByTagName("head")[0],
+		cssNode = w.document.createElement('link');
+	
+	cssNode.type = 'text/css';
+	cssNode.rel = 'stylesheet';
+	cssNode.href = fileName;
+	
+	head.appendChild(cssNode);
+
+	//console.log(fileName + ' injected from ' + w.location.href);
+};
+
+
 /* object extensions */
 if (!Object.extend)
 	Object.extend = function (d, s){

Modified: trunk/htdocs/tools/ck_poll_questions.bml
===================================================================
--- trunk/htdocs/tools/ck_poll_questions.bml	2012-04-20 11:21:52 UTC (rev 21765)
+++ trunk/htdocs/tools/ck_poll_questions.bml	2012-04-20 11:23:01 UTC (rev 21766)
@@ -4,7 +4,7 @@
 	<title>LiveJournal Poll Questions</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 	<meta content="noindex, nofollow" name="robots">
-	<link rel="stylesheet" type="text/css" href="<?statprefix?>/js/ck/skins/v2/dialog.css" media="all">
+	<!--<link rel="stylesheet" type="text/css" href="<?statprefix?>/js/ck/skins/v2/dialog.css" media="all">-->
 	<script src="<?_code $LJ::STATPREFIX _code?>/stc/fck/editor/dialog/common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 		//Standard setup stuff (notice the command name used in the property names)//var oEditor = window.parent.InnerDialogLoaded();
@@ -43,6 +43,8 @@
 			}
 
 			updateQuestionNav();
+
+			top.LJ.DOM.injectStyle('<?statprefix?>/js/ck/skins/v2/dialog.css?t=' + (top.Site ? top.Site.version : ''), window);
 		};
 
 		function insertQandA(add_answers, switch_answers, q_num, poll){

Modified: trunk/htdocs/tools/ck_poll_setup.bml
===================================================================
--- trunk/htdocs/tools/ck_poll_setup.bml	2012-04-20 11:21:52 UTC (rev 21765)
+++ trunk/htdocs/tools/ck_poll_setup.bml	2012-04-20 11:23:01 UTC (rev 21766)
@@ -6,12 +6,14 @@
 	<meta content="noindex, nofollow" name="robots">
 	<script type="text/javascript">
 		window.ready = function(poll){
+			top.LJ.DOM.injectStyle('<?statprefix?>/js/ck/skins/v2/dialog.css?t=' + (top.Site ? top.Site.version : ''), window);
+
 			top.jQuery(document.poll.whovote).val([poll.whovote]);
 			top.jQuery(document.poll.whoview).val([poll.whoview]);
 			document.poll.name.value = poll.name;
 		};
 	</script>
-	<link rel="stylesheet" type="text/css" href="<?statprefix?>/js/ck/skins/v2/dialog.css" media="all">
+	<!--<link rel="stylesheet" type="text/css" href="<?statprefix?>/js/ck/skins/v2/dialog.css" media="all">-->
 </head>
 
 <body style="overflow: hidden">

Tags: bml, can3p, dpetrov, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments